/* ==================================================================
   まるごと 1日1文 — Mio テーマ（2026-10）
   既存の <style> の「後」に 読み込む。既存の 変数を 上書きし、
   キャラ（白・ペリウィンクル・コバルト・金）に 合わせて 見た目だけ 変える。
   DOM の id・ロジックには 触れない。
   ================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Zen+Maru+Gothic:wght@400;500;700&family=Shippori+Mincho+B1:wght@600;800&display=swap');

:root{
  --paper:#f5f6fc;  --panel:#ffffff;
  --ink:#1e2350;    --ink2:#4b5287;  --dim:#5f6694;  --line:#e1e4f4;
  --accent:#2c47b5; --accent-hi:#8e9ce6; --accent-deep:#1f3590;
  --accent-soft:#e8ebfb; --accent-line:#cdd4f4; --accent-ink:#ffffff;
  --sun:#e2ac2f; --sun-soft:#fdf4dc; --sun-ink:#7d5a0a;
  --clay:#a3354d; --clay-soft:#fcebef; --clay-line:#e7879b;
  --radius:26px; --radius-sm:20px;
  /* モックの 枠（390×844）の **高さ**。#app{height:min(100dvh,844px)} と 同じ 値。
     セッション画面の 縦の 位置は この 枠の % で 決める（下の #screen-session を 見よ）。 */
  --mio-frame-h:844px;
  --shadow:0 4px 14px -10px rgba(30,35,80,.3);
  --shadow-lift:0 10px 30px -14px rgba(30,35,80,.25);
  --font:"Zen Maru Gothic","Hiragino Maru Gothic ProN","Hiragino Sans","Noto Sans JP",system-ui,sans-serif;
  --font-de:"Zen Maru Gothic",system-ui,-apple-system,sans-serif;
  --font-title:"Shippori Mincho B1","Hiragino Mincho ProN",serif;
}
body{background:var(--paper) radial-gradient(120% 60% at 50% 12%,#e3e7fb 0%,rgba(227,231,251,0) 62%) no-repeat fixed}
/* ★ ボタン・入力欄は font-family を **継承しない**（ブラウザ既定 = Arial に なる）。
   アプリ側で font-family を 書いて いない ボタンが **22個** あり、周りの 文字
   （Zen Maru Gothic）と 混ざって いた。3つ並びの 「Über diese App」だけ 字が 違って
   見えた のが 気づいた きっかけ（2026-10-05 user 指摘「字のフォントそろえた方がいいのでは」）。
   まとめて そろえる。**個別の 指定（.top-link など）が あれば そちらが 勝つ**。 */
button, input, select, textarea { font-family: var(--font) }
#app{position:relative; z-index:1}                 /* Mio（z-index:0）より 前に */

/* ---------- 見出し ---------- */
.top-title,.cat-title,#parent-title,#info-title,.big{font-family:var(--font-title); font-weight:800; letter-spacing:.04em}
.wm-b{color:var(--accent)}
/* 題字の 下線。**モックには 下線が 無い**（mock/Marugoto Redesign.dc.html の
   <h1> は 30px ＋ 22px の 2語だけで、飾りは 付いて いない）。
   元アプリの 吹き出し飾り（丸い 下線 ＋ 右下の 角）は トップ画面の 節で 消して いる。 */

/* ---------- ボタン ---------- */
.top-main,#btn-next{border-radius:999px; font-family:var(--font)}
.top-main[disabled],#btn-next:not(.ready){background:#cfd5ef; box-shadow:0 4px 0 #b9c2e6}
.top-cat{background:var(--paper); border-color:var(--line); color:var(--ink); text-align:left; border-radius:20px}
.top-sub,.small-btn{border-radius:14px}
.play{border-radius:999px; border:0}
#btn-speak-de{background:var(--paper); color:var(--ink2)}
.ptab{border-radius:999px}

/* ---------- カード ---------- */
#card,#cat-card{border-radius:28px; border:1px solid var(--line); box-shadow:var(--shadow-lift)}
.quiz-choice{border-radius:18px}
.quiz-choice.is-correct{border-color:var(--sun); background:var(--sun-soft); color:var(--sun-ink)}
.cat-item,.stat-grid,.filter-block{border-radius:20px; border-width:1px}

/* ---------- 進み具合：ひし形（ブローチの宝石）---------- */
.prog-bar{justify-content:center; gap:8px; align-items:center}
.prog-bar i{flex:none; width:12px; height:12px; border-radius:3px; transform:rotate(45deg);
  background:#fff; border:2px solid var(--accent-line); box-sizing:border-box}
.prog-bar i.on{background:var(--accent); border-color:var(--accent)}
.prog-bar i.now{background:var(--accent-hi); border-color:var(--accent-hi)}

/* トップの「○ ● ●」も ひし形で（mio-layer.js が .mio-gems を描く） */
#top-dots{display:none}
.mio-gems{display:flex; gap:12px; justify-content:center; margin:2px 0}
.mio-gems i{width:13px; height:13px; transform:rotate(45deg); border-radius:3px; border:2px solid var(--accent); box-sizing:border-box; background:#fff}
.mio-gems i.on{background:var(--accent)}

/* ---------- 吹き出し ---------- */
.koto-say{border:1.5px solid var(--accent-line); border-radius:20px; box-shadow:0 6px 18px -8px rgba(44,71,181,.3)}
.koto-say::before{display:none}
.mio-say::after{content:"MIO"; position:absolute; top:-9px; left:14px; padding:0 6px; background:var(--panel);
  font-size:10px; font-weight:700; letter-spacing:.1em; color:var(--accent-hi)}
.mio-say.is-wrong{color:var(--clay)}
.mio-say--right{flex:1; font-size:18px; font-weight:700; line-height:1.4; border-radius:22px 22px 6px 22px}

/* ---------- Mio の 置き場所（中身は 空。<l2d-stage> が ここへ 合わせる）---------- */
.mio-slot{flex:none; pointer-events:none}
.mio-slot--full{width:100%; height:min(44vh,380px); margin:0 auto}
#screen-done .mio-slot--full,#screen-cat-done .mio-slot--full{height:min(46vh,420px)}

/* ---------- トップ画面：モック（390×844）の 実測値に 合わせる ----------
   モックは 390×844 の フレームに **絶対配置**で 組んである。アプリは 縦フローの
   レスポンシブなので、トップ画面だけ モックと 同じ 絶対配置に 組み替える。
   出典: mock/Marugoto Redesign.dc.html（data-screen-label="Top"）
   mio-layer.js が #koto-top と #koto-top-say を .mio-hero で、
   下部を .mio-sheet で 包んで いる。 */
#app{max-width:390px}                                  /* モックの フレーム幅に 合わせる */
/* PCなど 高い画面でも モックの 枠（390×844）を 保ち、縦に 伸ばさない。
   #app が 100dvh の ままだと 縦いっぱいに 伸び、下部シートが 画面の 一番下に
   行って モデルと 離れて しまう（2026-10-04 に user が PC で 指摘）。 */
body{display:flex; align-items:center; justify-content:center}
#app{height:min(100dvh, 844px); width:100%}
#screen-top{position:relative}
/* 元の .top-wrap は align-items:center なので、明示的に 打ち消す
   （打ち消さないと .mio-hero が 中身に 縮んで 幅0に なる） */
#screen-top .top-wrap{position:absolute; inset:0; display:flex; flex-direction:column;
  align-items:stretch; justify-content:flex-start}

/* 題字と タグライン（モック: top 54・98）。縦は dvh なので 画面が 低いと 一緒に 縮む */
#screen-top .top-title{
  position:absolute; left:0; right:0; top:6.4dvh; margin:0;
  display:flex; align-items:baseline; justify-content:center; gap:10px;
  font-size:30px; font-weight:800; letter-spacing:.06em; line-height:1.1; white-space:nowrap;
}
#screen-top .top-title .wm-b{font-size:22px}
#screen-top .top-title .wm-b::before,#screen-top .top-title .wm-b::after{display:none}
#screen-top .top-tagline{
  position:absolute; left:0; right:0; top:11.6dvh; margin:0; padding:0;
  text-align:center; font-size:13px; font-weight:400; color:#4b5287;
  letter-spacing:.02em; background:none; border-radius:0; white-space:nowrap;
}

/* モデル: 題字の 下から シートの 上までを **残り全部** 使う。
   画面が 低い スマホでは ここが 縮んで モデルも 小さく なる。
   シートに 脚が 隠れない（2026-10-04 に user が 「スカート下で 切れる」と 指摘）。 */
#screen-top .mio-hero{position:relative; flex:1 1 auto; min-height:0}
#screen-top .mio-slot--full{position:absolute; left:0; right:0; top:21.3dvh; bottom:0; width:auto; height:auto; margin:0}

/* 吹き出し（モック: left 14・top 204 = モデルの 上から 24px・max-width 136）
   モックでは 「MIO」が **吹き出しの 中**に 小さく 入って いる。order:-1 で 前に 出す。 */
#screen-top #koto-top-say{
  position:absolute; left:14px; top:24.2dvh; width:auto; max-width:136px;
  transform:none; margin:0; z-index:3; text-align:left;
  border-radius:20px 20px 20px 6px; padding:12px 14px;
  font-size:15px; line-height:1.55;
  display:flex; flex-direction:column; gap:2px;
}
#screen-top #koto-top-say::after{
  position:static; order:-1; padding:0; background:none;
  font-size:11px; font-weight:700; letter-spacing:.08em; color:#8e9ce6;
}

/* 下部シート（モック: height 316・radius 34 34 0 0）。高さは 中身で 決まる。
   画面が 低い ときは 余白・ボタンも dvh で 一緒に 縮む（下が 大きすぎない ように）。 */
#screen-top .mio-sheet{
  position:relative; flex:0 0 auto;
  background:#fff; border-radius:34px 34px 0 0;
  box-shadow:0 -10px 30px -12px rgba(44,71,181,.25);
  padding:1.7dvh 22px 3.6dvh; box-sizing:border-box;
  display:flex; flex-direction:column; gap:1.4dvh;
}
#screen-top .mio-sheet::before{                         /* モックの 点線の つまみ */
  content:""; flex:none; height:0.95dvh; min-height:5px; margin:0 30px;
  background-image:radial-gradient(circle,#c9d0f3 2px,transparent 2.6px);
  background-size:12px 8px; background-position:center;
}

/* 「Heutige Übung」の 行（モックは 横並びの 素の 行。元アプリは カードだったので 枠を 外す） */
#screen-top .top-today{display:grid; grid-template-columns:1fr auto auto; align-items:center; column-gap:12px; margin:0;
  background:none; border:0; padding:0; border-radius:0; box-shadow:none}
#screen-top .top-today .top-label{margin:0; font-size:14px; font-weight:700; color:#4b5287}
#screen-top .top-today .top-dots{display:none}
#screen-top .top-today .mio-gems{grid-column:2; margin:0}
#screen-top .top-today .top-count{grid-column:3; margin:0; min-width:34px; text-align:right; font-size:14px; color:#5f6694}
#screen-top .top-today .top-note{grid-column:1 / -1}

/* 主ボタン（モック: 高さ 58・18px・radius 999）。低い画面では dvh で 縮む */
#screen-top .top-main{height:6.9dvh; min-height:46px; padding:0; font-size:18px; font-weight:700; letter-spacing:.02em; border-radius:999px}

/* レッスン（モック: padding 12 18・radius 20・border 1.5 #dfe3f5・bg #f5f6fc） */
#screen-top .top-cat{padding:1.4dvh 18px; border-radius:20px; border:1.5px solid #dfe3f5; background:#f5f6fc}

/* 下の ボタン列（モック: flex1・高さ 44・radius 14・透明・14px 700）。
   モックに 但し書きは 無いので small は 出さない。法務リンクの 行も 外す。
   「Über diese App」だけ ボタン列へ 移して ある（行き先を 残す ため）。 */
#screen-top .top-secondary{gap:6px}
#screen-top .top-sub{height:5.2dvh; min-height:34px; padding:0 2px; border-radius:14px; background:transparent; border:0; color:#2c47b5; font-size:13px; font-weight:700; white-space:nowrap}
#screen-top .top-sub small{display:none}
#screen-top .top-links{display:none}
#screen-top .top-secondary .top-link{
  flex:1 1 0; height:5.2dvh; min-height:34px; padding:0 2px; border:0; border-radius:14px;
  background:transparent; color:#2c47b5; font-size:13px; font-weight:700; white-space:nowrap;
  display:flex; align-items:center; justify-content:center; text-decoration:none;
}
/* ★ 3つ並びの フォントを そろえる（2026-10-05 user 指摘「字のフォントそろえた方がいいのでは」）。
   アプリ側は .top-sub が --font（Segoe UI Variable **Text**）、.top-link だけが
   --font-de（Segoe UI Variable **Display**）を 指して いた。**同じ Segoe UI でも 別の 書体**
   なので、3つ目だけ 字が 違って 見えて いた。13px では Text が 正しい 光学サイズ なので、
   3つとも --font に そろえる。 */
#screen-top .top-sub,
#screen-top .top-secondary .top-link{font-family:var(--font)}

/* ---------- セッション画面：モック（390×844）の 実測値に 合わせる ----------
   出典: mock/Marugoto Redesign.dc.html（data-screen-label="Session"）
   上部バー top52・吹き出し left18 top128 幅176・モデル 186,150,204,250・
   カード top322 bottom112・下部 bottom30 */
/* ★ 2026-10-06: 縦の 位置は `min(Xdvh, 枠の X%)` で 書く（--mio-frame-h）。
   この 画面は #app の 中に あり、#app の 高さは `min(100dvh, 844px)` で **844px で 止まる**。
   さらに 大きい 画面では #app ごと `--mio-scale` で 拡大される だけなので、
   **枠の 中の 高さは どの 端末でも 844px 以下**（＝想定端末 390×844 と 同じ 条件）。
   `Xdvh` の ままに すると、viewport だけ 高い 端末で 上下の 余白が viewport の % で
   計算されて しまい、枠（844px）の 中で 余白が 食い合って カードが つぶれる。
   実測 952×1547: top 38.2dvh=590.95px / bottom 13.3dvh=205.75px となり、
   **カードの 高さが 844-590.95-205.75 = 47.3px**、中身 504px（はみ出し 459px）。
   選択肢は 3つとも 画面外（下端 1968.8px > viewport 1547px）に 出て いた。
   `min()` なので **viewport が 844px 以下（スマホ）では Xdvh ≦ 枠の X% となり、
   値は 今までと 1px も 変わらない**。 */
/* ★ display は 指定しない。`#screen-session{display:block}` と 書くと
   `.screen[hidden]{display:none}` に 勝ってしまい、隠して いる 画面が 常に 出る
   （2026-10-04 に 実際に やらかした）。 */
#screen-session{position:relative; padding:0}
#screen-session #topbar{position:absolute; left:18px; right:18px; top:min(6.2dvh, calc(var(--mio-frame-h) * 0.062)); height:40px; margin:0; padding:0;
  display:flex; align-items:center; gap:12px}
#screen-session .prog-bar{flex:1; display:flex; gap:6px; align-items:center; justify-content:center; margin:0}
#screen-session #progress{font-size:13px; color:#5f6694; min-width:38px; text-align:right; margin:0}

/* 吹き出しと 上半身。モックは 吹き出しが 左・モデルが 右で 重なって いる */
#screen-session #koto-session{position:absolute; inset:0; height:auto; min-height:0; margin:0; display:block; pointer-events:none}
/* ★ 安全装置（2026-10-05）: mio-theme の 「id 2つ」の display は、アプリの
   `#xxx[hidden]{display:none}`（id+属性）に **勝ってしまう**。実際に #quiz-choices で
   起きた（デモの選択肢が残って見えた）。同じ形の 3箇所を明示的に 塞ぐ。 */
#screen-session #koto-session[hidden]{display:none}
#screen-session #koto-session .mio-say--right{position:absolute; left:18px; top:min(15.2dvh, calc(var(--mio-frame-h) * 0.152)); width:176px; flex:none;
  border-radius:22px 22px 6px 22px; padding:14px 16px; font-size:19px; font-weight:700; line-height:1.35;
  display:flex; flex-direction:column; gap:4px}
/* モックは 「MIO」が 吹き出しの **中**に 小さく 入って いる（上に 飛び出さない） */
#screen-session #koto-session .mio-say--right::after{
  position:static; order:-1; padding:0; background:none;
  font-size:11px; font-weight:700; letter-spacing:.08em; color:#8e9ce6;
}
#screen-session #koto-session .mio-slot--bust{position:absolute; left:186px; top:min(17.8dvh, calc(var(--mio-frame-h) * 0.178)); width:204px; height:250px}

/* カード（モック: radius28・border1 #e1e4f4・padding22 20・中身は 中央寄せ gap14） */
#screen-session #card{position:absolute; left:16px; right:16px; top:min(38.2dvh, calc(var(--mio-frame-h) * 0.382)); bottom:min(13.3dvh, calc(var(--mio-frame-h) * 0.133)); margin:0;
  border-radius:28px; border:1px solid #e1e4f4; padding:22px 20px; overflow:auto;
  display:flex; flex-direction:column; justify-content:center; align-items:center; gap:14px; text-align:center}
#screen-session #instruction{font-size:13px; font-weight:700; color:#8e9ce6; margin:0}
#screen-session #main{font-size:28px; line-height:1.45; font-weight:700; color:#1e2350; margin:0; text-wrap:balance}
#screen-session #reading{font-size:14px; color:#5f6694; letter-spacing:.04em; margin:0}
#screen-session #sub{font-size:15px; color:#5f6694; line-height:1.5; margin:0}
#screen-session #main-row,#screen-session #sub-wrap{display:flex; gap:8px; justify-content:center; align-items:center; flex-wrap:wrap; margin:0}
#screen-session .play{height:44px; min-height:44px; padding:0 16px; border-radius:999px; font-size:14px; font-weight:700; box-shadow:none}
#screen-session #btn-speak-ja{background:#e8ebfb; color:#2c47b5}
#screen-session #btn-speak-de{background:#f5f6fc; color:#4b5287}
#screen-session #btn-reveal{height:48px; padding:0 22px; border-radius:999px; border:2px dashed #b9c2ef;
  background:#f5f6fc; color:#2c47b5; font-size:15px; font-weight:700}
#screen-session #quiz-choices{width:100%; display:flex; flex-direction:column; gap:10px}
/* ★ 上の 1行は `#quiz-choices[hidden]{display:none}`（アプリ側）に **勝ってしまう**
   （id 2つ = 210 に対し id+属性 = 110）。そのため クイズの 選択肢が 隠れず、
   **デモを 繰り返すと 前の 選択肢が 残って 見えた**
   （2026-10-05 user 指摘「デモを 何度か 繰り返すと 前デモしたときの 選択肢が 残ってる」）。
   [hidden] を 明示して 勝たせる。 */
#screen-session #quiz-choices[hidden]{display:none}
#screen-session .quiz-choice{min-height:54px; border-radius:18px; border-width:2px; font-size:17px}

/* ★ PC など 画面の 高さが 足りない ときの 不具合（2026-10-05 user 指摘
   「PCでデモをやったらこんなバグが出た」）。
   カードは `justify-content:center` + `overflow:auto` なので、**中身が はみ出すと
   上側が 切れ、スクロールしても 戻れない**（指示文が 消えて 見えた 原因）。
   `safe center` は 「収まれば 中央、はみ出すなら 上ぞろえ」に なる。
   対応して いない ブラウザでは この 行が 無効に なり、既定の flex-start（上ぞろえ）に
   戻る だけ なので、どちらでも 切れない。 */
#screen-session #card{justify-content: safe center}
/* 中身を 詰めて、なるべく スクロール せずに 収める。
   ★ 2026-10-06: 前は `@media (max-height:950px)` で 「viewport が 低い ときだけ」に
   当てて いたが、**この 画面の 高さは viewport では なく 枠（844px 以下）で 決まる** ので
   その 判定は 成り立たない。viewport が 高い 端末（iPad 820×1180・952×1547）では
   詰めが 外れ、iPad 820×1180 の 実測で カードが 236.3px しか 無い のに
   中身が 504px 必要で、**267.7px はみ出して いた**（実測 2026-10-06）。
   枠は どの 端末でも 844px 以下 ＝ 想定端末 390×844 と 同じ 条件 なので、
   **この 詰めは いつも 当てる**（390×844 では 前から 950px 未満で 当たって いた ので、
   想定端末の 見た目は 変わらない）。
   ★ この ブロックの セレクタは すべて `#screen-session` だけ。
     トップ・Mein Fortschritt・About の 画面には 当たらない。 */
#screen-session #card{padding:10px; gap:4px}
#screen-session #instruction{font-size:12px}
#screen-session #main{font-size:22px}
#screen-session #sub{font-size:13px}
#screen-session #reading{font-size:13px}
#screen-session .play{height:34px; min-height:34px; font-size:13px; padding:0 13px}
#screen-session .quiz-choice{min-height:44px; font-size:16px}
#screen-session #quiz-choices{gap:7px}
/* 回答後の 選択肢（アプリが disabled を 付ける ＝ もう 押せない 読み物）。
   2026-10-05 に 「回答すると 読み（reading）と ヒントが 増えて カードから 85px
   はみ出す」（実測 412×777）を 直した 続き。その ときの 値（padding 6px /
   min-height 38px）でも **3〜5px 足りて いなかった**（実測 2026-10-06:
   中身 377.8px に対し カードの 中身の 高さ 412×777 → 375px・476×773 → 373px）。
   足りない ぶんだけ カードに スクロールバーが 出て、3つ目の 選択肢の 下が 切れる。
   文字の 行（15px×1.45=21.75px）は 変えず、上下の padding を 6→4px・
   min-height を 36→32px に して 1つ あたり 4px（3つで 12px）詰める。
   ★ 2026-10-06 追加: 選択肢の 文が 長い と **2行に なり**、その 分 21.75px 増える。
   実測 デモ 6/6（「私は 月曜日と 水曜日に 大学に 行きます。」が 2行）で
   412×777 → 中身 380.1px（カード 375px）・476×773 → 380.1px（カード 373px）と
   また あふれた。**行の 高さを 1.45→1.25 に 詰める**（1行 21.75→18.75px）。
   15px の 文字で 行間 18.75px は 読める 範囲。 */
#screen-session #quiz-choices .quiz-choice[disabled]{min-height:32px; padding-top:4px; padding-bottom:4px; line-height:1.25; font-size:15px}

/* 下部（モック: left16 right16 bottom30・gap10。自己評価は その 上に 重ねる） */
#screen-session #btn-next{position:absolute; left:16px; right:16px; bottom:min(3.6dvh, calc(var(--mio-frame-h) * 0.036)); margin:0; height:58px; min-height:58px;
  font-size:18px; font-weight:700; border-radius:999px}
#screen-session #selfeval{position:absolute; left:16px; right:16px; bottom:min(11.6dvh, calc(var(--mio-frame-h) * 0.116)); margin:0; display:flex; gap:10px}
#screen-session #selfeval[hidden]{display:none}
#screen-session #selfeval .small-btn{flex:1; height:44px; border-radius:14px; border:2px solid var(--accent-line); font-size:15px; font-weight:700}
#screen-session #footer-note{position:absolute; left:16px; right:16px; top:min(34.6dvh, calc(var(--mio-frame-h) * 0.346)); margin:0;
  text-align:center; font-size:12px; color:#5f6694}

/* ★ 2026-10-06: 枠が 低い 端末（〜760px）用の 追加の 詰め。
   カードは 枠の 48.5%（top 38.2% / bottom 13.3%）なので、枠が 低い と カードだけが
   小さくなり、中身が 入らない。回答後は 実測 約364px 必要 なので、
   枠 364/0.485 = **750px が 境界**（2026-10-06 実測: 375×667 では カード 322px に
   中身 365.7px ＝ 43.7px あふれ、カードに スクロールバーが 出て いた）。
   それ 未満では カードを 枠の 55%（top 32% / bottom 13.3%）に 広げ、文字も 1段 詰める。
   bottom は 13.3% の まま（下の 「Weiter」58px＋余白を 侵さない ため）。
   枠 760px 以下でしか 当たらない ＝ 想定端末 390×844・スマホ・大きい 画面では 変化 なし。
   ★ この ブロックは **ファイルの 下の ほう** に 置く（同じ セレクタは 後ろの 宣言が
     勝つ ため。上の ほうに 書くと 下の #btn-next の 58px に 負ける）。 */
@media (max-height: 760px){
  #screen-session #card{top:32dvh; bottom:13.3dvh; padding:8px; gap:3px}
  #screen-session #instruction{font-size:11px}
  #screen-session #main{font-size:19px}
  #screen-session #reading{font-size:12px}
  #screen-session #sub{font-size:12px}
  #screen-session .play{height:30px; min-height:30px; font-size:12px; padding:0 12px}
  #screen-session #hint{font-size:13px}
  #screen-session .quiz-choice{min-height:40px; font-size:15px}
  #screen-session #quiz-choices{gap:6px}
  #screen-session #quiz-choices .quiz-choice[disabled]{min-height:28px; padding-top:3px; padding-bottom:3px; line-height:1.2; font-size:14px}
}

/* ★ 2026-10-06: さらに 低い 枠（〜600px・320×568 など）用。
   枠 568px では カードが 318px しか 無く、回答後（実測 330.8px）も
   回答前の 6/6（実測 333px）も 入らなかった（760px の 詰めだけでは 3/7 の 段階で
   6〜17px あふれ・カードに スクロールバー）。
   ここ だけ は さらに 詰める:
     ・カードを 枠の 55%（top 32% / bottom 13.3%）に 広げる
     ・「Weiter」を 58→48px に（タップの 目安 44px は 保つ）カードの 余地を 作る
     ・回答前の 選択肢の 上下 padding を 14→10px（高さ 44.3px ＝ タップの 目安 44px は 保つ）
   枠 600px 以下でしか 当たらない。 */
@media (max-height: 600px){
  #screen-session #card{top:32dvh; bottom:13.3dvh; padding:6px; gap:3px}
  #screen-session #btn-next{height:48px; min-height:48px; font-size:16px}
  #screen-session #main{font-size:18px}
  #screen-session #reading{font-size:11px}
  #screen-session #sub{font-size:11px}
  #screen-session .play{height:28px; min-height:28px; font-size:11px; padding:0 10px}
  #screen-session #hint{font-size:11px}
  #screen-session .quiz-choice{min-height:36px; padding-top:10px; padding-bottom:10px; font-size:14px}
  #screen-session #quiz-choices{gap:4px}
  #screen-session #quiz-choices .quiz-choice[disabled]{min-height:26px; padding-top:2px; padding-bottom:2px; font-size:13px}
}

/* ---------- 完了画面：モックの 実測値に 合わせる ----------
   出典: mock/Marugoto Redesign.dc.html（data-screen-label="Done"）
   モデル 0,56,390,500 full・吹き出し left14 top120 幅150・下部 bottom34 */
#screen-done{position:relative; padding:0}
#screen-done .center{position:absolute; inset:0; display:block; margin:0; padding:0}
/* モックは top:56 だが、キャラを 約11% 大きく した ぶん 頭の てっぺんが
   4px 画面外に 出た ので、60px（7.1dvh）に 下げた（2026-10-04）。 */
#screen-done .mio-slot--full{position:absolute; left:0; right:0; top:7.1dvh; bottom:auto; height:59.2dvh; width:auto; margin:0}
#screen-done .mio-say{position:absolute; left:14px; top:14.2dvh; width:auto; max-width:150px; margin:0;
  border-radius:20px 20px 20px 6px; padding:12px 14px; font-size:15px; line-height:1.55;
  display:flex; flex-direction:column; gap:2px}
#screen-done .mio-say::after{position:static; order:-1; padding:0; background:none;
  font-size:11px; font-weight:700; letter-spacing:.08em; color:#8e9ce6}
#screen-done .mio-done-bottom{position:absolute; left:24px; right:24px; bottom:4dvh;
  display:flex; flex-direction:column; align-items:center; gap:10px; text-align:center}
#screen-done .mio-done-bottom::before{content:""; width:120px; height:8px;
  background-image:radial-gradient(circle,#c9d0f3 2px,transparent 2.6px); background-size:12px 8px; background-position:center}
#screen-done .big{font-family:var(--font-title); font-weight:800; font-size:32px; color:#1e2350; margin:0}
#screen-done .pri{font-size:15px; color:#4b5287; margin:0}
#screen-done .day-progress{font-size:12px; color:#5f6694; margin:0}
#screen-done #btn-replay-today{height:50px; width:100%; border-radius:999px; background:#e8ebfb; color:#2c47b5; font-size:15px; font-weight:700; box-shadow:none}
#screen-done #btn-go-home{height:58px; width:100%; border-radius:999px; background:#2c47b5; color:#fff; font-size:18px; font-weight:700; border:0}

/* ---------- レッスン一覧：モックの 実測値に 合わせる ----------
   出典: data-screen-label="Lektionen"。見出し padding 58 120 14 22・h2 28px・
   一覧 padding 6 16 30 gap10・項目 padding 12 16 12 14 radius20 */
#screen-cat-list{position:relative; padding:0}
#screen-cat-list .cat-head{padding:6.9dvh 120px 1.7dvh 22px; align-items:start; row-gap:6px}
#screen-cat-list .cat-title{font-size:28px; margin:0}
#screen-cat-list .cat-note{font-size:13px; color:#5f6694; line-height:1.5; margin:0}
#screen-cat-list .cat-list{flex:1; overflow:auto; padding:6px 16px 30px; display:flex; flex-direction:column; gap:10px}
#screen-cat-list .cat-item{padding:12px 16px 12px 14px; border-radius:20px}
#screen-cat-list #btn-cat-back{margin:0 16px 30px; height:46px; border-radius:14px; border:1.5px solid #dfe3f5; background:#fff; color:#2c47b5; font-size:14px; font-weight:700}

/* ---------- レッスン練習：モックの 実測値に 合わせる ----------
   出典: data-screen-label="Lektion üben"。見出し left18 right110 top56・
   カード top160 bottom112 radius28 padding 24 20・下部 bottom30（戻る 110 幅・次は 残り） */
#screen-cat-run{position:relative; padding:0}
#screen-cat-run #cat-topbar{position:absolute; left:18px; right:110px; top:6.6dvh; margin:0; padding:0;
  display:flex; flex-direction:column; align-items:flex-start; gap:4px}
#screen-cat-run #cat-card{position:absolute; left:16px; right:16px; top:19dvh; bottom:13.3dvh; margin:0;
  border-radius:28px; border:1px solid #e1e4f4; padding:24px 20px; overflow:auto;
  display:flex; flex-direction:column; justify-content:center; align-items:center; gap:16px; text-align:center}
#screen-cat-run #cat-lektion,#screen-cat-run #cat-progress{font-size:13px; color:#5f6694; margin:0}
#screen-cat-run #cat-instruction{font-size:13px; font-weight:700; color:#8e9ce6; margin:0}
#screen-cat-run #cat-main{font-size:28px; line-height:1.45; font-weight:700; margin:0; text-wrap:balance}
#screen-cat-run #cat-reading{font-size:14px; color:#5f6694; letter-spacing:.04em; margin:0}
#screen-cat-run #cat-sub{font-size:15px; color:#5f6694; line-height:1.5; margin:0}
#screen-cat-run #cat-audio{display:flex; gap:8px; flex-wrap:wrap; justify-content:center}
#screen-cat-run .play{height:44px; min-height:44px; padding:0 16px; border-radius:999px; font-size:14px; font-weight:700; box-shadow:none}
#screen-cat-run #btn-cat-ja,#screen-cat-run #btn-cat-slow{background:#e8ebfb; color:#2c47b5}
#screen-cat-run #btn-cat-de{background:#f5f6fc; color:#4b5287}
#screen-cat-run #cat-actions{position:absolute; left:16px; right:16px; bottom:3.6dvh; margin:0; display:flex; gap:10px}
#screen-cat-run #btn-cat-prev{flex:none; width:110px; height:58px; min-height:58px; border-radius:999px;
  border:1.5px solid #dfe3f5; background:#fff; color:#4b5287; font-size:15px; font-weight:700}
#screen-cat-run #btn-cat-next{flex:1; height:58px; min-height:58px; border-radius:999px; font-size:18px; font-weight:700}

/* ---------- 記録（Mein Fortschritt）：モックの 実測値に 合わせる ----------
   出典: data-screen-label="Mein Fortschritt"。見出し padding 58 120 12 22・h2 28px・
   タブ 背景 #e8ebfb radius999 高さ36・本文 padding 4 16 30 */
#screen-parent{position:relative; padding:0}
#screen-parent .parent-head{padding:6.9dvh 120px 1.4dvh 22px; display:flex; flex-direction:column; align-items:flex-start; gap:6px}
#screen-parent #parent-title{font-size:28px; margin:0}
/* ★ モックでは 戻るリンクが 題字の **上**に ある。右に 置くと 見出しの 丸い 顔と
   重なる（2026-10-05 user 指摘「設定画面で顔が重なってるのはよくない」）。 */
#screen-parent #btn-parent-close{position:static; order:-1; font-size:14px; font-weight:700;
  color:#2c47b5; background:none; border:0; padding:0; align-self:flex-start}
#screen-parent .parent-tabs{margin:0 16px 10px; display:flex; flex-wrap:wrap; gap:4px; padding:4px; background:#e8ebfb; border-radius:999px}
#screen-parent .ptab{flex:1 1 auto; min-width:0; height:36px; border:0; border-radius:999px; font-size:13px; font-weight:700; padding:0 8px}
#screen-parent #parent-body{flex:1; overflow:auto; padding:4px 16px 30px; margin:0}
/* ★ 設定画面の 顔を 大きくする（2026-10-05 user 指示
   「小さな窓に 顔が あるのでは なくて、Bericht とか Daten の 上に、大きく 顔を 出せませんかね」
   「Mein Fortschritt の 大きな 字を 消しても いいよ」）。
   見出しを 消して、その 分を 顔に 使う。**丸窓は やめる**（crop=face。Live2DStage.js）。
   流れの 中に 置いて タブを 押し下げる（絶対配置では 重なる だけ）。
   高さは 画面に 合わせて 伸びる（dvh）。本文は 残りを スクロールする。 */
#screen-parent #parent-title{display:none}
#screen-parent .parent-head{padding:5.6dvh 22px 0}
#screen-parent .mio-slot--face{
  position:relative; left:auto; right:auto; top:auto; margin:0 auto 2px;
  width:min(88%, 320px); height:30dvh; min-height:170px; max-height:260px;
  border-radius:28px; pointer-events:none;
}

/* ---------- 見出しの 右に 出る 丸い 顔（モック: 286,56,88,88） ----------
   モックでは 見出しの 余白（右120px）の 中に **絶対配置**で 置いて ある。
   流れに 置くと 見出しの 高さを 押し広げて しまう ので、画面に 対して 固定する。 */
#screen-cat-list .mio-slot--head,
#screen-cat-run .mio-slot--head,
#screen-parent .mio-slot--head{position:absolute; left:auto; right:16px; top:6.6dvh;
  width:88px; height:88px; margin:0; grid-column:auto; grid-row:auto}
#screen-done .star,#screen-cat-done .star{display:none}
#koto-session{display:flex; align-items:center; gap:4px; min-height:0; height:clamp(150px,24vh,220px); margin:0}
.mio-slot--bust{width:46%; height:100%}
.mio-slot--head{width:72px; height:72px; border-radius:50%; margin-left:auto}
.cat-head,.parent-head,#cat-topbar{display:flex; align-items:center; gap:12px}
.cat-head{display:grid; grid-template-columns:minmax(0,1fr) auto; column-gap:12px; align-items:center}
.cat-head > :not(.mio-slot){grid-column:1}
.cat-head .mio-slot--head{grid-column:2; grid-row:1 / span 2; margin:0}
#cat-topbar .mio-slot--head{width:56px; height:56px}

@media (prefers-reduced-motion: reduce){ l2d-stage{transition:none} }

/* ---------- 見出しの 右の 丸い 顔（モック: 286,56,88,88） ----------
   ★ 上の `.mio-slot--head` / `#cat-topbar .mio-slot--head` より **後ろ**に 置く。
     先に 書くと 同点で 負ける（2026-10-04 に 実際に 負けた）。
   モックでは 見出しの 右余白の 中に 絶対配置で 置いて ある。流れに 置くと
   見出しの 高さを 押し広げる ので、画面に 対して 固定する。 */
#screen-cat-list .mio-slot--head,
#screen-cat-run .mio-slot--head,
#screen-parent .mio-slot--head{position:absolute; left:auto; right:16px; top:6.6dvh;
  width:88px; height:88px; margin:0; grid-column:auto; grid-row:auto}
/* レッスン練習だけ 顔が #cat-topbar（position:absolute）の 中に ある ため、
   基準が 画面では なく トップバーに なって しまう。トップバーは 18px から
   幅262px なので、右余白の 先（画面で 286px）へ 置き直す。 */
#screen-cat-run #cat-topbar .mio-slot--head{left:calc(100% + 6px); right:auto; top:0}

/* ---------- 背景の 後光（透過PNGを WebP に した もの・1024×1536・0.30MB） ----------
   アプリの 枠（390×844）に 合わせて contain で 中央に 置く。上下は 余るが、
   背景が 薄い グラデーションなので なじむ（user 選択 2026-10-05）。
   ★ body に 置く 理由: #app は z-index:1 で スタック文脈を 作る ため、中に 置くと
     **モデル（z-index:0・body の 直下）より 上**に 出て しまう。body の ::before なら
     モデルより 後ろに なる（body の 地 → 後光 → モデル → 画面の中身）。 */
/* ★ 2026-10-05: iPad のような 広い 画面では アプリが 390×844 の 枠の ままで、
   女の子が 小さく 見えた（user 指摘）。mio-layer.js が 画面に 合わせた 倍率を
   `--mio-scale` に 入れ、#app と 後光を **同じ 倍率・同じ 基準点（中央）**で 拡大する。
   body が display:flex で #app を 中央に 置いて いる ので、後光も
   `inset:0; margin:auto` で 中央に そろえる（top:50% + translate では ずれた）。 */
body::before{
  content:""; position:fixed; inset:0; margin:auto;
  width:390px; height:min(100dvh, 844px);
  transform:scale(var(--mio-scale, 1));
  z-index:0; pointer-events:none;
  background:url("halo.webp") center / contain no-repeat;
}
