/* まいにち学習 — Apple 風の白ベース */
:root {
  --bg: #f5f5f7;
  --surface: #ffffff;
  --surface2: #f2f2f7;
  --ink: #1d1d1f;
  --muted: #6e6e73;
  --faint: #aeaeb2;
  --line: #e5e5ea;
  --accent: #0071e3;
  --accentInk: #ffffff;
  --accentSoft: #e8f1fc;
  /* 意味の色（文字や線にも使えるように、少し濃いめ） */
  --blue: #0066cc;   --blueSoft: #e8f1fc;
  --orange: #c93400; --orangeSoft: #fff1e6;
  --green: #248a3d;  --greenSoft: #e8f6ec;
  --pink: #d70015;   --pinkSoft: #fdecee;
  --purple: #8944ab; --purpleSoft: #f5edfa;
  --amber: #b25000;  --amberSoft: #fff6e0;
  --ok: #248a3d; --okSoft: #e8f6ec;
  --ng: #d70015; --ngSoft: #fdecee;
  /* 進み具合のリング */
  --ring1: #ff375f; --ring2: #30d158; --ring3: #0a84ff;
  --radius: 18px;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 4px 16px rgba(0,0,0,.05);
  --navH: 64px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic UI", "Meiryo", sans-serif;
  font-size: 17px; line-height: 1.6; letter-spacing: .01em;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: anywhere; line-break: strict;
}
#app { max-width: 720px; margin: 0 auto; padding: 12px 16px calc(var(--navH) + 40px + env(safe-area-inset-bottom)); }
h1 { font-size: 30px; font-weight: 700; letter-spacing: -.01em; margin: 12px 0 14px; line-height: 1.25; }
h2 { font-size: 20px; font-weight: 700; margin: 28px 0 10px; line-height: 1.3; }
.section-title { font-size: 13px; font-weight: 600; color: var(--muted); text-transform: none; margin: 26px 4px 8px; letter-spacing: .02em; }
p { margin: 6px 0; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.center { text-align: center; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.spacer { height: 12px; }
.eyebrow { font-size: 13px; font-weight: 600; color: var(--muted); letter-spacing: .02em; }

/* カード */
.card { background: var(--surface); border-radius: var(--radius); padding: 18px; margin: 12px 0; box-shadow: var(--shadow); }
.card.soft { background: var(--surface2); box-shadow: none; }
.card.hero { padding: 20px 18px; }
.card.flat { box-shadow: none; border: 1px solid var(--line); }
.label { font-size: 13px; color: var(--muted); font-weight: 600; margin-bottom: 4px; }

/* ボタン */
button, .btn {
  font: inherit; color: var(--accent); cursor: pointer; border: none; background: var(--surface2);
  border-radius: 14px; padding: 12px 16px; min-height: 50px; line-height: 1.35; text-align: center; font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation; transition: background .15s, transform .1s;
}
button:focus-visible, .btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid rgba(0,113,227,.45); outline-offset: 2px; }
button:active { transform: scale(.98); }
.btn-main { background: var(--accent); color: var(--accentInk); font-size: 17px; min-height: 54px; width: 100%; border-radius: 14px; }
.btn-main:hover { background: #0077ed; }
.btn-wide { width: 100%; }
.btn-ghost { background: transparent; }
.btn-small { min-height: 40px; padding: 6px 12px; font-size: 15px; }
.btn-ok { background: var(--okSoft); color: var(--green); }
.btn-ng { background: var(--ngSoft); color: var(--ng); }
.btn-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 12px 0; }
.btn-col { display: grid; gap: 10px; margin: 12px 0; }
.link { background: none; color: var(--accent); min-height: 40px; padding: 4px 6px; font-weight: 500; }
button[disabled]:not(.choice):not(.word) { opacity: .4; cursor: default; }

/* 教科 */
.chip { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 1px 10px; font-size: 13px; font-weight: 600; background: var(--surface2); }
.s-sugaku { color: var(--blue); } .s-kokugo { color: var(--pink); } .s-eigo { color: var(--purple); } .s-rika { color: var(--green); } .s-shakai { color: var(--orange); }
.chip.s-sugaku { background: var(--blueSoft); } .chip.s-kokugo { background: var(--pinkSoft); } .chip.s-eigo { background: var(--purpleSoft); } .chip.s-rika { background: var(--greenSoft); } .chip.s-shakai { background: var(--orangeSoft); }
.app-ic { display: inline-flex; align-items: center; justify-content: center; border-radius: 24%; color: #fff; flex: none; box-shadow: inset 0 0 0 .5px rgba(0,0,0,.06); }
.app-ic-svg { width: 58%; height: 58%; }
.t-sugaku { background: linear-gradient(160deg, #3d9bff, #0a64e0); }
.t-kokugo { background: linear-gradient(160deg, #ff6b81, #e0193a); }
.t-eigo { background: linear-gradient(160deg, #c27cf0, #8a3fd1); }
.t-rika { background: linear-gradient(160deg, #4cd97b, #1f9e4a); }
.t-shakai { background: linear-gradient(160deg, #ffb340, #f07800); }

/* iOS 風のリスト */
.group { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; margin: 8px 0 12px; }
.group > .cell, .group > button.cell { display: flex; align-items: center; gap: 14px; width: 100%; padding: 12px 16px; min-height: 60px; background: var(--surface); color: var(--ink); border-radius: 0; text-align: left; font-weight: 400; justify-content: flex-start; position: relative; }
.group > .cell + .cell::before { content: ""; position: absolute; top: 0; left: 72px; right: 0; height: 1px; background: var(--line); }
.group > .cell.plain + .cell.plain::before { left: 16px; }
.cell .t { font-weight: 600; font-size: 17px; display: block; line-height: 1.35; }
.cell .s { font-size: 13px; color: var(--muted); display: block; line-height: 1.4; margin-top: 2px; }
.cell .chev { width: 16px; height: 16px; color: var(--faint); flex: none; }
.cell .val { color: var(--muted); font-size: 15px; white-space: nowrap; }
button.cell:active { background: var(--surface2); transform: none; }
.subj-card, .unit-btn { /* 旧クラス：リストのセルとして表示 */ }

/* 進み具合の棒 */
.meter { height: 6px; background: var(--surface2); border-radius: 999px; overflow: hidden; margin-top: 8px; }
.meter > span { display: block; height: 100%; border-radius: 999px; background: var(--accent); }
.meter.t-sugaku > span { background: #0a7cff; } .meter.t-kokugo > span { background: #ff375f; } .meter.t-eigo > span { background: #af52de; } .meter.t-rika > span { background: #30b158; } .meter.t-shakai > span { background: #ff9500; }
.meter.t-sugaku, .meter.t-kokugo, .meter.t-eigo, .meter.t-rika, .meter.t-shakai { background: var(--surface2); }
.lv { display: inline-block; font-size: 12px; font-weight: 600; padding: 1px 8px; border-radius: 999px; background: var(--surface2); color: var(--muted); margin-left: 6px; vertical-align: 1px; }

/* 今日のリング */
.rings { display: grid; grid-template-columns: 132px 1fr; gap: 18px; align-items: center; }
.rings svg { width: 132px; height: 132px; display: block; }
.ring-legend { display: grid; gap: 10px; }
.ring-legend .k { font-size: 13px; color: var(--muted); font-weight: 600; display: flex; align-items: center; gap: 6px; }
.ring-legend .k i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.ring-legend .v { font-size: 20px; font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; }
.ring-legend .v small { font-size: 14px; color: var(--muted); font-weight: 500; }
@media (max-width: 360px) { .rings { grid-template-columns: 108px 1fr; } .rings svg { width: 108px; height: 108px; } }

/* 今日の課題リスト */
.todo { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.todo:first-of-type { border-top: none; }
.todo .box-ic { width: 26px; height: 26px; flex: none; color: var(--faint); }
.todo.done .box-ic { color: var(--green); }
.todo.done .tt { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--faint); }
.todo .tt { font-weight: 600; }
.todo .ts { font-size: 13px; color: var(--muted); }
.status-pill { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: var(--amberSoft); color: var(--amber); }
.status-pill.ok { background: var(--okSoft); color: var(--green); }

/* ステップ表示 */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 10px 0 16px; }
.step { background: var(--surface2); border-radius: 14px; padding: 10px 6px; text-align: center; font-size: 13px; line-height: 1.35; color: var(--muted); }
.step b { display: block; font-size: 15px; color: var(--ink); }
.step.doing { background: var(--accentSoft); color: var(--accent); box-shadow: inset 0 0 0 2px var(--accent); }
.step.done { background: var(--okSoft); color: var(--green); }
.step .st { display: block; font-size: 12px; margin-top: 2px; }
.step-ill { width: 24px; height: 24px; display: block; margin: 0 auto 4px; }

/* 大きな「次にやること」 */
.next-label { font-size: 13px; color: var(--muted); font-weight: 600; }
.next-title { font-size: 24px; font-weight: 700; line-height: 1.3; margin: 2px 0 12px; letter-spacing: -.01em; }

/* カウントダウン */
.count { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.count > div { background: var(--surface); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.count .days { font-size: 28px; font-weight: 700; line-height: 1.2; letter-spacing: -.01em; }
.count .days small { font-size: 15px; font-weight: 600; color: var(--muted); }

/* 統計 */
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.stat { background: var(--surface); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.stat .v { font-size: 26px; font-weight: 700; line-height: 1.25; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.stat .v small, .stat .v .small { font-size: 14px; color: var(--muted); font-weight: 600; }
.stat .k { font-size: 13px; color: var(--muted); }

/* グラフ */
.chart svg { width: 100%; height: auto; display: block; }

/* ゴールまでの道のり */
.road { position: relative; margin: 10px 0 4px; }
.road-bar { height: 10px; border-radius: 999px; background: var(--surface2); overflow: hidden; }
.road-bar > span { display: block; height: 100%; background: linear-gradient(90deg, #0a84ff, #30d158); border-radius: 999px; }
.road-labels { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-top: 6px; }

/* タイマー */
.timer { font-size: 56px; font-weight: 300; text-align: center; font-variant-numeric: tabular-nums; line-height: 1.1; margin: 8px 0; letter-spacing: -.02em; }
.bar { height: 6px; background: var(--surface2); border-radius: 999px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--accent); border-radius: 999px; }

/* 入力 */
input[type=text], input[type=number], input[type=date], select, textarea {
  font: inherit; color: inherit; background: var(--surface2); border: none; border-radius: 12px;
  padding: 12px 14px; min-height: 48px; width: 100%;
}
textarea { min-height: 96px; }
.field { margin: 14px 0; }
.field > label { display: block; font-weight: 600; margin-bottom: 6px; font-size: 15px; }
.pages { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: center; }
.stepper { display: grid; grid-template-columns: 1fr auto auto auto; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.stepper:last-child { border-bottom: none; }
.stepper .v { min-width: 2em; text-align: center; font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; }
.stepper button { min-width: 44px; min-height: 40px; font-size: 20px; padding: 2px; border-radius: 10px; }
.seg { display: flex; flex-wrap: wrap; gap: 2px; background: var(--surface2); border-radius: 12px; padding: 3px; }
.seg button { flex: 1 1 auto; min-width: 56px; min-height: 40px; background: transparent; color: var(--ink); font-weight: 500; border-radius: 9px; font-size: 15px; }
.seg button[aria-pressed=true] { background: var(--surface); box-shadow: 0 1px 3px rgba(0,0,0,.12); font-weight: 600; }
.nums { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.num { display: inline-flex; align-items: center; gap: 6px; background: var(--ngSoft); color: var(--ng); border-radius: 999px; padding: 4px 6px 4px 12px; font-weight: 600; font-size: 15px; }
.num.q { background: var(--orangeSoft); color: var(--orange); }
.num button { min-height: 28px; min-width: 28px; padding: 0; border-radius: 999px; font-size: 12px; background: rgba(0,0,0,.06); color: inherit; }

/* 問題 */
.qhead { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 6px; }
.qprog { height: 4px; background: var(--line); border-radius: 999px; overflow: hidden; margin-bottom: 14px; }
.qprog > span { display: block; height: 100%; background: var(--accent); }
.qtext { font-size: 21px; font-weight: 700; line-height: 1.5; margin: 8px 0; letter-spacing: -.005em; }
.qvisual { margin: 12px 0; background: var(--surface); border-radius: var(--radius); padding: 12px; box-shadow: var(--shadow); }
.qvisual svg, .ex-v svg { width: 100%; height: auto; max-height: 360px; display: block; margin: 0 auto; }
.choices { display: grid; gap: 10px; margin: 16px 0; }
@media (min-width: 560px) { .choices.c4 { grid-template-columns: 1fr 1fr; } }
.choice { width: 100%; font-size: 19px; min-height: 60px; justify-content: flex-start; text-align: left; padding: 12px 16px; background: var(--surface); color: var(--ink); box-shadow: var(--shadow); font-weight: 500; }
.choice .mark { display: inline-flex; width: 30px; height: 30px; border-radius: 50%; align-items: center; justify-content: center; background: var(--surface2); color: var(--muted); font-size: 14px; font-weight: 600; flex: none; }
.choice.correct { background: var(--okSoft); box-shadow: inset 0 0 0 2px var(--ok); }
.choice.correct .mark { background: var(--ok); color: #fff; }
.choice.wrong { background: var(--ngSoft); box-shadow: inset 0 0 0 2px var(--ng); }
.choice.wrong .mark { background: var(--ng); color: #fff; }
.choice[disabled] { cursor: default; opacity: 1; }
.feedback { border-radius: var(--radius); padding: 14px 16px; margin: 12px 0; font-weight: 600; font-size: 17px; }
.feedback.ok { background: var(--okSoft); color: #1b6b30; }
.feedback.ng { background: var(--ngSoft); color: #a3000f; }
.feedback.info { background: var(--surface2); color: var(--ink); }
.hintbox { background: var(--amberSoft); color: #7a3a00; border-radius: 14px; padding: 12px 14px; margin: 10px 0; }

/* 並べる問題 */
.order-ans { min-height: 68px; border-radius: 16px; padding: 10px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; background: var(--surface); box-shadow: inset 0 0 0 2px var(--line); }
.order-pool { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.word { min-height: 48px; min-width: 48px; font-size: 18px; padding: 6px 14px; background: var(--surface); color: var(--ink); box-shadow: var(--shadow); font-weight: 500; }
.order-ans .word { background: var(--accentSoft); color: var(--accent); box-shadow: none; }

/* 解説 */
.explain { border-radius: var(--radius); padding: 16px; margin: 14px 0; background: var(--surface); box-shadow: var(--shadow); }
.explain-title { font-weight: 700; font-size: 15px; color: var(--accent); margin-bottom: 4px; }
.ex-step { display: grid; grid-template-columns: 30px 1fr; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.ex-step:first-of-type { border-top: none; }
.ex-num { width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; }
.ex-step.old { opacity: .5; }
.ex-v { margin-top: 8px; }
.ask-ai { display: flex; gap: 10px; align-items: center; background: var(--surface2); border-radius: 14px; padding: 12px 14px; margin: 12px 0; }
.ask-ai .t { font-weight: 600; }

/* 数式の見た目 */
.math-big { font-size: 26px; text-align: center; padding: 12px 8px; line-height: 1.6; background: var(--surface2); border-radius: 14px; font-variant-numeric: tabular-nums; }
.tx { color: var(--blue); background: var(--blueSoft); border-radius: 6px; padding: 0 4px; font-weight: 700; }
.tn { color: var(--orange); background: var(--orangeSoft); border-radius: 6px; padding: 0 4px; font-weight: 700; }
.tg { color: var(--green); background: var(--greenSoft); border-radius: 6px; padding: 0 6px; font-weight: 700; box-shadow: inset 0 0 0 2px var(--green); }
.box { display: inline-block; box-shadow: inset 0 0 0 2px var(--pink); border-radius: 6px; padding: 0 6px; min-width: 1.6em; }
.strike { color: var(--ng); }
.frac { display: inline-flex; flex-direction: column; vertical-align: middle; text-align: center; line-height: 1.15; margin: 0 2px; }
.frac > span:first-child { border-bottom: 2px solid currentColor; padding: 0 4px; }
.sign-table { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.sign-table > div { background: var(--surface2); border-radius: 10px; padding: 8px; text-align: center; font-size: 17px; }
.vt { border-collapse: separate; border-spacing: 0; margin: 6px auto; font-size: 20px; border-radius: 12px; overflow: hidden; box-shadow: inset 0 0 0 1px var(--line); }
.vt th, .vt td { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 6px 16px; text-align: center; min-width: 52px; }
.vt tr:last-child td, .vt tr:last-child th { border-bottom: none; }
.vt td:last-child { border-right: none; }
.vt-note { text-align: center; color: var(--muted); font-size: 14px; }
.tape { display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; }
.tape-x, .tape-n { background: var(--blueSoft); color: var(--blue); border-radius: 8px; padding: 8px 10px; font-weight: 700; min-width: 60px; text-align: center; }
.tape-n { background: var(--orangeSoft); color: var(--orange); }
.tape-total { text-align: center; margin-top: 6px; border-top: 2px solid var(--ink); padding-top: 4px; font-weight: 700; }
.steps-row { display: grid; gap: 6px; }
.steps-row > span { background: var(--surface2); border-radius: 10px; padding: 6px 10px; }
.arc { border-bottom: 3px solid var(--pink); padding-bottom: 2px; }
.pie-row { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; align-items: center; }
.pie-row svg { width: 110px; height: 110px; }

/* 一覧 */
.list { display: grid; gap: 0; }
.day-row { display: grid; grid-template-columns: 7em 1fr; gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--line); align-items: center; }
.day-row:last-child { border-bottom: none; }
.tag { display: inline-block; font-size: 12px; font-weight: 600; border-radius: 999px; padding: 2px 9px; margin: 2px 4px 2px 0; background: var(--surface2); color: var(--muted); }
.tag.ok { background: var(--okSoft); color: var(--green); }
.tag.mid { background: var(--orangeSoft); color: var(--orange); }

/* アイコン */
.ic { width: 20px; height: 20px; flex: none; }
.badge-ic { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 50%; flex: none; }
.badge-ic svg { width: 22px; height: 22px; }
.g-green { background: var(--okSoft); color: var(--green); }
.g-amber { background: var(--amberSoft); color: var(--amber); }
.g-blue { background: var(--accentSoft); color: var(--accent); }
.g-gray { background: var(--surface2); color: var(--muted); }
.owl-row { display: flex; align-items: center; gap: 14px; }
.owl-big { display: flex; justify-content: center; margin-top: 18px; }
.owl-big .badge-ic { width: 72px; height: 72px; }
.owl-big .badge-ic svg { width: 38px; height: 38px; }
.fb-owl { display: flex; align-items: center; gap: 12px; }
.fb-owl .badge-ic { background: rgba(255,255,255,.7); }
h1.row { display: flex; align-items: center; gap: 12px; }

/* 下のメニュー（すりガラス） */
#nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  background: rgba(250,250,252,.82); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  border-top: .5px solid rgba(0,0,0,.12); padding-bottom: env(safe-area-inset-bottom);
}
#nav .in { max-width: 720px; margin: 0 auto; display: grid; grid-template-columns: repeat(4, 1fr); }
#nav button { background: none; border-radius: 0; min-height: var(--navH); flex-direction: column; gap: 3px; font-size: 11px; font-weight: 500; padding: 6px 2px; color: #8e8e93; }
#nav button svg { width: 25px; height: 25px; }
#nav button[aria-current=page] { color: var(--accent); }
#nav button:active { transform: none; }
.badge { display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 999px; background: #ff3b30; color: #fff; font-size: 11px; line-height: 18px; font-weight: 600; }

#toast { position: fixed; left: 50%; bottom: calc(var(--navH) + 16px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: rgba(29,29,31,.92); color: #fff; padding: 10px 18px; border-radius: 14px; font-size: 15px; display: none; z-index: 20; max-width: calc(100% - 32px); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
#toast.show { display: block; }

.backbar { display: flex; align-items: center; gap: 8px; margin: 0 -8px 2px; }
.backbar button { min-height: 40px; padding: 4px 8px; background: none; font-weight: 500; }

details.card > summary { cursor: pointer; font-weight: 600; color: var(--accent); }

@media (min-width: 900px) {
  #app { padding-top: 32px; }
  h1 { font-size: 34px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ===== 学習アプリ風（講座カード・レッスンの道すじ・答えのシート） ===== */
.courses { display: grid; gap: 14px; }
@media (min-width: 640px) { .courses { grid-template-columns: 1fr 1fr; } }
.course { background: var(--surface); border-radius: 20px; box-shadow: var(--shadow); overflow: hidden; display: grid; text-align: left; padding: 0; color: var(--ink); font-weight: 400; width: 100%; }
.course-head { display: flex; align-items: center; gap: 12px; padding: 16px; color: #fff; }
.course-head .app-ic { background: rgba(255,255,255,.22) !important; box-shadow: none; }
.course-head .ct { font-size: 20px; font-weight: 700; line-height: 1.2; }
.course-head .cs { font-size: 13px; opacity: .9; }
.course-body { padding: 14px 16px 16px; display: grid; gap: 8px; }
.course-body .meter { margin-top: 0; height: 8px; }
.course-next { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: var(--surface2); border-radius: 12px; padding: 10px 12px; }
.course-next .nt { font-weight: 600; font-size: 15px; }
.course-next .play { width: 36px; height: 36px; border-radius: 50%; background: var(--accent); color: #fff; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.course-next .play svg { width: 16px; height: 16px; }
.h-sugaku { background: linear-gradient(135deg, #2f8cff, #0a5fd6); }
.h-kokugo { background: linear-gradient(135deg, #ff5f7a, #d81b3b); }
.h-eigo { background: linear-gradient(135deg, #b46cf0, #7d38c9); }
.h-rika { background: linear-gradient(135deg, #3fcf72, #1b8f43); }
.h-shakai { background: linear-gradient(135deg, #ffad33, #e86f00); }

.path { position: relative; display: grid; gap: 0; margin: 8px 0 12px; }
.path-item { display: grid; grid-template-columns: 44px 1fr auto; gap: 12px; align-items: center; padding: 10px 4px; background: none; color: var(--ink); text-align: left; font-weight: 400; border-radius: 14px; width: 100%; position: relative; }
.path-item:hover { background: var(--surface); }
.path-item::before { content: ""; position: absolute; left: 25px; top: -6px; bottom: -6px; width: 3px; background: var(--line); z-index: 0; }
.path-item:first-child::before { top: 50%; }
.path-item:last-child::before { bottom: 50%; }
.path-item .dot { width: 44px; height: 44px; border-radius: 50%; background: var(--surface); box-shadow: inset 0 0 0 3px var(--line); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; color: var(--muted); position: relative; z-index: 1; font-size: 15px; }
.path-item.done .dot { background: var(--green); color: #fff; box-shadow: none; }
.path-item.now .dot { background: var(--accent); color: #fff; box-shadow: 0 0 0 5px var(--accentSoft); }
.path-item.tried .dot { box-shadow: inset 0 0 0 3px var(--accent); color: var(--accent); }
.path-item .dot svg { width: 22px; height: 22px; }
.path-item .pt { font-weight: 600; display: block; line-height: 1.35; }
.path-item .ps { font-size: 13px; color: var(--muted); display: block; }
.path-item .now-tag { font-size: 12px; font-weight: 700; color: var(--accent); background: var(--accentSoft); border-radius: 999px; padding: 2px 8px; white-space: nowrap; }

/* レッスン中：下のメニューを隠して集中する */
/* 問題・講義のとちゅうは下のメニューを隠す（じゃまにならないように。やめるときは左上の×） */
body.lesson #nav { display: none; }
body.lesson #app { padding-bottom: calc(150px + env(safe-area-inset-bottom)); }
.lesson-top { display: flex; align-items: center; gap: 12px; margin: 0 0 14px; }
.lesson-top .x { width: 40px; height: 40px; min-height: 40px; padding: 0; border-radius: 50%; background: var(--surface2); color: var(--muted); font-size: 20px; flex: none; }
.segbar { flex: 1; display: grid; gap: 4px; }
.segbar > i { height: 8px; border-radius: 999px; background: var(--line); display: block; }
.segbar > i.ok { background: var(--green); }
.segbar > i.ng { background: #ff9f0a; }
.segbar > i.cur { background: var(--accent); }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 15; background: var(--surface); box-shadow: 0 -6px 24px rgba(0,0,0,.08); border-radius: 22px 22px 0 0; padding: 16px max(16px, env(safe-area-inset-left)) calc(16px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-right)); }
.sheet .in { max-width: 720px; margin: 0 auto; display: grid; gap: 12px; }
.sheet.ok { background: #effaf2; }
.sheet.ng { background: #fff4f0; }
.sheet .st { display: flex; align-items: center; gap: 12px; font-size: 20px; font-weight: 700; }
.sheet.ok .st { color: #1b6b30; }
.sheet.ng .st { color: #b3261e; }
.sheet .st .badge-ic { width: 44px; height: 44px; background: #fff; }
.today-lessons { display: grid; gap: 10px; }
.lesson-card { display: grid; grid-template-columns: 48px 1fr auto; gap: 12px; align-items: center; background: var(--surface); border-radius: 16px; box-shadow: var(--shadow); padding: 12px 14px; text-align: left; color: var(--ink); font-weight: 400; width: 100%; }
.lesson-card.done { opacity: .6; }
.lesson-card .lt { font-weight: 700; display: block; }
.lesson-card .ls { font-size: 13px; color: var(--muted); display: block; }
.lesson-card .go { width: 34px; height: 34px; border-radius: 50%; background: var(--accent); color: #fff; display: inline-flex; align-items: center; justify-content: center; }
.lesson-card.done .go { background: var(--green); }
.lesson-card .go svg { width: 16px; height: 16px; }
.lesson-card .icon-tile { width: 48px; height: 48px; border-radius: 14px; display: inline-flex; align-items: center; justify-content: center; color: #fff; }
.lesson-card .icon-tile svg { width: 26px; height: 26px; }
.tile-routine { background: linear-gradient(135deg, #ff6b6b, #e5484d); }
.tile-review { background: linear-gradient(135deg, #5ac8fa, #0a84ff); }
.tile-q { background: linear-gradient(135deg, #34c759, #248a3d); }
.tile-time { background: linear-gradient(135deg, #ffcc00, #ff9500); }

/* ===== 講座の作り（章・レッスン・講義） ===== */
.page-head { display: flex; align-items: center; gap: 14px; margin: 8px 0 14px; }
.page-head h1 { margin: 0; }
.page-head .icon-tile { width: 52px; height: 52px; border-radius: 15px; display: inline-flex; align-items: center; justify-content: center; color: #fff; flex: none; }
.page-head .icon-tile svg { width: 28px; height: 28px; }
.tile-gray { background: linear-gradient(135deg, #a1a1a6, #6e6e73); }
.course-hero, .lesson-hero { border-radius: 22px; padding: 20px 18px; color: #fff; margin: 4px 0 16px; box-shadow: var(--shadow); }
.course-hero .app-ic { background: rgba(255,255,255,.22) !important; }
.course-hero .ct { font-size: 26px; font-weight: 700; line-height: 1.2; }
.course-hero .cs, .lesson-hero .cs { font-size: 14px; opacity: .92; }
.hero-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 16px; }
.hero-stats > div { background: rgba(255,255,255,.18); border-radius: 12px; padding: 8px 10px; }
.hero-stats b { display: block; font-size: 18px; }
.hero-stats span { font-size: 12px; opacity: .9; }
.hero-meter { height: 8px; background: rgba(255,255,255,.3); border-radius: 999px; overflow: hidden; margin-top: 12px; }
.hero-meter > span { display: block; height: 100%; background: #fff; border-radius: 999px; }
.chapter { background: var(--surface); border-radius: 20px; box-shadow: var(--shadow); padding: 6px 12px 8px; margin: 12px 0; }
.chapter-head { display: flex; align-items: baseline; gap: 8px; padding: 10px 4px 4px; flex-wrap: wrap; }
.chapter-no { font-size: 12px; font-weight: 700; color: var(--accent); }
.chapter-t { font-size: 18px; font-weight: 700; }
.chapter-sub { font-size: 12px; color: var(--muted); background: var(--surface2); border-radius: 999px; padding: 1px 8px; }
.chapter-prog { margin-left: auto; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.pills { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.pill { font-size: 12px; font-weight: 600; border-radius: 999px; padding: 1px 8px; background: var(--surface2); color: var(--muted); }
.pill.on { background: var(--accentSoft); color: var(--accent); }
.pill.ok { background: var(--okSoft); color: var(--green); }
.path-item .chev { width: 16px; height: 16px; color: var(--faint); }
.steps-v { display: grid; gap: 10px; }
.step-card { display: grid; grid-template-columns: 40px 1fr auto; gap: 12px; align-items: center; width: 100%; text-align: left; background: var(--surface); color: var(--ink); font-weight: 400; border-radius: 18px; box-shadow: var(--shadow); padding: 16px; }
.step-card .sn { width: 40px; height: 40px; border-radius: 50%; background: var(--surface2); color: var(--muted); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; }
.step-card.next { box-shadow: inset 0 0 0 2px var(--accent), var(--shadow); }
.step-card.next .sn { background: var(--accent); color: #fff; }
.step-card.done .sn { background: var(--green); color: #fff; }
.step-card .stt { display: block; font-weight: 700; font-size: 17px; }
.step-card .sts { display: block; font-size: 13px; color: var(--muted); }
.step-card .state { font-size: 14px; font-weight: 600; color: var(--accent); white-space: nowrap; }
.step-card.done .state { color: var(--green); }

/* ===== ガオ先生 ===== */
.dino-badge { background: #eaf7e4 !important; }
.dino-badge svg { width: 30px !important; height: 30px !important; }
.owl-big .dino-badge svg { width: 54px !important; height: 54px !important; }
.talk { display: grid; grid-template-columns: 84px 1fr; gap: 10px; align-items: end; margin: 6px 0 14px; }
.talk .sensei { width: 84px; height: 84px; display: block; }
.talk.big { grid-template-columns: 112px 1fr; }
.talk.big .sensei { width: 112px; height: 112px; }
.talk .say { position: relative; background: var(--surface); border-radius: 18px 18px 18px 6px; padding: 12px 14px; box-shadow: var(--shadow); font-weight: 600; line-height: 1.55; margin-bottom: 18px; }
.talk .say .who { display: block; font-size: 12px; color: #2c7a46; font-weight: 700; margin-bottom: 2px; }
.talk .say .act { margin-top: 10px; }
.sheet .talk { margin: 0; grid-template-columns: 64px 1fr; }
.sheet .talk .sensei { width: 64px; height: 64px; }
.sheet .talk .say { margin-bottom: 8px; box-shadow: none; }

/* ===== 学習時間のダッシュボード ===== */
.dash-tiles { display: grid; grid-template-columns: 1.25fr 1fr 1fr; gap: 10px; margin: 6px 0 12px; }
.dash-tile { background: var(--surface); border-radius: 16px; box-shadow: var(--shadow); padding: 12px; min-width: 0; }
.dash-tile .k { font-size: 12px; color: var(--muted); font-weight: 600; line-height: 1.3; }
.dash-tile .v { font-size: 22px; font-weight: 700; line-height: 1.25; margin-top: 4px; font-variant-numeric: tabular-nums; }
.dash-tile .v small { font-size: 12px; color: var(--muted); font-weight: 600; }
.wdots { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; margin-top: 6px; }
.wdots i { font-style: normal; font-size: 10px; text-align: center; border-radius: 6px; padding: 1px 0; color: var(--muted); background: var(--surface2); }
.wdots i.on { background: var(--accent); color: #fff; font-weight: 700; }
.wdots i.off { background: var(--surface2); }
.week-card { display: grid; grid-template-columns: 150px 1fr; gap: 14px; align-items: start; }
.week-card .k { font-size: 13px; color: var(--muted); font-weight: 600; }
.ring-wrap { position: relative; width: 150px; height: 150px; margin-top: 6px; }
.ring-wrap .big-ring { width: 150px; height: 150px; display: block; }
.ring-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.ring-center .v { font-size: 22px; font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; }
.ring-center .v small { font-size: 12px; color: var(--muted); }
.ring-center .s { font-size: 12px; color: var(--muted); margin-top: 2px; }
.week-right .goal { font-size: 20px; font-weight: 700; }
.week-right .goal small { font-size: 12px; color: var(--muted); }
.week-right .week-bars { width: 100%; height: auto; display: block; margin-top: 6px; }
@media (max-width: 400px) {
  .dash-tiles { grid-template-columns: 1fr 1fr; }
  .dash-tiles .dash-tile:first-child { grid-column: 1 / -1; }
  .week-card { grid-template-columns: 1fr; }
  .ring-wrap { margin: 6px auto 0; }
}
.week-right .week-bars { max-height: 190px; }

/* ===== 今日のルーティン・問い ===== */
.routine-card .rt-time { font-size: 34px; font-weight: 700; line-height: 1.15; font-variant-numeric: tabular-nums; }
.routine-card .rt-time small { font-size: 16px; color: var(--muted); font-weight: 600; }
.rt-bar { height: 10px; border-radius: 999px; background: var(--surface2); overflow: hidden; margin: 10px 0 12px; }
.rt-bar > span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #0a84ff, #30d158); }
.rt-flow { display: flex; align-items: center; gap: 6px; margin-bottom: 12px; }
.rt-flow span { flex: 1; text-align: center; font-size: 13px; font-weight: 700; padding: 6px 4px; border-radius: 10px; background: var(--surface2); color: var(--muted); }
.rt-flow span.cur { background: var(--accent); color: #fff; }
.rt-flow span.done { background: var(--okSoft); color: var(--green); }
.rt-flow i { width: 8px; height: 2px; background: var(--line); flex: none; }
.stepno { display: inline-flex; width: 20px; height: 20px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 12px; align-items: center; justify-content: center; margin-right: 6px; vertical-align: 2px; }
.lesson-card.done .stepno { background: var(--green); }
.qask { background: var(--surface); border-radius: 18px; box-shadow: var(--shadow); padding: 14px 16px; margin: 10px 0 12px; border-left: 6px solid var(--accent); }
.qlabel { display: inline-block; font-size: 12px; font-weight: 700; color: var(--accent); background: var(--accentSoft); border-radius: 999px; padding: 1px 10px; }
.qask .qtext { font-size: 24px; line-height: 1.45; margin: 6px 0 0; }
.qlabel.qno { font-size: 18px; padding: 3px 14px; background: var(--accent); color: #fff; }
.rt-sub { display: flex; justify-content: space-between; font-size: 14px; color: var(--muted); margin-top: 12px; }
.rt-sub b { color: var(--ink); font-variant-numeric: tabular-nums; }
.routine-card.is-done { box-shadow: inset 0 0 0 2px #30d158, var(--shadow); }
.stamp-row { display: flex; align-items: center; gap: 14px; background: #fff5f5; border-radius: 16px; padding: 12px; margin-top: 12px; }
.stamp { width: 96px; height: 96px; flex: none; transform: rotate(-8deg); }
.stamp-text { display: grid; gap: 2px; font-size: 14px; color: var(--ink); }
.stamp-text b { font-size: 18px; color: #c4262e; }
.wdots i.star { background: #ffcc00; color: #7a4b00; font-weight: 700; }

/* ===== はじめの流れ（チャート） ===== */
.chart-flow { display: grid; gap: 0; }
.cf-step { display: grid; grid-template-columns: 44px 1fr; gap: 12px; position: relative; padding-bottom: 16px; }
.cf-step:last-child { padding-bottom: 0; }
.cf-step::before { content: ""; position: absolute; left: 21px; top: 44px; bottom: 0; width: 3px; background: var(--line); }
.cf-step:last-child::before { display: none; }
.cf-dot { width: 44px; height: 44px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 18px; background: var(--surface2); color: var(--muted); position: relative; z-index: 1; }
.cf-dot svg { width: 20px; height: 20px; }
.cf-step.cur .cf-dot { background: var(--accent); color: #fff; box-shadow: 0 0 0 5px var(--accentSoft); }
.cf-step.done .cf-dot { background: var(--green); color: #fff; }
.cf-t { font-weight: 700; font-size: 18px; line-height: 1.3; margin-top: 2px; }
.cf-s { font-size: 14px; color: var(--muted); margin: 2px 0 10px; }
.cf-step.lock .cf-t { color: var(--muted); }
/* はじめにやること：赤で目立たせる */
.start-card { box-shadow: inset 0 0 0 3px #e5484d, var(--shadow); }
.start-title { font-size: 22px; font-weight: 800; color: #c4262e; margin-bottom: 14px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.start-badge { font-size: 13px; font-weight: 700; color: #fff; background: #e5484d; border-radius: 999px; padding: 3px 12px; }
.start-card .cf-step.cur .cf-dot { background: #e5484d; box-shadow: 0 0 0 5px #fde3e4; }
.start-card .cf-step.cur .cf-t { font-size: 22px; color: #c4262e; }
.btn-red { background: #e5484d !important; color: #fff !important; font-size: 19px; min-height: 60px; box-shadow: 0 6px 16px rgba(229,72,77,.3); }
.btn-red:hover { background: #d93d42 !important; }
/* テスト用の目印 */
#testBanner { position: sticky; top: 0; z-index: 30; background: #ff9500; color: #fff; font-weight: 800; font-size: 14px; text-align: center; padding: 8px max(16px, env(safe-area-inset-left)) 8px max(16px, env(safe-area-inset-right)); padding-top: calc(8px + env(safe-area-inset-top)); letter-spacing: .04em; }

/* 実力チェックでクリアした学年の章（復習用としては開ける） */
.chapter.is-done { opacity: .45; filter: grayscale(1); }

/* 今日のノルマ：見出しと「今日の学習時間」を大きく */
.norma-title { font-size: 22px; font-weight: 800; line-height: 1.2; }
.today-time { background: #fff5f5; border: 1.5px solid #ffd1d6; border-radius: 16px; padding: 12px 14px 4px; margin: 14px 0 14px; }
.tt-label { color: #d70015; font-size: 17px; font-weight: 800; }
.tt-v { font-size: 42px; font-weight: 800; line-height: 1.15; font-variant-numeric: tabular-nums; color: var(--ink); display: flex; align-items: baseline; gap: 6px; }
.tt-v small { font-size: 18px; font-weight: 700; color: var(--ink); }
.tt-goal { margin-left: auto; font-size: 15px; font-weight: 700; color: var(--muted); }
.today-time .rt-bar { margin: 6px 0 10px; }
.dash-tile .k.tt-red { color: #d70015; font-size: 15px; font-weight: 800; }
.lesson-card .lk { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 800; color: var(--muted); margin-bottom: 2px; }
.lesson-card .lk .stepno { margin: 0; }
.lesson-top .live-min { font-size: 13px; font-weight: 800; color: #d70015; white-space: nowrap; font-variant-numeric: tabular-nums; }
/* 今日のノルマ：1から順番に（いまやる1つを赤、まだの分は鍵） */
.lesson-card.cur { outline: 3px solid #d70015; outline-offset: -3px; background: #fff5f5; }
.lesson-card.cur .stepno { background: #d70015; width: 24px; height: 24px; font-size: 14px; }
.lesson-card.cur .lk { color: #d70015; }
.lesson-card.cur .go { background: #d70015; }
.lesson-card.lock { opacity: .45; filter: grayscale(1); cursor: not-allowed; }
.lesson-card.lock .go { background: #aeaeb2; }
.lesson-card.done .stepno { background: var(--green); }
.now-pill { background: #d70015; color: #fff; font-size: 12px; font-weight: 800; padding: 2px 9px; border-radius: 999px; margin-left: 4px; }
/* 今日のノルマ：全体の文字を大きめに（11/13） */
.routine-card .norma-title { font-size: 24px; }
.routine-card .norma-title + .small { font-size: 15px; }
.routine-card .status-pill { font-size: 17px; font-weight: 800; padding: 7px 14px; }
.routine-card .lesson-card { padding: 14px 14px; gap: 14px; }
.routine-card .lesson-card .lk { font-size: 15px; gap: 8px; margin-bottom: 4px; }
.routine-card .lesson-card .stepno { width: 30px; height: 30px; font-size: 17px; font-weight: 800; }
.routine-card .lesson-card.cur .stepno { width: 34px; height: 34px; font-size: 19px; }
.routine-card .lesson-card .lt { font-size: 19px; line-height: 1.3; }
.routine-card .lesson-card .ls { font-size: 15px; line-height: 1.4; margin-top: 2px; }
.routine-card .lesson-card .go { width: 40px; height: 40px; }
.routine-card .lesson-card .go svg { width: 19px; height: 19px; }
.routine-card .now-pill { font-size: 14px; padding: 3px 10px; }
.routine-card > p.small { font-size: 15px; line-height: 1.5; }
/* ホームのガオ先生：吹き出しを小さめに。やることは赤 */
.talk.home-talk { grid-template-columns: 84px 1fr; align-items: end; gap: 8px; margin: 4px 0 10px; }
.talk.home-talk .sensei { width: 84px; height: 84px; }
.talk.home-talk .say { padding: 9px 12px; font-size: 15px; line-height: 1.5; margin-bottom: 10px; }
.talk.home-talk .say .who { font-size: 11px; margin-bottom: 0; }
.talk .say .do-red { color: #d70015; font-weight: 800; }
/* 保護者の端末：1行の知らせ */
.parent-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; background: #fff8ec; border: 1px solid #ffd59e; color: #b25000; border-radius: 10px; padding: 7px 12px; margin: 0 0 10px; font-size: 13px; font-weight: 700; text-decoration: none; }
.parent-bar b { white-space: nowrap; }
/* ノルマのあとのおかわり */
.okawari { background: #fffbea; border: 2px dashed #f5b400; border-radius: 14px; padding: 10px 12px; }
.okawari .okw-t { font-weight: 800; color: #9a6a00; margin-bottom: 6px; }

/* 答え合わせ：画面の真ん中に大きく出して、少したつと消える（正解＝青・不正解＝赤） */
.judge { position: fixed; left: 50%; top: 42%; z-index: 60; pointer-events: none; display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 200px; padding: 22px 34px 18px; border-radius: 28px; background: rgba(255,255,255,.96); box-shadow: 0 12px 40px rgba(0,0,0,.18); transform: translate(-50%, -50%); animation: judgePop .3s cubic-bezier(.2,1.4,.4,1), judgeOut .35s ease-in 1.3s forwards; }
.judge-mark { display: grid; place-items: center; width: 92px; height: 92px; border-radius: 50%; font-size: 64px; font-weight: 900; line-height: 1; color: #fff; }
.judge-t { font-size: 34px; font-weight: 900; letter-spacing: .1em; }
.judge.ok .judge-mark { background: #0a6cff; } .judge.ok .judge-t { color: #0a6cff; }
.judge.ng .judge-mark { background: #d70015; } .judge.ng .judge-t { color: #d70015; }
@keyframes judgePop { from { transform: translate(-50%, -50%) scale(.5); opacity: 0; } to { transform: translate(-50%, -50%) scale(1); opacity: 1; } }
@keyframes judgeOut { to { transform: translate(-50%, -50%) scale(.9); opacity: 0; visibility: hidden; } }
@media (prefers-reduced-motion: reduce) { .judge { animation: judgeOut .2s linear 1.3s forwards; } }

/* 解説の最後の答え：赤でひと目で分かるように */
.answer-box { display: flex; align-items: center; gap: 12px; margin: 14px 0 4px; padding: 14px 16px; border-radius: var(--radius); background: #fff0f1; box-shadow: inset 0 0 0 2px #d70015; }
.answer-box .ab-label { flex: none; background: #d70015; color: #fff; font-weight: 800; font-size: 15px; padding: 4px 12px; border-radius: 999px; }
.answer-box .ab-v { font-size: 22px; font-weight: 800; color: #b3000f; line-height: 1.4; }

/* 解説の「つづきを見る」：赤に近いオレンジ（答えを見る・もう一回は赤） */
.btn-coral { background: #f07a3c !important; color: #fff !important; font-size: 19px; min-height: 60px; box-shadow: 0 6px 16px rgba(240,122,60,.3); }
.btn-coral:hover { background: #e46a2c !important; }

/* スマホで短い言葉が途中で折り返さないように（「レッスン」「いまここ」など） */
.lesson-card .lk { white-space: nowrap; flex-wrap: nowrap; }
.now-pill, .status-pill, .stepno { white-space: nowrap; flex: none; }
body { line-break: strict; }
h1, h2, .lt, .norma-title { word-break: auto-phrase; }

/* ホームの見出し：タイトルと日付を1行で真ん中に（スクロールを少なく） */
.home-head { display: flex; align-items: baseline; justify-content: center; gap: 10px; margin: 2px 0 8px; }
.home-head .hh-t { font-size: 24px; font-weight: 800; letter-spacing: .02em; }
.home-head .hh-date { font-size: 15px; font-weight: 700; color: var(--muted); }
/* テストまでの日数：真ん中にそろえて「あと◯日」を大きく */
.count > div { text-align: center; padding: 12px 10px; }
.count .cd-t { font-size: 14px; font-weight: 800; color: var(--muted); }
.count .days { font-size: 34px; font-weight: 800; color: #d70015; margin: 2px 0; }
.count .days small { font-size: 15px; font-weight: 800; color: #d70015; margin: 0 2px; }
.count .cd-date { font-size: 14px; font-weight: 700; margin-bottom: 6px; }
.count .cd-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; }

/* テストまでの日数：見出しのすぐ下に小さくまとめる */
.home-head + .count { margin: 0 0 10px; gap: 8px; }
.home-head + .count > div { padding: 8px 8px 10px; }
.home-head + .count .days { font-size: 28px; margin: 0; line-height: 1.15; }
.home-head + .count .cd-date { margin-bottom: 4px; font-size: 13px; }
.home-head + .count .cd-t { font-size: 13px; }
/* 学習時間：たたんで今週の分と目標だけ。押すと開く */
.dash-fold { padding: 12px 14px; }
.dash-fold > summary { list-style: none; cursor: pointer; display: grid; grid-template-columns: auto auto 1fr auto; align-items: baseline; gap: 6px; }
.dash-fold > summary::-webkit-details-marker { display: none; }
.dash-fold .df-k { font-size: 14px; font-weight: 800; color: var(--muted); }
.dash-fold .df-v { font-size: 22px; font-weight: 800; }
.dash-fold .df-goal { font-size: 14px; font-weight: 700; color: var(--muted); }
.dash-fold .df-pct { font-size: 14px; font-weight: 800; color: var(--accent); }
.dash-fold .df-pct::after { content: ' ▼'; font-size: 11px; color: var(--muted); }
.dash-fold:not([open]) .df-pct::after { content: ' ▶'; }
.dash-fold .df-bar { grid-column: 1 / -1; height: 8px; border-radius: 6px; background: var(--surface2); overflow: hidden; }
.dash-fold .df-bar > span { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, #0a84ff, #34c759); }
.dash-fold[open] > summary { margin-bottom: 12px; }
.dash-fold .week-card { box-shadow: none; padding: 0; margin: 12px 0 0; }

/* テストまでの日数：日めくりカレンダー（案A） */
.count.cal { gap: 10px; margin: 0 0 12px; }
.count.cal > .cal-page { padding: 0; text-align: center; overflow: visible; position: relative; border-radius: 14px; background: var(--surface); box-shadow: 0 1px 2px rgba(0,0,0,.06), 0 6px 0 -3px var(--surface2), 0 6px 0 -2px var(--line); }
.cal-top { position: relative; display: flex; align-items: center; justify-content: center; gap: 6px; background: #e5484d; color: #fff; font-size: 13px; font-weight: 800; padding: 7px 4px 6px; border-radius: 14px 14px 0 0; letter-spacing: .02em; }
.cal-top i { position: absolute; top: -6px; width: 7px; height: 13px; border-radius: 4px; background: #8e8e93; box-shadow: inset 0 0 0 1.5px #636366; }
.cal-top i:first-child { left: 22%; } .cal-top i:last-child { right: 22%; }
.cal-body { padding: 6px 0 2px; }
.cal-ato { font-size: 13px; font-weight: 800; color: var(--muted); line-height: 1; }
.cal-num { font-size: 46px; font-weight: 900; line-height: 1.05; color: #d70015; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.cal-num small { font-size: 17px; font-weight: 800; margin-left: 2px; letter-spacing: 0; }
.cal-num.today { font-size: 30px; padding: 8px 0 6px; }
.cal-foot { border-top: 1.5px dashed var(--line); margin: 4px 10px 0; padding: 6px 0 9px; }
.cal-date { font-size: 13px; font-weight: 800; margin-bottom: 4px; }
.cal-page.is-near .cal-top, .cal-page.is-today .cal-top { background: #d70015; }
.cal-page.is-today { box-shadow: 0 0 0 2px #d70015; }
.count.cal.flip .cal-page { animation: calFlip .55s cubic-bezier(.2,.8,.3,1); transform-origin: 50% 0; }
.count.cal.flip .cal-page:nth-child(2) { animation-delay: .12s; }
@keyframes calFlip { 0% { transform: perspective(500px) rotateX(-40deg); } 65% { transform: perspective(500px) rotateX(6deg); } 100% { transform: perspective(500px) rotateX(0); } }
.cal-foot .cd-chips { flex-wrap: nowrap; gap: 3px; }
.cal-foot .chip { font-size: 11px; padding: 2px 6px; white-space: nowrap; }
@media (prefers-reduced-motion: reduce) { .count.cal.flip .cal-page { animation: none; } }
/* 日めくりを一回り小さく：スマホ（画面がせまいとき）だけ。パソコンは前の大きさ */
@media (max-width: 600px) {
.count.cal { max-width: 300px; margin-left: auto; margin-right: auto; gap: 8px; }
.cal-top { font-size: 12px; padding: 5px 4px 4px; }
.cal-top i { top: -5px; width: 6px; height: 11px; }
.cal-body { padding: 3px 0 0; }
.cal-ato { font-size: 11px; }
.cal-num { font-size: 36px; }
.cal-num small { font-size: 14px; }
.cal-foot { margin: 3px 8px 0; padding: 4px 0 7px; }
.cal-date { font-size: 12px; margin-bottom: 3px; }
}
/* ガオ先生の絵（画像） */
.talk img.sensei { object-fit: contain; flex: none; }
.dino-badge img, .badge-ic img.owl { width: 34px; height: 34px; object-fit: contain; }
.owl-big .dino-badge img { width: 60px; height: 60px; }
.owl-gao { width: 64px; height: 64px; object-fit: contain; flex: none; }
/* ガオ先生の吹き出し：白地にうすい緑のふち＋ガオ先生のほうへ「しっぽ」（アプリ全体） */
.talk { column-gap: 14px; }
.talk.home-talk { column-gap: 14px; }
.talk .say { background: #fff; border: 2px solid #bfe3a4; border-radius: 18px; box-shadow: 0 2px 0 #e2f2d8; }
.talk .say::before, .talk .say::after { content: ''; position: absolute; width: 0; height: 0; border-style: solid; }
.talk .say::before { left: -13px; bottom: 14px; border-width: 9px 13px 9px 0; border-color: transparent #bfe3a4 transparent transparent; }
.talk .say::after { left: -9px; bottom: 16px; border-width: 7px 10px 7px 0; border-color: transparent #fff transparent transparent; }
.sheet .talk .say { box-shadow: none; }
.math-big .nw { display: inline-block; white-space: nowrap; }

/* 設定の欄：閉じたり開いたり */
.sfold { margin: 0 0 10px; }
.sfold > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; font-weight: 800; }
.sfold > summary::-webkit-details-marker { display: none; }
.sfold > summary .sf-t { flex: 1; }
.sfold > summary .sf-v { font-size: 14px; font-weight: 700; color: var(--muted); text-align: right; }
.sfold > summary::after { content: '▼'; font-size: 11px; color: var(--muted); transition: transform .15s; }
.sfold:not([open]) > summary::after { transform: rotate(-90deg); }
.sfold[open] > summary { border-radius: var(--radius) var(--radius) 0 0; box-shadow: none; border-bottom: 1px solid var(--line); }
.sfold > .sf-body > .card { margin-top: 0; border-top-left-radius: 0; border-top-right-radius: 0; }
.dev-row { padding: 8px 0; border-top: 1px solid var(--line); } .dev-row:first-child { border-top: 0; }
.dev-me { margin-left: 8px; font-size: 12px; padding: 1px 8px; }

/* はんこ（画像）：ポンと押す */
.stamp-img { width: 120px; height: 120px; object-fit: contain; transform: rotate(-8deg); }
.stamp-img.pop { animation: stampIn .28s ease-out; }
.stamp-row .stamp-img { width: 104px; height: 104px; flex: none; }
.owl-big .stamp-img { width: 132px; height: 132px; }
@keyframes stampIn { 0% { transform: scale(1.35) rotate(-8deg); } 100% { transform: scale(1) rotate(-8deg); } }
@media (prefers-reduced-motion: reduce) { .stamp-img.pop { animation: none; } }
.tg { display: inline-block; vertical-align: middle; line-height: 1.3; padding: 2px 6px; }

/* 保護者の端末の帯（テスト用の帯と同じ形・赤） */
#roleBanner { position: sticky; top: 0; z-index: 29; display: flex; align-items: center; justify-content: center; gap: 12px; background: #d70015; color: #fff; font-weight: 800; font-size: 14px; padding: 7px max(16px, env(safe-area-inset-left)); text-decoration: none; }
#roleBanner b { background: rgba(255,255,255,.2); border-radius: 999px; padding: 2px 10px; font-size: 13px; white-space: nowrap; }
body:not(.is-test) #roleBanner { padding-top: calc(7px + env(safe-area-inset-top)); }
