/*
 * The Birth Letter – question space (U-302, design B "Daylight Paper" + 5 judge fixes).
 * Colours ONLY through var(--…) from tokens.css. No dark mode yet.
 * Sizes: body text ≥ 18px, small text 15–16px, tap targets ≥ 44px (buttons 56–58px).
 */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html, body { margin: 0; padding: 0; background: var(--paper); }
body {
  color: var(--ink);
  font: 400 18px/1.6 var(--font-ui);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}
[hidden] { display: none !important; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--navy); }
h1, h2, h3 { margin: 0; }
p { margin: 0; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.noscript { padding: 24px; text-align: center; }

/* icons + seal */
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.ic { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.ic--lg { width: 32px; height: 32px; }
.i-fill { fill: currentColor; stroke: none; }
.seal { width: 36px; height: 36px; flex: none; }
.seal--lg { width: 64px; height: 64px; }
.seal--xl { width: 76px; height: 76px; }
.seal-body { fill: url(#sealWax); }
.seal-stop-hi { stop-color: var(--wax-hi); }
.seal-stop-mid { stop-color: var(--wax); }
.seal-stop-lo { stop-color: var(--wax-lo); }
.seal-ring { fill: none; stroke: var(--wax-ink); stroke-opacity: .55; stroke-width: 1.2; }
.seal-letter { fill: var(--wax-ink); font: 700 31px var(--font-head); }

.lockup { display: flex; align-items: center; gap: 10px; min-width: 0; }
.lockup__name { font: 600 20px/1.15 var(--font-head); color: var(--navy); letter-spacing: -.005em; white-space: nowrap; }
.lockup--big { flex-direction: column; gap: 12px; text-align: center; }
.lockup--big .lockup__name { font-size: 28px; }

/* buttons */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; min-height: 58px; padding: 12px 20px;
  font: 600 19px/1.25 var(--font-ui); text-align: center; text-decoration: none;
  border-radius: 14px; border: 2px solid transparent;
  transition: background .15s ease, transform .05s ease;
}
.btn:active { transform: translateY(1px); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .55; cursor: default; }
.btn--primary { background: var(--navy); color: var(--on-navy); }
.btn--primary:hover { background: var(--navy-2); }
.btn--secondary { background: var(--card); color: var(--navy); border-color: var(--navy); }
.btn--secondary:hover { background: var(--press); }
.btn--md { min-height: 48px; font-size: 17px; padding: 8px 16px; width: auto; }
.btn--listen { min-height: 56px; font-size: 18px; justify-content: flex-start; padding: 8px 18px 8px 8px; }
.btn--listen .play { width: 40px; height: 40px; border-radius: 50%; background: var(--on-navy); color: var(--navy); display: inline-flex; align-items: center; justify-content: center; flex: none; }
.btn--listen .play .ic { width: 20px; height: 20px; }
.btn--listen .btn__dur { margin-left: auto; font-weight: 500; font-variant-numeric: tabular-nums; }
.btn--listen.is-small { min-height: 48px; font-size: 17px; }
.btn--listen.is-small .play { width: 34px; height: 34px; }

.tlink {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 8px 4px; background: none; border: 0;
  font: 600 17px/1.3 var(--font-ui); color: var(--navy);
  text-decoration: underline; text-decoration-color: var(--gold-line); text-underline-offset: 5px; text-decoration-thickness: 2px;
}
.tlink--inline { min-height: 44px; padding: 0 2px; font-size: 16px; }
.tbtn { display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 8px 12px; background: none; border: 0; font: 600 16px/1.2 var(--font-ui); color: var(--ink-2); border-radius: 10px; }
.tbtn:hover { background: var(--press); }

/* text */
h1, .page-title { font: 600 28px/1.2 var(--font-head); color: var(--navy); letter-spacing: -.005em; }
h2 { font: 600 23px/1.25 var(--font-head); color: var(--navy); }
.lead { font-size: 19px; line-height: 1.5; }
.sub { font-size: 17px; line-height: 1.55; color: var(--ink-2); }
.fine { font-size: 15px; line-height: 1.5; color: var(--ink-2); }
.eyebrow { font: 600 15px/1.3 var(--font-ui); color: var(--label); margin: 4px 0 6px; }
.label { font: 600 15px/1.3 var(--font-ui); color: var(--label); }
.muted { color: var(--ink-2); }

/* messages */
.msg { padding: 12px 14px; border-radius: 12px; font-size: 16px; line-height: 1.45; }
.msg--error { background: var(--error-bg); color: var(--error-ink); }
.msg--ok { background: var(--ok-bg); color: var(--ok-ink); }
.msg--notice { background: var(--notice-bg); color: var(--notice-ink); }

/* fields */
.stack { display: flex; flex-direction: column; gap: 12px; }
.field { display: flex; flex-direction: column; gap: 6px; text-align: left; }
.field__label { font: 600 16px/1.3 var(--font-ui); color: var(--ink); }
.field__hint { font-size: 15px; color: var(--ink-2); }
.input, .select, textarea.input {
  width: 100%; min-height: 54px; padding: 12px 14px;
  font: 400 18px/1.4 var(--font-ui); color: var(--ink);
  background: var(--card); border: 1.5px solid var(--field-border); border-radius: 12px;
  appearance: none; -webkit-appearance: none;
}
textarea.input { min-height: 96px; resize: vertical; }
.input::placeholder, textarea::placeholder { color: var(--ink-3); opacity: 1; }
.input:focus, .select:focus, textarea:focus { outline: 3px solid var(--focus); outline-offset: 1px; }
.input--code { font: 600 30px/1 var(--font-ui); letter-spacing: .4em; text-align: center; font-variant-numeric: tabular-nums; padding-left: 22px; }
.select { padding-right: 34px; background-image: linear-gradient(45deg, transparent 50%, var(--ink-2) 50%), linear-gradient(135deg, var(--ink-2) 50%, transparent 50%); background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%; background-size: 6px 6px, 6px 6px; background-repeat: no-repeat; }
.check { display: flex; align-items: center; gap: 12px; min-height: 48px; font-size: 17px; }
.check input { width: 24px; height: 24px; accent-color: var(--navy); flex: none; }
.row3 { display: grid; grid-template-columns: 1.4fr .8fr 1fr; gap: 8px; }

/* cards */
.card { background: var(--card); border: 1.5px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-1); }

/* boot */
.boot { position: fixed; inset: 0; z-index: 100; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; background: var(--paper); transition: opacity .3s ease; }
.boot.hidden { opacity: 0; pointer-events: none; }
.boot__name { font: 600 26px/1.2 var(--font-head); color: var(--navy); margin-top: 6px; }
.boot__sub { font-size: 16px; color: var(--ink-2); margin-bottom: 10px; }
.spinner { width: 30px; height: 30px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--navy); animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ═════════════ SIGN IN ═════════════ */
.screen--login { min-height: 100vh; min-height: 100dvh; display: flex; justify-content: center; }
.login { width: 100%; max-width: 440px; padding: max(28px, env(safe-area-inset-top)) 24px 20px; display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; }
.login .lockup--big { margin: 8px 0 22px; }
.login__step { display: flex; flex-direction: column; gap: 14px; text-align: center; }
.login__step h1 { margin-top: 2px; }
.login__step .stack { margin-top: 6px; }
.login__step .lead b { font-weight: 600; word-break: break-all; }
.icon-circle { width: 72px; height: 72px; margin: 0 auto; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--card); color: var(--navy); border: 2px solid var(--gold-line); }
.login__foot { margin-top: auto; padding-top: 28px; text-align: center; font-size: 15px; line-height: 1.5; color: var(--ink-2); }
.login__foot .links { margin-top: 6px; display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 8px; }
.login__foot a { color: var(--ink-2); text-underline-offset: 3px; display: inline-flex; min-height: 32px; align-items: center; }
/* her language (U-300): a quiet row at the top of sign-in, the current one plain and darker */
.login .langs { margin: 0 0 6px; display: flex; flex-wrap: wrap; justify-content: center; gap: 0 10px; }
.login .langs .tlink { min-height: 36px; padding: 4px 1px; font-size: 13px; font-weight: 400; color: var(--ink-2); text-underline-offset: 3px; text-decoration-thickness: 1px; }
.login .langs .tlink.is-current { color: var(--ink); font-weight: 600; text-decoration: none; }

/* ═════════════ APP SHELL ═════════════ */
.screen--app { height: 100vh; height: 100dvh; display: flex; flex-direction: column; }
.topbar {
  flex: none; position: relative; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  min-height: 64px; padding: max(8px, env(safe-area-inset-top)) 12px 8px 18px;
  background: var(--paper); border-bottom: 1.5px solid var(--line);
}
.topbar__left { display: flex; align-items: center; gap: 4px; min-width: 0; }
.topbar__right { display: flex; align-items: center; gap: 2px; }
.topbar__title { position: absolute; left: 50%; transform: translateX(-50%); font: 600 18px/1.2 var(--font-ui); color: var(--navy); white-space: nowrap; pointer-events: none; }
.topbtn {
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-width: 52px; min-height: 48px; padding: 4px 6px; background: none; border: 0; border-radius: 10px;
  font: 600 13px/1.1 var(--font-ui); color: var(--navy);
}
.topbtn:hover { background: var(--press); }
.topbtn[aria-pressed="true"] { background: var(--chip-bg); }
.topbtn--back { flex-direction: row; gap: 2px; font-size: 17px; padding: 4px 10px 4px 0; margin-left: -6px; }

.views { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.views.is-thread { overflow: hidden; }
.view { width: 100%; max-width: 620px; margin: 0 auto; padding: 18px 20px 32px; }

.tabbar {
  flex: none; display: flex; justify-content: space-around; align-items: stretch;
  padding: 0 8px env(safe-area-inset-bottom); background: var(--card); border-top: 1.5px solid var(--line);
}
.tab {
  position: relative; flex: 1; max-width: 160px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  min-height: 66px; padding: 8px 4px 10px; background: none; border: 0;
  font: 600 15px/1.1 var(--font-ui); color: var(--ink-3);
}
.tab .ic { width: 24px; height: 24px; }
.tab.active { color: var(--navy); }
.tab.active::after { content: ""; position: absolute; left: 6px; right: 6px; bottom: 0; height: 3px; border-radius: 3px 3px 0 0; background: var(--gold-line); }

/* ═════════════ HOME ═════════════ */
.hello { font: 600 30px/1.2 var(--font-head); color: var(--navy); margin-bottom: 18px; }
.ask-card { padding: 20px; margin-bottom: 12px; }
.ask-card__q { font-size: 19px; line-height: 1.4; font-weight: 500; margin-bottom: 14px; }
.balance { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font: 500 16px/1.4 var(--font-ui); color: var(--ink-2); margin: 4px 0 22px 4px; }
.balance .ic { width: 20px; height: 20px; }
.today { padding: 20px 20px 18px; border-left: 5px solid var(--gold-line); border-radius: 14px; }
.today__title { display: flex; align-items: center; gap: 8px; font: 600 16px/1.3 var(--font-ui); color: var(--label); margin-bottom: 10px; }
.today__title .ic { width: 20px; height: 20px; }
.today__line { font-size: 19px; line-height: 1.55; margin-bottom: 14px; }
.today .msg { margin-bottom: 12px; }
.today .btn { width: 100%; }

/* ═════════════ THREAD (My answers) ═════════════ */
.view--thread { display: flex; flex-direction: column; height: 100%; max-width: none; padding: 0; }
.thread { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; padding: 14px 16px 24px; }
.thread > * { max-width: 620px; margin-left: auto; margin-right: auto; }
.thread__empty { text-align: center; padding: 36px 12px 8px; }
.thread__empty h2 { margin-bottom: 10px; }
.thread__empty p { color: var(--ink-2); }
.messages { display: flex; flex-direction: column; gap: 14px; }

.message.user { align-self: flex-end; max-width: 88%; margin-left: 44px; }
.message.user .message-content { background: var(--navy); color: var(--on-navy); padding: 14px 16px; border-radius: 18px 18px 4px 18px; font-size: 18px; line-height: 1.5; white-space: pre-wrap; word-wrap: break-word; }
.message.assistant { background: var(--card); border: 1.5px solid var(--line); border-top: 3px solid var(--gold-line); border-radius: 16px; padding: 18px 20px 10px; box-shadow: var(--shadow-1); }
.letter__head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 8px; }
.letter__dear { font: 400 20px/1.4 var(--font-letter); color: var(--ink); }
.letter__date { font: 400 15px/1.3 var(--font-ui); color: var(--ink-2); white-space: nowrap; }
.message.assistant .message-content { font: 400 20px/1.6 var(--font-letter); color: var(--ink); word-wrap: break-word; }
.message.assistant .message-content p { margin: 0 0 14px; }
.message.assistant .message-content h2, .message.assistant .message-content h3 { font: 600 21px/1.35 var(--font-letter); color: var(--ink); margin: 6px 0 8px; }
.message.assistant .btn--listen { margin: 14px 0 6px; }
.message-actions { display: flex; flex-wrap: wrap; gap: 4px; border-top: 1px solid var(--line); margin-top: 10px; padding-top: 4px; }
.msg-action { display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 12px; background: none; border: 0; border-radius: 10px; font: 600 16px/1 var(--font-ui); color: var(--navy); }
.msg-action:hover { background: var(--press); }
.msg-action .ic { width: 20px; height: 20px; }
.message.notice { align-self: stretch; background: var(--notice-bg); color: var(--notice-ink); border-radius: 14px; padding: 14px 16px; font-size: 17px; line-height: 1.5; }
.message.notice .btn { margin-top: 12px; }
.typing { display: flex; align-items: center; gap: 12px; font: 400 19px/1.4 var(--font-letter); color: var(--ink-2); }
.dots { display: inline-flex; gap: 5px; }
.dots span { width: 7px; height: 7px; border-radius: 50%; background: var(--gold-line); animation: dot 1.2s ease-in-out infinite; }
.dots span:nth-child(2) { animation-delay: .15s; }
.dots span:nth-child(3) { animation-delay: .3s; }
@keyframes dot { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
.voice-sentence-chunk { transition: opacity .3s ease; }

.starters { margin-top: 16px; }
.starters__label { font: 600 15px/1.3 var(--font-ui); color: var(--label); margin: 0 0 8px 2px; }
.starters__list { display: flex; flex-direction: column; gap: 8px; }
.chip-btn { display: block; width: 100%; min-height: 52px; padding: 12px 16px; text-align: left; background: var(--card); border: 1.5px solid var(--field-border); border-radius: 14px; font: 500 17px/1.4 var(--font-ui); color: var(--ink); }
.chip-btn:hover { background: var(--press); }

.saved { display: flex; flex-direction: column; gap: 12px; }
.saved__empty { text-align: center; color: var(--ink-2); padding: 32px 8px; }

.composer { flex: none; background: var(--paper); border-top: 1.5px solid var(--line); padding: 10px 14px 10px; }
.composer > * { max-width: 620px; margin-left: auto; margin-right: auto; }
.depth { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 8px; }
.depth__opt { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 1px; min-height: 52px; padding: 6px 12px; text-align: left; background: var(--card); border: 1.5px solid var(--line); border-radius: 12px; color: var(--ink-2); }
.depth__name { font: 600 16px/1.2 var(--font-ui); }
.depth__cost { font: 500 14px/1.2 var(--font-ui); }
.depth__opt.active { border: 2px solid var(--navy); color: var(--navy); background: var(--card); }
.cbox { display: flex; align-items: flex-end; gap: 8px; min-height: 58px; padding: 6px 6px 6px 16px; background: var(--card); border: 1.5px solid var(--field-border); border-radius: 16px; }
.cbox:focus-within { outline: 3px solid var(--focus); outline-offset: 1px; }
.cbox textarea { flex: 1; min-height: 44px; max-height: 180px; padding: 10px 0; border: 0; outline: 0; resize: none; background: transparent; font: 400 18px/1.4 var(--font-ui); color: var(--ink); }
.sendbtn { width: 46px; height: 46px; flex: none; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 12px; background: var(--navy); color: var(--on-navy); }
.sendbtn[disabled] { opacity: .5; }
.composer__bal { text-align: center; font: 500 15px/1.3 var(--font-ui); color: var(--ink-2); margin-top: 6px; min-height: 20px; }
.composer__bal button { margin-left: 6px; }

/* voice mode (voice-chat.js builds these) */
.voice-mode-btn { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; min-width: 52px; height: 46px; padding: 0 6px; border: 1.5px solid var(--navy); border-radius: 12px; background: var(--card); color: var(--navy); font: 600 12px/1 var(--font-ui); }
.voice-mode-btn .ic { width: 20px; height: 20px; }
.voice-mode-btn.active { background: var(--chip-bg); }
.voice-interface { flex: 1; display: none; flex-direction: column; align-items: center; gap: 8px; padding: 6px 0; }
.voice-interface-content { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.voice-status { display: flex; align-items: center; gap: 8px; font: 500 16px/1.3 var(--font-ui); color: var(--ink-2); text-align: center; }
.status-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--gold-line); flex: none; }
.status-dot--rec { background: var(--wax); animation: dot 1.2s ease-in-out infinite; }
.status-dot--busy { background: var(--navy); animation: dot 1.2s ease-in-out infinite; }
.voice-record-btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-width: 180px; min-height: 56px; padding: 8px 22px; border: 0; border-radius: 28px; background: var(--navy); color: var(--on-navy); font: 600 18px/1 var(--font-ui); }
.voice-record-btn.recording { background: var(--wax); }
.voice-record-btn .ic { width: 22px; height: 22px; }
.voice-timer { font: 600 16px/1 var(--font-ui); color: var(--ink-2); font-variant-numeric: tabular-nums; }
.voice-timer.is-warn, #recordingTime.is-warn { color: var(--label); }
.voice-timer.is-limit, #recordingTime.is-limit { color: var(--error-ink); }
.voice-waveform { display: none; gap: 4px; height: 18px; align-items: center; }
.voice-waveform.active { display: flex; }
.waveform-bar { width: 4px; height: 8px; border-radius: 2px; background: var(--navy); animation: wave 1s ease-in-out infinite; }
.waveform-bar:nth-child(2) { animation-delay: .1s; } .waveform-bar:nth-child(3) { animation-delay: .2s; } .waveform-bar:nth-child(4) { animation-delay: .3s; } .waveform-bar:nth-child(5) { animation-delay: .4s; }
@keyframes wave { 0%, 100% { height: 6px; } 50% { height: 18px; } }
.voice-hint, .voice-switch-hint { font-size: 15px; color: var(--ink-2); text-align: center; }
.audio-playing-indicator { display: inline-flex; align-items: center; gap: 8px; font-size: 15px; color: var(--ink-2); }
.audio-wave-bar { width: 3px; border-radius: 2px; background: var(--gold-line); animation: wave 1s ease-in-out infinite; }
.autoplay-btn { min-height: 48px; padding: 8px 16px; border: 2px solid var(--navy); border-radius: 12px; background: var(--card); color: var(--navy); font: 600 16px/1.2 var(--font-ui); }
body.patark-voice-mode-active .depth { display: none; }

/* ═════════════ TODAY'S MESSAGE (opened) ═════════════ */
.letter { background: var(--card); border: 1.5px solid var(--line); border-top: 3px solid var(--gold-line); border-radius: 16px; padding: 22px 22px 16px; box-shadow: var(--shadow-1); }
.letter__title { font: 600 15px/1.3 var(--font-ui); color: var(--label); margin-bottom: 4px; }
.letter__body { font: 400 20px/1.6 var(--font-letter); color: var(--ink); margin-top: 6px; }
.letter__body p { margin: 0 0 14px; }
.letter__image { margin: 4px 0 16px; border-radius: 12px; overflow: hidden; }
.letter__image img { display: block; width: 100%; aspect-ratio: 16/9; object-fit: cover; }

/* ═════════════ ME ═════════════ */
.page-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 .3em; margin-bottom: 16px; }
.page-title__name::before { content: "· "; }
.page-title__name:empty { display: none; }
.me { display: flex; flex-direction: column; gap: 14px; }
.me-card { padding: 18px 16px 16px; }
.me-card__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.me-card__head h2 { font-size: 22px; }
.edit-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 44px; min-height: 44px; padding: 0 12px; background: var(--card); border: 1.5px solid var(--navy); border-radius: 12px; font: 600 16px/1 var(--font-ui); color: var(--navy); }
.edit-btn .ic { width: 18px; height: 18px; }
.cosmic { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.cosmic__cell { display: grid; grid-template-columns: 26px 1fr; column-gap: 6px; padding: 10px; background: var(--paper-2); border-radius: 12px; }
.cosmic__cell .ic { color: var(--label); width: 20px; height: 20px; margin-top: 2px; grid-row: 1 / 3; }
.cosmic__k { font: 600 15px/1.2 var(--font-ui); color: var(--label); }
.cosmic__v { font: 600 20px/1.25 var(--font-ui); color: var(--ink); }
.cosmic__v.is-unknown { font: 400 15px/1.3 var(--font-ui); color: var(--ink-2); }
.intent { background: var(--chip-bg); border-radius: 12px; padding: 12px 14px; }
.intent p { font-size: 19px; line-height: 1.45; font-weight: 500; }
.intent .muted { font-size: 17px; font-weight: 400; }
.kv { display: grid; gap: 10px; }
.kv__row { display: flex; flex-direction: column; gap: 2px; }
.kv__k { font: 600 15px/1.3 var(--font-ui); color: var(--label); }
.kv__v { font-size: 18px; }
.kv__v.is-empty { color: var(--ink-2); }
.form-actions { display: flex; gap: 10px; margin-top: 4px; }
.form-actions .btn { flex: 1; min-height: 52px; font-size: 18px; }
.suggest { position: relative; }
.suggest__list { position: absolute; z-index: 5; left: 0; right: 0; top: 100%; margin: 4px 0 0; padding: 4px; list-style: none; background: var(--card); border: 1.5px solid var(--field-border); border-radius: 12px; box-shadow: var(--shadow-2); max-height: 260px; overflow-y: auto; }
.suggest__list button { display: block; width: 100%; min-height: 48px; padding: 10px 12px; text-align: left; background: none; border: 0; border-radius: 8px; font-size: 17px; }
.suggest__list button:hover, .suggest__list button.is-active { background: var(--press); }
.qcard { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.qcard__n { font: 600 36px/1 var(--font-ui); color: var(--navy); }
.qcard__t { font-size: 16px; color: var(--ink-2); }
.me__signout { max-width: 620px; margin: 22px auto 0; padding: 0 0 8px; display: flex; justify-content: center; border-top: 1px solid var(--line); padding-top: 14px; }

/* ═════════════ MORE QUESTIONS ═════════════ */
.buy__bal { display: flex; align-items: baseline; gap: 8px; margin: 4px 0 8px; }
.buy__bal-n { font: 600 40px/1 var(--font-ui); color: var(--navy); }
.buy__bal-t { font: 500 18px/1.3 var(--font-ui); color: var(--ink-2); }
.buy h1 { margin-bottom: 6px; }
.buy .lead { color: var(--ink-2); margin-bottom: 18px; }
.pack { display: flex; align-items: center; gap: 14px; min-height: 92px; padding: 16px 18px; background: var(--card); border: 3px solid var(--navy); border-radius: 16px; margin-bottom: 14px; }
.pack__l { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.pack__n { font: 600 22px/1.2 var(--font-ui); color: var(--ink); }
.pack__e { font: 400 16px/1.2 var(--font-ui); color: var(--ink-2); }
.pack__p { font: 700 26px/1 var(--font-ui); color: var(--navy); }
.once, .secure { display: flex; align-items: center; justify-content: center; gap: 8px; font: 500 17px/1.3 var(--font-ui); color: var(--ink-2); }
.once { margin: 2px 0 14px; }
.once .ic { color: var(--navy); width: 20px; height: 20px; }
.secure { margin-top: 12px; font-size: 16px; }
.secure .ic { width: 18px; height: 18px; }
.buy .tlink { width: 100%; margin-top: 6px; }
.buy .msg { margin: 10px 0; }

/* ═════════════ DIALOG + TOAST ═════════════ */
.dialog { position: fixed; inset: 0; z-index: 60; display: flex; align-items: flex-end; justify-content: center; background: var(--scrim); padding: 16px; }
.dialog__panel { width: 100%; max-width: 440px; background: var(--card); border-radius: 18px; padding: 22px 20px calc(16px + env(safe-area-inset-bottom)); box-shadow: var(--shadow-2); }
.dialog__panel h2 { margin-bottom: 10px; }
.dialog__body { font-size: 17px; line-height: 1.55; color: var(--ink-2); }
.dialog__body p + p { margin-top: 10px; }
.dialog__body ol { margin: 0; padding-left: 22px; }
.dialog__body li { margin-bottom: 8px; color: var(--ink); }
.dialog__actions { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; }
@media (min-width: 600px) { .dialog { align-items: center; } }
.toast { position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 70; max-width: calc(100% - 32px); padding: 12px 18px; border-radius: 12px; background: var(--navy); color: var(--on-navy); font: 500 16px/1.4 var(--font-ui); box-shadow: var(--shadow-2); }

/* cookie notice (cookie-consent.js) */
.cookie-consent { position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 80; display: flex; justify-content: center; }
.cookie-consent__inner { display: flex; align-items: center; gap: 12px; max-width: 520px; width: 100%; padding: 12px 14px; background: var(--card); border: 1.5px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-2); }
.cookie-consent__text { flex: 1; font-size: 15px; line-height: 1.4; color: var(--ink-2); }
.cookie-consent__link { color: var(--navy); }
.cookie-consent__btn { min-width: 64px; min-height: 44px; padding: 0 16px; border: 0; border-radius: 10px; background: var(--navy); color: var(--on-navy); font: 600 16px/1 var(--font-ui); }
.cookie-consent--hidden { opacity: 0; transition: opacity .3s ease; }

/* admin shell */
.screen--admin { min-height: 100vh; }
.admin-wrap { max-width: 1200px; margin: 0 auto; padding: 16px; }

@media (min-width: 760px) {
  .topbar { padding-left: 28px; padding-right: 20px; }
  .view { padding-top: 28px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* the cookie notice must not cover the AI line on the sign-in screen (U-302 review 11-01): lift the footer above it */
body:has(.cookie-consent:not(.cookie-consent--hidden)) .login { padding-bottom: calc(108px + env(safe-area-inset-bottom)); }
/* the cookie notice must not cover the tab bar */
body:has(#memberScreen:not([hidden])) .cookie-consent { bottom: calc(78px + env(safe-area-inset-bottom)); }
.today .btn { font-size: 16px; padding: 8px 10px; }
.btn--wide { width: 100%; margin-top: 14px; }
.fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.fieldset legend { padding: 0; margin-bottom: 6px; }
.sub--gap { margin-bottom: 16px; }
.spinner--center { display: block; margin: 40px auto; }
.btn--listen { font-size: 17px; gap: 10px; }
.thread { padding-left: 12px; padding-right: 12px; }
.message.assistant { padding: 16px 16px 8px; }
