:root,
:root[data-theme="dark"] {
  --bg: #0b0f1a;
  --bg-glow: #141c2f;
  --card: #121828;
  --card-border: #222c42;
  --surface: #0f1522;
  --chip-bg: #1a2336;
  --track: #1f2940;
  --text: #e8ebf3;
  --muted: #8b93a7;
  --accent: #3b82f6;
  --advice-bg: #101b30;
  --advice-border: #24406e;
  --low: #2ecc71;
  --elevated: #f39c12;
  --high: #e74c3c;
  --nav-bg: #0d1322;
}

:root[data-theme="light"] {
  --bg: #f5f7fb;
  --bg-glow: #e3ecfb;
  --card: #ffffff;
  --card-border: #dde3ee;
  --surface: #f0f3f9;
  --chip-bg: #eaeff7;
  --track: #e3e8f2;
  --text: #17202e;
  --muted: #5b6577;
  --accent: #2f6fe0;
  --advice-bg: #eef4ff;
  --advice-border: #c4d6f5;
  --low: #1e9e56;
  --elevated: #c97a08;
  --high: #cf3a2e;
  --nav-bg: #0d1322;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: radial-gradient(1100px 500px at 50% -8%, var(--bg-glow) 0%, var(--bg) 55%);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  min-height: 100vh;
}

.topnav {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  background: var(--nav-bg);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.nav-brand {
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}

.shield { display: inline-block; transform: translateY(-1px); }

.nav-links { display: flex; align-items: center; gap: 18px; }

.nav-links a {
  color: #aab3c5;
  text-decoration: none;
  font-size: 0.88rem;
  transition: color 0.15s ease;
}

.nav-links a:hover { color: #fff; }

.nav-discord {
  background: var(--accent);
  color: #fff !important;
  padding: 7px 14px;
  border-radius: 8px;
  font-weight: 600;
}

.nav-discord:hover { filter: brightness(1.12); }

.theme-toggle {
  background: #1c2740;
  border: 1px solid #2a3752;
  border-radius: 50%;
  width: 34px;
  height: 34px;
  font-size: 0.95rem;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: transform 0.15s ease;
}

.theme-toggle:hover { transform: scale(1.08); }

.shell { max-width: 760px; margin: 0 auto; padding: 56px 20px 40px; }

.hero { text-align: center; margin-bottom: 36px; }

.hero h1 {
  font-size: clamp(2rem, 5vw, 2.9rem);
  letter-spacing: -0.03em;
  color: var(--text);
}

.tagline {
  color: var(--muted);
  margin-top: 12px;
  font-size: 1.05rem;
  line-height: 1.5;
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
}

.tabs { display: flex; gap: 6px; margin-bottom: 8px; }

.tab {
  background: var(--chip-bg);
  border: 1px solid var(--card-border);
  color: var(--muted);
  font: inherit;
  font-size: 0.86rem;
  padding: 7px 16px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 600;
}

.tab:hover:not(.active) { color: var(--text); }

.tab-hint { color: var(--muted); font-size: 0.8rem; margin: 0 0 10px 4px; }

.input-card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
}

textarea {
  width: 100%;
  resize: vertical;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font: inherit;
  line-height: 1.5;
  min-height: 110px;
}

textarea::placeholder { color: var(--muted); }

.char-count { color: var(--muted); font-size: 0.72rem; text-align: right; margin-top: 6px; }

.input-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--card-border);
  padding-top: 12px;
  margin-top: 8px;
}

.attach-btn {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--card-border);
  border-radius: 9px;
  padding: 9px 14px;
  font-size: 0.85rem;
  cursor: pointer;
}

.attach-btn:hover:not(:disabled) { color: var(--text); border-color: var(--accent); }
.attach-btn:disabled { opacity: 0.5; cursor: default; }

.analyze-btn {
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 9px;
  padding: 10px 30px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: filter 0.15s ease, opacity 0.15s ease;
}

.analyze-btn:hover:not(:disabled) { filter: brightness(1.15); }
.analyze-btn:disabled { opacity: 0.6; cursor: default; }

.loading {
  margin-top: 16px;
  color: var(--muted);
  font-size: 0.88rem;
  display: flex;
  align-items: center;
  gap: 10px;
}

.spinner {
  width: 14px; height: 14px;
  border: 2px solid var(--card-border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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

.result {
  background: var(--card);
  border-radius: 14px;
  padding: 22px;
  margin-top: 18px;
  animation: rise 0.25s ease;
  text-align: left;
}

.result.low      { border-left: 4px solid var(--low); }
.result.elevated { border-left: 4px solid var(--elevated); }
.result.high     { border-left: 4px solid var(--high); }
.result.error    { border-left: 4px solid var(--high); color: var(--muted); }

@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}

.verdict-head { display: flex; gap: 14px; align-items: flex-start; }

.verdict-emoji { font-size: 2rem; line-height: 1; }

.verdict-title { font-size: 1.3rem; margin-bottom: 4px; }

.result.low      .verdict-title { color: var(--low); }
.result.elevated .verdict-title { color: var(--elevated); }
.result.high     .verdict-title { color: var(--high); }

.summary { line-height: 1.45; }

.score-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 16px 0 6px;
}

.score-track {
  flex: 1;
  height: 8px;
  background: var(--track);
  border-radius: 999px;
  overflow: hidden;
}

.score-fill { height: 100%; border-radius: 999px; transition: width 0.4s ease; }
.result.low      .score-fill { background: var(--low); }
.result.elevated .score-fill { background: var(--elevated); }
.result.high     .score-fill { background: var(--high); }

.score-num { font-size: 0.85rem; color: var(--muted); white-space: nowrap; }

.mode-badge {
  font-size: 0.72rem;
  color: var(--muted);
  border: 1px solid var(--card-border);
  border-radius: 999px;
  padding: 2px 8px;
  white-space: nowrap;
}

.evidence-section { margin-top: 18px; }

.evidence-section h4 {
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 8px;
}

.signals { list-style: none; display: grid; gap: 8px; }

.signals li {
  background: var(--surface);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  padding: 10px 14px;
}

.signal-title { font-weight: 600; font-size: 0.92rem; }

.signal-detail { color: var(--muted); font-size: 0.86rem; margin-top: 3px; line-height: 1.4; }

.intel-table { width: 100%; border-collapse: collapse; font-size: 0.87rem; }

.intel-table td { padding: 6px 10px; border-bottom: 1px solid var(--card-border); vertical-align: top; }

.intel-table tr:last-child td { border-bottom: none; }

.intel-table .k { color: var(--muted); width: 160px; }

.intel-table .v { word-break: break-all; }

.advice {
  margin-top: 18px;
  background: var(--advice-bg);
  border: 1px solid var(--advice-border);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 0.9rem;
}

.advice strong { display: block; margin-bottom: 4px; color: var(--accent); }

.advice p { line-height: 1.45; }

.feedback-row {
  margin-top: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.84rem;
}

.fb-btn {
  background: var(--chip-bg);
  border: 1px solid var(--card-border);
  border-radius: 999px;
  color: var(--text);
  padding: 4px 12px;
  font-size: 0.82rem;
  cursor: pointer;
}

.fb-btn:hover:not(:disabled) { border-color: var(--accent); }
.fb-btn:disabled { opacity: 0.5; cursor: default; }

.fb-note { color: var(--low); font-size: 0.8rem; }

.share-btn {
  margin-top: 16px;
  background: var(--chip-bg);
  color: var(--text);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  padding: 8px 16px;
  font-size: 0.85rem;
  cursor: pointer;
}

.share-btn:hover { border-color: var(--accent); }

.recent-section, .how-section { margin-top: 64px; }

.recent-section h2, .how-section h2 {
  font-size: 1.25rem;
  letter-spacing: -0.01em;
  margin-bottom: 6px;
}

.section-sub { color: var(--muted); font-size: 0.92rem; margin-bottom: 18px; }

.history-card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  padding: 10px;
}

.history { list-style: none; display: grid; gap: 2px; }

.history li.empty { color: var(--muted); font-size: 0.88rem; padding: 18px 14px; }

.history a {
  display: flex;
  gap: 10px;
  align-items: baseline;
  color: var(--text);
  text-decoration: none;
  font-size: 0.86rem;
  line-height: 1.35;
  padding: 9px 12px;
  border-radius: 8px;
  overflow: hidden;
}

.history a:hover { background: var(--surface); }

.dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; position: relative; top: -1px; }
.dot.low { background: var(--low); }
.dot.elevated { background: var(--elevated); }
.dot.high { background: var(--high); }

.hist-text {
  min-width: 0;
  flex: 1;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hist-mode { color: var(--muted); font-size: 0.72rem; margin-right: 4px; }

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

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

.feature-card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  padding: 20px;
}

.feature-icon { font-size: 1.4rem; }

.feature-card h3 { font-size: 0.98rem; margin: 10px 0 6px; }

.feature-card p { color: var(--muted); font-size: 0.85rem; line-height: 1.5; }

.faq { margin-top: 56px; }

.faq details {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  padding: 12px 16px;
  margin-bottom: 8px;
}

.faq summary { cursor: pointer; font-weight: 600; font-size: 0.92rem; }

.faq p { color: var(--muted); font-size: 0.88rem; line-height: 1.5; margin-top: 8px; }

.site-footer { background: #ffffff; color: #17202e; margin-top: 72px; }

.footer-inner {
  max-width: 760px;
  margin: 0 auto;
  padding: 32px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.beta-copy strong { font-size: 1rem; }

.beta-copy p { color: #5b6577; font-size: 0.85rem; margin-top: 4px; max-width: 380px; }

.beta-form { display: flex; gap: 8px; flex-wrap: wrap; }

.beta-form input {
  border: 1px solid #cdd5e3;
  border-radius: 9px;
  padding: 10px 14px;
  font: inherit;
  font-size: 0.88rem;
  min-width: 220px;
  color: #17202e;
  outline: none;
}

.beta-form input:focus { border-color: var(--accent); }

.beta-btn {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 9px;
  padding: 10px 20px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
}

.beta-btn:hover { filter: brightness(1.12); }

.footer-bottom {
  border-top: 1px solid #e5e9f1;
  padding: 14px 20px;
  max-width: 760px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  color: #7a8398;
  font-size: 0.76rem;
}

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: #1c2740;
  border: 1px solid #2a3752;
  border-left: 4px solid var(--accent);
  color: #e8ebf3;
  border-radius: 10px;
  padding: 10px 18px;
  font-size: 0.86rem;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
  opacity: 0;
  transition: transform 0.25s ease, opacity 0.25s ease;
  z-index: 50;
  max-width: 90vw;
}

.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }

@media (max-width: 560px) {
  .shell { padding-top: 36px; }
  .nav-links a:not(.nav-discord) { display: none; }
}

.shell.wide { max-width: 900px; }

.stat-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 26px 0 6px;
}

@media (max-width: 640px) { .stat-cards { grid-template-columns: 1fr; } }

.stat-card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 16px;
  text-align: center;
}

.stat-card strong { display: block; font-size: 1.6rem; color: var(--accent); }

.stat-card span { color: var(--muted); font-size: 0.8rem; }

.scam-link { text-decoration: none; color: var(--text); transition: border-color 0.15s ease; }

.scam-link:hover { border-color: var(--accent); }

.scam-list { padding-left: 20px; color: var(--text); font-size: 0.92rem; line-height: 1.7; }

.live-count { margin-top: 12px; color: var(--muted); font-size: 0.9rem; }

.live-count strong { color: var(--accent); }

.advice a { color: var(--accent); }

.footer-bottom a { color: #4a5468; }
