/* Alaska by the Numbers — a terminal for the state's public data.
   Dark-first, dense, monospaced numerals. Direction is encoded on every value:
   arrow = which way it moved, colour = whether that move is favourable.
   Categorical chart palettes validated for both themes (OKLCH band, chroma
   floor, CVD separation, surface contrast). */

:root[data-theme="dark"] {
  --bg: #0f1216;
  --panel: #151a20;
  --panel-2: #1b212a;
  --rail: #10141a;
  --ink: #e9e6df;
  --ink-2: #a8a79f;
  --ink-3: #6f7681;
  --rule: #232a34;
  --rule-2: #2f3843;
  --accent: #e5842f;
  --pos: #3fbf7f;
  --pos-bg: rgba(63, 191, 127, 0.12);
  --neg: #ec6a5e;
  --neg-bg: rgba(236, 106, 94, 0.12);
  --grid: rgba(233, 230, 223, 0.07);
  --c1: #0d9488; --c2: #ea580c; --c3: #4f46e5;
  --c4: #b45309; --c5: #9333ea; --c6: #0369a1;
}

:root[data-theme="light"] {
  --bg: #f4f1ea;
  --panel: #fffdf8;
  --panel-2: #efeade;
  --rail: #e9e4d8;
  --ink: #1a1917;
  --ink-2: #4c4840;
  --ink-3: #7d776b;
  --rule: #ddd5c4;
  --rule-2: #c6bda8;
  --accent: #a03c12;
  --pos: #10704b;
  --pos-bg: rgba(16, 112, 75, 0.1);
  --neg: #a83224;
  --neg-bg: rgba(168, 50, 36, 0.1);
  --grid: rgba(26, 25, 23, 0.09);
  --c1: #0d9488; --c2: #c2410c; --c3: #3b5bdb;
  --c4: #a16207; --c5: #9333ea; --c6: #0891b2;
}

:root {
  --serif: "Fraunces", Georgia, serif;
  --sans: "IBM Plex Sans", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --page: min(1560px, 95vw);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--sans); font-size: 15px; line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: var(--serif); font-weight: 600; letter-spacing: -0.015em; }

/* ---------------- top bar ---------------- */
.bar { border-bottom: 1px solid var(--rule); background: var(--rail); }
.bar-inner {
  width: var(--page); margin: 0 auto; height: 46px;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.brand { display: flex; align-items: center; gap: 0.6rem; min-width: 0; }
.brand-mark {
  font-family: var(--mono); font-weight: 600; font-size: 0.72rem; letter-spacing: 0.08em;
  background: var(--accent); color: #0f1216; padding: 0.15rem 0.4rem;
}
:root[data-theme="light"] .brand-mark { color: #fffdf8; }
.brand-name { font-family: var(--serif); font-size: 1.02rem; white-space: nowrap; }
.brand-name em { font-style: italic; font-weight: 400; color: var(--ink-3); font-size: 0.85em; }

.bar-right { display: flex; align-items: center; gap: 0.75rem; }
.bar-stat {
  font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--ink-3); white-space: nowrap;
}
.bar-stat span { color: var(--ink-2); }
.bar-sep { width: 1px; height: 14px; background: var(--rule-2); }
@media (max-width: 860px) { .bar-stat:not(#bar-date) { display: none; } }

#theme-toggle {
  background: none; border: 1px solid var(--rule-2); color: var(--ink-2);
  font-family: var(--mono); font-size: 0.64rem; letter-spacing: 0.12em;
  text-transform: uppercase; padding: 0.25rem 0.6rem; cursor: pointer;
}
#theme-toggle:hover { border-color: var(--accent); color: var(--ink); }

/* ---------------- ticker ---------------- */
.ticker {
  background: var(--panel); border-bottom: 1px solid var(--rule);
  overflow-x: auto; scrollbar-width: none; display: flex;
}
.ticker::-webkit-scrollbar { display: none; }
.ticker-inner { width: var(--page); margin: 0 auto; display: flex; gap: 0; min-width: max-content; }
.tick {
  display: flex; align-items: baseline; gap: 0.45rem; padding: 0.5rem 1rem;
  border-right: 1px solid var(--rule); white-space: nowrap; font-family: var(--mono);
}
.tick:first-child { padding-left: 0; }
.tick-sym { font-size: 0.66rem; letter-spacing: 0.1em; color: var(--ink-3); }
.tick-val { font-size: 0.86rem; font-weight: 500; font-variant-numeric: tabular-nums; }
.tick-chg { font-size: 0.72rem; font-variant-numeric: tabular-nums; }

/* ---------------- tabs ---------------- */
.tabs { position: sticky; top: 0; z-index: 30; background: var(--bg); border-bottom: 1px solid var(--rule); }
.tabs-inner { width: var(--page); margin: 0 auto; display: flex; gap: 0; overflow-x: auto; scrollbar-width: none; }
.tabs-inner::-webkit-scrollbar { display: none; }
.tab {
  flex: 0 0 auto; background: none; border: 0; border-bottom: 2px solid transparent;
  color: var(--ink-3); cursor: pointer; padding: 0.7rem 1.05rem;
  font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.13em; text-transform: uppercase;
  transition: color 0.15s, border-color 0.15s;
}
.tab:hover { color: var(--ink); }
.tab.is-active { color: var(--ink); border-bottom-color: var(--accent); }

/* ---------------- views ---------------- */
main { width: var(--page); margin: 0 auto; }
.view { display: none; padding: 1.75rem 0 0; }
.view.is-active { display: block; animation: fade 0.25s ease both; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } }

.view-head { max-width: 74ch; margin-bottom: 1.5rem; }
.view-head h1 { font-size: clamp(1.6rem, 3vw, 2.3rem); margin: 0 0 0.5rem; }
.view-head h2 { font-size: clamp(1.2rem, 2.2vw, 1.6rem); margin: 0 0 0.4rem; }
.view-head p { margin: 0; color: var(--ink-2); font-size: 0.95rem; }
.view-head-sub { margin-top: 2.5rem; }

.legend-key { display: flex; flex-wrap: wrap; gap: 1.1rem; margin-top: 0.9rem; }
.key-item { display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.76rem; color: var(--ink-3); }
.chip {
  font-family: var(--mono); font-size: 0.68rem; padding: 0.05rem 0.3rem;
  border: 1px solid currentColor;
}
.chip-pos { color: var(--pos); } .chip-neg { color: var(--neg); }
.chip-flat { color: var(--ink-2); } .chip-na { color: var(--ink-3); }

/* ---------------- terminal panels ---------------- */
.panels { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(560px, 1fr)); }
@media (max-width: 640px) { .panels { grid-template-columns: 1fr; } }

.panel { background: var(--panel); border: 1px solid var(--rule); }
.panel-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.5rem 0.85rem; border-bottom: 1px solid var(--rule); background: var(--panel-2);
}
.panel-head h3 {
  margin: 0; font-family: var(--mono); font-size: 0.7rem; font-weight: 600;
  letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-2);
}
.panel-count { font-family: var(--mono); font-size: 0.64rem; color: var(--ink-3); letter-spacing: 0.08em; }

.kpi-head, .kpi {
  display: grid; align-items: center; gap: 0.5rem;
  grid-template-columns: minmax(120px, 1.5fr) minmax(78px, 0.9fr) repeat(3, minmax(66px, 0.8fr)) 78px;
  padding: 0.4rem 0.85rem;
}
.kpi-head {
  border-bottom: 1px solid var(--rule);
  font-family: var(--mono); font-size: 0.6rem; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--ink-3);
}
.kpi-head span:not(:first-child), .kpi > *:not(.kpi-name) { text-align: right; }
.kpi { border-bottom: 1px solid var(--rule); transition: background 0.12s; cursor: default; }
.kpi:last-child { border-bottom: 0; }
.kpi:hover { background: var(--panel-2); }

.kpi-name { min-width: 0; }
.kpi-label { font-size: 0.85rem; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kpi-sub { font-family: var(--mono); font-size: 0.6rem; color: var(--ink-3); letter-spacing: 0.06em; }
.kpi-value { font-family: var(--mono); font-size: 0.94rem; font-weight: 500; font-variant-numeric: tabular-nums; }
.kpi-unit { font-size: 0.72em; color: var(--ink-3); margin-left: 0.12em; }
.kpi-chg {
  font-family: var(--mono); font-size: 0.76rem; font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.up { color: var(--pos); } .down { color: var(--neg); }
.neutral { color: var(--ink-2); } .na { color: var(--ink-3); opacity: 0.55; }
.kpi-spark { height: 26px; }
.kpi-spark svg { display: block; width: 100%; height: 26px; }

@media (max-width: 720px) {
  .kpi-head, .kpi { grid-template-columns: minmax(0, 1.4fr) minmax(66px, 1fr) minmax(58px, 0.8fr) 62px; }
  .kpi-head span:nth-child(3), .kpi > *:nth-child(3),
  .kpi-head span:nth-child(5), .kpi > *:nth-child(5) { display: none; }
}

/* ---------------- yoy grid ---------------- */
.yoy-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }
.yoy-card { background: var(--panel); border: 1px solid var(--rule); padding: 0.85rem 1rem 0.7rem; }
.yoy-card h4 {
  margin: 0 0 0.15rem; font-family: var(--mono); font-size: 0.68rem;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-2); font-weight: 600;
}
.yoy-meta { font-family: var(--mono); font-size: 0.72rem; color: var(--ink-3); margin-bottom: 0.4rem; font-variant-numeric: tabular-nums; }

/* ---------------- charts ---------------- */
.charts { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(460px, 1fr)); }
@media (max-width: 700px) { .charts { grid-template-columns: 1fr; } }

.card { background: var(--panel); border: 1px solid var(--rule); padding: 1rem 1.1rem 0.85rem; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.card h3 { margin: 0; font-size: 1.08rem; }
.card-latest { font-family: var(--mono); font-size: 0.78rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.card-trend { display: flex; flex-wrap: wrap; gap: 0.9rem; margin: 0.45rem 0 0; font-family: var(--mono); font-size: 0.74rem; }
.card-trend .tl { color: var(--ink-3); letter-spacing: 0.06em; }
.card-note { font-size: 0.82rem; color: var(--ink-3); margin: 0.55rem 0 0.8rem; line-height: 1.5; max-width: 64ch; }

.legend { display: flex; flex-wrap: wrap; gap: 0.85rem; margin-top: 0.6rem; }
.legend-item { display: inline-flex; align-items: center; gap: 0.4rem; font-family: var(--mono); font-size: 0.7rem; color: var(--ink-2); }
.legend-swatch { width: 14px; height: 3px; border-radius: 2px; flex: 0 0 auto; }

.plot { position: relative; }
.plot svg { display: block; width: 100%; height: auto; overflow: visible; }
.axis-label { font-family: var(--mono); font-size: 10px; fill: var(--ink-3); }
.gridline { stroke: var(--grid); stroke-width: 1; }
.axis-line { stroke: var(--rule-2); stroke-width: 1; }
.series-line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.hover-line { stroke: var(--ink-3); stroke-width: 1; stroke-dasharray: 3 3; }
.hover-dot { stroke: var(--panel); stroke-width: 2; }

.tooltip {
  position: absolute; pointer-events: none; z-index: 5;
  background: var(--panel-2); border: 1px solid var(--rule-2);
  padding: 0.5rem 0.65rem; font-size: 0.76rem; min-width: 148px;
  box-shadow: 0 12px 28px -16px rgba(0, 0, 0, 0.7);
  opacity: 0; transition: opacity 0.12s; transform: translate(-50%, -108%);
}
.tooltip.is-on { opacity: 1; }
.tt-date { font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 0.25rem; }
.tt-row { display: flex; align-items: center; gap: 0.5rem; justify-content: space-between; }
.tt-name { display: inline-flex; align-items: center; gap: 0.4rem; color: var(--ink-2); }
.tt-val { font-family: var(--mono); font-variant-numeric: tabular-nums; color: var(--ink); }

.card-sources {
  margin-top: 0.8rem; padding-top: 0.6rem; border-top: 1px solid var(--rule);
  font-family: var(--mono); font-size: 0.64rem; letter-spacing: 0.06em;
  color: var(--ink-3); text-transform: uppercase;
}
.card-sources a { color: var(--ink-3); text-decoration: none; border-bottom: 1px solid var(--rule-2); }
.card-sources a:hover { color: var(--ink); }

/* ---------------- drill-down: every number links to its series ----------------
   Links inherit type colour so the data stays the visual subject; the
   affordance is the hover/focus state, not blue underlined text. */
a.kpi, a.tick, a.ex-row { color: inherit; text-decoration: none; }
a.kpi:hover, a.tick:hover, a.ex-row:hover { background: var(--panel-2); }
a.kpi:focus-visible, a.tick:focus-visible, a.ex-row:focus-visible,
.card-link:focus-visible {
  outline: 2px solid var(--accent); outline-offset: -2px;
}
a.kpi .kpi-label { text-decoration: underline; text-decoration-color: transparent;
  text-underline-offset: 2px; transition: text-decoration-color 0.12s; }
a.kpi:hover .kpi-label { text-decoration-color: var(--accent); }
a.ex-row:hover .ex-name > span:first-child { color: var(--accent); }
.card-link { color: inherit; text-decoration: none; }
.card-link:hover { color: var(--accent); }

/* ---------------- card actions: about / table / csv ---------------- */
.card-foot { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; align-items: center; justify-content: space-between; }
.card-actions { display: flex; gap: 0.45rem; margin-left: auto; }
.action-btn {
  background: none; border: 1px solid var(--rule-2); color: var(--ink-2);
  font-family: var(--mono); font-size: 0.6rem; letter-spacing: 0.1em;
  text-transform: uppercase; padding: 0.22rem 0.5rem; cursor: pointer;
  transition: border-color 0.12s, color 0.12s;
}
.action-btn:hover { border-color: var(--accent); color: var(--ink); }
.action-btn[aria-expanded="true"] { border-color: var(--accent); color: var(--accent); }
.action-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

.card-panel-slot > * { margin-top: 0.8rem; }

.about-panel {
  border: 1px solid var(--rule); background: var(--panel-2);
  padding: 0.8rem 1rem; font-size: 0.82rem; line-height: 1.55; color: var(--ink-2);
}
.about-panel h5 { margin: 0.7rem 0 0.3rem; font-size: 0.85rem; color: var(--ink); }
.about-panel h5:first-child { margin-top: 0; }
.about-label {
  font-family: var(--mono); font-size: 0.6rem; font-weight: 600; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--accent); margin: 0.7rem 0 0.25rem;
}
.about-label:first-child { margin-top: 0; }
.about-prose p { margin: 0 0 0.5rem; max-width: 74ch; }
.about-prose ul { margin: 0 0 0.5rem; padding-left: 1.2rem; }
.about-prose li { margin-bottom: 0.3rem; }
.about-prose code {
  font-family: var(--mono); font-size: 0.9em; background: var(--rail);
  padding: 0.05rem 0.3rem; border: 1px solid var(--rule);
}
.about-prose > :last-child, .about-prose li:last-child { margin-bottom: 0; }

.data-table { max-height: 320px; overflow: auto; border: 1px solid var(--rule); }
.data-table table { border-collapse: collapse; width: 100%; font-size: 0.78rem; }
.data-table th {
  position: sticky; top: 0; background: var(--rail); text-align: right;
  font-family: var(--mono); font-size: 0.6rem; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--ink-3); font-weight: 600;
  padding: 0.4rem 0.7rem; border-bottom: 1px solid var(--rule-2); white-space: nowrap;
}
.data-table th:first-child, .data-table td:first-child { text-align: left; }
.data-table td {
  font-family: var(--mono); font-variant-numeric: tabular-nums; text-align: right;
  padding: 0.28rem 0.7rem; border-bottom: 1px solid var(--rule); white-space: nowrap;
}
.data-table tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover td { background: var(--panel-2); }

.fresh-about { border-top: 0; }

/* ---------------- explore ---------------- */
.controls {
  display: flex; flex-wrap: wrap; gap: 1rem; align-items: end;
  padding: 0.9rem 1rem; background: var(--panel); border: 1px solid var(--rule); margin-bottom: 1.1rem;
}
.control { display: flex; flex-direction: column; gap: 0.28rem; }
.control-grow { flex: 1 1 180px; }
.control label { font-family: var(--mono); font-size: 0.62rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-3); }
.control select, .control input {
  font-family: var(--sans); font-size: 0.88rem; color: var(--ink);
  background: var(--bg); border: 1px solid var(--rule-2); padding: 0.4rem 0.55rem;
  min-width: 148px; width: 100%;
}
.control select:focus, .control input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

.ex-meta { display: flex; flex-wrap: wrap; gap: 1.4rem; margin-bottom: 0.9rem; font-family: var(--mono); font-size: 0.73rem; color: var(--ink-3); }
.ex-meta strong { color: var(--ink); font-weight: 500; }

.ex-chart { display: flex; flex-direction: column; border: 1px solid var(--rule); }
.ex-row {
  display: grid; grid-template-columns: minmax(150px, 250px) 1fr auto auto;
  align-items: center; gap: 1rem; padding: 0.42rem 0.9rem;
  background: var(--panel); border-bottom: 1px solid var(--rule);
}
.ex-row:last-child { border-bottom: 0; }
.ex-row:hover { background: var(--panel-2); }
.ex-row.is-state { background: var(--panel-2); }
.ex-name { font-size: 0.86rem; display: flex; align-items: baseline; gap: 0.45rem; min-width: 0; }
.ex-region-tag { font-family: var(--mono); font-size: 0.58rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); white-space: nowrap; }
.ex-track { height: 14px; }
.ex-bar { height: 100%; border-radius: 0 3px 3px 0; }
.ex-val { font-family: var(--mono); font-size: 0.84rem; font-variant-numeric: tabular-nums; text-align: right; min-width: 92px; }
.ex-vs { font-family: var(--mono); font-size: 0.72rem; font-variant-numeric: tabular-nums; text-align: right; min-width: 74px; }
@media (max-width: 680px) { .ex-row { grid-template-columns: 1fr auto auto; } .ex-track { display: none; } }

/* ---------------- freshness ---------------- */
.freshness { border: 1px solid var(--rule); }
.fresh-row {
  display: grid; gap: 0.3rem 1rem; align-items: center;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1.1fr) 6rem 9rem;
  padding: 0.5rem 0.9rem; background: var(--panel); border-bottom: 1px solid var(--rule); font-size: 0.86rem;
}
.fresh-row:last-child { border-bottom: 0; }
.fresh-title { display: flex; align-items: baseline; gap: 0.5rem; flex-wrap: wrap; min-width: 0; }
.fresh-title a { color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--rule-2); }
.fresh-title a:hover { border-color: var(--accent); }
.badge {
  font-family: var(--mono); font-size: 0.56rem; letter-spacing: 0.12em; text-transform: uppercase;
  padding: 0.08rem 0.36rem; border: 1px solid var(--rule-2); color: var(--ink-3);
}
.badge-primary { color: var(--accent); border-color: var(--accent); }
.fresh-meta { font-family: var(--mono); font-size: 0.7rem; color: var(--ink-3); min-width: 0; overflow-wrap: anywhere; }
.fresh-row > .fresh-meta:last-child { text-align: right; white-space: nowrap; }
@media (max-width: 880px) {
  .fresh-row { grid-template-columns: 1fr auto; }
  .fresh-row .fresh-freq { display: none; }
  .fresh-row > .fresh-meta:nth-child(2) { grid-column: 1; font-size: 0.66rem; }
}

/* ---------------- footer ---------------- */
.footer {
  width: var(--page); margin: 3.5rem auto 0; padding: 1.5rem 0 3rem;
  border-top: 1px solid var(--rule); font-size: 0.8rem; color: var(--ink-3);
}
.footer p { max-width: 82ch; margin: 0 0 0.5rem; }
.footer-meta { font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.1em; text-transform: uppercase; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  html { scroll-behavior: auto; }
}

/* ---------------- newsletter signup ----------------
   Rendered only when a handle is configured (see src/ak_data/site.py).
   Plain form POST to the provider — no key in the browser, site stays static. */
.signup {
  background: var(--panel); border: 1px solid var(--rule);
  border-left: 3px solid var(--accent);
  padding: 1rem 1.2rem; margin: 0 0 1rem;
  display: flex; flex-direction: column; gap: 0.3rem;
}
.signup-label {
  font-family: var(--mono); font-size: 0.7rem; font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent);
}
.signup-pitch { margin: 0; font-size: 0.88rem; color: var(--ink-2); max-width: 58ch; }
.signup-row { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.45rem; }
.signup-row input {
  flex: 1 1 240px; min-width: 0;
  font-family: var(--sans); font-size: 0.9rem; color: var(--ink);
  background: var(--bg); border: 1px solid var(--rule-2); padding: 0.45rem 0.6rem;
}
.signup-row input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.signup-row button {
  font-family: var(--mono); font-size: 0.7rem; font-weight: 600;
  letter-spacing: 0.1em; text-transform: uppercase;
  background: var(--accent); color: var(--bg); border: 0;
  padding: 0.45rem 1.1rem; cursor: pointer;
}
:root[data-theme="light"] .signup-row button { color: #fffdf8; }
.signup-row button:hover { filter: brightness(1.08); }
.signup-row button:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.signup-compact { margin: 2rem 0 0; padding: 0.85rem 1rem; }
/* a forecast is a projection, not an observation — the legend says so too */
.legend-swatch.legend-dashed {
  background-image: repeating-linear-gradient(90deg,
    currentColor 0 4px, transparent 4px 7px);
  background-blend-mode: normal; opacity: 0.95;
}

/* ---------------- site search ----------------
   Index loads on first focus, so a reader who never searches pays nothing. */
.site-search-wrap { position: relative; }
#site-search {
  font-family: var(--sans); font-size: 0.8rem; color: var(--ink);
  background: var(--bg); border: 1px solid var(--rule-2);
  padding: 0.28rem 0.55rem; width: 15rem; max-width: 40vw;
}
#site-search:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.site-search-results {
  position: absolute; right: 0; top: calc(100% + 4px); z-index: 60;
  min-width: 22rem; max-width: 90vw; max-height: 60vh; overflow-y: auto;
  list-style: none; margin: 0; padding: 0;
  background: var(--panel); border: 1px solid var(--rule-2);
  box-shadow: 0 14px 34px -18px rgba(0, 0, 0, 0.6);
}
.site-search-results li { border-bottom: 1px solid var(--rule); }
.site-search-results li:last-child { border-bottom: 0; }
.site-search-results a {
  display: flex; justify-content: space-between; align-items: baseline; gap: 1rem;
  padding: 0.45rem 0.7rem; text-decoration: none; color: var(--ink);
  font-size: 0.85rem;
}
.site-search-results a:hover, .site-search-results a.is-on { background: var(--panel-2); }
.sr-kind {
  font-family: var(--mono); font-size: 0.58rem; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--ink-3); flex: 0 0 auto;
}
.sr-empty { padding: 0.5rem 0.7rem; font-size: 0.82rem; color: var(--ink-3); }
@media (max-width: 700px) { #site-search { width: 9rem; } }
