:root {
  --bg: #f4f5f2;
  --surface: #ffffff;
  --ink: #1b2129;
  --muted: #56606c;
  --line: #dfe2e6;
  --accent: #24527a;
  --accent-ink: #ffffff;
  --focus: #1a73e8;
  --strong: #a1251b; --strong-bg: #fdecea;
  --moderate: #9a4a00; --moderate-bg: #fff1e0;
  --weak: #6d5a00; --weak-bg: #fbf5d6;
  --context: #2d4f73; --context-bg: #e8f0f8;
  --link-bg: #eceff3;
  --neutral: #4a5560; --neutral-bg: #eef0f2;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(20, 30, 40, .06), 0 2px 8px rgba(20, 30, 40, .04);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #12161b; --surface: #1b2128; --ink: #e8ebee; --muted: #a3adb8; --line: #2e3640;
    --accent: #7fb0dc; --accent-ink: #0d1a26; --focus: #8ab4f8;
    --strong: #ff9b91; --strong-bg: #3a1d1b; --moderate: #ffb86b; --moderate-bg: #3a2914;
    --weak: #e8d26a; --weak-bg: #332e12; --context: #9cc3ea; --context-bg: #1b2b3c;
    --link-bg: #262e37; --neutral: #c3ccd5; --neutral-bg: #262d35;
    --shadow: none;
  }
}
:root[data-theme="dark"] {
  --bg: #12161b; --surface: #1b2128; --ink: #e8ebee; --muted: #a3adb8; --line: #2e3640;
  --accent: #7fb0dc; --accent-ink: #0d1a26; --focus: #8ab4f8;
  --strong: #ff9b91; --strong-bg: #3a1d1b; --moderate: #ffb86b; --moderate-bg: #3a2914;
  --weak: #e8d26a; --weak-bg: #332e12; --context: #9cc3ea; --context-bg: #1b2b3c;
  --link-bg: #262e37; --neutral: #c3ccd5; --neutral-bg: #262d35;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.55 var(--font); }
a { color: var(--accent); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.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; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; z-index: 10; }
.skip:focus { left: 16px; }
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 16px; }

.top { background: var(--surface); border-bottom: 1px solid var(--line); }
.top-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 14px; padding-bottom: 14px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand-name { margin: 0; font-weight: 700; font-size: 20px; letter-spacing: -.01em; }
.brand-tag { margin: 0; color: var(--muted); font-size: 14px; }
.privacy-pill { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; font-size: 14px; color: var(--ink); text-decoration: none; background: var(--bg); }
.privacy-pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }

.layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; padding-top: 24px; padding-bottom: 8px; }
@media (min-width: 1000px) {
  .layout { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); align-items: start; }
  .input-panel { position: sticky; top: 16px; }
}
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.results > * + * , #out > * + * { margin-top: 16px; }
h1 { font-size: 24px; line-height: 1.25; margin: 0 0 8px; letter-spacing: -.01em; }
h2 { font-size: 20px; margin: 0 0 10px; }
h3 { font-size: 17px; margin: 0 0 8px; }
h4 { font-size: 16px; margin: 0; }
.lead { color: var(--muted); margin: 0 0 16px; }
.fine { color: var(--muted); font-size: 14px; }
.hint { color: var(--muted); font-weight: 400; font-size: 13px; }
label { display: block; font-weight: 600; margin: 12px 0 4px; font-size: 15px; }
textarea, input, select { width: 100%; font: inherit; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; }
textarea { resize: vertical; min-height: 64px; }
#msg { min-height: 180px; }
.row2 { display: grid; grid-template-columns: 1fr; gap: 0 12px; }
@media (min-width: 560px) { .row2 { grid-template-columns: 1fr 1fr; } }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; align-items: center; }
.actions select { width: auto; flex: 1 1 220px; min-width: 0; }
button { font: inherit; font-weight: 600; border-radius: 8px; padding: 10px 18px; cursor: pointer; border: 1px solid transparent; min-height: 44px; }
button.primary { background: var(--accent); color: var(--accent-ink); }
button.primary:hover { filter: brightness(1.08); }
button.secondary { background: transparent; color: var(--ink); border-color: var(--line); }
kbd { font: 12px var(--mono); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; padding: 0 4px; }
.error { color: var(--strong); background: var(--strong-bg); border-radius: 8px; padding: 8px 12px; }

.howto .steps { padding-left: 20px; margin: 0 0 12px; }
.howto .steps li { margin-bottom: 8px; }

/* verdict */
.verdict { border-width: 2px; }
.verdict-top { display: flex; gap: 16px; align-items: center; }
.verdict h2 { margin: 0; font-size: 24px; }
.eyebrow { margin: 0; font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.meter { display: flex; gap: 4px; align-items: flex-end; height: 36px; flex: none; }
.meter span { width: 10px; border-radius: 3px; background: var(--line); }
.meter span:nth-child(1) { height: 14px; } .meter span:nth-child(2) { height: 24px; } .meter span:nth-child(3) { height: 36px; }
.lvl0 { border-color: var(--neutral); } .lvl0 h2 { color: var(--neutral); }
.lvl1 { border-color: var(--weak); background: linear-gradient(var(--weak-bg), var(--surface) 70%); } .lvl1 h2 { color: var(--weak); } .lvl1 .meter .on { background: var(--weak); }
.lvl2 { border-color: var(--moderate); background: linear-gradient(var(--moderate-bg), var(--surface) 70%); } .lvl2 h2 { color: var(--moderate); } .lvl2 .meter .on { background: var(--moderate); }
.lvl3 { border-color: var(--strong); background: linear-gradient(var(--strong-bg), var(--surface) 70%); } .lvl3 h2 { color: var(--strong); } .lvl3 .meter .on { background: var(--strong); }
.verdict-detail { margin: 12px 0 6px; font-size: 17px; }
.verdict-meta { margin: 0; color: var(--muted); font-size: 14px; }
.notes { margin: 12px 0 0; padding-left: 20px; }
.notes li { margin-bottom: 6px; }

/* highlighted message */
.msgview { white-space: pre-wrap; overflow-wrap: anywhere; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 14px; font-size: 16px; line-height: 1.8; }
mark { color: inherit; border-radius: 4px; padding: 1px 2px; border-bottom: 2px solid; }
mark sup { font-size: 11px; font-weight: 700; margin-left: 2px; vertical-align: super; line-height: 0; }
.t-strong { --c: var(--strong); --cb: var(--strong-bg); }
.t-moderate { --c: var(--moderate); --cb: var(--moderate-bg); }
.t-weak { --c: var(--weak); --cb: var(--weak-bg); }
.t-context { --c: var(--context); --cb: var(--context-bg); }
.t-info, .t-link { --c: var(--neutral); --cb: var(--link-bg); }
mark.t-strong, mark.t-moderate, mark.t-weak, mark.t-context, mark.t-link { background: var(--cb); border-color: var(--c); }
mark.t-strong { border-bottom-width: 3px; }
mark.t-moderate { border-bottom-style: dashed; }
mark.t-weak, mark.t-context { border-bottom-style: dotted; }
mark.is-link { font-family: var(--mono); font-size: .92em; }
.legend { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 0; }
.chip { display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--cb); color: var(--c); border: 1px solid var(--c); white-space: nowrap; }

/* signs */
.signs { list-style: none; padding: 0; margin: 0; }
.sign { border-left: 4px solid var(--c); padding: 10px 0 10px 14px; }
.sign + .sign { border-top: 1px solid var(--line); }
.sign-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.sign p { margin: 6px 0; }
.num { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--c); color: var(--surface); font-size: 13px; font-weight: 700; flex: none; }
.evidence { margin: 4px 0; padding-left: 18px; font-size: 15px; }
.evidence q { font-style: italic; }
.sources { font-size: 13px; color: var(--muted); }

/* link anatomy */
.linkcard { border: 1px solid var(--line); border-radius: 10px; padding: 14px; margin-top: 12px; background: var(--bg); }
.raw { margin: 0 0 8px; overflow-wrap: anywhere; }
.raw .k { color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: .05em; }
code { font-family: var(--mono); font-size: .92em; overflow-wrap: anywhere; }
dl { margin: 0; }
.dlrow { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 8px; padding: 4px 0; border-top: 1px dashed var(--line); }
dt { color: var(--muted); font-size: 14px; }
dd { margin: 0; overflow-wrap: anywhere; }
.reg { font-size: 18px; font-family: var(--mono); }
.puny { color: var(--muted); font-size: 13px; }
mark.odd { padding: 0 1px; border-bottom-width: 3px; }
#verdict-h:focus { outline: none; }
.params { margin: 0; padding-left: 18px; }
.params .flag { color: var(--moderate); font-weight: 600; }
.flags { list-style: none; padding: 0; margin: 10px 0 0; }
.flags li { margin: 6px 0; }
.notopen { margin: 10px 0 0; }

/* next steps */
.nextlist { padding-left: 22px; margin: 0; }
.nextlist > li { margin-bottom: 12px; }
.nextlist p { margin: 4px 0; }
.report { margin: 4px 0; padding-left: 18px; }
details.already { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 10px; }
details.already summary { font-weight: 700; cursor: pointer; padding: 6px 0; }
details.already li { margin-bottom: 6px; }
.muted { background: var(--bg); }
.muted ul { margin: 0; padding-left: 20px; }

.info { display: grid; gap: 16px; padding-top: 24px; padding-bottom: 8px; }
@media (min-width: 1000px) { .info { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.info ul { padding-left: 20px; margin: 0; }
.info li { margin-bottom: 8px; }
.foot { color: var(--muted); font-size: 14px; padding-top: 8px; padding-bottom: 32px; }

/* used only by the recorded demo walkthrough; hidden otherwise */
#demo-caption { display: none; position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); width: min(1000px, calc(100% - 48px)); background: rgba(14, 22, 32, .94); color: #fff; font-size: 22px; line-height: 1.4; padding: 14px 22px; border-radius: 12px; z-index: 50; text-align: center; box-shadow: 0 6px 24px rgba(0, 0, 0, .3); }
#demo-caption.on { display: block; }

@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; } }
@media print { .input-panel, .info, .top .privacy-pill { display: none; } }
