/* Praxis — the QQ signature chassis (Doctrine interface grammar, re-plugged for Praxis).
   Source of truth: /opt/qualequest/doctrine/mobile.html + KG#890 Gold Standard.
   Same chassis at every size: topbar + views + bottom tab nav. No sidebars, no SaaS chrome.
   Provider-neutral: no provider/model names anywhere user-facing.
   Documented deviations from Doctrine: --text-3 lightened #6B7280 -> #7D8694 (WCAG AA 4.5:1
   for sub-16px mono labels); Deep depth state uses green (the reference badge-slot accent),
   keeping gold scarce next to SEND. */

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; -webkit-touch-callout: none; }

:root {
  --bg: #0A0A0A;
  --bg-card: #111318;
  --bg-surface: #151922;
  --bg-hover: #1E2438;
  --gold: #C9A227;
  --gold-light: #E5C158;
  --gold-dim: rgba(201, 162, 39, .10);
  --gold-glow: rgba(201, 162, 39, .18);
  --cyan: #00D9FF;
  --text: #FFFFFF;
  --text-2: #B0B0B0;
  --text-3: #7D8694; /* AA-adjusted from Doctrine #6B7280 — see header note */
  --border: #1F2937;
  --border-2: rgba(255, 255, 255, .06);
  --red: #E74C3C;
  --green: #27AE60;
  --amber: #F39C12;
  --mono: 'IBM Plex Mono', 'Courier New', monospace;
  --serif: 'Cormorant Garamond', Georgia, serif;
  --body: 'Source Serif 4', Georgia, serif;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --col: 720px; /* content column on wide screens; chassis itself is full-bleed */
}

html { overscroll-behavior: none; }
html, body { height: 100%; }
body {
  background: var(--bg); color: var(--text);
  font-family: var(--mono); font-size: 14px; line-height: 1.5;
  -webkit-font-smoothing: antialiased; overscroll-behavior: none;
}
body.app-mode { overflow: hidden; }

/* Grain overlay — all pages (KG#890 mandatory) */
body::after {
  content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 9999; opacity: .025;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-repeat: repeat; background-size: 256px 256px;
}

a { color: var(--gold); text-decoration: none; }
a:hover { color: var(--gold-light); }
:focus-visible { outline: 1px solid var(--gold); outline-offset: 2px; }
::selection { background: var(--gold-dim); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
[hidden] { display: none !important; }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 1000;
  background: var(--bg-card); border: 1px solid var(--gold); color: var(--gold);
  font-family: var(--mono); font-size: .65rem; letter-spacing: .1em; text-transform: uppercase; padding: 12px 16px;
}
.skip-link:focus { left: 16px; top: calc(8px + var(--safe-top)); }

/* ================= GATE (landing / auth / onboarding — the Doctrine auth-gate grammar) ================= */
.gate { position: fixed; inset: 0; z-index: 500; display: flex; align-items: flex-start; justify-content: center; background: var(--bg); padding: 24px; padding-top: calc(24px + var(--safe-top)); overflow-y: auto; }
.gate::before { content: ''; position: fixed; top: 40%; left: 50%; transform: translate(-50%, -50%); width: 400px; height: 400px; background: radial-gradient(circle, rgba(201,162,39,.08) 0%, transparent 70%); pointer-events: none; }
.gate-box { width: 100%; max-width: 320px; text-align: center; position: relative; z-index: 2; margin: auto; }
.gate-logo { font-family: var(--serif); font-size: 42px; font-weight: 300; color: var(--gold); letter-spacing: .02em; margin-bottom: 2px; }
.gate-sub { font-size: .6rem; color: var(--text-3); letter-spacing: .25em; text-transform: uppercase; margin-bottom: 10px; }
#gate-auth .gate-sub, #gate-onboarding .gate-sub { margin-bottom: 32px; }
.gate-lede { font-family: var(--body); font-weight: 300; font-size: 15px; line-height: 1.65; color: var(--text-2); margin: 14px 0 30px; }
.gate-stack { display: flex; flex-direction: column; gap: 10px; }
.gate-links { margin-top: 34px; font-size: .58rem; letter-spacing: .18em; text-transform: uppercase; color: var(--text-3); }
.gate-links a, .gate-note a { color: var(--text-3); display: inline-block; padding: 14px 8px; margin: -14px -2px; }
.gate-links a:hover, .gate-note a:hover { color: var(--gold); }
.gate-err { color: var(--red); font-size: 11px; margin-top: 10px; min-height: 16px; }
.gate-note { font-size: .58rem; letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); margin-top: 16px; }
.gate-back { background: none; border: none; color: var(--text-3); font-family: var(--mono); font-size: .6rem; letter-spacing: .12em; text-transform: uppercase; cursor: pointer; margin-top: 14px; padding: 14px 12px; }
.gate-back:hover { color: var(--gold); }

/* fields (exact auth-field grammar) */
.field-row { text-align: left; margin-bottom: 12px; }
.field-label { display: block; font-size: .6rem; color: var(--text-3); letter-spacing: .08em; text-transform: uppercase; margin-bottom: 4px; }
.afield {
  width: 100%; background: transparent; border: 1px solid var(--border); padding: 14px 16px;
  color: var(--text); font-size: 14px; font-family: var(--mono); outline: none;
  transition: border-color .3s; border-radius: 0; -webkit-appearance: none; min-height: 48px;
}
.afield:focus { border-color: var(--gold); }
.afield::placeholder { color: #8A93A1; }
.afield[aria-invalid="true"] { border-color: var(--red); }
.checkrow { display: flex; align-items: flex-start; gap: 10px; text-align: left; margin: 4px 0 16px; }
.checkrow input {
  -webkit-appearance: none; appearance: none; width: 18px; height: 18px;
  border: 1px solid var(--border); background: transparent; border-radius: 0;
  flex: none; margin-top: 2px; cursor: pointer; display: grid; place-content: center;
}
.checkrow input:checked { border-color: var(--gold); }
.checkrow input:checked::before { content: ''; width: 10px; height: 10px; background: var(--gold); }
.checkrow input:focus-visible { outline: 1px solid var(--gold); outline-offset: 2px; }
.checkrow label { font-family: var(--body); font-weight: 300; font-size: 13px; line-height: 1.5; color: var(--text-2); }

/* buttons (exact d-submit / sheet-btn grammar) */
.gbtn {
  width: 100%; background: linear-gradient(135deg, var(--gold), var(--gold-light)); border: none;
  padding: 16px; color: #0A0A0A; font-size: .7rem; font-weight: 600; cursor: pointer;
  letter-spacing: .15em; text-transform: uppercase; font-family: var(--mono);
  min-height: 48px; border-radius: 0; -webkit-appearance: none;
}
.gbtn:disabled { opacity: .4; pointer-events: none; }
.gbtn-ghost { background: none; border: 1px solid var(--border); color: var(--text-2); }
.gbtn-ghost:hover, .gbtn-ghost:active { border-color: var(--gold); color: var(--gold); }
.gbtn-danger { background: none; border: 1px solid rgba(231,76,60,.5); color: var(--red); }
.gbtn-danger:hover, .gbtn-danger:active { border-color: var(--red); background: rgba(231,76,60,.08); }

/* onboarding rows */
.ob-list { text-align: left; margin: 6px 0 26px; }
.ob-item { padding: 13px 0; border-bottom: 1px solid var(--border-2); }
.ob-item:last-child { border-bottom: none; }
.ob-k { font-size: .58rem; color: var(--gold); letter-spacing: .14em; text-transform: uppercase; margin-bottom: 3px; }
.ob-v { font-family: var(--body); font-weight: 300; font-size: 14px; color: var(--text-2); line-height: 1.55; }

/* ================= APP SHELL ================= */
#app { display: none; height: 100%; flex-direction: column; }
#app.on { display: flex; }

/* Topbar (exact) */
.topbar {
  padding: 8px 16px; padding-top: calc(8px + var(--safe-top));
  background: var(--bg); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px; flex-shrink: 0;
  min-height: calc(48px + var(--safe-top));
}
.topbar-inner { display: flex; align-items: center; gap: 10px; width: 100%; max-width: var(--col); margin: 0 auto; }
.topbar-brand { font-family: var(--serif); font-size: 22px; font-weight: 300; color: var(--gold); letter-spacing: .02em; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; background: var(--green); box-shadow: 0 0 6px rgba(39,174,96,.5); }
.live-dot.err { background: transparent; border: 2px solid var(--red); box-shadow: 0 0 6px rgba(231,76,60,.4); }
.topbar-time { font-size: .6rem; color: var(--text-3); }

/* Content + views (exact) */
.content { flex: 1; overflow: hidden; position: relative; }
.view { position: absolute; inset: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; display: none; padding: 16px; padding-bottom: calc(16px + 56px + var(--safe-bottom)); }
.view.active { display: block; }
.view-inner { max-width: var(--col); margin: 0 auto; }
.view::-webkit-scrollbar { width: 2px; }
.view::-webkit-scrollbar-thumb { background: var(--border); }
.view { scrollbar-width: thin; scrollbar-color: var(--border) transparent; }

/* Bottom nav (exact) */
.bottom-nav { position: fixed; bottom: 0; left: 0; right: 0; background: var(--bg-card); border-top: 1px solid var(--border); display: flex; padding-bottom: var(--safe-bottom); z-index: 100; }
.bottom-nav-inner { display: flex; width: 100%; max-width: var(--col); margin: 0 auto; }
.nav-btn {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 10px 4px 8px; background: none; border: none; color: var(--text-3);
  font-family: var(--mono); font-size: .55rem; letter-spacing: .06em; text-transform: uppercase;
  cursor: pointer; transition: color .2s; min-height: 48px;
}
.nav-btn.active { color: var(--gold); }
.nav-btn:hover { color: var(--text-2); }
.nav-btn.active:hover { color: var(--gold); }
.nav-icon { font-size: 18px; line-height: 1; }
#nav-new .nav-icon { font-weight: 600; font-size: 20px; }

/* Section heads (exact) */
.section-head { font-size: .65rem; color: var(--gold); letter-spacing: .12em; text-transform: uppercase; font-weight: 600; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.section-count { color: var(--text-3); font-weight: 400; }

/* ================= THREADS (board grammar) ================= */
.ptr-indicator { text-align: center; padding: 8px; font-size: .6rem; color: var(--text-3); display: none; }
.board-group { margin-bottom: 20px; }
.board-group-label { font-size: .6rem; color: var(--text-3); letter-spacing: .08em; text-transform: uppercase; margin-bottom: 8px; display: flex; align-items: center; gap: 6px; }
.group-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.dot-today { background: var(--gold); box-shadow: 0 0 6px rgba(201,162,39,.5); }
.dot-week { background: var(--cyan); box-shadow: 0 0 6px rgba(0,217,255,.35); }
.dot-old { background: #6B7280; }

.thread-card {
  display: block; width: 100%; text-align: left; font: inherit; color: inherit;
  background: var(--bg-surface); border: 1px solid var(--border-2);
  padding: 12px 14px; margin-bottom: 8px; min-height: 48px; cursor: pointer;
  transition: border-color .15s; border-radius: 0; -webkit-appearance: none;
}
.thread-card:hover { border-color: var(--border); background: var(--bg-hover); }
.thread-card:active { border-color: var(--gold); background: var(--bg-hover); }
.thread-card.current { border-color: rgba(201,162,39,.35); }
.th-time { font-size: .6rem; color: var(--text-3); letter-spacing: .04em; display: block; }
.th-title { font-family: var(--body); font-weight: 300; font-size: 14px; color: var(--text); margin-top: 3px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ================= CHAT (exact grammar; bars full-bleed, content column-constrained) ================= */
#view-chat { display: none; padding: 0; flex-direction: column; }
#view-chat.active { display: flex; }

.chat-bar { padding: 10px 16px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.chat-bar-inner { display: flex; align-items: center; gap: 8px; width: 100%; max-width: var(--col); margin: 0 auto; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.chat-bar-inner::-webkit-scrollbar { display: none; }
.c-new, .c-depth { position: relative; }
.c-new::after, .c-depth::after { content: ''; position: absolute; inset: -7px 0; }
.c-new { background: none; border: 1px solid var(--border); color: var(--text-2); padding: 6px 12px; font-family: var(--mono); font-size: .6rem; cursor: pointer; white-space: nowrap; min-height: 32px; flex-shrink: 0; border-radius: 0; -webkit-appearance: none; }
.c-new:hover, .c-new:active { border-color: var(--gold); color: var(--gold); }
.c-title { flex: 1; min-width: 60px; background: var(--bg-surface); border: 1px solid var(--border); padding: 6px 10px; min-height: 32px; display: flex; align-items: center; justify-content: center; font-size: .6rem; color: var(--text-2); letter-spacing: .04em; text-transform: uppercase; overflow: hidden; }
.c-title span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.c-depth { background: none; border: 1px solid var(--border); color: var(--text-3); padding: 6px 10px; font-family: var(--mono); font-size: .55rem; cursor: pointer; letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; min-height: 32px; flex-shrink: 0; border-radius: 0; -webkit-appearance: none; }
.c-depth.deep { border-color: var(--green); color: var(--green); }

.chat-msgs { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; padding: 12px 16px; }
.chat-msgs-inner { display: flex; flex-direction: column; gap: 10px; width: 100%; max-width: var(--col); margin: 0 auto; }
.chat-msgs::-webkit-scrollbar { width: 2px; }
.chat-msgs::-webkit-scrollbar-thumb { background: var(--border); }
.chat-msgs { scrollbar-width: thin; scrollbar-color: var(--border) transparent; }

.chat-bubble { max-width: 88%; padding: 10px 14px; font-size: 13px; line-height: 1.6; word-break: break-word; -webkit-touch-callout: default; }
.chat-bubble.user { align-self: flex-end; background: var(--gold-dim); border: 1px solid rgba(201,162,39,.2); color: var(--text); white-space: pre-wrap; }
.chat-bubble.assistant { align-self: flex-start; background: var(--bg-surface); border: 1px solid var(--border-2); color: var(--text-2); font-family: var(--body); font-weight: 300; font-size: 14px; }
.chat-bubble.assistant p { margin: 0 0 .7em; } .chat-bubble.assistant p:last-child { margin-bottom: 0; }
.chat-bubble.assistant pre { background: var(--bg); border: 1px solid var(--border); padding: 10px; overflow-x: auto; margin: .5em 0; font-family: var(--mono); font-size: 12px; }
.chat-bubble.assistant code { font-family: var(--mono); font-size: .9em; background: var(--bg); padding: 1px 5px; }
.chat-bubble.assistant pre code { background: none; padding: 0; }
.chat-bubble.error { align-self: center; background: rgba(231,76,60,.1); border: 1px solid rgba(231,76,60,.3); color: var(--red); font-size: 12px; white-space: pre-wrap; }
.streaming-cursor::after { content: '|'; animation: blink .8s infinite; color: var(--gold); }
@keyframes blink { 0%,100% { opacity: 1; } 50% { opacity: 0; } }

.chat-empty { margin-top: 60px; text-align: center; color: var(--text-3); font-size: 12px; line-height: 1.8; }
.chat-empty .ce-serif { font-family: var(--serif); font-size: 26px; font-weight: 300; color: var(--text-2); display: block; margin-bottom: 4px; }

.chat-compose { padding: 10px 16px; padding-bottom: calc(10px + 56px + var(--safe-bottom)); border-top: 1px solid var(--border); flex-shrink: 0; }
.chat-compose-inner { display: flex; gap: 8px; align-items: flex-end; width: 100%; max-width: var(--col); margin: 0 auto; }
.chat-input { flex: 1; background: var(--bg-surface); border: 1px solid var(--border); padding: 12px 14px; color: var(--text); font-size: 14px; font-family: var(--mono); outline: none; resize: none; min-height: 48px; max-height: 120px; line-height: 1.5; border-radius: 0; -webkit-appearance: none; }
.chat-input:focus { border-color: var(--gold); }
.chat-input::placeholder { color: #8A93A1; }
.chat-send { background: linear-gradient(135deg, var(--gold), var(--gold-light)); border: none; padding: 12px 18px; color: #0A0A0A; font-size: .7rem; font-weight: 600; cursor: pointer; letter-spacing: .08em; text-transform: uppercase; font-family: var(--mono); min-height: 48px; flex-shrink: 0; border-radius: 0; -webkit-appearance: none; }
.chat-send:disabled { opacity: .4; pointer-events: none; }
.chat-stop { background: var(--red); border: none; padding: 12px 18px; color: #fff; font-size: .7rem; font-weight: 600; cursor: pointer; letter-spacing: .08em; text-transform: uppercase; font-family: var(--mono); min-height: 48px; flex-shrink: 0; border-radius: 0; -webkit-appearance: none; }

/* ================= ACCOUNT (status grammar) ================= */
.status-section { margin-bottom: 22px; }
.metric-row { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--border-2); }
.metric-row:last-child { border-bottom: none; }
.metric-label { color: var(--text-3); font-size: .65rem; }
.metric-val { color: var(--text); font-weight: 600; font-size: .65rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 60%; }
.acct-actions { display: flex; flex-direction: column; gap: 8px; }
.acct-actions .gbtn-ghost, .acct-actions .gbtn-danger { width: 100%; padding: 14px 16px; font-size: .65rem; letter-spacing: .08em; min-height: 48px; font-family: var(--mono); text-transform: uppercase; cursor: pointer; border-radius: 0; -webkit-appearance: none; }
.legal-links { display: flex; gap: 10px; padding-top: 4px; }
.legal-links a { font-size: .6rem; letter-spacing: .14em; text-transform: uppercase; color: var(--text-3); display: inline-block; padding: 14px 8px; margin: -10px -2px; }
.legal-links a:hover { color: var(--gold); }

/* ================= BOTTOM SHEET (exact) ================= */
.sheet-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 200; display: none; align-items: flex-end; justify-content: center; }
.sheet-overlay.on { display: flex; }
.sheet { background: var(--bg-card); border-top: 2px solid var(--gold-dim); width: 100%; max-width: var(--col); max-height: 85vh; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; padding: 20px 16px; padding-bottom: calc(20px + var(--safe-bottom)); }
.sheet::-webkit-scrollbar { width: 2px; }
.sheet::-webkit-scrollbar-thumb { background: var(--border); }
.sheet { scrollbar-width: thin; scrollbar-color: var(--border) transparent; }
.sheet-handle { width: 36px; height: 4px; background: var(--border); margin: 0 auto 16px; border-radius: 2px; }
.sheet-title { font-family: var(--serif); font-size: 20px; font-weight: 400; color: var(--text); margin-bottom: 2px; }
.sheet-id { font-size: .6rem; color: var(--text-3); margin-bottom: 14px; letter-spacing: .04em; }
.sheet-section { margin-bottom: 12px; }
.sheet-label { font-size: .55rem; color: var(--gold); letter-spacing: .1em; text-transform: uppercase; margin-bottom: 3px; }
.sheet-body { color: var(--text-2); line-height: 1.5; white-space: pre-wrap; font-family: var(--body); font-weight: 300; font-size: 13px; }
.sheet-actions { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.sheet-btn { flex: 1; min-width: 100px; background: none; border: 1px solid var(--border); color: var(--text-2); padding: 12px 16px; font-family: var(--mono); font-size: .65rem; cursor: pointer; letter-spacing: .06em; text-transform: uppercase; min-height: 48px; border-radius: 0; -webkit-appearance: none; }
.sheet-btn:hover, .sheet-btn:active { border-color: var(--gold); color: var(--gold); }
.sheet-btn.primary { background: linear-gradient(135deg, var(--gold), var(--gold-light)); color: #0A0A0A; border: none; font-weight: 600; }
.sheet-btn.danger { border-color: rgba(231,76,60,.5); color: var(--red); }
.sheet-btn.danger:hover, .sheet-btn.danger:active { border-color: var(--red); color: var(--red); background: rgba(231,76,60,.08); }

/* Empty + spinner (exact) */
.empty { text-align: center; padding: 40px 20px; color: var(--text-3); font-size: 12px; }
.spinner { width: 24px; height: 24px; border: 2px solid var(--border); border-top-color: var(--gold); border-radius: 50%; animation: spin .7s linear infinite; margin: 20px auto; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Toast (chassis-toned; stays in a11y tree — visibility, not [hidden]) */
.toast { position: fixed; bottom: calc(64px + var(--safe-bottom)); left: 50%; transform: translateX(-50%); background: var(--bg-card); border: 1px solid var(--gold-dim); color: var(--text); padding: 12px 18px; z-index: 300; font-family: var(--mono); font-size: .68rem; letter-spacing: .04em; visibility: hidden; opacity: 0; transition: opacity .15s; }
.toast.show { visibility: visible; opacity: 1; }

/* ================= LEGAL PAGES (document mode — same tokens) ================= */
.doc-topbar { padding: 10px 16px; padding-top: calc(10px + var(--safe-top)); background: var(--bg); border-bottom: 1px solid var(--border); display: flex; align-items: center; }
.doc-topbar-inner { display: flex; align-items: center; justify-content: space-between; width: 100%; max-width: 760px; margin: 0 auto; }
.doc-topbar .topbar-brand { font-size: 20px; }
.doc-links a { font-size: .6rem; letter-spacing: .14em; text-transform: uppercase; color: var(--text-3); margin-left: 10px; display: inline-block; padding: 14px 8px; }
.doc-links a:hover { color: var(--gold); }
.legal { max-width: 760px; margin: 0 auto; padding: 48px 20px 80px; font-family: var(--body); font-weight: 300; font-size: 16px; line-height: 1.65; -webkit-touch-callout: default; }
.legal h1 { font-family: var(--serif); font-weight: 300; font-size: 2.6rem; line-height: 1.15; margin-bottom: 8px; }
.legal .kicker { font-family: var(--mono); font-size: .65rem; font-weight: 500; letter-spacing: .2em; text-transform: uppercase; color: var(--gold); display: block; margin-bottom: 14px; }
.legal h2 { font-family: var(--mono); font-size: .75rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); margin-top: 2.6em; margin-bottom: .9em; }
.legal p, .legal li { color: var(--text-2); margin-bottom: 1em; }
.legal strong { color: var(--text); font-weight: 600; }
.legal ul { padding-left: 1.2em; margin-bottom: 1em; }
.legal li { margin-bottom: .4em; }
.legal .status-line { font-family: var(--mono); font-size: .68rem; letter-spacing: .04em; color: var(--text-3); border-left: 2px solid var(--gold); padding-left: 14px; margin-bottom: 8px; }
.legal .pending { font-family: var(--mono); font-size: .72rem; color: var(--amber); border: 1px solid rgba(243,156,18,.4); padding: 1px 8px; letter-spacing: .06em; text-transform: uppercase; }
.legal .draft-banner { background: var(--bg-card); border: 1px solid var(--border); border-left: 2px solid var(--amber); padding: 16px 18px; color: var(--text-2); font-size: .94rem; margin: 24px 0 8px; }
.doc-footer { border-top: 1px solid var(--border); padding: 26px 20px calc(26px + var(--safe-bottom)); }
.doc-footer-inner { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; max-width: 760px; margin: 0 auto; font-family: var(--mono); font-size: .6rem; letter-spacing: .12em; text-transform: uppercase; color: var(--text-3); }
.doc-footer a { color: var(--text-3); margin-left: 8px; display: inline-block; padding: 14px 8px; }
.doc-footer a:hover { color: var(--gold); }

@media (max-width: 360px) {
  .legal h1 { font-size: 2rem; }
}
