/* Vedomost admin: handwritten CSS, design tokens first. No build step, no CDN.
   Spacing scale: 4/8 px grid (--s-1 .. --s-8). Base text 17 px, controls 48 px. */

@font-face {
  font-family: "Inter Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("/static/fonts/inter-latin-ext-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Inter Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("/static/fonts/inter-latin-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  color-scheme: light;
  /* page, sidebar, cards */
  --bg: #f3f5f9;
  --sidebar: #ffffff;
  --surface: #ffffff;
  --surface-2: #f4f6fa;
  --surface-3: #e8ecf3;
  --border: #e3e7f0;
  --border-strong: #cdd3e0;
  --text: #121726;
  --text-2: #3a4257;
  --muted: #586079;
  /* one bright sky-blue accent */
  --primary: #0879bd;
  --primary-hover: #066aa6;
  --primary-soft: #e2f1fb;
  --primary-ink: #0670ae;
  --on-primary: #ffffff;
  /* semantic */
  --ok: #0c7a4d;
  --ok-bg: #dff5ea;
  --bad: #c42347;
  --bad-solid: #c42347;
  --bad-solid-hover: #a31b39;
  --on-bad: #ffffff;
  --bad-bg: #fde7ec;
  --warn: #8a5600;
  --warn-bg: #fff0d1;
  --info: #0670ae;
  --info-bg: #e2f1fb;
  --focus: #0879bd;
  /* categorical slots (chart series, donut): validated for light surface */
  --series-1: #0b83cc;
  --series-2: #b86e00;
  --series-3: #6b4fd8;
  --grid: #e8ecf3;
  --d1: #0b83cc; --d2: #d9308a; --d3: #b86e00; --d4: #6b4fd8; --d5: #0f8a5a;
  /* icon chip tints */
  --c-blue: #0b83cc; --c-purple: #6b4fd8; --c-green: #0f8a5a; --c-cyan: #0e8fa3; --c-amber: #b86e00; --c-pink: #d9308a;
  --shadow-1: 0 1px 2px rgb(18 23 38 / 4%);
  --shadow-2: 0 6px 18px rgb(18 23 38 / 8%);
  --shadow-3: 0 24px 60px rgb(18 23 38 / 28%);
  --radius: 16px;
  --radius-sm: 10px;
  --radius-xs: 6px;
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 20px; --s-6: 24px; --s-7: 32px; --s-8: 40px; --s-9: 56px;
  --font: "Inter Variable", Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --control: 44px;
  --sidebar-w: 248px;
  --content-max: 1180px;
}
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    color-scheme: dark;
    --bg: #1e2130; --sidebar: #181b28; --surface: #252839; --surface-2: #2b2f44; --surface-3: #363b54;
    --border: #323650; --border-strong: #454b68;
    --text: #f1f3f9; --text-2: #cfd4e4; --muted: #9ba2bc;
    --primary: #1ea7f0; --primary-hover: #4cbaf5; --primary-soft: #1b3550; --primary-ink: #3db4f4; --on-primary: #04202f;
    --ok: #3fd49a; --ok-bg: #173a31; --bad: #ff7d97; --bad-solid: #f0476b; --bad-solid-hover: #f56d8a; --on-bad: #2a0511; --bad-bg: #432238;
    --warn: #f6b648; --warn-bg: #43361c; --info: #3db4f4; --info-bg: #1b3550; --focus: #3db4f4;
    --series-1: #1ea7f0; --series-2: #f5a524; --series-3: #8b6cf0; --grid: #2d3148;
    --d1: #1ea7f0; --d2: #f0476b; --d3: #f5a524; --d4: #8b6cf0; --d5: #1db97a;
    --c-blue: #1ea7f0; --c-purple: #9d82f5; --c-green: #1db97a; --c-cyan: #22c3d6; --c-amber: #f5a524; --c-pink: #f0476b;
    --shadow-1: none; --shadow-2: 0 8px 24px rgb(0 0 0 / 35%); --shadow-3: 0 24px 60px rgb(0 0 0 / 60%);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #1e2130; --sidebar: #181b28; --surface: #252839; --surface-2: #2b2f44; --surface-3: #363b54;
  --border: #323650; --border-strong: #454b68;
  --text: #f1f3f9; --text-2: #cfd4e4; --muted: #9ba2bc;
  --primary: #1ea7f0; --primary-hover: #4cbaf5; --primary-soft: #1b3550; --primary-ink: #3db4f4; --on-primary: #04202f;
  --ok: #3fd49a; --ok-bg: #173a31; --bad: #ff7d97; --bad-solid: #f0476b; --bad-solid-hover: #f56d8a; --on-bad: #2a0511; --bad-bg: #432238;
  --warn: #f6b648; --warn-bg: #43361c; --info: #3db4f4; --info-bg: #1b3550; --focus: #3db4f4;
  --series-1: #1ea7f0; --series-2: #f5a524; --series-3: #8b6cf0; --grid: #2d3148;
  --d1: #1ea7f0; --d2: #f0476b; --d3: #f5a524; --d4: #8b6cf0; --d5: #1db97a;
  --c-blue: #1ea7f0; --c-purple: #9d82f5; --c-green: #1db97a; --c-cyan: #22c3d6; --c-amber: #f5a524; --c-pink: #f0476b;
  --shadow-1: none; --shadow-2: 0 8px 24px rgb(0 0 0 / 35%); --shadow-3: 0 24px 60px rgb(0 0 0 / 60%);
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; font-size: 16px; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 1rem/1.55 var(--font); font-feature-settings: "cv11", "ss03"; -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4 { font-weight: 700; letter-spacing: -.015em; color: var(--text); }
h1 { font-size: 1.75rem; line-height: 1.2; margin: 0 0 var(--s-1); letter-spacing: -.025em; font-weight: 750; }
h2 { font-size: 1.1rem; line-height: 1.3; margin: 0 0 var(--s-2); }
h3 { font-size: 1rem; line-height: 1.35; margin: var(--s-5) 0 var(--s-3); }
p { margin: 0 0 var(--s-3); }
a { color: var(--primary-ink); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
code { font: .86em var(--mono); background: var(--surface-2); padding: 2px 6px; border-radius: var(--radius-xs); }
strong { font-weight: 650; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: var(--radius-xs); }
.muted { color: var(--muted); }
.small { font-size: .88rem; }
.block { display: block; }
.center { text-align: center; }
.num, .tnum { font-variant-numeric: tabular-nums; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 0; background: var(--primary); color: var(--on-primary); padding: var(--s-2) var(--s-4); z-index: 100; border-radius: var(--radius-sm); }
.skip:focus { left: var(--s-2); top: var(--s-2); }
.sprite { position: absolute; }
.icon { width: 1.25em; height: 1.25em; flex: none; vertical-align: -.25em; }
[hidden] { display: none !important; }

/* ---------- layout ---------- */
.shell { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; overflow-y: auto; background: var(--sidebar); border-right: 1px solid var(--border); padding: var(--s-5) var(--s-3) 0; display: flex; flex-direction: column; gap: var(--s-4); scrollbar-width: thin; }
.brand { display: flex; gap: var(--s-3); align-items: center; padding: 0 var(--s-2); }
.brand > div { display: flex; flex-direction: column; line-height: 1.25; }
.brand strong { font-size: 1.1rem; letter-spacing: .02em; font-weight: 800; }
.brand-tag { color: var(--primary-ink); font-size: .78rem; font-weight: 650; }
.logo { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: linear-gradient(135deg, #1ea7f0, #0b6cc4); color: #fff; font-weight: 800; font-size: 1.2rem; }
.nav-group + .nav-group { margin-top: 2px; }
.nav { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.nav a { display: flex; align-items: center; gap: var(--s-3); min-height: var(--control); padding: 0 var(--s-3); border-radius: var(--radius-sm); color: var(--text-2); text-decoration: none; font-weight: 550; font-size: .94rem; line-height: 1.25; }
.nav a:hover { background: var(--surface-2); color: var(--text); }
.nav a[aria-current="page"] { background: var(--primary-soft); color: var(--primary-ink); font-weight: 650; }
.nav .icon { width: 1.3em; height: 1.3em; }
.side-foot { margin-top: auto; position: sticky; bottom: 0; display: flex; align-items: center; gap: var(--s-2); background: var(--sidebar); border-top: 1px solid var(--border); padding: var(--s-3) var(--s-2); }
.side-foot form { margin: 0; }
.side-foot .icon-btn { width: 38px; height: 38px; color: var(--text-2); }
.avatar { display: grid; place-items: center; width: 36px; height: 36px; flex: none; border-radius: 50%; background: var(--primary-soft); color: var(--primary-ink); font-weight: 700; }
.who { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; font-size: .92rem; }
.topbar, .bottombar, .scrim { display: none; }
.content { min-width: 0; display: flex; flex-direction: column; }
.topstrip { height: 56px; flex: none; display: flex; align-items: center; justify-content: flex-end; padding: 0 clamp(16px, 3vw, 40px); border-bottom: 1px solid var(--border); background: var(--bg); }
.main { padding: var(--s-7) clamp(16px, 3vw, 40px) var(--s-9); max-width: var(--content-max); width: 100%; margin-inline: auto; flex: 1; }
.main:focus { outline: none; }

.page-head, .dash-head { display: flex; flex-wrap: wrap; gap: var(--s-4) var(--s-6); align-items: flex-start; justify-content: space-between; margin-bottom: var(--s-6); }
.page-head > div:first-child, .dash-head > div:first-child { min-width: 0; flex: 1 1 320px; }
.page-head p { margin: 0; }
.lead { color: var(--muted); font-size: .98rem; max-width: 70ch; margin: 0; }
.dash-head h1 { font-size: 1.9rem; }
.dash-live { margin: 0; color: var(--muted); font-size: .8rem; max-width: 230px; text-align: right; line-height: 1.4; }
.actions { display: flex; flex-wrap: wrap; gap: var(--s-3); align-items: center; }
.crumb { margin-bottom: var(--s-3); font-weight: 550; }
.crumb a { text-decoration: none; }
.crumb a:hover { text-decoration: underline; }
.banner { background: var(--warn-bg); color: var(--warn); border-radius: var(--radius-sm); padding: var(--s-3) var(--s-4); font-size: .9rem; font-weight: 550; margin-bottom: var(--s-5); }
.notice { background: var(--info-bg); color: var(--text); border-radius: var(--radius-sm); padding: var(--s-4) var(--s-5); border-left: 4px solid var(--primary); margin-bottom: var(--s-5); }
.notice.warn { background: var(--warn-bg); border-left-color: var(--warn); }

.flash { position: sticky; top: var(--s-3); z-index: 30; display: flex; justify-content: space-between; align-items: center; gap: var(--s-3); background: var(--ok-bg); color: var(--ok); border: 1px solid color-mix(in srgb, var(--ok) 35%, transparent); border-radius: var(--radius-sm); padding: var(--s-2) var(--s-2) var(--s-2) var(--s-4); margin-bottom: var(--s-5); font-weight: 600; box-shadow: var(--shadow-2); animation: toast-in .25s ease-out; }
@keyframes toast-in { from { transform: translateY(-8px); opacity: 0; } to { transform: none; opacity: 1; } }
.loading-bar { position: fixed; top: 0; left: 0; right: 0; height: 3px; background: var(--primary); transform: scaleX(0); transform-origin: left; opacity: 0; z-index: 90; }
body.htmx-request .loading-bar, .loading-bar.htmx-request { opacity: 1; animation: load 1.2s ease-in-out infinite; }
@keyframes load { 0% { transform: scaleX(0); } 70% { transform: scaleX(.9); } 100% { transform: scaleX(1); opacity: 0; } }

/* ---------- cards, grids ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: var(--s-6); box-shadow: var(--shadow-1); margin-bottom: var(--s-6); min-width: 0; }
.card.flush { padding: 0; overflow: hidden; }
.card.narrow { max-width: 680px; }
.card h2 { margin-bottom: var(--s-3); font-weight: 700; }
.card-title { margin: 0; }
.card-sub { color: var(--muted); font-size: .92rem; margin: 0 0 var(--s-4); }
.pad { padding: var(--s-5) var(--s-6) 0; margin: 0; }
h2.pad { padding-bottom: var(--s-4); }
.card-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: var(--s-3); margin-bottom: var(--s-3); }
.card-head h2 { margin: 0; }
.card-head p { margin: 0; font-size: .92rem; }
.card-foot { display: flex; align-items: center; justify-content: space-between; margin: var(--s-5) calc(-1 * var(--s-6)) calc(-1 * var(--s-6)); padding: var(--s-4) var(--s-6); border-top: 1px solid var(--border); color: var(--text); font-weight: 650; text-decoration: none; border-radius: 0 0 var(--radius) var(--radius); }
.card-foot:hover { background: var(--surface-2); color: var(--primary-ink); }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 480px), 1fr)); gap: var(--s-6); align-items: start; }
.grid-2 > .card { margin-bottom: 0; }
.grid-charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 460px), 1fr)); gap: var(--s-6); margin-bottom: var(--s-6); align-items: stretch; }
.grid-charts > .card { margin-bottom: 0; }
.stack { display: grid; gap: var(--s-6); }
.stack > .card, .stack > .grid-charts { margin-bottom: 0; }
.section-title { font-size: 1.1rem; margin: var(--s-7) 0 var(--s-3); }
.section-sub { color: var(--muted); margin: 0 0 var(--s-4); }

/* KPI cards */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: var(--s-4); margin-bottom: var(--s-6); }
@media (min-width: 900px) { .kpis.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: var(--s-5); box-shadow: var(--shadow-1); min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.kpi-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--s-3); }
.chip { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: color-mix(in srgb, var(--chip, var(--c-blue)) 16%, transparent); color: var(--chip, var(--c-blue)); }
.chip .icon { width: 20px; height: 20px; }
.chip.blue { --chip: var(--c-blue); } .chip.purple { --chip: var(--c-purple); } .chip.green { --chip: var(--c-green); } .chip.cyan { --chip: var(--c-cyan); } .chip.amber { --chip: var(--c-amber); } .chip.pink { --chip: var(--c-pink); }
.kpi-arrow { color: var(--muted); display: inline-flex; }
.kpi-label { font-size: .92rem; font-weight: 500; color: var(--muted); margin: 0; letter-spacing: 0; line-height: 1.3; }
.kpi-value { font-size: 1.85rem; font-weight: 750; line-height: 1.2; margin: var(--s-1) 0 0; letter-spacing: -.025em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.kpi-caption { font-size: .82rem; line-height: 1.45; color: var(--muted); margin: 0; }
.kpi-delta { display: inline-flex; align-items: center; gap: var(--s-1); align-self: flex-start; margin: var(--s-2) 0 0; padding: 2px var(--s-3) 2px var(--s-2); border-radius: 10px; font-size: .8rem; font-weight: 650; }
.kpi-delta { background: var(--surface-3); color: var(--text-2); }
.kpi-delta.up { color: var(--ok); background: var(--ok-bg); } .kpi-delta.down { color: var(--bad); background: var(--bad-bg); }
.kpi-more { margin-top: auto; padding-top: var(--s-3); font-size: .85rem; font-weight: 650; color: var(--primary-ink); text-decoration: none; align-self: flex-start; }
.kpi-more:hover { text-decoration: underline; }
.kpi:has(.kpi-more) { justify-content: flex-start; }

.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: var(--s-3) var(--s-4); margin: 0 0 var(--s-2); }
.facts > div { background: var(--surface-2); border-radius: var(--radius-sm); padding: var(--s-3) var(--s-4); }
.facts dt { font-size: .82rem; color: var(--muted); font-weight: 500; }
.facts dd { margin: 2px 0 0; font-weight: 650; font-size: 1.02rem; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.bars + .facts { margin-top: var(--s-4); }
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: var(--s-4); margin-bottom: var(--s-6); }
.plans .card { margin-bottom: 0; }
.plans h2 { display: flex; align-items: center; gap: var(--s-2); flex-wrap: wrap; min-height: 32px; }
.plain { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-1); }
.badges { display: flex; flex-wrap: wrap; gap: var(--s-2); margin-top: var(--s-3) !important; }

/* donut */
.donut-body { display: flex; align-items: center; gap: var(--s-6); padding: var(--s-3) 0; }
.donut-fig { flex: none; width: 150px; }
.donut-svg { display: block; width: 100%; height: auto; }
.donut-track { stroke: var(--surface-3); }
.donut-svg .seg { stroke-linecap: butt; }
.seg.d1, .seg.s1 { stroke: var(--d1); } .seg.d2 { stroke: var(--d2); } .seg.d3 { stroke: var(--d3); } .seg.d4 { stroke: var(--d4); } .seg.d5 { stroke: var(--d5); }
.seg.ok { stroke: var(--d5); } .seg.bad { stroke: var(--d2); } .seg.warn { stroke: var(--d3); }
.donut-total { fill: var(--text); font: 800 24px var(--font); font-variant-numeric: tabular-nums; }
.donut-total.t-m { font-size: 19px; } .donut-total.t-s { font-size: 15px; } .donut-total.t-xs { font-size: 12px; }
.donut-label { fill: var(--muted); font: 500 11px var(--font); }
.donut-legend { list-style: none; margin: 0; padding: 0; flex: 1; min-width: 0; display: grid; gap: var(--s-3); }
.donut-legend li { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto 44px; gap: var(--s-3); align-items: center; font-size: .92rem; }
.donut-legend .dl-label { overflow-wrap: anywhere; }
.donut-legend .dl-pct { color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.donut-legend .dl-val { font-variant-numeric: tabular-nums; text-align: right; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--d1); }
.dot.d1 { background: var(--d1); } .dot.d2 { background: var(--d2); } .dot.d3 { background: var(--d3); } .dot.d4 { background: var(--d4); } .dot.d5 { background: var(--d5); }
.dot.ok { background: var(--d5); } .dot.bad { background: var(--d2); } .dot.warn { background: var(--d3); }
.donut-card .table-view { margin-top: var(--s-2); }

/* ---------- buttons, forms ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2); min-height: var(--control); padding: 0 var(--s-4); border: 1px solid var(--primary); background: var(--primary); color: var(--on-primary); border-radius: var(--radius-sm); font: 650 .93rem/1.2 var(--font); text-decoration: none; cursor: pointer; transition: background-color .12s, border-color .12s; }
.btn:hover { background: var(--primary-hover); border-color: var(--primary-hover); color: var(--on-primary); text-decoration: none; }
.btn .icon { width: 1.15em; height: 1.15em; }
.btn.ghost { background: transparent; color: var(--text); border-color: var(--border-strong); }
.btn.ghost:hover { background: var(--surface-2); color: var(--text); border-color: var(--muted); }
.btn.danger { background: var(--bad-solid); border-color: var(--bad-solid); color: var(--on-bad); }
.btn.danger:hover { background: var(--bad-solid-hover); border-color: var(--bad-solid-hover); color: var(--on-bad); }
.btn.ghost.danger { background: transparent; color: var(--bad); border-color: color-mix(in srgb, var(--bad) 55%, transparent); }
.btn.ghost.danger:hover { background: var(--bad-bg); color: var(--bad); border-color: var(--bad); }
.btn.block { display: flex; width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.small-btn { min-height: 36px; padding: 0 var(--s-3); font-size: .88rem; }
.icon-btn { display: inline-grid; place-items: center; width: var(--control); height: var(--control); border: 0; background: transparent; color: inherit; border-radius: var(--radius-sm); cursor: pointer; font: inherit; }
.icon-btn:hover { background: var(--surface-2); }
.icon-btn .icon { width: 1.3rem; height: 1.3rem; }

.form { display: grid; gap: var(--s-2); }
.form > * { min-width: 0; }
.form label, fieldset legend { font-weight: 650; font-size: .92rem; color: var(--text); margin-top: var(--s-2); }
.form label:first-child { margin-top: 0; }
.form p { margin: 0; }
.form .btn { margin-top: var(--s-4); justify-self: start; }
.hint { color: var(--muted); font-size: .85rem; line-height: 1.45; margin: 0; }
input, select, textarea { width: 100%; min-height: var(--control); padding: var(--s-2) var(--s-4); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); font: inherit; font-size: .95rem; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .9; }
input:hover, select:hover, textarea:hover { border-color: var(--muted); }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid color-mix(in srgb, var(--focus) 35%, transparent); outline-offset: 0; border-color: var(--focus); }
input:user-invalid, select:user-invalid, textarea:user-invalid { border-color: var(--bad); }
input[type="radio"], input[type="checkbox"] { width: 20px; height: 20px; min-height: 0; padding: 0; accent-color: var(--primary); flex: none; }
input[type="file"] { padding: var(--s-2); }
input[type="file"]::file-selector-button { font: 650 .88rem var(--font); min-height: 32px; margin-right: var(--s-3); padding: 0 var(--s-3); border: 1px solid var(--border-strong); border-radius: var(--radius-xs); background: var(--surface-2); color: var(--text); cursor: pointer; }
input[type="search"] { -webkit-appearance: none; appearance: none; padding-left: 42px; background-repeat: no-repeat; background-position: 14px 50%; background-size: 18px 18px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238b93ad' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='6.5'/%3E%3Cpath d='M16 16l4.5 4.5'/%3E%3C/svg%3E"); }
textarea { resize: vertical; line-height: 1.5; padding-block: var(--s-3); }
select { appearance: none; -webkit-appearance: none; padding-right: 40px; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%; background-size: 6px 6px; background-repeat: no-repeat; }
fieldset { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: var(--s-4) var(--s-5) var(--s-5); display: grid; gap: var(--s-2); margin: 0; min-width: 0; }
.choice { display: flex !important; gap: var(--s-3); align-items: center; flex-wrap: wrap; font-weight: 550 !important; min-height: var(--control); padding: var(--s-2) var(--s-3); margin: 0 !important; border: 1px solid var(--border); border-radius: var(--radius-sm); cursor: pointer; }
.choice:hover { background: var(--surface-2); }
.choice:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.form-error { background: var(--bad-bg); color: var(--bad); border-radius: var(--radius-sm); padding: var(--s-3) var(--s-4); font-weight: 600; border-left: 4px solid var(--bad); }
.search { display: flex; flex-wrap: wrap; gap: var(--s-3); margin-bottom: var(--s-5); max-width: 640px; }
.search input, .search select { flex: 1 1 260px; width: auto; }
.pick { list-style: none; padding: 0; margin: var(--s-4) 0 0; display: grid; gap: var(--s-2); }
.pick-btn { display: grid; gap: 2px; width: 100%; min-height: 56px; text-align: left; padding: var(--s-3) var(--s-4); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); font: inherit; cursor: pointer; }
.pick-btn:hover { background: var(--primary-soft); border-color: var(--primary); }
.dialog-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--s-3); margin-top: var(--s-5); }
.dialog-actions.left { justify-content: flex-start; }
.dialog-actions .btn { margin-top: 0; }

/* ---------- dialog ---------- */
.dialog { border: 1px solid var(--border); border-radius: var(--radius); padding: var(--s-6); width: min(92vw, 500px); background: var(--surface); color: var(--text); box-shadow: var(--shadow-3); }
.dialog::backdrop { background: rgb(8 10 20 / 65%); backdrop-filter: blur(2px); }
.dialog form { display: grid; gap: var(--s-3); }
.dialog h2 { margin: 0; font-size: 1.2rem; }
.dialog p { margin: 0; color: var(--text-2); }
.dialog.danger-dialog h2 { color: var(--bad); }

/* ---------- tabs, segmented, stepper ---------- */
.tabs { display: flex; gap: var(--s-1); overflow-x: auto; border-bottom: 1px solid var(--border); margin: 0 0 var(--s-5); scrollbar-width: thin; }
.tabs a { display: inline-flex; align-items: center; min-height: var(--control); padding: 0 var(--s-4); text-decoration: none; color: var(--muted); font-weight: 600; font-size: .94rem; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; border-radius: var(--radius-sm) var(--radius-sm) 0 0; }
.tabs a:hover { color: var(--text); background: var(--surface-2); }
.tabs a[aria-current="page"] { color: var(--primary-ink); border-bottom-color: var(--primary); }
.segmented { display: inline-flex; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 3px; gap: 2px; max-width: 100%; overflow-x: auto; }
.segmented a { display: inline-flex; align-items: center; min-height: 34px; padding: 0 var(--s-4); border-radius: 8px; text-decoration: none; color: var(--text-2); font-weight: 600; font-size: .92rem; white-space: nowrap; }
.segmented a:hover { color: var(--text); background: var(--surface-2); }
.segmented a[aria-current="true"] { background: var(--primary-soft); color: var(--primary-ink); }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-3) var(--s-5); margin-bottom: var(--s-5); }
.toolbar-label { font-weight: 600; color: var(--muted); margin-right: var(--s-3); font-size: .92rem; }
.stepper { display: flex; flex-wrap: wrap; gap: var(--s-3) var(--s-6); list-style: none; padding: 0; margin: 0 0 var(--s-6); color: var(--muted); font-weight: 600; }
.stepper li { display: flex; gap: var(--s-3); align-items: center; }
.step-n { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--border-strong); font-size: .85rem; font-weight: 700; background: var(--surface); }
.stepper [aria-current="step"] { color: var(--text); }
.stepper [aria-current="step"] .step-n { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.stepper .done .step-n { border-color: var(--ok); color: var(--ok); background: var(--ok-bg); }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .93rem; }
table.data th, table.data td { padding: var(--s-3) var(--s-4); text-align: left; border-bottom: 1px solid var(--border); vertical-align: middle; height: 56px; }
table.data thead th { position: sticky; top: 0; z-index: 1; font-size: .82rem; font-weight: 600; color: var(--muted); background: var(--surface-2); white-space: nowrap; border-bottom: 1px solid var(--border); }
table.data tbody th { font-weight: 600; }
table.data tbody tr:last-child th, table.data tbody tr:last-child td { border-bottom: 0; }
table.data td { font-variant-numeric: tabular-nums; }
table.data a { text-decoration: none; font-weight: 600; color: var(--primary-ink); }
table.data a:hover { text-decoration: underline; }
table.data th:first-child, table.data td:first-child { padding-left: var(--s-6); }
table.data th:last-child, table.data td:last-child { padding-right: var(--s-6); }
table.data .num { text-align: right; font-variant-numeric: tabular-nums; }
table.data tbody tr:hover { background: color-mix(in srgb, var(--surface-2) 55%, transparent); }
table.data tr.voided td, table.data tr.voided th { opacity: .6; text-decoration: line-through; }
table.data tr.voided td:last-child { text-decoration: none; opacity: 1; }
table.data td .btn { min-height: 34px; padding: 0 var(--s-3); font-size: .86rem; }
.clip { max-width: 34ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.table-foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: var(--s-3); padding: var(--s-4) var(--s-6); border-top: 1px solid var(--border); background: var(--surface-2); }
.pager { display: flex; align-items: center; gap: var(--s-4); }
.badge { display: inline-flex; align-items: center; padding: 2px 10px; border-radius: 8px; font-size: .78rem; font-weight: 650; background: var(--surface-3); color: var(--text-2); white-space: nowrap; line-height: 1.6; }
.badge.ok { background: var(--ok-bg); color: var(--ok); } .badge.bad { background: var(--bad-bg); color: var(--bad); } .badge.warn { background: var(--warn-bg); color: var(--warn); } .badge.info { background: var(--info-bg); color: var(--info); }

/* ---------- empty, misc ---------- */
.empty { text-align: center; padding: var(--s-8) var(--s-5); display: grid; justify-items: center; gap: var(--s-1); }
.empty-art { width: 64px; height: 64px; fill: var(--surface-2); stroke: var(--border-strong); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.empty-title { font-weight: 700; font-size: 1.05rem; margin: var(--s-3) 0 0; }
.empty p { max-width: 52ch; }
.empty .btn { margin-top: var(--s-3); }
.quote { border-left: 3px solid var(--border-strong); padding-left: var(--s-3); }
.phone-bubble { background: var(--primary-soft); border-radius: 18px 18px 18px 4px; padding: var(--s-4) var(--s-5); white-space: pre-wrap; overflow-wrap: anywhere; min-height: 56px; max-width: 460px; }
progress { width: 100%; height: 12px; accent-color: var(--primary); border-radius: 999px; }
.err-code { font-size: 5rem; font-weight: 800; color: var(--surface-3); margin: 0; line-height: 1; letter-spacing: -.04em; }
.table-view { margin-top: var(--s-3); }
.table-view summary { cursor: pointer; color: var(--primary-ink); font-weight: 650; font-size: .9rem; min-height: 36px; display: flex; align-items: center; }
.table-view .table-wrap { max-height: 320px; overflow: auto; }
.skeleton { display: block; border-radius: var(--radius-xs); background: linear-gradient(90deg, var(--surface-2), var(--surface-3), var(--surface-2)); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; min-height: 1em; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.live[aria-busy="true"] { opacity: .75; transition: opacity .2s; }
.live-bar { display: flex; align-items: center; gap: var(--s-2); color: var(--muted); font-size: .82rem; margin: 0; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--d5); flex: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--d5) 25%, transparent); }
.live-bar[data-state="paused"] .live-dot, .live-bar[data-state="offline"] .live-dot { background: var(--muted); box-shadow: none; }
.live-time { font-variant-numeric: tabular-nums; }

.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: var(--s-5); background: radial-gradient(900px 420px at 50% -10%, var(--primary-soft), transparent 70%), var(--bg); }
.login-card { width: min(100%, 420px); padding: var(--s-7); box-shadow: var(--shadow-2); margin-bottom: 0; }
.login-card .brand { padding: 0; margin-bottom: var(--s-6); }
.login-card h1 { font-size: 1.6rem; }
.login-card .form { margin-top: var(--s-5); }
.login-card .btn { width: 100%; justify-self: stretch; }
.login-card .notice, .login-card .hint { margin-top: var(--s-4); margin-bottom: 0; }
.soon { text-align: center; padding: var(--s-9) var(--s-6); }
.soon .soon-icon { display: grid; place-items: center; width: 72px; height: 72px; margin: 0 auto var(--s-5); border-radius: 20px; background: var(--primary-soft); color: var(--primary-ink); }
.soon .soon-icon .icon { width: 36px; height: 36px; }
.soon h2 { font-size: 1.45rem; }
.soon p { max-width: 52ch; margin-inline: auto; }

.bars { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-3); }
.bars li { display: grid; grid-template-columns: minmax(110px, 220px) 1fr auto; gap: var(--s-4); align-items: center; min-height: 34px; }
.bar-label { overflow-wrap: anywhere; font-size: .94rem; }
.bar-track { width: 100%; height: 10px; display: block; }
.bar-bg { fill: var(--surface-3); }
.bar-fill.s1, .swatch.s1 { fill: var(--series-1); } .bar-fill.s2 { fill: var(--series-2); }
.bar-val { font-variant-numeric: tabular-nums; font-weight: 700; min-width: 3ch; text-align: right; }
.bar-val.wide { min-width: 12ch; }

/* ---------- charts ---------- */
.chart-scroll { overflow-x: auto; }
.chart-svg { display: block; width: 100%; max-width: 860px; margin-inline: auto; min-width: 460px; height: auto; overflow: visible; }
.chart-svg .grid { stroke: var(--grid); stroke-width: 1; }
.chart-svg .axis-line { stroke: var(--border-strong); stroke-width: 1.2; }
.chart-svg .axis-text { fill: var(--muted); font-size: 12px; font-weight: 500; font-family: var(--font); font-variant-numeric: tabular-nums; }
.chart-svg .bar.s1 { fill: var(--series-1); } .chart-svg .bar.s2 { fill: var(--series-2); }
.chart-svg .bar { stroke: var(--surface); stroke-width: 2; paint-order: stroke; }
.chart-svg .line { fill: none; stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.chart-svg .line.s1 { stroke: var(--series-1); } .chart-svg .line.s2 { stroke: var(--series-2); }
.chart-svg .hit { fill: transparent; }
.chart-svg .col { outline: none; }
.chart-svg .col:hover .hit, .chart-svg .col:focus .hit { fill: color-mix(in srgb, var(--text) 6%, transparent); }
.chart-svg .col:focus-visible .hit { stroke: var(--focus); stroke-width: 2; }
.chart-svg .dot { opacity: 0; stroke: var(--surface); stroke-width: 2; }
.chart-svg .dot.s1 { fill: var(--series-1); } .chart-svg .dot.s2 { fill: var(--series-2); }
.chart-svg .crosshair { stroke: var(--muted); stroke-dasharray: 3 3; opacity: 0; }
.chart-svg .col:hover .dot, .chart-svg .col:focus .dot, .chart-svg .col:hover .crosshair, .chart-svg .col:focus .crosshair { opacity: 1; }
.chart-svg .tip { opacity: 0; pointer-events: none; }
.chart-svg .col:hover .tip, .chart-svg .col:focus .tip { opacity: 1; }
.chart-svg .tip-bg { fill: var(--surface-2); stroke: var(--border-strong); stroke-width: 1; }
.chart-svg .tip-head { fill: var(--text); font-size: 12px; font-weight: 700; font-family: var(--font); }
.chart-svg .tip-line { fill: var(--text-2); font-size: 12px; font-family: var(--font); }
.legend { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-4); list-style: none; margin: 0; padding: 0; font-size: .86rem; font-weight: 550; color: var(--text-2); }
.legend li { display: flex; align-items: center; gap: var(--s-2); }
.swatch { width: 12px; height: 12px; border-radius: 4px; display: inline-block; background: var(--series-1); }
.swatch.s2 { background: var(--series-2); }
.swatch.s1 { background: var(--series-1); }

.show-dark { display: none; }
:root[data-theme="dark"] .show-light { display: none; }
:root[data-theme="dark"] .show-dark { display: inline; }
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) .show-light { display: none; }
  :root:where(:not([data-theme="light"])) .show-dark { display: inline; }
}

/* ---------- responsive ---------- */
@media (max-width: 1023px) {
  .shell { display: block; }
  .topstrip { display: none; }
  .topbar { position: sticky; top: 0; z-index: 40; display: flex; align-items: center; justify-content: space-between; gap: var(--s-2); height: 60px; padding: 0 var(--s-3); background: var(--sidebar); border-bottom: 1px solid var(--border); }
  .brand-mini { font-weight: 800; font-size: 1.05rem; }
  .sidebar { position: fixed; z-index: 60; inset: 0 auto 0 0; width: min(86vw, 300px); transform: translateX(-105%); visibility: hidden; transition: transform .2s ease, visibility .2s; box-shadow: var(--shadow-3); }
  body.menu-open .sidebar { transform: none; visibility: visible; }
  body.menu-open .scrim { display: block; position: fixed; inset: 0; z-index: 50; background: rgb(8 10 20 / 65%); }
  .main { padding: var(--s-6) var(--s-5) var(--s-9); }
}
@media (max-width: 639px) {
  h1, .dash-head h1 { font-size: 1.45rem; }
  .main { padding: var(--s-5) var(--s-4) 104px; }
  .dash-live { text-align: left; max-width: none; }
  .bottombar { position: fixed; z-index: 40; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: repeat(5, 1fr); background: var(--sidebar); border-top: 1px solid var(--border); padding-bottom: env(safe-area-inset-bottom); }
  .bottombar a, .bottombar button { display: grid; justify-items: center; align-content: center; gap: 2px; min-height: 62px; padding: var(--s-2) 2px; color: var(--muted); text-decoration: none; font: 600 .7rem/1.2 var(--font); background: none; border: 0; cursor: pointer; }
  .bottombar a[aria-current="page"] { color: var(--primary-ink); }
  .bottombar .icon { width: 24px; height: 24px; }
  .page-head { margin-bottom: var(--s-5); }
  .page-head .actions { width: 100%; }
  .page-head .actions .btn, .page-head > .btn { flex: 1 1 100%; }
  .bars li { grid-template-columns: 1fr auto; row-gap: var(--s-1); }
  .bars .bar-track { grid-column: 1 / -1; grid-row: 2; }
  .card { padding: var(--s-5) var(--s-4); margin-bottom: var(--s-4); }
  .card-foot { margin: var(--s-5) calc(-1 * var(--s-4)) calc(-1 * var(--s-5)); padding: var(--s-4); }
  .pad { padding: var(--s-4) var(--s-4) 0; }
  .kpis { grid-template-columns: 1fr; gap: var(--s-3); }
  .kpi { padding: var(--s-4); }
  .kpi-value { font-size: 1.65rem; }
  .login-card { padding: var(--s-6) var(--s-5); }
  .search input, .search select, .search .btn { flex: 1 1 100%; }
  .table-foot { flex-direction: column; align-items: stretch; padding: var(--s-4); }
  .pager { justify-content: space-between; }
  .dialog-actions .btn { flex: 1 1 100%; }
  .facts { grid-template-columns: 1fr; gap: var(--s-2); }
  .stepper { gap: var(--s-2) var(--s-4); font-size: .9rem; }
  .chart-svg { min-width: 520px; }
  .donut-body { flex-direction: column; align-items: stretch; gap: var(--s-4); }
  .donut-fig { width: 150px; margin-inline: auto; }
  .segmented { display: flex; width: 100%; }
  .segmented a { flex: 1 1 auto; justify-content: center; padding: 0 var(--s-2); }
  .toolbar > div { width: 100%; }
  .toolbar-label { display: block; margin: 0 0 var(--s-2); }
  table.data thead { position: absolute; left: -9999px; }
  table.data, table.data tbody, table.data tr, table.data th, table.data td { display: block; }
  table.data tr { padding: var(--s-4); border-bottom: 1px solid var(--border); }
  table.data tbody tr:last-child { border-bottom: 0; }
  table.data th, table.data td, table.data th:first-child, table.data td:first-child, table.data th:last-child, table.data td:last-child { border: 0; padding: 2px 0; height: auto; }
  table.data tbody th { font-size: 1.02rem; margin-bottom: var(--s-1); }
  table.data td[data-label] { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--s-1) var(--s-4); align-items: baseline; padding: 3px 0; }
  table.data td[data-label]::before { content: attr(data-label); color: var(--muted); font-size: .85rem; font-weight: 500; flex: none; }
  table.data .num { text-align: right; }
  table.data td .btn { width: 100%; margin-top: var(--s-2); min-height: 44px; }
  .clip { max-width: none; white-space: normal; }
  .table-view table.data { display: table; }
  .table-view table.data tr { display: table-row; padding: 0; }
  .table-view table.data th, .table-view table.data td { display: table-cell; padding: var(--s-2) var(--s-3); }
  .table-view table.data thead { display: table-header-group; position: static; }
  .table-view table.data tbody { display: table-row-group; }
}

/* ---------- filters, date ranges, audit log ---------- */
.filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--s-3) var(--s-4); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: var(--s-4) var(--s-5); margin-bottom: var(--s-5); }
.filters label { display: grid; gap: var(--s-1); font-weight: 600; font-size: .85rem; color: var(--muted); flex: 1 1 170px; min-width: 0; }
.filters label.grow { flex: 2 1 260px; }
.filters input, .filters select { color: var(--text); font-weight: 400; }
.filter-actions { display: flex; flex-wrap: wrap; gap: var(--s-3); }
.range { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--s-3); }
.range-field { display: grid; gap: var(--s-1); font-weight: 600; font-size: .85rem; color: var(--muted); }
.range-field input { min-width: 160px; color: var(--text); font-weight: 400; }
.range-text { color: var(--muted); font-weight: 550; margin: 0 0 var(--s-4); font-variant-numeric: tabular-nums; }
.audit-date { font-weight: 650; }
.audit-time { color: var(--muted); font-variant-numeric: tabular-nums; margin-left: var(--s-1); }
.audit-text { font-weight: 600; margin-right: var(--s-2); }
.audit-cat { vertical-align: 1px; }
.audit-detail summary, details.more summary { cursor: pointer; color: var(--primary-ink); font-weight: 650; font-size: .88rem; min-height: 32px; display: flex; align-items: center; }
details.more { display: inline-block; overflow-wrap: anywhere; }
details.more summary { display: inline-flex; font-weight: 500; }
.changes { display: grid; gap: 2px; margin-top: var(--s-2); min-width: 280px; }
.change { display: grid; grid-template-columns: minmax(90px, .8fr) 1fr 1fr; gap: var(--s-3); padding: var(--s-2) var(--s-3); border-radius: var(--radius-xs); background: var(--surface-2); font-size: .88rem; overflow-wrap: anywhere; }
.change-head { background: transparent; color: var(--muted); font-weight: 600; font-size: .8rem; }
.change-key { font-weight: 650; }
.audit-link { margin: var(--s-2) 0 0; }
.db-usage { color: var(--text-2); }
@media (max-width: 639px) {
  .filters { padding: var(--s-4); }
  .filter-actions .btn, .range .btn { flex: 1 1 100%; }
  .change { grid-template-columns: 1fr; }
  .change-head { display: none; }
  .change > span[data-label]::before { content: attr(data-label) ": "; color: var(--muted); font-weight: 500; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
@media print { .sidebar, .topbar, .bottombar, .topstrip, .actions { display: none; } .shell { display: block; } }

/* Whole-card links: the "Batafsil" link stretches over its card (KPI cards and donut cards), so a
   click anywhere on the card opens the page. Cards without a link are not clickable. Interactive
   elements inside a donut card (the table toggle) stay above the overlay. */
.kpi:has(.kpi-more), .donut-card:has(.card-foot) { position: relative; transition: border-color .15s ease, background-color .15s ease, transform .15s ease; }
.kpi:has(.kpi-more):hover, .donut-card:has(.card-foot):hover { border-color: var(--primary); background: var(--surface-2); }
.kpi-more::after, .card-foot::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.kpi:has(.kpi-more) { border-radius: var(--radius); }
.kpi-more:focus-visible, .card-foot:focus-visible { outline: none; }
.kpi:has(.kpi-more:focus-visible), .donut-card:has(.card-foot:focus-visible) { outline: 2px solid var(--primary); outline-offset: 2px; }
.donut-card:has(.card-foot) :is(summary, details, button, a):not(.card-foot) { position: relative; z-index: 1; }
.kpi:has(.kpi-more):hover .kpi-arrow { color: var(--primary-ink); }

/* ---------- search as you type (macro search_box, static/js/search.js) ---------- */
.search-box { position: relative; display: block; min-width: 0; }
.search .search-box { flex: 1 1 260px; }
.search-box input[type="search"] { width: 100%; padding-right: 44px; }
.search-spin { position: absolute; top: 50%; right: 38px; width: 16px; height: 16px; margin-top: -8px; border: 2px solid var(--border-strong); border-top-color: var(--primary); border-radius: 50%; opacity: 0; pointer-events: none; transition: opacity .12s ease .15s; }
.search-spin.htmx-request { opacity: 1; animation: search-spin .7s linear infinite; }
@keyframes search-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .search-spin.htmx-request { animation: none; border-top-color: var(--border-strong); border-right-color: var(--primary); } }
/* With JavaScript the field searches by itself: the submit button is only the no-JS fallback. */
html.js .js-hide { display: none !important; }
