:root {
  --bg: #0b1220; --surface: #121a2b; --surface2: #1a2438; --border: #2a3650;
  --text: #e8eef9; --muted: #9aabc8; --accent: #3d8bfd; --good: #22c55e;
  --input-bg: #0d1424; --glow: #1a2a4a;
  --font: "Segoe UI", system-ui, -apple-system, sans-serif;
}
html[data-theme="light"] {
  --bg: #f4f6f9; --surface: #ffffff; --surface2: #f1f5f9; --border: #e2e8f0;
  --text: #0f172a; --muted: #64748b; --accent: #2563eb; --good: #059669;
  --input-bg: #ffffff; --glow: #dbeafe;
}
* { box-sizing: border-box; }
body {
  margin: 0; font-family: var(--font); background:
    radial-gradient(900px 400px at 10% -10%, var(--glow) 0%, transparent 50%), var(--bg);
  color: var(--text); line-height: 1.65; min-height: 100vh;
}
a { color: var(--accent); }
.wrap { max-width: 720px; margin: 0 auto; padding: 24px 18px 64px; }
nav.top {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  margin-bottom: 24px; font-size: .88rem; padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
nav.top a {
  color: var(--muted); text-decoration: none;
  padding: 6px 12px; border: 1px solid var(--border); border-radius: 999px;
}
nav.top a:hover { color: var(--text); border-color: var(--accent); }
nav.top a.home {
  background: linear-gradient(135deg, #2563eb, #3d8bfd); color: #fff; border: none; font-weight: 700;
}
nav.top a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.theme-btn, button.theme-btn {
  appearance: none; cursor: pointer; font: inherit; font-size: .88rem; font-weight: 600;
  color: var(--muted); background: var(--surface); border: 1px solid var(--border);
  padding: 6px 12px; border-radius: 999px;
}
.theme-btn:hover { color: var(--text); border-color: var(--accent); }
h1 { font-size: clamp(1.5rem, 4vw, 2rem); line-height: 1.25; margin: 0 0 12px; letter-spacing: -0.02em; }
.lede { color: var(--muted); font-size: 1.05rem; margin: 0 0 22px; }
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; padding: 18px; margin: 20px 0;
  box-shadow: 0 10px 30px rgba(0,0,0,.12);
}
label { display: block; font-size: .88rem; color: var(--muted); margin-bottom: 5px; }
.field { margin-bottom: 12px; }
input, select {
  width: 100%; background: var(--input-bg); border: 1px solid var(--border); color: var(--text);
  border-radius: 10px; padding: 11px 12px; font-size: 1rem;
}
input:focus, select:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(61,139,253,.2);
}
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 520px) { .row2 { grid-template-columns: 1fr; } }
.big { font-size: clamp(1.5rem, 4vw, 1.9rem); font-weight: 800; color: var(--good); margin: 10px 0 4px; }
.sub { color: var(--muted); font-size: .9rem; }
.btn {
  appearance: none; border: none; border-radius: 10px; padding: 11px 16px;
  font-weight: 700; cursor: pointer;
  background: linear-gradient(135deg, #2563eb, #3d8bfd); color: #fff; margin-top: 4px;
}
.btn:hover { filter: brightness(1.06); }
.btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.presets { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.preset {
  border: 1px dashed var(--border); background: transparent; color: var(--muted);
  font-size: .78rem; padding: 6px 10px; border-radius: 8px; cursor: pointer; font-weight: 600;
}
.preset:hover { border-color: var(--accent); color: var(--text); }
article h2 { font-size: 1.2rem; margin: 28px 0 10px; }
article p, article li { color: var(--muted); }
article ul { padding-left: 1.2rem; }
.metrics {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px;
}
.metric {
  background: var(--surface2); border: 1px solid var(--border); border-radius: 10px; padding: 10px;
}
.metric .k { font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.metric .v { font-weight: 700; margin-top: 3px; font-size: 1rem; }
footer {
  margin-top: 40px; padding-top: 16px; border-top: 1px solid var(--border);
  color: var(--muted); font-size: .85rem;
}
.cta {
  display: inline-block; margin-top: 8px; padding: 10px 16px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  text-decoration: none; color: var(--text); font-weight: 600;
}
.cta:hover { border-color: var(--accent); }
.badge {
  display: inline-block; font-size: 11px; text-transform: uppercase; letter-spacing: .04em;
  color: var(--good); background: rgba(34,197,94,.12); border: 1px solid rgba(34,197,94,.35);
  padding: 4px 10px; border-radius: 999px; margin-bottom: 12px;
}
html[data-theme="light"] .badge {
  background: rgba(5,150,105,.1); border-color: rgba(5,150,105,.35);
}
details {
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  padding: 12px 14px; margin-bottom: 8px;
}
summary { cursor: pointer; font-weight: 650; color: var(--text); }
details p { margin: 10px 0 0; color: var(--muted); }
article ol { color: var(--muted); }
.cta { margin-right: 8px; margin-bottom: 8px; }
