/*
 * Khoan Đã styles.
 *
 * One design system for every page. The tokens below are the Apple-style system of T05G/T05H:
 * SF Pro through the system font stack, semibold headlines, pill buttons, #f5f5f7 cards and
 * Apple blue, in light and dark. The analyst console (<body class="admin">) shares all of them
 * and only overrides the density tokens in the "Console density" block: smaller type, compact
 * controls and tighter rhythm (T14).
 * Shared component rules read tokens only. Never put a hard-coded size, weight, radius or
 * tracking into a shared rule when one of the two looks needs a different one: add a token.
 * Dark applies for the OS preference unless the page is forced light, and for an explicit dark
 * choice; both dark selectors carry the same values.
 */
:root {
  color-scheme: light;
  font-family: var(--font-sans);
  font-size: 16px;
  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif;
  --bg: #ffffff;
  --surface: #f5f5f7;
  --surface-raised: #ffffff;
  --surface-muted: #e8e8ed;
  --ink: #1d1d1f;
  --muted: #66666b;
  --line: #d2d2d7;
  --control-line: #86868b;
  --accent: #0071e3;
  --accent-strong: #0066cc;
  --accent-hover: #0058b0;
  --accent-ink: #ffffff;
  --button-ink: #ffffff;
  --danger: #a52525;
  --danger-ink: #ffffff;
  --danger-bg: #fde9e6;
  --amber: #805200;
  --amber-bg: #fff3d3;
  --slate: #48484d;
  --slate-bg: #efeff2;
  --violet: #5d5670;
  --violet-bg: #efebf5;
  --info: #0066cc;
  --info-bg: #e5f0fc;
  --focus: #0071e3;
  --shadow: 0 8px 30px rgb(0 0 0 / 12%);
  --shadow-small: none;
  --header-bg: rgb(255 255 255 / 80%);
  --header-line: rgb(0 0 0 / 10%);
  --header-min: 56px;
  --footer-bg: var(--surface);
  --card-line: rgb(0 0 0 / 6%);
  --row-hover: rgb(0 0 0 / 3%);
  --toggle-bg: transparent;
  --toggle-line: transparent;

  /* UX1 tokens. Colour tokens are repeated in both dark blocks. Structure tokens (sizes and
     widths) are the same in every mode and live only here; `--verdict-icon-size` also steps up
     in the 768px media block. The --verdict-* tokens are read by the result page (UX1-2). */
  --ok: #1a6130;
  --ok-bg: #e3f4e8;
  --sticky-bar-bg: var(--header-bg);
  --sticky-bar-line: var(--header-line);
  --seg-on-bg: var(--info-bg);
  --seg-on-line: var(--accent-strong);
  --skeleton-bg: var(--surface-muted);
  --sticky-bar-h: 72px;
  --seg-gap: 8px;
  --rail-w: 360px;
  --rail-top: calc(var(--header-min) + 12px);
  --verdict-bar-strong: 8px;
  --verdict-bar-medium: 5px;
  --verdict-bar-light: 3px;
  --verdict-icon-size: 44px;
  --kpi-min: 160px;
  --nav-group-gap: 4px;

  /* Shape, type and rhythm tokens. */
  --radius-btn: 980px;
  --radius-ctl: 12px;
  --radius-card: 22px;
  --radius-row: 14px;
  --radius-pill: 999px;
  --ctl-h: 44px;
  --ctl-pad: 11px 13px;
  --btn-pad: 10px 22px;
  --ctl-h-sm: 44px;
  --nav-h: 44px;
  --ring-w: 2px;
  --ring-off: 2px;
  --fw-strong: 600;
  --fw-label: 500;
  --fw-nav: 400;
  --fw-head: 600;
  --fw-link-btn: 500;
  --fs-body: 0.9375rem;
  --fs-control: 0.9375rem;
  --fs-h1: clamp(1.5rem, 1.2rem + 1.5vw, 2rem);
  --fs-h1-result: var(--fs-h1);
  --fs-h2: clamp(1.125rem, 1.05rem + 0.4vw, 1.25rem);
  --fs-h3: 1rem;
  --fs-verdict: clamp(1.375rem, 1.1rem + 1.3vw, 1.75rem);
  --fs-lede: clamp(1rem, 0.95rem + 0.25vw, 1.0625rem);
  --fs-brand: 1rem;
  --fs-legend: 1rem;
  --fs-label: 0.9375rem;
  --fs-small: 0.8125rem;
  --fs-xs: 0.8125rem;
  --fs-nav: 0.875rem;
  --fs-footer: 0.8125rem;
  --track-h1: -0.015em;
  --track-h: -0.01em;
  --track-brand: -0.01em;
  --lh-body: 1.47;
  --lh-h1: 1.15;
  --lh-h: 1.25;
  --eyebrow-size: 0.8125rem;
  --eyebrow-weight: 600;
  --eyebrow-track: 0;
  --eyebrow-case: none;
  --card-pad: clamp(20px, 3vw, 32px);
  --card-pad-sm: 20px;
  --main-pad-top: clamp(28px, 5vw, 56px);
  --section-pad: 20px;
  --section-gap: 24px;
  --label-gap: 18px;
  --label-gap-first: 18px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #000000;
    --surface: #1d1d1f;
    --surface-raised: #2c2c2e;
    --surface-muted: #3a3a3c;
    --ink: #f5f5f7;
    --muted: #aeaeb2;
    --line: #424245;
    --control-line: #86868b;
    --accent: #0071e3;
    --accent-strong: #5ab0ff;
    --accent-hover: #0066cc;
    --accent-ink: #ffffff;
    --button-ink: #ffffff;
    --danger: #ffb4aa;
    --danger-ink: #2a0a07;
    --danger-bg: #482c2a;
    --amber: #ffd27f;
    --amber-bg: #45351b;
    --slate: #d1d1d6;
    --slate-bg: #2c2c2e;
    --violet: #d7c8ee;
    --violet-bg: #3a3049;
    --info: #5ab0ff;
    --info-bg: #1b2f48;
    --focus: #2997ff;
    --shadow: 0 8px 30px rgb(0 0 0 / 60%);
    --header-bg: rgb(22 22 23 / 80%);
    --header-line: rgb(255 255 255 / 12%);
    --card-line: rgb(255 255 255 / 8%);
    --row-hover: rgb(255 255 255 / 5%);
    --ok: #8be0a4;
    --ok-bg: #1b3a28;
    --kpi-min: 160px;
    --nav-group-gap: 4px;
    --sticky-bar-bg: var(--header-bg);
    --sticky-bar-line: var(--header-line);
    --seg-on-bg: var(--info-bg);
    --seg-on-line: var(--accent-strong);
    --skeleton-bg: var(--surface-muted);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #000000;
  --surface: #1d1d1f;
  --surface-raised: #2c2c2e;
  --surface-muted: #3a3a3c;
  --ink: #f5f5f7;
  --muted: #aeaeb2;
  --line: #424245;
  --control-line: #86868b;
  --accent: #0071e3;
  --accent-strong: #5ab0ff;
  --accent-hover: #0066cc;
  --accent-ink: #ffffff;
  --button-ink: #ffffff;
  --danger: #ffb4aa;
  --danger-ink: #2a0a07;
  --danger-bg: #482c2a;
  --amber: #ffd27f;
  --amber-bg: #45351b;
  --slate: #d1d1d6;
  --slate-bg: #2c2c2e;
  --violet: #d7c8ee;
  --violet-bg: #3a3049;
  --info: #5ab0ff;
  --info-bg: #1b2f48;
  --focus: #2997ff;
  --shadow: 0 8px 30px rgb(0 0 0 / 60%);
  --header-bg: rgb(22 22 23 / 80%);
  --header-line: rgb(255 255 255 / 12%);
  --card-line: rgb(255 255 255 / 8%);
  --row-hover: rgb(255 255 255 / 5%);
  --ok: #8be0a4;
  --ok-bg: #1b3a28;
  --kpi-min: 160px;
  --nav-group-gap: 4px;
  --sticky-bar-bg: var(--header-bg);
  --sticky-bar-line: var(--header-line);
  --seg-on-bg: var(--info-bg);
  --seg-on-line: var(--accent-strong);
  --skeleton-bg: var(--surface-muted);
}

/* Console density (T14): the analyst console is a desktop work tool, so type, controls and
   rhythm are one step tighter than the public pages. Colour, radii, weights and the focus ring
   are the shared tokens above. */
body.admin {
  --fs-body: 0.875rem;
  --fs-control: 0.875rem;
  --fs-label: 0.8125rem;
  --fs-small: 0.8125rem;
  --fs-xs: 0.75rem;
  --fs-h1: clamp(1.25rem, 1.1rem + 0.7vw, 1.5rem);
  --fs-h2: 1.0625rem;
  --fs-h3: 0.9375rem;
  --fs-legend: 0.9375rem;
  --fs-brand: 0.9375rem;
  --lh-body: 1.45;
  --lh-h1: 1.2;
  --ctl-h: 36px;
  --ctl-pad: 6px 11px;
  --btn-pad: 6px 18px;
  --ctl-h-sm: 30px;
  --nav-h: 36px;
  --header-min: 52px;
  --card-pad: 18px;
  --card-pad-sm: 14px;
  --section-pad: 14px;
  --section-gap: 16px;
  --label-gap: 12px;
  --label-gap-first: 12px;
}

* { box-sizing: border-box; }
html { min-width: 320px; }
body { background: var(--bg); color: var(--ink); font-family: var(--font-sans); font-size: var(--fs-body); letter-spacing: -0.01em; line-height: var(--lh-body); margin: 0; min-height: 100vh; }
button, input, select, textarea { font-family: inherit; }
img, svg { max-width: 100%; }
a { color: var(--accent-strong); }
a:hover { text-decoration-thickness: 2px; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: var(--ring-w) solid var(--focus); outline-offset: var(--ring-off); }
[hidden] { display: none !important; }

/* Controls stay at 16px on phones and touch devices, including landscape (iOS zooms smaller ones);
   the desktop scale may go down to 15px (console: 14px). Touch targets are 44px there too. */
@media (max-width: 639.98px), (pointer: coarse) {
  body, body.admin { --fs-control: 1rem; --ctl-h: 44px; --ctl-h-sm: 44px; --nav-h: 44px; }
}

.container { margin: 0 auto; max-width: 1000px; padding-inline: 18px; width: 100%; }
.site-header { background: var(--header-bg); border-bottom: 1px solid var(--header-line); position: relative; z-index: 1; }
.header-inner { align-items: center; display: flex; gap: 16px; justify-content: space-between; min-height: var(--header-min); }
.header-actions, .admin-header-actions { align-items: center; display: flex; gap: 10px; }
.brand { align-items: center; color: var(--ink); display: inline-flex; font-size: var(--fs-brand); font-weight: var(--fw-strong); letter-spacing: var(--track-brand); min-height: 44px; text-decoration: none; }
.brand-mark { align-items: center; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); display: inline-flex; font-size: 0.7rem; font-weight: 800; height: 32px; justify-content: center; letter-spacing: 0.1em; width: 32px; }
.theme-toggle { align-items: center; background: var(--toggle-bg); border: 1px solid var(--toggle-line); border-radius: 999px; color: var(--ink); cursor: pointer; display: inline-flex; justify-content: center; min-height: 44px; min-width: 44px; padding: 9px; transition: background 160ms ease, border-color 160ms ease, transform 160ms ease; }
.theme-toggle:hover { background: var(--surface-muted); border-color: transparent; }
.theme-icon { height: 21px; width: 21px; }
html[data-theme="light"] .theme-icon--moon, html[data-theme="dark"] .theme-icon--sun { display: none; }

main.container { padding-bottom: 72px; padding-top: var(--main-pad-top); }
.site-footer { background: var(--footer-bg); border-top: 1px solid var(--line); color: var(--muted); font-size: var(--fs-footer); padding: 24px 0 36px; }
.site-footer p { margin: 0 0 6px; }
.hero { margin-bottom: 34px; max-width: 760px; position: relative; }
.hero::after { background: var(--accent); border-radius: 999px; content: ""; display: block; height: 4px; margin-top: 28px; opacity: 0.75; width: 58px; }
.hero h1, h1 { font-size: var(--fs-h1); font-weight: var(--fw-head); letter-spacing: var(--track-h1); line-height: var(--lh-h1); margin: 0 0 16px; }
.lede { color: var(--muted); font-size: var(--fs-lede); margin: 0; max-width: 52ch; }
.eyebrow { color: var(--muted); font-size: var(--eyebrow-size); font-weight: var(--eyebrow-weight); letter-spacing: var(--eyebrow-track); margin: 0 0 10px; text-transform: var(--eyebrow-case); }
h2, h3 { font-weight: var(--fw-head); letter-spacing: var(--track-h); line-height: var(--lh-h); }
h2 { font-size: var(--fs-h2); margin: 0 0 14px; }
h3 { font-size: var(--fs-h3); margin: 0 0 9px; }
p { overflow-wrap: anywhere; }

.card { background: var(--surface); border: 1px solid var(--card-line); border-radius: var(--radius-card); box-shadow: var(--shadow-small); padding: var(--card-pad); }
.intake-form { margin-bottom: 28px; max-width: 840px; }
fieldset { border: 0; border-top: 1px solid var(--line); margin: 0; padding: var(--section-pad) 0 0; }
fieldset:first-child { border-top: 0; padding-top: 0; }
fieldset + fieldset { margin-top: var(--section-gap); }
legend { font-size: var(--fs-legend); font-weight: var(--fw-strong); padding: 0 14px 0 0; }
label { display: block; font-size: var(--fs-label); font-weight: var(--fw-label); margin: var(--label-gap) 0 8px; }
fieldset label:first-of-type { margin-top: var(--label-gap-first); }
input, textarea, select, button { font: inherit; }
textarea, select, input:not([type]), input[type="url"], input[type="text"], input[type="number"], input[type="file"] { background: var(--surface-raised); border: 1px solid var(--control-line); border-radius: var(--radius-ctl); color: var(--ink); display: block; max-width: 100%; min-height: var(--ctl-h); padding: var(--ctl-pad); width: 100%; }
textarea, input, select { font-size: var(--fs-control); letter-spacing: 0; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }
textarea { min-height: 170px; resize: vertical; }
input[type="file"] { padding: 8px; }
body:not(.admin) input[type="file"] { color: var(--muted); padding: 7px; }
body:not(.admin) input[type="file"]::file-selector-button,
body:not(.admin) input[type="file"]::-webkit-file-upload-button {
  background: var(--surface-muted);
  border: 1px solid transparent;
  border-radius: 980px;
  color: var(--accent-strong);
  cursor: pointer;
  font: inherit;
  font-weight: 500;
  margin-inline-end: 10px;
  min-height: 44px;
  padding: 7px 16px;
}
body:not(.admin) input[type="file"]::file-selector-button:hover,
body:not(.admin) input[type="file"]::-webkit-file-upload-button:hover { background: var(--line); }
body:not(.admin) .file-input-status { color: var(--muted); display: block; font-size: var(--fs-small); margin-top: 6px; min-height: 1.3em; }
input[type="checkbox"] { accent-color: var(--accent); height: 1.25rem; margin: 2px 0 0; width: 1.25rem; }
.consent { border-top: 1px solid var(--line); margin-top: 16px; padding-top: 16px; }
.consent label { align-items: flex-start; display: flex; gap: 11px; margin: 0; }
.consent label span { flex: 1; }
.consent small { color: var(--muted); display: block; margin: 8px 0 0 2.05rem; }

.button, button { align-items: center; border: 1px solid transparent; border-radius: var(--radius-btn); cursor: pointer; display: inline-flex; font-weight: var(--fw-link-btn); justify-content: center; font-size: var(--fs-control); letter-spacing: 0; min-height: var(--ctl-h); padding: var(--btn-pad); text-decoration: none; }
.button--primary { background: var(--accent); color: var(--button-ink); margin-top: 26px; min-width: 150px; }
.button--primary:hover { background: var(--accent-hover); }
.button--secondary { background: transparent; border-color: var(--accent); color: var(--accent-strong); }
.button--secondary:hover { background: var(--surface-muted); }
.button--danger { background: var(--danger); color: var(--danger-ink); }
.button--danger:hover { filter: brightness(0.94); }

.notice, .error { border-left: 4px solid var(--amber); border-radius: var(--radius-row); margin: 18px 0; padding: 13px 16px; }
.notice { background: var(--amber-bg); }
.notice--system { border-left-color: var(--accent); }
.notice--demo { border-left-color: var(--violet); }
.notice--caveat { background: var(--slate-bg); border-left-color: var(--slate); }
.notice--fallback { margin: 12px 0 0; }
.error { background: var(--danger-bg); border-left-color: var(--danger); }
.error-box { align-items: flex-start; background: var(--danger-bg); border: 1px solid var(--danger); border-radius: var(--radius-row); color: var(--danger); display: flex; gap: 12px; margin: 18px 0; padding: 14px 16px; }
.error-box:focus { outline: var(--ring-w) solid var(--focus); outline-offset: var(--ring-off); }
.error-box-icon { flex: 0 0 24px; height: 24px; margin-top: 1px; width: 24px; }
.error-box-copy { min-width: 0; }
.error-box-copy p { margin: 0; }
.error-box-copy p + p { margin-top: 4px; }
.error-box a { align-items: center; color: var(--danger); display: inline-flex; font-weight: var(--fw-strong); min-height: 44px; }
.error-card { border-color: var(--danger); }
.notices { color: var(--muted); font-size: var(--fs-small); max-width: 840px; padding-left: 22px; }
body:not(.admin) .file-preview { color: var(--muted); display: grid; font-size: var(--fs-small); gap: 14px; grid-template-columns: repeat(auto-fill, minmax(135px, 1fr)); margin-top: 12px; }
body:not(.admin) .file-preview:empty { display: none; }
.dropzone { border: 2px dashed var(--control-line); border-radius: 14px; color: var(--muted); display: grid; gap: 4px; margin-top: 12px; padding: 16px; text-align: center; transition: background 160ms ease, border-color 160ms ease, color 160ms ease; }
.dropzone strong { color: var(--ink); font-weight: var(--fw-strong); }
.dropzone:hover, .dropzone:focus-visible, .dropzone.is-dragover { background: var(--surface-muted); border-color: var(--accent); color: var(--ink); }
.paste-hint, .dropzone-hint--touch, .dropzone-limits { font-size: var(--fs-small); }
.dropzone-hint--touch { display: none; }
.dropzone-feedback { color: var(--danger); display: block; font-size: var(--fs-small); min-height: 1.3em; }
.dropzone-feedback[data-feedback-type="attached"] { color: var(--muted); }
body:not(.admin) .file-preview-item { background: var(--surface-raised); border: 1px solid var(--line); border-radius: var(--radius-row); display: flex; flex-direction: column; min-width: 0; overflow: hidden; }
body:not(.admin) .file-preview-media { align-items: center; background: var(--surface-muted); display: flex; height: 160px; justify-content: center; min-height: 160px; overflow: hidden; }
body:not(.admin) .file-preview-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body:not(.admin) .file-preview-meta { align-items: center; display: flex; gap: 6px; min-width: 0; padding: 7px; }
body:not(.admin) .file-preview-remove { background: transparent; border: 1px solid var(--control-line); color: var(--accent-strong); flex: 0 0 auto; min-height: 44px; min-width: 44px; padding: 6px 12px; white-space: nowrap; }
body:not(.admin) .file-preview-remove:hover { background: var(--surface-muted); }
body:not(.admin) .file-preview img { display: block; height: auto; max-height: 100%; max-width: 100%; object-fit: contain; width: auto; }

.samples { margin: 56px 0 32px; }
.section-heading { margin-bottom: 18px; }
.section-heading p { color: var(--muted); margin: 0; }
.sample-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.sample-card { background: var(--surface); border: 1px solid var(--card-line); border-radius: var(--radius-row); display: block; min-width: 0; padding: 18px; text-align: left; transition: border-color 160ms ease, transform 160ms ease; }
body:not(.admin) .sample-card { border-radius: var(--radius-card); padding: 22px; }
a.sample-card { text-decoration: none; }
.sample-card:hover { border-color: var(--accent); transform: translateY(-2px); }
body:not(.admin) .sample-card:hover { transform: none; }
.sample-card .button { min-width: 0; width: 100%; }
.sample-prefill { background: var(--surface-muted); border-radius: 10px; max-width: 840px; padding: 11px 14px; }
body:not(.admin) .sample-prefill { border-radius: var(--radius-row); }
.samples-form { margin: 0; }
.cf-turnstile, .kd-turnstile { margin: 15px 0; min-height: 65px; }

.result-heading { margin-bottom: 28px; max-width: 820px; }
.result-heading h1 { font-size: var(--fs-h1-result); }
.progress-card, .verdict-card, .error-card, .delete-box { max-width: 820px; }
.progress-card { margin-bottom: 22px; }
.progress-header h2 { margin-bottom: 22px; }
.progress-list { list-style: none; margin: 0; padding: 0; }
.progress-step { align-items: center; color: var(--muted); display: flex; gap: 12px; padding: 10px 0; }
.progress-step.is-current { color: var(--ink); font-weight: var(--fw-strong); }
.progress-step.is-done { color: var(--ok); }
.progress-marker { align-items: center; border: 1px solid currentColor; border-radius: 999px; display: inline-flex; flex: 0 0 30px; font-size: 0.8rem; height: 30px; justify-content: center; }
.progress-step.is-current .progress-marker { border-color: var(--accent-strong); }
.progress-spinner { border: 2px solid var(--line); border-radius: 50%; border-top-color: var(--accent-strong); display: block; height: 16px; width: 16px; }
.progress-skeleton { display: grid; gap: 10px; margin-top: 18px; }
.skeleton-row { background: var(--skeleton-bg); border-radius: var(--radius-pill); display: block; height: 14px; width: 85%; }
.skeleton-row--wide { width: 100%; }
.skeleton-row--short { width: 55%; }
.progress-card .muted { margin: 14px 0 0; }
@media (prefers-reduced-motion: no-preference) {
  .progress-spinner { animation: kd-spin 0.9s linear infinite; }
  .skeleton-row { animation: kd-pulse 1.6s ease-in-out infinite; }
}
@keyframes kd-spin { to { transform: rotate(360deg); } }
@keyframes kd-pulse { 50% { opacity: 0.55; } }
.muted { color: var(--muted); }
.error-copy { color: var(--muted); margin-bottom: 0; }
.verdict-card { align-items: flex-start; border-left-style: solid; border-left-width: var(--verdict-bar-light); display: flex; gap: 17px; margin-bottom: 18px; }
.verdict-card h2 { font-size: var(--fs-verdict); margin-bottom: 9px; }
.verdict-icon { flex: 0 0 var(--verdict-icon-size); }
.verdict-icon svg { display: block; height: var(--verdict-icon-size); width: var(--verdict-icon-size); }
.verdict-copy { color: var(--ink); min-width: 0; }
.verdict--red { background: var(--danger-bg); border-color: var(--danger); border-left-width: var(--verdict-bar-strong); }
.verdict--red .verdict-icon { color: var(--danger); }
.verdict--amber { background: var(--amber-bg); border-color: var(--amber); border-left-width: var(--verdict-bar-medium); }
.verdict--amber .verdict-icon { color: var(--amber); }
.verdict--slate { background: var(--slate-bg); border-color: var(--slate); }
.verdict--slate .verdict-icon { color: var(--slate); }
.verdict--violet, .verdict--violet-grey { background: var(--violet-bg); border-color: var(--violet); border-style: dashed; }
.verdict--violet .verdict-icon, .verdict--violet-grey .verdict-icon { color: var(--violet); }
.scam-type { margin-bottom: 3px; }
.scam-type-description { color: var(--muted); margin-bottom: 0; }
.verdict-reason { display: -webkit-box; font-size: var(--fs-small); margin: 0 0 8px; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.mode-line { color: var(--muted); font-size: var(--fs-small); margin-bottom: 0; }

.failed-card { align-items: flex-start; display: flex; gap: 14px; margin-bottom: 18px; }
.failed-icon { color: var(--muted); flex: 0 0 var(--verdict-icon-size); }
.failed-icon svg { display: block; height: var(--verdict-icon-size); width: var(--verdict-icon-size); }
.failed-copy { min-width: 0; }
.failed-copy h2 { margin-bottom: 8px; }
.failed-copy .button--primary { margin-top: 4px; }

.result-section { margin: 44px 0; max-width: 820px; }
.reasons { list-style: none; margin: 0; padding: 0; }
.reason { display: flex; gap: 13px; padding: 16px 0; }
.reason + .reason { border-top: 1px solid var(--line); }
.reason-number { align-items: center; background: var(--accent); border-radius: 999px; color: var(--accent-ink); display: flex; flex: 0 0 30px; font-weight: var(--fw-strong); height: 30px; justify-content: center; }
.reason-body { min-width: 0; }
.reason-body p { margin: 0 0 9px; }
.evidence-chip, .tag { align-items: center; border: 1px solid var(--line); border-radius: 999px; display: inline-flex; font-size: var(--fs-small); min-height: var(--ctl-h-sm); padding: 4px 12px; }
.evidence-chip { color: var(--accent-strong); }
blockquote { border-left: 3px solid var(--accent); color: var(--muted); margin: 11px 0 0; padding: 5px 13px; }
.evidence-images { display: grid; gap: 20px; }
.evidence-image { margin: 0; scroll-margin-top: 20px; }
.evidence-image svg { background: var(--surface-muted); border: 1px solid var(--line); border-radius: 10px; display: block; height: auto; max-height: 620px; width: 100%; }
.evidence-image figcaption { color: var(--muted); font-size: var(--fs-small); margin-top: 7px; }
.evidence-badge { fill: var(--danger); font-size: 16px; font-weight: 800; }
.plain-list, .advice-list, .reporting-list, .policy-list { padding-left: 22px; }
.plain-list li, .policy-list li, .reporting-list li { margin: 12px 0; }
.plain-list span, .reporting-list span, .policy-list span { color: var(--muted); display: block; }
.chip-list { display: flex; flex-wrap: wrap; gap: 8px; }
.tag { background: var(--surface-muted); }
.advice-list li { margin: 11px 0; }
.reporting-list a { display: inline-flex; margin-top: 5px; min-height: 44px; }
.delete-box { margin-top: 48px; }
.delete-box p:last-child { margin-bottom: 0; }
.delete-link { margin-top: 2px; }
.reference { color: var(--muted); font-size: var(--fs-small); }
.result-disclosure { background: var(--surface-raised); border: 1px solid var(--line); border-radius: var(--radius-row); padding: 0 var(--section-pad) var(--section-pad); scroll-margin-top: 20px; }
.result-disclosure > summary { align-items: center; cursor: pointer; display: flex; list-style: none; min-height: 64px; outline: none; }
  .result-disclosure > summary::after { color: var(--muted); content: "＋" / ""; font-size: 1.25rem; margin-left: auto; padding-left: 14px; }
  .result-disclosure[open] > summary::after { content: "−" / ""; }
.result-disclosure > summary:focus-visible { border-radius: var(--radius-row); outline: var(--ring-w) solid var(--focus); outline-offset: calc(-1 * var(--ring-off)); }
.result-disclosure[open] > summary { border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.disclosure-heading { display: block; min-width: 0; }
.disclosure-heading .eyebrow { margin-bottom: 3px; }
.disclosure-title { display: block; font-size: var(--fs-h2); font-weight: var(--fw-head); letter-spacing: var(--track-h); line-height: var(--lh-h); margin: 0 0 14px; }
.action-card { background: var(--surface-raised); border: 1px solid var(--line); border-radius: var(--radius-row); margin: 20px 0 30px; padding: var(--section-pad); }
.action-card h2 { margin-bottom: 12px; }
.action-card .advice-list { padding-left: 22px; }
.action-card .advice-list li { padding: 10px 13px; }
.action-home { margin: 0 0 14px; }
.action-calls { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.action-calls .button--primary { margin-top: 0; min-width: 0; }
.action-secondary { align-items: center; display: inline-flex; font-size: var(--fs-small); min-height: 44px; margin-top: 8px; }
.privacy-footer { align-items: center; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 8px 16px; margin: 18px 0 0; max-width: 820px; padding-top: 12px; }
.privacy-footer .button { margin-top: 0; }
.privacy-footer .reference { margin: 0; }
.reason-quote { margin-top: 10px; }
.reason-quote > summary { align-items: center; color: var(--accent-strong); cursor: pointer; display: inline-flex; list-style: none; min-height: 44px; padding: 4px 0; text-decoration: underline; text-underline-offset: 4px; }
.reason-quote > summary:focus-visible { border-radius: var(--radius-ctl); outline: var(--ring-w) solid var(--focus); outline-offset: var(--ring-off); }
.empty-state { margin: 24px auto 0; max-width: 620px; text-align: center; }
.standalone-page { padding-top: clamp(40px, 10vw, 96px) !important; }

/* Analyst console (T14). Same tokens and components as the public pages; only the density
   tokens in "Console density" differ. Chips, tables, sections and forms below are shared by
   every admin template. */
.admin-container { margin: 0 auto; max-width: 1280px; padding-inline: 18px; width: 100%; }
.admin-main { padding-bottom: 48px; padding-top: 20px; }
.admin-header { flex-wrap: wrap; gap: 0 12px; }
.admin .site-nav { margin-left: auto; position: relative; }
.admin-nav .nav-links { display: none; flex-wrap: nowrap; gap: 2px; }
.admin-nav .nav-links a { padding: 6px 11px; white-space: nowrap; }
.admin-nav .nav-menu { display: block; }
.admin-user { align-items: center; color: var(--muted); display: inline-flex; flex-wrap: wrap; font-size: var(--fs-small); gap: 4px 6px; letter-spacing: 0; overflow-wrap: anywhere; }
.admin-header-actions { align-items: center; display: flex; gap: 10px; }
.admin-title { margin: 0 0 12px; }
.admin-title .muted { font-weight: 400; margin-left: 4px; }
.admin-lede { color: var(--muted); font-size: var(--fs-small); margin: -4px 0 14px; max-width: 90ch; }
.admin-main h2 { margin: 22px 0 10px; }
.admin-main h3 { margin: 16px 0 6px; }
.admin-main ul, .admin-main ol { margin: 8px 0; padding-left: 20px; }
.admin-main li { margin: 4px 0; }
.admin-main li > form { margin-left: 6px; }
.admin-main code { background: var(--surface-muted); border-radius: 6px; font-size: 0.92em; overflow-wrap: anywhere; padding: 1px 5px; }
.admin-main .notice, .admin-main .error { margin: 12px 0; }
.admin-main strong.notice { border-left-width: 3px; border-radius: var(--radius-pill); display: inline-block; font-weight: var(--fw-strong); margin: 0 0 0 6px; padding: 1px 10px; }

.admin-section, .admin-main .result-block, .admin-card { background: var(--surface); border: 1px solid var(--card-line); border-radius: var(--radius-card); box-shadow: var(--shadow-small); margin: 14px 0; max-width: none; padding: var(--card-pad); }
.admin-section > h2:first-child, .admin-main .result-block > h2:first-child, .admin-card > h2:first-child { align-items: center; display: flex; flex-wrap: wrap; gap: 6px 8px; margin: 0 0 10px; }
.admin-section > :last-child, .admin-main .result-block > :last-child, .admin-card > :last-child { margin-bottom: 0; }
.admin-main .result-block p { margin: 6px 0; }
.admin-section-note { color: var(--muted); font-size: var(--fs-small); margin: -4px 0 10px; }
.admin-main .plain-list { padding-left: 20px; }
.admin-main .plain-list li { margin: 6px 0; }

.lane-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; }
.lane-tabs a { align-items: center; background: var(--surface); border-radius: var(--radius-pill); color: var(--ink); display: inline-flex; font-size: var(--fs-nav); gap: 8px; letter-spacing: 0; min-height: var(--nav-h); padding: 4px 14px; text-decoration: none; }
.lane-tabs a:hover { background: var(--surface-muted); }
.lane-tabs a[aria-current="page"] { background: var(--accent); color: var(--accent-ink); font-weight: 500; }

.filters { align-items: flex-end; background: var(--surface); border: 1px solid var(--card-line); border-radius: var(--radius-row); display: flex; flex-wrap: wrap; gap: 8px 14px; margin: 0 0 14px; padding: 12px 14px; }
.filters label, .disposition-form label, .admin-card label { color: var(--muted); font-size: var(--fs-small); margin: 0; }
.filters label { display: grid; gap: 4px; }
.filters select, .filters input[type="text"] { min-width: 0; }
.filters .inline { align-items: center; display: flex; gap: 8px; min-height: var(--ctl-h); }
.filters .button { margin: 0; }
.filter-toolbar { align-items: flex-start; display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.filter-disclosure { background: var(--surface); border: 1px solid var(--card-line); border-radius: var(--radius-row); flex: 0 1 auto; min-width: min(100%, 170px); }
.filter-disclosure summary { align-items: center; cursor: pointer; display: flex; font-size: var(--fs-small); font-weight: var(--fw-label); min-height: var(--ctl-h); padding: 6px 14px; }
.filter-disclosure > summary:focus-visible { outline: var(--ring-w) solid var(--focus); outline-offset: var(--ring-off); }
.filter-disclosure > .filters { border: 0; border-top: 1px solid var(--line); border-radius: 0 0 var(--radius-row) var(--radius-row); margin: 0; }
@media (max-width: 639.98px) { .filter-disclosure { flex-basis: 100%; width: 100%; } }
.filter-pill { gap: 4px; max-width: 100%; min-width: 0; }
.filter-pill > span { min-width: 0; overflow-wrap: anywhere; }
.filter-pill > a { align-items: center; border-radius: var(--radius-pill); color: inherit; display: inline-flex; flex: none; font-size: 1.1em; justify-content: center; line-height: 1; min-height: var(--ctl-h); min-width: var(--ctl-h); text-decoration: none; }
.filter-pill > a:hover { background: var(--surface-raised); }
.filter-clear { align-items: center; display: inline-flex; min-height: var(--ctl-h); white-space: nowrap; }
label.inline { align-items: center; display: flex; gap: 8px; }
.inline-form { align-items: center; display: inline-flex; flex-wrap: wrap; gap: 6px; margin: 0; }
.disposition-form, .admin-card-form { background: var(--surface); border: 1px solid var(--card-line); border-radius: var(--radius-card); display: grid; gap: 12px 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); margin: 10px 0 14px; max-width: 960px; padding: var(--card-pad); }
.disposition-form > label, .bulk > label, .admin-card-form > label { display: grid; gap: 4px; margin: 0; }
.disposition-form > label.inline, .bulk > label.inline, .admin-card-form > label.inline { display: flex; }
.disposition-form .button, .bulk .button, .admin-card-form .button, .disposition-form > label.inline, .bulk > label.inline, .disposition-form > label:has(textarea), .admin-card-form > .form-actions { grid-column: 1 / -1; }
.disposition-form .button, .bulk .button, .admin-card-form .button { justify-self: start; }
.admin-main .button--primary { margin-top: 0; min-width: 0; }
.admin-main select { padding-right: 8px; }
.admin-main textarea { min-height: 84px; }
.admin-main fieldset { border: 0; margin: 0; padding: 0; }
.admin-main fieldset > legend { margin-bottom: 10px; }
.admin-main fieldset.bulk { backdrop-filter: blur(12px); background: var(--sticky-bar-bg); border: 0; border-radius: var(--radius-card); border-top: 1px solid var(--sticky-bar-line); box-shadow: inset 0 0 0 1px var(--card-line); bottom: 0; display: grid; gap: 12px 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); margin-top: 14px; max-width: 960px; padding: var(--card-pad); position: sticky; z-index: 4; }
.admin-main fieldset.bulk > legend { float: left; grid-column: 1 / -1; margin: 0; padding: 0; width: 100%; }
.admin-main .bulk-wrap:has(> fieldset.bulk:not([hidden])) { backdrop-filter: blur(12px); background: var(--sticky-bar-bg); border: 0; border-radius: var(--radius-card); border-top: 1px solid var(--sticky-bar-line); box-shadow: inset 0 0 0 1px var(--card-line); bottom: 0; margin-top: 14px; max-width: 960px; padding: var(--card-pad); position: sticky; z-index: 4; }
.admin-main .bulk-wrap > .bulk-status:not(.visually-hidden) { margin-bottom: 8px; }
.admin-main .bulk-wrap > fieldset.bulk { background: transparent; border: 0; border-radius: 0; box-shadow: none; margin-top: 0; max-width: none; padding: 0; position: static; z-index: auto; }
.bulk-status { color: var(--muted); grid-column: 1 / -1; margin: 0; }
.bulk .bulk-select-all { grid-column: auto; justify-self: start; }
.bulk-submit { grid-column: 1 / -1; }
.admin-ai-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); margin: 0 0 12px; }
.admin-ai-model { background: var(--surface); border: 1px solid var(--card-line); border-radius: var(--radius-card); display: grid; margin: 0; padding: var(--card-pad); }
.admin-ai-model fieldset { display: grid; gap: 12px; }
.admin-ai-model label { color: var(--muted); display: grid; font-size: var(--fs-small); gap: 4px; margin: 0; }
.admin-ai-model label:has(> input[type="checkbox"]) { align-items: center; display: flex; gap: 8px; }
.admin-ai-model p { margin: 0; }
.admin-ai-model .button { justify-self: start; }
.admin-main input[type="number"] { max-width: 16rem; }
.admin-section .disposition-form, .admin-card .disposition-form { background: transparent; border: 0; box-shadow: none; margin: 0; padding: 0; }
.admin-card--danger { border-color: var(--danger); }
.chip-row { align-items: center; display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; }
.kit-steps { list-style: none; margin: 10px 0 0; padding: 0; }
.kit-steps > li { background: var(--surface-raised); border: 1px solid var(--line); border-radius: var(--radius-row); margin: 0 0 10px; padding: 12px 14px; }
.kit-steps h3 { margin: 0 0 6px; }
.admin-main .token-list { list-style: none; padding: 0; }
.token-list li { align-items: center; display: flex; flex-wrap: wrap; gap: 6px 10px; margin: 6px 0; }
.admin-ai-model input:not([type="checkbox"]):not([type="number"]) { width: 100%; }

.button--small { background: var(--surface-muted); color: var(--ink); font-size: var(--fs-small); min-height: var(--ctl-h-sm); padding: 3px 12px; }
.button--small:hover { background: var(--line); }
.admin-main .button--danger { margin-top: 0; }
.actions { align-items: center; display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 0; }
.actions form { margin: 0; }
.actions .button--danger { margin-left: auto; }
.form-actions { align-items: center; display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }

.table-wrap { background: var(--surface-raised); border: 1px solid var(--line); border-radius: var(--radius-row); margin: 8px 0 12px; max-width: 100%; overflow-x: auto; width: 100%; }
.admin-section > .table-wrap, .admin-card > .table-wrap { margin-top: 4px; }
.admin-table { border-collapse: collapse; font-size: var(--fs-small); letter-spacing: 0; width: 100%; }
.admin-table th, .admin-table td { border-bottom: 1px solid var(--line); padding: 7px 10px; text-align: left; vertical-align: top; }
.admin-table th { background: var(--surface); color: var(--muted); font-size: var(--fs-xs); font-weight: var(--fw-strong); white-space: nowrap; }
.admin-table tbody tr:last-child > td { border-bottom: 0; }
.admin-table tbody tr:hover > td { background: var(--row-hover); }
.admin-table .num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.admin-table .empty-row { color: var(--muted); padding: 18px 10px; text-align: center; }
.admin-table input[type="checkbox"] { margin: 0; }
.admin-table td form { margin: 0; }
.admin-table .inline-form { flex-wrap: nowrap; }
.inbox-table { min-width: 760px; }
.inbox-table .inbox-select-col { width: 36px; }
.inbox-table input[name="ids"][type="checkbox"] { height: var(--ctl-h); min-height: var(--ctl-h); min-width: var(--ctl-h); width: var(--ctl-h); }
.inbox-table .stacked-cell { display: grid; gap: 2px; }
.inbox-table .stacked-cell .muted { font-size: var(--fs-xs); }
.inbox-table .row-meta { display: flex; flex-wrap: wrap; font-size: var(--fs-xs); gap: 2px 6px; margin-top: 4px; }
.inbox-table .header-sub { color: var(--muted); display: block; font-size: var(--fs-xs); font-weight: 400; }
.inbox-table .row-weight { color: var(--muted); display: block; font-size: var(--fs-xs); margin-top: 3px; }
.inbox-table .sla-cell { min-width: 112px; }
.inbox-table tbody tr:has(input[name="ids"]:checked) > td { background: var(--info-bg); }
.inbox-table tbody tr.is-focused > td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
@media (max-width: 639.98px) {
  .inbox-table.inbox-table--empty { min-width: 0; width: 100%; }
  .inbox-table.inbox-table--empty thead { clip: rect(0 0 0 0); clip-path: inset(50%); height: 1px; overflow: hidden; position: absolute; white-space: nowrap; width: 1px; }
}
.sla-badge { gap: 4px; }
.badge.sla-badge--quiet { background: var(--surface-muted); color: var(--muted); }
.sla-icon { flex: none; height: 1em; width: 1em; }
.empty-row > strong, .empty-row > .empty-row-detail { display: block; }
.empty-row > strong { color: var(--ink); }
.empty-row-detail { margin-top: 4px; overflow-wrap: anywhere; }
.empty-row-action { display: inline-flex; margin-top: 8px; min-height: var(--nav-h); }
.title-cell { min-width: 18ch; max-width: 32ch; overflow-wrap: anywhere; }
.nowrap { white-space: nowrap; }
.admin-pager { align-items: center; color: var(--muted); display: flex; flex-wrap: wrap; font-size: var(--fs-small); gap: 4px 14px; margin: 0 0 14px; }
.admin-pager a { align-items: center; display: inline-flex; min-height: var(--nav-h); }
.empty-note { background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius-row); color: var(--muted); margin: 8px 0; padding: 18px; text-align: center; }

.badge { align-items: center; background: var(--slate-bg); border: 1px solid color-mix(in srgb, currentColor 16%, transparent); border-radius: var(--radius-pill); color: var(--slate); display: inline-flex; font-size: var(--fs-xs); font-weight: var(--fw-strong); letter-spacing: 0; line-height: 1.3; padding: 1px 9px; vertical-align: middle; white-space: nowrap; }
.badge--red, .badge--overdue, .sev--critical, .sev--high { background: var(--danger-bg); color: var(--danger); }
.badge--amber, .sev--medium { background: var(--amber-bg); color: var(--amber); }
.badge--slate, .sev--low, .sev--info { background: var(--slate-bg); color: var(--slate); }
.badge--violet, .badge--mode { background: var(--violet-bg); color: var(--violet); }
.badge--info { background: var(--info-bg); color: var(--info); }
.badge--plain { background: transparent; color: var(--muted); }
.lane-tabs .badge { background: var(--surface-raised); color: var(--ink); }

.report-head { margin: 0 0 14px; }
.report-head .admin-title { margin-bottom: 4px; }
.report-head .admin-title .ref { white-space: nowrap; }
.report-title { color: var(--muted); font-size: var(--fs-body); margin: 0 0 12px; overflow-wrap: anywhere; }
.report-key { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); margin: 0 0 4px; }
.report-key > div { background: var(--surface-raised); border: 1px solid var(--line); border-radius: var(--radius-row); min-width: 0; padding: 9px 12px; }
.report-key dt { color: var(--muted); font-size: var(--fs-xs); font-weight: var(--fw-label); }
.report-key dd { font-size: var(--fs-body); font-weight: var(--fw-strong); margin: 3px 0 0; overflow-wrap: anywhere; }
.report-key dd .muted { font-weight: 400; }
.facts { display: grid; gap: 8px 22px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); margin: 12px 0 0; }
.facts dt { color: var(--muted); font-size: var(--fs-xs); font-weight: var(--fw-label); }
.facts dd { margin: 1px 0 0; overflow-wrap: anywhere; }
.facts > div { min-width: 0; }
.admin-dl { display: grid; gap: 4px 16px; grid-template-columns: max-content minmax(0, 1fr); margin: 8px 0 14px; }
.admin-dl dt { color: var(--muted); font-size: var(--fs-small); }
.admin-dl dd { margin: 0; overflow-wrap: anywhere; }
.content-box { background: var(--surface-raised); border: 1px solid var(--line); border-radius: var(--radius-row); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: var(--fs-small); letter-spacing: 0; max-height: 420px; overflow: auto; overflow-wrap: anywhere; padding: 10px 12px; white-space: pre-wrap; }
.image-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 190px), 1fr)); }
.image-grid img { border: 1px solid var(--line); display: block; height: auto; max-width: 100%; }
.image-grid figure { margin: 0; }
.admin-main .image-grid img { border-radius: 10px; }
.admin-main .image-grid figcaption { margin-top: 5px; }
.email-preview { background: var(--surface-raised); border: 1px solid var(--line); border-radius: var(--radius-row); height: 420px; width: 100%; }
.admin-main details { margin: 8px 0; }
.admin-main details > summary { align-items: center; color: var(--accent-strong); cursor: pointer; display: flex; min-height: var(--ctl-h-sm); }
.admin-main details[open] > summary { margin-bottom: 6px; }
.visually-hidden { clip: rect(0 0 0 0); clip-path: inset(50%); height: 1px; overflow: hidden; position: absolute; white-space: nowrap; width: 1px; }
.site-footer a { align-items: center; display: inline-flex; min-height: 44px; }

@media (min-width: 1100px) {
  .admin-nav .nav-links { display: flex; }
  .admin-nav .nav-menu { display: none; }
}
@media (max-width: 639.98px) {
  .admin-header { align-items: flex-start; padding-block: 4px; }
  .admin-header .brand, .admin-header-actions { align-items: center; align-self: flex-start; display: flex; min-height: var(--nav-h); }
  .admin-user { flex-basis: 100%; order: 9; padding: 0 0 6px; }
  .admin-nav .nav-menu-list { margin-top: 6px; min-width: 0; position: static; }
  .admin-main .button--primary { width: auto; }
  .filters { padding: 10px 12px; }
  .filters label { flex: 1 1 calc(50% - 7px); min-width: 0; }
  .filters label:has(> input[type="text"]), .filters .button { flex-basis: 100%; }
  .filters select, .filters input[type="text"] { width: 100%; }
  .filters .button { justify-content: center; }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .facts > .wide { grid-column: 1 / -1; }
  .report-key { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .actions .button--danger { margin-left: 0; }
  .admin-dl { grid-template-columns: minmax(0, 1fr); }
}

@media (hover: none) {
  .paste-hint { display: none; }
  .dropzone-hint--touch { display: block; }
}

  @media (min-width: 760px) {
  .container { padding-inline: 26px; }
  .hero { margin-bottom: 42px; }
  .sample-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .trust-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .verdict-card { padding: 30px; }
}

@media (max-width: 480px) {
  .header-inner { min-height: var(--header-min); }
  main.container { padding-top: var(--main-pad-top); }
  .card { border-radius: var(--radius-card); padding: var(--card-pad-sm); }
  body:not(.admin) .file-preview-media { height: 140px; min-height: 140px; }
  .verdict-card { gap: 12px; }
  .verdict-icon { flex-basis: var(--verdict-icon-size); }
  .verdict-icon svg { height: var(--verdict-icon-size); width: var(--verdict-icon-size); }
  .button--primary { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0.01ms !important; }
}

/* T05F: public navigation, home, samples and result layout. Admin pages use admin_base.html and are not affected. */
.skip-link { background: var(--surface); border: 2px solid var(--focus); border-radius: 0 0 11px 0; color: var(--ink); font-weight: var(--fw-strong); left: 0; padding: 12px 16px; position: absolute; top: 0; transform: translateY(-120%); z-index: 20; }
.skip-link:focus { transform: none; }
main:focus { outline: none; }

.site-nav { align-items: center; display: flex; margin-left: auto; }
.nav-links, .nav-menu-list, .footer-links { list-style: none; margin: 0; padding: 0; }
.nav-links { display: flex; gap: 4px; }
.nav-links a, .nav-menu-list a, .footer-links a { align-items: center; border-radius: 980px; color: var(--ink); display: inline-flex; font-size: var(--fs-nav); font-weight: var(--fw-nav); letter-spacing: 0; min-height: var(--nav-h); padding: 8px 12px; text-decoration: none; }
.nav-links a:hover, .nav-menu-list a:hover, .footer-links a:hover { background: var(--surface-muted); }
.nav-links a[aria-current="page"], .nav-menu-list a[aria-current="page"], .footer-links a[aria-current="page"] { color: var(--ink); font-weight: 500; text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 6px; }
.nav-menu { display: none; position: relative; }
.nav-menu summary, .add-row summary, .more summary { cursor: pointer; list-style: none; }
.nav-menu summary::-webkit-details-marker, .add-row summary::-webkit-details-marker, .more summary::-webkit-details-marker, .result-disclosure summary::-webkit-details-marker, .reason-quote summary::-webkit-details-marker { display: none; }
.nav-menu-toggle { align-items: center; background: var(--surface); border: 1px solid transparent; border-radius: 980px; color: var(--ink); display: inline-flex; font-size: var(--fs-nav); font-weight: 500; gap: 8px; min-height: var(--nav-h); padding: 8px 16px; }
.nav-menu-toggle:hover { background: var(--surface-muted); }
.nav-menu-toggle:focus-visible, .more summary:focus-visible { outline: var(--ring-w) solid var(--focus); outline-offset: var(--ring-off); }
.nav-menu-icon { flex: 0 0 20px; height: 20px; width: 20px; }
.nav-menu-list { background: var(--surface-raised); border: 1px solid var(--card-line); border-radius: var(--radius-row); box-shadow: var(--shadow); min-width: 220px; padding: 6px; position: absolute; right: 0; top: calc(100% + 8px); z-index: 10; }
.nav-menu-list a { display: flex; }
.header-actions { align-items: center; display: flex; gap: 8px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 2px 8px; margin: 0 0 8px -12px; }
.footer-links a { color: var(--accent-strong); }

@media (max-width: 639px) {
  .nav-links { display: none; }
  .nav-menu { display: block; }
}

/* Home */
.home-layout { display: grid; gap: 8px; }
.home-hero { margin-bottom: 20px; max-width: none; }
.home-hero::after { display: none; }
.input-kinds { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 18px 0 0; padding: 0; }
.input-kinds li { background: var(--surface-muted); border: 1px solid var(--line); border-radius: 999px; color: var(--ink); font-size: var(--fs-small); font-weight: var(--fw-label); padding: 5px 13px; }
body:not(.admin) .input-kinds li { background: var(--surface); border-color: transparent; }
.home-main { min-width: 0; }
.home-main .intake-form { margin-bottom: 18px; max-width: none; }
.check-input textarea { min-height: 150px; resize: vertical; }
body:not(.admin) .check-input > label:first-of-type { font-size: var(--fs-body); }
.add-rows-label { font-size: var(--fs-body); font-weight: var(--fw-label); margin: var(--label-gap) 0 8px; }
/* Segmented selector (C2): native <details> kept so the paste/drop script can open the images pane.
   Closed segments share one row; an open segment takes the full width and shows its pane. */
.add-rows { display: flex; flex-wrap: wrap; gap: var(--seg-gap); }
.add-row { background: var(--surface-raised); border: 1px solid var(--control-line); border-radius: var(--radius-row); flex: 0 1 calc((100% - 2 * var(--seg-gap)) / 3); min-width: 0; }
.add-row[open] { background: var(--seg-on-bg); border-color: var(--seg-on-line); box-shadow: 0 0 0 1px var(--seg-on-line); flex-basis: 100%; }
.add-row summary { align-items: center; border-radius: var(--radius-row); color: var(--ink); display: flex; flex-wrap: wrap; font-weight: var(--fw-label); gap: 2px 8px; justify-content: center; min-height: 48px; padding: 6px 10px; text-align: center; }
.add-row summary:hover { background: var(--surface-muted); }
.add-row[open] > summary { border-bottom: 1px solid var(--seg-on-line); border-bottom-left-radius: 0; border-bottom-right-radius: 0; justify-content: flex-start; text-align: left; }
.add-row[open] > summary:hover { background: transparent; }
.add-row-mark { color: var(--accent-strong); font-weight: var(--fw-strong); line-height: 1; }
.add-row-mark::before { content: "＋"; font-size: 1.15rem; }
.add-row[open] .add-row-mark::before { content: "✓"; }
.add-row-badge { background: var(--surface-muted); border: 1px solid var(--line); border-radius: var(--radius-pill); color: var(--ink); font-size: var(--fs-small); font-weight: var(--fw-label); padding: 0 9px; }
.add-row-badge[hidden] { display: none; }
.add-row-body { padding: 4px 14px 16px; }
.field-hint { color: var(--muted); font-size: var(--fs-small); margin: 10px 0 0; }
@media (max-width: 339.98px) {
  .add-row { flex-basis: 100%; }
}
body:not(.admin) fieldset .add-row-body label { font-size: var(--fs-body); margin: 14px 0 7px; }
/* Focus ring for the collapsible rows: one ring that follows the row's border radius and is
   shown for keyboard focus only (:focus-visible never matches after a mouse click on a summary).
   Browsers with :has() draw it on the row itself (recoloured border plus 1px spread, no gap);
   others fall back to an inset outline on the summary. */
.add-row summary:focus { outline: none; }
.add-row summary:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
@supports selector(:has(*)) {
  .add-row summary:focus-visible { outline: none; }
  .add-row:has(> summary:focus-visible) { border-color: var(--focus); box-shadow: 0 0 0 1px var(--focus); }
  /* An open row already has a blue border; add an outer ring so keyboard focus still shows. */
  .add-row[open]:has(> summary:focus-visible) { box-shadow: 0 0 0 1px var(--seg-on-line), 0 0 0 calc(1px + var(--ring-w)) var(--focus); }
}
body:not(.admin) .consent-card { background: var(--surface-raised); border: 1px solid var(--line); border-radius: var(--radius-row); margin-top: 22px; padding: 16px 18px 18px; }
/* Public legends are plain section headings inside the card: a floated legend leaves the border notch and lines up with the content below. */
fieldset > legend { float: left; margin: 0 0 14px; padding: 0; width: 100%; }
fieldset > legend + * { clear: both; }
.consent-card .consent:first-of-type { border-top: 0; margin-top: 4px; padding-top: 0; }
.consent-card .consent label { min-height: 44px; padding: 6px 0; }
body:not(.admin) .consent label, body:not(.admin) fieldset .consent label:first-of-type { font-size: var(--fs-body); font-weight: var(--fw-label); margin: 0; }
.consent-badge { border: 1px solid var(--line); border-radius: 999px; color: var(--muted); display: inline-block; font-size: var(--fs-small); font-weight: var(--fw-label); margin: 12px 0 12px; padding: 1px 11px; }
.consent-card .consent:first-of-type .consent-badge { margin-top: 8px; }
.consent-badge--required { background: var(--danger-bg); border-color: var(--danger); color: var(--danger); }
.consent-card .consent small { font-size: var(--fs-small); margin-left: calc(1.25rem + 11px); }
.consent-error { color: var(--danger); font-size: var(--fs-small); font-weight: var(--fw-label); margin: 8px 0 0 calc(1.25rem + 11px); }
.intake-form .button--primary { margin-top: 22px; }
.intake-form .submit-bar .button--primary { margin-top: 12px; }
.intake-form.is-dragover { outline: 3px dashed var(--accent); outline-offset: 4px; }
.trust-line { color: var(--muted); font-size: var(--fs-small); margin: 14px 0 0; }
.sample-link { align-items: center; color: var(--muted); display: flex; flex-wrap: wrap; gap: 0 0.4em; margin: 6px 0 14px; }
.sample-link a { align-items: center; display: inline-flex; min-height: 44px; }
.sample-clear { align-items: center; display: inline-flex; min-height: 44px; }
.home-links { display: flex; flex-wrap: wrap; gap: 0 24px; }

@media (min-width: 960px) {
  .home-layout { align-items: start; gap: 48px; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
  .home-hero { margin-bottom: 0; padding-top: 12px; }
  .home-hero .lede { max-width: 40ch; }
}

/* Samples page */
.samples .section-heading { margin-bottom: 24px; max-width: 640px; }
a.sample-card { color: var(--ink); }
.samples .sample-link { margin-top: 20px; }
.sample-card h3 { color: var(--ink); font-size: var(--fs-h3); margin: 10px 0 6px; }
.sample-icon { color: var(--accent-strong); display: block; height: 28px; width: 28px; }
.sample-card--prefill { display: flex; flex-direction: column; gap: 0; }
.sample-action { align-items: center; color: var(--accent-strong); display: inline-flex; font-weight: var(--fw-label); margin-top: auto; min-height: 44px; text-decoration: underline; text-underline-offset: 4px; }
.sample-card--send { background: var(--surface-raised); display: flex; flex-direction: column; }
.sample-card--send .button--primary { margin-top: auto; }
.sample-group { margin: 0 0 36px; }
.sample-group h2 { margin: 0 0 6px; }
.sample-group-help { color: var(--muted); margin: 0 0 16px; max-width: 640px; }
.sample-verify { color: var(--ink); margin-bottom: 8px; }
.samples-form .cf-turnstile { margin-bottom: 16px; }
/* Privacy and channel pages (C14): summary tiles, address block, consent box, status cards */
.trust-tiles { display: grid; gap: 14px; list-style: none; margin: 24px 0 8px; padding: 0; }
.trust-tile { min-width: 0; background: var(--surface); border: 1px solid var(--card-line); border-radius: var(--radius-card); display: flex; flex-direction: column; padding: 18px 20px; }
.trust-tile p { margin: 0 0 8px; }
.trust-tile-title { color: var(--ink); font-size: var(--fs-h3); font-weight: var(--fw-head); }
.trust-tile a { align-items: center; display: inline-flex; margin-top: auto; min-height: 44px; }
.policy-card, .result-section { scroll-margin-top: 16px; }
.address-block { background: var(--surface-raised); border: 1px solid var(--line); border-radius: var(--radius-row); margin: 20px 0; padding: 16px 18px; }
.address-label { color: var(--muted); font-size: var(--fs-small); font-weight: var(--fw-label); margin: 0 0 6px; }
.address-text { color: var(--ink); font-size: var(--fs-h2); font-weight: var(--fw-strong); margin: 0 0 12px; overflow-wrap: anywhere; user-select: all; }
.address-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.address-actions .button { margin-top: 0; }
.consent-box { background: var(--surface-muted); border-radius: var(--radius-row); margin: 20px 0; padding: 4px 18px 14px; }
.consent-box h2 { font-size: var(--fs-h3); margin-top: 14px; }
.how-steps { padding-left: 22px; }
.how-steps li { margin: 10px 0; }
.page-link { margin: 6px 0 14px; }
.page-link a { align-items: center; display: inline-flex; min-height: 44px; }
.status-card .status-icon { color: var(--muted); display: block; height: 32px; margin: 0 auto 10px; width: 32px; }
.status-card .status-icon--ok { color: var(--ok); }
.status-card .button { margin-top: 6px; }
.error-card--neutral { border-color: var(--card-line); }
.delete-actions { align-items: center; display: flex; flex-wrap: wrap; gap: 12px; margin-top: 18px; }
.delete-actions form { margin: 0; }
.delete-actions .button { margin-top: 0; }

/* UX4: public-page gaps (error pages, retention box, delete lists, provider help) */
.error-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 18px; }
.error-actions .button { margin-top: 0; }
.retention-box { background: var(--surface-muted); border-radius: var(--radius-row); margin: 20px 0; padding: 4px 18px 14px; }
.retention-box h2 { font-size: var(--fs-h3); margin-top: 14px; }
.retention-list { margin: 0; }
.retention-list > div { margin-top: 12px; }
.retention-list dt { color: var(--ink); font-weight: var(--fw-strong); }
.retention-list dd { margin: 2px 0 0; }
.delete-lists { display: grid; gap: 18px; margin-top: 18px; }
.delete-lists h2 { font-size: var(--fs-h3); margin: 0 0 6px; }
.delete-lists ul { margin: 0; padding-left: 22px; }
.delete-lists li { margin: 4px 0; }
.delete-lists-lead { color: var(--muted); margin: 0 0 6px; }
@media (min-width: 720px) { .delete-lists { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.provider-help { border: 1px solid var(--card-line); border-radius: var(--radius-row); margin: 16px 0; padding: 0 18px; }
.provider-help summary { cursor: pointer; font-weight: var(--fw-strong); min-height: 44px; padding: 10px 0; }
.provider-help[open] { padding-bottom: 12px; }
.provider-help h3 { font-size: var(--fs-body); margin: 16px 0 0; }
.provider-help-lead { color: var(--muted); }

/* Result */
.verdict-caveat { color: var(--ink); font-size: var(--fs-small); margin: 12px 0 0; }
.result-block { margin: 34px 0; max-width: 820px; }
.result-block h2 { margin-bottom: 14px; }
.advice-block .advice-list { display: grid; gap: 10px; list-style: decimal; margin: 0; padding: 0 0 0 22px; }
.advice-block .advice-list li { background: var(--surface); border: 1px solid var(--card-line); border-left: 4px solid var(--accent); border-radius: var(--radius-row); margin: 0; padding: 12px 16px; }
.more { margin-top: 12px; }
.more summary { align-items: center; color: var(--accent-strong); display: inline-flex; font-weight: var(--fw-label); min-height: 44px; padding: 6px 2px; text-decoration: underline; text-underline-offset: 4px; }
.more[open] summary { margin-bottom: 4px; }
.result-again { margin: 26px 0 0; max-width: 820px; }
.result-again .button--primary { margin-top: 0; }
.progress-again { margin: 18px 0 0; }
.progress-again a { align-items: center; display: inline-flex; min-height: 44px; }
.standalone-card { margin: 12px auto 0; max-width: 620px; }
.standalone-card .button { margin-top: 6px; }

@media (max-width: 480px) {
  .intake-form .submit-bar .button--primary { margin-top: 0; }
  /* C5: sticky action bar. The bar is in the form's flow, so it never covers content once the form
     ends; while a text field has focus (is-editing, set by app.js) it stays in flow too. */
  .intake-form .submit-bar { backdrop-filter: blur(12px); background: var(--sticky-bar-bg); border-bottom-left-radius: var(--radius-card); border-bottom-right-radius: var(--radius-card); border-top: 1px solid var(--sticky-bar-line); bottom: 0; margin: 12px calc(-1 * var(--card-pad-sm)) calc(-1 * var(--card-pad-sm)); min-height: var(--sticky-bar-h); padding: 12px var(--card-pad-sm) calc(12px + env(safe-area-inset-bottom)); position: sticky; z-index: 5; }
  .intake-form.is-editing .submit-bar { position: static; }
  .home-main { padding-bottom: var(--sticky-bar-h); }
  html:has(.submit-bar) { scroll-padding-bottom: var(--sticky-bar-h); }
}

/* T15a: console login, accounts, sessions and the audit viewer */
.badge--role { background: var(--surface-muted); color: var(--ink); }
.admin-header-link { white-space: nowrap; }
.admin-logout { margin: 0; }
.login-card { margin: 40px auto; max-width: 440px; }
.login-card .admin-card-form { background: transparent; border: 0; box-shadow: none; grid-template-columns: 1fr; margin: 0; padding: 0; }
.issued-card { border-color: var(--accent); }
/* A command quoted from an attacker page: not selected by a stray triple-click (T16b). */
.no-select { user-select: none; }
.temp-password { font-size: 1.15rem; letter-spacing: 0.04em; user-select: all; }
.row-actions { align-items: center; display: flex; flex-wrap: nowrap; gap: 6px; white-space: nowrap; }
.filters input[type="date"] { min-width: 0; }
.audit-table code { white-space: nowrap; }
.admin-main input[type="password"], .admin-main input[type="date"] { box-sizing: border-box; background: var(--surface-raised); border: 1px solid var(--control-line); border-radius: var(--radius-ctl); color: var(--ink); display: block; max-width: 100%; min-height: var(--ctl-h); padding: var(--ctl-pad); width: 100%; }
.admin-main td .inline-form select { min-width: 8rem; width: auto; }
.audit-table td.title-cell { max-width: 360px; overflow-wrap: anywhere; }
@media (max-width: 480px) { .login-card { margin: 16px auto; } }
/* T15b: analyst workflow (decision panel, queues, search, suggestions, feedback) */
.chip { align-items: center; background: var(--surface); border: 1px solid var(--control-line); border-radius: var(--radius-pill); color: var(--ink); display: inline-flex; font-size: var(--fs-small); gap: 6px; margin: 0; min-height: 32px; padding: 2px 12px; text-decoration: none; }
.chip--suggest { background: transparent; border-style: dashed; }
.chip--applied { background: var(--info-bg); border-color: transparent; color: var(--info); }
.chip--on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.chip input[type="checkbox"] { flex: none; height: 16px; margin: 0; min-height: 0; width: 16px; }
.chip-x { background: transparent; border: 0; color: inherit; cursor: pointer; font-size: 1.1em; line-height: 1; min-height: 28px; min-width: 28px; padding: 0 4px; }
.chip-fieldset { border: 0; display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; }
.chip-fieldset legend { margin: 0 0 6px; padding: 0; }
.queue-chips { align-items: center; display: flex; flex-wrap: wrap; gap: 6px 8px; margin: 0 0 14px; }
@media (max-width: 639.98px), (pointer: coarse) { .queue-chips .chip { min-height: var(--ctl-h); } }
.queue-chips > a:not(.chip) { align-items: center; display: inline-flex; min-height: var(--ctl-h); }
.search-form label { flex: 1 1 280px; }
.save-filter { margin: -4px 0 14px; }
.save-filter summary { color: var(--accent-strong); cursor: pointer; font-size: var(--fs-small); min-height: 32px; }
.case-panel h3 { margin: 22px 0 8px; }
.case-ai { background: var(--info-bg); border-radius: var(--radius-row); margin: 0 0 12px; padding: 4px 16px; }
.case-owner { align-items: flex-end; display: flex; flex-wrap: wrap; gap: 8px 14px; margin: 0 0 10px; }
.case-decision { max-width: 820px; }
.case-decision .chip-fieldset, .case-decision .tag-picker, .case-decision .notice, .case-decision .form-actions { grid-column: 1 / -1; }
.tag-picker summary { color: var(--accent-strong); cursor: pointer; min-height: 32px; }
.note-list { display: grid; gap: 8px; list-style: none; margin: 0 0 12px; padding: 0; }
.note-list li { background: var(--surface); border-radius: var(--radius-row); padding: 8px 14px; white-space: pre-wrap; word-break: break-word; }
.case-nav { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 0; }
kbd { background: var(--surface-muted); border: 1px solid var(--line); border-radius: 6px; font-family: inherit; font-size: var(--fs-xs); padding: 0 6px; }
.queue-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); list-style: none; margin: 0; padding: 0; }
.queue-card { background: var(--surface); border-radius: var(--radius-row); padding: 12px 16px; }
.queue-card .queue-count { display: block; font-size: var(--fs-h1); font-weight: var(--fw-strong); line-height: var(--lh-h1); margin-bottom: 4px; }
.queue-card > a { align-items: center; display: inline-flex; min-height: var(--ctl-h); }
.queue-card p { margin: 6px 0 0; }
.summary-table-wrap { max-width: 30rem; }
.summary-table { width: auto; }
.summary-table th, .summary-table td { padding-block: 6px; }
.actions-cell { white-space: nowrap; }
.actions-cell > * { display: inline-block; vertical-align: middle; }
.bar-chart { display: block; height: 10px; width: 120px; }
.bar-bg { fill: var(--surface-muted); }
.bar-fill { fill: var(--accent); }
.confusion .cell--match { background: var(--info-bg); font-weight: var(--fw-strong); }
.confusion .cell--miss { background: var(--amber-bg); }
tr[data-inbox-row].is-focused { box-shadow: inset 3px 0 0 var(--accent); background: var(--row-hover); }
.shortcut-help { background: var(--surface-raised); border: 1px solid var(--line); border-radius: var(--radius-card); box-shadow: var(--shadow); color: var(--ink); margin: auto; max-height: calc(100dvh - 32px); max-width: calc(100vw - 32px); overflow-y: auto; padding: var(--card-pad); width: 420px; }
.shortcut-help[hidden] { display: none; }
.shortcut-help h2 { font-size: 1rem; margin: 0 0 8px; }
.shortcut-help ul { margin: 0; padding-left: 18px; }
@media (max-width: 480px) {
  .case-decision { grid-template-columns: 1fr; }
  .shortcut-help { width: calc(100vw - 32px); }
}

/* ==== T15c (Lane A): analytics dashboard, inline SVG charts, quota board ==============================
 * Charts are server-side SVG (web/charts.py). Colours come from the six `.chart-s1` ... `.chart-s6`
 * classes only: no style attribute, no inline colour. Light and dark values live here once; both dark
 * selectors carry the same values. */
:root {
  --chart-1: #2f6fd6;
  --chart-2: #d97a1f;
  --chart-3: #23925f;
  --chart-4: #8656d1;
  --chart-5: #c0447f;
  --chart-6: #6f747c;
  --chart-grid: var(--line);
  --chart-ink: var(--muted);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --chart-1: #6ea8ff;
    --chart-2: #ffa95a;
    --chart-3: #4fd1a0;
    --chart-4: #b79bff;
    --chart-5: #ff8cc0;
    --chart-6: #a1a6ae;
  }
}
:root[data-theme="dark"] {
  --chart-1: #6ea8ff;
  --chart-2: #ffa95a;
  --chart-3: #4fd1a0;
  --chart-4: #b79bff;
  --chart-5: #ff8cc0;
  --chart-6: #a1a6ae;
}
.chart-s1 { --chart-c: var(--chart-1); }
.chart-s2 { --chart-c: var(--chart-2); }
.chart-s3 { --chart-c: var(--chart-3); }
.chart-s4 { --chart-c: var(--chart-4); }
.chart-s5 { --chart-c: var(--chart-5); }
.chart-s6 { --chart-c: var(--chart-6); }
.chart { margin: 4px 0 8px; }
.chart-svg { display: block; height: auto; max-width: 100%; width: 100%; }
.chart-fill { fill: var(--chart-c); }
.chart-stroke { stroke: var(--chart-c); }
.chart-area { fill-opacity: 0.18; }
.chart-line { stroke-linecap: round; stroke-linejoin: round; stroke-width: 2; }
.chart-slice { fill: none; }
.chart-grid { stroke: var(--chart-grid); stroke-dasharray: 2 3; stroke-width: 1; }
.chart-label { fill: var(--chart-ink); font-family: var(--font-sans); font-size: 11px; }
.chart-label--value, .chart-label--total { fill: var(--ink); font-variant-numeric: tabular-nums; }
.chart-label--total { font-size: 20px; font-weight: 600; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; list-style: none; margin: 6px 0 2px; padding: 0; }
.chart-legend li { align-items: center; color: var(--muted); display: inline-flex; font-size: var(--fs-small); gap: 6px; }
.chart-swatch { background: var(--chart-c); border-radius: 3px; display: inline-block; height: 10px; width: 10px; }
.chart-data { margin: 6px 0 0; }
.chart-data > summary { color: var(--muted); cursor: pointer; font-size: var(--fs-small); }
.chart-data .table-wrap { margin: 6px 0 0; max-height: 320px; overflow-y: auto; }
.chart-empty { margin: 6px 0; }
.analytics-toggle { font-size: var(--fs-small); margin: 0 0 10px; }
.quota-board td { vertical-align: middle; }
.quota-meter { height: 12px; margin-right: 8px; min-width: 120px; vertical-align: middle; width: 40%; }
@media (max-width: 640px) {
  .chart-label { font-size: 13px; }
  .quota-meter { display: block; margin: 0 0 4px; width: 100%; }
}
/* ==== end T15c (Lane A) ============================================================================== */

/* ==== T15c (Lane B): IOC list, export page, printable case summary ======================================
 * Append to src/khoanda/web/static/app.css. Tokens only (var(--...)); no inline style anywhere. */

/* IOC list: the table scrolls inside its wrapper on a phone; the indicator column wraps long values. */
.ioc-table td.title-cell code { overflow-wrap: anywhere; }
.ioc-table th, .ioc-table td { vertical-align: top; }

/* Printable case summary (/admin/r/<id>/ho-so). On screen it reads as a page of paper. */
.case-sheet { background: var(--surface-raised); border: 1px solid var(--line); border-radius: var(--radius-card); margin: 14px 0; padding: 22px 26px; }
.case-head { border-bottom: 1px solid var(--line); margin: 0 0 14px; padding: 0 0 10px; }
.case-head .admin-title { margin: 0 0 4px; }
.case-section { margin: 0 0 18px; }
.case-section > h2 { font-size: var(--fs-body); margin: 0 0 8px; }
.case-section .admin-table { width: 100%; }
.case-shot { border: 1px solid var(--line); display: block; height: auto; max-width: 100%; }
.case-note { background: var(--surface); border-left: 3px solid var(--line); margin: 6px 0; padding: 6px 10px; white-space: pre-wrap; overflow-wrap: anywhere; }
.case-foot { border-top: 1px solid var(--line); color: var(--muted); font-size: var(--fs-small); margin: 18px 0 0; padding: 10px 0 0; }
.case-foot p { margin: 4px 0; }
.case-hash { overflow-wrap: anywhere; word-break: break-all; }
.case-tools .inline-form { align-items: center; display: flex; flex-wrap: wrap; gap: 8px 12px; }

@media print {
  /* Only the sheet is printed: no header, navigation, flash messages, theme toggle or toolbar. */
  .site-header, .admin-nav, .theme-toggle, .no-print, .notice, .site-footer { display: none !important; }
  body, body.admin { background: #fff; color: #000; }
  .admin-main, .admin-container { margin: 0; max-width: none; padding: 0; }
  .case-sheet { background: #fff; border: 0; border-radius: 0; box-shadow: none; margin: 0; padding: 0; }
  .case-head, .case-section, .case-foot { color: #000; }
  .case-section { break-inside: avoid; page-break-inside: avoid; }
  .case-section > h2 { break-after: avoid; page-break-after: avoid; }
  .case-section .admin-table { border-collapse: collapse; }
  .case-section .admin-table th, .case-section .admin-table td { border: 1px solid #999; color: #000; padding: 3px 6px; }
  .case-shot { max-height: 11cm; max-width: 100%; object-fit: contain; }
  .case-foot { color: #000; }
  .case-hash { font-size: 9pt; }
  a { color: #000; text-decoration: none; }
}

/* ==== T15c (merge): date inputs in the IOC filter =======================================================
 * The base rule styles number/text inputs only; give type=date the same size and look. */
.admin-main input[type="date"] { box-sizing: border-box; min-width: 0; background: var(--surface-raised); border: 1px solid var(--control-line); border-radius: var(--radius-ctl); color: var(--ink); display: block; max-width: 16rem; min-height: var(--ctl-h); padding: var(--ctl-pad); width: 100%; }

@media (min-width: 768px) {
  :root { --verdict-icon-size: 56px; }
}

/* UX1-2: keep the verdict and immediate actions within the phone's first screen. */
#main:has([data-result-heading]) { padding-top: var(--section-pad); }
#main:has([data-result-heading]) .result-heading { margin-bottom: var(--section-pad); }
.result-verdict { display: grid; gap: 6px 12px; grid-template-columns: var(--verdict-icon-size) minmax(0, 1fr); padding: var(--card-pad-sm); }
.result-verdict .verdict-copy { display: contents; }
.result-verdict .verdict-icon { grid-row: 1 / span 2; }
.result-verdict .verdict-overline, .result-verdict h2 { grid-column: 2; margin: 0; }
.result-verdict .verdict-copy > :not(.verdict-overline):not(h2) { grid-column: 1 / -1; margin: 0; }
.result-verdict .notice--fallback { padding: 10px 12px; }
.result-verdict .scam-description > summary { padding: 0; }
.result-verdict .scam-description p { margin-bottom: 0; }
.advice-block.action-card { margin: var(--section-pad) 0; }
.advice-block.action-card .advice-list { gap: 8px; }
.advice-block.action-card .advice-list li { background: transparent; border: 0; border-radius: 0; padding: 0; }
.result-disclosure .reporting-list a, .disclosure-body figcaption a { align-items: center; display: inline-flex; min-height: var(--ctl-h); }

.advice-block.action-card .more, .advice-block.action-card .action-secondary { margin-top: 0; }

/* UX1-6: grouped navigation, dashboard cards and focused recovery actions. */
.admin-header > * { min-width: 0; }
.admin-header { row-gap: var(--nav-group-gap); }
.admin-nav .nav-links { gap: var(--nav-group-gap); }
.nav-group { position: relative; }
.nav-group > summary { align-items: center; border-radius: var(--radius-pill); color: var(--ink); cursor: pointer; display: flex; font-size: var(--fs-nav); gap: var(--nav-group-gap); list-style: none; min-height: var(--nav-h); padding: 6px 11px; white-space: nowrap; }
.nav-group > summary::-webkit-details-marker { display: none; }
.nav-group > summary::after { content: "⌄"; }
.nav-group > summary[aria-current="true"] { background: var(--info-bg); color: var(--info); font-weight: var(--fw-strong); }
.nav-group[open] > summary::after { content: "⌃"; }
.nav-group > summary:hover { background: var(--surface-muted); }
.nav-group > summary:focus-visible, .admin-main details > summary:focus-visible { outline: var(--ring-w) solid var(--focus); outline-offset: var(--ring-off); }
.nav-group-list { background: var(--surface-raised); border: 1px solid var(--line); border-radius: var(--radius-row); box-shadow: var(--shadow); list-style: none; margin: 0; min-width: 220px; padding: 6px; position: absolute; top: calc(100% + var(--nav-group-gap)); z-index: 10; }
.admin-nav .nav-group-list a { align-items: center; border-radius: var(--radius-ctl); display: flex; min-height: var(--nav-h); }
.admin-nav .nav-menu-list { max-height: calc(100dvh - 120px); max-width: calc(100vw - 36px); overflow-y: auto; }
.nav-menu-group + .nav-menu-group { border-top: 1px solid var(--line); }
.nav-menu-group h2 { color: var(--muted); font-size: var(--fs-small); font-weight: var(--fw-strong); margin: 0; padding: 10px 12px 4px; }
.nav-menu-group ul { list-style: none; margin: 0; padding: 0; }
.admin-nav .nav-menu-group a { min-height: var(--nav-h); }
.admin-banner { overflow-wrap: anywhere; }
.admin-banner.notice--success { background: var(--ok-bg); border-color: var(--ok); color: var(--ok); }
.admin-main .kpi-grid { gap: 10px; grid-template-columns: repeat(auto-fit, minmax(min(100%, var(--kpi-min)), 1fr)); margin: 14px 0; }
.kpi-grid > div { display: flex; flex-direction: column; padding: var(--section-pad); }
.kpi-grid dd { font-size: var(--fs-h2); }
.kpi-grid .kpi-note { color: var(--muted); display: block; font-size: var(--fs-small); font-weight: var(--fw-nav); }
.kpi-grid a { align-items: center; display: inline-flex; font-size: var(--fs-small); font-weight: var(--fw-nav); min-height: var(--ctl-h-sm); }
.analytics-controls { align-items: center; background: var(--surface); border: 1px solid var(--card-line); border-radius: var(--radius-row); display: flex; flex-wrap: wrap; gap: 12px 24px; margin: 14px 0; padding: var(--section-pad); }
.analytics-controls .lane-tabs, .analytics-controls p { margin: 0; }
.analytics-controls .analytics-toggle a { align-items: center; display: inline-flex; min-height: var(--nav-h); }
.admin-main:has(.kpi-grid) > .admin-lede a,
.admin-main:has(.kpi-grid) > ul a,
.admin-main:has(.export-layout) .admin-section-note a { align-items: center; display: inline-flex; min-height: var(--ctl-h-sm); }
.analytics-control-label { color: var(--muted); display: block; font-size: var(--fs-small); margin-bottom: 6px; }
.status-cell .status-value { color: var(--muted); font-size: var(--fs-small); }
.ops-status-summary { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-row); margin: 12px 0; padding: 12px var(--section-pad); }
.export-layout { display: grid; gap: var(--section-gap); }
.export-layout > * { min-width: 0; }
.export-advanced { flex-basis: 100%; }
.export-form .filters { margin: 0; }
.export-summary { align-self: start; }
.admin-message-card { max-width: 620px; }
.admin-message-card .status-icon { color: var(--muted); height: 32px; margin-bottom: 12px; width: 32px; }
.login-bootstrap { margin-bottom: 14px; }
.shortcut-help::backdrop { background: rgba(15, 23, 42, 0.72); background: var(--header-bg); backdrop-filter: blur(4px); }
.shortcut-help h3 { color: var(--muted); font-size: var(--fs-small); margin: 18px 0 8px; }
.shortcut-help li { align-items: center; display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.shortcut-help kbd { background: var(--surface); border: 1px solid var(--control-line); border-radius: var(--radius-ctl); color: var(--ink); display: inline-block; font-size: var(--fs-small); min-width: 28px; padding: 3px 8px; text-align: center; }
@media (min-width: 1024px) {
  .admin-nav .nav-links { display: flex; flex-wrap: wrap; }
  .admin-nav .nav-menu { display: none; }
  .nav-links > li:last-child .nav-group-list { right: 0; }
  .export-layout { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
}
@media (max-width: 1023.98px) {
  .admin-nav .nav-links { display: none; }
  .admin-nav .nav-menu { display: block; }
}
@media (max-width: 767.98px) {
  .admin-main .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 339.98px) {
  .admin-main .kpi-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (hover: none) {
  .admin-header-link { align-items: center; display: inline-flex; min-height: var(--ctl-h); }
}
/* UX1-5: evidence first in the DOM, with an independently scrolling decision rail on laptops. */
.case-layout { display: grid; gap: var(--section-gap); grid-template-columns: minmax(0, 1fr); }
.case-main, .case-rail { min-width: 0; }
.case-layout section, .case-layout details[id], #case-panel { scroll-margin-top: var(--rail-top); }
.case-main > .admin-section:first-of-type, .case-rail > .case-panel { margin-top: 0; }
.case-jump { margin-bottom: var(--section-gap); }
.case-layout .badge { max-width: 100%; overflow-wrap: anywhere; white-space: normal; }
.case-report-head .case-danger-action-group { margin-inline-start: auto; }
.case-report-head .inline-form select { width: auto; }
.case-rail .disposition-form { grid-template-columns: minmax(0, 1fr); max-width: none; }
.case-rail .case-state { gap: 6px 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 0 0 8px; }
.case-rail .case-state > div { align-items: baseline; display: flex; flex-wrap: wrap; gap: 4px 8px; }
.case-rail .case-state > .wide { grid-column: 1 / -1; }
.case-rail .case-state dt, .case-rail .case-state dd { font-size: var(--fs-xs); }
.case-owner form, .case-owner label { min-width: 0; }
.case-owner label { align-items: center; display: flex; flex: 1 1 180px; font-size: var(--fs-small); gap: 8px; margin: 0; white-space: nowrap; }
.case-owner input { min-width: 0; }
.case-rail .case-owner { margin-bottom: 6px; }
.case-rail .case-ai { margin-bottom: 8px; padding: 4px 12px; }
.case-rail .case-ai > p { font-size: var(--fs-small); margin: 6px 0; }
.case-rail .case-panel > h3 { margin: 8px 0 6px; }
.case-rail .case-decision > .case-options, .case-rail .case-confirm-ai { grid-column: 1 / -1; }
.case-options > label { display: grid; gap: 4px; margin: 8px 0 12px; }
.case-options > .tag-picker { margin-top: 12px; }
.case-layout details > summary { list-style: none; }
.case-layout details > summary::-webkit-details-marker { display: none; }
.case-layout details > summary::before { content: "＋" / ""; flex: none; margin-right: 8px; }
.case-layout details[open] > summary::before { content: "−" / ""; }
.case-layout summary:focus-visible, .case-history:focus-visible { outline: var(--ring-w) solid var(--focus); outline-offset: var(--ring-off); }
.case-layout .case-timeline { margin: 14px 0 0; }
.case-timeline > summary > .disclosure-title { color: var(--ink); margin: 0; }
.case-confirm-ai { border-top: 1px solid var(--line); margin-top: 8px; padding-top: 12px; }
.case-confirm-ai > p { font-size: var(--fs-small); margin: 0 0 8px; }
.case-rail .form-actions { align-items: stretch; display: grid; margin-top: 0; }
.case-rail .form-actions .button, .case-rail .case-confirm-ai .button { justify-self: stretch; width: 100%; }
.case-decision > label.inline { min-height: var(--ctl-h); }
.case-history .admin-table { min-width: 700px; }
.case-main .content-box { max-height: 360px; }
.case-main .evidence-image { max-width: 100%; }
.case-main .evidence-image img { height: auto; max-height: 420px; object-fit: contain; }
@media (min-width: 1100px) {
  .case-report-head .report-key > div { align-items: center; display: flex; flex-wrap: wrap; gap: 4px 8px; }
  .case-report-head .report-key dd { margin: 0; }
  .case-report-head .facts > div { align-items: baseline; display: flex; flex-wrap: wrap; gap: 4px 8px; }
  .case-report-head .facts dd { margin: 0; }
  .case-layout { align-items: start; grid-template-columns: minmax(0, 1fr) var(--rail-w); }
  .case-rail { max-height: calc(100vh - var(--rail-top) - 12px); overflow: auto; position: sticky; top: var(--rail-top); }
  .case-jump { left: 0; position: absolute; top: 0; transform: translateY(-120%); z-index: 20; }
  .case-jump:focus-visible { background: var(--surface); transform: none; }
}
@media (max-width: 639.98px), (pointer: coarse) {
  .case-layout { --ctl-h: 44px; --ctl-h-sm: 44px; }
  .case-layout .chip, .case-layout .chip-x { min-height: 44px; }
  .case-layout .chip-x { min-width: 44px; }
}

/* ==== UX3 ==== */
/* Case toolbar: one row of equal-height controls, the lane select joined to its button, delete set apart. */
.case-actions { gap: 8px 10px; }
.case-actions > form, .case-actions > a { margin: 0; }
.case-actions .field-action { flex-wrap: nowrap; gap: 0; }
.case-actions .field-action select { border-bottom-right-radius: 0; border-right-width: 0; border-top-right-radius: 0; min-width: 0; width: auto; }
.case-actions .field-action .button { border-bottom-left-radius: 0; border-top-left-radius: 0; }
.case-actions .case-danger-action-group { border-inline-start: 1px solid var(--line); margin-inline-start: auto; padding-inline-start: 14px; }
.case-actions .case-danger-action-group .button { margin-left: 0; }
/* Signal table: Vietnamese label first, the raw code as small muted text. */
.signal-cell .signal-name { font-weight: var(--fw-strong); }
.signal-cell .signal-code { background: none; border: 0; color: var(--muted); display: block; font-size: var(--fs-xs); padding: 0; }
@media (max-width: 639.98px) {
  .case-actions > form:not(.field-action), .case-actions > a { flex: 1 1 calc(50% - 5px); }
  .case-actions > form:not(.field-action) .button, .case-actions > a.button { width: 100%; }
  .case-actions .field-action { flex: 1 1 100%; }
  .case-actions .field-action select { flex: 1 1 auto; }
  .case-actions .case-danger-action-group { border-inline-start: 0; border-top: 1px solid var(--line); flex: 1 1 100%; margin-inline-start: 0; padding: 10px 0 0; }
  .case-actions .case-danger-action-group .button { width: 100%; }
}
/* Report-ID links (a.report-ref, also when a badge follows them in the cell) and lone links in a cell or facts value reach a 44px tap target on touch screens. */
@media (max-width: 639.98px), (pointer: coarse) {
  body.admin a.report-ref, body.admin .admin-table td > a:only-child, body.admin .facts dd > a:first-child, body.admin .case-main li > a:first-child, body.admin .admin-section li > a[href^="/admin/"] { align-items: center; display: inline-flex; min-height: 44px; min-width: 44px; }
}
/* /tra-cuu: the intro no longer touches the form card */
.lookup .lede { margin-bottom: 20px; }
/* ==== end UX3 ==== */

/* T18b: quick lookup page */
.lookup { max-width: 820px; }
.lookup-form, .lookup-result, .lookup-report { margin-bottom: 18px; }
