/* 集中した分だけ育つ水辺（/shuchu-mizube/）。日英共通。
   上に水辺の絵（2D canvas）、下に細い輪のタイマーとボタン1つ（15分・50分は『時間を変える』の中）。色は切り紙の5色（紙・水・葦・朱・墨）だけ。
   グラデーション・影・発光は使わない。 */
[hidden] { display: none !important; }
.mz { --mz-paper: #F4EFE4; --mz-water: #5E8F96; --mz-reed: #6F7F4A; --mz-red: #C4583A; --mz-ink: #2E3A3C;
  --mz-soft: #66706f; --mz-line: #d9d4c8;
  background: var(--mz-paper); color: var(--mz-ink); margin-bottom: 8px; }
.mz-stage { position: relative; line-height: 0; }
.mz-stage canvas { display: block; width: 100%; height: auto; aspect-ratio: 1000 / 760; }
.mz-tag { position: absolute; left: 10px; top: 10px; line-height: 1; padding: 5px 9px 6px; font-size: 13px; font-weight: 700;
  letter-spacing: .08em; background: var(--mz-ink); color: var(--mz-paper); }
/* 記録の知らせ: 絵に重なって見える墨の帯をやめ、絵の上に罫線で区切った紙の欄として置く（次にすることのボタンつき） */
.mz-stage, .mz { scroll-margin-top: 64px; }
.mz-err { margin: 0; padding: 12px 16px 8px; font-size: 14px; line-height: 1.65; color: var(--mz-ink);
  border-left: 3px solid var(--mz-red); border-bottom: 1px solid var(--mz-line); }
.mz-err-msg { margin: 0; }
.mz-err-msg span { display: block; }
.mz-err-msg span + span { margin-top: 6px; }
.mz-err-acts { margin: 6px 0 0; display: flex; flex-wrap: wrap; gap: 4px 16px; }
.mz-err-acts button { border: 0; background: none; padding: 0; min-height: 40px; font: inherit; font-size: 14px; font-weight: 700;
  color: var(--mz-ink); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.mz-err-acts button:focus-visible { outline: 2px solid var(--mz-ink); outline-offset: 3px; }
.mz-panel { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 14px 16px 16px; text-align: center; }
.mz-ringwrap { position: relative; width: 112px; height: 112px; }
.mz-ring { width: 100%; height: 100%; transform: rotate(-90deg); display: block; }
/* 線の太さは画面で 1.6px・2.2px。vector-effect: non-scaling-stroke を使うと Chromium で pathLength が効かず、
   輪が大きいほど 25:00 でも弧が途中で切れていた（196px で半周）。太さは app.js が輪の幅から --mz-k（100÷幅）を入れて保つ */
.mz-ring circle { fill: none; stroke-width: calc(1.6px * var(--mz-k, 1)); }
.mz-track { stroke: var(--mz-line); }
.mz-arc { stroke: var(--mz-ink); stroke-width: calc(2.2px * var(--mz-k, 1)); transition: stroke-dashoffset 250ms linear; }
.mz-time { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 26px; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.mz-stat { margin: 0; font-size: 14px; color: var(--mz-soft); font-variant-numeric: tabular-nums; }

.mz-result { padding: 4px 0 2px; }
.mz-got { margin: 0; font-size: 22px; font-weight: 700; line-height: 1.4; }
.mz-today { margin: 4px 0 0; font-size: 17px; font-variant-numeric: tabular-nums; }

.mz-btn { width: 100%; max-width: 340px; min-height: 54px; border: 0; cursor: pointer; font: inherit; font-size: 18px; font-weight: 700;
  letter-spacing: .04em; border-radius: 4px; }
.mz-go { background: var(--mz-red); color: #fff; }
.mz-go:hover { background: #b04c30; }
.mz-sub { background: transparent; color: var(--mz-ink); border: 1.5px solid var(--mz-ink); }
.mz-sub:hover { background: #ebe5d7; }
.mz-btn:focus-visible, .mz-link:focus-visible, .mz-lens button:focus-visible, .mz-len summary:focus-visible, .mz-testlink:focus-visible { outline: 2px solid var(--mz-ink); outline-offset: 3px; }
.mz-link { border: 0; background: none; color: var(--mz-ink); font: inherit; font-size: 15px; text-decoration: underline; text-underline-offset: 3px;
  min-height: 44px; padding: 0 12px; cursor: pointer; }

.mz-len { width: 100%; max-width: 340px; font-size: 15px; }
.mz-len summary { min-height: 44px; display: flex; align-items: center; justify-content: center; cursor: pointer; list-style: none;
  color: var(--mz-ink); text-decoration: underline; text-underline-offset: 3px; }
.mz-len summary::-webkit-details-marker { display: none; }
.mz-len summary::after { content: " ▾"; font-size: 11px; margin-left: 4px; text-decoration: none; }
.mz-len[open] summary::after { content: " ▴"; }
.mz-lens { display: flex; justify-content: center; gap: 8px; padding: 4px 0 2px; }
.mz-lens button { min-width: 76px; min-height: 44px; padding: 0 10px; font: inherit; font-size: 16px; color: var(--mz-ink); background: transparent;
  border: 1px solid var(--mz-line); border-radius: 4px; cursor: pointer; font-variant-numeric: tabular-nums; }
.mz-lens button[aria-pressed="true"] { border-color: var(--mz-ink); font-weight: 700; }
.mz-testlink { border: 0; background: none; padding: 0 2px; font: inherit; color: inherit; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.mz-msg { margin: 0; min-height: 0; font-size: 14px; line-height: 1.6; color: var(--mz-ink); }
.mz-msg:empty { display: none; }
.mz-test { margin: 0; font-size: 12px; line-height: 1.5; color: var(--mz-soft); text-align: left; width: 100%; max-width: 420px;
  font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.mz-test span { display: block; }

/* 今週の7日（月曜の空の水面からの前後） */
.mz-week { border-top: 1px solid var(--mz-line); padding: 12px 16px 16px; }
.mz-week-h { margin: 0 0 8px; font-size: 13px; color: var(--mz-soft); text-align: center; }
.mz-week-row { list-style: none; margin: 0 auto; padding: 0; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); max-width: 420px; }
.mz-week-row li { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 12px; color: var(--mz-soft); padding: 0; margin: 0; }
.mz-week-row b { font-size: 18px; font-weight: 500; font-variant-numeric: tabular-nums; }
.mz-week-row li.is-today { color: var(--mz-ink); }
.mz-week-row li.is-today b { font-weight: 700; border-bottom: 2px solid var(--mz-ink); }

/* 保存したカード（保存したのと同じ PNG を小さく見せる） */
.mz-card { margin: 4px 0 0; }
.mz-card img { display: block; width: 180px; height: auto; margin: 0 auto; border: 1px solid var(--mz-line); }
.mz-card figcaption { margin-top: 6px; font-size: 13px; color: var(--mz-soft); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }

/* 確かめ用の記録（確かめ用のときだけ app.js が足す） */
.mz-qa { grid-area: qa; text-align: left; font-size: 12px; line-height: 1.55; color: var(--mz-ink);
  border-top: 1px dashed var(--mz-soft); padding: 8px 16px 6px; font-variant-numeric: tabular-nums; }
.mz-qa p { margin: 0 0 4px; overflow-wrap: anywhere; }
.mz-qa p:empty { display: none; }
.mz-qa-h { font-weight: 700; }
.mz-qa-links { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.mz-qa-btn { border: 0; background: none; padding: 0; font: inherit; color: var(--mz-ink); text-decoration: underline; min-height: 32px; cursor: pointer; }
.mz-qa-net { border-left: 2px solid var(--mz-line); padding-left: 8px; margin: 0 0 4px; }

/* 見出しの改行: 「勉強タイマー」は分けない（375px で長音だけが2行目に残っていた） */
.mz-nw { display: inline-block; }

/* このページの見出し: サイト共通の小さな英字風（朱の横線＋灰色の小文字）ではなく、和文の見出しとして墨で置く */
.tool:has(.mz) .section > h2 { font-family: inherit; font-size: 17px; font-weight: 700; letter-spacing: .02em; color: var(--mz-ink, #2E3A3C);
  text-transform: none; margin-bottom: 14px; }
.tool:has(.mz) .section > h2::before { display: none; }

/* 手順: 同じ箱を3つ並べず、岸の線1本の上に、それぞれの見え方（残り時間・増えたもの・カードの大きさ）を置く */
ol.steps.mz-steps { border: 0; border-top: 1px solid #2E3A3C; background: none; gap: 28px; grid-template-columns: 1fr 1.15fr 1fr; }
ol.steps.mz-steps li { padding: 14px 0 0; border: 0; color: var(--ink-soft, #4b5563); font-size: 14px; }
ol.steps.mz-steps li::before { display: none; }
ol.steps.mz-steps b { font-size: 15px; margin-bottom: 4px; }
.mz-steps .mz-ex { display: flex; align-items: flex-end; height: 64px; margin-bottom: 10px; color: #2E3A3C; font-variant-numeric: tabular-nums; }
.mz-steps li:nth-child(1) .mz-ex { font-size: 34px; font-weight: 600; letter-spacing: .02em; line-height: 1; }
.mz-steps li:nth-child(2) .mz-ex { font-size: 22px; font-weight: 700; color: #C4583A; line-height: 1.2; }
.mz-steps li:nth-child(3) .mz-ex { font-size: 26px; font-weight: 600; letter-spacing: .02em; line-height: 1.1; color: #5E8F96; }

/* 共有欄（share.js の部品）: 角丸の箱と丸いボタンをやめ、罫線1本とこのページのボタンの形に合わせる */
.tool:has(.mz) .ch-share { border: 0; border-top: 1px solid var(--hairline, #e5e7eb); border-radius: 0; background: none; padding: 28px 0 32px; margin: 0; }
.tool:has(.mz) .ch-share-h { font-size: 17px; }
.tool:has(.mz) .ch-share-btn { border-radius: 4px; border-color: #2E3A3C; color: #2E3A3C; }

/* 広い画面: 絵の右にタイマーとボタンを置き、最初の画面に両方が入るようにする
   （768px でも縦に積むと絵が幅いっぱいに大きくなり、輪とボタンが最初の画面の外に出ていたので 700px から横に並べる） */
@media (min-width: 700px) {
  .mz { display: grid; grid-template-columns: minmax(0, 1fr) 270px; grid-template-areas: "err err" "stage panel" "week week"; }
  .mz-stage { grid-area: stage; align-self: center; }
  .mz-err { grid-area: err; }
  .mz-panel { grid-area: panel; justify-content: center; padding: 20px 20px; }
  .mz-ringwrap { width: 132px; height: 132px; }
  .mz-time { font-size: 30px; }
  .mz[data-state="run"] .mz-ringwrap { width: 200px; height: 200px; }
  .mz[data-state="run"] .mz-time { font-size: 52px; }
  .mz-week { grid-area: week; }
  .mz:has(.mz-qa) { grid-template-areas: "err err" "stage panel" "week week" "qa qa"; }
}
/* PC: 残り時間を離れた所からも読めるよう輪を大きくする。計測中は
   右のタイマーの列を絵より広げ、輪を直径約330px・数字92px にして画面の主役にする（絵は左で小さくなる） */
@media (min-width: 1000px) {
  .mz { grid-template-columns: minmax(0, 1fr) 330px; }
  .mz-ringwrap { width: 196px; height: 196px; }
  .mz-time { font-size: 50px; }
  .mz[data-state="run"] { grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr); }
  .mz[data-state="run"] .mz-ringwrap { width: min(330px, 100%); height: auto; aspect-ratio: 1; }
  .mz[data-state="run"] .mz-time { font-size: 92px; letter-spacing: 0; }
}
/* スマホ: 水辺を画面の端まで広げ、最初の画面に絵とボタンが入るよう見出しまわりを詰める */
@media (max-width: 640px) {
  .mz { margin-left: -24px; margin-right: -24px; }
  .tool:has(.mz) .crumb { margin-bottom: 4px; }
  .tool:has(.mz) h1 { font-size: 20px; line-height: 1.4; margin: 0 0 4px; }
  .tool:has(.mz) .lede { font-size: 14px; line-height: 1.6; margin-bottom: 10px; }
  .mz { margin-bottom: 32px; }
  .mz-panel { padding: 16px 12px 24px; gap: 10px; }
  /* はじめる前: 上に水辺の絵を幅いっぱいで大きく見せ（最初の2秒の見せ場）、下に輪とボタン1つ。
     輪は直径152px・数字38px（108px・22px では残り時間が絵の下の小さな飾りに見えていた）。390×844 でボタンと『時間を変える』まで最初の画面に入る */
  .mz-ringwrap { width: 152px; height: 152px; }
  .mz-time { font-size: 38px; letter-spacing: 0; }
  /* 計測中と『やめる』の直後: 水辺は上の細い帯（水面と増えたものの段）に縮め、残り時間の輪を直径216px・数字56px にする。
     机に置いて少し離れても読める大きさ。やめた後も同じ並びのまま（絵は変わらないので大きく戻さない）。
     終わったら絵を元の大きさに戻して増えたものを見せる */
  .mz[data-state="run"] .mz-stage canvas, .mz[data-stopped] .mz-stage canvas { aspect-ratio: auto; height: 120px; object-fit: cover; object-position: 50% 50%; }
  .mz[data-state="run"] .mz-ringwrap, .mz[data-stopped] .mz-ringwrap { width: 216px; height: 216px; }
  .mz[data-state="run"] .mz-time, .mz[data-stopped] .mz-time { font-size: 56px; }
  ol.steps.mz-steps { grid-template-columns: 1fr; gap: 0; }
  ol.steps.mz-steps li { display: grid; grid-template-columns: 110px minmax(0, 1fr); column-gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--hairline, #e5e7eb); }
  ol.steps.mz-steps li + li { border-top: 0; }
  ol.steps.mz-steps .mz-ex { grid-row: 1 / span 2; margin: 0; height: auto; align-self: start; }
  .mz-steps li:nth-child(1) .mz-ex { font-size: 26px; }
  .mz-steps li:nth-child(2) .mz-ex, .mz-steps li:nth-child(3) .mz-ex { font-size: 15px; white-space: nowrap; }
}
@media (max-width: 560px) { .mz { margin-left: -18px; margin-right: -18px; } }
@media (prefers-reduced-motion: reduce) { .mz-arc { transition: none; } }
