/* GantryView design system.
   Palette, radii, focus and form rules ported from habitly's "Doorframe" look
   (~/habitly apps/web/src/index.css, specs/S84a-brand-look.md): grey-green paper,
   teal action colour, green-black night; Alegreya Sans 800 for titles (SIL OFL,
   static/brand/OFL-AlegreyaSans.txt); no pill-shaped controls.
   Light is the base; dark redefines tokens only (system preference, or an explicit
   data-theme on <html> set by the theme toggle). */

@font-face {
  font-family: "Alegreya Sans";
  src: url("/static/brand/alegreya-sans-800-latin.woff2") format("woff2");
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Alegreya Sans Fallback";
  src: local("Arial Bold"), local("Arial-BoldMT"), local("Helvetica Bold"), local("Helvetica-Bold");
  font-weight: 800;
  size-adjust: 90%;
}

:root {
  color-scheme: light;
  accent-color: var(--focus);
  --bg: #ecede7;
  --bg-sunk: #e3e5dd;
  --card: #fbfbf8;
  --card-2: #f4f5f0;
  --ink: #1d2320;
  --muted: #545c57;
  --faint: #606661;
  --line: #d3d7cf;
  --line-strong: #bfc5bc;
  --accent: #1d4a4c;
  --accent-ink: #fbfbf8;
  --accent-soft: #d9e6e3;
  --brand: #1d4a4c;
  --lemon: #f2dd5a;
  --ok: #266734;
  --ok-fill: #d4efd6;
  --warn: #7b4903;
  --warn-fill: #f6e8d1;
  --bad: #a72721;
  --bad-fill: #fadbd7;
  --info: #295d94;
  --info-fill: #d2e5fa;
  --off: #7c827d;
  --off-fill: #e6e8e2;
  --focus: #1d4a4c;
  --track: rgba(29, 35, 32, 0.14);
  --media: #0f1312;
  --shadow-sm: 0 1px 2px rgba(29, 35, 32, 0.06);
  --shadow: 0 1px 2px rgba(29, 35, 32, 0.05), 0 8px 24px rgba(29, 35, 32, 0.07);
  --shadow-lg: 0 2px 6px rgba(29, 35, 32, 0.08), 0 24px 60px rgba(29, 35, 32, 0.14);
  --topbar-bg: rgba(236, 237, 231, 0.82);

  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-brand: "Alegreya Sans", "Alegreya Sans Fallback", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Mono", "JetBrains Mono", Menlo, Consolas, monospace;

  --radius: 12px;
  --radius-sm: 8px;
  --radius-field: 10px;
  --radius-tile: 20px;
  --radius-hero: 26px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #141917;
    --bg-sunk: #101412;
    --card: #1e2421;
    --card-2: #252c28;
    --ink: #eceee8;
    --muted: #a2aaa5;
    --faint: #8d958f;
    --line: #2c3430;
    --line-strong: #3a443f;
    --accent: #8cc1bb;
    --accent-ink: #0c2220;
    --accent-soft: #1d3331;
    --brand: #8cc1bb;
    --ok: #8fdd9b;
    --ok-fill: #1f3522;
    --warn: #f6c16b;
    --warn-fill: #36301e;
    --bad: #fe9b95;
    --bad-fill: #3e2725;
    --info: #9cc5f4;
    --info-fill: #202f3f;
    --off: #8a928d;
    --off-fill: #262d29;
    --focus: #8cc1bb;
    --track: rgba(236, 238, 232, 0.18);
    --media: #0a0d0c;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.28);
    --shadow-lg: 0 2px 6px rgba(0, 0, 0, 0.35), 0 24px 60px rgba(0, 0, 0, 0.45);
    --topbar-bg: rgba(20, 25, 23, 0.82);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #141917;
  --bg-sunk: #101412;
  --card: #1e2421;
  --card-2: #252c28;
  --ink: #eceee8;
  --muted: #a2aaa5;
  --faint: #8d958f;
  --line: #2c3430;
  --line-strong: #3a443f;
  --accent: #8cc1bb;
  --accent-ink: #0c2220;
  --accent-soft: #1d3331;
  --brand: #8cc1bb;
  --ok: #8fdd9b;
  --ok-fill: #1f3522;
  --warn: #f6c16b;
  --warn-fill: #36301e;
  --bad: #fe9b95;
  --bad-fill: #3e2725;
  --info: #9cc5f4;
  --info-fill: #202f3f;
  --off: #8a928d;
  --off-fill: #262d29;
  --focus: #8cc1bb;
  --track: rgba(236, 238, 232, 0.18);
  --media: #0a0d0c;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.28);
  --shadow-lg: 0 2px 6px rgba(0, 0, 0, 0.35), 0 24px 60px rgba(0, 0, 0, 0.45);
  --topbar-bg: rgba(20, 25, 23, 0.82);
}

/* ---------- base ---------- */
svg.ico { width: 18px; height: 18px; flex: none; vertical-align: -3px; }
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { min-height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
img { max-width: 100%; }
code, kbd, .mono { font-family: var(--font-mono); font-size: 0.92em; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
::selection { background: var(--accent-soft); }
[hidden] { display: none !important; }
.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; }

h1, h2, h3, .display {
  font-family: var(--font-brand);
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1.15;
  margin: 0;
  text-wrap: balance;
}
h1 { font-size: clamp(26px, 3.2vw, 34px); }
h2 { font-size: 22px; }
h3 { font-size: 18px; }
p { margin: 0; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.num { font-variant-numeric: tabular-nums; }
.eyebrow {
  font-size: 12px; font-weight: 650; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted);
}

/* ---------- shell ---------- */
.gv-topbar {
  position: sticky; top: 0; z-index: 50;
  background: var(--topbar-bg);
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.gv-topbar-inner {
  max-width: 1320px; margin: 0 auto; padding: 10px 20px;
  display: flex; align-items: center; gap: 18px; min-height: 64px;
}
.gv-brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; flex: none; }
.gv-brand:hover { text-decoration: none; }
.gv-brand img, .gv-brand svg { width: 34px; height: 34px; display: block; border-radius: 9px; }
.gv-wordmark { font-family: var(--font-brand); font-weight: 800; font-size: 22px; letter-spacing: -0.015em; line-height: 1; }
.gv-wordmark .v { color: var(--brand); }
.gv-nav { display: flex; align-items: center; gap: 4px; margin-left: 8px; }
.gv-nav a {
  display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 12px;
  border-radius: var(--radius-field); color: var(--muted); font-weight: 600; font-size: 14.5px; text-decoration: none;
}
.gv-nav a:hover { color: var(--ink); background: var(--card-2); }
.gv-nav a[aria-current="page"] { color: var(--ink); background: var(--card); box-shadow: inset 0 0 0 1px var(--line), var(--shadow-sm); }
.gv-nav a svg { width: 17px; height: 17px; flex: none; }
.gv-topbar .spacer { flex: 1; }
.gv-tools { display: flex; align-items: center; gap: 8px; }
.gv-org {
  display: inline-flex; flex-direction: column; align-items: flex-end; line-height: 1.2; padding-right: 6px;
  border-right: 1px solid var(--line); margin-right: 2px;
}
.gv-org .o { font-size: 13px; font-weight: 650; }
.gv-org .s { font-size: 11.5px; color: var(--muted); }
.gv-tools select { height: 38px; font-size: 13px; padding-top: 0; padding-bottom: 0; min-width: 0; width: 150px; }
.icon-btn {
  width: 38px; height: 38px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--radius-field); border: 1px solid var(--line); background: var(--card); color: var(--ink);
  cursor: pointer; padding: 0; flex: none;
}
.icon-btn:hover { border-color: var(--line-strong); background: var(--card-2); }
.icon-btn svg { width: 18px; height: 18px; }
.gv-menu-btn { display: none; }

.page { max-width: 1320px; margin: 0 auto; padding: 26px 20px 64px; }
.page-head { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head .titles { flex: 1 1 340px; min-width: 0; }
.page-head .titles p { margin-top: 6px; color: var(--muted); max-width: 72ch; }
.page-head .actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.section { margin-top: 30px; }
.section-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.section-head h2 { font-size: 21px; }
.section-head .hint { color: var(--muted); font-size: 13.5px; }
.section-head .right { margin-left: auto; display: flex; gap: 8px; align-items: center; }

/* ---------- surfaces ---------- */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-tile);
  box-shadow: var(--shadow);
}
.card.pad { padding: 20px; }
.card.flat { box-shadow: none; }
.card-head { display: flex; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.card-head h2, .card-head h3 { font-size: 18px; }
.card-body { padding: 18px 20px; }
.card-foot { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.well { background: var(--bg-sunk); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.divider { height: 1px; background: var(--line); margin: 16px 0; border: 0; }

.grid { display: grid; gap: 16px; }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.auto { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.stack { display: flex; flex-direction: column; gap: 14px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px; border-radius: var(--radius);
  border: 1px solid var(--line-strong); background: var(--card); color: var(--ink);
  font: inherit; font-weight: 650; font-size: 14.5px; line-height: 1; cursor: pointer;
  text-decoration: none; white-space: nowrap;
  transition: background-color .15s ease, border-color .15s ease, transform .1s ease, box-shadow .15s ease;
}
.btn:hover { text-decoration: none; background: var(--card-2); }
.btn:active:not(:disabled) { opacity: 0.8; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; }
.btn svg { width: 17px; height: 17px; flex: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); box-shadow: var(--shadow-sm); }
.btn.primary:hover { filter: brightness(1.08); background: var(--accent); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { background: var(--card-2); color: var(--ink); }
.btn.danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 45%, var(--line)); background: transparent; }
.btn.danger:hover { background: var(--bad-fill); }
.btn.sm, .btn.mini { height: 32px; padding: 0 11px; font-size: 13px; border-radius: var(--radius-field); }
.btn.lg { height: 48px; padding: 0 22px; font-size: 15.5px; }
.btn.block { width: 100%; }

/* ---------- status chips (no pills: 8px corners) ---------- */
.chip, .pill, .tag {
  display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px;
  border-radius: var(--radius-sm); font-size: 12px; font-weight: 650; letter-spacing: 0.01em;
  background: var(--off-fill); color: var(--muted); white-space: nowrap; border: 0; text-transform: none;
}
.chip .dot, .pill .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }
.chip.ok, .pill.ok { background: var(--ok-fill); color: var(--ok); }
.chip.warn, .pill.warn { background: var(--warn-fill); color: var(--warn); }
.chip.bad, .pill.bad { background: var(--bad-fill); color: var(--bad); }
.chip.info, .pill.info { background: var(--info-fill); color: var(--info); }
.chip.off, .pill.off { background: var(--off-fill); color: var(--muted); }
.chip.accent { background: var(--accent-soft); color: var(--accent); }
.chip.live .dot { animation: gv-pulse 1.8s ease-in-out infinite; }
.chip.outline { background: transparent; box-shadow: inset 0 0 0 1px var(--line-strong); color: var(--muted); }
@keyframes gv-pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .45; transform: scale(.8); } }

.status-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; background: var(--off); flex: none; }
.status-dot.ok { background: var(--ok); }
.status-dot.warn { background: var(--warn); }
.status-dot.bad { background: var(--bad); }
.status-dot.info { background: var(--info); }

/* ---------- forms ---------- */
label, .label { display: block; font-size: 13px; font-weight: 650; color: var(--muted); margin-bottom: 6px; }
.field { display: flex; flex-direction: column; }
.field .help { font-size: 12.5px; color: var(--faint); margin-top: 6px; }
input, select, textarea {
  font: inherit; font-size: 15px; color: var(--ink); background: var(--card);
  border: 1px solid var(--line-strong); border-radius: var(--radius-field);
  padding: 10px 12px; min-height: 42px; width: 100%;
}
input::placeholder, textarea::placeholder { color: var(--faint); }
input:not([type="radio"], [type="checkbox"], [type="range"], [type="file"], [type="button"], [type="submit"], [type="reset"], [type="image"], [type="color"]):focus,
input:not([type="radio"], [type="checkbox"], [type="range"], [type="file"], [type="button"], [type="submit"], [type="reset"], [type="image"], [type="color"]):focus-visible,
select:focus-visible, textarea:focus, textarea:focus-visible {
  outline: none; border-color: var(--focus); box-shadow: inset 0 0 0 1px var(--focus);
}
input[type="checkbox"], input[type="radio"] { width: 17px; height: 17px; min-height: 0; padding: 0; margin: 0; }
input[type="number"] { appearance: textfield; -moz-appearance: textfield; }
input[type="number"]::-webkit-inner-spin-button, input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
select {
  appearance: none; -webkit-appearance: none; padding-right: 34px;
  background-image: url(/static/ui/select-chevron-light.svg); background-repeat: no-repeat;
  background-position: right 12px center; background-size: 12px 8px;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) select { background-image: url(/static/ui/select-chevron-dark.svg); } }
:root[data-theme="dark"] select { background-image: url(/static/ui/select-chevron-dark.svg); }
textarea { min-height: 96px; resize: vertical; }
.check { display: flex; align-items: center; gap: 9px; font-size: 14px; font-weight: 500; color: var(--ink); margin: 0; cursor: pointer; }
.form-grid { display: grid; gap: 16px; }
.form-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.codebox {
  font-family: var(--font-mono); font-size: 12.5px; line-height: 1.55; white-space: pre; overflow: auto;
  background: var(--bg-sunk); color: var(--ink); border: 1px solid var(--line); border-radius: var(--radius);
}

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 11px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { font-size: 12px; font-weight: 650; color: var(--muted); letter-spacing: 0.02em; background: transparent; }
tbody tr:hover td { background: var(--card-2); }
tr:last-child td { border-bottom: 0; }

/* ---------- KPI tiles ---------- */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-tile); padding: 16px 18px; box-shadow: var(--shadow-sm); min-width: 0; }
.kpi .k { font-size: 12.5px; font-weight: 650; color: var(--muted); display: flex; align-items: center; gap: 7px; }
.kpi .k svg { width: 15px; height: 15px; color: var(--faint); }
.kpi .v { font-family: var(--font-brand); font-weight: 800; font-size: 34px; line-height: 1.05; margin-top: 8px; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.kpi .v small { font-family: var(--font-sans); font-size: 14px; font-weight: 600; color: var(--muted); margin-left: 4px; letter-spacing: 0; }
.kpi .s { font-size: 12.5px; color: var(--muted); margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- camera media ---------- */
.media {
  position: relative; background: var(--media); aspect-ratio: 16 / 9; overflow: hidden;
  border-radius: var(--radius); isolation: isolate;
}
.media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; transition: opacity .6s ease; }
.media .shade-top, .media .shade-bottom { position: absolute; left: 0; right: 0; pointer-events: none; z-index: 1; }
.media .shade-top { top: 0; height: 46%; background: linear-gradient(180deg, rgba(5, 8, 7, 0.62), rgba(5, 8, 7, 0)); }
.media .shade-bottom { bottom: 0; height: 52%; background: linear-gradient(0deg, rgba(5, 8, 7, 0.72), rgba(5, 8, 7, 0)); }
.media .on-media { position: absolute; z-index: 2; color: #f4f6f1; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.55); }
.media .empty {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  color: #a7b0aa; font-size: 13px; text-align: center; padding: 16px; z-index: 1;
}
.media .empty svg { width: 30px; height: 30px; opacity: .7; }
/* A frame that loaded (or is loading) covers the placeholder; onerror removes the img and the placeholder returns. */
.media:has(> img) > .empty { display: none; }
.on-media .chip { background: rgba(10, 14, 12, 0.55); color: #eef1ec; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.on-media .chip.ok { color: #9fe3aa; }
.on-media .chip.warn { color: #f6c16b; }
.on-media .chip.bad { color: #ffaca6; }
.media-btn {
  width: 36px; height: 36px; border-radius: 10px; border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(10, 14, 12, 0.5); color: #f4f6f1; display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); padding: 0;
}
.media-btn:hover { background: rgba(10, 14, 12, 0.72); border-color: rgba(255, 255, 255, 0.4); }
.media-btn svg { width: 17px; height: 17px; }

/* ---------- empty / notice ---------- */
.notice {
  display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--radius);
  background: var(--info-fill); color: var(--ink); border: 1px solid color-mix(in srgb, var(--info) 30%, transparent);
}
.notice.warn { background: var(--warn-fill); border-color: color-mix(in srgb, var(--warn) 35%, transparent); }
.notice.bad { background: var(--bad-fill); border-color: color-mix(in srgb, var(--bad) 35%, transparent); }
.notice.ok { background: var(--ok-fill); border-color: color-mix(in srgb, var(--ok) 35%, transparent); }
.notice .t { font-weight: 700; }
.notice .ico { flex: none; width: 20px; height: 20px; margin-top: 1px; }
.empty-state { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty-state h3 { color: var(--ink); margin-bottom: 6px; }

/* ---------- key/value ---------- */
.kv { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 8px 14px; font-size: 14px; }
.kv .k { color: var(--muted); font-size: 13px; }
.kv .v { min-width: 0; overflow-wrap: anywhere; }
.lines .line { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px dashed var(--line); font-size: 13.5px; }
.lines .line:last-child { border-bottom: 0; }
.lines .line span:first-child { color: var(--muted); }
.lines .line b { font-weight: 600; text-align: right; min-width: 0; overflow-wrap: anywhere; }

details.disclose > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13.5px; font-weight: 600; }
details.disclose > summary::-webkit-details-marker { display: none; }
details.disclose > summary::before { content: ""; width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); transition: transform .15s ease; margin-right: 2px; }
details.disclose[open] > summary::before { transform: rotate(45deg); }

/* ---------- footer ---------- */
.gv-foot { max-width: 1320px; margin: 0 auto; padding: 0 20px 28px; color: var(--faint); font-size: 12.5px; display: flex; gap: 14px; flex-wrap: wrap; }
.gv-foot .sep { opacity: .5; }

/* ---------- motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

/* ---------- responsive ---------- */
@media (max-width: 1080px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gv-org { display: none; }
}
@media (max-width: 860px) {
  .gv-topbar-inner { flex-wrap: wrap; gap: 10px; padding: 8px 16px; min-height: 58px; }
  .gv-menu-btn { display: inline-flex; }
  .gv-nav { order: 10; width: 100%; margin: 0; display: none; flex-direction: column; align-items: stretch; padding: 4px 0 8px; }
  .gv-topbar.open .gv-nav { display: flex; }
  .gv-nav a { height: 42px; }
  .grid.cols-2, .grid.cols-3, .form-grid.two { grid-template-columns: minmax(0, 1fr); }
  .page { padding: 18px 16px 48px; }
  .kv { grid-template-columns: minmax(0, 1fr); gap: 2px 0; }
  .kv .v { margin-bottom: 8px; }
}
@media (max-width: 520px) {
  .kpis { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
  .kpi { padding: 13px 14px; }
  .kpi .v { font-size: 28px; }
  .gv-tools select { max-width: 120px; }
  .gv-wordmark { font-size: 20px; }
}
