:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #f0f2f5;
  --ink: #0e1726;
  --ink-2: #4a5568;
  --ink-3: #718096;
  --line: #e2e6ec;
  --brand: #0b3d91;
  --brand-ink: #ffffff;
  --focus: #2563eb;
  --warn: #c62828;
  --warn-bg: #fdecea;
  --watch: #b45309;
  --watch-bg: #fff4e0;
  --adv: #1d4ed8;
  --adv-bg: #e8effd;
  --emer: #7b1fa2;
  --emer-bg: #f4e8fa;
  --ok: #15803d;
  --ok-bg: #e7f6ec;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(14, 23, 38, .06), 0 4px 16px rgba(14, 23, 38, .06);
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1220;
    --surface: #111a2b;
    --surface-2: #17223a;
    --ink: #e8edf5;
    --ink-2: #b4bfd0;
    --ink-3: #8592a8;
    --line: #243049;
    --brand: #5b8def;
    --brand-ink: #06122a;
    --focus: #7aa7ff;
    --warn: #ff8a80;
    --warn-bg: #3a1618;
    --watch: #ffc36b;
    --watch-bg: #3a2a10;
    --adv: #93b4ff;
    --adv-bg: #16254a;
    --emer: #e1a6ff;
    --emer-bg: #2e1740;
    --ok: #6fdc97;
    --ok-bg: #12301f;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.55 var(--font); }
a { color: var(--brand); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.01em; }
p { margin: 0 0 1em; }
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 720px; }
.muted { color: var(--ink-3); }
.fine { font-size: 13px; color: var(--ink-3); }
.hidden { display: none !important; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }

/* Top bar */
.topbar { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.topbar .wrap { display: flex; align-items: center; justify-content: space-between; height: 60px; gap: 12px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; color: var(--ink); text-decoration: none; }
.brand .dot { width: 12px; height: 12px; border-radius: 50%; background: var(--warn); box-shadow: 0 0 0 4px var(--warn-bg); }
.topbar nav { display: flex; gap: 16px; align-items: center; }
.topbar nav a { color: var(--ink-2); text-decoration: none; font-weight: 500; }
.topbar nav a:hover { color: var(--ink); }

/* Buttons & inputs */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px;
  border-radius: 10px; border: 1px solid transparent; background: var(--brand); color: var(--brand-ink); font: 600 15px var(--font);
  cursor: pointer; text-decoration: none; }
.btn:hover { filter: brightness(1.08); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.secondary { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn.danger { background: transparent; color: var(--warn); border-color: var(--warn); }
.btn.small { min-height: 34px; padding: 0 12px; font-size: 14px; }
.btn.block { width: 100%; }
label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; }
input[type=text], input[type=tel], input[type=time], select {
  width: 100%; min-height: 46px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface); color: var(--ink); font: 16px var(--font); }
input:focus, select:focus { outline: 2px solid var(--focus); outline-offset: 0; border-color: transparent; }
.field { margin-bottom: 14px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; }
.row > * { flex: 1 1 160px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; font-size: 13px; color: var(--ink-2); }
.check input { margin-top: 3px; width: 18px; height: 18px; flex: none; }
.code-input { letter-spacing: .4em; font-size: 22px !important; text-align: center; font-variant-numeric: tabular-nums; }
.msg { padding: 10px 12px; border-radius: 10px; font-size: 14px; margin: 10px 0; }
.msg.error { background: var(--warn-bg); color: var(--warn); }
.msg.ok { background: var(--ok-bg); color: var(--ok); }

/* Cards */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.card + .card { margin-top: 16px; }
.card h2 { font-size: 18px; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.card-head h2 { margin: 0; }

/* Hero */
.hero { padding: 56px 0 40px; }
.hero .wrap { display: grid; grid-template-columns: 1.15fr .85fr; gap: 40px; align-items: start; }
.hero h1 { font-size: clamp(32px, 5vw, 48px); }
.hero .lede { font-size: 19px; color: var(--ink-2); max-width: 34em; }
.text-us { display: inline-flex; flex-direction: column; gap: 2px; background: var(--surface); border: 1px dashed var(--line);
  border-radius: 12px; padding: 14px 18px; margin: 8px 0 18px; }
.text-us strong { font-size: 22px; letter-spacing: .01em; }
.text-us .kw { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--surface-2); padding: 1px 6px; border-radius: 6px; }
.ticks { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.ticks li { padding-left: 28px; position: relative; color: var(--ink-2); }
.ticks li::before { content: ""; position: absolute; left: 4px; top: 7px; width: 12px; height: 7px; border-left: 2.5px solid var(--ok); border-bottom: 2.5px solid var(--ok); transform: rotate(-45deg); }

.section { padding: 40px 0; border-top: 1px solid var(--line); }
.section h2 { font-size: 26px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.step-num { width: 32px; height: 32px; border-radius: 50%; background: var(--brand); color: var(--brand-ink); display: grid; place-items: center; font-weight: 700; margin-bottom: 10px; }
.types { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.type { border-left: 4px solid var(--line); background: var(--surface); padding: 14px 16px; border-radius: 10px; border-top: 1px solid var(--line); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.type.warning { border-left-color: var(--warn); }
.type.watch { border-left-color: var(--watch); }
.type.advisory { border-left-color: var(--adv); }
.type.emergency { border-left-color: var(--emer); }
.type h3 { font-size: 16px; margin-bottom: 4px; }
.type p { margin: 0; font-size: 14px; color: var(--ink-2); }
table.cmds { width: 100%; border-collapse: collapse; font-size: 15px; }
table.cmds td { padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.cmds td:first-child { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; white-space: nowrap; font-weight: 600; width: 1%; padding-right: 20px; }

/* Chips */
.chip { display: inline-block; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: 3px 8px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); }
.chip.warning { background: var(--warn-bg); color: var(--warn); }
.chip.watch { background: var(--watch-bg); color: var(--watch); }
.chip.advisory, .chip.statement { background: var(--adv-bg); color: var(--adv); }
.chip.emergency { background: var(--emer-bg); color: var(--emer); }
.chip.live, .chip.active { background: var(--ok-bg); color: var(--ok); }
.chip.unsubscribed, .chip.pending { background: var(--warn-bg); color: var(--warn); }

/* Dashboard */
.dash { padding: 28px 0 48px; }
.dash-grid { display: grid; grid-template-columns: 1.2fr .8fr; gap: 16px; align-items: start; }
.banner { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 14px 18px; border-radius: var(--radius); margin-bottom: 16px; }
.banner.active { background: var(--ok-bg); color: var(--ok); }
.banner.unsubscribed { background: var(--warn-bg); color: var(--warn); }
.banner strong { color: inherit; }
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.list li:last-child { border-bottom: 0; }
.list .meta { font-size: 13px; color: var(--ink-3); }
.empty { color: var(--ink-3); font-size: 15px; padding: 8px 0; }
.alert-item { display: block; text-decoration: none; color: inherit; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--line); margin-bottom: 8px; }
.alert-item:hover { background: var(--surface-2); }
.alert-item .t { font-weight: 700; }
.switch { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.switch:last-child { border-bottom: 0; }
.switch .d { font-size: 13px; color: var(--ink-3); font-weight: 400; }
.switch input { appearance: none; width: 46px; height: 28px; border-radius: 999px; background: var(--line); position: relative; flex: none; cursor: pointer; transition: background .15s; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.25); }
.switch input:checked { background: var(--ok); }
.switch input:checked::after { transform: translateX(18px); }
.saved { font-size: 13px; color: var(--ok); opacity: 0; transition: opacity .2s; }
.saved.show { opacity: 1; }

/* Auth card */
.auth { max-width: 440px; margin: 48px auto; }

/* Alert page */
.alert-page { padding: 24px 16px 48px; }
.alert-page .back { display: inline-block; margin-bottom: 16px; text-decoration: none; }
.alert-head { border-left: 6px solid var(--line); padding: 4px 0 4px 16px; margin-bottom: 20px; }
.alert-head.cat-warning { border-color: var(--warn); }
.alert-head.cat-watch { border-color: var(--watch); }
.alert-head.cat-advisory, .alert-head.cat-statement { border-color: var(--adv); }
.alert-head.cat-emergency { border-color: var(--emer); }
.alert-head h1 { font-size: 32px; margin-top: 10px; }
.alert-head .lede { color: var(--ink-2); }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; margin: 0 0 16px; }
.facts div { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.facts dt { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); }
.facts dd { margin: 2px 0 0; font-weight: 600; }
.instruction { border-left: 4px solid var(--warn); }

.foot { border-top: 1px solid var(--line); padding: 24px 0; font-size: 14px; color: var(--ink-3); }
.foot .wrap { display: flex; gap: 12px; flex-wrap: wrap; justify-content: space-between; }
.foot a { color: var(--ink-3); }
.prose { padding: 32px 16px 48px; }
.prose h2 { font-size: 20px; margin-top: 1.6em; }
.prose li { margin-bottom: .4em; }

@media (max-width: 820px) {
  .hero .wrap, .dash-grid, .grid3 { grid-template-columns: 1fr; }
  .hero { padding: 32px 0 24px; }
  .topbar nav .hide-sm { display: none; }
}
