/* mozek · Velín. Jeden soubor tokenů a komponent. Tmavý režim výchozí, světlý přes html[data-theme="light"].
   Mřížka 4 px, váhy 400/500 (600 jen titulek stránky), čísla tabular, linky 8 % inkoustu, jeden easing. */

@font-face {
  font-family: "Inter Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("/static/fonts/inter-latin-opsz-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;
}
@font-face {
  font-family: "Inter Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("/static/fonts/inter-latin-ext-opsz-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;
}

/* ------------------------------------------------------------------ tokeny */
:root {
  color-scheme: dark;
  --bg: #0b0d10;
  --surface: #111418;
  --surface-2: #161a1f;
  --surface-3: #1d2228;
  --hair: rgba(226, 232, 240, 0.08);
  --hair-2: rgba(226, 232, 240, 0.14);
  --ink: #e6eaf0;
  --ink-2: #a0a8b4;
  --ink-3: #7c8592;
  --c1: #3987e5;            /* Dory: modrá (validovaný pár slotů 1 a 2) */
  --c2: #d95926;            /* ROMERON: oranžová */
  --c1-soft: rgba(57, 135, 229, 0.42);
  --c2-soft: rgba(217, 89, 38, 0.42);
  --neutral-bar: rgba(226, 232, 240, 0.16);
  --good: #2fb344;
  --warn: #fab219;
  --serious: #ec835a;
  --bad: #e5484d;
  --focus: #9cc3ff;
  --btn-bg: #e6eaf0;
  --btn-ink: #0b0d10;
  --pop-shadow: 0 8px 24px rgba(0, 0, 0, 0.45), 0 0 0 1px var(--hair-2);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --r-sm: 6px;
  --r: 8px;
  --r-lg: 12px;
  --side: 232px;
  --font: "Inter Variable", "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-2: #f1f3f6;
  --surface-3: #e8ebf0;
  --hair: rgba(15, 23, 32, 0.08);
  --hair-2: rgba(15, 23, 32, 0.15);
  --ink: #0f1720;
  --ink-2: #485260;
  --ink-3: #626c7a;
  --c1: #2a78d6;
  --c2: #e0612d;
  --c1-soft: rgba(42, 120, 214, 0.38);
  --c2-soft: rgba(224, 97, 45, 0.38);
  --neutral-bar: rgba(15, 23, 32, 0.12);
  --good: #1f8f34;
  --warn: #c98500;
  --serious: #d4693f;
  --bad: #d03b3b;
  --focus: #2a78d6;
  --btn-bg: #0f1720;
  --btn-ink: #ffffff;
  --pop-shadow: 0 8px 24px rgba(15, 23, 32, 0.1), 0 0 0 1px var(--hair-2);
}

/* ------------------------------------------------------------------ základ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 14px;
  line-height: 20px;
  font-optical-sizing: auto;
  font-feature-settings: "calt", "kern", "cv11";
  -webkit-font-smoothing: antialiased;
  transition: background-color 240ms var(--ease), color 240ms var(--ease);
}
a { color: inherit; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 24px; line-height: 32px; font-weight: 600; letter-spacing: -0.012em; text-wrap: balance; }
h2 { font-size: 16px; line-height: 24px; font-weight: 500; letter-spacing: 0; }
h3 { font-size: 13px; line-height: 20px; font-weight: 500; color: var(--ink-2); }
code, .mono { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 12px; }
.num, table, .kpi-v, .tnum { font-variant-numeric: tabular-nums; font-feature-settings: "tnum", "calt", "kern"; }
.meta, .hint { color: var(--ink-3); font-size: 12px; line-height: 16px; }
.sec { color: var(--ink-2); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
[hidden] { display: none !important; }

/* ------------------------------------------------------------------ rozvržení */
.shell { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); min-height: 100vh; min-height: 100dvh; }
.side {
  position: sticky; top: 0; height: 100vh; height: 100dvh;
  display: flex; flex-direction: column; gap: 4px;
  padding: 20px 12px 16px; border-right: 1px solid var(--hair);
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 20px; font-weight: 500; letter-spacing: -0.01em; text-decoration: none; color: var(--ink); }
.brand-mark { width: 20px; height: 20px; color: var(--ink); }
.brand small { color: var(--ink-3); font-weight: 400; font-size: 12px; }
.nav { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  display: flex; align-items: center; gap: 10px; min-height: 36px; padding: 0 10px;
  border-radius: var(--r); color: var(--ink-2); text-decoration: none; font-weight: 500;
  transition: background-color 140ms var(--ease), color 140ms var(--ease);
}
.nav-item svg { width: 18px; height: 18px; flex: none; }
.nav-item:hover { background: var(--surface-2); color: var(--ink); }
.nav-item.active { background: var(--surface-2); color: var(--ink); box-shadow: inset 0 0 0 1px var(--hair); }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; padding: 0 4px; }
.side-row { display: flex; gap: 8px; }
.main { min-width: 0; padding: 24px 32px 64px; max-width: 1520px; width: 100%; margin: 0 auto; }
.topbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.topbar .sub { color: var(--ink-3); margin-top: 4px; }
.status { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.tabbar { display: none; }

/* ------------------------------------------------------------------ prvky */
.card { background: var(--surface); border: 1px solid var(--hair); border-radius: var(--r-lg); padding: 20px; min-width: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.card-head .title { display: flex; align-items: center; gap: 8px; min-width: 0; }
.section { margin-top: 32px; }
.section > h2 { margin-bottom: 12px; }
.grid { display: grid; gap: 16px; }
.flash { padding: 10px 12px; border-radius: var(--r); border: 1px solid var(--hair-2); margin-bottom: 16px; background: var(--surface); }
.flash.ok { border-color: color-mix(in srgb, var(--good) 45%, transparent); }
.flash.err, .error { border-color: color-mix(in srgb, var(--bad) 55%, transparent); }
.flash.warn { border-color: color-mix(in srgb, var(--warn) 45%, transparent); }
.empty { color: var(--ink-3); padding: 12px 0; }
.empty-card { padding: 32px 20px; text-align: left; }
.empty-card p + p { margin-top: 4px; }

.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; background: var(--ink-3); }
.dot.c1 { background: var(--c1); }
.dot.c2 { background: var(--c2); }
.dot.ok, .dot.zelena { background: var(--good); }
.dot.warn, .dot.oranzova, .dot.rucne, .dot.medium { background: var(--warn); }
.dot.fail, .dot.cervena, .dot.high { background: var(--bad); }
.dot.off, .dot.nezname, .dot.low { background: var(--ink-3); }
.dot.wait { background: transparent; box-shadow: inset 0 0 0 1.5px var(--ink-3); }

.badge {
  display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px; border-radius: var(--r-sm);
  font-size: 12px; line-height: 16px; font-weight: 500; color: var(--ink-2); background: var(--surface-2);
  box-shadow: inset 0 0 0 1px var(--hair); white-space: nowrap;
}
.badge.demo, .tag-demo {
  color: var(--ink); background: transparent; box-shadow: inset 0 0 0 1px var(--hair-2);
  letter-spacing: 0.02em;
}
.tag-demo { display: inline-flex; align-items: center; height: 18px; padding: 0 6px; border-radius: 4px; font-size: 11px; font-weight: 500; color: var(--ink-3); }
.badge.ok::before, .badge.bad::before, .badge.cv-ok::before, .badge.cv-fail::before, .badge.cv-warn::before, .badge.cv-rucne::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--good);
}
.badge.bad::before, .badge.cv-fail::before { background: var(--bad); }
.badge.cv-warn::before, .badge.cv-rucne::before { background: var(--warn); }

.light { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-2); }
.light .dot { width: 6px; height: 6px; }
.light.zelena .dot { background: var(--good); }
.light.oranzova .dot { background: var(--warn); }
.light.cervena .dot { background: var(--bad); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 36px; padding: 0 14px;
  border-radius: var(--r); border: 1px solid var(--hair-2); background: var(--surface); color: var(--ink);
  font: inherit; font-weight: 500; text-decoration: none; cursor: pointer;
  transition: transform 100ms var(--ease), background-color 140ms var(--ease), border-color 140ms var(--ease), opacity 140ms var(--ease);
}
.btn:hover { background: var(--surface-2); }
.btn:active:not(:disabled) { transform: scale(0.98); }
.btn.primary { background: var(--btn-bg); color: var(--btn-ink); border-color: transparent; }
.btn.primary:hover { opacity: 0.92; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn.ghost:hover { background: var(--surface-2); color: var(--ink); }
.btn.sm { min-height: 32px; padding: 0 10px; font-size: 13px; }
.btn.icon { width: 36px; padding: 0; }
.btn svg { width: 16px; height: 16px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.actions, .pager { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.inline { display: inline; }

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; border: 0; padding: 0; margin: 0; }
.label { font-size: 13px; font-weight: 500; color: var(--ink-2); }
.input {
  min-height: 40px; padding: 8px 12px; border-radius: var(--r); border: 1px solid var(--hair-2);
  background: var(--bg); color: var(--ink); font: inherit; width: 100%;
  transition: border-color 140ms var(--ease), box-shadow 140ms var(--ease);
}
.input:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 22%, transparent); }
textarea.input { resize: vertical; }
.check { display: flex; align-items: center; gap: 8px; min-height: 32px; }
.check input { accent-color: var(--c1); width: 16px; height: 16px; }
.form { display: flex; flex-direction: column; gap: 16px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.inline-form { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.inline-form .grow { flex: 1 1 220px; }

.table-wrap { overflow-x: auto; margin: 0 -20px; padding: 0 20px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; font-size: 12px; line-height: 16px; font-weight: 500; color: var(--ink-3); padding: 0 12px 10px 0; white-space: nowrap; }
td { padding: 10px 12px 10px 0; border-top: 1px solid var(--hair); vertical-align: middle; }
th.r, td.r { text-align: right; }
td.name { max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
tr.is-best td.name::before, tr.is-worst td.name::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; margin-right: 8px; vertical-align: 1px; background: var(--tone, var(--c1)); }
tr.is-worst td.name::before { background: var(--ink-3); }
.pos { color: var(--ink); }
.neg { color: var(--ink-3); }

/* ------------------------------------------------------------------ živě */
.live { display: inline-flex; align-items: center; gap: 8px; height: 28px; padding: 0 10px; border-radius: var(--r); background: var(--surface); box-shadow: inset 0 0 0 1px var(--hair); font-size: 12px; color: var(--ink-2); }
.live .dot { width: 6px; height: 6px; background: var(--ink-3); }
.live[data-state="live"] .dot { background: var(--good); animation: breathe 2.4s var(--ease) infinite; }
.live[data-state="poll"] .dot { background: var(--warn); }
.live[data-state="off"] .dot { background: var(--bad); }
.live b { font-weight: 500; color: var(--ink); }
@keyframes breathe { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

/* ------------------------------------------------------------------ osa týdne (podpis velínu) */
.axis-card { padding: 0; overflow: hidden; }
.axis-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 20px 0; }
.axis { position: relative; display: grid; grid-template-columns: 152px minmax(0, 1fr); margin-top: 12px; }
.axis-days, .axis-lane { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.axis-days { grid-column: 2; border-bottom: 1px solid var(--hair); }
.axis-day { padding: 0 8px 10px; font-size: 12px; color: var(--ink-3); display: flex; gap: 6px; align-items: baseline; }
.axis-day b { font-weight: 500; color: var(--ink-2); }
.axis-day.today b, .axis-day.today { color: var(--ink); }
.axis-label { display: flex; align-items: center; gap: 8px; padding: 0 12px 0 20px; font-weight: 500; font-size: 13px; min-height: 76px; border-bottom: 1px solid var(--hair); min-width: 0; }
.axis-label span.n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.axis-lane { position: relative; border-bottom: 1px solid var(--hair); min-height: 76px; }
.axis-row:last-of-type .axis-label, .axis-row:last-of-type .axis-lane { border-bottom: 0; }
.axis-cell { border-left: 1px solid var(--hair); padding: 10px 6px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.axis-cell.past { background: color-mix(in srgb, var(--surface-2) 55%, transparent); }
.axis-row { display: contents; }
.evt {
  display: flex; flex-direction: column; gap: 2px; padding: 6px 8px; border-radius: var(--r-sm);
  background: var(--surface-2); box-shadow: inset 2px 0 0 var(--tone); text-decoration: none; min-width: 0;
  transition: background-color 140ms var(--ease);
}
.evt:hover { background: var(--surface-3); }
.evt .t { font-size: 12px; line-height: 16px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.evt .s { display: flex; align-items: center; gap: 6px; font-size: 11px; line-height: 14px; color: var(--ink-3); white-space: nowrap; overflow: hidden; }
.evt .s .dot { width: 6px; height: 6px; }
.evt.past { opacity: 0.62; }
.c1 { --tone: var(--c1); }
.c2 { --tone: var(--c2); }
.now-line { position: absolute; top: 0; bottom: 0; width: 0; border-left: 1px solid var(--ink); opacity: 0.75; pointer-events: none; transition: left 600ms var(--ease); }
.now-tag { position: absolute; top: -22px; transform: translateX(-50%); font-size: 11px; line-height: 14px; padding: 2px 6px; border-radius: 4px; background: var(--ink); color: var(--bg); font-weight: 500; white-space: nowrap; }
.now-wrap { position: absolute; left: 152px; right: 0; top: 30px; bottom: 0; pointer-events: none; }
.ripple { position: absolute; width: 8px; height: 8px; margin: -4px 0 0 -4px; border-radius: 50%; background: var(--tone); animation: ripple 1100ms var(--ease) forwards; }
@keyframes ripple { 0% { transform: scale(0.4); opacity: 1; } 100% { transform: scale(3.2); opacity: 0; } }

/* ------------------------------------------------------------------ velín */
.velin { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 320px; gap: 16px; margin-top: 16px; align-items: start; }
.panel { display: flex; flex-direction: column; gap: 20px; }
.client-name { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.client-name .dot { width: 8px; height: 8px; }
.hero-k { display: flex; flex-direction: column; gap: 4px; }
.hero-k .lab { font-size: 13px; color: var(--ink-2); }
.hero-v {
  font-size: 40px; line-height: 44px; font-weight: 500; letter-spacing: -0.028em;
  font-variant-numeric: tabular-nums; font-feature-settings: "tnum", "ss01", "kern";
}
.hero-v.na { font-size: 24px; line-height: 32px; color: var(--ink-3); letter-spacing: -0.01em; }
.delta { font-size: 13px; color: var(--ink-2); }
.delta b { font-weight: 500; color: var(--ink); }
.kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 0; border-top: 1px solid var(--hair); }
.kpi { padding: 14px 0 0; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.kpi:nth-child(2n) { padding-left: 16px; border-left: 1px solid var(--hair); }
.kpi:nth-child(n+3) { border-top: 1px solid var(--hair); margin-top: 14px; }
.kpi .lab { font-size: 12px; line-height: 16px; color: var(--ink-3); display: flex; gap: 6px; align-items: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-v { font-size: 20px; line-height: 28px; font-weight: 500; letter-spacing: -0.01em; }
.kpi-v.na { color: var(--ink-3); font-size: 14px; font-weight: 400; letter-spacing: 0; }
.kpi .unit { color: var(--ink-3); font-size: 13px; font-weight: 400; }
.today-line { font-size: 12px; color: var(--ink-3); display: flex; gap: 6px; flex-wrap: wrap; }
.today-line b { color: var(--ink-2); font-weight: 500; }
.ticker-card { position: sticky; top: 24px; display: flex; flex-direction: column; max-height: calc(100vh - 48px); }
.ticker { list-style: none; margin: 0; padding: 0; overflow: hidden; }
.ticker li { display: grid; grid-template-columns: 56px 8px minmax(0, 1fr); gap: 10px; align-items: baseline; padding: 9px 0; border-top: 1px solid var(--hair); }
.ticker li:first-child { border-top: 0; }
.ticker time { font-size: 12px; color: var(--ink-3); }
.ticker .dot { width: 6px; height: 6px; transform: translateY(-1px); }
.ticker .txt { font-size: 13px; line-height: 18px; color: var(--ink-2); overflow-wrap: anywhere; }
.ticker .txt b { color: var(--ink); font-weight: 500; }
.ticker li.new { animation: slide-in 420ms var(--ease); }
@keyframes slide-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
.flash-num { animation: num-flash 900ms var(--ease); }
@keyframes num-flash { 0% { color: var(--tone, var(--ink)); } 100% { color: inherit; } }
.health { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 16px; }
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill { display: inline-flex; align-items: center; gap: 8px; min-height: 32px; padding: 6px 10px; border-radius: var(--r); background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--hair); font-size: 12px; line-height: 16px; }
.pill .dot { width: 6px; height: 6px; }
.pill b { font-weight: 500; color: var(--ink); }
.pill span { color: var(--ink-3); }
.anoms { list-style: none; margin: 0; padding: 0; }
.anoms li { display: grid; grid-template-columns: 8px minmax(0, 1fr); gap: 10px; padding: 10px 0; border-top: 1px solid var(--hair); align-items: baseline; }
.anoms li:first-child { border-top: 0; padding-top: 0; }
.anoms b { font-weight: 500; }
.anoms p { color: var(--ink-2); font-size: 13px; }

/* ------------------------------------------------------------------ grafy */
.chart { margin: 0; position: relative; }
.chart-body { display: grid; grid-template-columns: 52px minmax(0, 1fr); }
.axis-y { display: flex; flex-direction: column; justify-content: space-between; font-size: 11px; line-height: 12px; color: var(--ink-3); padding-right: 8px; text-align: right; font-variant-numeric: tabular-nums; margin: -6px 0; }
.chart-plot { position: relative; height: 180px; }
.chart-sm .chart-plot { height: 120px; }
.chart-lg .chart-plot { height: 240px; }
.plot { display: block; width: 100%; height: 100%; overflow: visible; }
.axis-x { display: flex; justify-content: space-between; margin: 8px 0 0 52px; font-size: 11px; line-height: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.axis-x.even span { flex: 1; text-align: center; }
.gl { stroke: var(--hair); stroke-width: 1; }
.plot .line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.plot .line.c1 { stroke: var(--c1); }
.plot .line.c2 { stroke: var(--c2); }
.plot .line-prev { fill: none; stroke: var(--ink-3); stroke-width: 1.25; stroke-dasharray: 3 4; opacity: 0.8; }
.stop-a.c1 { stop-color: var(--c1); stop-opacity: 0.26; }
.stop-a.c2 { stop-color: var(--c2); stop-opacity: 0.24; }
.stop-b { stop-opacity: 0; }
.stop-b.c1 { stop-color: var(--c1); }
.stop-b.c2 { stop-color: var(--c2); }
.plot .bar { transition: opacity 140ms var(--ease); }
.plot .bar.c1, .meter .bar.c1, .ci .band.c1 { fill: var(--c1); }
.plot .bar.c2, .meter .bar.c2, .ci .band.c2 { fill: var(--c2); }
.plot .bar.c1-soft { fill: var(--c1-soft); }
.plot .bar.c2-soft { fill: var(--c2-soft); }
.plot .bar.n { fill: var(--neutral-bar); }
.plot .bar.dim { opacity: 0.45; }
.plot .avg { stroke: var(--ink-2); stroke-width: 1; stroke-dasharray: 4 4; }
.hover-line { position: absolute; top: 0; bottom: 0; width: 0; border-left: 1px solid var(--hair-2); pointer-events: none; }
.hover-dot { position: absolute; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; background: var(--tone); box-shadow: 0 0 0 2px var(--surface); pointer-events: none; }
.tip {
  position: absolute; z-index: 5; pointer-events: none; padding: 8px 10px; border-radius: var(--r); background: var(--surface-3);
  box-shadow: var(--pop-shadow); font-size: 12px; line-height: 16px; white-space: nowrap; font-variant-numeric: tabular-nums;
}
.tip b { display: block; font-weight: 500; color: var(--ink); }
.tip span { color: var(--ink-2); }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12px; color: var(--ink-2); margin-bottom: 12px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; background: var(--tone); }
.legend i.soft { opacity: 0.45; }
.legend i.dash { height: 0; border-top: 1.5px dashed var(--ink-3); background: none; width: 14px; vertical-align: 3px; border-radius: 0; }
.legend i.avg { height: 0; border-top: 1.5px dashed var(--ink-2); background: none; width: 14px; vertical-align: 3px; border-radius: 0; }
.meter { display: block; width: 100%; height: 8px; border-radius: 2px; overflow: hidden; }
.meter .track { fill: var(--surface-3); }
.ci { display: block; width: 100%; height: 28px; overflow: visible; }
.ci .track-line { stroke: var(--hair-2); stroke-width: 1; }
.ci .band { opacity: 0.35; }
.ci .mark { stroke-width: 2; }
.ci .mark.c1 { stroke: var(--c1); }
.ci .mark.c2 { stroke: var(--c2); }

/* ------------------------------------------------------------------ kampaně, popupy, časovače */
.split { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 16px; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat .lab { font-size: 12px; color: var(--ink-3); }
.stat .kpi-v { display: block; }
.callouts { display: flex; flex-direction: column; gap: 12px; }
.callout { padding: 14px 16px; border-radius: var(--r); background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--hair); }
.callout .lab { font-size: 12px; color: var(--ink-3); display: flex; align-items: center; gap: 6px; }
.callout .t { font-weight: 500; margin: 4px 0 2px; }
.callout .m { font-size: 12px; color: var(--ink-2); }
.funnel { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.funnel li { display: grid; grid-template-columns: 150px minmax(0, 1fr) 150px; gap: 16px; align-items: center; }
.funnel .l { font-size: 13px; color: var(--ink-2); }
.funnel .v { text-align: right; font-size: 13px; }
.funnel .v small { display: block; font-size: 11px; color: var(--ink-3); }
.ab { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 16px; }
.ab li { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "n v" "ci ci"; gap: 6px 16px; align-items: end; }
.ab li > b { grid-area: n; font-weight: 500; }
.ab li > .v { grid-area: v; }
.ab li > .ci { grid-area: ci; }
.ab-axis { display: block; font-size: 11px; color: var(--ink-3); margin-top: 6px; }
.ab-axis .ends { display: flex; justify-content: space-between; font-variant-numeric: tabular-nums; }
.ab .v { text-align: right; font-size: 13px; }
.ab .v small { display: block; font-size: 11px; color: var(--ink-3); }
.verdict { margin-top: 16px; font-size: 13px; color: var(--ink-2); }
.timers { list-style: none; margin: 0; padding: 0; }
.timers li { display: grid; grid-template-columns: minmax(0, 1.6fr) 140px repeat(3, 96px) minmax(80px, 1fr); gap: 16px; align-items: center; padding: 14px 0; border-top: 1px solid var(--hair); }
.timers li.head { border-top: 0; padding-top: 0; font-size: 12px; color: var(--ink-3); }
.timers .r { text-align: right; }
.timers .nm { font-weight: 500; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.timers li.ended { color: var(--ink-3); }
.timers li.ended .nm { color: var(--ink-2); font-weight: 400; }
.countdown { font-size: 13px; }
.countdown.soon { color: var(--ink); font-weight: 500; }

/* ------------------------------------------------------------------ kalendář */
.cal-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.legend-lanes { display: flex; gap: 16px; font-size: 12px; color: var(--ink-2); align-items: center; flex-wrap: wrap; }
.legend-lanes span { display: inline-flex; align-items: center; gap: 6px; }
.cal { display: flex; flex-direction: column; gap: 16px; }
.cal-week { padding: 0; overflow: hidden; }
.cal-week-head { display: flex; justify-content: space-between; align-items: baseline; padding: 14px 20px; border-bottom: 1px solid var(--hair); }
.cal-week-head b { font-weight: 500; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-day { border-left: 1px solid var(--hair); min-height: 148px; padding: 10px 8px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.cal-day:first-child { border-left: 0; }
.cal-day.past { background: color-mix(in srgb, var(--surface-2) 55%, transparent); }
.cal-day.today { box-shadow: inset 0 2px 0 var(--ink); }
.cal-date { font-size: 12px; color: var(--ink-3); display: flex; gap: 6px; }
.cal-date b { font-weight: 500; color: var(--ink-2); }
.cal-day.today .cal-date b { color: var(--ink); }
.cal-empty-week { padding: 16px 20px; color: var(--ink-3); }
.add-slot { margin-top: 16px; }
.add-slot .inline-form .field { flex: 1 1 160px; }

/* ------------------------------------------------------------------ fronta, slot, zdraví */
.queue { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.queue li { display: flex; flex-direction: column; gap: 10px; }
.q-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.slot-title { font-weight: 500; text-decoration: none; }
.slot-title:hover { text-decoration: underline; text-underline-offset: 3px; }
.plain { margin: 0; padding-left: 18px; color: var(--ink-2); }
.plain li { margin: 4px 0; }
.slot-meta { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.slot-layout { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.slot-layout > div { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.checks { list-style: none; margin: 0; padding: 0; }
.check-row { display: grid; grid-template-columns: 76px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--hair); }
.check-row:first-child { border-top: 0; padding-top: 0; }
.check-row strong { font-weight: 500; }
.check-row .meta { margin-top: 2px; }
.preview-wrap { border: 1px solid var(--hair); border-radius: var(--r); overflow: hidden; background: #fff; margin-top: 12px; }
.preview-wrap.mobil { max-width: 390px; margin-left: auto; margin-right: auto; }
.preview { display: block; width: 100%; height: 640px; border: 0; }
.link { color: var(--ink); text-underline-offset: 3px; }
.zdravi-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ------------------------------------------------------------------ přihlášení */
.login { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; }
.login .card { width: 100%; max-width: 380px; padding: 28px 24px; }
.login .brand { padding: 0 0 20px; }
.login h1 { font-size: 20px; line-height: 28px; margin-bottom: 4px; }

/* ------------------------------------------------------------------ responzivita */
@media (max-width: 1360px) {
  .velin { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .ticker-col { grid-column: 1 / -1; }
  .ticker-card { position: static; max-height: none; }
  .ticker { display: grid; grid-template-columns: 1fr 1fr; column-gap: 24px; }
  .ticker li:nth-child(2) { border-top: 0; }
}
@media (max-width: 1100px) {
  :root { --side: 72px; }
  .side .brand > span:last-child, .side .nav-item span, .side-foot .btn span { display: none; }
  .side .brand { justify-content: center; padding: 4px 0 20px; }
  .nav-item { justify-content: center; padding: 0; }
  .side-foot { align-items: center; }
  .side-row { flex-direction: column; }
  .split, .zdravi-grid, .slot-layout { grid-template-columns: 1fr; }
  .timers li { grid-template-columns: minmax(0, 1.4fr) 120px repeat(3, 80px); }
  .timers li > :last-child { display: none; }
}
@media (max-width: 860px) {
  .velin, .health { grid-template-columns: 1fr; }
  .ticker { display: block; }
  .ticker li:nth-child(2) { border-top: 1px solid var(--hair); }
  .stats { grid-template-columns: 1fr 1fr; }
  .cal-grid { grid-template-columns: 1fr; }
  .cal-day { border-left: 0; border-top: 1px solid var(--hair); min-height: 0; display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 6px 12px; align-items: start; padding: 10px 16px; }
  .cal-day > .cal-date { grid-row: 1; grid-column: 1; }
  .cal-day > .cal-event, .cal-day > .cal-items { grid-column: 2; }
  .cal-day:first-child { border-top: 0; }
  .cal-day.today { box-shadow: inset 2px 0 0 var(--ink); }
  .cal-day .cal-date { padding-top: 6px; }
  .cal-day .cal-items { flex: 1; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
  .cal-day.no-slots { display: none; }
}
@media (max-width: 767px) {
  .shell { grid-template-columns: 1fr; }
  .side { display: none; }
  .main { padding: 16px 16px calc(96px + env(safe-area-inset-bottom)); }
  h1 { font-size: 20px; line-height: 28px; }
  .topbar { margin-bottom: 16px; align-items: flex-start; flex-direction: column; }
  .card { padding: 16px; }
  .table-wrap { margin: 0 -16px; padding: 0 16px; }
  .hero-v { font-size: 34px; line-height: 40px; }
  .grid2 { grid-template-columns: 1fr; }
  .btn, .input { min-height: 44px; }
  .input { font-size: 16px; }
  .axis { grid-template-columns: 1fr; }
  .axis-days { grid-column: 1; }
  .axis-label { min-height: 0; padding: 12px 16px 6px; border-bottom: 0; }
  .axis-lane { min-height: 56px; }
  .axis-cell { padding: 6px 2px; }
  .axis .evt { padding: 6px 4px; align-items: center; }
  .axis .evt .t { display: none; }
  .axis .evt .s { justify-content: center; }
  .axis .evt .s .lbl { display: none; }
  .now-tag { display: none; }
  .axis-day { padding: 0 2px 8px; justify-content: center; flex-direction: column; align-items: center; gap: 0; }
  .now-wrap { left: 0; }
  .axis-head { padding: 16px 16px 0; }
  .funnel li { grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; }
  .funnel li .meter { grid-column: 1 / -1; grid-row: 2; }
  .funnel .v small { white-space: nowrap; }
  .timers li.head { display: none; }
  .timers li.head + li { border-top: 0; padding-top: 0; }
  .timers li { grid-template-columns: 1fr 1fr 1fr; gap: 8px 12px; }
  .timers .nm { grid-column: 1 / -1; white-space: normal; }
  .timers .r { text-align: left; }
  .timers .countdown { grid-column: 1 / -1; }
  .timers [data-label]::before { content: attr(data-label); display: block; font-size: 11px; line-height: 14px; color: var(--ink-3); margin-bottom: 2px; }
  .check-row { grid-template-columns: 1fr; gap: 4px; }
  .tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
    background: color-mix(in srgb, var(--bg) 82%, transparent);
    -webkit-backdrop-filter: blur(20px) saturate(160%); backdrop-filter: blur(20px) saturate(160%);
    border-top: 1px solid var(--hair);
  }
  .tab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 48px; border-radius: var(--r); color: var(--ink-3); text-decoration: none; font-size: 11px; line-height: 14px; font-weight: 500; }
  .tab svg { width: 20px; height: 20px; }
  .tab.active { color: var(--ink); }
  .more { position: relative; }
  .more summary { list-style: none; cursor: pointer; }
  .more summary::-webkit-details-marker { display: none; }
  .more-menu { position: absolute; right: 0; bottom: calc(100% + 10px); min-width: 200px; padding: 6px; border-radius: var(--r-lg); background: var(--surface-3); box-shadow: var(--pop-shadow); display: flex; flex-direction: column; gap: 2px; }
  .more-menu a, .more-menu button { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 12px; border-radius: var(--r); color: var(--ink); text-decoration: none; font: inherit; background: none; border: 0; text-align: left; cursor: pointer; width: 100%; }
  .more-menu a:hover, .more-menu button:hover { background: var(--surface-2); }
  .more-menu svg { width: 18px; height: 18px; }
}

/* ------------------------------------------------------------------ přístupnost */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; }
  .live[data-state="live"] .dot { animation: none; }
  .ripple { display: none; }
}
@media (prefers-reduced-transparency: reduce) {
  .tabbar { background: var(--bg); -webkit-backdrop-filter: none; backdrop-filter: none; }
}
@media (prefers-contrast: more) {
  :root { --hair: rgba(226, 232, 240, 0.22); --ink-3: #a0a8b4; }
  :root[data-theme="light"] { --hair: rgba(15, 23, 32, 0.25); --ink-3: #485260; }
}
@media (forced-colors: active) {
  .dot, .ripple { forced-color-adjust: none; }
}

/* doplňky rozestupů */
.section-gap { margin-top: 16px; }
.section-gap-b { margin-bottom: 16px; }
.section-sub { margin-top: 20px; margin-bottom: 10px; }
.meter .bar.n { fill: var(--ink-3); opacity: 0.45; }
.slot-meta .client-name { margin-right: 4px; }
.cal-event { font-size: 11px; line-height: 14px; color: var(--ink-3); display: flex; gap: 6px; align-items: baseline; }
.cal-event::before { content: ""; width: 4px; height: 4px; border-radius: 1px; background: var(--ink-3); flex: none; transform: translateY(-2px); }
.kpi .lab { display: block; }
