:root {
  /* Hogo design tokens — taken from the landing design (docs/design/mockups/Landing.dc.html) and used on every screen */
  color-scheme: light dark;
  --bg: #f4f7fa; --card: #fff; --ink: #1f2a37; --ink-2: #374151; --muted: #4b5563; --line: #d5dee8;
  --green: #2e7d4f; --green-ink: #1b4d31; --green-2: #22603d; --mint: #e3f4ea; --mint-2: #9ed7ae; --shell: #5fb37c;
  --accent: var(--green); --on-accent: #fff;
  --danger: #b91c1c; --ok: #2e7d4f; --warn: #a16207;
  --r-sm: 12px; --r: 18px; --r-lg: 22px; --r-xl: 28px;
  --font: "M PLUS Rounded 1c", "Hiragino Maru Gothic ProN", "Hiragino Maru Gothic Pro", "BIZ UDPGothic", "Hiragino Sans", system-ui, -apple-system, "Noto Sans JP", "Noto Sans", sans-serif;
  font: 500 17px/1.6 var(--font);
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0f141a; --card: #18202a; --ink: #e8edf3; --ink-2: #c9d2dc; --muted: #9aa6b5; --line: #2c3746;
    --green: #3f9b63; --green-ink: #bfe8cd; --green-2: #8fd3a5; --mint: #16301f; --mint-2: #2f6b45; --shell: #3f9b63;
    --danger: #ef5350; --ok: #66bb6a; --warn: #ffb74d; }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom); -webkit-tap-highlight-color: transparent; }
header, main, footer { max-width: 640px; margin: 0 auto; padding: 0 16px; }

/* masthead: name, tagline, language pill (same on sign-up and in the app) */
.masthead { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 4px 6px; }
h1 { font-size: 26px; font-weight: 800; line-height: 1.15; margin: 0; letter-spacing: .01em; }
.brand { font-size: 13px; font-weight: 600; color: var(--muted); margin: 2px 0 0; }
.langpill { display: inline-flex; align-items: center; gap: 6px; flex: none; margin: 0; min-height: 44px; padding: 0 14px; border-radius: 22px;
  border: 2px solid var(--line); background: var(--card); font-size: 14px; font-weight: 700; }
.langpill svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

h2 { font-size: 20px; font-weight: 800; margin: 20px 0 8px; line-height: 1.35; }
h3 { font-size: 17px; font-weight: 800; margin: 16px 0 6px; }
section, .tab { background: var(--card); border: 2px solid var(--line); border-radius: var(--r-lg); padding: 16px 18px; margin: 12px 0; }
section > h2:first-child { margin-top: 2px; }
.tab { border: 0; padding: 12px 0 0; margin: 0; background: none; }
#vMain { background: none; border: 0; padding: 0; }
label { display: block; color: var(--muted); font-size: 15px; font-weight: 700; margin: 14px 0 6px; }
label.toggle { display: flex; gap: 10px; align-items: center; color: var(--ink); }
input, select, textarea, button { font: inherit; color: var(--ink); background: var(--card); border: 2px solid var(--line); border-radius: var(--r-sm); min-height: 52px; padding: 10px 14px; }
input, select, textarea { width: 100%; }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible { outline: 3px solid color-mix(in srgb, var(--green) 55%, transparent); outline-offset: 2px; border-color: var(--green); }
input[type="checkbox"] { accent-color: var(--green); }
textarea { font: 13px/1.4 ui-monospace, Menlo, monospace; word-break: break-all; }
button { cursor: pointer; margin: 10px 8px 0 0; border-radius: var(--r); font-weight: 700; padding: 10px 18px; }
button:active { transform: translateY(1px); }
button.primary { background: var(--green); color: var(--on-accent); border-color: var(--green); font-weight: 800; min-height: 56px; }
button.danger { border-color: var(--danger); color: var(--danger); }
button.lv3 { background: var(--danger); color: #fff; border-color: var(--danger); }
button:disabled { opacity: .45; cursor: not-allowed; }
/* single main actions on the forms fill the width, like the landing's Start button */
#vSetup .primary, #vStart .primary, #vPlaces .primary, #vJoin .primary, #btnCs, #btnMissionsTell, #btnMsgIn { display: flex; width: 100%; justify-content: center; margin-right: 0; }
#vStart button { display: flex; width: 100%; justify-content: center; margin-right: 0; min-height: 56px; }
#btnJoin { border-color: var(--green); color: var(--green-ink); font-weight: 800; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 0 8px; }
.grid button { width: 100%; }
.row { display: flex; gap: 8px; align-items: end; }
.row button { flex: none; }
nav { display: flex; gap: 4px; overflow-x: auto; }
nav button { flex: 1; margin: 0; font-size: 15px; white-space: nowrap; }
nav button[aria-selected="true"] { background: var(--ink); color: var(--bg); }
.rule0 { border-left: 6px solid var(--danger); background: color-mix(in srgb, var(--danger) 9%, var(--card)); padding: 10px 14px; border-radius: var(--r-sm); font-weight: 700; }
.note { color: var(--muted); font-size: 14px; }
.code { font: 800 36px/1.2 ui-monospace, Menlo, monospace; letter-spacing: 6px; margin: 10px 0; padding: 10px 14px; border-radius: var(--r); background: var(--mint); color: var(--green-ink); text-align: center; }
.code:empty { display: none; }
.out:empty { display: none; }
.out { border: 2px dashed var(--line); border-radius: var(--r); padding: 12px 14px; margin-top: 12px; background: var(--card); }
.badge { font-weight: 700; }
.badge:empty { display: none; }
.badge.ok { color: var(--ok); } .badge.bad { color: var(--danger); } .badge.warn { color: var(--warn); }
.history { list-style: none; padding: 0; }
.history li { background: var(--card); border: 2px solid var(--line); border-radius: var(--r) var(--r) var(--r) 6px; padding: 12px 14px; margin: 10px 0; }
.history li.mine { opacity: 1; border-radius: var(--r) var(--r) 6px var(--r); background: color-mix(in srgb, var(--mint) 70%, var(--card)); border-color: color-mix(in srgb, var(--green) 35%, var(--line)); margin-left: 24px; }
.history li.lv3 { border-color: var(--danger); border-width: 3px; }
.history .title { font-weight: 800; }
.members { list-style: none; padding: 0; }
.members li { display: flex; justify-content: space-between; align-items: center; gap: 8px; background: var(--card); border: 2px solid var(--line); border-radius: var(--r); padding: 10px 14px; margin: 8px 0; }
.card-levels > div { border-top: 2px solid var(--line); padding: 10px 0; }
[hidden] { display: none !important; }
footer .note { text-align: center; margin: 16px 0 24px; }

.badge.duress, .history li.duress { color: #fff; background: var(--danger); border-color: var(--danger); padding: 10px 12px; border-radius: var(--r-sm); font-weight: 700; }
.history li.duress .note { color: #fff; }
.members .actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.members button { margin: 0; min-height: 40px; padding: 6px 12px; border-radius: var(--r-sm); }
.answerBox { display: flex; gap: 8px; align-items: end; margin-top: 8px; }
.answerBox button { margin: 0; flex: none; }

/* ---------- kid-friendly layout (docs/design/mockups, docs/content/KIDS-CONTENT.md) ---------- */
:root { --safe: #2e7d4f; --help: #c2410c; --here: #1d5fa8; --lv0: #2e7d4f; --lv1: #a16207; --lv2: #c2410c; --lv3: #b91c1c; --lv4: #6d28d9; }
#vMain { padding-bottom: 96px; }
.topbar { display: flex; justify-content: flex-end; gap: 8px; }
.topnav { flex: none; }
.iconbtn { display: inline-flex; align-items: center; gap: 6px; border-radius: 24px; min-height: 48px; margin: 0; }
.iconbtn svg, .bottomnav svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.bottomnav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0;
  background: var(--card); border-top: 2px solid var(--line); padding: 6px 8px calc(10px + env(safe-area-inset-bottom)); max-width: none; }
.bottomnav button { display: flex; flex-direction: column; align-items: center; gap: 2px; border: 0; background: none; font-size: 13px; font-weight: 700; color: var(--muted); min-height: 56px; }
.bottomnav button svg { width: 28px; height: 28px; }
.bottomnav button[aria-selected="true"] { background: none; color: var(--green-2); }
.bottomnav button[aria-selected="true"] svg { background: var(--mint); border-radius: 14px; padding: 2px 10px; width: 48px; box-sizing: content-box; }
.seg { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; background: color-mix(in srgb, var(--line) 70%, var(--bg)); border-radius: var(--r); padding: 4px; margin: 12px 0 0; }
.seg button { margin: 0; border: 0; border-radius: 12px; background: none; font-weight: 700; }
.seg button[aria-selected="true"] { background: var(--card); color: var(--green-2); box-shadow: 0 1px 3px rgb(0 0 0 / .12); }

.big { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 76px; margin: 10px 0 0; border: 0; border-radius: 22px;
  color: #fff; font-size: 24px; font-weight: 800; }
.big.safe { background: var(--safe); } .big.help { background: var(--help); } .big.here { background: var(--here); } .big.calls { background: #1f2a37; }
.quick { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.quick .big { font-size: 17px; min-height: 64px; }
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.tiles .big { min-height: 150px; font-size: 22px; }

.levelcard { border-radius: 22px; padding: 16px 18px; margin: 12px 0 0; border: 3px solid var(--lv0); background: color-mix(in srgb, var(--lv0) 12%, var(--card)); }
.levelcard .small { font-size: 14px; font-weight: 700; }
.levelcard .lvname { font-size: 28px; font-weight: 800; line-height: 1.2; }
.levelcard .childline { font-size: 18px; font-weight: 700; margin-top: 4px; }
.levelcard.banner .childline { font-size: 15px; }
.levelcard.alert { color: #fff; }
.mission { background: var(--card); border: 2px solid var(--line); border-radius: 18px 18px 18px 4px; padding: 10px 14px; font-weight: 700; }
.drillbanner { border: 4px dashed var(--lv1); border-radius: 12px; padding: 8px 12px; font-weight: 800; text-align: center; }
.alertcard .note { margin-top: 8px; }
.lv-0 { --lv: var(--lv0); } .lv-1 { --lv: var(--lv1); } .lv-2 { --lv: var(--lv2); } .lv-3 { --lv: var(--lv3); } .lv-4 { --lv: var(--lv4); }
.levelcard[class*="lv-"] { border-color: var(--lv); background: color-mix(in srgb, var(--lv) 12%, var(--card)); }
.levelcard.alert[class*="lv-"] { background: var(--lv); }

.circle { position: relative; width: min(100%, 360px); aspect-ratio: 1; margin: 8px auto 0; }
.circle .centre { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 40%; aspect-ratio: 1; border-radius: 50%;
  border: 8px solid var(--lv, var(--lv0)); background: var(--card); display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.circle .centre .num { font-size: 40px; font-weight: 800; line-height: 1; }
.circle .centre .small { font-size: 12px; font-weight: 700; }
.circle .who { position: absolute; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; width: 96px; text-align: center; }
.circle .face { width: 56px; height: 56px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 22px; font-weight: 800;
  background: var(--card); border: 3px solid var(--line); }
.circle .face.st-safe { border-color: var(--safe); } .circle .face.st-help { border-color: var(--help); background: color-mix(in srgb, var(--help) 15%, var(--card)); }
.circle .face.st-me { border-style: dashed; border-color: var(--here); }
.circle .whoname { font-size: 12px; font-weight: 700; line-height: 1.3; }

.places, .missions, .levellearn { list-style: none; padding: 0; }
.places li { border: 2px solid var(--line); border-radius: 16px; padding: 12px; margin: 8px 0; }
.places li.rally { border-color: var(--safe); }
.missions li { display: flex; gap: 10px; align-items: center; border-bottom: 1px solid var(--line); padding: 6px 0; }
.missions input { width: 28px; min-height: 28px; height: 28px; flex: none; }
.missions label { margin: 0; color: var(--ink); font-size: 17px; }
.levellearn li { border-left: 8px solid var(--lv); border-radius: 8px; padding: 8px 12px; margin: 8px 0; background: var(--card); }

.callgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.call { display: flex; flex-direction: column; gap: 2px; border-radius: 18px; padding: 12px; color: #fff; text-decoration: none; font-size: 13px; }
.call strong { font-size: 30px; line-height: 1.1; }
.call.c110 { background: #1e3a8a; } .call.c119 { background: #b91c1c; } .call.c171 { background: #1f2a37; align-items: center; font-size: 18px; font-weight: 800; }
.box171 { border: 3px solid var(--ink); border-radius: 20px; padding: 12px 14px; margin-top: 10px; }
.box171 .n171 { font-size: 30px; }
.box171 .steps { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; font-size: 14px; margin: 8px 0; }
.box171 .steps div { background: var(--bg); border-radius: 12px; padding: 8px 10px; display: flex; flex-direction: column; }

.looks { display: grid; gap: 8px; }
.lookopt { display: flex; flex-direction: column; align-items: flex-start; text-align: left; margin: 0; border: 3px solid var(--line); border-radius: 18px; }
.lookopt.on { border-color: var(--here); }

/* ---------- sign-up introduction ---------- */
.intro .lead { font-size: 18px; font-weight: 600; line-height: 1.6; }
.introcard { border: 2px solid var(--line); border-radius: 20px; padding: 14px 16px; margin: 12px 0; background: var(--card); }
.introcard h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; font-size: 18px; }
.introcard h3 svg { width: 26px; height: 26px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.introcard ul, .introcard ol { margin: 0; padding-left: 22px; }
.introcard li { margin: 4px 0; line-height: 1.55; }
.introcard.emergency { border-color: var(--ink); } .introcard.emergency h3 { color: var(--ink); }
.introcard.everyday { border-color: var(--safe); } .introcard.everyday h3 { color: var(--green-2); }
.introcard.safe { border-color: var(--here); } .introcard.safe h3 { color: var(--here); }
.introcard.start { border-style: dashed; border-color: #9aa7b5; }
.introcard.start ol { list-style: none; padding: 0; counter-reset: step; display: grid; gap: 10px; }
.introcard.start li { counter-increment: step; display: flex; gap: 10px; align-items: flex-start; margin: 0; }
.introcard.start li::before { content: counter(step); flex: none; width: 32px; height: 32px; border-radius: 16px; background: var(--ink); color: var(--card); display: flex; align-items: center; justify-content: center; font-weight: 800; }
.introdetails { border: 2px solid var(--line); border-radius: 16px; padding: 10px 14px; margin: 8px 0; }
.introdetails summary { font-weight: 800; cursor: pointer; }

/* nothing sent yet: calm, not an alert */
.levelcard.lv-none { border-color: var(--line); background: var(--card); }
.circle .centre.lv-none { border-color: var(--line); }
.note.official { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: var(--card); }
/* #33: inside a family the page header is compact; rule 0 shows there once a level is in play (#39) */
body.ingroup .masthead { padding: 8px 4px 2px; }
body.ingroup header h1 { font-size: 20px; }
body.ingroup header .brand { font-size: 12px; margin: 0; }   /* the tagline stays next to the name (保護 ≠ welfare) */
body.ingroup .langpill { min-height: 40px; padding: 0 12px; font-size: 13px; }
body.ingroup #draftNote { display: none; }
.topbar { flex-wrap: wrap; }
/* #13: storage status in Settings */
.status-list { list-style: none; padding: 0; margin: 4px 0 8px; }
.status-list li { padding: 4px 0; }
.note.warn { color: var(--danger); font-weight: 600; }

/* #29 family call buttons */
.callgrid.fam .call { background: var(--card); color: var(--ink, inherit); border: 2px solid var(--accent); }
.phonebook { margin: 12px 0; }
.phonebook li { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 6px 0; }
.phonebook li input { flex: 1 1 140px; min-width: 0; }

/* "I'm here" (#28) */
.herelist li { flex-wrap: wrap; gap: .4rem; }
.herelist .dist { flex-basis: 100%; font-weight: 600; }
.hereform { display: grid; gap: .5rem; margin: .75rem 0; }
.hereform .check { display: flex; gap: .6rem; align-items: center; justify-content: flex-start; }
.hereform .check input { width: 1.5rem; height: 1.5rem; min-height: 0; flex: none; margin: 0; }
.sharing { border: 2px solid var(--warn, #b45309); border-radius: 12px; padding: .75rem; margin: .5rem 0; }
a.button { display: inline-block; padding: .5rem .8rem; border: 1px solid currentColor; border-radius: 10px; text-decoration: none; }

/* ---------- landing hero (docs/design/mockups/Landing.dc.html) ---------- */
#introBox { background: none; border: 0; padding: 0; }
#introBox > .introcard, #introBox > .note.official { margin-left: 0; margin-right: 0; }
.hero { background: var(--mint); border-radius: var(--r-xl); padding: 22px 20px 20px; margin: 8px 0 4px; display: flex; flex-direction: column; gap: 12px; }
.hero .free { font-size: 14px; font-weight: 800; color: var(--green-2); }
.hero .herotitle { margin: -6px 0 0; font-size: 30px; font-weight: 800; line-height: 1.3; color: var(--green-ink); }
.heroline { display: flex; align-items: center; gap: 12px; }
.heroline p { margin: 0; font-size: 16px; font-weight: 700; line-height: 1.6; }
.hero .lead { margin: 0; font-size: 14px; font-weight: 500; line-height: 1.55; color: var(--ink-2); }
.turtle { width: 96px; height: 78px; flex: none; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.turtle .shell { fill: var(--shell); stroke: var(--green-2); stroke-width: 2.5; }
.turtle .line { stroke: var(--green-2); stroke-width: 2; }
.turtle .head { fill: var(--mint-2); stroke: var(--green-2); stroke-width: 2.5; }
.turtle .eye { fill: var(--ink); }
.turtle .smile { stroke: var(--ink); stroke-width: 1.6; }
.turtle .feet { stroke: var(--green-2); stroke-width: 4; }
.hero .cta { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 64px; margin: 0; border: 0; border-radius: 20px; background: var(--green); color: #fff; font-size: 22px; font-weight: 800; }
.hero .cta svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.hero .cta2 { width: 100%; min-height: 52px; margin: 0; border: 2px solid var(--green); border-radius: var(--r); background: var(--card); color: var(--green-ink); font-size: 17px; font-weight: 800; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips span { font-size: 12px; font-weight: 700; background: var(--card); border-radius: 12px; padding: 4px 10px; }

/* ---------- the same treatment inside the app ---------- */
/* home: the calm "no alerts" card uses the landing's mint panel; level cards keep their level colour */
.levelcard { border-radius: var(--r-xl); }
.levelcard.lv-none { border: 0; background: var(--mint); color: var(--green-ink); }
.levelcard .lvname { font-weight: 800; }
.big { border-radius: var(--r-lg); box-shadow: 0 2px 0 rgb(0 0 0 / .12); letter-spacing: .02em; }
.tiles .big { border-radius: var(--r-xl); }
/* family circle: soft colour per person, like the mockup */
.circle .face { width: 62px; height: 62px; font-size: 24px; border-width: 3px; }
.circle .face.tint-0 { background: #fbe3a0; color: #5c4306; } .circle .face.tint-1 { background: #b9d3f0; color: #12385f; }
.circle .face.tint-2 { background: #f6c9a8; color: #5b2a0c; } .circle .face.tint-3 { background: #d9cff2; color: #3b2a73; }
.circle .face.st-me { background: var(--card); color: var(--here); }
.circle .face.st-none { border-color: transparent; }
.circle .centre { box-shadow: 0 2px 0 rgb(0 0 0 / .08); }
/* top bar buttons: round pills like the language pill */
.iconbtn { border-radius: 24px; padding: 0 14px; font-size: 15px; }
/* lists and cards inside tabs: white cards with the landing's 2px borders */
.places li, .missions li { background: var(--card); }
.missions { background: var(--card); border: 2px solid var(--line); border-radius: var(--r-lg); padding: 6px 16px; }
.missions li:last-child { border-bottom: 0; }
.mission { border-radius: var(--r) var(--r) var(--r) 6px; }
.levellearn li { border: 2px solid var(--line); border-left: 10px solid var(--lv); border-radius: var(--r); }
.box171 { border-radius: var(--r-lg); background: var(--card); }
.call { border-radius: var(--r-lg); }
.lookopt { border-radius: var(--r-lg); background: var(--card); }
.lookopt.on { border-color: var(--green); background: var(--mint); }
.introdetails { background: var(--card); border-radius: var(--r-lg); }
#card { background: var(--card); border: 2px solid var(--line); border-radius: var(--r-lg); padding: 12px 16px; }
.callgrid.fam .call { border-color: var(--green); }
.sharing { border-radius: var(--r); }
.drillbanner { border-radius: var(--r); }
@media (prefers-color-scheme: dark) {
  .circle .face[class*="tint-"] { filter: saturate(.85) brightness(.9); }
  .chips span { background: var(--card); }
}
/* polish after screenshots */
.brand .by, .brand .tag { white-space: nowrap; }
.topnav button[aria-selected="true"] { background: var(--mint); color: var(--green-ink); border-color: var(--green); }
.circle .centre.lv-none { border-color: var(--mint-2); background: var(--mint); color: var(--green-ink); }
.quick .big { font-size: 16px; padding: 6px 8px; line-height: 1.3; }
#pasteBar button { background: var(--card); color: var(--green-ink); border-color: var(--green); border-radius: 24px; min-height: 48px; }
input[type="checkbox"] { appearance: none; -webkit-appearance: none; width: 28px; height: 28px; min-height: 28px; padding: 0; flex: none; margin: 0;
  border: 2px solid #9aa7b5; border-radius: 9px; background: var(--card) center / 18px no-repeat; cursor: pointer; }
input[type="checkbox"]:checked { background-color: var(--green); border-color: var(--green);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E"); }

/* Learn library and lesson reader (#60) */
.learncats { display: grid; gap: 10px; margin: 10px 0; }
.learncat { border: 2px solid var(--line); border-radius: var(--r-sm); padding: 6px 12px; background: var(--card); }
.learncat summary { display: flex; gap: 10px; align-items: center; min-height: 48px; cursor: pointer; font-size: 17px; }
.learncat summary .icon { font-size: 22px; }
.learncat summary .count { margin-left: auto; color: var(--muted); font-weight: 700; }
.lessonbtn { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%; text-align: left; margin: 6px 0; }
.lessonbtn.learned strong { color: var(--muted); }
.lessonbtn.continue { border-color: var(--accent); }
.linkbtn { min-height: 44px; background: none; border: none; padding: 6px 0; color: var(--accent); font-weight: 700; text-decoration: underline; }
.lesson { font-size: 17px; line-height: 1.6; }
.lesson h3 { margin: 22px 0 6px; }
.lesson li { margin: 6px 0; }
.lesson .answer { margin: 4px 0 0; padding: 6px 10px; border-left: 4px solid var(--accent); }
.lesson .tablewrap { overflow-x: auto; margin: 10px 0; }
.lesson table { border-collapse: collapse; font-size: 15px; min-width: 100%; }
.lesson th, .lesson td { border: 1px solid var(--line); padding: 6px 8px; text-align: left; vertical-align: top; }
.lesson .sources li { overflow-wrap: anywhere; font-size: 14px; color: var(--muted); }
#btnLessonDone { width: 100%; margin-top: 18px; }

/* ---------- Learn stories (core/learn-stories.js) ---------- */
.tp-quake { --tp: #a16207; --tp-bg: #fdf3d7; } .tp-tsunami { --tp: #1d5fa8; --tp-bg: #e2edf9; }
.tp-fire { --tp: #c2410c; --tp-bg: #fde7da; } .tp-storm { --tp: #5b4bb7; --tp-bg: #ebe7fa; } .tp-lost { --tp: #2e7d4f; --tp-bg: #e3f4ea; }
@media (prefers-color-scheme: dark) {
  .tp-quake { --tp: #f2c14e; --tp-bg: #3a2e10; } .tp-tsunami { --tp: #7fb0ec; --tp-bg: #142a44; }
  .tp-fire { --tp: #f59a6b; --tp-bg: #3e2012; } .tp-storm { --tp: #b3a6f2; --tp-bg: #262046; } .tp-lost { --tp: #8fd3a5; --tp-bg: #16301f; }
}
.learnhead { background: var(--mint); border-radius: var(--r-xl); padding: 18px; margin: 4px 0 12px; }
.learnhead h2 { margin: 0 0 4px; color: var(--green-ink); font-size: 22px; }
.learnhead .heroline p { font-weight: 600; font-size: 15px; }
.learnhead .turtle { width: 76px; height: 62px; }
.progress { height: 14px; border-radius: 7px; background: var(--card); overflow: hidden; margin-top: 12px; border: 2px solid color-mix(in srgb, var(--green) 30%, var(--line)); }
.progress span { display: block; height: 100%; background: var(--green); border-radius: 7px; min-width: 0; }
.progresstext { margin: 6px 0 0; font-weight: 800; color: var(--green-ink); font-size: 14px; }
.topics { display: grid; gap: 10px; margin-bottom: 8px; }
.topic { display: grid; grid-template-columns: 64px 1fr auto; align-items: center; gap: 12px; width: 100%; margin: 0; text-align: left;
  border: 2px solid color-mix(in srgb, var(--tp) 45%, var(--line)); border-radius: var(--r-lg); background: var(--card); padding: 12px 14px; min-height: 88px; }
.topic.done { background: var(--tp-bg); }
.tpicon { width: 64px; height: 64px; border-radius: 20px; background: var(--tp-bg); color: var(--tp); display: flex; align-items: center; justify-content: center; flex: none; }
.topic.done .tpicon { background: var(--card); }
.tpicon svg { width: 38px; height: 38px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tptext { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tptext strong { font-size: 19px; font-weight: 800; color: var(--tp); }
.tptext span { font-size: 14px; font-weight: 600; color: var(--ink-2); line-height: 1.45; }
.tpdone { font-size: 13px; font-weight: 800; color: var(--tp); white-space: nowrap; }
.backbtn { margin: 4px 0 10px; min-height: 44px; border-radius: 22px; padding: 0 16px; font-size: 15px; }
.storyhead { display: flex; gap: 14px; align-items: center; background: var(--tp-bg); border-radius: var(--r-xl); padding: 16px; }
.storyhead .tpicon { background: var(--card); width: 72px; height: 72px; }
.storyhead h2 { margin: 0; font-size: 26px; color: var(--tp); }
.storyhead p { margin: 4px 0 0; font-weight: 700; }
.storypart { background: var(--card); border: 2px solid var(--line); border-radius: var(--r-lg); padding: 12px 16px; margin: 12px 0; }
.storypart h3 { margin: 0 0 8px; display: inline-block; padding: 2px 12px; border-radius: 12px; font-size: 15px; }
.storypart.st-before h3 { background: var(--mint); color: var(--green-ink); }
.storypart.st-during h3 { background: var(--ink); color: var(--card); }
.storypart.st-after h3 { background: #e2edf9; color: #164a84; }
@media (prefers-color-scheme: dark) { .storypart.st-after h3 { background: #142a44; color: #b8d4f5; } }
.storypart.st-during { border-color: var(--ink); }
.storypart ol { list-style: none; margin: 0; padding: 0; counter-reset: s; display: grid; gap: 8px; }
.storypart li { counter-increment: s; display: flex; gap: 10px; align-items: flex-start; line-height: 1.55; font-weight: 600; }
.storypart li::before { content: counter(s); flex: none; width: 28px; height: 28px; border-radius: 14px; background: var(--bg); border: 2px solid var(--line); font-size: 14px; font-weight: 800; display: flex; align-items: center; justify-content: center; }
button.wide, .wide { display: flex; width: 100%; justify-content: center; margin: 12px 0 0; }
.cta2.wide { min-height: 52px; border: 2px solid var(--green); color: var(--green-ink); font-weight: 800; }
.quiz { background: var(--card); border: 3px solid color-mix(in srgb, var(--tp) 50%, var(--line)); border-radius: var(--r-xl); padding: 18px; }
.quiz .qof { margin: 0; font-size: 14px; font-weight: 800; color: var(--tp); }
.quiz h2 { margin: 6px 0 12px; font-size: 22px; }
.answers { display: grid; gap: 10px; }
.qans { width: 100%; margin: 0; min-height: 60px; text-align: left; font-size: 18px; border-radius: var(--r); }
.qans.right { background: var(--green); border-color: var(--green); color: #fff; opacity: 1; }
.qans.wrong { border-color: var(--help); background: color-mix(in srgb, var(--help) 10%, var(--card)); }
.qans:disabled:not(.right) { opacity: .5; }
.feedback { border-radius: var(--r); padding: 12px 14px; margin-top: 12px; }
.feedback.ok { background: var(--mint); color: var(--green-ink); }
.feedback.retry { background: color-mix(in srgb, var(--lv1) 14%, var(--card)); }
.feedback p { margin: 4px 0 0; font-weight: 600; color: var(--ink); }
.learndone { background: var(--mint); border-radius: var(--r-xl); padding: 24px 18px; text-align: center; display: flex; flex-direction: column; align-items: center; }
.learndone h2 { color: var(--green-ink); font-size: 28px; margin: 8px 0 0; }
.learndone .turtle { width: 120px; height: 98px; }


/* ---------- quiet games (core/games.js, pwa/games.js) ---------- */
.gamesentry { display: grid; grid-template-columns: 64px 1fr; gap: 12px; align-items: center; width: 100%; margin: 0 0 12px; padding: 12px 14px; text-align: left;
  border: 2px solid #b9a6f0; border-radius: var(--r-lg); background: #f3efff; }
.gamesentry .tptext strong { color: #5b4bb7; }
.gameicon { font-size: 34px; line-height: 1; width: 64px; height: 64px; border-radius: 20px; background: var(--card); display: flex; align-items: center; justify-content: center; }
.gamesalert { display: flex; width: 100%; justify-content: center; margin: 14px 0 0; border: 2px dashed var(--line); background: var(--card); color: var(--ink-2); font-size: 15px; }
@media (prefers-color-scheme: dark) { .gamesentry { background: #262046; border-color: #5b4bb7; } .gamesentry .tptext strong { color: #b3a6f2; } }
body.gaming { overflow: hidden; }
#gameLayer { position: fixed; inset: 0; z-index: 50; background: var(--bg); overflow-y: auto; padding: env(safe-area-inset-top) 16px calc(16px + env(safe-area-inset-bottom)); }
#gameLayer > * { max-width: 640px; margin-left: auto; margin-right: auto; }
.gametop { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding-top: 10px; }
.gamebanner { flex: 1 1 100%; margin: 0; padding: 8px 12px; border-radius: var(--r-sm); font-weight: 800; color: #fff; background: var(--lv, var(--ink)); }
.gamebattery { flex: 1 1 100%; margin: 0; font-weight: 700; color: var(--warn); }
.gameexit { position: relative; overflow: hidden; margin: 0 0 0 auto; min-height: 44px; border-radius: 22px; font-size: 14px; user-select: none; -webkit-user-select: none; touch-action: none; }
.gameexit .holdbar { position: absolute; left: 0; bottom: 0; height: 4px; width: 0; background: var(--green); }
.gamebody h2 { margin: 12px 0 8px; }
.gamelist { display: grid; gap: 12px; }
.gamecard { display: grid; grid-template-columns: 64px 1fr; grid-template-rows: auto auto; column-gap: 12px; align-items: center; margin: 0; padding: 14px; text-align: left; border-radius: var(--r-lg); background: var(--card); min-height: 96px; }
.gamecard .gameicon { grid-row: span 2; background: var(--bg); }
.gamecard strong { font-size: 19px; font-weight: 800; }
.gamecard span:last-child { font-size: 14px; color: var(--ink-2); font-weight: 600; }
.gamehead { display: flex; align-items: center; gap: 10px; }
.gamehead h2 { margin: 0; }
.gameopts { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.chip { margin: 0; min-height: 40px; padding: 4px 14px; border-radius: 20px; font-size: 14px; }
.chip.on { background: var(--mint); border-color: var(--green); color: var(--green-ink); }
.gamemsg { font-size: 18px; font-weight: 800; text-align: center; color: var(--green-ink); min-height: 1.6em; margin: 10px 0 0; }
.sq { display: grid; gap: 0; margin: 10px auto; width: min(100%, 360px); border: 3px solid var(--ink); border-radius: var(--r-sm); overflow: hidden; background: var(--ink); }
.sq4 { grid-template-columns: repeat(4, 1fr); } .sq6 { grid-template-columns: repeat(6, 1fr); }
.sqcell { aspect-ratio: 1; margin: 0; border: 0; border-radius: 0; min-height: 0; padding: 0; font-size: 30px; font-weight: 800; background: var(--card);
  box-shadow: inset 1px 1px 0 var(--line); }
.sq6 .sqcell { font-size: 22px; }
.sqcell.bl { box-shadow: inset 3px 1px 0 var(--ink); } .sqcell.bt { box-shadow: inset 1px 3px 0 var(--ink); } .sqcell.bl.bt { box-shadow: inset 3px 3px 0 var(--ink); }
.sqcell.fixed { background: color-mix(in srgb, var(--line) 45%, var(--card)); opacity: 1; color: var(--ink); }
.sqcell.sel { background: var(--mint); outline: 3px solid var(--green); outline-offset: -3px; }
.sqcell.clash { color: var(--help); background: color-mix(in srgb, var(--help) 10%, var(--card)); }
.sqpad { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.sqkey { margin: 0; width: 56px; height: 56px; padding: 0; font-size: 26px; font-weight: 800; border-radius: var(--r); }
.sqkey.erase { font-size: 20px; }
.pairs { display: grid; gap: 8px; margin: 10px auto; width: min(100%, 420px); }
.pairs.p4 { grid-template-columns: repeat(4, 1fr); } .pairs.p8 { grid-template-columns: repeat(4, 1fr); }
.paircard { aspect-ratio: 3 / 4; margin: 0; padding: 0; min-height: 0; border-radius: var(--r); font-size: 34px; background: #5b4bb7; border-color: #5b4bb7; }
.paircard.up { background: var(--card); border-color: var(--line); }
.paircard.found { background: var(--mint); border-color: var(--green); }
.spacewrap { margin: 10px 0 0; border-radius: var(--r-lg); overflow: hidden; }
.spacecv { display: block; width: 100%; touch-action: manipulation; }

/* new release ready */
.updatebar { position: sticky; top: 0; z-index: 50; display: flex; gap: 10px; align-items: center; justify-content: space-between;
  padding: 10px 14px; background: var(--ink); color: var(--bg); font-weight: 700; }
.updatebar button { min-height: 44px; }
/* landing: language switch (Japanese first) and the sign-up ask at the end of the page */
.langswitch { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 2px; }
.langswitch button, .langswitch select { flex: 1 1 auto; width: auto; min-height: 44px; margin: 0; padding: 0 12px; border: 2px solid var(--line, #d5dee8); border-radius: 22px; background: var(--card); color: var(--ink); font-size: 15px; font-weight: 700; }
.langswitch button[aria-pressed="true"] { background: var(--green); border-color: var(--green); color: #fff; }
.introcard.signup { background: var(--mint); text-align: center; }
.introcard.signup p { margin: 0 0 12px; font-weight: 600; }
.introcard.signup .cta { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 60px; margin: 0; border: 0; border-radius: 20px; background: var(--green); color: #fff; font-size: 20px; font-weight: 800; }
.hero .cta, .introcard.signup .cta { text-wrap: balance; padding: 8px 16px; line-height: 1.35; }
