/* AIA design system: tokens, primitives, then page sections. One file for every page. */

@view-transition { navigation: auto; }

/* Geist, self-hosted (SIL OFL, fonts/OFL.txt): variable files, latin + latin-ext for č, š, ž. */
@font-face { font-family: 'Geist'; font-weight: 100 900; font-display: swap; src: url(/static/fonts/geist-latin-v5.woff2) format('woff2'); 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; }
@font-face { font-family: 'Geist'; font-weight: 100 900; font-display: swap; src: url(/static/fonts/geist-latin-ext-v5.woff2) format('woff2'); 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-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Geist Mono'; font-weight: 100 900; font-display: swap; src: url(/static/fonts/geist-mono-latin-v6.woff2) format('woff2'); 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; }
@font-face { font-family: 'Geist Mono'; font-weight: 100 900; font-display: swap; src: url(/static/fonts/geist-mono-latin-ext-v6.woff2) format('woff2'); 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-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  --font: 'Geist', ui-sans-serif, -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Arial, sans-serif;
  --mono: 'Geist Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --ease: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-io: cubic-bezier(0.77, 0, 0.175, 1);
  --r-s: 8px;
  --r-m: 12px;
  --r-l: 16px;
  --max: 1320px;

  --clean: #16a34a;
  --pass: #65a30d;
  --risk: #d97706;
  --alert: #ea580c;
  --fail: #dc2626;
  --nodata: #8a8a93;
  --run: #2563eb;
}

:root, [data-theme="light"] {
  color-scheme: light;
  --bg: #fbfbfa;
  --surface: #ffffff;
  --surface-2: #f4f4f3;
  --surface-3: #ececea;
  --line: #e7e7e4;
  --line-strong: #d6d6d2;
  --text: #17171a;
  --text-2: #55555c;
  --text-3: #8f8f97;
  --accent: #17171a;
  --on-accent: #ffffff;
  --chart: #2563eb;
  --chart-fill: rgba(37, 99, 235, .08);
  --shadow: 0 1px 2px rgba(20, 20, 25, .04), 0 8px 24px -12px rgba(20, 20, 25, .10);
  --shadow-lg: 0 24px 64px -24px rgba(20, 20, 25, .28), 0 2px 6px rgba(20, 20, 25, .06);
  --glass: rgba(251, 251, 250, .78);
  --tint: 12%;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b0b0d;
  --surface: #131316;
  --surface-2: #1a1a1e;
  --surface-3: #232328;
  --line: #242429;
  --line-strong: #33333a;
  --text: #f4f4f5;
  --text-2: #a8a8b0;
  --text-3: #6c6c75;
  --accent: #f4f4f5;
  --on-accent: #0b0b0d;
  --chart: #6ea1ff;
  --chart-fill: rgba(110, 161, 255, .10);
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px -12px rgba(0, 0, 0, .6);
  --shadow-lg: 0 24px 64px -24px rgba(0, 0, 0, .8), 0 2px 6px rgba(0, 0, 0, .4);
  --glass: rgba(11, 11, 13, .72);
  --tint: 18%;
  --clean: #22c55e;
  --pass: #84cc16;
  --risk: #f59e0b;
  --alert: #fb923c;
  --fail: #f87171;
  --run: #6ea1ff;
}

.t-clean { --c: var(--clean); }
.t-pass { --c: var(--pass); }
.t-risk { --c: var(--risk); }
.t-alert { --c: var(--alert); }
.t-fail { --c: var(--fail); }
.t-nodata { --c: var(--nodata); }
.t-run { --c: var(--run); }

/* ---------- Base ---------- */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scrollbar-gutter: stable; }
body {
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font: 400 14px/1.5 var(--font);
  font-feature-settings: 'ss01', 'cv11';
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
svg { flex-shrink: 0; }
.num, .kpi-value, .badge, table td.num { font-variant-numeric: tabular-nums; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--chart); outline-offset: 2px; border-radius: 6px; }
::selection { background: color-mix(in srgb, var(--chart) 24%, transparent); }

/* ---------- Top bar ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--glass);
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  border-bottom: 1px solid var(--line);
  view-transition-name: topbar;
}
.topbar-inner {
  max-width: var(--max);
  margin: 0 auto;
  height: 60px;
  padding: 0 24px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
}
.logo { justify-self: center; display: flex; color: var(--text); }
.logo svg { width: 88px; height: 28px; fill: currentColor; }
.nav { display: flex; gap: 2px; padding: 3px; border-radius: 11px; background: var(--surface-2); width: max-content; }
.nav a {
  position: relative;
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-3);
  transition: color 150ms ease;
}
.nav a:hover { color: var(--text); }
.nav a[aria-current="page"] {
  color: var(--text);
  background: var(--surface);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .08), 0 0 0 1px var(--line);
  view-transition-name: nav-pill;
}
.theme-toggle { justify-self: end; display: flex; gap: 2px; padding: 3px; border-radius: 10px; background: var(--surface-2); }
.theme-toggle button {
  width: 28px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  color: var(--text-3);
  transition: color 150ms ease, background 150ms ease;
}
.theme-toggle button svg { width: 14px; height: 14px; }
.theme-toggle button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(0, 0, 0, .08); }

/* ---------- Page ---------- */

.page { max-width: var(--max); margin: 0 auto; padding: 36px 24px 96px; view-transition-name: page; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 28px; flex-wrap: wrap; }
.page-head h1 { font-size: 26px; font-weight: 600; letter-spacing: -0.025em; line-height: 1.15; }
.page-sub { margin-top: 6px; color: var(--text-2); font-size: 14px; }
.page-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 18px;
  font-size: 13px;
  color: var(--text-3);
  transition: color 150ms ease;
}
.back:hover { color: var(--text); }
.back svg { width: 14px; height: 14px; }
.section-title { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }
.section-meta { color: var(--text-3); font-size: 12.5px; }
.stack { display: grid; gap: 20px; }
.stack > *, .dash-grid > *, .two > * { min-width: 0; }

/* ---------- Primitives ---------- */

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); box-shadow: var(--shadow); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px 0; flex-wrap: wrap; }
.panel-body { padding: 16px 20px 20px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 36px;
  padding: 0 14px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  color: var(--text);
  transition: transform 140ms var(--ease), background 150ms ease, border-color 150ms ease, opacity 150ms ease;
}
.btn svg { width: 15px; height: 15px; }
.btn:active:not(:disabled) { transform: scale(0.97); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn.danger { color: var(--fail); }
.btn.danger.solid { background: var(--fail); border-color: var(--fail); color: #fff; }
.btn.sm { height: 30px; padding: 0 10px; font-size: 12.5px; border-radius: 8px; }
@media (hover: hover) and (pointer: fine) {
  .btn:hover:not(:disabled) { border-color: var(--text-3); }
  .btn.primary:hover:not(:disabled) { opacity: .88; }
  .btn.ghost:hover:not(:disabled) { background: var(--surface-2); color: var(--text); }
}
.btn.is-loading { pointer-events: none; }
.btn.is-loading svg { display: none; }
.btn.is-loading::before {
  content: '';
  width: 13px;
  height: 13px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 600ms linear infinite;
}

.icon-btn {
  width: 30px;
  height: 30px;
  display: inline-grid;
  place-items: center;
  border-radius: 8px;
  color: var(--text-3);
  transition: background 150ms ease, color 150ms ease, transform 140ms var(--ease);
}
.icon-btn svg { width: 16px; height: 16px; }
.icon-btn:active { transform: scale(0.94); }
@media (hover: hover) and (pointer: fine) {
  .icon-btn:hover { background: var(--surface-2); color: var(--text); }
}

.input {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  outline: none;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}
textarea.input { height: auto; padding: 10px 12px; resize: vertical; }
select.input {
  appearance: none;
  padding-right: 34px;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a8a93' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center / 14px;
  cursor: pointer;
}
.input.sm { width: auto; height: 32px; font-size: 13px; border-radius: 8px; }
.input:focus { border-color: var(--text-3); box-shadow: 0 0 0 3px color-mix(in srgb, var(--chart) 18%, transparent); }
.input[aria-invalid="true"] { border-color: var(--fail); }
.field { display: grid; gap: 6px; font-size: 12.5px; font-weight: 500; color: var(--text-2); }
.error-text { color: var(--fail); font-size: 12.5px; min-height: 0; }

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 46px;
  height: 24px;
  padding: 0 8px;
  border-radius: 7px;
  font: 600 12.5px/1 var(--mono);
  color: var(--c, var(--nodata));
  background: color-mix(in srgb, var(--c, var(--nodata)) var(--tint), transparent);
}
.badge.lg { height: 30px; min-width: 58px; font-size: 14px; border-radius: 9px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--c, var(--nodata));
  white-space: nowrap;
}
.chip::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 22px;
  padding: 0 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .02em;
  text-transform: uppercase;
  color: var(--text-3);
  background: var(--surface-2);
}
.pill svg { width: 11px; height: 11px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c, var(--nodata)); display: inline-block; }
.dot.live { background: var(--run); box-shadow: 0 0 0 0 color-mix(in srgb, var(--run) 50%, transparent); animation: live 1.6s var(--ease) infinite; }
.delta { font: 500 12px/1 var(--mono); color: var(--text-3); }
.delta.up { color: var(--clean); }
.delta.down { color: var(--fail); }

.skeleton {
  display: block;
  border-radius: 8px;
  background: linear-gradient(90deg, var(--surface-2) 0%, var(--surface-3) 50%, var(--surface-2) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.4s ease infinite;
}
.empty { padding: 48px 20px; text-align: center; color: var(--text-3); font-size: 13.5px; }
.empty strong { display: block; margin-bottom: 4px; font-size: 15px; font-weight: 600; color: var(--text); }
.muted { color: var(--text-3); }
.spinner { width: 14px; height: 14px; border: 2px solid var(--line-strong); border-top-color: var(--text-2); border-radius: 50%; animation: spin 700ms linear infinite; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@keyframes live { 70% { box-shadow: 0 0 0 7px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }


/* ---------- KPI tiles ---------- */

.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.kpis.six { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.kpi { padding: 18px 20px; display: flex; flex-direction: column; gap: 10px; min-height: 142px; }
.kpi-label { font-size: 12.5px; font-weight: 500; color: var(--text-3); }
.kpi-value { font-size: 30px; font-weight: 600; letter-spacing: -0.03em; line-height: 1; color: var(--c, var(--text)); }
.kpi-value small { font-size: 16px; font-weight: 500; color: var(--text-3); letter-spacing: 0; }
.kpi-foot { margin-top: auto; display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-2); flex-wrap: wrap; }
.kpi .chart.spark { height: 34px; margin-top: auto; }
.potential-row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--text-2); }
.potential-row b { font: 600 15px/1 var(--mono); color: var(--c, var(--text)); }
.potential-row .arrow { color: var(--text-3); margin: 0 4px; }

.dist { display: flex; gap: 2px; height: 8px; border-radius: 4px; overflow: hidden; background: var(--surface-2); }
.dist > span { background: var(--c); min-width: 3px; transition: flex-grow 500ms var(--ease); }
.dist-legend { display: flex; gap: 10px; flex-wrap: wrap; font-size: 11.5px; color: var(--text-3); }
.dist-legend span { display: inline-flex; align-items: center; gap: 5px; }

.bars { display: flex; align-items: flex-end; gap: 2px; height: 34px; margin-top: auto; }
.bars > i { flex: 1; min-height: 2px; border-radius: 2px; background: var(--surface-3); }
.bars > i.on { background: var(--chart); }

/* ---------- Charts ---------- */

.chart { position: relative; height: 220px; }
.chart svg { width: 100%; height: 100%; overflow: visible; display: block; }
.chart .grid-line { stroke: var(--line); stroke-width: 1; }
.chart .axis { fill: var(--text-3); font: 10px var(--mono); }
.chart .line { fill: none; stroke: var(--chart); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .area { fill: var(--chart-fill); }
.chart .point { fill: var(--surface); stroke: var(--chart); stroke-width: 2; }
.chart .guide { stroke: var(--text-3); stroke-dasharray: 3 3; }
.chart-foot { display: flex; gap: 28px; margin-top: 14px; flex-wrap: wrap; }
.chart-stat { display: grid; gap: 2px; }
.chart-stat span { font-size: 12px; color: var(--text-3); }
.chart-stat b { font: 600 15px/1.2 var(--mono); }
.tooltip {
  position: fixed;
  z-index: 60;
  pointer-events: none;
  padding: 6px 9px;
  border-radius: 8px;
  background: var(--text);
  color: var(--bg);
  font: 500 12px/1.35 var(--font);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(2px);
  transition: opacity 120ms ease, transform 120ms var(--ease);
  max-width: 280px;
  white-space: pre-line;
}
.tooltip.show { opacity: 1; transform: none; }
.tooltip b { font-family: var(--mono); }

.segmented { display: inline-flex; padding: 3px; gap: 2px; background: var(--surface-2); border-radius: 9px; }
.segmented button { height: 26px; padding: 0 10px; border-radius: 7px; font-size: 12px; font-weight: 500; color: var(--text-3); transition: color 150ms ease, background 150ms ease; }
.segmented button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(0, 0, 0, .08); }

/* ---------- Dashboard ---------- */

.dash-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 14px; }
.weak-list { display: grid; gap: 12px; }
.weak-item { display: grid; gap: 6px; }
.weak-top { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; }
.weak-top span:last-child { color: var(--text-3); font-size: 12px; white-space: nowrap; }
.meter { height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
.meter > i { display: block; height: 100%; width: var(--w); background: var(--c); border-radius: 3px; transform-origin: left; animation: grow 700ms var(--ease) both; }
@keyframes grow { from { transform: scaleX(0); } }

.heatmap-wrap { overflow-x: auto; margin: 0 -20px -20px; padding: 0 20px 20px; }
.heatmap { border-collapse: separate; border-spacing: 3px; font-size: 12.5px; min-width: 100%; }
.heatmap th { font-weight: 500; color: var(--text-3); font-size: 11px; white-space: nowrap; padding: 0 2px 6px; }
.heatmap thead th:not(:first-child) { writing-mode: vertical-rl; transform: rotate(180deg); text-align: left; height: 104px; vertical-align: bottom; padding: 6px 0; }
.heatmap td { height: 26px; min-width: 26px; border-radius: 5px; }
.heatmap td.cell { background: color-mix(in srgb, var(--c) calc(var(--tint) + 58%), var(--surface)); cursor: default; transition: transform 120ms var(--ease); }
.heatmap td.cell.t-nodata { background: var(--surface-2); }
.heatmap tbody tr { cursor: pointer; }
.heatmap .site {
  position: sticky;
  left: 0;
  z-index: 1;
  background: var(--surface);
  padding: 0 12px 0 2px;
  white-space: nowrap;
  font-weight: 500;
  width: 210px;
}
.heatmap .site a { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.heatmap .site .badge { min-width: 40px; height: 20px; font-size: 11.5px; }
@media (hover: hover) and (pointer: fine) {
  .heatmap tbody tr:hover .site { color: var(--chart); }
  .heatmap td.cell:hover { transform: scale(1.12); }
}

.run-list { display: grid; }
.run-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  align-items: center;
  gap: 16px;
  padding: 11px 20px;
  border-top: 1px solid var(--line);
  transition: background 150ms ease;
}
.run-row:first-child { border-top: 0; }
.run-row .domain { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.run-row .meta { color: var(--text-3); font-size: 12.5px; white-space: nowrap; font-variant-numeric: tabular-nums; }
@media (hover: hover) and (pointer: fine) { a.run-row:hover { background: var(--surface-2); } }
.day-label { padding: 16px 20px 6px; font-size: 12px; font-weight: 600; color: var(--text-3); border-top: 1px solid var(--line); }
.day-label:first-child { border-top: 0; padding-top: 8px; }

.batch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--run) 10%, transparent);
  color: var(--run);
  font-size: 13px;
  font-weight: 500;
}
.batch .progress { width: 90px; }

/* ---------- Automatic: site cards ---------- */

.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 22px; }
.toolbar .search { position: relative; flex: 1 1 240px; max-width: 320px; }
.toolbar .search svg { position: absolute; left: 11px; top: 50%; width: 15px; height: 15px; transform: translateY(-50%); color: var(--text-3); }
.toolbar .search .input { padding-left: 34px; height: 36px; }
.toolbar .spacer { flex: 1; }
.group-head { display: flex; align-items: baseline; gap: 12px; margin: 30px 0 12px; }
.group-head:first-child { margin-top: 0; }
.group-head .dist { flex: 1; max-width: 220px; align-self: center; }

.site-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(268px, 1fr)); gap: 12px; align-items: start; }
.site-grid > *, .site-card .body > * { min-width: 0; }
.site-card { border-radius: var(--r-l); transition: box-shadow 200ms ease, border-color 200ms ease; }
.site-card > summary { list-style: none; display: grid; gap: 12px; padding: 16px 16px 14px; cursor: pointer; border-radius: inherit; }
.site-card > summary::-webkit-details-marker { display: none; }
.site-card .row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.site-card .domain { font-weight: 600; font-size: 14.5px; letter-spacing: -0.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.site-card .foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--text-3); }
.site-card .chev { width: 14px; height: 14px; color: var(--text-3); transition: transform 220ms var(--ease); }
.site-card[open] .chev { transform: rotate(180deg); }
.site-card[open] { border-color: var(--line-strong); box-shadow: var(--shadow-lg); }
@media (hover: hover) and (pointer: fine) { .site-card:not([open]):hover { border-color: var(--line-strong); } }
.site-card::details-content {
  block-size: 0;
  overflow: hidden;
  opacity: 0;
  transition: block-size 260ms var(--ease), opacity 200ms ease, content-visibility 260ms allow-discrete;
}
.site-card[open]::details-content { block-size: auto; opacity: 1; }
@supports (interpolate-size: allow-keywords) { :root { interpolate-size: allow-keywords; } }
.site-card .body { padding: 0 16px 16px; display: grid; gap: 14px; }
.site-card .summary-text { font-size: 13px; line-height: 1.55; color: var(--text-2); border-top: 1px solid var(--line); padding-top: 14px; }
.site-card .actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.site-card .actions .spacer { flex: 1; }
.site-card.pending > summary { cursor: default; }
.site-card.pending .progress { margin-top: 2px; }

.strip { display: flex; gap: 2px; }
.strip > i { flex: 1; height: 6px; border-radius: 2px; background: var(--c); opacity: .9; }
.strip > i.t-nodata { background: var(--surface-3); }

.progress { height: 4px; border-radius: 2px; background: var(--surface-3); overflow: hidden; }
.progress > i { display: block; height: 100%; width: var(--p, 0%); background: var(--run); border-radius: 2px; transition: width 600ms var(--ease); }
.progress.indeterminate > i { width: 35%; animation: slide 1.3s var(--ease-io) infinite; }
@keyframes slide { from { transform: translateX(-100%); } to { transform: translateX(300%); } }

/* ---------- Overview ---------- */

.ov-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 22px; flex-wrap: wrap; }
.ov-domain { display: inline-flex; align-items: center; gap: 8px; font-size: 30px; font-weight: 600; letter-spacing: -0.03em; line-height: 1.1; }
.ov-domain svg { width: 18px; height: 18px; color: var(--text-3); transition: transform 200ms var(--ease), color 150ms ease; }
@media (hover: hover) and (pointer: fine) { a.ov-domain:hover svg { transform: translate(2px, -2px); color: var(--text); } }
.ov-meta { display: flex; align-items: center; gap: 10px; margin-top: 8px; color: var(--text-3); font-size: 13px; }
.ov-right { display: flex; align-items: center; gap: 14px; }
.ring { position: relative; width: 76px; height: 76px; display: grid; place-items: center; }
.ring svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 5; }
.ring .track { stroke: var(--surface-3); }
.ring .value { stroke: var(--c, var(--chart)); stroke-linecap: round; transition: stroke-dashoffset 900ms var(--ease); }
.ring b { font: 600 20px/1 var(--mono); letter-spacing: -0.02em; }
.ov-summary { padding: 18px 20px; font-size: 14px; line-height: 1.65; color: var(--text-2); }
.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }

.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th {
  text-align: left;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-3);
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.table td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table .title { font-weight: 500; white-space: nowrap; }
.table .summary { color: var(--text-2); font-size: 13px; line-height: 1.5; }
.table .override { margin-top: 4px; font-size: 11.5px; color: var(--text-3); }
.table td.num { font-family: var(--mono); font-weight: 600; white-space: nowrap; }
.table td.end { width: 1%; text-align: right; }
.table tr[data-history] { cursor: pointer; transition: background 150ms ease; }
@media (hover: hover) and (pointer: fine) { .table tr[data-history]:hover { background: var(--surface-2); } }
.table-wrap { overflow-x: auto; }
.table.params th:nth-child(1) { width: 210px; }
.table.params th:nth-child(2) { width: 130px; }
.table.params th:nth-child(3) { width: 80px; }

/* ---------- Manual ---------- */

.runbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; padding: 14px; }
.runbar .input { height: 44px; font-size: 15px; }
.runbar .btn { height: 44px; padding: 0 18px; }
.runbar-foot { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.picker > summary { list-style: none; display: inline-flex; align-items: center; gap: 6px; cursor: pointer; font-size: 12.5px; color: var(--text-2); padding: 4px 2px; }
.picker > summary::-webkit-details-marker { display: none; }
.picker > summary svg { width: 13px; height: 13px; transition: transform 200ms var(--ease); }
.picker[open] > summary svg { transform: rotate(180deg); }
.toggles { display: flex; flex-wrap: wrap; gap: 6px; padding-top: 10px; }
.toggle {
  height: 30px;
  padding: 0 11px;
  border-radius: 8px;
  font-size: 12.5px;
  border: 1px solid var(--line-strong);
  color: var(--text-2);
  transition: background 150ms ease, color 150ms ease, border-color 150ms ease, transform 140ms var(--ease);
}
.toggle:active { transform: scale(0.96); }
.toggle[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.active-runs { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.run-panel { padding: 16px; display: grid; gap: 12px; animation: rise 360ms var(--ease) both; }
.run-panel.done { border-color: color-mix(in srgb, var(--clean) 40%, var(--line)); }
.run-panel .head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.run-panel .head b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.run-panel .timer { font: 500 12.5px var(--mono); color: var(--text-3); }
.agents { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 12px; font-size: 12.5px; }
.agents span { display: flex; align-items: center; gap: 7px; color: var(--text-3); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.agents span::before { content: ''; flex-shrink: 0; width: 7px; height: 7px; border-radius: 50%; border: 1.5px solid var(--line-strong); }
.agents span.done { color: var(--text); }
.agents span.done::before { background: var(--clean); border-color: var(--clean); }
.agents span.running::before { border-color: var(--run); border-right-color: transparent; animation: spin 700ms linear infinite; }
.run-panel .foot { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; }

/* ---------- Parametri ---------- */

.param-card > summary {
  list-style: none;
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) auto auto 14px;
  align-items: center;
  gap: 18px;
  padding: 16px 20px;
  cursor: pointer;
}
.param-card > summary::-webkit-details-marker { display: none; }
.param-card .name { font-weight: 600; }
.param-card .affected { font-size: 12.5px; color: var(--text-3); white-space: nowrap; font-variant-numeric: tabular-nums; }
.param-card .chev { width: 14px; height: 14px; color: var(--text-3); transition: transform 220ms var(--ease); }
.param-card[open] .chev { transform: rotate(180deg); }
.param-card::details-content { block-size: 0; overflow: hidden; transition: block-size 280ms var(--ease), content-visibility 280ms allow-discrete; }
.param-card[open]::details-content { block-size: auto; }
.param-card .content { border-top: 1px solid var(--line); padding: 4px 8px 8px; }
.param-list { display: grid; gap: 10px; }

.filter-menu { padding: 14px; width: 300px; display: grid; gap: 14px; }
.filter-group { display: grid; gap: 7px; }
.filter-group > span { font-size: 11.5px; font-weight: 600; color: var(--text-3); }
.filter-group > div { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---------- Dialogs, menus ---------- */

dialog.modal {
  margin: auto;
  width: min(720px, calc(100vw - 32px));
  max-height: min(84dvh, 820px);
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  opacity: 0;
  transform: scale(0.97) translateY(6px);
  transition: opacity 200ms ease, transform 240ms var(--ease), overlay 240ms allow-discrete, display 240ms allow-discrete;
}
dialog.modal[open] { opacity: 1; transform: none; display: flex; flex-direction: column; }
@starting-style { dialog.modal[open] { opacity: 0; transform: scale(0.97) translateY(6px); } }
dialog.modal::backdrop { background: rgba(10, 10, 12, 0); backdrop-filter: blur(0); transition: background 240ms ease, backdrop-filter 240ms ease, overlay 240ms allow-discrete, display 240ms allow-discrete; }
dialog.modal[open]::backdrop { background: rgba(10, 10, 12, .38); backdrop-filter: blur(3px); }
@starting-style { dialog.modal[open]::backdrop { background: rgba(10, 10, 12, 0); backdrop-filter: blur(0); } }
dialog.modal.sm { width: min(440px, calc(100vw - 32px)); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 16px 12px 22px; border-bottom: 1px solid var(--line); }
.modal-head h2 { font-size: 16px; font-weight: 600; letter-spacing: -0.01em; }
.modal-body { padding: 20px 22px; overflow-y: auto; font-size: 14px; line-height: 1.65; color: var(--text-2); }
.modal-body.form { display: grid; gap: 14px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--line); }
.modal-body pre.logs { font: 12px/1.55 var(--mono); white-space: pre-wrap; word-break: break-word; color: var(--text); }
.prose h2, .prose h3 { color: var(--text); font-size: 15px; font-weight: 600; margin: 18px 0 6px; }
.prose h2:first-child, .prose h3:first-child { margin-top: 0; }
.prose p { margin: 0 0 10px; }
.prose ul, .prose ol { margin: 0 0 10px 20px; }
.prose li { margin: 3px 0; }
.prose code { font: 12.5px var(--mono); background: var(--surface-2); padding: 1px 5px; border-radius: 5px; color: var(--text); }
.prose pre { background: var(--surface-2); border-radius: 10px; padding: 12px; overflow-x: auto; margin: 0 0 10px; }
.prose pre code { background: none; padding: 0; }
.prose strong { color: var(--text); }

[popover].menu {
  position: fixed;
  inset: auto;
  margin: 0;
  min-width: 200px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: scale(0.96);
  transition: opacity 150ms ease, transform 180ms var(--ease), overlay 180ms allow-discrete, display 180ms allow-discrete;
}
[popover].menu:popover-open { opacity: 1; transform: none; }
@starting-style { [popover].menu:popover-open { opacity: 0; transform: scale(0.96); } }
.menu-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 13px;
  text-align: left;
  transition: background 120ms ease;
}
.menu-item svg { width: 16px; height: 16px; color: var(--text-3); }
@media (hover: hover) and (pointer: fine) { .menu-item:hover { background: var(--surface-2); } }

/* ---------- Site config panel ---------- */

.config-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.config-grid .wide { grid-column: 1 / -1; }
.config-section { font-size: 12px; font-weight: 600; color: var(--text-3); padding-top: 6px; }
.switch-row { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---------- Login ---------- */

.login { min-height: 100dvh; display: grid; place-items: center; padding: 24px; }
.login-box { width: min(380px, 100%); padding: 32px; display: grid; gap: 16px; }
.login-box .logo { justify-self: start; }
.login-box h1 { font-size: 20px; font-weight: 600; letter-spacing: -0.02em; }

/* ---------- View transitions & motion ---------- */

::view-transition-old(page) { animation: 160ms ease both vt-out; }
::view-transition-new(page) { animation: 260ms var(--ease) both vt-in; }
@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in { from { opacity: 0; transform: translateY(6px); } }
/* A theme switch cross-fades the whole page instead of moving it. */
.theme-switch .topbar, .theme-switch .page, .theme-switch .nav a { view-transition-name: none; }
::view-transition-group(nav-pill) { animation-duration: 260ms; animation-timing-function: var(--ease); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; }
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}

/* ---------- Responsive ---------- */

@media (max-width: 1100px) {
  .kpis.six { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .dash-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .two { grid-template-columns: minmax(0, 1fr); }
  .param-card > summary { grid-template-columns: minmax(0, 1fr) auto 14px; }
  .param-card > summary .meter, .param-card > summary .affected { display: none; }
}
@media (max-width: 720px) {
  .topbar-inner { grid-template-columns: 1fr auto; height: auto; padding: 10px 16px; gap: 10px; }
  .logo { justify-self: start; }
  .logo svg { width: 72px; height: 24px; }
  .nav { grid-column: 1 / -1; grid-row: 2; width: 100%; }
  .nav a { flex: 1; text-align: center; padding: 6px 4px; }
  .page { padding: 24px 16px 72px; }
  .page-head h1 { font-size: 22px; }
  .kpis, .kpis.six { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
  .kpi { padding: 14px; min-height: 120px; }
  .kpi-value { font-size: 24px; }
  .ov-domain { font-size: 24px; }
  .run-row { grid-template-columns: minmax(0, 1fr) auto; padding: 11px 14px; }
  .run-row .pill, .run-row .meta.hide-sm { display: none; }
  .config-grid { grid-template-columns: minmax(0, 1fr); }
  .runbar { grid-template-columns: minmax(0, 1fr); }
  .table .summary { min-width: 220px; }
}

/* ---------- Poročila ---------- */

.table.reports td.recipients { color: var(--text-2); max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.table.reports .error { margin-top: 4px; font-size: 11.5px; color: var(--fail); white-space: normal; }
.table.reports td.end { white-space: nowrap; }
.field .hint { font-weight: 400; color: var(--text-3); }
.kpi.link { color: inherit; text-decoration: none; transition: border-color 150ms ease; }
@media (hover: hover) and (pointer: fine) { .kpi.link:hover { border-color: var(--line-strong); } }
.kpis.five { grid-template-columns: repeat(5, minmax(0, 1fr)); }
@media (max-width: 1100px) { .kpis.five { grid-template-columns: repeat(3, minmax(0, 1fr)); } .kpis.five > :last-child { grid-column: span 2; } }
@media (max-width: 720px) { .kpis.five { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .kpis.five > :last-child { grid-column: 1 / -1; } }
