/* App shell glue for the v4.1 design (design/*.css are copies from the design
   workspace and stay untouched). One door holds entry, onboarding and the room;
   settings is a plain operations page. Test frame for beta, not new design. */

body { background: var(--cream-300); }
[hidden] { display: none !important; }
.beta-off { display: none !important; }

/* ---------- which screen is showing ---------- */
.enter-stage:not(.active), .settings-page:not(.active), .ops-page:not(.active) { display: none; }
.enter-stage { display: grid; gap: 12px; }

/* Entry and onboarding wear the login door (brass board, petals); the room wears the name tag and the gear. */
.door:not([data-stage="room"]) .home-gear { display: none; }
.door:not([data-stage="entry"]) .plate-board,
.door[data-stage="room"] .petals,
.door:not([data-stage="entry"]) .gate-plate .glint:nth-of-type(n+3) { display: none; }
.door:not([data-stage="entry"]) .plate-tag { margin-top: 0; }
.door[data-stage="onboarding"] .gate-plate::before, .door[data-stage="onboarding"] .gate-plate::after { display: none; }
.home-gear { border: 0; padding: 0; cursor: pointer; }
.home-gear:focus-visible { outline: 3px solid var(--apricot-300); outline-offset: 3px; }

/* Entry clips belong to the login door; the room has its own video. The idle loops start visible
   with their first-frame poster, so the pixel stand-in (.gate-room) never shows: not on reload, not
   between login and the room (2026-10-30 iPhone: 1-1.5 s of the old pixel dog). */
.door[data-stage="room"] .entry-clip, .door:not([data-stage="room"]) .room-clip { display: none; }
.door.has-video .entry-clip:not(.is-visible), .door.has-video .room-clip:not(.is-visible) { opacity: 0; }
/* Dozing (room-moments.mjs, 2026-11-16) is sitting after standing: she dozes off in a soft crossfade, never a cut or the
   stepped fade, and back after a while away her doze is there from the first frame, with no fade at all. */
.door.has-video .room-clip.soft-fade { transition: opacity 700ms ease-in-out; }
.door.has-video .room-clip.no-fade { transition: none; }
.gate-room { visibility: hidden; }
#reaction-video { z-index: 1; }

/* ---------- entry ---------- */
/* minmax(0, 1fr): on iPhone the wider Japanese font made the one-line 「LINEまたはGoogleでログイン」
   wider than the board, and a plain grid column grew to fit it, pushing every button and link right.
   The column now stays the board's width and the label shrinks a little instead. */
.gate-enter, .entry-actions, .enter-first { grid-template-columns: minmax(0, 1fr); }
.entry-actions { display: grid; gap: 12px; }
.btn-login { min-width: 0; font-size: clamp(12px, 3.9vw, 16px); }
/* The door (2026-11-30): LINE first and biggest, straight to LINE in one tap, with one line why; Google smaller under it; the guest
   start a quiet text button that still has a 44 px tap height. Inside an app's own browser a Safari/Chrome button comes first. */
.door-line { min-height: 52px; font-size: 16px; }
.door-line .idp-line-mark { height: 52px; }
.door-line-note { margin: -6px 0 0; text-align: center; font-size: 12px; line-height: 1.5; color: var(--ink-700); word-break: keep-all; word-break: auto-phrase; overflow-wrap: anywhere; line-break: strict; }
.door-google { min-height: 44px; }
.door-google .idp-g { height: 44px; }
.door-guest { justify-self: center; min-height: 44px; padding: 0 12px; border: 0; background: none; font: inherit; font-size: 13px; color: var(--ink-700); text-decoration: underline; text-underline-offset: 3px; }
.door-guest:focus-visible { outline: 3px solid var(--apricot-300); outline-offset: 2px; }
/* 2026-11-30: inside an app's own browser LINE and Google open Safari or Chrome first; in Safari or Chrome a line asks for the LINE press. */
.door-continue { margin: 0; padding: 10px 12px; border-radius: 12px; background: var(--apricot-100); text-align: center; font-size: 13.5px; line-height: 1.6; color: var(--ink-900); word-break: keep-all; word-break: auto-phrase; overflow-wrap: anywhere; line-break: strict; }
.door-line[data-continue] { box-shadow: 0 0 0 3px var(--apricot-300); }
.door-escape { display: grid; gap: 6px; padding: 10px 12px; border-radius: 12px; background: var(--cream-050); }
.door-escape-text { margin: 0; font-size: 13px; line-height: 1.7; color: var(--ink-700); word-break: keep-all; word-break: auto-phrase; overflow-wrap: anywhere; line-break: strict; }
.door-escape-btn { display: flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 12px; border: 1px solid var(--ink-300); border-radius: 999px; background: #fff; font: inherit; font-size: 14px; color: var(--ink-900); text-decoration: none; }
.door-escape-copy { justify-self: center; min-height: 44px; padding: 0 12px; border: 0; background: none; font: inherit; font-size: 13px; color: var(--ink-700); text-decoration: underline; text-underline-offset: 3px; }
.door-escape-btn:focus-visible, .door-escape-copy:focus-visible { outline: 3px solid var(--apricot-300); outline-offset: 2px; }
.door-escape-copied { margin: 0; text-align: center; font-size: 12.5px; line-height: 1.6; color: var(--ink-700); word-break: keep-all; word-break: auto-phrase; overflow-wrap: anywhere; }
.door-copy-field { position: fixed; top: 0; left: 0; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.entry-bye { color: var(--ink-700); font-size: 13px; }
.entry-consent { margin: 6px 0 0; font-size: 12px; line-height: 1.55; color: var(--ink-700); text-align: center; }
.entry-consent a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.entry-legal { margin-top: 2px; font-size: 11px; gap: 2px 12px; }
.entry-legal a { color: var(--ink-500); }
.door[data-stage="entry"] .gate-enter { gap: 8px; }
/* A failed start shows as a small card floating just above the buttons, over Mame's floor: it never
   pushes the buttons down or shrinks Mame's window, and long lines wrap inside the board (2026-10-29). */
.door[data-stage="entry"] .enter-error { position: absolute; z-index: 3; left: 0; right: 0; bottom: 100%; margin: 0 0 10px; white-space: normal; text-align: center; line-height: 1.6; word-break: keep-all; word-break: auto-phrase; overflow-wrap: anywhere; line-break: strict; }
/* Music on/off right on the entry screen (quiet trains: no trip to settings). */
.entry-sound { position: fixed; z-index: 5; top: calc(10px + env(safe-area-inset-top, 0px)); right: calc(10px + env(safe-area-inset-right, 0px)); display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; cursor: pointer; color: var(--ink-700); background: var(--cream-050); box-shadow: 0 0 0 2px var(--oak-700); }
.entry-sound:focus-visible { outline: 3px solid var(--apricot-300); outline-offset: 2px; }
.entry-sound[aria-checked="true"] .entry-sound-off, .entry-sound[aria-checked="false"] .entry-sound-on { display: none; }
.entry-sound[aria-checked="false"] { color: var(--ink-500); }

/* Tap sparkle: a tiny four-point light that pops where the finger lands (tap-sparkle.mjs). */
.tap-sparkle { position: fixed; z-index: 1100; width: 26px; height: 26px; margin: -13px 0 0 -13px; pointer-events: none; filter: drop-shadow(0 0 1px var(--apricot-500)) drop-shadow(0 0 3px rgba(255, 214, 120, .9)); animation: tap-sparkle-pop .42s ease-out forwards; }
/* Warm gold with an apricot rim so it reads on Mame's photo and on the cream paper alike. */
.tap-sparkle::before { content: ""; position: absolute; inset: 0; background: radial-gradient(circle, #FFFBEA 0 22%, #FFD978 60%); clip-path: polygon(50% 0, 59% 41%, 100% 50%, 59% 59%, 50% 100%, 41% 59%, 0 50%, 41% 41%); }
.tap-sparkle::after { content: ""; position: absolute; left: 50%; top: 50%; width: 4px; height: 4px; margin: -2px 0 0 -2px; background: #FFD978; box-shadow: 0 -11px 0 #FFD978, 11px 0 0 #FFE9A8, 0 11px 0 #FFD978, -11px 0 0 #FFE9A8; animation: tap-sparkle-dots .42s ease-out forwards; }
@keyframes tap-sparkle-pop { 0% { transform: scale(.3) rotate(0deg); opacity: 0; } 25% { transform: scale(1) rotate(10deg); opacity: 1; } 100% { transform: scale(.6) rotate(25deg); opacity: 0; } }
@keyframes tap-sparkle-dots { 0% { transform: scale(.4); } 100% { transform: scale(1.8); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .tap-sparkle { display: none; } }

/* ---------- room ---------- */
.room-act { gap: 8px; }
/* Approved subtitle sits under the window, never over Mame's face (docs/121 B2). */
.room-subtitle { margin: 0 -8px; padding: 4px 10px 5px; font-size: 13.5px; line-height: 1.6; color: var(--ink-900); background: var(--cream-050); box-shadow: 0 0 0 2px var(--oak-700), inset 0 -2px 0 var(--cream-300); word-break: keep-all; word-break: auto-phrase; overflow-wrap: anywhere; }
/* 「ちがうかも」 rides in the talk note row so talking adds no extra line over Mame. */
/* Words to say (2026-11-05): one line that scrolls sideways, over the room so Mame does not move when it appears. */
.room-act { position: relative; }
.talk-chips { position: absolute; left: 0; right: 0; bottom: calc(100% + 6px); display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 2px; z-index: 2; }
.talk-chips[hidden] { display: none; }
/* The talk note (ちがうかも) sits right above the bar, so the words go above it; elsewhere than the room there is no talking. */
.door[data-mode="talk"] .talk-chips { bottom: calc(100% + 40px); }
.door[data-mode="life"] .talk-chips, .door[data-view]:not([data-view="room"]) .talk-chips { display: none; }
.talk-chips::-webkit-scrollbar { display: none; }
.talk-chip { flex: none; min-height: 36px; padding: 6px 12px; border: 1.5px solid var(--oak-900); border-radius: 999px; background: var(--cream-050); color: var(--ink-900); font: inherit; font-size: 13.5px; font-weight: 500; line-height: 1.2; white-space: nowrap; cursor: pointer; }
.talk-chip:focus-visible { outline: 3px solid var(--apricot-300); outline-offset: 2px; }
.answer-report { display: inline-flex; align-items: center; margin-left: 6px; }
.answer-report-button { border: 0; background: none; padding: 4px 6px; min-height: 32px; font: inherit; font-size: 12px; font-weight: 700; color: var(--ink-500); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.answer-report-button:focus-visible { outline: 3px solid var(--apricot-300); outline-offset: 2px; }
.answer-report-thanks { margin: 0; font-size: 12px; color: var(--ink-500); }
.room-note { display: grid; gap: 6px; margin: 0 -8px; padding: 10px 12px; text-align: left; font-size: 13px; line-height: 1.6; color: var(--ink-900); background: var(--cream-050); background-image: var(--tex-linen); box-shadow: 0 0 0 2px var(--oak-700), inset 0 -3px 0 var(--cream-300); }
.room-note p { margin: 0; color: var(--ink-700); }
.room-note-acts { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.room-note-acts .btn { min-height: 40px; }
.room-note-dismiss { border: 0; background: none; padding: 6px 0; font: inherit; font-size: 12.5px; color: var(--ink-500); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
/* Home-screen suggestion: never while Mame is talking (on iPhone it took a quarter of the screen and
   shrank her window), and in the quiet room only a single compact strip; the how-to text opens after
   「やり方を見る」 (2026-10-30 iPhone review). */
.door[data-mode="talk"] #pwa-install-guidance { display: none; }
#pwa-install-guidance { grid-template-columns: minmax(0, 1fr); gap: 4px; padding: 8px 12px; }
#pwa-install-guidance #pwa-install-title { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#pwa-install-guidance:not(:has(#pwa-install-guide-complete:not([hidden]))) #pwa-install-detail { display: none; }
#pwa-install-guidance #pwa-install-detail { grid-column: 1 / -1; }
#pwa-install-guidance .room-note-acts { flex-wrap: nowrap; gap: 4px 10px; }
#pwa-install-guidance .room-note-acts .btn { min-height: 36px; padding: 0 10px; font-size: 12.5px; }
/* No action and no guide to show (a browser that cannot add to the home screen): nothing to do, so no card. */
#pwa-install-guidance:has(#pwa-install-action[hidden]):has(#pwa-install-guide-complete[hidden]) { display: none; }
.home-now-go, .home-now-back { border: 0; font: inherit; cursor: pointer; }

/* ---------- settings (settings v2, docs/118 · 121 B4) ---------- */
.settings-page { min-height: 100dvh; }
.settings-page .screen { padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px)); }
.set-group { display: grid; gap: var(--sp-2); }
.set-group > h2 { margin: 0 0 var(--sp-1); }
.row-button { width: 100%; border: 0; font: inherit; text-align: left; cursor: pointer; }
.row-button::after { content: "›"; color: var(--ink-500); }
.row-button { grid-template-columns: auto 1fr auto auto; }
.name-edit label { font-size: 13px; font-weight: 700; }
.name-edit input { width: 100%; min-height: 44px; padding: 8px 10px; border: 0; font: inherit; background: var(--cream-100); box-shadow: inset 0 0 0 2px var(--oak-500); }
.state-message { margin: 0; font-size: 13px; color: var(--berry-500); }
/* Success is not an error: 「なまえを 変更しました。」 reads in plain ink, not alarm red (2026-10-30 walk-through). */
.state-message[data-ok] { color: var(--ink-700); }
.settings-foot { margin: 0; text-align: center; font-size: 12px; color: var(--ink-500); }
#beta-remaining b { font-family: var(--f-title); font-size: 18px; margin: 0 2px; }

/* ---------- small dialogs and notices ---------- */
.sheet-backdrop { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 24px; background: rgba(56,44,36,.42); }
.sheet-dialog { width: min(100%, 360px); }
.sheet-dialog strong { font-family: var(--f-title); font-size: 16px; }
.sheet-dialog-acts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
/* Crisis help (B8): every number is a tap-to-call link, one per line. */
.safety-lines { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.safety-lines li { display: grid; gap: 2px; }
.safety-lines a, .sheet-dialog p a { color: inherit; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.safety-lines span { font-size: 12px; }
.sheet-dialog-acts.safety-acts { grid-template-columns: 1fr; }
/* The thing in the room (B5b): a picture on the floor of Mame's window, never in front of her face. */
.room-item { position: absolute; z-index: 1; left: 6%; bottom: 4%; width: 24%; height: auto; image-rendering: pixelated; pointer-events: none; }
.room-item[hidden], .door:not([data-stage="room"]) .room-item { display: none; }
.talk-limit-help { padding: 2px 6px; border: 0; background: none; color: inherit; font: inherit; text-decoration: underline; text-underline-offset: 3px; }
.inapp-note { position: fixed; z-index: 1050; top: calc(10px + env(safe-area-inset-top, 0px)); left: 16px; right: 16px; max-width: 420px; margin: 0 auto; padding: 10px 12px; display: grid; gap: 4px; font-size: 13px; line-height: 1.6; color: var(--ink-900); background: var(--cream-050); box-shadow: 0 0 0 2px var(--oak-700), 0 6px 18px rgba(0, 0, 0, .28); word-break: keep-all; word-break: auto-phrase; overflow-wrap: anywhere; line-break: strict; }
.inapp-note p { margin: 0; }
.inapp-note { grid-template-columns: 1fr auto; column-gap: 8px; }
.inapp-note p { grid-column: 1 / -1; }
.inapp-note .inapp-open { grid-column: 1; min-height: 44px; padding: 0 12px; font-size: 14px; }
.inapp-note .inapp-note-close { grid-column: 2; align-self: center; }
.inapp-open-help { font-size: 12.5px; color: var(--ink-700); }
.inapp-note-close { justify-self: end; min-height: 36px; padding: 0 8px; border: 0; background: none; font: inherit; color: var(--ink-700); text-decoration: underline; text-underline-offset: 3px; }
.notice { position: fixed; z-index: 30; top: calc(14px + env(safe-area-inset-top, 0px)); left: 50%; translate: -50% -12px; width: min(calc(100% - 32px), 420px); padding: 10px 14px; text-align: center; font-size: 13px; line-height: 1.6; color: var(--ink-900); background: var(--cream-050); box-shadow: 0 0 0 2px var(--oak-900), 4px 4px 0 2px rgba(79,61,48,.18); opacity: 0; pointer-events: none; transition: opacity .2s steps(2, end), translate .2s steps(2, end); }
.notice.show { opacity: 1; translate: -50% 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (prefers-reduced-motion: reduce) { .notice { transition: none; } }
/* System copy wraps only at spaces (design rule: no 「でき / る」 breaks); long unspaced runs may still wrap anywhere. */
.settings-page p, .settings-page .row-name, .room-note, .enter-error, .sheet-dialog p, .name-error, .name-help, .room-subtitle { word-break: keep-all; word-break: auto-phrase; overflow-wrap: anywhere; line-break: strict; }
.name-error { padding: 0 4px; }

/* ---------- 2026-10-30 full-screen audit (320-430 px, wide iOS-like font) ---------- */
/* D. The talk bar (おはなし中 / もどる / ちがうかも) broke inside words and ran off the board at 320 px.
   Each piece stays whole and the bar tightens on narrow phones. */
.home-now-line, .home-now-back, .answer-report-button, .answer-report-thanks, #home-now-text { white-space: nowrap; }
@media (max-width: 360px) {
  .door[data-mode="talk"] .home-now { margin: 0 -8px; padding: 5px 8px 6px; gap: 6px; font-size: 12px; }
  .door[data-mode="talk"] .home-now-back { padding-inline: 8px; }
  .answer-report { margin-left: 2px; }
  .answer-report-button { padding: 4px 2px; font-size: 11.5px; }
}
/* B. Short screens (iPhone SE with Safari bars ≈ 553 px tall): the signboard, two 52 px buttons and two
   lines of legal links left Mame a sliver on the login door. Tighten them so she keeps most of it. */
@media (max-height: 640px) {
  .door[data-stage="entry"] .gate-plate { padding-top: 6px; }
  .door[data-stage="entry"] .plate-board { padding: 6px clamp(10px, 3vw, 16px) 6px; }
  .door[data-stage="entry"] .plate-name { font-size: clamp(18px, 6vw, 24px); }
  .door[data-stage="entry"] .plate-tag { margin-top: 8px; padding: 2px 12px 3px; font-size: 12px; }
  .door[data-stage="entry"] .gate-enter { padding-top: 8px; gap: 6px; }
  .door[data-stage="entry"] .gate-enter .btn, .door[data-stage="entry"] .idp { min-height: 42px; }
  .door[data-stage="entry"] .entry-actions, .door[data-stage="entry"] .enter-first { gap: 8px; }
  .door[data-stage="entry"] .login-panel { gap: 6px; padding: 8px 10px 6px; }
  .door[data-stage="entry"] .entry-consent { margin-top: 2px; font-size: 11px; line-height: 1.45; }
  .door[data-stage="entry"] .entry-legal { margin-top: 0; font-size: 10px; line-height: 1.4; gap: 0 10px; }
}

/* ---------- operator screens (v4.1 screens/support · survey · account · about) ---------- */
/* Rules that lived in each design screen's <style> move here (CSP: no inline styles). */
body:has(.ops-page.active), body:has(.settings-page.active) { background: var(--bg-app); }
.ops-page fieldset { margin: 0; border: 0; min-width: 0; }
.ops-page fieldset.ops-group { padding: 0; }
/* A floated legend is not the "rendered legend": it becomes a normal grid row inside the padding. */
.ops-page legend { float: left; width: 100%; padding: 0; }
.ops-page p, .ops-row b, .ops-row small, .letter p, .ops-notes li { word-break: keep-all; word-break: auto-phrase; overflow-wrap: anywhere; line-break: strict; }
.ops-row-button { width: 100%; border: 0; background: none; font: inherit; text-align: left; cursor: pointer; }
.thread-head { padding: 0; min-height: 0; border: 0; }
.thread-letters { display: grid; gap: 10px; }
.thread-letters:empty { display: none; }
.ops-page .ops-alert:is(p) { margin: 0; }

/* settings v2: survey card, reply dot, quiet delete link, nav rows */
.survey-card { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 10px; width: 100%; padding: 12px 14px; border: 0; font: inherit; text-align: left; cursor: pointer; color: var(--ink-900); background: var(--cream-050); box-shadow: inset 0 0 0 2px var(--apricot-700); }
.survey-card b { display: block; font-size: 14.5px; }
.survey-card small { display: block; margin-top: 2px; font-size: 12px; color: var(--ink-700); }
.reply-dot { display: inline-block; width: 8px; height: 8px; margin-left: 6px; vertical-align: 2px; background: var(--apricot-500); clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); }
.home-gear { position: absolute; }
.gear-dot { position: absolute; top: 5px; right: 5px; margin: 0; }
.delete-link { justify-self: center; display: block; margin: 0 auto; padding: 8px; border: 0; background: none; font: inherit; font-size: 12.5px; color: var(--ink-500); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.row-nav { width: 100%; border: 0; font: inherit; color: inherit; text-align: left; cursor: pointer; }

/* survey */
.q { display: grid; gap: 10px; padding: 14px; background: var(--cream-050); box-shadow: inset 0 0 0 2px var(--oak-500); }
.q-h { margin: 0; font-size: 15px; line-height: 1.7; font-weight: 700; text-wrap: pretty; }
.q-h small { margin-left: 6px; font-weight: 500; font-size: 12px; color: var(--ink-500); }
.q .n { margin-right: 6px; font-family: var(--f-title); color: var(--ink-500); }
.gift { display: grid; justify-items: center; gap: 4px; padding: 14px 22px; background: var(--cream-050); box-shadow: inset 0 0 0 2px var(--apricot-700), 3px 3px 0 rgba(79,61,48,.14); }
.gift b { font-family: var(--f-title); font-weight: 700; font-size: 24px; letter-spacing: .06em; font-variant-numeric: lining-nums tabular-nums; }
.gift small { font-size: 12px; color: var(--ink-700); }

/* account deletion */
.lose { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.lose li { display: grid; grid-template-columns: 14px 1fr; gap: 8px; padding: 9px 0; border-top: 1px dashed var(--cream-400); font-size: 14px; line-height: 1.7; text-wrap: pretty; }
.lose li:first-child { border-top: 0; padding-top: 0; }
.lose li::before { content: ""; width: 9px; height: 2px; margin-top: 12px; background: var(--berry-500); }
.check { display: grid; grid-template-columns: 26px 1fr; gap: 10px; align-items: start; padding: 14px; font-size: 14px; line-height: 1.7; cursor: pointer; background: var(--cream-050); box-shadow: inset 0 0 0 2px var(--oak-500); }
.check input { appearance: none; width: 22px; height: 22px; margin: 2px 0 0; background: var(--cream-050); box-shadow: inset 0 0 0 2px var(--oak-700); cursor: pointer; }
.check input:checked { background: var(--oak-700); box-shadow: inset 0 0 0 2px var(--oak-900), inset 0 0 0 5px var(--cream-050); }
.check input:focus-visible { outline: 3px solid var(--apricot-300); outline-offset: 2px; }

/* about */
.about-head { display: grid; justify-items: center; gap: 4px; padding: 10px 0 2px; }
.about-head b { font-family: var(--f-title); font-weight: 700; font-size: 22px; letter-spacing: .12em; }
.about-head small { font-size: 12px; color: var(--ink-500); }
.about-help { margin: 0 -4px -4px; }
.ver { justify-self: center; font-family: var(--f-title); font-size: 12px; color: var(--ink-500); }

/* beta: conversation review consent */
.beta-review strong { font-family: var(--f-title); font-size: 15px; }

/* in-app browser note under the sign-in choices */
.login-inapp-note { margin: 0; font-size: 12.5px; line-height: 1.7; color: var(--ink-700); word-break: keep-all; word-break: auto-phrase; overflow-wrap: anywhere; line-break: strict; }
/* LINE's second way (11-24): a link that looks like one */
.login-inapp-note a { color: inherit; font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }
/* While the login choices are open, the 「ログアウトしました。」 line has done its job; give the room back to Mame. */
.enter-stage:has(#login-panel:not([hidden])) .entry-bye { display: none; }
/* E. At 320 px the LINE / Google buttons ran 11 px past the panel: the panel's grid column grew to the
   buttons' one-line width. The column keeps the panel width; the label may tighten instead of pushing. */
.login-panel { grid-template-columns: minmax(0, 1fr); }
.idp { min-width: 0; }
.idp-line-text, .idp-google-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 360px) {
  .idp-line-text, .idp-google-text { padding-right: 8px; font-size: 13.5px; }
  .idp-line-mark, .idp-g { width: 40px; }
}
/* The stage column itself must not grow to a child's one-line width (it pushed the say bar 4 px right at 320 px). */
.enter-stage { grid-template-columns: minmax(0, 1fr); }
@media (max-width: 340px) {
  .door[data-mode="talk"] .home-now { gap: 4px; padding-inline: 6px; }
  .door[data-mode="talk"] .home-now-dot { display: none; }
}

/* おもいで cover (beta tab preview, 2026-10-30): the cover fills the notebook, and the notebook was as tall as the
   calendar behind it — taller than short screens, so the cover's two buttons sat under the tab bar (390x664:
   「はじめての 7日間」 10 px under; the same in the design file). While the cover is closed, the notebook is exactly
   the visible area and the calendar behind it is clipped; once opened, the page scrolls as designed. */
.omoide-view:has(.om-cover) { overflow: hidden; grid-template-rows: minmax(0, 1fr); }
.omoide-view:has(.om-cover) .om-book { height: 100%; }
.omoide-view:has(.om-cover) .om-paper { height: 100%; overflow: hidden; }

/* Tab bar in the room (beta tab preview, 2026-10-30): on short phones the tabs took 83 px from Mame
   (320x460: 330 -> 247 px). User: if Mame gets too small, make the buttons smaller. Tabs and the say bar
   tighten; the tab icons stay the design's pixel art, just smaller. */
@media (max-height: 700px) {
  .door[data-stage="room"] .home-tabs { margin-top: 13px; padding: 2px 0 0; }
  .door[data-stage="room"] .home-tab { padding: 2px 0; font-size: 11px; }
  .door[data-stage="room"] .tab-ico { width: 36px; height: 30px; }
  .door[data-stage="room"] .tab-ico img { width: 26px; height: 26px; }
  .door[data-stage="room"] .home-tab[aria-current="page"] .tab-ico { translate: 0 -4px; }
  .door[data-stage="room"] .home-tab[aria-current="page"] .tab-label { translate: 0 -3px; }
  .door[data-stage="room"] .home-act { padding-top: 8px; }
  .door[data-stage="room"] .home-say { grid-template-columns: minmax(0, 1fr) 38px 38px; padding: 4px; }
  .door[data-stage="room"] .home-say input, .door[data-stage="room"] .say-btn { height: 38px; }
  .door[data-stage="room"] .say-btn { width: 38px; }
}

/* Survey v2 (2026-10-30): five rating buttons in one row, with the two ends named underneath. */
.pick.five { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.pick.five label { min-height: 44px; padding: 4px; font-size: 16px; font-family: var(--f-title, inherit); }
.pick-scale { display: flex; justify-content: space-between; gap: 8px; margin: 6px 2px 0; font-size: 11.5px; color: var(--ink-500); }

/* Talk keeps Mame as large as the room (2026-10-31 user decision). The spoken line is no longer shown as
   text — it spoiled the line before Mame said it, and people listen with earphones — and the talk bar
   (おはなし中 · もどる · ちがうかも) rests on the floor in front of Mame instead of pushing the window up
   (390x664: Mame 504 px in talk -> 629 px, the same as the room).
   The line stays available to screen readers, and is shown only when the reply had to play muted. */
.room-subtitle { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.door[data-reply="muted"] .room-subtitle { position: static; width: auto; height: auto; margin: 0 -8px; padding: 4px 10px 5px; overflow: visible; clip: auto; white-space: normal; }
.door[data-mode="talk"] .room-act { position: relative; }
.door[data-mode="talk"] .home-now { position: absolute; left: 0; right: 0; bottom: calc(100% + 8px); }

/* Talk (2026-10-31 user decision): おはなし中 and もどる are gone — only the beta 「ちがうかも」 stays, as a
   small pill on the floor at Mame's lower right, so the video can be larger. The pill is visible only after
   a reply (showAnswerReport); the testers' guide explains it (memory: mame-beta-guide-todo). */
.door[data-mode="talk"] .home-now-line, .door[data-mode="talk"] .home-now-back { display: none; }
.door[data-mode="talk"] .home-now { left: auto; right: 2px; margin: 0; padding: 0; background: none; box-shadow: none; pointer-events: none; }
.door[data-mode="talk"] .answer-report { margin: 0; pointer-events: auto; }
.door[data-mode="talk"] .answer-report-button, .door[data-mode="talk"] .answer-report-thanks {
  min-height: 28px; padding: 3px 10px; font-size: 11px; font-weight: 700; color: var(--ink-700); text-decoration: none; letter-spacing: .02em;
  background: rgba(255, 250, 240, .92); box-shadow: 0 0 0 1.5px var(--oak-700), 0 2px 0 rgba(79, 61, 48, .2); border-radius: 999px;
}
.door[data-mode="talk"] .answer-report-thanks { display: inline-flex; align-items: center; }

/* 「こえを きく」 (2026-10-31): shown only when a reply had to play muted (Instagram in-app browser, Low Power
   Mode). The tap is a user gesture, so the voice plays and the next replies keep their sound. */
.voice-on { display: none; }
.door[data-mode="talk"][data-reply="muted"] .voice-on:not([hidden]) {
  display: inline-flex; align-items: center; margin-right: 6px; min-height: 28px; padding: 3px 12px; border: 0; cursor: pointer; pointer-events: auto;
  font: inherit; font-size: 12px; font-weight: 700; color: var(--ink-900); background: var(--apricot-300, #f6c48f);
  box-shadow: 0 0 0 1.5px var(--oak-700), 0 2px 0 rgba(79, 61, 48, .2); border-radius: 999px;
}
.voice-on:focus-visible { outline: 3px solid var(--apricot-300); outline-offset: 2px; }

/* Fruit from the plaza for Mame (fruit-gift.mjs, 2026-11-19): a small shelf in the bag, like the notebook button above it. */
.fruit-shelf { display: grid; gap: 6px; width: 100%; padding: 8px 12px; border-radius: 12px; color: #4F3D30; background: var(--oak-300); box-shadow: inset 0 0 0 2px var(--oak-700), inset 0 4px 0 rgba(79,61,48,.14); }
.fruit-shelf-title { margin: 0; font-size: 12px; font-weight: 700; opacity: .78; }
.fruit-list { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.fruit-list[hidden], .fruit-empty[hidden] { display: none; }
.fruit-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 8px; }
.fruit-label { font-size: 15px; }
.fruit-count { font-size: 13px; opacity: .78; }
.fruit-give { min-height: 40px; padding: 0 14px; font-weight: 700; }
.fruit-give:disabled { filter: saturate(.4); color: var(--ink-500); }
.fruit-empty { margin: 0; font-size: 14px; }

/* Mame reads the name (name-voice.mjs). 2026-11-21 redesign, owner: nothing may cover Mame. Over her video only small, light pieces
   sit just above the talk bar: the letters as one soft caption, the answers shaped like the talk chips. The name is written in the
   talk bar's own place. */
.name-voice-stage { position: absolute; left: 0; right: 0; bottom: calc(100% + 8px); display: grid; justify-items: center; gap: 8px; z-index: 3; pointer-events: none; }
.name-voice-cards { display: inline-flex; align-items: baseline; gap: 1px; padding: 3px 16px 5px; border-radius: 999px; background: rgb(251 248 242 / .86); box-shadow: 0 2px 12px rgb(56 44 36 / .16); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.name-voice-cards[hidden], .name-voice-chips[hidden] { display: none; }
.name-voice-card { min-width: 1.05em; text-align: center; font-family: var(--f-title); font-size: 25px; line-height: 1.35; color: var(--ink-300); transition: color .2s ease, transform .2s ease; }
.name-voice-card.is-lit { color: var(--apricot-700); transform: translateY(-2px) scale(1.1); }
.name-voice-card.is-done { color: var(--ink-900); }
.name-voice-card.is-suffix { font-size: 16px; margin-left: 5px; }
.name-voice-chips { display: flex; gap: 8px; pointer-events: auto; }
.name-voice-answer, .name-voice-suffix, .name-voice-later { flex: none; min-height: 36px; padding: 6px 14px; border: 1.5px solid var(--oak-900); border-radius: 999px; background: var(--cream-050); color: var(--ink-900); font: inherit; font-size: 13.5px; font-weight: 500; line-height: 1.2; white-space: nowrap; cursor: pointer; box-shadow: 0 2px 8px rgb(56 44 36 / .12); }
.name-voice-answer:focus-visible, .name-voice-suffix:focus-visible, .name-voice-later:focus-visible { outline: 3px solid var(--apricot-300); outline-offset: 2px; }
.name-voice-suffix.is-on { background: var(--apricot-100); font-weight: 700; }
.name-voice-later { margin-left: auto; color: var(--ink-700); border-color: var(--oak-500); }
/* Writing the name: the talk bar steps aside for the name bar; the way to be called sits just above it, over the floor. */
.name-voice-entry { position: relative; }
.name-voice-entry[hidden] { display: none; }
.room-act:has(> .name-voice-entry:not([hidden])) > #turn-form { display: none; }
.name-voice-entry-top { position: absolute; left: 0; right: 0; bottom: calc(100% + 8px); display: grid; gap: 6px; z-index: 3; }
.name-voice-row { display: flex; align-items: center; gap: 6px; }
.name-voice-suffixes { display: flex; gap: 6px; }
.name-voice-error, .name-voice-note { justify-self: center; max-width: 100%; margin: 0; padding: 3px 12px; border-radius: 999px; font-size: 12px; line-height: 1.4; background: rgb(251 248 242 / .86); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.name-voice-note { color: var(--ink-700); white-space: nowrap; }
.name-voice-error { color: var(--berry-700); font-weight: 700; }
.name-voice-error:not([hidden]) + .name-voice-note { display: none; }
.door[data-stage="room"] .name-voice-say { grid-template-columns: minmax(0, 1fr) 38px; }
.sheet-backdrop.name-voice-busy { display: none; }
.door[data-name-voice] .talk-chips { display: none; }

/* Open day (2026-11-21, owner on iPhone): the first login door must be Mame's. With the login choices open, the panel,
   the consent and the links took 60% of the screen and Mame shrank to a 147 px strip. The consent and links get smaller,
   the panel tighter (閉じる moves to the panel's corner), so the window keeps most of the height. Wording is unchanged. */
.door[data-stage="entry"] .entry-consent { margin-top: 0; font-size: 10.5px; line-height: 1.45; color: var(--ink-500); }
.door[data-stage="entry"] .entry-legal { margin-top: 0; font-size: 10px; line-height: 1.35; gap: 0 10px; }
.door[data-stage="entry"] .enter-stage:has(#login-panel:not([hidden])) { gap: 6px; }
.door[data-stage="entry"] .login-panel { position: relative; gap: 6px; padding: 8px 10px 8px; }
.door[data-stage="entry"] .login-panel-title { padding: 0 48px; font-size: 12px; line-height: 18px; }
.door[data-stage="entry"] .login-panel .idp { min-height: 44px; }
.door[data-stage="entry"] .login-panel .idp-line-mark, .door[data-stage="entry"] .login-panel .idp-g { height: 44px; }
.door[data-stage="entry"] .login-panel-close { position: absolute; top: 3px; right: 4px; padding: 4px 8px; font-size: 12px; line-height: 18px; }

/* Open day (2026-11-21, owner): the room's photo waited as a grey, undeveloped film over Mame's shoulder and read as a
   broken image. It is now a small, warm keepsake card at the window's right edge, off Mame: a soft sunny print with a
   flower and a strip of tape, the same 「写真」 label. Tapping still develops today's photo (photo-view.mjs). */
.photo-peek { right: 6px; width: 58px; padding: 4px 4px 1px; rotate: 6deg; border-radius: 2px; }
.photo-peek::before { content: ""; position: absolute; top: -6px; left: 50%; width: 26px; height: 11px; translate: -50% 0; rotate: -4deg;
  background: rgba(246, 201, 160, .82); box-shadow: 0 1px 0 rgba(79, 61, 48, .12); }
.pk-film { border-radius: 1px; background: url("./design/sprites/stamp-paw.svg") center 46% / 26px no-repeat,
  radial-gradient(circle at 70% 28%, #fffbef 0 18%, transparent 46%), linear-gradient(160deg, #fde9d2, #f7d3b4 58%, #fbe4cb); }
.pk-name { padding: 3px 0 2px; font-size: 10.5px; }
/* Open day, second pass (owner: still too small). With the login choices open, the consent stays (start = agreement:
   legal-entry.test.mjs) but the link row steps aside (it stays on the first door, for the review-site rule), and the
   signboard takes its short-screen size, so the window between the name tag and the panel grows. */
.door[data-stage="entry"]:has(#login-panel:not([hidden])) .entry-legal { display: none; }
.door[data-stage="entry"]:has(#login-panel:not([hidden])) .gate-plate { padding-top: 6px; }
.door[data-stage="entry"]:has(#login-panel:not([hidden])) .plate-board { padding: 6px clamp(10px, 3vw, 16px) 6px; }
.door[data-stage="entry"]:has(#login-panel:not([hidden])) .plate-name { font-size: clamp(18px, 6vw, 24px); }
.door[data-stage="entry"]:has(#login-panel:not([hidden])) .plate-tag { margin-top: 8px; padding: 2px 12px 3px; font-size: 12px; }
/* Open day, second pass (owner: invite the touch): a small sparkle twinkles at the card's corner, and the card gives a
   little hop now and then. Both rest for people who ask for less motion. */
.photo-peek::after { content: ""; position: absolute; top: -10px; right: -10px; width: 20px; height: 20px;
  background: url("./design/sprites/twinkle.svg") center / contain no-repeat; animation: peek-twinkle 1.8s ease-in-out infinite; pointer-events: none; }
@keyframes peek-twinkle { 0%, 100% { opacity: .55; scale: .75; rotate: 0deg; } 50% { opacity: 1; scale: 1.1; rotate: 20deg; } }
.photo-peek { animation: peek-in .6s cubic-bezier(.2, 1.3, .4, 1) both, peek-hop 4.2s 1.2s ease-in-out infinite; }
@keyframes peek-hop { 0%, 82%, 100% { translate: 0 0; } 88% { translate: 0 -6px; } 94% { translate: 0 0; } 97% { translate: 0 -2px; } }
@media (prefers-reduced-motion: reduce) { .photo-peek, .photo-peek::after { animation: none; } }

/* Open day, third pass (owner: the consent took too much of the door). The full consent and the info links now sit
   under the first door: the page scrolls to them, and only one short line under the buttons says that starting means
   agreeing to them (it scrolls there when tapped). Shown on the first door only; the room never scrolls. */
.entry-terms { display: none; }
body:has(.door[data-stage="entry"]) .entry-terms { display: grid; gap: 10px; max-width: var(--app-max); margin: 0 auto; padding: 18px 22px 28px; background: var(--cream-300); }
.entry-terms .entry-consent { margin: 0; font-size: 12px; line-height: 1.7; color: var(--ink-700); text-align: left; }
.entry-terms .entry-legal { margin: 0; justify-content: flex-start; font-size: 11.5px; line-height: 1.6; gap: 2px 14px; }
.entry-terms-pointer { justify-self: center; margin: 0; padding: 2px 6px; border: 0; background: none; font: inherit; font-size: 10.5px; line-height: 1.4;
  color: var(--ink-500); text-decoration: underline; text-underline-offset: 2px; white-space: nowrap; cursor: pointer; }
.entry-terms-pointer:focus-visible { outline: 3px solid var(--apricot-300); outline-offset: 2px; }
/* Open day, third pass: the intro hint asks for sound in the same single line (no speaker icon: older users may tap it).
   One line on every phone: a little smaller on narrow screens, never wrapping. */
.intro-hint { font-size: clamp(12px, 3.7vw, 16px); letter-spacing: .04em; max-width: calc(100vw - 16px); }

/* Open day: the snack shelf keeps its card when the day's snacks are done (tab-preview.mjs renderPantry). */
.pantry-detail[data-empty] .pd-give { display: none; }
.pantry-detail[data-empty] .pd-icon img { opacity: .7; }
/* 063: a snack bought with melons shows the next one's last day under its name, and the shelf one quiet line when some go within
   30 days (tab-preview.mjs renderPantry). The shop's sheet says the day before a snack is bought (preview/shop.js openSheet). */
.pd-until[hidden], .pantry-info[hidden] { display: none; }
.pantry-info { align-self: center; margin: 0; font-size: 12px; line-height: 1.6; color: var(--ink-700); text-align: center; }
.sheet-until { display: inline-block; margin-top: 4px; }
/* Open day: the veil between shelves is quicker, with the shelf switching under it at 70 ms (tab-preview.mjs show). */
.door.swap .door-veil { animation-duration: 200ms; }

/* Open day (owner: the mic blinked on and off and looked cheap). While listening, a soft ring breathes out from the button
   and the mic gently swells; nothing flashes. A short line above the bar says a second tap ends (app.js micHint). */
.say-mic { position: relative; }
.say-mic[data-listening] { animation: none; background: var(--apricot-100); }
.say-mic[data-listening]::after { content: ""; position: absolute; inset: -2px; border-radius: inherit; pointer-events: none;
  box-shadow: 0 0 0 2px rgba(232, 168, 110, .9); animation: mic-ring 1.8s cubic-bezier(.2, .7, .3, 1) infinite; }
.say-mic[data-listening] .glyph { animation: mic-swell 1.8s ease-in-out infinite; }
@keyframes mic-ring { 0% { opacity: .95; transform: scale(1); } 100% { opacity: 0; transform: scale(1.45); } }
@keyframes mic-swell { 0%, 100% { scale: 1; } 50% { scale: 1.1; } }
.home-say { position: relative; }
.mic-hint { position: absolute; right: 0; bottom: calc(100% + 10px); margin: 0; padding: 6px 12px; max-width: calc(100vw - 24px); letter-spacing: 0;
  background: var(--cream-050); color: var(--ink-700); font-size: 12.5px; line-height: 1.4; white-space: nowrap; border-radius: 999px;
  box-shadow: 0 0 0 2px var(--oak-700), 0 3px 10px rgba(79, 61, 48, .18); animation: mic-hint-in .35s ease-out both; pointer-events: none; }
.mic-hint[hidden] { display: none; }
@keyframes mic-hint-in { from { opacity: 0; translate: 0 6px; } }
@media (prefers-reduced-motion: reduce) { .say-mic[data-listening]::after, .say-mic[data-listening] .glyph, .mic-hint { animation: none; } }

/* Open day (2026-11-21, review #12): for eyes of 30-50, the smallest everyday text grows to at least 11-12.5 px and the talk
   bar's buttons to 44 px (the common minimum for a fingertip). Notices stay 4 s (app.js notice). Shop and plan rules that are
   not open yet keep their sizes. */
.door[data-stage="room"] .home-tab { font-size: 12px; }
.talk-limit { font-size: 12.5px; }
.door[data-mode="talk"] .answer-report-button, .door[data-mode="talk"] .answer-report-thanks { min-height: 32px; font-size: 12px; }
.sd-state { font-size: 12px; }
.shop-sign { font-size: 11px; }
.goods-name { font-size: 12px; }
.goods-free, .goods-owned { font-size: 11px; }
.sheet-body small { font-size: 12px; }
.slot-count, .goods .slot-count { font-size: 12px; }
.entry-terms-pointer { font-size: 11.5px; }
.door[data-stage="room"] .home-say { grid-template-columns: minmax(0, 1fr) 44px 44px; }
.door[data-stage="room"] .home-say input, .door[data-stage="room"] .say-btn { height: 44px; }
.door[data-stage="room"] .say-btn { width: 44px; }
/* Captions on (settings 「まめの言葉を字幕で表示」, review #13): the line shows under Mame while she speaks, as it does for a muted reply. */
.door[data-captions] .room-subtitle:not([hidden]) { position: static; width: auto; height: auto; margin: 0 -8px; padding: 4px 10px 5px; overflow: visible; clip: auto; white-space: normal; }
/* Mame's lines are phrases with spaces between them (「げんき です！ しっぽも げんき です。えへへ。」): a line breaks at a space, never
   inside a word (2026-11-21 check: 「えへ／へ。」); a phrase too long for the line still wraps.
   Safari has no auto-phrase, so there the shared rule fell back to breaking anywhere (「だ／いじょうぶ」, 「おひ／るね」). */
.door .room-subtitle { word-break: keep-all; overflow-wrap: anywhere; line-break: strict; }

/* Help sheet (2026-11-21, review #3): with the sexual violence, DV and poison lines it is taller than a phone; it scrolls inside
   and stays compact (the hours sit beside each number), so 閉じる is always reachable. */
/* the backdrop pads 24px all round, and the home-screen app draws under the notch and the home bar (viewport-fit=cover): the whole
   sheet, 閉じる included, stays inside (independent QA 2026-11-21, S6) */
/* iOS before 15.4 has no dvh: this line holds there (independent QA re-run 2026-11-21) */
#safety-help .sheet-dialog { max-height: calc(100vh - 48px); overflow-y: auto; overscroll-behavior: contain; }
#safety-help .sheet-dialog { max-height: calc(100dvh - 48px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)); overflow-y: auto; overscroll-behavior: contain; }
#safety-help .safety-lines { gap: 6px; }
#safety-help .safety-lines li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 8px; }
#safety-help .safety-more { margin-top: 4px; }
/* 2026-11-22 owner: every snack and every thing is shown, five of each, so each shelf is one row of five with no empty slots
   (two rows of four pushed the bag past a 375x667 screen once its things were always listed). */
.pantry-grid, .storage-grid { grid-template-columns: repeat(5, 1fr); }
/* 2026-11-22 owner: ご意見・ご要望 is its own door to the support form (ops-screens.mjs data-mode): its own words, and no FAQ
   and no kind to pick there; the inquiry door keeps everything as it was. */
[data-screen="support"]:not([data-mode="feedback"]) [data-for="feedback"],
[data-screen="support"][data-mode="feedback"] [data-for="inquiry"],
[data-screen="support"][data-mode="feedback"] #support-faq,
[data-screen="support"][data-mode="feedback"] #support-kind { display: none; }
