:root {
  /* Deep-violet night theme. */
  --bg: #0d0a20; --bg2: #161038; --panel: #201a48; --panel2: #191340; --ink: #f2effc; --muted: #9a93c6; --faint: #6a6399;
  --line: #302a60; --accent: #7b5cff; --accent2: #9d7bff; --accent-ink: #ffffff;
  --bot: #e0687a; --sus: #ffb84d; --low: #9a93c6; --ok: #7bc47f;
  --chip: rgba(255,255,255,0.06); --shadow: 0 8px 28px rgba(0,0,0,.35);
  color-scheme: dark;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: radial-gradient(1200px 600px at 10% -10%, #2a1d6e 0%, transparent 60%), linear-gradient(180deg, var(--bg2), var(--bg)); background-attachment: fixed; color: var(--ink); font: 15px/1.5 -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, system-ui, sans-serif; }
header.top { display: flex; align-items: center; gap: 16px; padding: 12px 20px; background: linear-gradient(180deg, #1b1445, #100b2c); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; flex-wrap: wrap; }
header.top h1 { font-size: 17px; margin: 0; font-weight: 650; }
header.top .spacer { flex: 1; }
main { max-width: 1180px; margin: 0 auto; padding: 20px 16px 60px; }
nav.tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 16px; }
nav.tabs button { background: transparent; border: 1px solid transparent; color: var(--muted); padding: 6px 12px; border-radius: 8px; cursor: pointer; font: inherit; }
nav.tabs button.on { background: rgba(123,92,255,0.18); border-color: transparent; color: #fff; font-weight: 600; box-shadow: inset 0 -2px 0 var(--accent); }
.panel { background: linear-gradient(160deg, var(--panel), var(--panel2)); border: 1px solid var(--line); border-radius: 16px; padding: 18px; box-shadow: var(--shadow); margin-bottom: 16px; }
.panel h2 { font-size: 16px; margin: 0 0 12px; }
.panel h3 { font-size: 14px; margin: 14px 0 8px; }
.grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.card { border: 1px solid var(--line); border-radius: 10px; padding: 12px; background: var(--panel); }
.card .big { font-size: 26px; font-weight: 700; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
button, .btn { font: inherit; border: 1px solid var(--line); background: var(--panel); color: var(--ink); border-radius: 8px; padding: 6px 12px; cursor: pointer; text-decoration: none; display: inline-block; }
button.primary, .btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }
button.danger { color: var(--bot); border-color: color-mix(in srgb, var(--bot) 45%, var(--line)); }
button:disabled { opacity: .5; cursor: not-allowed; }
input, select, textarea { font: inherit; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; max-width: 100%; }
textarea { width: 100%; min-height: 110px; }
label.f { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; }
.table-wrap { overflow-x: auto; }
.pill { display: inline-block; min-width: 42px; text-align: center; padding: 2px 8px; border-radius: 999px; font-weight: 700; font-size: 13px; background: var(--chip); }
.pill.likely_bot, .pill.tier3 { color: #fff; background: var(--bot); }
.pill.suspicious, .pill.tier2 { color: #fff; background: var(--sus); }
.pill.low_confidence, .pill.tier1 { color: var(--ink); background: var(--chip); }
.chip { display: inline-block; background: var(--chip); border-radius: 6px; padding: 1px 8px; font-size: 12px; margin: 2px 4px 2px 0; }
.chip.warn { background: color-mix(in srgb, var(--sus) 22%, transparent); }
.chip.bad { background: color-mix(in srgb, var(--bot) 22%, transparent); }
.chip.good { background: color-mix(in srgb, var(--ok) 22%, transparent); }
ul.reasons { margin: 4px 0 0; padding-left: 18px; font-size: 13px; color: var(--muted); }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; color: #fff; flex: none; }
.who { display: flex; gap: 10px; align-items: center; min-width: 180px; }
.who .n { font-weight: 600; }
.toast { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 10px; z-index: 30; max-width: calc(100% - 32px); }
.hidden { display: none !important; }
dialog { border: 1px solid var(--line); border-radius: 12px; background: var(--panel); color: var(--ink); max-width: min(560px, calc(100% - 32px)); }
dialog::backdrop { background: rgba(0,0,0,.4); }
ol.steps { padding-left: 20px; }
ol.steps li { margin-bottom: 4px; }
.progress { height: 8px; background: var(--chip); border-radius: 99px; overflow: hidden; }
.progress > div { height: 100%; background: var(--accent); }
code, pre { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; }
pre { background: var(--bg); border: 1px solid var(--line); padding: 10px; border-radius: 8px; overflow-x: auto; white-space: pre-wrap; }
.notice { border-left: 4px solid var(--sus); padding: 8px 12px; background: color-mix(in srgb, var(--sus) 10%, transparent); border-radius: 6px; }
@media (max-width: 640px) {
  header.top { padding: 10px 16px; }
  main { padding: 16px 16px 48px; }
  th.hide-sm, td.hide-sm { display: none; }
}

.result-head { display: flex; gap: 16px; align-items: center; }
.shield { width: 64px; height: 64px; border-radius: 16px; display: grid; place-items: center; font-size: 32px; background: var(--chip); flex: none; }
.shield.bad { background: color-mix(in srgb, var(--bot) 20%, transparent); }
.shield.warn { background: color-mix(in srgb, var(--sus) 20%, transparent); }
.shield.ok { background: color-mix(in srgb, var(--ok) 20%, transparent); }
.result-head .big { font-size: 28px; font-weight: 750; line-height: 1.15; }
.cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px; margin: 14px 0; }
.cat { display: flex; justify-content: space-between; border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; }
.cat.hit { border-color: color-mix(in srgb, var(--bot) 45%, var(--line)); }
.cat.hit b { color: var(--bot); }
.cta { display: grid; grid-template-columns: auto 1fr; gap: 8px 12px; align-items: center; }
.cta .link { grid-column: 1 / -1; justify-self: start; border: none; background: none; color: var(--accent); padding: 0; }
.big-btn { padding: 10px 18px; font-size: 16px; }
.price s { color: var(--muted); }
.free { color: var(--ok); }
.plans .plan { display: flex; flex-direction: column; gap: 6px; }
.plans .plan.featured { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.plans .plan h3 { margin: 4px 0 0; }
.plan-price { font-size: 18px; }
.plans .plan ul { padding-left: 18px; margin: 4px 0; flex: 1; }
@media (max-width: 640px) { .cta { grid-template-columns: 1fr; } .result-head .big { font-size: 22px; } }

/* Phones: list tables become stacked cards so reasons stay readable. */
@media (max-width: 640px) {
  table.stack thead { display: none; }
  table.stack, table.stack tbody, table.stack tr, table.stack td { display: block; width: 100%; }
  table.stack tr { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; margin-bottom: 10px; position: relative; }
  table.stack td { border: none; padding: 4px 0; }
  table.stack td:empty { display: none; }
  table.stack .who { min-width: 0; }
}

/* Night theme details */
.card { background: rgba(255,255,255,0.03); border-radius: 12px; }
button, .btn { background: rgba(255,255,255,0.05); border-color: var(--line); border-radius: 10px; }
button:hover:not(:disabled), .btn:hover { border-color: var(--accent); }
button.primary, .btn.primary { background: linear-gradient(90deg, var(--accent), var(--accent2)); border: 0; color: #fff; border-radius: 12px; box-shadow: 0 4px 18px rgba(123,92,255,.35); }
button.danger { background: rgba(224,104,122,0.08); }
input, select, textarea { background: rgba(255,255,255,0.05); border-color: var(--line); border-radius: 10px; }
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(123,92,255,.55); outline-offset: 0; border-color: var(--accent); }
select option { background: var(--panel); color: var(--ink); }
th { color: var(--faint); }
.pill.likely_bot, .pill.tier3 { background: var(--bot); color: #1a0d14; }
.pill.suspicious, .pill.tier2 { background: var(--sus); color: #2a1a00; }
.toast { background: #2b2360; color: var(--ink); border: 1px solid var(--accent); box-shadow: var(--shadow); }
dialog { background: linear-gradient(160deg, var(--panel), var(--panel2)); }
.shield { box-shadow: 0 0 28px rgba(123,92,255,.25); }
.plans .plan.featured { box-shadow: 0 0 0 1px var(--accent), 0 0 32px rgba(123,92,255,.3); }
a { color: var(--accent2); }
code { color: var(--accent2); }
pre { background: rgba(0,0,0,.25); }
.progress > div { background: linear-gradient(90deg, var(--accent), var(--accent2)); }
header.top h1 { color: #fff; }

.hero { text-align: center; max-width: 720px; margin: 28px auto 20px; }
.hero h2 { font-size: 32px; margin: 0 0 8px; background: linear-gradient(90deg, #fff, var(--accent2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); max-width: 980px; margin: 0 auto; }
@media (max-width: 640px) { .hero h2 { font-size: 24px; } }

html { background: var(--bg); }

/* Live Guard: the chat as a moderator sees it */
.lgstats { margin: 10px 0; color: var(--muted); } .lgstats b { color: var(--ink); } .lgstats b.bad { color: var(--bot); }
.lgchat { max-height: 360px; overflow-y: auto; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; margin: 10px 0; }
.lgchat .msg { padding: 5px 6px; border-radius: 8px; font-size: 14px; line-height: 1.4; }
.lgchat .msg b { color: var(--accent2); }
.lgchat .msg.bad { background: rgba(224,104,122,.1); border-left: 3px solid var(--bot); }
.lgchat .msg.bad .t { text-decoration: line-through; color: var(--faint); }
.lgchat .msg .why { font-size: 12px; color: var(--muted); margin-top: 3px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.panel.dropping{outline:2px dashed var(--accent,#7b5cff);outline-offset:-6px}
.chatlog{max-height:320px;overflow:auto;display:flex;flex-direction:column;gap:6px;padding:4px 0}
.chatlog .msg{max-width:85%;padding:8px 12px;border-radius:14px;font-size:14px;line-height:1.4;white-space:pre-wrap}
.chatlog .msg.agent{align-self:flex-start;background:rgba(123,92,255,.14);border:1px solid var(--line)}
.chatlog .msg.me{align-self:flex-end;background:var(--accent);color:var(--accent-ink)}
