[hidden] { display: none !important; }
:root {
  --bg: #f6f5f2; --fg: #16181d; --muted: #555b66; --card: #ffffff; --line: #e1dfd9; --soft: #eeece7;
  --accent: #1f55e6; --accent-fg: #ffffff; --ok: #126b34; --bad: #b42318; --warn: #7a4f00;
  --warn-bg: #fff6e0; --bad-bg: #fdecea; --radius: 14px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0f1115; --fg: #eceef2; --muted: #a2a9b4; --card: #181b22; --line: #2a2f39; --soft: #20242d;
    --accent: #7b9dff; --accent-fg: #0b0d12; --ok: #4cc27a; --bad: #ff8a7d; --warn: #e8bd55;
    --warn-bg: #2a2412; --bad-bg: #2c1714; }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--fg);
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif; -webkit-text-size-adjust: 100%; }
a { color: var(--accent); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
code, pre, .fp { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.fp { font-size: 12px; color: var(--muted); word-break: break-all; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--card); padding: 8px 12px; border-radius: 8px; z-index: 10; }
.skip:focus { left: 8px; }

/* ---------- buttons, inputs ---------- */
button, .btn { font: inherit; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--line); background: var(--card); color: var(--fg); text-decoration: none;
  border-radius: 12px; padding: 10px 16px; min-height: 44px; cursor: pointer; }
button.primary, .btn.primary { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); font-weight: 600; }
button.deny { color: var(--bad); }
button.big, .btn.big { min-height: 56px; font-size: 18px; width: 100%; font-weight: 600; }
button:disabled { opacity: .5; cursor: default; }
label { display: block; margin: 12px 0; color: var(--muted); font-size: 14px; }
input:not([type=checkbox]):not([type=radio]) { display: block; width: 100%; margin-top: 4px; font: inherit; padding: 10px 12px; min-height: 44px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: var(--fg); }
label.check, label.radio { display: flex; gap: 10px; align-items: center; color: var(--fg); font-size: 16px; min-height: 44px; }
label.check input, label.radio input { width: 22px; height: 22px; accent-color: var(--accent); }
.row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.row > button, .row > label { flex: 1; }
.answers > button { min-height: 56px; font-size: 18px; }

/* ---------- app shell ---------- */
body.app { padding: env(safe-area-inset-top) 16px calc(env(safe-area-inset-bottom) + 88px); max-width: 680px; margin: 0 auto; }
.top { position: sticky; top: 0; background: var(--bg); padding: 12px 0 8px; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.top h1 { font-size: 20px; margin: 0; display: flex; align-items: center; gap: 8px; }
.pill { font-size: 13px; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px; }
h2 { font-size: 22px; margin: 16px 0 8px; }
h3 { font-size: 17px; margin: 4px 0 8px; }
main:focus { outline: none; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin: 12px 0; }
details.card > summary { cursor: pointer; min-height: 32px; font-weight: 600; }
.banner { border-radius: var(--radius); padding: 12px 14px; margin: 10px 0; background: var(--card); border: 1px solid var(--line); }
.banner.warn { background: var(--warn-bg); border-color: var(--warn); }
.banner.bad { background: var(--bad-bg); border-color: var(--bad); }
.banner p { margin: 0 0 8px; }
.msg { min-height: 1.4em; color: var(--muted); }
.msg.err { color: var(--bad); }
.empty { color: var(--muted); text-align: center; padding: 32px 8px; }

.list { list-style: none; padding: 0; margin: 8px 0; }
.list > li { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; margin: 10px 0; }
.list.plain > li { background: transparent; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; padding: 10px 0; margin: 0; }
.list > li.is-focus { border-color: var(--accent); }
.list > li.pending { border-width: 2px; border-color: var(--accent); }
.list > li.pending.risky { border-color: var(--bad); }
.pending .kind { margin: 6px 0 2px; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.risky .kind { color: var(--bad); font-weight: 600; }
.pending .question { font-size: 18px; margin: 4px 0 8px; white-space: pre-wrap; word-break: break-word; }
.meta { color: var(--muted); font-size: 13px; display: flex; flex-wrap: wrap; gap: 4px 10px; }
.agent { font-weight: 600; color: var(--fg); }
.title { font-weight: 600; margin-top: 4px; }
.body { white-space: pre-wrap; word-break: break-word; margin: 6px 0; }
.status { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.status.answered, .status.approved, .status.delivered, .status.opened { color: var(--ok); }
.status.expired, .status.cancelled, .status.denied { color: var(--bad); }
.status.pending, .status.held { color: var(--warn); }

.tabs { display: flex; gap: 6px; overflow-x: auto; margin: 8px 0; }
.seg { flex: 0 0 auto; min-height: 40px; padding: 6px 12px; font-size: 15px; }
.seg.is-active { border-color: var(--accent); color: var(--accent); font-weight: 600; }
.snippet { background: var(--soft); border: 1px solid var(--line); border-radius: 10px; padding: 12px; overflow-x: auto; font-size: 13px; line-height: 1.45; white-space: pre-wrap; word-break: break-all; }

.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 3; display: flex; justify-content: center;
  background: var(--card); border-top: 1px solid var(--line); padding: 4px 8px calc(env(safe-area-inset-bottom) + 4px); }
.tabbar .tab { flex: 1; max-width: 170px; flex-direction: column; gap: 0; border: 0; background: transparent; color: var(--muted);
  font-size: 12px; min-height: 56px; position: relative; border-radius: 10px; }
.tabbar .tab .ico { font-size: 18px; line-height: 1.2; }
.tabbar .tab.is-active { color: var(--accent); font-weight: 600; }
.badge { position: absolute; top: 4px; left: 55%; background: var(--bad); color: #fff; font-size: 11px; font-weight: 700;
  border-radius: 999px; min-width: 18px; height: 18px; display: inline-flex; align-items: center; justify-content: center; padding: 0 5px; }

/* ---------- landing ---------- */
body.landing { max-width: 760px; margin: 0 auto; padding: env(safe-area-inset-top) 16px 32px; }
.lp-top { display: flex; align-items: center; justify-content: space-between; padding: 14px 0; }
.brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 18px; color: var(--fg); text-decoration: none; }
.hero h1 { font-size: clamp(30px, 7vw, 44px); line-height: 1.12; margin: 28px 0 12px; letter-spacing: -.01em; }
.lede { font-size: 19px; color: var(--fg); max-width: 36em; }
.cta { margin: 20px 0 8px; }
.cta .btn.big { width: auto; padding: 0 28px; }
.steps ol { padding-left: 1.2em; }
.steps li, .facts li { margin: 10px 0; }
.facts ul { padding-left: 1.2em; }
.landing section { margin: 36px 0; }
.landing h2 { font-size: 24px; }
.lp-foot { border-top: 1px solid var(--line); padding-top: 16px; color: var(--muted); font-size: 14px; }

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