/* YouGene · the first surface (CR-0021 P3-08 FS) · one screen at a time, no motion for anyone (AX-5), phone first (AX-1)
 * provenance: derived (tier D) · generator: claude-fable-5-1 builder CR-0021 FS · P3-08 · serves: H-0093 H-0526 H-0531 P-03 P-12 · design-surface v1.1 D-7 AX-1..AX-11 (tokens: the interview's app.css, muted lifted to 4.5:1 per FA-D F-3) */

:root {
  --bg: #ffffff;
  --ink: #17181a;
  --muted: #5c6168;        /* ≥ 4.5:1 on --bg and on --chip in this theme (AX-7; the walk asserts the formula) */
  --line: #858b94;         /* borders ≥ 3:1 on --bg (WCAG 1.4.11) */
  --chip: #f2f3f5;
  --press: #c9d8f7;
  --accent: #1d5fd6;
  --accent-ink: #ffffff;
  --key: #1f2937;
  --key-ink: #ffffff;
  --focus: #1d5fd6;
  --sa-bottom: env(safe-area-inset-bottom, 0px);
  --ask-h: 64px;
  --col: 560px;
  --fs: 106.25%;           /* 17 px at the default size; scales with the system setting (AX-6) */
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1114; --ink: #eceef1; --muted: #9aa1aa; --line: #6d7580; --chip: #1b1f25; --press: #2a3a5c;
    --accent: #6ea0ff; --accent-ink: #0f1114; --key: #e6e8eb; --key-ink: #0f1114; --focus: #6ea0ff;
  }
}
:root[data-theme="dark"] {
  --bg: #0f1114; --ink: #eceef1; --muted: #9aa1aa; --line: #6d7580; --chip: #1b1f25; --press: #2a3a5c;
  --accent: #6ea0ff; --accent-ink: #0f1114; --key: #e6e8eb; --key-ink: #0f1114; --focus: #6ea0ff;
}

* { box-sizing: border-box; }
html { font-size: var(--fs); -webkit-text-size-adjust: 100%; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--bg); color: var(--ink);
  font: 400 1rem/1.4 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;              /* AX-1: no horizontal scroll */
}
body.has-ask { padding-bottom: calc(var(--ask-h) + 16px + var(--sa-bottom)); }

/* nothing moves, for anyone, under any setting (AX-5) */
*, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }

button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
[hidden] { display: none !important; }

/* ---------- the header slot: one muted line and the glyphs (AX-1) ---------- */
.hdr { width: 100%; max-width: var(--col); margin: 0 auto; display: flex; align-items: center; gap: 4px; padding: 6px 8px 0 16px; min-height: 48px; }
.hdr-line { flex: 1 1 auto; min-width: 0; margin: 0; padding: 4px 0; color: var(--muted); font-size: 0.9rem; line-height: 1.3; overflow-wrap: anywhere; }
.glyph { flex: 0 0 auto; min-width: 48px; min-height: 48px; border: 0; border-radius: 12px; background: none; color: var(--muted); display: inline-flex; align-items: center; justify-content: center; padding: 0; }
.glyph.txt { padding: 0 12px; color: var(--accent); font-weight: 600; }
.glyph:active { background: var(--chip); color: var(--ink); }

/* ---------- the column ---------- */
.main { width: 100%; max-width: var(--col); margin: 0 auto; padding: 0 16px 16px; }

/* ---------- S-1 sign in ---------- */
.signin { display: flex; flex-direction: column; gap: 16px; padding-top: 22vh; }
.signin h1 { margin: 0 0 8px; font-size: 2rem; font-weight: 600; letter-spacing: -0.01em; }
.btn { min-height: 48px; padding: 10px 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--chip); color: var(--ink); font-weight: 600; text-align: left; overflow-wrap: anywhere; }
.btn:active { background: var(--press); }
.btn.primary { min-height: 56px; border: 0; background: var(--accent); color: var(--accent-ink); font-size: 1.1rem; text-align: center; }
.btn.quiet { background: none; border: 0; color: var(--muted); font-weight: 400; text-decoration: underline; text-underline-offset: 3px; min-height: 44px; padding: 8px 4px; align-self: flex-start; }
.hint, .status-line { margin: 0; color: var(--muted); font-size: 0.95rem; min-height: 1.4em; overflow-wrap: anywhere; }
.plain { margin: 0; font-size: 1.1rem; line-height: 1.4; overflow-wrap: anywhere; }

/* ---------- S-2 my day ---------- */
.sec { margin: 0; }
.sec h2 { margin: 18px 0 6px; font-size: 0.8rem; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); }
.lines { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.line {
  width: 100%; min-height: 48px; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--chip); color: var(--ink);
  text-align: left; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px;
  overflow-wrap: anywhere;                 /* nothing truncates (AX-6) */
}
.line:active { background: var(--press); }
.line .t { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 0.95rem; }
/* tree order = "{sender}, {subject}, {time}" (AX-3); the grid places the time top-right without reordering the tree */
.line.event { display: grid; grid-template-columns: 4.6rem 1fr; grid-template-areas: "t ttl"; }
.line.mail { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "who t" "ttl ttl" "wait wait"; }
.line.mail .who { grid-area: who; font-weight: 600; }
.line .t { grid-area: t; }
.line .ttl { grid-area: ttl; }
.line .wait { grid-area: wait; color: var(--muted); font-size: 0.9rem; }
.more { width: 100%; min-height: 48px; padding: 8px 12px; margin-top: 6px; border: 0; border-radius: 12px; background: none; color: var(--accent); text-align: left; font-weight: 600; }
.foot { margin: 16px 0 0; color: var(--muted); font-size: 0.9rem; overflow-wrap: anywhere; }
.empty { margin: 28px 0 0; font-size: 1.1rem; line-height: 1.4; }

/* ---------- the ask field and the mic (AX-1: pinned at the foot) ---------- */
.ask {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  width: 100%; max-width: var(--col); margin: 0 auto;
  display: flex; gap: 8px; padding: 8px 16px calc(8px + var(--sa-bottom));
  background: var(--bg); border-top: 1px solid var(--line);
}
.ask-field { flex: 1 1 auto; min-width: 0; min-height: 48px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); color: var(--ink); }
.ask-field::placeholder { color: var(--muted); opacity: 1; }
.ask-field:focus-visible { outline-offset: 0; border-color: var(--focus); }
.mic { flex: 0 0 auto; width: 48px; height: 48px; border: 1px solid var(--line); border-radius: 12px; background: var(--chip); color: var(--ink); display: grid; place-items: center; padding: 0; }
.mic[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.mic:active { background: var(--press); }

/* ---------- S-3 an item · S-4 the answer · S-8 settings ---------- */
.bar { display: flex; align-items: center; gap: 4px; margin: 0 0 4px -12px; }
.bar .glyph { color: var(--accent); }
.bar .glyph.txt { padding: 0 12px 0 8px; }
.item h1, .card h1, .settings h1 { margin: 8px 0 12px; font-size: 1.35rem; font-weight: 600; line-height: 1.25; letter-spacing: -0.01em; overflow-wrap: anywhere; }
.kv { display: grid; grid-template-columns: 4.6rem 1fr; gap: 6px 12px; margin: 0; }
.kv dt { margin: 0; color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.kv .t { color: var(--muted); font-variant-numeric: tabular-nums; }
.who span + span::before { content: " · "; color: var(--muted); }
.text { margin: 16px 0 0; }
.seg { margin: 0 0 12px; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.45; }
.seg.meta { font-weight: 600; }
.seg.attach, .stripped { color: var(--muted); }
.stripped { font-style: italic; }
.fold { margin: 12px 0; border: 1px solid var(--line); border-radius: 12px; padding: 0 12px; }
.fold summary { min-height: 48px; display: flex; align-items: center; color: var(--muted); cursor: pointer; list-style: none; }
.fold summary::-webkit-details-marker { display: none; }
.fold[open] summary { border-bottom: 1px solid var(--line); margin-bottom: 8px; }
.note { margin: 12px 0 0; color: var(--muted); font-size: 0.95rem; }
.src { margin: 20px 0 0; color: var(--muted); font-size: 0.9rem; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 20px 0 0; padding: 0; list-style: none; }
.chip { display: inline-flex; align-items: center; gap: 10px; min-height: 48px; padding: 8px 14px 8px 8px; border: 1px solid var(--line); border-radius: 12px; background: var(--chip); color: var(--ink); text-align: left; overflow-wrap: anywhere; }
.chip:active { background: var(--press); }
.chip[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.chip[aria-pressed="true"] .kc { background: var(--accent-ink); color: var(--accent); }
.kc { flex: 0 0 auto; width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: var(--key); color: var(--key-ink); font-weight: 600; font-variant-numeric: tabular-nums; font-size: 0.95rem; }
.undo { min-height: 48px; padding: 8px 14px; border: 1px solid var(--line); border-radius: 12px; background: none; color: var(--accent); font-weight: 600; }

.card .q { margin: 0 0 4px; color: var(--muted); font-size: 0.95rem; overflow-wrap: anywhere; }
.card .model { margin: 0 0 8px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.card .dunno { margin: 8px 0 0; font-size: 1.1rem; line-height: 1.4; }

.settings .row { margin: 20px 0 0; }
.settings .row > label, .settings .row > .lbl { display: block; margin: 0 0 6px; color: var(--muted); font-size: 0.95rem; }
.settings h2 { margin: 24px 0 6px; font-size: 0.8rem; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); }
.devices { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.device { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 6px 0 6px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--chip); flex-wrap: wrap; }
.device .name { font-weight: 600; }
.device .meta, .device .tag { color: var(--muted); font-size: 0.9rem; }
.device .btn { margin-left: auto; background: none; border: 0; color: var(--accent); min-height: 48px; }
.time { min-height: 48px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); color: var(--ink); font-variant-numeric: tabular-nums; }
.switch { display: inline-flex; align-items: center; gap: 10px; min-height: 48px; padding: 8px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--chip); color: var(--ink); font-weight: 600; }
.switch[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.wide { width: 100%; text-align: center; }

/* ---------- S-6 nothing ever loaded ---------- */
.full { min-height: 60vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 20px; text-align: center; padding: 24px 0; }
.full p { margin: 0; font-size: 1.15rem; line-height: 1.4; }

@media (hover: hover) and (pointer: fine) {
  .line:hover, .chip:hover, .btn:hover { background: var(--press); }
  .btn.primary:hover, .chip[aria-pressed="true"]:hover { background: var(--accent); }
}
