/* 土台：部品の並べ方と大きさ。色・文字・形は、下の変数を見た目の案（design1〜3.css）が上書きする。 */
:root {
  --page: #e9e9e6;
  --bg: #f6f6f4;
  --surface: #ffffff;
  --ink: #23262a;
  --muted: #666b72;
  --line: #d3d5d8;
  --accent: #3b5b7a;
  --on-accent: #ffffff;
  --accent-soft: #e3ebf2;
  --warn: #9a4a1c;
  --warn-soft: #f6e7dc;
  --good: #2f6b4a;
  --good-soft: #e1efe6;
  --rest-soft: #ececec;
  --radius: 10px;
  --radius-s: 6px;
  --radius-btn: 10px;
  --border: 1px;
  --shadow: none;
  --font: system-ui, -apple-system, 'Hiragino Sans', 'Noto Sans JP', sans-serif;
  --font-head: var(--font);
  --head-weight: 700;
  --stroke: 1.800;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--page); color: var(--ink); font-family: var(--font); font-weight: var(--body-weight, 400); font-size: 16px; line-height: 1.6; overflow-wrap: anywhere; }
h1, h2, p, ul, ol, fieldset, legend { margin: 0; padding: 0; }
ul, ol { list-style: none; }
fieldset { border: 0; min-width: 0; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; text-align: inherit; -webkit-tap-highlight-color: transparent; }
button:disabled { cursor: default; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }
b { font-weight: 700; }

.ic { width: 24px; height: 24px; flex: none; fill: none; stroke: currentColor; stroke-width: var(--stroke); stroke-linecap: round; stroke-linejoin: round; }

/* 見本の枠（アプリの画面ではない所）。どの案でも同じ見た目 */
.mockbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 5px 10px; background: #1f2326; color: #fff; font: 500 12px/1.4 system-ui, sans-serif; }
.mockbar-top { flex: none; padding: 6px 10px; border: 1px solid #6c7379; border-radius: 6px; color: #fff; }
.mockbar-now { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #c9ced2; }
.designs { flex: none; display: flex; border: 1px solid #6c7379; border-radius: 6px; overflow: hidden; }
.designs button { min-width: 40px; min-height: 30px; padding: 4px 8px; color: #c9ced2; text-align: center; }
.designs button + button { border-left: 1px solid #6c7379; }
.designs button[aria-pressed='true'] { background: #fff; color: #1f2326; font-weight: 700; }
.mocknote { max-width: 480px; margin: 0 auto; padding: 8px 12px; background: #fffbe8; color: #4a4636; border-bottom: 1px dashed #b9b08a; font: 400 12px/1.6 system-ui, sans-serif; }
.mockctl { width: 100%; padding: 10px; border: 1px dashed var(--muted); border-radius: var(--radius-s); display: grid; gap: 8px; }
.mockctl-label { font-size: 12px; color: var(--muted); }
.kari { display: inline-block; margin-left: 6px; padding: 0 5px; border: 1px solid currentColor; border-radius: 4px; font: 400 10px/1.5 system-ui, sans-serif; color: var(--muted); vertical-align: middle; white-space: nowrap; }

/* 画面の入れ物 */
.phone { max-width: 480px; margin: 0 auto; min-height: calc(100vh - 40px); background: var(--bg); display: flex; flex-direction: column; }
.scr { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.apphead { display: flex; align-items: center; gap: 4px; min-height: 52px; padding: 4px 8px; }
.apphead h1 { flex: 1; min-width: 0; font: var(--head-weight) 18px/1.35 var(--font-head); }
.apphead-right { flex: none; max-width: 50%; }
.iconbtn { flex: none; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; }
.iconbtn-space { flex: none; width: 8px; }
.body { flex: 1; display: flex; flex-direction: column; gap: 14px; padding: 8px 16px 28px; min-width: 0; }
.body > * { min-width: 0; }
.body-center { align-items: center; text-align: center; }
.body-center > .btn, .body-center > .stack, .body-center > .card, .body-center > .mockctl { align-self: stretch; }
.stack { display: grid; gap: 10px; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pair > * { min-width: 0; }

.tabbar { position: sticky; bottom: 0; z-index: 5; display: flex; background: var(--surface); border-top: var(--border) solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.tab { flex: 1; min-width: 0; min-height: 56px; display: grid; justify-items: center; align-content: center; gap: 2px; font-size: 12px; color: var(--muted); }
.tab.is-on { color: var(--accent); font-weight: 700; }

/* 文字 */
.h2 { font: var(--head-weight) 20px/1.4 var(--font-head); }
.h3 { font: 700 13px/1.4 var(--font); color: var(--muted); margin-top: 6px; }
.lead { font: var(--head-weight) 17px/1.5 var(--font-head); }
.text { font-size: 15px; }
.fine { font-size: 13px; color: var(--muted); }
.links { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.textlink { font-size: 14px; color: var(--accent); text-decoration: underline; text-underline-offset: 3px; min-height: 32px; align-self: flex-start; }

/* カード・一覧 */
.card { background: var(--surface); border: var(--border) solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px; display: grid; gap: 10px; min-width: 0; }
.card > * { min-width: 0; }
.card-flat { box-shadow: none; }
.card-center { justify-items: center; text-align: center; }
.card-center > .btn { justify-self: stretch; }
.card-head { display: flex; align-items: center; gap: 8px; font: var(--head-weight) 15px/1.4 var(--font-head); }
.card-head .ic { width: 20px; height: 20px; }
.card-from { margin-left: auto; font: 400 12px/1.4 var(--font); color: var(--muted); }
.list { background: var(--surface); border: var(--border) solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.row { width: 100%; display: flex; align-items: center; gap: 10px; min-height: 56px; padding: 10px 12px; }
.row + .row { border-top: 1px solid var(--line); }
.row-ic { flex: none; display: grid; color: var(--muted); }
.row-main { flex: 1; min-width: 0; display: grid; gap: 4px; }
.row-title { font-size: 15px; font-weight: 700; }
.row-sub { font-size: 12px; color: var(--muted); }
.row-right { flex: none; display: grid; justify-items: end; gap: 4px; }
.row-next { flex: none; width: 18px; height: 18px; color: var(--muted); }
.row-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.row-point { display: flex; align-items: center; gap: 2px; font-size: 13px; font-weight: 700; }
.row-point .ic { width: 15px; height: 15px; }
.grade { margin-left: 8px; font-size: 12px; font-weight: 400; color: var(--muted); white-space: nowrap; }
.minibars { width: 49px; height: 18px; display: block; }
.plain { display: grid; }
.plain li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 0; font-size: 14px; }
.plain li + li { border-top: 1px solid var(--line); }
.plain li > span { min-width: 0; }
.plain li > b { flex: none; max-width: 60%; text-align: right; }
.plain li.is-undone { color: var(--muted); }
.mini { flex: none; min-height: 36px; padding: 4px 12px; border: var(--border) solid var(--accent); border-radius: var(--radius-btn); font-size: 13px; color: var(--accent); }
.tag { display: inline-block; padding: 1px 8px; border-radius: 99px; font-size: 11px; line-height: 1.7; border: 1px solid var(--line); background: var(--surface); }
.tag-good { background: var(--good-soft); border-color: transparent; color: var(--good); }
.tag-warn { background: var(--warn-soft); border-color: transparent; color: var(--warn); }
.tag-rest { background: var(--rest-soft); border-color: transparent; color: var(--muted); }

/* ボタン */
.btn { width: 100%; min-height: 50px; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 16px; border-radius: var(--radius-btn); border: var(--border) solid transparent; font-weight: 700; font-size: 16px; line-height: 1.35; text-align: center; }
.btn > span { min-width: 0; }
.btn-primary, .btn-big { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.btn-big { min-height: 64px; font-size: 20px; }
.btn-ghost { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn-danger { background: var(--surface); color: var(--warn); border-color: var(--warn); }
.btn:disabled { background: var(--rest-soft); color: var(--muted); border-color: var(--line); opacity: .75; box-shadow: none; }
.presshint { font-size: 12px; color: var(--muted); text-align: center; margin-bottom: -8px; }
.presshint.is-hidden { visibility: hidden; }
.seg { display: grid; grid-template-columns: 1fr 1fr; border: var(--border) solid var(--line); border-radius: var(--radius-btn); overflow: hidden; background: var(--surface); }
.seg-item { min-height: 44px; padding: 6px; text-align: center; font-size: 14px; }
.seg-item.is-on { background: var(--accent); color: var(--on-accent); font-weight: 700; }
.chips { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.chip { min-width: 56px; min-height: 44px; padding: 6px 14px; text-align: center; border: var(--border) solid var(--line); border-radius: 99px; background: var(--surface); font-weight: 700; }
.chip.is-on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }

/* 入力 */
.field { display: grid; gap: 4px; min-width: 0; }
.field-label, .group legend { font-size: 13px; font-weight: 700; }
.field-hint { font-size: 12px; color: var(--muted); }
.field input, .field select { width: 100%; min-width: 0; min-height: 48px; padding: 8px 12px; background: var(--surface); border: var(--border) solid var(--line); border-radius: var(--radius-s); font-size: 16px; }
.group { display: grid; gap: 8px; }
.group legend { margin-bottom: 8px; }
.choice, .check, .donecheck { display: flex; align-items: flex-start; gap: 10px; min-height: 48px; padding: 11px 12px; background: var(--surface); border: var(--border) solid var(--line); border-radius: var(--radius-s); font-size: 15px; cursor: pointer; }
.donecheck { width: 100%; align-items: center; }
.choice input, .check input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.choice-mark { flex: none; width: 22px; height: 22px; margin-top: 1px; border: 2px solid var(--muted); border-radius: 50%; }
.choice.is-on { border-color: var(--accent); background: var(--accent-soft); }
.choice.is-on .choice-mark { border-color: var(--accent); background: radial-gradient(var(--accent) 45%, transparent 50%); }
.choice-text, .check-text { flex: 1; min-width: 0; }
.check-mark { flex: none; width: 24px; height: 24px; margin-top: 0; border: 2px solid var(--muted); border-radius: 5px; display: grid; place-items: center; color: transparent; }
.check-mark .ic { width: 18px; height: 18px; stroke-width: 2.600; }
.check.is-on .check-mark, .donecheck.is-on .check-mark { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.choice:focus-within, .check:focus-within { outline: 3px solid var(--accent); outline-offset: 2px; }

/* 知らせ */
.notice { display: flex; align-items: flex-start; gap: 8px; padding: 10px 12px; background: var(--accent-soft); border-radius: var(--radius-s); font-size: 14px; text-align: left; }
.notice .ic { width: 20px; height: 20px; margin-top: 1px; color: var(--accent); }
.notice-warn { background: var(--warn-soft); }
.notice-warn .ic { color: var(--warn); }
.alert { width: 100%; display: flex; align-items: center; gap: 10px; padding: 12px; background: var(--warn-soft); border: var(--border) solid var(--warn); border-radius: var(--radius); font-size: 14px; font-weight: 700; }
.alert > span { flex: 1; min-width: 0; }
.alert-soft { background: var(--accent-soft); border-color: var(--accent); }
.card-alert { background: var(--warn-soft); border-color: var(--warn); }
.toast { position: fixed; left: 50%; bottom: calc(68px + env(safe-area-inset-bottom)); z-index: 30; transform: translateX(-50%); width: calc(100% - 24px); max-width: 456px; display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 14px; background: #1f2326; color: #fff; border-radius: 10px; font: 500 14px/1.5 system-ui, sans-serif; box-shadow: 0 6px 20px rgba(0, 0, 0, .25); }
.toast-text { flex: 1; min-width: 0; }
.toast-undo { flex: none; min-height: 40px; padding: 6px 14px; border: 1px solid #fff; border-radius: 8px; color: #fff; font-weight: 700; }

/* 登録・同意 */
.steps { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 13px; font-weight: 700; color: var(--muted); }
.steps-dots { display: flex; gap: 6px; }
.step-dot { width: 26px; height: 6px; border-radius: 3px; background: var(--line); }
.step-dot.is-on { background: var(--accent); }
.points { display: grid; gap: 10px; }
.points li { display: flex; align-items: flex-start; gap: 8px; font-size: 14px; }
.points .ic { width: 20px; height: 20px; margin-top: 2px; color: var(--accent); }
.points li > span { flex: 1; min-width: 0; }
.consent { display: grid; gap: 6px; }
.consent-text { font-size: 13px; color: var(--muted); padding: 0 2px; }
.detail-link { display: inline; margin-left: 4px; font-size: inherit; color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.detail { display: grid; gap: 4px; padding: 10px 12px 10px 30px; list-style: decimal; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-s); font-size: 13px; color: var(--muted); }
.code { font: 700 34px/1.2 ui-monospace, 'Courier New', monospace; letter-spacing: .12em; text-align: center; }
.qr { width: 150px; height: 150px; fill: var(--ink); }
.qr .qr-eye { fill: none; stroke: var(--ink); stroke-width: 4; }
.card-locked { padding: 24px 16px; }

/* 絵 */
.staff-box { width: 100%; padding: 14px 8px; background: var(--surface); border: var(--border) solid var(--line); border-radius: var(--radius); }
.staff { display: block; width: 100%; height: auto; }
.staff-line { stroke: var(--ink); stroke-width: 1; fill: none; }
.staff-clef { stroke: var(--ink); stroke-width: 2.200; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.staff-note ellipse { fill: var(--ink); }
.staff-note path { stroke: var(--ink); stroke-width: 1.600; }
.staff-note.is-done { opacity: .35; }
.staff-note.is-now ellipse { fill: var(--accent); }
.staff-note.is-now path { stroke: var(--accent); }
.keyboard { display: block; width: 100%; max-width: 300px; height: auto; margin: 0 auto; }
.key { fill: var(--surface); stroke: var(--ink); stroke-width: 1.500; }
.key.is-hit { fill: var(--accent); }
.key-black { fill: var(--ink); }
.key-label { font: 700 13px var(--font); fill: var(--on-accent); }
.bars { display: block; width: 100%; height: auto; }
.bar-0 { fill: var(--accent-soft); stroke: var(--accent); stroke-width: 1; }
.bar-1 { fill: var(--accent); }
.bar-zero, .bar-base { stroke: var(--line); stroke-width: 1; }
.bar-day { font: 11px var(--font); fill: var(--muted); }
.minibars .bar-0 { fill: var(--accent); stroke: none; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; color: var(--muted); }
.legend span::before { content: ''; display: inline-block; width: 10px; height: 10px; margin-right: 5px; border-radius: 2px; border: 1px solid var(--accent); }
.legend-0::before { background: var(--accent-soft); }
.legend-1::before { background: var(--accent); }
.levelmap { display: block; width: 100%; height: auto; }
.map-road { fill: none; stroke: var(--line); stroke-width: 10; stroke-linecap: round; stroke-dasharray: 2 16; }
.map-node circle { fill: var(--surface); stroke: var(--line); stroke-width: 2; }
.map-node.is-done circle { fill: var(--accent-soft); stroke: var(--accent); }
.map-node.is-now circle { fill: var(--accent); stroke: var(--accent); }
.map-check { fill: none; stroke: var(--accent); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.map-num { font: 700 18px var(--font-head); fill: var(--muted); }
.map-node.is-now .map-num { fill: var(--on-accent); }
.map-name { font: 700 13px var(--font); fill: var(--ink); }
.map-node.is-next .map-name { fill: var(--muted); font-weight: 400; }
.map-here { font: 700 11px var(--font); fill: var(--accent); }

/* 子どもの画面（文字を大きく） */
.scr-kid { font-size: 17px; }
.kid-who { display: flex; align-items: center; gap: 6px; padding: 4px 12px 4px 4px; border: var(--border) solid var(--line); border-radius: 99px; background: var(--surface); font-size: 14px; font-weight: 700; }
.kid-face { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); }
.kid-face .ic { width: 20px; height: 20px; }
.kid-task { font: var(--head-weight) 21px/1.4 var(--font-head); }
.kid-book { font-size: 16px; }
.kid-progress { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 15px; justify-content: inherit; }
.body-center .kid-progress { justify-content: center; }
.dots { display: inline-flex; gap: 5px; }
.dots i { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--accent); }
.dots i.is-on { background: var(--accent); }
.kid-start { display: grid; gap: 4px; justify-items: end; margin-top: 4px; }
.kid-big { font: var(--head-weight) 28px/1.4 var(--font-head); }
.kid-text { font-size: 17px; }
.kid-note, .kid-hint, .kid-count { font-size: 14px; color: var(--muted); }
.quiet { display: flex; gap: 18px; margin: 12px 0 0; }
.quiet i { width: 46px; height: 46px; border-radius: 50%; background: var(--accent); }
.quiet i.is-off { background: none; border: 3px dashed var(--line); }
.quiet-count { font-size: 13px; color: var(--muted); letter-spacing: .2em; }
.listening { position: relative; width: 96px; height: 96px; display: grid; place-items: center; margin-top: 6px; }
.listening-mic { position: relative; display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; background: var(--accent); color: var(--on-accent); }
.listening-mic .ic { width: 32px; height: 32px; }
.listening-ring { position: absolute; inset: 0; border-radius: 50%; border: 3px solid var(--accent); opacity: .5; animation: ring 1.800s ease-out infinite; }
@keyframes ring { from { transform: scale(.7); opacity: .6; } to { transform: scale(1.150); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .listening-ring { animation: none; } }
.result-mark, .handover-mark { display: grid; place-items: center; width: 88px; height: 88px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); }
.result-mark .ic, .handover-mark .ic { width: 46px; height: 46px; }
.grownup { text-align: left; font-size: 15px; margin-top: 10px; }
.card-point { justify-items: center; text-align: center; }
.point-label { font-size: 14px; color: var(--muted); }
.point-num { display: flex; align-items: center; gap: 8px; font: var(--head-weight) 48px/1.1 var(--font-head); color: var(--accent); }
.point-num .ic { width: 36px; height: 36px; }
.point-sub { font-size: 14px; }

/* 最初のページ（画面の一覧） */
.scr-top .body { padding-top: 20px; }
.top-title { font: var(--head-weight) 26px/1.35 var(--font-head); }
.top-role { display: grid; gap: 6px; margin-top: 8px; }
.top-role-head { display: flex; align-items: center; gap: 8px; font: var(--head-weight) 19px/1.4 var(--font-head); }
.top-count { margin-left: auto; font: 400 13px var(--font); color: var(--muted); }
.top-no { display: inline-block; min-width: 1.800em; color: var(--muted); font-weight: 400; }
.scr-top .row-title { font-weight: 500; }
