/* Source Sans 3 (SIL Open Font License 1.1, see fonts/OFL.txt), served from this server only. */
@font-face { font-family: "Source Sans 3"; src: url("fonts/SourceSans3-Light.woff2") format("woff2"); font-weight: 300; font-style: normal; font-display: swap; }
@font-face { font-family: "Source Sans 3"; src: url("fonts/SourceSans3-Regular.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Source Sans 3"; src: url("fonts/SourceSans3-Semibold.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Source Sans 3"; src: url("fonts/SourceSans3-Bold.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }

/* ------------------------------------------------------------------ tokens */

:root {
  --bg: #f2efe7;
  --paper: #fbfaf6;
  --paper-2: #f0ece2;
  --ink: #16161a;
  --ink-2: #4a4a52;
  --muted: #807e77;
  --rule: #ddd7c9;
  --rule-strong: #16161a;
  --signal: #e2482d;
  --signal-ink: #ffffff;
  --signal-soft: #fbe2da;
  --safe: #1c7a57;
  --safe-soft: #dbeee4;
  --amber: #b97a12;
  --amber-soft: #f5e8cf;
  --side: #16161a;
  --side-ink: #ecebe5;
  --side-muted: #8a8983;
  --side-rule: #2b2b31;
  --focus: #e2482d;
  --chart-1: #4a4a52;
  --chart-2: #e2482d;
  --chart-3: #c98a1a;
  --shadow: 0 1px 0 rgb(22 22 26 / 0.04), 0 12px 32px -18px rgb(22 22 26 / 0.18);
  --font: "Source Sans 3", sans-serif;
  --r: 6px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d0d0f; --paper: #151518; --paper-2: #1c1c20; --ink: #ecebe5; --ink-2: #b6b5ae; --muted: #85847e;
    --rule: #29292f; --rule-strong: #ecebe5; --signal: #ff6448; --signal-ink: #1a0905; --signal-soft: #3a1a13;
    --safe: #48c08e; --safe-soft: #12291f; --amber: #e8a93f; --amber-soft: #2f2410;
    --side: #09090a; --side-rule: #222227; --focus: #ff6448;
    --chart-1: #b6b5ae; --chart-2: #ff6448; --chart-3: #e8a93f;
    --shadow: 0 0 0 1px rgb(255 255 255 / 0.02);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0d0d0f; --paper: #151518; --paper-2: #1c1c20; --ink: #ecebe5; --ink-2: #b6b5ae; --muted: #85847e;
  --rule: #29292f; --rule-strong: #ecebe5; --signal: #ff6448; --signal-ink: #1a0905; --signal-soft: #3a1a13;
  --safe: #48c08e; --safe-soft: #12291f; --amber: #e8a93f; --amber-soft: #2f2410;
  --side: #09090a; --side-rule: #222227; --focus: #ff6448;
  --chart-1: #b6b5ae; --chart-2: #ff6448; --chart-3: #e8a93f;
  --shadow: 0 0 0 1px rgb(255 255 255 / 0.02);
  color-scheme: dark;
}

/* ------------------------------------------------------------------ base */

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--ink);
  font: 400 15px/1.5 var(--font);
  font-feature-settings: "kern", "liga";
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
[hidden] { display: none !important; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: var(--signal); color: var(--signal-ink); }
.num, .tnum { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 0.875rem; }
.eyebrow { margin: 0; font-size: 0.72rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
code { font-family: var(--font); font-weight: 600; font-size: 0.95em; padding: 0 0.3em; border-radius: 3px; background: var(--paper-2); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* ------------------------------------------------------------------ brand */

.brand { display: flex; align-items: center; gap: 0.6rem; font-weight: 600; font-size: 1.05rem; letter-spacing: 0.01em; white-space: nowrap; }
.mark {
  position: relative; flex: none; width: 22px; height: 22px; background: var(--signal);
  clip-path: polygon(30% 0, 70% 0, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0 70%, 0 30%);
}
.mark::after { content: ""; position: absolute; left: 24%; right: 24%; top: 45%; height: 11%; background: #fff; border-radius: 1px; }
.brand-xl { font-size: 2rem; font-weight: 300; gap: 0.9rem; letter-spacing: -0.01em; }
.brand-xl .mark { width: 40px; height: 40px; }

/* ------------------------------------------------------------------ shell */

.shell { display: grid; grid-template-columns: 252px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 2.25rem;
  padding: calc(1.75rem + env(safe-area-inset-top, 0px)) 1.25rem 1.5rem;
  background: var(--side); color: var(--side-ink);
}
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  position: relative; display: flex; align-items: baseline; gap: 0.85rem;
  padding: 0.55rem 0.75rem; border-radius: 4px; color: var(--side-muted); text-decoration: none;
  transition: color 0.15s, background 0.15s;
}
.nav a:hover { color: var(--side-ink); background: rgb(255 255 255 / 0.04); }
.nav a.active { color: var(--side-ink); background: rgb(255 255 255 / 0.06); }
.nav a.active::before { content: ""; position: absolute; left: -1.25rem; top: 0.5rem; bottom: 0.5rem; width: 3px; background: var(--signal); border-radius: 0 2px 2px 0; }
.nav-no { font-size: 0.72rem; font-weight: 600; letter-spacing: 0.08em; font-variant-numeric: tabular-nums; color: var(--side-muted); opacity: 0.7; }
.nav a.active .nav-no { color: var(--signal); opacity: 1; }
.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 0.75rem; padding-top: 1.25rem; border-top: 1px solid var(--side-rule); font-size: 0.85rem; color: var(--side-muted); }
.status { display: flex; align-items: center; gap: 0.55rem; }
.conn { width: 8px; height: 8px; border-radius: 50%; background: var(--side-muted); }
.conn.on { background: #48c08e; box-shadow: 0 0 0 4px rgb(72 192 142 / 0.15); }
.conn.off { background: #ff6448; box-shadow: 0 0 0 4px rgb(255 100 72 / 0.15); }
.sidebar-bot { color: var(--side-ink); overflow: hidden; text-overflow: ellipsis; }
.theme-btn {
  display: inline-flex; align-items: center; gap: 0.55rem; align-self: flex-start;
  padding: 0.35rem 0.7rem 0.35rem 0.5rem; border: 1px solid var(--side-rule); border-radius: 999px;
  background: transparent; color: var(--side-muted); cursor: pointer; font-size: 0.82rem;
}
.theme-btn:hover { color: var(--side-ink); border-color: var(--side-muted); }
.theme-ico { width: 14px; height: 14px; border-radius: 50%; border: 1.5px solid currentColor; background: linear-gradient(90deg, currentColor 50%, transparent 50%); }

.main { width: 100%; min-width: 0; max-width: 1240px; padding: 2.75rem clamp(1rem, 4vw, 3.5rem) 5rem; }

@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    position: sticky; z-index: 20; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 0.75rem 1rem;
    padding: calc(0.8rem + env(safe-area-inset-top, 0px)) 1rem 0.6rem;
  }
  .nav { order: 3; flex-basis: 100%; flex-direction: row; overflow-x: auto; scrollbar-width: none; margin: 0 -1rem; padding: 0 1rem; }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { flex: none; gap: 0.4rem; padding: 0.4rem 0.7rem; }
  .nav a.active::before { left: 0.7rem; right: 0.7rem; top: auto; bottom: -0.6rem; width: auto; height: 2px; }
  .sidebar-foot { margin: 0 0 0 auto; padding: 0; border: 0; flex-direction: row; align-items: center; gap: 0.75rem; }
  .sidebar-bot, #conn-label, #theme-label { display: none; }
  .theme-btn { padding: 0.4rem; }
  .main { padding-top: 1.75rem; }
}

/* ------------------------------------------------------------------ page head */

.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 1.25rem 2rem; margin-bottom: 2.25rem; }
.page-head-text { flex: 1 1 340px; min-width: 0; }
.page-title { margin: 0.35rem 0 0; font-size: clamp(2rem, 1.4rem + 2vw, 2.85rem); font-weight: 300; line-height: 1.05; letter-spacing: -0.025em; }
.page-title em { font-style: normal; color: var(--signal); }
.lede { margin: 0.75rem 0 0; max-width: 62ch; color: var(--ink-2); font-size: 1.02rem; }
.page-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; }

/* ------------------------------------------------------------------ controls */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.5rem 0.95rem; border: 1px solid var(--rule); border-radius: var(--r);
  background: var(--paper); color: var(--ink); cursor: pointer; white-space: nowrap; font-weight: 600; font-size: 0.92rem;
  transition: border-color 0.15s, background 0.15s, color 0.15s, transform 0.05s;
}
.btn:hover { border-color: var(--ink-2); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.45; cursor: default; transform: none; }
.btn-primary { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.btn-primary:hover { background: var(--ink-2); border-color: var(--ink-2); }
.btn-signal { background: var(--signal); border-color: var(--signal); color: var(--signal-ink); }
.btn-safe { background: var(--safe); border-color: var(--safe); color: #fff; }
.btn-ghost { background: transparent; }
.btn-danger { color: var(--signal); }
.btn-danger:hover { border-color: var(--signal); }
.btn-sm { padding: 0.28rem 0.65rem; font-size: 0.84rem; }
.btn-lg { padding: 0.75rem 1.2rem; font-size: 1rem; }
kbd {
  display: inline-block; min-width: 1.5em; padding: 0.05rem 0.35rem; border-radius: 4px;
  border: 1px solid currentColor; opacity: 0.6; font: 600 0.72rem/1.3 var(--font); letter-spacing: 0.04em; text-align: center;
}

.seg { display: inline-flex; padding: 3px; gap: 2px; border: 1px solid var(--rule); border-radius: 999px; background: var(--paper); }
.seg button {
  border: 0; background: transparent; color: var(--ink-2); padding: 0.3rem 0.85rem; border-radius: 999px; cursor: pointer;
  font-size: 0.86rem; font-weight: 600; white-space: nowrap;
}
.seg button:hover { color: var(--ink); }
.seg button.on { background: var(--ink); color: var(--bg); }
.seg button:disabled { opacity: 0.4; cursor: default; }
.seg-scroll { max-width: 100%; overflow-x: auto; scrollbar-width: none; }

input[type=text], input[type=password], input[type=number], input[type=search], select, textarea {
  width: 100%; padding: 0.55rem 0.75rem; border: 1px solid var(--rule); border-radius: var(--r);
  background: var(--paper); color: var(--ink); transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--ink-2); box-shadow: 0 0 0 3px color-mix(in srgb, var(--signal) 22%, transparent); }
input[type=search] { width: auto; flex: 0 1 17rem; min-width: 12rem; }
textarea { min-height: 10rem; resize: vertical; line-height: 1.55; }
select { appearance: none; padding-right: 2rem; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: right 1rem center, right 0.7rem center; background-size: 5px 5px; background-repeat: no-repeat; }
input[type=checkbox] { appearance: none; width: 2.4rem; height: 1.35rem; border-radius: 999px; background: var(--rule); position: relative; cursor: pointer; transition: background 0.15s; margin: 0; }
input[type=checkbox]::after { content: ""; position: absolute; top: 3px; left: 3px; width: calc(1.35rem - 6px); height: calc(1.35rem - 6px); border-radius: 50%; background: var(--paper); transition: transform 0.15s; box-shadow: 0 1px 2px rgb(0 0 0 / 0.2); }
input[type=checkbox]:checked { background: var(--ink); }
input[type=checkbox]:checked::after { transform: translateX(1.05rem); }
.field { display: flex; flex-direction: column; gap: 0.4rem; }
.field-label { font-size: 0.8rem; font-weight: 600; color: var(--ink-2); }
.form-error { min-height: 1.3em; margin: 0.25rem 0 0; color: var(--signal); font-size: 0.9rem; }

.toolbar { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; margin-bottom: 1.25rem; min-width: 0; }
.toolbar .grow { flex: 1; }
.toolbar select { width: auto; min-width: 11rem; }
.center { justify-content: center; }

/* ------------------------------------------------------------------ pills */

.pill {
  display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.1rem 0.55rem; border-radius: 999px;
  font-size: 0.72rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; white-space: nowrap;
  color: var(--ink-2); background: var(--paper-2);
}
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: 0.8; }
.pill.plain::before { display: none; }
.pill.signal { color: var(--signal); background: var(--signal-soft); }
.pill.safe { color: var(--safe); background: var(--safe-soft); }
.pill.amber { color: var(--amber); background: var(--amber-soft); }
.pill.outline { background: transparent; border: 1px solid var(--rule); }

/* ------------------------------------------------------------------ panels */

.panel { background: var(--paper); border: 1px solid var(--rule); border-radius: var(--r); box-shadow: var(--shadow); }
.panel-head { display: flex; align-items: baseline; gap: 1rem; padding: 1rem 1.25rem 0; }
.panel-title { margin: 0; font-size: 0.74rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink); }
.panel-title::before { content: ""; display: inline-block; width: 10px; height: 2px; margin-right: 0.6rem; vertical-align: middle; background: var(--signal); }
.panel-meta { margin-left: auto; font-size: 0.84rem; color: var(--muted); }
.panel-body { padding: 1rem 1.25rem 1.25rem; }
.panel-body > p:first-child { margin-top: 0; }
.grid { display: grid; gap: 1.25rem; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr)); }
.grid-main { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); align-items: start; }
@media (max-width: 1080px) { .grid-main { grid-template-columns: minmax(0, 1fr); } }
.stack { display: flex; flex-direction: column; gap: 1.25rem; }
.mb { margin-bottom: 1.25rem; }
.mt { margin-top: 1.5rem; }

/* ------------------------------------------------------------------ KPI strip */

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); border-top: 2px solid var(--rule-strong); margin-bottom: 2rem; }
.kpi { padding: 1rem 1.25rem 0.25rem 0; min-width: 0; }
.kpi + .kpi { padding-left: 1.25rem; border-left: 1px solid var(--rule); }
.kpi-label { font-size: 0.72rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.kpi-value { margin-top: 0.35rem; font-size: 2.5rem; font-weight: 300; line-height: 1; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kpi-value.text { font-size: 1.45rem; font-weight: 400; letter-spacing: 0; line-height: 1.7; }
.kpi-value .unit { font-size: 0.45em; font-weight: 400; color: var(--muted); margin-left: 0.15em; letter-spacing: 0; }
.kpi-sub { margin-top: 0.4rem; font-size: 0.86rem; color: var(--muted); }
.kpi.alert .kpi-value { color: var(--signal); }
@media (max-width: 560px) {
  .kpis { grid-template-columns: 1fr 1fr; }
  .kpi { padding: 0.9rem 0.9rem 0.6rem 0; }
  .kpi + .kpi { padding-left: 0.9rem; }
  .kpi:nth-child(2n + 1) { padding-left: 0; border-left: 0; }
  .kpi-value { font-size: 2rem; }
}

/* ------------------------------------------------------------------ tables */

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { padding: 0 0.75rem 0.6rem; text-align: left; font-size: 0.72rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--rule-strong); white-space: nowrap; }
td { padding: 0.7rem 0.75rem; border-bottom: 1px solid var(--rule); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
th:first-child, td:first-child { padding-left: 0; }
th:last-child, td:last-child { padding-right: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.kv td { padding: 0.5rem 0; }
.kv td:last-child { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.cell-title { font-weight: 600; }
.cell-sub { font-size: 0.82rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.row-actions { display: flex; flex-wrap: wrap; gap: 0.4rem; justify-content: flex-end; }

.bar { height: 4px; min-width: 70px; background: var(--paper-2); border-radius: 999px; overflow: hidden; }
.bar > div { height: 100%; background: var(--signal); border-radius: 999px; }

/* ------------------------------------------------------------------ charts */

.chart { display: block; width: 100%; height: 280px; }
.chart-sm { height: 120px; }
.legend { display: flex; flex-wrap: wrap; gap: 1.25rem; margin-top: 0.75rem; font-size: 0.86rem; color: var(--ink-2); }
.legend i { display: inline-block; width: 14px; height: 3px; margin-right: 0.45rem; vertical-align: middle; border-radius: 2px; }
.legend .l1 { background: var(--chart-1); }
.legend .l2 { background: var(--chart-2); }
.legend .l3 { background: var(--chart-3); }

/* ------------------------------------------------------------------ message ledger */

.ledger { border-top: 2px solid var(--rule-strong); }
/* Chat pages: the column fills the viewport so short histories sit at the bottom, above the bar. */
.main.chat { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; padding-bottom: 0; }
.main.chat .ledger { border-top: 0; }
.history-edge {
  flex: 1 0 auto; display: flex; align-items: flex-end; justify-content: center;
  min-height: 2.5rem; padding-bottom: 0.75rem; font-size: 0.84rem; color: var(--muted);
}
.chatbar {
  position: sticky; bottom: 0; z-index: 30; display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem;
  margin-top: 0.5rem; padding: 0.85rem 0 calc(0.85rem + env(safe-area-inset-bottom, 0px));
  border-top: 2px solid var(--rule-strong);
  background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(10px);
}
.chatbar .seg-scroll { flex: 0 1 auto; min-width: 0; }
.chatbar select { width: auto; min-width: 10rem; margin-left: auto; }
.chatbar input[type=search] { flex: 0 1 15rem; }
.jump {
  position: absolute; left: 50%; bottom: calc(100% + 0.9rem); transform: translateX(-50%);
  padding: 0.55rem 1.1rem; border: 0; border-radius: 999px; background: var(--signal); color: var(--signal-ink);
  font-weight: 600; font-size: 0.92rem; white-space: nowrap; cursor: pointer; box-shadow: 0 8px 24px -8px rgb(0 0 0 / 0.35);
}
@media (max-width: 900px) {
  /* the sticky top bar takes part of the viewport on narrow screens */
  .main.chat { min-height: calc(100dvh - 6.5rem); }
}
@media (max-width: 640px) {
  .chatbar { gap: 0.5rem; padding-top: 0.6rem; }
  .chatbar .seg-scroll { flex-basis: 100%; }
  .chatbar select, .chatbar input[type=search] { flex: 1 1 0; min-width: 0; margin-left: 0; }
}
.entry {
  position: relative; display: grid; grid-template-columns: 9.5rem minmax(0, 1fr) 15rem; gap: 0.5rem 1.75rem;
  padding: 1.2rem 0 1.2rem 1rem; border-bottom: 1px solid var(--rule);
}
.entry::before { content: ""; position: absolute; left: 0; top: 1.2rem; bottom: 1.2rem; width: 3px; border-radius: 2px; background: var(--rule); }
.entry.is-scam::before { background: var(--signal); }
.entry.is-ok::before { background: var(--safe); }
.entry.is-deleted:not(.is-scam):not(.is-ok)::before { background: repeating-linear-gradient(180deg, var(--signal) 0 4px, transparent 4px 7px); }
.entry.new { animation: arrive 1.6s ease-out; }
@keyframes arrive { from { background: color-mix(in srgb, var(--signal) 9%, transparent); } to { background: transparent; } }
.entry-meta { display: flex; flex-direction: column; gap: 0.1rem; min-width: 0; }
.entry-time { font-size: 1.35rem; font-weight: 300; line-height: 1.1; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.entry-date { font-size: 0.78rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.entry-chat { margin-top: 0.5rem; font-weight: 600; font-size: 0.9rem; overflow-wrap: anywhere; }
.entry-sender { font-size: 0.86rem; color: var(--muted); overflow-wrap: anywhere; }
.entry-body { min-width: 0; }
.entry-tags { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-bottom: 0.5rem; }
.entry-tags:empty { display: none; }
.entry-content { display: flex; gap: 1rem; align-items: flex-start; }
.entry-main { flex: 1; min-width: 0; }
.entry-text { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 1rem; line-height: 1.55; }
.entry-text .none { color: var(--muted); font-style: italic; }
.entry-ocr { margin-top: 0.75rem; padding: 0.6rem 0.8rem; border-radius: 4px; background: var(--paper-2); color: var(--ink-2); font-size: 0.9rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.entry-ocr .tag { display: block; margin-bottom: 0.2rem; font-size: 0.68rem; font-weight: 700; letter-spacing: 0.14em; color: var(--muted); }
.thumb { flex: none; width: 112px; height: 112px; object-fit: cover; border-radius: 4px; border: 1px solid var(--rule); cursor: zoom-in; background: var(--paper-2); }
.thumb.big { width: min(640px, 100%); height: auto; cursor: zoom-out; }
.entry-content:has(.thumb.big) { flex-direction: column; }
.entry-reason { margin-top: 0.6rem; font-size: 0.84rem; color: var(--muted); }
.entry-reason .err { color: var(--signal); }
.entry-verdict { display: flex; flex-direction: column; gap: 0.75rem; }
.entry-verdict .seg { align-self: stretch; }
.entry-verdict .seg button { flex: 1; }
.seg .on-scam { background: var(--signal); color: var(--signal-ink); }
.seg .on-ok { background: var(--safe); color: #fff; }

.meter { display: grid; grid-template-columns: 1fr auto; gap: 0.25rem 0.5rem; align-items: baseline; font-size: 0.8rem; }
.meter-label { font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; font-size: 0.68rem; color: var(--muted); }
.meter-value { font-variant-numeric: tabular-nums; font-weight: 600; }
.meter.hot .meter-value { color: var(--signal); }
.meter-track { grid-column: 1 / -1; position: relative; height: 4px; border-radius: 999px; background: var(--paper-2); }
.meter-fill { position: absolute; inset: 0 auto 0 0; border-radius: 999px; background: var(--ink-2); }
.meter.warm .meter-fill { background: var(--amber); }
.meter.hot .meter-fill { background: var(--signal); }
.meter-tick { position: absolute; top: -3px; bottom: -3px; width: 2px; margin-left: -1px; background: var(--ink); border-radius: 1px; }
.meter.none .meter-value { color: var(--muted); font-weight: 400; }

@media (max-width: 1100px) {
  .entry { grid-template-columns: 8rem minmax(0, 1fr); }
  .entry-verdict { grid-column: 2; flex-direction: row; flex-wrap: wrap; align-items: flex-end; }
  .entry-verdict .meter { flex: 1 1 140px; }
  .entry-verdict .seg { flex: 1 1 200px; }
}
@media (max-width: 640px) {
  .entry { grid-template-columns: minmax(0, 1fr); padding-left: 0.9rem; }
  .toolbar select, .toolbar input[type=search] { flex: 1 1 100%; min-width: 0; }
  .entry-meta { flex-direction: row; flex-wrap: wrap; align-items: baseline; gap: 0.25rem 0.6rem; }
  .entry-chat { margin-top: 0; }
  .entry-verdict { grid-column: 1; }
  .thumb { width: 84px; height: 84px; }
}

/* ------------------------------------------------------------------ review */

.progress-line { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.25rem 1rem; margin-bottom: 0.6rem; font-size: 0.92rem; color: var(--ink-2); }
.progress-line strong { font-size: 1.5rem; font-weight: 300; color: var(--ink); font-variant-numeric: tabular-nums; }
.progress { height: 3px; margin-bottom: 2rem; background: var(--rule); border-radius: 999px; overflow: hidden; }
.progress > div { height: 100%; width: 0; background: var(--signal); transition: width 0.35s ease; }
.specimen { max-width: 860px; }
.specimen-head { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; align-items: center; padding: 1.25rem 1.75rem 0; }
.specimen-no { font-size: 0.78rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); font-variant-numeric: tabular-nums; }
.specimen-text {
  position: relative; margin: 1rem 1.75rem 0; padding: 0.25rem 0 0.25rem 1.5rem; border-left: 2px solid var(--rule-strong);
  font-size: 1.2rem; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere;
}
.specimen-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; padding: 1.5rem 1.75rem; margin-top: 1.25rem; border-top: 1px solid var(--rule); }
.specimen-actions .btn-lg { min-width: 9.5rem; }
.specimen-actions .grow { flex: 1; }
@media (max-width: 560px) {
  .specimen-head, .specimen-actions { padding-inline: 1rem; }
  .specimen-text { margin-inline: 1rem; font-size: 1.05rem; }
  .specimen-actions .btn-lg { flex: 1 1 40%; min-width: 0; }
}

/* ------------------------------------------------------------------ settings */

.setting { display: grid; grid-template-columns: minmax(0, 1fr) 8.5rem; gap: 0.25rem 1.5rem; align-items: center; padding: 0.85rem 0; border-bottom: 1px solid var(--rule); }
.setting:last-of-type { border-bottom: 0; }
.setting-label { font-weight: 600; font-size: 0.95rem; }
.setting-hint { font-size: 0.8rem; color: var(--muted); }
.setting-control { justify-self: end; width: 100%; display: flex; justify-content: flex-end; }
.setting-control input[type=number] { text-align: right; font-variant-numeric: tabular-nums; }
.setting-dep { display: none; margin-top: 0.15rem; font-size: 0.8rem; color: var(--amber); }
.setting.inactive > label > :not(.setting-dep), .setting.inactive .setting-control { opacity: 0.4; }
.setting.inactive .setting-dep { display: block; }
.setting-group { margin: 1.75rem 0 0.25rem; }
.setting-group:first-child { margin-top: 0; }
.form-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 1.25rem; }
.token-now { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.25rem 0.75rem; margin: 0 0 1rem; }
.token-now strong { font-size: 1.2rem; font-weight: 400; }
@media (max-width: 560px) { .setting { grid-template-columns: 1fr; } .setting-control { justify-content: flex-start; } }

/* ------------------------------------------------------------------ login */

.login { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); min-height: 100vh; }
.login-hero {
  position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 1.5rem;
  padding: calc(3rem + env(safe-area-inset-top, 0px)) clamp(1.5rem, 5vw, 4.5rem) 3rem;
  background: var(--side); color: var(--side-ink);
}
.login-tag { position: relative; margin: 1rem 0 0; max-width: 18ch; font-size: clamp(1.9rem, 1.2rem + 2.4vw, 3.2rem); font-weight: 300; line-height: 1.1; letter-spacing: -0.02em; }
.login-foot { position: relative; z-index: 1; align-self: flex-start; margin: auto 0 0; padding: 0.35rem 0.75rem; border-radius: 999px; background: var(--side); font-size: 0.85rem; color: var(--side-muted); letter-spacing: 0.04em; }
.login-octagons { position: absolute; right: -14%; bottom: -22%; width: 70%; aspect-ratio: 1; pointer-events: none; }
.login-octagons span {
  position: absolute; inset: 0; background: var(--signal);
  /* Octagon ring: outer outline, then the inner outline traced back. */
  clip-path: polygon(30% 0, 70% 0, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0 70%, 0 30%, 30% 0, 31.2% 3%, 3% 31.2%, 3% 68.8%, 31.2% 97%, 68.8% 97%, 97% 68.8%, 97% 31.2%, 68.8% 3%, 31.2% 3%);
  opacity: 0.9;
}
.login-octagons span:nth-child(2) { inset: 16%; opacity: 0.45; }
.login-octagons span:nth-child(3) { inset: 32%; opacity: 0.2; }
.login-side { display: grid; place-items: center; padding: 3rem 1.5rem; background: var(--bg); }
.login-form { width: min(380px, 100%); display: flex; flex-direction: column; gap: 1.1rem; }
.login-title { margin: 0 0 0.5rem; font-size: 2.4rem; font-weight: 300; letter-spacing: -0.02em; }
@media (max-width: 820px) {
  .login { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .login-hero { min-height: 260px; padding-bottom: 2rem; }
  .login-octagons { width: 60%; right: -15%; bottom: -35%; }
  .login-tag { font-size: 1.8rem; }
}

/* ------------------------------------------------------------------ misc */

.empty { padding: 3rem 1rem; text-align: center; color: var(--muted); }
.empty strong { display: block; margin-bottom: 0.25rem; font-size: 1.15rem; font-weight: 400; color: var(--ink-2); }
.note { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem; padding: 0.8rem 1rem; border-radius: var(--r); background: var(--amber-soft); color: var(--ink); font-size: 0.92rem; }
.toast {
  position: fixed; left: 50%; bottom: calc(1.5rem + env(safe-area-inset-bottom, 0px)); z-index: 50;
  max-width: calc(100vw - 2rem); padding: 0.65rem 1.1rem; border-radius: 999px;
  background: var(--ink); color: var(--bg); font-weight: 600; font-size: 0.92rem;
  opacity: 0; transform: translate(-50%, 8px); transition: opacity 0.2s, transform 0.2s; pointer-events: none;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
