:root {
  --bg: #f6f8fb;
  --card: #ffffff;
  --text: #16213a;
  --muted: #5b6b82;
  --border: #e2e8f0;
  --primary: #1d4ed8;
  --primary-dark: #1e40af;
  --safe: #16a34a;
  --safe-bg: #dcfce7;
  --suspicious: #d97706;
  --suspicious-bg: #fef3c7;
  --scam: #dc2626;
  --scam-bg: #fee2e2;
  --radius: 16px;
  --shadow: 0 4px 24px rgba(22, 33, 58, .07);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

.container { max-width: 760px; margin: 0 auto; padding: 0 16px; }
.hidden { display: none !important; }
.spacer { flex: 1; }

/* ---------- header ---------- */
.site-header {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 10;
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding-top: 12px; padding-bottom: 12px;
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-logo { font-size: 34px; line-height: 1; }
.brand-name { margin: 0; font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.brand-tagline { margin: 0; font-size: 13px; color: var(--muted); }

.lang-toggle { display: flex; border: 1px solid var(--border); border-radius: 999px; overflow: hidden; flex-shrink: 0; }
.lang-btn {
  border: 0; background: transparent; padding: 7px 14px; cursor: pointer;
  font: 600 13px 'Inter', sans-serif; color: var(--muted);
}
.lang-btn.active { background: var(--primary); color: #fff; }

/* ---------- hero ---------- */
.hero { text-align: center; padding: 36px 0 8px; }
.hero h2 { margin: 0 0 8px; font-size: clamp(26px, 5.5vw, 38px); font-weight: 800; letter-spacing: -.02em; line-height: 1.2; }
.hero-sub { margin: 0 auto; max-width: 620px; color: var(--muted); font-size: 16px; }
.hero-sub strong { color: var(--text); }

.stat-row { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; margin: 20px 0 8px; }
.stat {
  background: var(--card); border: 1px solid var(--border); border-radius: 12px;
  padding: 10px 18px; display: flex; flex-direction: column; align-items: center; min-width: 120px;
}
.stat strong { font-size: 22px; font-weight: 800; color: var(--primary); line-height: 1.1; }
.stat span { font-size: 12px; color: var(--muted); text-align: center; }

/* ---------- cards ---------- */
.card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 20px; margin: 20px 0;
}
.card h3 { margin: 0 0 12px; font-size: 18px; font-weight: 700; }

/* ---------- checker ---------- */
.field-label { display: block; font-weight: 600; margin-bottom: 8px; font-size: 15px; }
textarea {
  width: 100%; border: 1.5px solid var(--border); border-radius: 12px;
  padding: 14px; font: 400 15px/1.6 'Inter', sans-serif; color: var(--text);
  resize: vertical; min-height: 130px; background: #fbfcfe;
}
textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(29, 78, 216, .15); background: #fff; }
.char-row { display: flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); margin: 6px 0 12px; }

.btn {
  border: 0; border-radius: 10px; padding: 11px 18px; cursor: pointer;
  font: 600 15px 'Inter', sans-serif; transition: filter .15s, transform .05s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { background: #eef2ff; color: var(--primary-dark); border: 1px solid #c7d2fe; }
.btn-secondary:hover { filter: brightness(.97); }
.btn-ghost { background: transparent; color: var(--muted); padding: 8px 10px; font-size: 13px; }
.btn-ghost:hover { color: var(--text); background: #f1f5f9; }
.btn-block { width: 100%; padding: 14px; font-size: 16px; }
.btn-small { padding: 6px 10px; font-size: 12px; }

.examples { margin-top: 20px; border-top: 1px dashed var(--border); padding-top: 16px; }
.examples-title { margin: 0 0 10px; font-size: 13px; font-weight: 600; color: var(--muted); }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 1px solid var(--border); background: #f8fafc; border-radius: 999px;
  padding: 6px 12px; font: 500 13px 'Inter', sans-serif; color: var(--text); cursor: pointer;
}
.chip:hover { border-color: var(--primary); color: var(--primary); background: #eff6ff; }
.chip .chip-tag { font-weight: 700; margin-right: 4px; }
.chip.tag-scam .chip-tag { color: var(--scam); }
.chip.tag-suspicious .chip-tag { color: var(--suspicious); }
.chip.tag-safe .chip-tag { color: var(--safe); }

/* ---------- result ---------- */
.result-head { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.result-kicker { margin: 0; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.verdict-badge {
  display: inline-block; margin: 6px 0 4px; padding: 6px 16px; border-radius: 999px;
  font-size: 22px; font-weight: 800;
}
.verdict-badge.safe { background: var(--safe-bg); color: var(--safe); }
.verdict-badge.suspicious { background: var(--suspicious-bg); color: var(--suspicious); }
.verdict-badge.scam { background: var(--scam-bg); color: var(--scam); }
.verdict-desc { margin: 0; color: var(--muted); font-size: 14px; max-width: 420px; }

.score-box { text-align: right; }
.score-num { font-size: 42px; font-weight: 800; line-height: 1; letter-spacing: -.02em; }
.score-num small { font-size: 18px; color: var(--muted); font-weight: 600; }
.score-label { margin: 4px 0 0; font-size: 12px; color: var(--muted); font-weight: 600; }

.gauge { margin: 22px 0 6px; }
.gauge-track {
  position: relative; height: 14px; border-radius: 999px;
  background: linear-gradient(90deg, var(--safe) 0 40%, var(--suspicious) 40% 70%, var(--scam) 70% 100%);
  opacity: .85;
}
.gauge-fill { height: 100%; border-radius: 999px; background: rgba(255, 255, 255, .45); }
.gauge-marker {
  position: absolute; top: 50%; width: 4px; height: 22px; background: var(--text);
  border-radius: 2px; transform: translate(-50%, -50%); transition: left .6s ease;
}
.gauge-scale { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin-top: 4px; }
.gauge-zones { display: flex; font-size: 11px; font-weight: 600; color: var(--muted); margin-top: 2px; }
.gauge-zones span:nth-child(1) { flex: 0 0 40%; }
.gauge-zones span:nth-child(2) { flex: 0 0 30%; }
.gauge-zones span:nth-child(3) { flex: 1; text-align: right; }

.block-title { font-weight: 700; font-size: 14px; margin: 20px 0 8px; }
.highlighted-text {
  background: #f8fafc; border: 1px solid var(--border); border-radius: 12px;
  padding: 14px; margin: 0; font-size: 15px; white-space: pre-wrap; word-break: break-word;
}
.highlighted-text mark {
  background: #fde047; color: inherit; padding: 1px 3px; border-radius: 4px;
  box-shadow: inset 0 -2px 0 #eab308; cursor: help;
}
.highlight-legend { font-size: 12px; color: var(--muted); margin: 8px 0 0; display: flex; align-items: center; gap: 6px; }
.legend-mark { display: inline-block; width: 14px; height: 14px; background: #fde047; border-radius: 3px; box-shadow: inset 0 -2px 0 #eab308; }

.flags-count {
  background: #f1f5f9; border-radius: 999px; padding: 1px 9px;
  font-size: 12px; font-weight: 700; color: var(--muted);
}
.flags-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.flag-item { border: 1px solid var(--border); border-left: 4px solid var(--suspicious); border-radius: 10px; padding: 10px 12px; }
.flag-item.sev-high { border-left-color: var(--scam); }
.flag-item.sev-med { border-left-color: var(--suspicious); }
.flag-item.sev-low { border-left-color: #64748b; }
.flag-top { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.flag-label { font-weight: 700; font-size: 14px; }
.flag-weight { font-size: 12px; font-weight: 700; color: var(--muted); white-space: nowrap; }
.flag-why { margin: 4px 0 0; font-size: 13px; color: var(--muted); }
.flag-match { margin: 6px 0 0; font-size: 12px; color: var(--muted); }
.flag-match code { background: #f1f5f9; padding: 1px 6px; border-radius: 5px; font-family: ui-monospace, monospace; }
.no-flags { color: var(--safe); font-weight: 600; font-size: 14px; margin: 0; }

.advice-box { border-radius: 12px; padding: 14px 16px; margin-top: 20px; font-size: 14px; }
.advice-box.safe { background: var(--safe-bg); color: #14532d; }
.advice-box.suspicious { background: var(--suspicious-bg); color: #78350f; }
.advice-box.scam { background: var(--scam-bg); color: #7f1d1d; }
.advice-box strong { display: block; margin-bottom: 2px; }
.advice-box p { margin: 0; }

.result-actions { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.copy-toast { color: var(--safe); font-size: 13px; font-weight: 600; margin: 10px 0 0; }

/* ---------- how / history ---------- */
.how-list { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; font-size: 14px; color: var(--muted); }
.how-list strong { color: var(--text); }
.how-note { font-size: 13px; color: var(--muted); background: #f8fafc; border-radius: 10px; padding: 10px 12px; margin: 14px 0 0; }

.history-head { display: flex; justify-content: space-between; align-items: center; }
.history-head h3 { margin: 0; }
.history-empty { color: var(--muted); font-size: 14px; margin: 8px 0 0; }
.history-list { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.history-item {
  display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--border);
  border-radius: 10px; padding: 10px 12px; cursor: pointer; background: #fbfcfe;
}
.history-item:hover { border-color: var(--primary); }
.history-dot { width: 12px; height: 12px; border-radius: 50%; margin-top: 5px; flex-shrink: 0; }
.history-dot.safe { background: var(--safe); }
.history-dot.suspicious { background: var(--suspicious); }
.history-dot.scam { background: var(--scam); }
.history-text { flex: 1; min-width: 0; }
.history-text p { margin: 0; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history-meta { font-size: 12px; color: var(--muted); }
.history-del { border: 0; background: transparent; cursor: pointer; font-size: 15px; color: var(--muted); padding: 2px 6px; }
.history-del:hover { color: var(--scam); }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--border); padding: 20px 0 32px; font-size: 13px; color: var(--muted); }
.site-footer p { margin: 4px 0; }
.footer-small { font-size: 12px; }

@media (max-width: 560px) {
  .card { padding: 16px; }
  .brand-tagline { display: none; }
  .score-num { font-size: 34px; }
  .verdict-badge { font-size: 19px; }
  .result-head { flex-direction: column; }
  .score-box { text-align: left; }
  .stat { min-width: 100px; padding: 8px 12px; }
}
