/* Hallmark · checked: 2026-11-22 · genre: playful (inferred)
 * floor: 0 FAIL · fixed: 26a, 27, 30a, 34, 39a, 40, 41, 48, 63, 7a, 10a, 3, 26b · structural: 1 printed (the tablet's first screen)
 * built: the project · redesign: polish · v2.0.0
 * finish-review: subagent, 5 findings, 5 resolved (server recap wording left to its owner) */
/* Hallmark · waive 39b · tablet button.big at 56px, parent phone controls at 44px · a child presses ただいま on the genkan tablet with small fingers, and the parent phone keeps touch-sized targets */
/* Hallmark · dropped 02:35, 02:33 · live arrival times the websocket pushed into the feed during the before capture, not page content */

:root {
  --bg: #fbf7f0;
  --ink: #2b2620;
  --muted: #6f665d;
  --card: #fffdf9;
  --line: #e7dfd3;
  --hover: #f6f0e6;
  --press: #f1e9dc;
  --accent: #e07a3f;
  --accent-text: #a3501f;
  --on-accent: #241f1a;
  --ok: #2f7550;
  --watch: #8a5d00;
  --urgent: #b0362f;
  --focus: var(--accent-text);
  --field-edge: var(--muted);
  /* the avatar stage and the drawn fallback face */
  --stage-top: #f3e6d4;
  --stage-bottom: #e9d6bd;
  --skin: #ffd9a8;
  --face-ink: #2b2620;
  --scrim: rgb(42 33 26 / 0.8);
  --on-scrim: #fbf7f0;
  --font: system-ui, "Hiragino Sans", "Noto Sans JP", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1e1b18; --ink: #f2ece4; --muted: #a59b90; --card: #2a2622; --line: #3a342e;
    --hover: #332e29; --press: #3a342e;
    --accent-text: #ec9a68; --ok: #73c496; --watch: #e8b34f; --urgent: #f08a80;
    --stage-top: #3b3129; --stage-bottom: #30281f;
  }
}
html, body { overflow-x: clip; }
* { box-sizing: border-box; }
body { margin: 0; font: 16px/1.5 var(--font); background: var(--bg); color: var(--ink); accent-color: var(--accent-text); }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* the top bar lines up with the content column below it */
.bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.tablet .bar { padding-inline: max(16px, calc((100% - 960px) / 2 + 16px)); }
.phone .bar { padding-inline: max(16px, calc((100% - 560px) / 2 + 16px)); }
.brand { font-weight: 700; font-size: 20px; }
.brand small { color: var(--muted); font-weight: 400; font-size: 14px; }
.pill { font-size: 13px; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px; }

/* controls: rest, hover, focus, active, disabled */
button, .button { display: inline-flex; align-items: center; gap: 8px; font: inherit; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); color: var(--ink); cursor: pointer; text-decoration: none; white-space: nowrap; transition: background-color .15s ease-out; }
@media (hover: hover) { button:hover, .button:hover { background: var(--hover); } }
button:active, .button:active { background: var(--press); }
button.big { font-size: 18px; min-height: 56px; padding: 0 18px; }
button.on, button.on:hover { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
button:disabled, input:disabled, select:disabled { opacity: .55; cursor: not-allowed; }
input, select { font: inherit; padding: 10px; border-radius: 10px; border: 1px solid var(--field-edge); background: var(--card); color: var(--ink); }
input:focus-visible, select:focus-visible { outline-offset: -3px; }
/* うんどう: the coach fills the stage; the step card sits on the left, clear of the coach */
.coach { position: absolute; inset: 0; background: linear-gradient(var(--stage-top), var(--stage-bottom)); }
.move { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); width: min(240px, 36%); display: grid; gap: 2px; justify-items: center; background: var(--scrim); color: var(--on-scrim); padding: 14px 16px; border-radius: 16px; text-align: center; }
.move b { font-size: 24px; }
.move .count { font-size: 56px; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; min-height: 1.1em; }
.move small { font-size: 13px; opacity: .85; }
@media (max-width: 700px) { .move { left: 50%; top: auto; bottom: 12px; transform: translateX(-50%); width: 80%; } .move .count { font-size: 40px; } }
/* the family passcode prompt (web/login.js) */
.login { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; background: var(--scrim); padding: max(16px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) max(16px, env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); }
.login-card { width: min(380px, 100%); display: grid; gap: 10px; background: var(--card); color: var(--ink); border: 1px solid var(--line); border-radius: 16px; padding: 20px; }
.login-card h2 { margin: 0; font-size: 20px; }
.login-card .hint { margin: 0; }
.login-card label { font-weight: 600; font-size: 14px; }
.login-card button { justify-content: center; }
.demo-pass { margin: 0; padding: 10px 12px; border-radius: 10px; background: var(--press); font-size: 15px; }
.demo-pass b { font-size: 18px; letter-spacing: .04em; }
.login-error { margin: 0; min-height: 1.5em; color: var(--urgent); font-size: 14px; }
@media (hover: hover) { input:hover, select:hover { background: var(--hover); } }
input[type="checkbox"] { width: 20px; height: 20px; margin: 0; padding: 0; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 8px 0; }
.row > input { flex: 1; min-width: 160px; }
#live select { min-height: 56px; font-size: 18px; }
.row label { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; cursor: pointer; }

/* icons: one set (Lucide, ISC), drawn in the text colour */
.i { width: 1.2em; height: 1.2em; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* tablet */
.stage { max-width: 960px; margin: 0 auto; padding: 16px; }
#avatar-wrap { position: relative; height: min(62vh, 560px); border-radius: 20px; overflow: hidden; background: linear-gradient(var(--stage-top), var(--stage-bottom)); }
sv-presenter { display: block; width: 100%; height: 100%; }
#start { position: absolute; left: 50%; bottom: 24px; transform: translateX(-50%); }
.banner { position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%); background: var(--scrim); color: var(--on-scrim); padding: 8px 16px; border-radius: 999px; font-size: 18px; }
.controls { margin-top: 12px; }
.demo { color: var(--muted); font-size: 14px; }
.log-wrap { margin-top: 12px; font-size: 14px; }
#log { padding-left: 20px; max-height: 220px; overflow: auto; }
#log li.child b { color: var(--accent-text); }
#log li.okaeri b { color: var(--ok); }
#log small { color: var(--muted); }

/* the drawn fallback face; asleep until Start */
.face { position: absolute; inset: 0; margin: auto; width: 260px; height: 260px; border-radius: 50%; background: var(--skin); transform: translateY(-24px); transition: transform .4s ease-out; }
.face.lean { transform: translateY(-24px) scale(1.12); }
.face .eyes { position: absolute; top: 95px; left: 0; right: 0; display: flex; justify-content: center; gap: 70px; }
.face .eyes span { width: 26px; height: 26px; border-radius: 50%; background: var(--face-ink); transition: transform .2s ease-out; }
.face .mouth { position: absolute; left: 50%; top: 165px; width: 90px; height: 45px; transform: translateX(-50%); border-bottom: 8px solid var(--face-ink); border-radius: 0 0 90px 90px; }
.face[data-emotion="caring"] .mouth, .face[data-emotion="sadness"] .mouth { height: 20px; width: 60px; }
.face[data-emotion="caring"] .eyes span { transform: scaleY(.7); }
.face[data-emotion="surprise"] .mouth, .face[data-emotion="excitement"] .mouth { height: 60px; border: 8px solid var(--face-ink); border-radius: 50%; width: 60px; }
.face[data-emotion="confusion"] .mouth { border-radius: 0; height: 0; width: 60px; transform: translateX(-50%) rotate(-8deg); }
.face[data-emotion="sleep"] .eyes span { transform: scaleY(.18); }
.face[data-emotion="sleep"] .mouth { width: 40px; height: 16px; border-bottom-width: 6px; }
@media (prefers-reduced-motion: reduce) {
  .face, .face .eyes span, button, .button { transition: none; }
}

/* parent phone */
.phone section { padding: 0 16px 8px; max-width: 560px; margin: 0 auto; }
.hint { color: var(--muted); font-size: 14px; margin: 4px 0 8px; }
/* Today's song: the words on the tablet while the chick sings, with the English line under each */
/* what to notice at each beat, and the controls folded away */
.notice { margin: 0 0 8px; padding: 12px 14px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--accent); font-size: 16px; line-height: 1.5; }
.notice .next { color: var(--muted); }
.quick button { min-height: 48px; }
.more { margin-top: 8px; border: 1px solid var(--line); border-radius: 14px; padding: 4px 12px; background: var(--card); }
.more > summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; color: var(--muted); font-size: 15px; }
/* the demo script: one tap per beat */
.rail { padding: 8px; border: 1px dashed var(--line); border-radius: 14px; background: var(--card); }
.rail-label { font-weight: 700; color: var(--accent-text); margin-right: 4px; }
.rail button { min-height: 48px; font-size: 16px; }
.rail button.running { border-color: var(--accent); }
.rail button.done { color: var(--ok); border-color: var(--ok); }
.rail button.done::after { content: " ✓"; }
.controls.waking .row:not(.rail) button { opacity: .6; }
/* るすばん れんしゅう: the drawn intercom and the choices, over the stage */
.drill { position: absolute; left: 16px; top: 16px; bottom: 16px; width: min(330px, 44%); display: flex; flex-direction: column; gap: 8px; background: var(--card); color: var(--ink); border: 1px solid var(--line); border-radius: 18px; padding: 12px; overflow: auto; box-shadow: 0 6px 24px rgb(0 0 0 / .18); }
.drill-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.drill-head b { font-size: 18px; }
.drill-head button { min-height: 44px; min-width: 44px; padding: 0; justify-content: center; font-size: 22px; }
.drill-screen { display: grid; place-items: center; height: 120px; flex: none; border-radius: 12px; background: #1f2a2e; border: 6px solid #cfc6b8; color: #8fb3bd; }
.drill-screen { overflow: hidden; height: auto; aspect-ratio: 2 / 1; }
.drill-screen svg.scene { width: 100%; height: 100%; display: block; }
.drill-screen.ring { animation: ring .25s ease-in-out 4; }
@keyframes ring { 50% { transform: translateX(3px) rotate(1deg); } }
.drill-caller { margin: 0; padding: 8px 12px; border-radius: 12px; background: var(--press); font-size: 17px; }
.drill-choices { display: grid; gap: 8px; }
.drill-choices button { min-height: 56px; height: auto; padding-block: 10px; font-size: 18px; line-height: 1.35; white-space: normal; justify-content: flex-start; text-align: left; }
.drill-choices button.right { border-color: var(--ok); color: var(--ok); font-weight: 700; }
.drill-choices button.wrong { opacity: .55; text-decoration: line-through; }
.drill-note { color: var(--muted); }
@media (max-width: 700px) { .drill { left: 8px; right: 8px; top: auto; bottom: 8px; width: auto; max-height: 75%; } }
@media (prefers-reduced-motion: reduce) { .drill-screen.ring { animation: none; } }
.card.practice b { color: var(--ok); }
.card.door b { color: var(--muted); }
.lyrics { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); width: min(360px, 40%); background: var(--scrim); color: var(--on-scrim); padding: 12px 16px; border-radius: 16px; }
.lyrics p { margin: 4px 0; font-size: 20px; line-height: 1.35; }
@media (max-width: 700px) { .lyrics { right: auto; left: 50%; top: auto; bottom: 12px; transform: translateX(-50%); width: 92%; text-align: center; } }
.lyrics small { display: block; font-size: 13px; opacity: .8; margin-top: -2px; }
.card .lines { white-space: pre-line; margin: 6px 0 2px; font-size: 17px; }
.card audio { width: 100%; margin-top: 6px; }
.cards { list-style: none; padding: 0; margin: 0; }
.card { background: var(--card); color: var(--ink); border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin-bottom: 10px; }
.card b { margin-right: 6px; }
.card small { color: var(--muted); }
.card.arrived b { color: var(--ok); }
.card.alert.watch { border-color: var(--watch); }
.card.alert.watch b { color: var(--watch); }
.card.alert.urgent { border-color: var(--urgent); border-width: 2px; padding: 11px; }
.card.alert.urgent b { color: var(--urgent); }
.card p { margin: 6px 0; }
.memory { padding-left: 18px; }
.memory li { margin: 4px 0; }
.memory .kind { color: var(--muted); font-size: 14px; margin-right: 8px; }
.memory button { position: relative; font-size: 14px; padding: 4px 12px; min-height: 32px; }
.memory button::before { content: ""; position: absolute; inset: -6px -4px; }
#rec .i-stop, #rec[aria-pressed="true"] .i-mic { display: none; }
#rec[aria-pressed="true"] .i-stop { display: inline; }
.rules { padding-left: 18px; }
.rules li { margin: 4px 0; }

/* empty states for the parent's lists */
#feed:empty::before, #facts:empty::before, #threads:empty::before { display: block; color: var(--muted); font-size: 14px; padding: 8px 0; }
#feed:empty::before { content: "Nothing yet today. Arrivals and check-ins show up here."; }
#facts:empty::before { content: "Nothing remembered yet."; margin-left: -18px; }
#threads:empty::before { content: "No unfinished stories."; margin-left: -18px; }

/* the 玄関 backdrop behind Perxona's transparent scene (and the drawn face) */
.tablet #avatar-wrap { isolation: isolate; background: linear-gradient(var(--stage-top), var(--stage-bottom)); }
/* the 玄関 behind the chick: the front door swings open on its hinge when someone comes home */
.genkan { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; }
.genkan .door-leaf { transform-box: view-box; transform-origin: 1460px 470px; transition: transform .9s cubic-bezier(.3, .7, .2, 1), filter .9s; }
.genkan.open .door-leaf { transform: scaleX(.12) skewY(-3deg); filter: brightness(.8); }
.genkan .spill { opacity: 0; transition: opacity .9s; }
.genkan.open .spill { opacity: .9; }
.genkan .shoes { opacity: 0; transform: translateY(-18px); transition: opacity .5s, transform .5s cubic-bezier(.3, 1.5, .5, 1); }
.genkan.home .shoes { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .genkan .door-leaf, .genkan .spill, .genkan .shoes { transition: none; } }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .tablet #avatar-wrap { background-blend-mode: multiply; background-color: #8c7a66; }
}

/* door watcher meter (demo row) */
#door-meter meter { width: 120px; height: 16px; }

/* homework check: the photo, then a mark per problem (the answers stay on the server) */
.hw { margin-top: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 16px; background: var(--card); }
.hw-view { display: grid; gap: 8px; justify-items: center; }
.hw-view video, .hw-view img { width: 100%; max-height: 320px; object-fit: contain; border-radius: 12px; background: var(--press); }
.hw-hint { margin: 0; color: var(--muted); font-size: 16px; }
.marks { list-style: none; margin: 8px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 0 24px; }
.marks li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 18px; }
.marks b { font-weight: 700; }
.marks .right b { color: var(--ok); }
.marks .wrong b { color: var(--accent-text); }
.marks .blank b, .marks .unsure b { color: var(--muted); }
