/* ============================================================================
   Anti-Scam Shield — giao diện
   ----------------------------------------------------------------------------
   Ngôn ngữ thị giác lấy từ các site kiểm tra lừa đảo đáng tin cậy: nền giấy
   sáng, chữ serif cho tiêu đề, một màu nhấn đỏ cho rủi ro, thẻ bo nhẹ, nút
   dạng viên thuốc. Không phụ thuộc font/CDN ngoài để bản demo luôn mở được.
   ========================================================================== */

:root {
  --paper: #f4f6fa;
  --surface: #ffffff;
  --sunk: #eaeef5;

  --ink: #0e1726;
  --ink-2: #26324a;
  --muted: #4e5b73;
  --line: #d9dfea;
  --line-strong: #b9c3d4;

  --focus: #2457d6;
  --link: #1d47b8;

  --red: #c8321f;
  --red-soft: #fbeae7;
  --amber: #a85a06;
  --amber-soft: #fcf0e0;
  --ochre: #7c6200;
  --ochre-soft: #f8f2d8;
  --green: #1d7a4e;
  --green-soft: #e3f3ea;

  --btn: #0e1726;
  --btn-ink: #ffffff;

  --navy: #0e1726;
  --on-navy: #f4f6fa;
  --on-navy-muted: #b9c3d4;

  /*
   * Font serif cho tiêu đề: ưu tiên những font có ĐỦ glyph tiếng Việt dựng sẵn
   * (ắ, ộ, ữ…). Georgia thiếu nhiều glyph này nên trình duyệt phải ghép dấu từ
   * font khác, chữ sẽ bị vỡ khoảng cách giữa chữ và dấu.
   */
  --display: Cambria, "Noto Serif", "DejaVu Serif", Caladea, Georgia, "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

  --r-sm: 4px;
  --r: 6px;
  --r-lg: 10px;

  --shadow: 0 1px 2px rgba(14, 23, 38, 0.06), 0 8px 24px rgba(14, 23, 38, 0.06);
  --shadow-sm: 0 1px 2px rgba(14, 23, 38, 0.06);

  --wrap: 1120px;
  --gutter: clamp(16px, 4vw, 32px);

  color-scheme: light;
}

:root[data-theme="dark"] {
  --paper: #0b111c;
  --surface: #121a28;
  --sunk: #0f1622;
  --ink: #e8edf6;
  --ink-2: #c9d2e3;
  --muted: #9aa7bd;
  --line: #253045;
  --line-strong: #34425c;
  --focus: #7ea2ff;
  --link: #9db8ff;
  --red: #ff6b57;
  --red-soft: #3a1714;
  --amber: #f2a04a;
  --amber-soft: #33230f;
  --ochre: #e0c255;
  --ochre-soft: #2e2910;
  --green: #56c68e;
  --green-soft: #10291d;
  --btn: #e8edf6;
  --btn-ink: #0b111c;
  --navy: #16213a;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.3);
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0b111c;
    --surface: #121a28;
    --sunk: #0f1622;
    --ink: #e8edf6;
    --ink-2: #c9d2e3;
    --muted: #9aa7bd;
    --line: #253045;
    --line-strong: #34425c;
    --focus: #7ea2ff;
    --link: #9db8ff;
    --red: #ff6b57;
    --red-soft: #3a1714;
    --amber: #f2a04a;
    --amber-soft: #33230f;
    --ochre: #e0c255;
    --ochre-soft: #2e2910;
    --green: #56c68e;
    --green-soft: #10291d;
    --btn: #e8edf6;
    --btn-ink: #0b111c;
    --navy: #16213a;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.3);
    color-scheme: dark;
  }
}

*, *::before, *::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1rem/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--display);
  font-weight: 650;
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 0;
  text-wrap: balance;
  color: var(--ink);
}

h1 {
  font-size: clamp(2rem, 4.6vw, 3.3rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.022em;
}

h2 {
  font-size: clamp(1.45rem, 2.9vw, 2.1rem);
  line-height: 1.1;
  letter-spacing: -0.018em;
}

h3 { font-size: 1.16rem; }
h4 { font-size: 1rem; font-family: var(--sans); font-weight: 700; letter-spacing: 0; }

p { margin: 0; }
p + p { margin-top: 0.6em; }

a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 2px; }

.wrap {
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 100;
  background: var(--btn);
  color: var(--btn-ink);
  padding: 10px 14px;
  border-radius: var(--r-sm);
}

.skip:focus { top: 12px; }

.muted { color: var(--muted); }
.small { font-size: 0.88rem; }
.hint { font-size: 0.85rem; color: var(--muted); font-weight: 400; }

.eyebrow {
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0;
}

.eyebrow-rule {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.eyebrow-rule::before {
  content: "";
  width: 26px;
  height: 2px;
  background: var(--red);
  flex: none;
}

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}

/* ------------------------------------------------------------------ header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 66px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.22rem;
  letter-spacing: -0.01em;
  white-space: nowrap;
  flex: none;
}

.brand-logo {
  height: 34px;
  width: auto;
  flex: none;
  display: block;
  color: var(--ink);
}

.brand-name em {
  font-style: normal;
  color: var(--red);
}

.nav {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: auto;
}

.nav a {
  color: var(--ink-2);
  text-decoration: none;
  font-weight: 550;
  font-size: 0.94rem;
  padding: 8px 10px;
  border-radius: 999px;
  white-space: nowrap;
}

.nav a:hover,
.nav a[aria-current="page"] {
  background: var(--sunk);
  color: var(--ink);
}

.nav a.btn { margin-left: 8px; }

.theme-toggle {
  appearance: none;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink-2);
  width: 38px;
  height: 38px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  cursor: pointer;
  margin-left: 6px;
}

.theme-toggle:hover { border-color: var(--ink); color: var(--ink); }

.nav-toggle {
  display: none;
  appearance: none;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  border-radius: 999px;
  padding: 7px 14px;
  font: 600 0.9rem var(--sans);
  cursor: pointer;
  margin-left: auto;
}

/* -------------------------------------------------------------------- hero */
.hero {
  padding-block: clamp(24px, 4vw, 48px) clamp(32px, 5vw, 56px);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: clamp(28px, 4vw, 56px);
  align-items: start;
}

@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
}

.hero h1 em {
  font-style: italic;
  color: var(--red);
}

.lede {
  margin-top: 16px;
  font-size: 1.1rem;
  color: var(--muted);
  max-width: 58ch;
}

.hero-points {
  list-style: none;
  padding: 0;
  margin: 22px 0 0;
  display: grid;
  gap: 12px;
}

.hero-points li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  color: var(--ink-2);
  font-size: 0.95rem;
}

.hero-points svg {
  flex: none;
  width: 19px;
  height: 19px;
  margin-top: 3px;
  color: var(--green);
}

/* ---------------------------------------------------------------- checker */
.checker {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-bottom: 1px solid var(--line);
  background: var(--sunk);
}

.tab {
  appearance: none;
  border: 0;
  background: none;
  padding: 14px 8px;
  font: 600 0.96rem var(--sans);
  color: var(--muted);
  cursor: pointer;
  border-bottom: 3px solid transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 52px;
}

.tab svg { width: 18px; height: 18px; flex: none; }

.tab:hover { color: var(--ink); }

.tab[aria-selected="true"] {
  color: var(--ink);
  background: var(--surface);
  border-bottom-color: var(--red);
}

@media (max-width: 460px) {
  .tab { font-size: 0.85rem; padding: 12px 4px; gap: 5px; }
  .tab svg { display: none; }
}

.panel {
  padding: clamp(16px, 3vw, 24px);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

label,
.label-text {
  font-weight: 600;
  font-size: 0.95rem;
}

.counter {
  font: 500 0.78rem var(--mono);
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

input[type="text"],
textarea {
  width: 100%;
  font: 400 0.98rem/1.55 var(--sans);
  color: var(--ink);
  background: var(--surface);
  border: 1.5px solid var(--line-strong);
  border-radius: var(--r);
  padding: 12px 14px;
  min-height: 46px;
}

textarea {
  resize: vertical;
  min-height: 158px;
  max-height: 340px;
  overflow-y: auto;
  font-family: var(--mono);
  font-size: 0.88rem;
  line-height: 1.6;
}

input::placeholder,
textarea::placeholder { color: var(--muted); opacity: 0.75; }

input:focus,
textarea:focus {
  outline: none;
  border-color: var(--focus);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 22%, transparent);
}

.tip {
  font-size: 0.85rem;
  color: var(--muted);
}

.detect-line {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  align-self: flex-start;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--green);
  background: var(--green-soft);
  border-radius: 999px;
  padding: 3px 10px;
}

.detect-line::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  flex: none;
}

.samples {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  font-size: 0.85rem;
  color: var(--muted);
}

.chip {
  appearance: none;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink-2);
  border-radius: 999px;
  padding: 4px 12px;
  font: 500 0.85rem var(--sans);
  cursor: pointer;
}

.chip:hover { border-color: var(--ink); color: var(--ink); }

.context-box {
  font-size: 0.9rem;
  color: var(--muted);
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.context-box summary {
  cursor: pointer;
  user-select: none;
  font-weight: 600;
  color: var(--ink-2);
}

.context-box input { margin-top: 8px; }

.checker-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.privacy-line {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 0.82rem;
  color: var(--muted);
  max-width: 34ch;
}

.privacy-line svg { width: 15px; height: 15px; flex: none; }

.under-checker {
  margin-top: 12px;
  font-size: 0.84rem;
  color: var(--muted);
}

/* ----------------------------------------------------------------- buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 10px 20px;
  border-radius: 999px;
  border: 1.5px solid var(--btn);
  background: var(--btn);
  color: var(--btn-ink);
  font: 600 0.98rem/1.2 var(--sans);
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.btn:hover:not(:disabled) { transform: translateY(-1px); }
.btn:disabled { opacity: 0.55; cursor: progress; transform: none; }
.btn.red { background: var(--red); border-color: var(--red); color: #fff; }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn.ghost:hover:not(:disabled) { border-color: var(--ink); }
.btn.small { min-height: 36px; padding: 6px 14px; font-size: 0.9rem; }
.btn-kbd {
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.btn-primary { background: var(--red); border-color: var(--red); color: #fff; }
.btn-primary:hover:not(:disabled) { background: #a82718; border-color: #a82718; }

/* ------------------------------------------------------------- drop / upload */
.dropzone {
  border: 2px dashed var(--line-strong);
  border-radius: var(--r);
  padding: 30px 16px;
  text-align: center;
  color: var(--muted);
  cursor: pointer;
  background: var(--paper);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  transition: border-color 0.15s, background 0.15s;
}

.dropzone:hover { border-color: var(--focus); }

.dropzone.dragover,
.dropzone.drag {
  border-color: var(--focus);
  background: color-mix(in srgb, var(--focus) 6%, var(--paper));
}

.dropzone b { color: var(--ink); font-size: 1rem; }

.upload-list {
  display: grid;
  gap: 8px;
}

.upload-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 6px 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 9px 12px;
  background: var(--paper);
  font-size: 0.85rem;
}

.upload-name {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.upload-name b {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
}

.upload-thumb {
  grid-row: span 2;
  width: 46px;
  height: 46px;
  object-fit: cover;
  object-position: top;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  background: var(--surface);
}

.upload-kind {
  font: 700 0.66rem var(--mono);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-2);
  background: var(--sunk);
  border-radius: 999px;
  padding: 2px 8px;
  flex: none;
}

.upload-state {
  font-size: 0.78rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.upload-state.ok { color: var(--green); font-weight: 600; }
.upload-state.error { color: var(--red); font-weight: 600; }

.progress-track {
  grid-column: 1 / -1;
  height: 5px;
  border-radius: 999px;
  background: var(--sunk);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--red);
  transition: width 0.15s linear;
}

.upload-remove {
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
}

.upload-remove:hover { color: var(--red); }

.attach-notice {
  font-size: 0.85rem;
  color: var(--amber);
  background: var(--amber-soft);
  border: 1px solid color-mix(in srgb, var(--amber) 30%, transparent);
  border-radius: var(--r);
  padding: 9px 12px;
}

/* Dòng "Đã đính 2 ảnh và 1 tệp" ngay dưới ô nhập tin nhắn. */
.attach-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 2px;
  padding: 7px 12px;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--green);
  background: var(--green-soft);
  border: 1px solid color-mix(in srgb, var(--green) 26%, transparent);
  border-radius: 999px;
}

.attach-clear {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--green);
  font: 600 0.8rem var(--sans);
  text-decoration: underline;
  cursor: pointer;
  padding: 0 2px;
}

.attach-clear:hover { color: var(--ink); }

/* ------------------------------------------------------------------ result */
.result-wrap { padding-block: 8px 40px; }

.result { display: grid; gap: 16px; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

.empty h2,
.empty h3 {
  font-size: 1.1rem;
  margin-bottom: 12px;
}

.steps {
  padding-left: 20px;
  margin: 0;
  color: var(--ink-2);
  font-size: 0.95rem;
  display: grid;
  gap: 8px;
}

/* verdict ---------------------------------------------------------------- */
.verdict {
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  border-left: 5px solid var(--tone, var(--muted));
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: clamp(16px, 3vw, 24px);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 22px;
  align-items: center;
}

.verdict[data-level="high"],
.verdict[data-level="critical"] { --tone: var(--red); background: linear-gradient(0deg, var(--red-soft), var(--surface) 60%); }
.verdict[data-level="medium"] { --tone: var(--amber); background: linear-gradient(0deg, var(--amber-soft), var(--surface) 60%); }
.verdict[data-level="low"] { --tone: var(--green); background: linear-gradient(0deg, var(--green-soft), var(--surface) 60%); }

@media (max-width: 620px) {
  .verdict { grid-template-columns: minmax(0, 1fr); justify-items: start; }
}

.ring {
  --pct: 0;
  --ring-color: var(--muted);
  width: 112px;
  height: 112px;
  flex: none;
  display: grid;
  place-items: center;
  position: relative;
  border-radius: 50%;
  background: conic-gradient(var(--ring-color) calc(var(--pct) * 1%), var(--sunk) 0);
}

.ring::after {
  content: "";
  position: absolute;
  inset: 9px;
  border-radius: 50%;
  background: var(--surface);
}

.ring-inner {
  position: relative;
  z-index: 1;
  text-align: center;
  line-height: 1.1;
}

.ring-score {
  font-family: var(--display);
  font-size: 2.1rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  color: var(--ring-color);
  display: block;
}

.ring-max {
  display: block;
  font: 600 0.7rem var(--mono);
  color: var(--muted);
}

.verdict-body { min-width: 0; }

.band {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font: 700 0.72rem var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 5px 12px;
  border-radius: 999px;
  margin-bottom: 10px;
  color: var(--band);
  background: var(--band-tint);
  border: 1px solid color-mix(in srgb, var(--band) 24%, transparent);
}

.band-low { --band: var(--green); --band-tint: var(--green-soft); }
.band-medium { --band: var(--amber); --band-tint: var(--amber-soft); }
.band-high { --band: var(--red); --band-tint: var(--red-soft); }
.band-critical { --band: var(--red); --band-tint: var(--red-soft); }

.verdict-headline {
  font-size: 1.06rem;
  color: var(--ink);
  margin-bottom: 12px;
  line-height: 1.45;
}

.verdict-meta {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 0.82rem;
  color: var(--muted);
  align-items: center;
}

.verdict-meta b { color: var(--ink-2); font-variant-numeric: tabular-nums; }

.judge {
  font: 700 0.68rem var(--mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-2);
  background: var(--sunk);
  border-radius: 999px;
  padding: 3px 10px;
}

/* --------------------------------------------------------- link report UI */
.link-hero {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 22px;
  align-items: center;
}

@media (max-width: 620px) {
  .link-hero { grid-template-columns: minmax(0, 1fr); justify-items: start; }
}

.link-domain {
  font-family: var(--mono);
  font-size: 0.95rem;
  font-weight: 600;
  overflow-wrap: anywhere;
  color: var(--ink);
}

.link-domain small {
  display: block;
  font: 400 0.78rem var(--sans);
  color: var(--muted);
  margin-top: 2px;
}

.link-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.fact {
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 10px 12px;
  background: var(--paper);
  display: grid;
  gap: 2px;
}

.fact b {
  font-size: 0.98rem;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.fact span {
  font: 500 0.7rem var(--mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.fact.bad b { color: var(--red); }
.fact.good b { color: var(--green); }

.link-title {
  margin-top: 14px;
  padding: 12px 14px;
  border-left: 3px solid var(--line-strong);
  background: var(--paper);
  border-radius: 0 var(--r) var(--r) 0;
  font-size: 0.92rem;
  color: var(--ink-2);
}

.link-title b { display: block; font-size: 0.95rem; color: var(--ink); margin-bottom: 3px; }

.reason-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.reason {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 12px;
  align-items: baseline;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--paper);
  font-size: 0.9rem;
}

.reason-weight {
  font: 700 0.88rem var(--mono);
  font-variant-numeric: tabular-nums;
  text-align: right;
  color: var(--red);
}

.reason-weight.good { color: var(--green); }

.reason-body { min-width: 0; }
.reason-body b { font-weight: 600; color: var(--ink); }

.reason-detail {
  display: block;
  font: 0.78rem var(--mono);
  color: var(--muted);
  margin-top: 3px;
  overflow-wrap: anywhere;
}

/* ------------------------------------------------------------- sections */
.block {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

.block > h2 {
  font-size: 1.02rem;
  font-family: var(--sans);
  font-weight: 700;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.block-hint {
  font-size: 0.85rem;
  line-height: 1.55;
  color: var(--muted);
  margin: 0 0 12px;
}

.tag-count {
  font: 700 0.7rem var(--mono);
  letter-spacing: 0.04em;
  color: var(--muted);
  background: var(--sunk);
  border-radius: 999px;
  padding: 2px 9px;
  font-variant-numeric: tabular-nums;
}

/* signals ---------------------------------------------------------------- */
.signals {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.signal {
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 12px 14px;
  background: var(--paper);
}

.signal-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
}

.signal-label {
  font-weight: 640;
  font-size: 0.94rem;
}

.signal-group {
  font: 600 0.7rem var(--mono);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}

.quote {
  margin-top: 8px;
  padding: 8px 12px;
  border-left: 3px solid var(--red);
  background: var(--red-soft);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  font-size: 0.88rem;
  color: var(--ink-2);
  overflow-wrap: anywhere;
}

.raw-evidence > summary {
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 650;
  color: var(--ink-2);
  padding: 2px 0;
}

.raw-evidence > summary:hover { color: var(--red); }
.raw-evidence[open] > summary { margin-bottom: 10px; }

/* conversation ----------------------------------------------------------- */
.chat { display: grid; gap: 10px; }

.bubble-row { display: flex; gap: 10px; align-items: flex-start; }
.bubble-row.me { flex-direction: row-reverse; }

.avatar {
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font: 700 0.72rem var(--sans);
  color: #fff;
  background: var(--ink-2);
}

.bubble-row.me .avatar { background: var(--focus); }

.bubble {
  max-width: min(560px, 82%);
  border-radius: var(--r);
  padding: 10px 13px;
  background: var(--paper);
  border: 1px solid var(--line);
  font-size: 0.9rem;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.bubble-row.risky .bubble {
  background: var(--red-soft);
  border-color: color-mix(in srgb, var(--red) 35%, transparent);
}

.bubble-head {
  display: flex;
  gap: 8px;
  align-items: baseline;
  margin-bottom: 3px;
  font-size: 0.72rem;
  color: var(--muted);
}

.bubble-head b { color: var(--ink-2); font-size: 0.76rem; }

.bubble-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }

.bubble-tags .chip,
.bubble .chip {
  font-size: 0.68rem;
  font-weight: 650;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid color-mix(in srgb, var(--red) 35%, transparent);
  color: var(--red);
}

/* breakdown -------------------------------------------------------------- */
.bars { display: grid; gap: 9px; }

.bar-row {
  display: grid;
  grid-template-columns: minmax(140px, 240px) minmax(0, 1fr) 46px;
  gap: 12px;
  align-items: center;
  font-size: 0.88rem;
}

@media (max-width: 620px) {
  .bar-row { grid-template-columns: minmax(0, 1fr) 40px; }
  .bar-row .bar-track { grid-column: 1 / -1; grid-row: 2; }
}

.bar-track {
  height: 7px;
  background: var(--sunk);
  border-radius: 999px;
  overflow: hidden;
}

.bar-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--red);
}

.bar-value {
  text-align: right;
  font: 700 0.84rem var(--mono);
  font-variant-numeric: tabular-nums;
  color: var(--ink-2);
}

/* links ------------------------------------------------------------------ */
.links { display: grid; gap: 10px; }

.link-card {
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 12px 14px;
  background: var(--paper);
}

.link-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
}

.link-host {
  font-family: var(--mono);
  font-size: 0.88rem;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.link-score {
  font: 700 0.88rem var(--mono);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.link-reasons {
  margin: 8px 0 0;
  padding-left: 18px;
  font-size: 0.82rem;
  color: var(--ink-2);
  display: grid;
  gap: 3px;
}

.link-official { color: var(--green); font-weight: 600; font-size: 0.84rem; margin-top: 6px; }

/* recommendations -------------------------------------------------------- */
.reco-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.reco {
  border-radius: var(--r);
  padding: 14px 16px;
  border: 1px solid;
}

.reco h3 {
  font-size: 0.78rem;
  font-family: var(--sans);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 9px;
}

.reco ol,
.reco ul {
  margin: 0;
  padding-left: 18px;
  font-size: 0.9rem;
  display: grid;
  gap: 6px;
  color: var(--ink-2);
}

.reco-do { background: var(--green-soft); border-color: color-mix(in srgb, var(--green) 28%, transparent); }
.reco-do h3 { color: var(--green); }

.reco-avoid { background: var(--red-soft); border-color: color-mix(in srgb, var(--red) 28%, transparent); }
.reco-avoid h3 { color: var(--red); }

.reco-verify { background: var(--amber-soft); border-color: color-mix(in srgb, var(--amber) 30%, transparent); }
.reco-verify h3 { color: var(--amber); }

.indicators { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 8px; }

.indicator {
  font-size: 0.8rem;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 5px 10px;
  color: var(--ink-2);
}

.indicator b { color: var(--ink); font-family: var(--mono); }

/* scanner ---------------------------------------------------------------- */
.scan-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}

.scan-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 10px;
  align-items: baseline;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--paper);
  font-size: 0.85rem;
}

.scan-score {
  font: 700 0.92rem var(--mono);
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.scan-body { min-width: 0; display: grid; gap: 2px; }

.scan-body b {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
}

.scan-signal {
  font-size: 0.78rem;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.scan-more { margin-top: 8px; }

.scan-more > summary {
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--link);
  padding: 6px 2px;
  list-style: none;
}

.scan-more > summary::-webkit-details-marker { display: none; }
.scan-more > summary::before { content: "▸ "; }
.scan-more[open] > summary::before { content: "▾ "; }
.scan-more > .scan-list { margin-top: 8px; }

/* similar cases ---------------------------------------------------------- */
.similar-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.similar-card {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--paper);
  cursor: pointer;
  transition: border-color 0.15s, transform 0.15s;
}

.similar-card:hover,
.similar-card:focus-visible {
  border-color: var(--ink);
  transform: translateY(-1px);
  outline: none;
}

.similar-sim {
  font: 700 0.86rem var(--mono);
  font-variant-numeric: tabular-nums;
  color: var(--ink-2);
  text-align: right;
}

.similar-body { min-width: 0; display: grid; gap: 2px; }
.similar-body b { font-size: 0.88rem; }

.similar-text {
  font-size: 0.8rem;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.similar-cta { font-size: 0.8rem; font-weight: 600; color: var(--link); white-space: nowrap; }
.similar-more { margin-top: 10px; width: 100%; }

.similar-detail {
  margin-top: 14px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--paper);
}

.similar-detail-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.similar-score {
  font-family: var(--display);
  font-size: 1.9rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

.similar-score small { font-size: 0.8rem; font-weight: 600; color: var(--muted); }
.similar-quote { margin: 8px 0; }

/* modal ------------------------------------------------------------------ */
.modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(14, 23, 38, 0.5);
  backdrop-filter: blur(3px);
}

.modal[hidden] { display: none !important; }

.modal-card {
  width: min(720px, 100%);
  max-height: min(84vh, 780px);
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: 0 24px 60px rgba(14, 23, 38, 0.3);
  padding: 20px 22px 22px;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  position: sticky;
  top: -20px;
  background: var(--surface);
  padding: 6px 0 8px;
}

.modal-head h3 { font-size: 1.05rem; display: flex; align-items: center; gap: 8px; }

.modal-close {
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--muted);
  width: 32px;
  height: 32px;
  border-radius: var(--r);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  flex: none;
}

.modal-close:hover { color: var(--red); border-color: var(--red); }

body.modal-open { overflow: hidden; }

@media (max-width: 640px) {
  .modal { padding: 0; align-items: flex-end; }
  .modal-card { width: 100%; max-height: 88vh; border-radius: var(--r-lg) var(--r-lg) 0 0; }
}

/* AI narrative ----------------------------------------------------------- */
.ai-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.ai-head h2 {
  font-family: var(--sans);
  font-size: 1.02rem;
  font-weight: 700;
}

.ai-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.84rem;
  color: var(--muted);
}

.spinner {
  width: 13px;
  height: 13px;
  border: 2px solid color-mix(in srgb, var(--red) 25%, transparent);
  border-top-color: var(--red);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
  flex: none;
}

@keyframes spin { to { transform: rotate(360deg); } }

.ai-body {
  font-size: 0.95rem;
  color: var(--ink-2);
  overflow-wrap: anywhere;
}

.ai-body h4 { font-size: 0.95rem; color: var(--red); margin: 16px 0 7px; }
.ai-body h4:first-child { margin-top: 0; }
.ai-body p { margin: 0 0 9px; }
.ai-body ul { margin: 0 0 10px; padding-left: 20px; display: grid; gap: 5px; }
.ai-body strong { color: var(--ink); font-weight: 680; }

.ai-body code {
  font-family: var(--mono);
  font-size: 0.82rem;
  background: var(--sunk);
  padding: 1px 5px;
  border-radius: var(--r-sm);
}

.tools { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }

.tool {
  font-family: var(--mono);
  font-size: 0.72rem;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--paper);
  border: 1px solid var(--line);
  color: var(--muted);
}

.tool.done { background: var(--green-soft); border-color: color-mix(in srgb, var(--green) 30%, transparent); color: var(--green); }

.tool-chips-mini {
  font-size: 0.82rem;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 0;
}

.progress-meta {
  display: flex;
  gap: 8px;
  align-items: center;
  font: 500 0.78rem var(--mono);
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.skeleton-card { display: grid; gap: 10px; color: var(--muted); font-size: 0.92rem; }

.deep-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
}

.copy-row { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }

/* notices ---------------------------------------------------------------- */
.notice {
  border-radius: var(--r);
  padding: 12px 14px;
  font-size: 0.88rem;
  border: 1px solid;
}

.notice-danger {
  background: var(--red-soft);
  border-color: color-mix(in srgb, var(--red) 30%, transparent);
  color: var(--red);
}

.notice-info {
  background: var(--sunk);
  border-color: var(--line);
  color: var(--ink-2);
}

/* ---------------------------------------------- marketing / static sections */
.band-section { padding-block: clamp(32px, 5vw, 64px) 0; }

.section-head {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 24px;
  max-width: 70ch;
}

.grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 270px), 1fr));
}

.card.how { display: flex; flex-direction: column; gap: 8px; }
.card.how h3 { font-size: 1.05rem; }
.card.how p { color: var(--muted); font-size: 0.92rem; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font: 500 0.68rem var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--sunk);
  color: var(--ink-2);
  width: fit-content;
}

.pill.red { background: var(--red-soft); color: var(--red); }
.pill.green { background: var(--green-soft); color: var(--green); }

.scam-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
}

.scam-list li {
  border: 1px solid var(--line);
  border-left: 3px solid var(--red);
  border-radius: var(--r);
  background: var(--surface);
  padding: 12px 14px;
  display: grid;
  gap: 3px;
  font-size: 0.88rem;
}

.scam-list b { color: var(--ink); font-size: 0.94rem; }
.scam-list span { color: var(--muted); }

.navy-band {
  margin-top: clamp(32px, 5vw, 64px);
  background: var(--navy);
  color: var(--on-navy);
  padding-block: clamp(32px, 5vw, 56px);
}

.navy-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
  align-items: center;
  justify-content: space-between;
}

.navy-band h2 { color: var(--on-navy); margin-top: 8px; }
.navy-band .eyebrow { color: var(--on-navy-muted); }

.navy-steps {
  margin: 16px 0 0;
  padding-left: 20px;
  display: grid;
  gap: 9px;
  color: var(--on-navy-muted);
  font-size: 0.94rem;
  max-width: 62ch;
}

.impact { padding-block: clamp(32px, 5vw, 56px); }

.impact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.impact-cell {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 14px 16px;
  display: grid;
  gap: 2px;
}

.impact-cell span {
  font-family: var(--display);
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  color: var(--red);
}

.impact-cell small { font-size: 0.78rem; color: var(--muted); }

.impact-top {
  list-style: none;
  margin: 14px 0 0;
  padding: 0;
  display: grid;
  gap: 6px;
}

.impact-top li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.82rem;
  padding: 8px 12px;
  border-radius: var(--r-sm);
  background: var(--surface);
  border: 1px solid var(--line);
}

.impact-top code { font-family: var(--mono); color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; }
.impact-top b { color: var(--red); white-space: nowrap; }

/* footer ----------------------------------------------------------------- */
.site-footer {
  border-top: 1px solid var(--line);
  background: var(--surface);
  padding-block: 32px 36px;
  font-size: 0.86rem;
  color: var(--muted);
}

.footer-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 24px 40px;
  align-items: start;
}

@media (max-width: 700px) {
  .footer-inner { grid-template-columns: 1fr; }
}

.footer-brand { display: grid; gap: 10px; }
.footer-brand .brand-logo { height: 30px; }

.footer-cols { display: flex; gap: 40px; flex-wrap: wrap; }
.footer-cols > div { display: grid; gap: 6px; align-content: start; }
.footer-cols b { color: var(--ink); font-size: 0.86rem; }
.footer-cols a { color: var(--muted); text-decoration: none; }
.footer-cols a:hover { color: var(--ink); text-decoration: underline; }

.footer-legal { grid-column: 1 / -1; border-top: 1px solid var(--line); padding-top: 14px; }

/* ------------------------------------------------------------- responsive */
@media (max-width: 860px) {
  .nav-toggle { display: inline-block; }
  .nav {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding-bottom: 12px;
    margin-left: 0;
  }
  .nav.open { display: flex; }
  .nav a { padding: 10px 12px; }
  .nav a.btn { margin-left: 0; justify-content: center; }
  .theme-toggle { align-self: flex-start; margin-left: 0; }
  .header-inner { flex-wrap: wrap; }
}

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

@media print {
  .site-header,
  .site-footer,
  .hero,
  .band-section,
  .navy-band,
  .impact,
  .copy-row,
  .deep-row {
    display: none !important;
  }
  body { background: #fff; }
  /* In đúng màu: thanh điểm, vòng điểm, nhãn mức rủi ro */
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .card,
  .block,
  .verdict { box-shadow: none; break-inside: avoid; }
  /* Nhận định của AI dài nhiều trang: cho phép ngắt trang, không được cắt */
  #narrative-slot .block,
  #link-narrative,
  .ai-body,
  .reco-list,
  #reco-slot { break-inside: auto; overflow: visible !important; max-height: none !important; }
  .ai-status, .spinner, .tools, .similar-cta, .btn, button { display: none !important; }
  .scan-more > :not(summary), .raw-evidence > :not(summary) { display: block !important; }
  .result-wrap, .result { display: block !important; }
}
