@font-face {
  font-family: Inter;
  src: url("/fonts/Inter.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: Anton;
  src: url("/fonts/Anton.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("/fonts/JetBrainsMono.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 800;
  font-display: swap;
}

:root {
  color-scheme: light;
  --surface: #ffffff;
  --ink: #1a1a1a;
  --secondary: #535353;
  --muted: #686868;
  --line: #dedede;
  --hover: #f3f3f3;
  --strip-muted: #aaaaaa;
  --strip-line: #686868;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --surface: #1a1a1a;
  --ink: #ffffff;
  --secondary: #cecece;
  --muted: #a8a8a8;
  --line: #393939;
  --hover: #2a2a2a;
  --strip-muted: #626262;
  --strip-line: #aaaaaa;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-height: 100%; background: var(--surface); }
body { min-height: 100svh; margin: 0; color: var(--ink); background: var(--surface); }
button, input, textarea { font: inherit; }
button { color: inherit; cursor: pointer; }
button, label { -webkit-tap-highlight-color: transparent; }
button:disabled { cursor: default; opacity: .45; }
button:focus-visible, a:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }
::selection { background: var(--ink); color: var(--surface); }

.app-shell { position: relative; width: min(100%, 760px); min-height: 100svh; margin: 0 auto; padding: max(22px, env(safe-area-inset-top)) max(18px, env(safe-area-inset-right)) calc(22px + var(--safe-bottom)) max(18px, env(safe-area-inset-left)); }
.topbar { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 28px; }
.brand { padding-top: 10px; font-size: 14px; font-weight: 700; letter-spacing: .09em; }
.brand-rule { width: 34px; height: 2px; margin-top: 12px; background: var(--ink); }
.topbar-actions { display: flex; align-items: center; gap: 4px; }
.icon-button { min-width: 44px; height: 44px; padding: 0 9px; border: 0; background: transparent; letter-spacing: 2px; }
.icon-button.small { font-size: 21px; letter-spacing: 0; }
.icon-button:hover, .text-button:hover, .settings-row:hover { background: var(--hover); }

.settings-panel { position: absolute; z-index: 10; top: calc(max(22px, env(safe-area-inset-top)) + 48px); right: max(18px, env(safe-area-inset-right)); width: min(280px, calc(100% - 36px)); padding: 6px; border: 1px solid var(--line); background: var(--surface); box-shadow: 0 12px 32px #00000014; }
.settings-row { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 48px; justify-content: space-between; padding: 12px; border: 0; background: transparent; color: var(--secondary); font-size: 13px; text-align: left; text-decoration: none; }
.settings-row > span:last-child { color: var(--ink); font-family: var(--mono); }

.activation-view { padding: clamp(48px, 12svh, 120px) 6px 30px; text-align: left; }
.eyebrow { margin: 0 0 18px; color: var(--muted); font: 10px var(--mono); letter-spacing: .08em; }
h1 { max-width: 520px; margin: 0; font: 400 clamp(44px, 10vw, 64px)/1.12 Anton, Impact, sans-serif; }
.lede { max-width: 390px; margin: 24px 0 0; color: var(--secondary); font-size: 14px; line-height: 1.65; }
.activation-form { display: grid; gap: 10px; max-width: 520px; margin: 34px 0 0; }
input, textarea { width: 100%; border: 1px solid var(--line); border-radius: 0; background: var(--surface); color: var(--ink); caret-color: var(--ink); }
input:focus, textarea:focus { outline: 2px solid var(--ink); outline-offset: 2px; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }
.activation-form input { height: 52px; padding: 0 16px; }
.primary-button { min-height: 52px; padding: 0 16px; border: 1px solid var(--ink); background: var(--ink); color: var(--surface); font: 11px var(--mono); letter-spacing: .08em; }
.primary-button:focus-visible { outline-color: var(--ink); }

.main-view { display: flex; flex-direction: column; }
.answer-view { margin: 0 0 12px; scroll-margin-top: 16px; }
/* The asked question echoes the desktop header line beside FINDOUT. */
.answer-question { margin: 0; overflow: hidden; color: var(--muted); font-size: 10px; font-weight: 300; letter-spacing: .08em; text-overflow: ellipsis; text-transform: uppercase; white-space: nowrap; }
.text-button { min-height: 44px; padding: 8px; border: 0; background: transparent; color: var(--secondary); font: 10px var(--mono); letter-spacing: .03em; }
.answer-text { padding: 14px 0 6px; color: var(--ink); font-size: 17px; line-height: 1.65; white-space: pre-wrap; overflow-wrap: anywhere; }
.answer-text.is-short { font: 400 clamp(44px, 14vw, 69px)/1.12 Anton, Impact, sans-serif; }
.answer-status { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.answer-status p { margin: 0; color: var(--muted); font: 9px/1.6 var(--mono); }
#answerSource:not(:empty) + #allowance:not(:empty)::before { content: " · "; }
.answer-status .text-button { margin-right: -8px; }

/* Recent stays in the mobile page, below the composer, with expandable threads. */
.history-section { margin: 4px 0 24px; }
.section-heading { margin: 0 0 9px; font: 400 10px var(--mono); letter-spacing: .08em; }
.history-list { border-top: 1px solid var(--line); }
.history-item { border-bottom: 1px solid var(--line); }
.history-question { display: grid; grid-template-columns: 30px minmax(0, 1fr) 25px; align-items: center; width: 100%; min-height: 50px; padding: 15px 4px; border: 0; background: transparent; text-align: left; }
.history-question:hover { background: var(--hover); }
.history-index { color: var(--muted); font: 10px var(--mono); }
.history-title { overflow: hidden; font-size: 13px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.history-chevron { justify-self: end; color: var(--muted); transition: transform .18s ease; }
.history-question[aria-expanded="true"] .history-chevron { transform: rotate(180deg); }
.history-answer { padding: 0 34px 17px; color: var(--secondary); font-size: 14px; line-height: 1.65; white-space: pre-wrap; overflow-wrap: anywhere; }
.history-answer .text-button { margin: 8px 0 0 -8px; }

.composer { position: relative; margin: 0 0 24px; padding: 12px 14px; background: var(--ink); color: var(--surface); }
.composer textarea { min-height: 51px; max-height: 145px; padding: 12px 0 10px; resize: none; overflow-y: auto; border: 0; border-bottom: 1px solid var(--surface); background: transparent; color: var(--surface); caret-color: var(--surface); font-size: 16px; line-height: 1.4; }
.composer textarea:focus { outline: 0; }
.composer:focus-within { outline: 2px solid var(--ink); outline-offset: 3px; }
.composer textarea::placeholder { color: var(--strip-muted); }
.composer textarea::selection { color: var(--ink); background: var(--surface); }
.composer-bar { display: flex; align-items: center; justify-content: space-between; margin-top: 5px; }
.attach-button { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; margin-left: -8px; padding: 0 8px; border: 0; background: transparent; color: var(--strip-muted); font: 10px var(--mono); }
.attach-button:hover, .send-button:hover { color: var(--surface); }
.attach-button > span:first-child { font-size: 19px; }
.send-button { min-width: 44px; min-height: 44px; margin-right: -6px; padding: 0 6px; border: 0; background: transparent; color: var(--surface); font: 400 24px Inter, sans-serif; text-align: right; }
.image-preview { display: grid; grid-template-columns: 45px minmax(0, 1fr) auto; align-items: center; gap: 10px; margin: 0 0 4px; padding: 8px 0; border-bottom: 1px solid var(--strip-line); }
.image-preview img { width: 45px; height: 45px; object-fit: cover; }
.image-preview span { overflow: hidden; color: var(--strip-muted); font: 10px var(--mono); text-overflow: ellipsis; white-space: nowrap; }
.form-status { min-height: 18px; margin: 7px 0 0; color: var(--secondary); font: 11px/1.6 var(--mono); text-align: left; overflow-wrap: anywhere; }
.composer .form-status { color: var(--surface); }
.composer .form-status:empty { display: none; }
.install-hint { position: fixed; z-index: 12; right: 16px; bottom: calc(16px + var(--safe-bottom)); left: 16px; display: flex; align-items: center; gap: 4px; max-width: 520px; margin: auto; padding: 6px 6px 6px 16px; border: 1px solid var(--line); background: var(--surface); box-shadow: 0 8px 32px #00000014; color: var(--secondary); font-size: 13px; line-height: 1.45; }
.install-hint span { flex: 1; }
.install-hint .text-button { color: var(--ink); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

@media (min-width: 650px) {
  .app-shell { padding-right: 28px; padding-left: 28px; }
  .activation-form { grid-template-columns: 1fr 125px; }
  .activation-form .form-status { grid-column: 1 / -1; grid-row: 2; }
  .activation-form .primary-button { grid-column: 2; grid-row: 1; }
  .composer { padding-right: 24px; padding-left: 24px; }
}

dialog { width: min(92vw, 520px); max-height: 90dvh; overflow: auto; padding: 24px; border: 1px solid var(--line); color: var(--ink); background: var(--surface); }
dialog::backdrop { background: #0008; }
#installDialog h2 { margin: 0 0 16px; font-size: 21px; }
#installDialog p { margin: 16px 0; color: var(--secondary); font-size: 13px; line-height: 1.6; }
.install-steps { display: grid; gap: 12px; margin: 0; padding-left: 22px; font-size: 15px; line-height: 1.55; }
.step-icon { width: 1.15em; height: 1.15em; vertical-align: -.2em; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.step-icon circle { fill: currentColor; stroke: none; }
#feedbackForm { display: grid; gap: 12px; }
#feedbackForm h2 { margin: 0; font-size: 21px; }
#feedbackForm p { font-size: 13px; line-height: 1.6; overflow-wrap: anywhere; }
#feedbackForm a, .privacy-shell a { color: inherit; text-underline-offset: 3px; }
#feedbackForm textarea, #feedbackEmail { padding: 10px; font-size: 16px; }
.feedback-license { display: flex; align-items: start; gap: 8px; font-size: 14px; line-height: 1.5; }
.feedback-license input { flex: 0 0 auto; width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--ink); }
.feedback-payload { padding: 12px; border: 1px solid var(--line); background: var(--hover); }
.feedback-payload strong { font-size: 13px; }
.feedback-payload ul { margin: 8px 0; padding-left: 22px; font-size: 13px; line-height: 1.6; }
.feedback-payload p { margin: 8px 0 0; }
.dialog-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.dialog-actions button { min-height: 44px; padding: 8px 14px; border: 1px solid var(--line); background: var(--surface); font: 11px var(--mono); }
#feedbackSend { border-color: var(--ink); color: var(--surface); background: var(--ink); }
#feedbackSend:focus-visible { outline-color: var(--ink); }

.privacy-shell { position: relative; width: min(100% - 36px, 760px); margin: 0 auto; padding: 42px 0 calc(70px + var(--safe-bottom)); color: var(--secondary); font-size: 15px; line-height: 1.75; overflow-wrap: anywhere; }
.privacy-shell h1, .privacy-shell h2 { color: var(--ink); }
.privacy-shell h1 { font-size: clamp(34px, 8vw, 54px); }
.privacy-shell h2 { margin-top: 34px; font-size: 21px; }
.privacy-shell .updated { color: var(--muted); font: 11px/1.6 var(--mono); }
.privacy-shell .back-link { display: inline-flex; align-items: center; min-height: 44px; margin-bottom: 24px; font: 11px var(--mono); text-decoration: none; }
.privacy-shell code, #feedbackForm code { font-family: var(--mono); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}
