:root {
  font-family: 'DM Sans', Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color-scheme: dark;
  --bg: #080c12;
  --bg-raised: #0c121b;
  --card: rgba(14, 21, 32, .88);
  --card-solid: #0e1520;
  --surface: #111a27;
  --surface-hover: #172333;
  --text: #eef3fb;
  --text-soft: #a6b3c5;
  --muted: #77869b;
  --faint: #526176;
  --line: rgba(146, 166, 193, .15);
  --line-strong: rgba(146, 166, 193, .25);
  --accent: #58a6ff;
  --accent-strong: #388bfd;
  --accent-soft: rgba(56, 139, 253, .12);
  --green: #56d4a4;
  --amber: #e8ba69;
  --red: #ff7878;
  --shadow: 0 24px 80px rgba(0, 0, 0, .18);
  --radius: 18px;
  --mono: 'DM Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

:root[data-theme='light'] {
  color-scheme: light;
  --bg: #f4f7fb;
  --bg-raised: #edf2f8;
  --card: rgba(255, 255, 255, .91);
  --card-solid: #fff;
  --surface: #f3f6fa;
  --surface-hover: #e9f0f8;
  --text: #172233;
  --text-soft: #526174;
  --muted: #718096;
  --faint: #8c99aa;
  --line: rgba(57, 75, 101, .12);
  --line-strong: rgba(57, 75, 101, .2);
  --accent: #1674e8;
  --accent-strong: #1267d1;
  --accent-soft: rgba(22, 116, 232, .09);
  --green: #168767;
  --amber: #a46b11;
  --red: #c54646;
  --shadow: 0 24px 80px rgba(34, 58, 88, .08);
}

* { box-sizing: border-box; }
html { min-width: 320px; scroll-behavior: smooth; }
body { margin: 0; min-height: 100vh; color: var(--text); background: var(--bg); transition: color .2s ease, background-color .2s ease; }
button, input { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible, a:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
a { color: inherit; }
[hidden] { display: none !important; }
.constellation { position: fixed; inset: 0; z-index: 0; width: 100%; height: 100%; pointer-events: none; opacity: .52; }
.site-shell { width: min(1160px, calc(100% - 56px)); margin: 0 auto; position: relative; z-index: 1; }
.topbar { min-height: 94px; display: grid; grid-template-columns: 1fr minmax(300px, 1.5fr) 1fr; align-items: center; gap: 24px; border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 11px; width: max-content; text-decoration: none; }
.brand-mark { width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid var(--line-strong); background: var(--card); border-radius: 10px; }
.brand-mark svg { width: 24px; height: 24px; fill: none; stroke: var(--accent); stroke-width: 1.6; }
.brand-mark circle { fill: var(--accent); stroke: var(--bg); stroke-width: 1; }
.brand-name { font: 700 12px/1 var(--mono); letter-spacing: .11em; }
.brand-name span { color: var(--accent); }
.header-center { text-align: center; }
.header-center h1 { margin: 0; font: 700 16px/1.35 Manrope, sans-serif; letter-spacing: -.02em; }
.header-center p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.header-actions { display: flex; justify-content: flex-end; align-items: center; gap: 13px; }
.mode-switch { display: inline-flex; gap: 3px; padding: 4px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg-raised); }
.mode-tab { min-width: 70px; padding: 7px 12px; border: 0; border-radius: 7px; color: var(--muted); background: transparent; font-size: 12px; font-weight: 600; cursor: pointer; transition: color .18s, background-color .18s; }
.mode-tab:hover { color: var(--text); }
.mode-tab.is-active { color: var(--text); background: var(--surface-hover); box-shadow: inset 0 0 0 1px var(--line); }
.theme-toggle { width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 10px; background: var(--card); cursor: pointer; color: var(--text-soft); }
.theme-toggle:hover { background: var(--surface-hover); color: var(--text); }
.theme-toggle svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; }
.icon-sun { display: none; }
:root[data-theme='light'] .icon-sun { display: block; }
:root[data-theme='light'] .icon-moon { display: none; }
main { min-height: 65vh; }
.search-stage { padding: 63px 0 31px; text-align: center; }
.eyebrow { display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--accent); font: 500 9px/1 var(--mono); letter-spacing: .16em; }
.eyebrow-line { width: 23px; height: 1px; background: currentColor; opacity: .55; }
.search-stage h2 { margin: 17px 0 8px; font: 700 clamp(25px, 3.4vw, 37px)/1.2 Manrope, sans-serif; letter-spacing: -.045em; }
.stage-copy { margin: 0; color: var(--text-soft); font-size: 14px; }
.mode-view { width: min(690px, 100%); margin: 29px auto 0; }
.search-form { display: flex; align-items: center; min-height: 59px; gap: 10px; padding: 7px; border: 1px solid var(--line-strong); border-radius: 14px; background: var(--card); box-shadow: 0 14px 45px rgba(0, 0, 0, .12); text-align: left; }
.input-prefix { flex: 0 0 auto; padding-left: 12px; color: var(--muted); font: 12px var(--mono); white-space: nowrap; }
.search-form input, .compare-input-wrap input { width: 100%; min-width: 0; border: 0; outline: none; color: var(--text); background: transparent; font-size: 14px; }
.search-form input::placeholder, .compare-input-wrap input::placeholder { color: var(--faint); }
.input-hint { margin: 10px 0 0; color: var(--muted); font-size: 11px; }
.form-error { margin: 9px 0 0; color: var(--red); font-size: 12px; }
.recent-row { display: flex; justify-content: center; align-items: center; gap: 10px; margin: 17px auto 0; flex-wrap: wrap; }
.recent-label { color: var(--muted); font: 10px var(--mono); letter-spacing: .11em; }
.recent-list { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.recent-chip { padding: 5px 10px; border: 1px solid var(--line); border-radius: 999px; color: var(--text-soft); background: var(--card); font: 10px var(--mono); cursor: pointer; }
.recent-chip:hover { border-color: var(--accent); color: var(--accent); }
.clear-history { color: var(--muted) !important; }
.site-footer { display: flex; justify-content: space-between; align-items: center; gap: 16px; min-height: 68px; margin-top: 44px; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; }
.site-footer > span:first-child { color: var(--text-soft); font: 500 9px var(--mono); letter-spacing: .09em; }
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--accent); }
.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; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
