/* JetWash – monitoring autoumyvárne. Mobil najprv, svetlá aj tmavá téma. */

:root {
  color-scheme: light;
  --bg: #f3f5f9;
  --bg-grad: radial-gradient(1200px 600px at 10% -10%, #dff1ff 0%, transparent 60%), radial-gradient(900px 500px at 110% 0%, #e7e9ff 0%, transparent 55%);
  --surface: #ffffff;
  --surface-2: #f6f8fb;
  --surface-3: #eef2f7;
  --border: rgba(15, 23, 42, 0.08);
  --border-strong: rgba(15, 23, 42, 0.14);
  --text: #0b1220;
  --text-2: #475467;
  --muted: #8a94a6;
  --grid: #e6e9ef;
  --axis: #c7ccd6;
  --brand: #0a7cff;
  --brand-2: #00b4d8;
  --brand-ink: #ffffff;
  --brand-soft: rgba(10, 124, 255, 0.10);
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 4px 16px rgba(16, 24, 40, 0.06);
  --shadow-lg: 0 10px 40px rgba(16, 24, 40, 0.14);

  --good: #0ca30c;
  --good-ink: #067a06;
  --warning: #fab219;
  --warning-ink: #8a5a00;
  --serious: #ec835a;
  --critical: #d03b3b;
  --critical-soft: rgba(208, 59, 59, 0.09);
  --warning-soft: rgba(250, 178, 25, 0.14);
  --good-soft: rgba(12, 163, 12, 0.10);

  /* Farby boxov (kategorické poradie, overené na farbosleposť) */
  --s1: #2a78d6;
  --s2: #eb6834;
  --s3: #1baf7a;
  --s4: #eda100;
  --s5: #e87ba4;
  --s6: #6250d6;

  --radius: 18px;
  --radius-sm: 12px;
  --sidebar: 248px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0a0e15;
    --bg-grad: radial-gradient(1000px 520px at 0% -10%, rgba(10, 124, 255, 0.16) 0%, transparent 60%), radial-gradient(800px 480px at 110% 0%, rgba(0, 180, 216, 0.10) 0%, transparent 55%);
    --surface: #121823;
    --surface-2: #161d2a;
    --surface-3: #1d2534;
    --border: rgba(255, 255, 255, 0.07);
    --border-strong: rgba(255, 255, 255, 0.13);
    --text: #eef2f7;
    --text-2: #b4bfd0;
    --muted: #7d8799;
    --grid: #232b39;
    --axis: #364052;
    --brand: #3b93ff;
    --brand-soft: rgba(59, 147, 255, 0.14);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 4px 18px rgba(0, 0, 0, 0.25);
    --good-ink: #3fcf3f;
    --warning-ink: #fab219;
    --critical-soft: rgba(208, 59, 59, 0.16);
    --warning-soft: rgba(250, 178, 25, 0.12);
    --good-soft: rgba(12, 163, 12, 0.14);
    --s1: #3987e5;
    --s2: #d95926;
    --s3: #199e70;
    --s4: #c98500;
    --s5: #d55181;
    --s6: #9085e9;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0a0e15;
  --bg-grad: radial-gradient(1000px 520px at 0% -10%, rgba(10, 124, 255, 0.16) 0%, transparent 60%), radial-gradient(800px 480px at 110% 0%, rgba(0, 180, 216, 0.10) 0%, transparent 55%);
  --surface: #121823;
  --surface-2: #161d2a;
  --surface-3: #1d2534;
  --border: rgba(255, 255, 255, 0.07);
  --border-strong: rgba(255, 255, 255, 0.13);
  --text: #eef2f7;
  --text-2: #b4bfd0;
  --muted: #7d8799;
  --grid: #232b39;
  --axis: #364052;
  --brand: #3b93ff;
  --brand-soft: rgba(59, 147, 255, 0.14);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 4px 18px rgba(0, 0, 0, 0.25);
  --good-ink: #3fcf3f;
  --warning-ink: #fab219;
  --critical-soft: rgba(208, 59, 59, 0.16);
  --warning-soft: rgba(250, 178, 25, 0.12);
  --good-soft: rgba(12, 163, 12, 0.14);
  --s1: #3987e5;
  --s2: #d95926;
  --s3: #199e70;
  --s4: #c98500;
  --s5: #d55181;
  --s6: #9085e9;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.45;
  color: var(--text);
  background: var(--bg);
  background-image: var(--bg-grad);
  background-attachment: fixed;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; color: inherit; }
a { color: var(--brand); text-decoration: none; }
h1, h2, h3 { margin: 0; letter-spacing: -0.01em; }
.tabular, table { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.text-2 { color: var(--text-2); }
.small { font-size: 13px; }
.xs { font-size: 12px; }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }
svg.i { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
svg.i.sm { width: 16px; height: 16px; }

.splash { display: grid; place-items: center; min-height: 100vh; color: var(--muted); }

/* ------------------------------------------------------------------ shell */

.shell { display: flex; min-height: 100vh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar);
  display: flex; flex-direction: column; gap: 6px;
  padding: 20px 14px; border-right: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  z-index: 20;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 4px 8px 18px; }
.logo {
  width: 40px; height: 40px; border-radius: 12px; flex: none;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 100%);
  box-shadow: 0 6px 18px rgba(10, 124, 255, 0.35);
}
.logo svg { width: 22px; height: 22px; fill: #fff; }
.brand-name { font-weight: 750; font-size: 17px; letter-spacing: -0.02em; }
.brand-sub { font-size: 12px; color: var(--muted); }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px;
  color: var(--text-2); font-weight: 560;
}
.nav a:hover { background: var(--surface-3); color: var(--text); }
.nav a.active { background: var(--brand-soft); color: var(--brand); }
.nav .count {
  margin-left: auto; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 11px;
  background: var(--critical); color: #fff; font-size: 12px; font-weight: 700; display: grid; place-items: center;
}
.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; padding: 10px 6px 0; border-top: 1px solid var(--border); }
.me { display: flex; align-items: center; gap: 10px; min-width: 0; }
.avatar {
  width: 32px; height: 32px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: var(--surface-3); color: var(--text-2); font-weight: 700; font-size: 13px;
}
.me .email { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.foot-actions { display: flex; gap: 6px; }

.main { flex: 1; margin-left: var(--sidebar); min-width: 0; }
.content { max-width: 1320px; margin: 0 auto; padding: 26px 32px 60px; }

.topbar {
  display: none; position: sticky; top: 0; z-index: 15;
  align-items: center; gap: 10px; padding: 10px 16px; padding-top: max(10px, env(safe-area-inset-top));
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.topbar .logo { width: 34px; height: 34px; border-radius: 10px; }
.topbar .logo svg { width: 18px; height: 18px; }
.topbar-title { font-weight: 720; font-size: 16px; line-height: 1.15; }
.topbar-sub { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 42vw; }
.topbar > div:nth-child(2) { min-width: 0; }
@media (max-width: 959px) { .status-strip .pill:not(.demo) { display: none; } }
@media (max-width: 760px) { .grid.stats-2 { grid-template-columns: 1fr 1fr; gap: 10px; } .stats-2 .stat .v { font-size: 20px; } .stats-2 .card { padding: 13px 14px; } }
.topbar .spacer { flex: 1; }

.tabbar {
  display: none; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  padding: 6px 6px max(6px, env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--border);
  grid-template-columns: repeat(5, 1fr);
}
.tabbar a {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 6px 2px; border-radius: 12px; color: var(--muted); font-size: 11px; font-weight: 600;
}
.tabbar a.active { color: var(--brand); }
.tabbar a.active svg.i { stroke-width: 2.2; }
.tabbar .dot { position: absolute; top: 3px; left: calc(50% + 8px); width: 9px; height: 9px; border-radius: 50%; background: var(--critical); box-shadow: 0 0 0 2px var(--surface); }

@media (max-width: 959px) {
  .sidebar { display: none; }
  .main { margin-left: 0; }
  .topbar { display: flex; }
  .tabbar { display: grid; }
  .content { padding: 14px 16px calc(92px + env(safe-area-inset-bottom)); }
}

/* ------------------------------------------------------------------ page header */

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head h1 { font-size: 26px; font-weight: 760; }
.page-head .sub { color: var(--text-2); margin-top: 2px; }
@media (max-width: 959px) { .page-head h1 { font-size: 22px; } .page-head { margin-bottom: 14px; } }

/* ------------------------------------------------------------------ cards & grid */

.grid { display: grid; gap: 16px; }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); }
@media (max-width: 1180px) { .g-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g-main { grid-template-columns: 1fr; } }
@media (max-width: 760px) { .g-2, .g-3 { grid-template-columns: 1fr; } .grid { gap: 12px; } }
@media (max-width: 420px) { .g-4.boxes { grid-template-columns: 1fr 1fr; gap: 10px; } }
.stack { display: flex; flex-direction: column; gap: 16px; }
@media (max-width: 760px) { .stack { gap: 12px; } }

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px 20px; min-width: 0;
}
@media (max-width: 760px) { .card { padding: 15px 16px; border-radius: 16px; } }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.card-head h2 { font-size: 15px; font-weight: 680; display: flex; align-items: center; gap: 8px; }
.card-head h2 svg.i { color: var(--muted); }
.card-head .meta { font-size: 12.5px; color: var(--muted); }
@media (max-width: 760px) { .card-head { flex-wrap: wrap; row-gap: 10px; } .card-head .seg { width: 100%; } .card-head .seg button { flex: 1; } }
.card.flush { padding: 0; overflow: hidden; }
.card.flush .card-head { padding: 16px 20px 0; }

.section-title { font-size: 13px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; margin: 26px 2px 10px; }
.section-title:first-child { margin-top: 0; }

/* ------------------------------------------------------------------ status banner */

.status-strip { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.pill {
  display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 12px; border-radius: 15px;
  background: var(--surface); border: 1px solid var(--border); font-size: 13px; font-weight: 560; color: var(--text-2);
  white-space: nowrap;
}
.pill .led { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.pill.ok .led { background: var(--good); box-shadow: 0 0 0 3px var(--good-soft); animation: pulse 2.4s infinite; }
.pill.bad { color: var(--critical); border-color: color-mix(in srgb, var(--critical) 35%, transparent); background: var(--critical-soft); }
.pill.bad .led { background: var(--critical); }
.pill.warn { color: var(--warning-ink); border-color: color-mix(in srgb, var(--warning) 45%, transparent); background: var(--warning-soft); }
.pill.warn .led { background: var(--warning); }
.pill.demo { color: #fff; background: linear-gradient(135deg, #7c3aed, #db2777); border: 0; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 3px var(--good-soft); } 50% { box-shadow: 0 0 0 6px transparent; } }

.alert-banner {
  display: flex; align-items: center; gap: 14px; padding: 14px 18px; margin-bottom: 16px;
  border-radius: var(--radius); background: var(--critical-soft); border: 1px solid color-mix(in srgb, var(--critical) 30%, transparent);
  color: var(--text);
}
.alert-banner .ic { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--critical); color: #fff; flex: none; }
.alert-banner .t { font-weight: 680; }
.alert-banner .s { font-size: 13px; color: var(--text-2); }
.alert-banner .go { margin-left: auto; }

/* ------------------------------------------------------------------ hero & stats */

.hero {
  position: relative; overflow: hidden;
  background: linear-gradient(135deg, #0a5bd8 0%, #0a7cff 45%, #00b4d8 100%);
  color: #fff; border: 0;
}
.hero::after {
  content: ""; position: absolute; right: -60px; top: -80px; width: 280px; height: 280px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.22), transparent 65%);
}
.hero .label { font-size: 13px; font-weight: 600; opacity: 0.85; display: flex; align-items: center; gap: 8px; }
.hero .big { font-size: 46px; font-weight: 780; letter-spacing: -0.03em; line-height: 1.05; margin: 8px 0 6px; }
.hero .delta { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 650; padding: 3px 10px; border-radius: 12px; background: rgba(255, 255, 255, 0.18); }
.hero .row { display: flex; gap: 22px; flex-wrap: wrap; margin-top: 18px; position: relative; z-index: 1; }
.hero .row div { min-width: 0; }
.hero .row .k { font-size: 12px; opacity: 0.8; }
.hero .row .v { font-size: 18px; font-weight: 700; }
@media (max-width: 760px) { .hero .big { font-size: 40px; } .hero .row { gap: 16px; } .hero .row .v { font-size: 16px; } }

.stat .k { font-size: 13px; color: var(--text-2); font-weight: 560; display: flex; align-items: center; gap: 6px; }
.stat .v { font-size: 26px; font-weight: 740; letter-spacing: -0.02em; margin-top: 4px; }
.stat .d { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
@media (max-width: 760px) { .stat .v { font-size: 22px; } }
.up { color: var(--good-ink); }
.down { color: var(--critical); }

/* ------------------------------------------------------------------ boxes */

.box-card { position: relative; overflow: hidden; padding-top: 20px; }
.box-card::before { content: ""; position: absolute; left: 0; top: 0; right: 0; height: 4px; background: var(--c); }
.box-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.box-name { display: flex; align-items: center; gap: 10px; font-weight: 760; font-size: 18px; }
.g-code { display: inline-block; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 11.5px; font-weight: 650; color: var(--muted); background: var(--surface-3); border-radius: 6px; padding: 1px 6px; vertical-align: middle; letter-spacing: 0; }
.box-names { display: grid; gap: 10px; }
.box-names label { display: grid; grid-template-columns: 64px 1fr; align-items: center; gap: 10px; }
.box-badge { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: color-mix(in srgb, var(--c) 16%, transparent); color: var(--c); }
.box-badge svg { width: 18px; height: 18px; }
.box-today { font-size: 28px; font-weight: 760; letter-spacing: -0.02em; margin-top: 12px; }
.box-sub { font-size: 12.5px; color: var(--muted); }
.box-rows { margin-top: 12px; display: grid; gap: 6px; font-size: 13px; }
.box-rows div { display: flex; justify-content: space-between; gap: 8px; }
.box-rows span:first-child { color: var(--text-2); }
.box-rows span:last-child { font-weight: 620; text-align: right; }
@media (max-width: 420px) {
  .box-card { padding: 14px 13px; }
  .box-today { font-size: 22px; margin-top: 8px; }
  .box-name { font-size: 16px; }
  .box-badge { width: 28px; height: 28px; }
  .box-rows { font-size: 12px; }
  .box-top .chip { display: none; }
}

.chip {
  display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px; border-radius: 12px;
  font-size: 12px; font-weight: 650; white-space: nowrap; background: var(--surface-3); color: var(--text-2);
}
.chip.good { background: var(--good-soft); color: var(--good-ink); }
.chip.bad { background: var(--critical-soft); color: var(--critical); }
.chip.warn { background: var(--warning-soft); color: var(--warning-ink); }
.chip.info { background: var(--brand-soft); color: var(--brand); }
.chip svg.i { width: 14px; height: 14px; }

.cert { display: inline-flex; align-items: center; height: 18px; padding: 0 7px; border-radius: 9px; font-size: 10.5px; font-weight: 700; letter-spacing: 0.02em; vertical-align: middle; border: 1px solid; white-space: nowrap; }
.cert.likely { color: var(--brand); border-color: color-mix(in srgb, var(--brand) 40%, transparent); }
.cert.guess { color: var(--warning-ink); border-color: color-mix(in srgb, var(--warning) 60%, transparent); }
.cert.sys { color: var(--muted); border-color: var(--border-strong); }

/* ------------------------------------------------------------------ lists */

.list { display: flex; flex-direction: column; }
.li { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--border); min-width: 0; }
.li:last-child { border-bottom: 0; }
.li .ic { width: 36px; height: 36px; border-radius: 11px; flex: none; display: grid; place-items: center; background: var(--surface-3); color: var(--text-2); font-weight: 750; font-size: 12.5px; }
.li .ic svg.i { width: 18px; height: 18px; }
.li .ic.box { background: color-mix(in srgb, var(--c) 15%, transparent); color: var(--c); }
.li .ic.bad { background: var(--critical-soft); color: var(--critical); }
.li .ic.ok { background: var(--good-soft); color: var(--good-ink); }
.li .ic.warn { background: var(--warning-soft); color: var(--warning-ink); }
.li .ic.info { background: var(--brand-soft); color: var(--brand); }
.li .body { flex: 1; min-width: 0; }
.li .t { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; }
.li .s { font-size: 12.5px; color: var(--muted); }
.li .amt { font-weight: 720; white-space: nowrap; }
.empty { padding: 26px 10px; text-align: center; color: var(--muted); font-size: 14px; }
.empty svg.i { width: 30px; height: 30px; display: block; margin: 0 auto 8px; opacity: 0.6; }

/* ------------------------------------------------------------------ buttons & controls */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; padding: 0 14px;
  border-radius: 11px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  font-weight: 600; font-size: 14px; cursor: pointer; white-space: nowrap;
}
.btn:hover { background: var(--surface-3); }
.btn.primary { background: var(--brand); border-color: transparent; color: #fff; }
.btn.primary:hover { filter: brightness(1.06); }
.btn.danger { color: var(--critical); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.icon { width: 38px; padding: 0; }
.btn.sm { height: 32px; padding: 0 10px; font-size: 13px; border-radius: 9px; }
.btn.icon.sm { width: 32px; }

.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 12px; background: var(--surface-3); overflow-x: auto; max-width: 100%; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg button { border: 0; background: transparent; height: 32px; padding: 0 12px; border-radius: 9px; font-size: 13.5px; font-weight: 600; color: var(--text-2); cursor: pointer; white-space: nowrap; }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(16, 24, 40, 0.12); }

.input {
  height: 38px; padding: 0 12px; border-radius: 11px; border: 1px solid var(--border-strong); background: var(--surface);
  min-width: 0; outline: none;
}
.input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.li.click { cursor: pointer; border-radius: 10px; }
.li.click:hover { background: var(--surface-2); }
.li .meta svg.i { width: 15px; height: 15px; color: var(--muted); }
.exp-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.exp-row label { display: grid; gap: 5px; font-size: 13px; color: var(--text-2); flex: 1 1 180px; }
.pi-g { padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); }
.pi-g .hbar-track { height: 6px; margin: 10px 0 6px; }
.kv .v .chip { vertical-align: middle; }
.check { display: inline-flex; align-items: center; gap: 7px; font-size: 13.5px; color: var(--text-2); cursor: pointer; user-select: none; }
.check input { width: 16px; height: 16px; accent-color: var(--brand); }

/* ------------------------------------------------------------------ tables */

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th { text-align: left; font-size: 12px; font-weight: 650; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; position: sticky; top: 0; background: var(--surface); }
td { padding: 9px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; }
tbody tr.click { cursor: pointer; }
tbody tr.click:hover td { background: var(--surface-2); }
.mono { font-family: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, monospace; font-size: 12.5px; }
.kv { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0; }
.kv > div { padding: 9px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.kv > div:nth-last-child(-n+2) { border-bottom: 0; }
.kv .k { color: var(--text-2); padding-right: 12px; }
.kv .v { font-weight: 620; text-align: right; }

/* ------------------------------------------------------------------ charts */

.chart { position: relative; width: 100%; }
.chart svg { display: block; width: 100%; overflow: visible; }
.chart .gridline { stroke: var(--grid); stroke-width: 1; }
.chart .baseline { stroke: var(--axis); stroke-width: 1; }
.chart .tick { fill: var(--muted); font-size: 11px; }
.chart .hit { fill: transparent; cursor: crosshair; }
.chart .hit:hover + .hover-col, .chart .hover-col { pointer-events: none; }
.chart .cross { stroke: var(--axis); stroke-width: 1; stroke-dasharray: 3 3; }
.chart .ref { stroke: var(--brand); stroke-width: 1.5; stroke-dasharray: 5 4; opacity: 0.8; }
.chart .ref-label { fill: var(--brand); font-size: 11px; font-weight: 650; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: var(--text-2); margin-bottom: 10px; }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; background: var(--c); }

#tip {
  position: fixed; z-index: 100; pointer-events: none; opacity: 0; transform: translateY(4px);
  transition: opacity 0.12s, transform 0.12s;
  background: var(--surface); color: var(--text); border: 1px solid var(--border-strong); border-radius: 12px;
  box-shadow: var(--shadow-lg); padding: 10px 12px; font-size: 13px; min-width: 150px; max-width: 260px;
}
#tip.on { opacity: 1; transform: none; }
#tip .tt { font-weight: 700; margin-bottom: 6px; }
#tip .tr { display: flex; align-items: center; gap: 8px; justify-content: space-between; padding: 1px 0; }
#tip .tr span:first-child { display: inline-flex; align-items: center; gap: 7px; color: var(--text-2); }
#tip .tr i { width: 9px; height: 9px; border-radius: 3px; background: var(--c); }
#tip .tr b { font-variant-numeric: tabular-nums; }
#tip .tot { border-top: 1px solid var(--border); margin-top: 6px; padding-top: 6px; }

.hbar { display: grid; gap: 12px; }
.hbar-row .top { display: flex; justify-content: space-between; gap: 10px; font-size: 13.5px; margin-bottom: 6px; }
.hbar-row .top span:first-child { display: inline-flex; align-items: center; gap: 8px; font-weight: 620; }
.hbar-row .top i { width: 10px; height: 10px; border-radius: 3px; background: var(--c); }
.hbar-track { height: 10px; border-radius: 5px; background: var(--surface-3); overflow: hidden; }
.hbar-fill { height: 100%; border-radius: 5px; background: var(--c); transition: width 0.5s ease; }

/* ------------------------------------------------------------------ temperature */

.temp-big { display: flex; align-items: baseline; gap: 6px; }
.temp-big .v { font-size: 42px; font-weight: 760; letter-spacing: -0.03em; }
.temp-big .u { font-size: 18px; color: var(--muted); font-weight: 600; }
.spark { height: 64px; margin-top: 8px; }
.spark path.line { fill: none; stroke: var(--s1); stroke-width: 2; }
.spark path.area { fill: var(--s1); opacity: 0.10; }

/* ------------------------------------------------------------------ pumps */

.pump { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border); }
.pump:last-child { border-bottom: 0; }
.pump .n { font-weight: 600; font-size: 14px; }
.pump .h { font-weight: 720; font-variant-numeric: tabular-nums; }
.pump .hbar-track { grid-column: 1 / -1; height: 6px; }
.pump .hbar-fill { background: linear-gradient(90deg, var(--brand), var(--brand-2)); }

.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.tile { background: var(--surface-2); border: 1px solid var(--border); border-radius: 14px; padding: 12px; }
.tile .k { font-size: 12px; color: var(--muted); font-weight: 600; }
.tile .v { font-size: 20px; font-weight: 740; margin-top: 2px; }
.tile.off { opacity: 0.5; }
.coin {
  width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; margin: 2px auto 6px;
  font-weight: 800; font-size: 14px; color: #5a3d00;
  background: radial-gradient(circle at 35% 30%, #ffe9a6, #e0b54a 60%, #b98a1c);
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.35), 0 2px 6px rgba(0, 0, 0, 0.15);
}
.coin.silver { color: #333; background: radial-gradient(circle at 35% 30%, #ffffff, #c9cfd8 60%, #98a1ae); }
.coin.bi { background: radial-gradient(circle at 50% 50%, #e9d18c 0 46%, #c7ccd4 47% 100%); color: #3b2b00; }
.coin.none { background: var(--surface-3); color: var(--muted); box-shadow: none; font-weight: 600; font-size: 12px; }
.tile.center { text-align: center; }

/* ------------------------------------------------------------------ IO & bits */

.io-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.io-group { background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; }
.io-group .gh { font-size: 12px; font-weight: 700; color: var(--muted); margin-bottom: 8px; display: flex; justify-content: space-between; }
.leds { display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; }
.led-b { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 10px; color: var(--muted); }
.led-b i { width: 16px; height: 16px; border-radius: 50%; background: var(--surface-3); border: 1px solid var(--border-strong); transition: background 0.2s, box-shadow 0.2s; }
.led-b.on i { background: var(--good); border-color: transparent; box-shadow: 0 0 8px color-mix(in srgb, var(--good) 70%, transparent); }
.led-b.q.on i { background: #f59e0b; box-shadow: 0 0 8px rgba(245, 158, 11, 0.7); }
.led-b.cand i { outline: 2px dashed var(--warning); outline-offset: 2px; }
.bits16 { display: grid; grid-template-columns: repeat(16, 1fr); gap: 3px; }
.bits16 span { height: 22px; border-radius: 5px; background: var(--surface-3); font-size: 9.5px; display: grid; place-items: center; color: var(--muted); }
.bits16 span.on { background: var(--brand); color: #fff; }

/* ------------------------------------------------------------------ login */

.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.login {
  width: 100%; max-width: 400px; text-align: center; padding: 34px 28px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 24px; box-shadow: var(--shadow-lg);
}
.login .logo { width: 64px; height: 64px; border-radius: 20px; margin: 0 auto 18px; }
.login .logo svg { width: 34px; height: 34px; }
.login h1 { font-size: 24px; font-weight: 780; }
.login p { color: var(--text-2); margin: 6px 0 24px; }
.login .gbtn { display: flex; justify-content: center; min-height: 44px; }
.login .err { color: var(--critical); font-size: 14px; margin-top: 14px; }
.login .dev { margin-top: 22px; padding-top: 18px; border-top: 1px dashed var(--border-strong); display: flex; gap: 8px; }
.login .dev .input { flex: 1; }
.login .foot { margin-top: 22px; font-size: 12px; color: var(--muted); }

/* ------------------------------------------------------------------ modal & toast */

.modal-bg { position: fixed; inset: 0; z-index: 90; background: rgba(5, 10, 20, 0.5); display: grid; place-items: center; padding: 16px; animation: fade 0.15s; }
.modal { width: 100%; max-width: 640px; max-height: 86vh; overflow: auto; background: var(--surface); border-radius: 20px; box-shadow: var(--shadow-lg); padding: 20px; }
.modal .card-head { margin-bottom: 10px; }
@keyframes fade { from { opacity: 0; } }
#toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); z-index: 120; opacity: 0; pointer-events: none;
  background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 12px; font-weight: 600; font-size: 14px;
  transition: opacity 0.2s, transform 0.2s; max-width: calc(100vw - 32px);
}
#toast.on { opacity: 1; transform: translate(-50%, 0); }
@media (max-width: 959px) { #toast { bottom: calc(86px + env(safe-area-inset-bottom)); } }

.note { display: flex; gap: 10px; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); font-size: 13.5px; color: var(--text-2); }
.note svg.i { color: var(--brand); margin-top: 1px; }
.note.warn svg.i { color: var(--warning-ink); }
.codebox { background: var(--surface-3); border-radius: 10px; padding: 12px; font-family: ui-monospace, Consolas, monospace; font-size: 12.5px; white-space: pre-wrap; word-break: break-all; }

.fade-in { animation: fade 0.25s ease; }
.skeleton { background: linear-gradient(90deg, var(--surface-3), var(--surface-2), var(--surface-3)); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: 8px; }
@keyframes sk { to { background-position: -200% 0; } }
