:root {
  --bg: #f3f6ff;
  --card: #ffffff;
  --ink: #0f172a;
  --muted: #55607a;
  --line: #dfe5f3;
  --brand: #2563eb;
  --brand2: #7c3aed;
  --sil: #f59e0b;
  --neg: #10b981;
  --ds: #2563eb;
  --ot: #a855f7;
  --nt: #0ea5e9;
  --vt: #f97316;
  --band: rgba(14, 165, 233, 0.09);
  --good: #059669;
  --bad: #dc2626;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: var(--bg);
}
* { box-sizing: border-box; }
body { margin: 0; line-height: 1.5; }
a { color: var(--brand); }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }

.top { background: linear-gradient(90deg, var(--brand), var(--brand2)); color: #fff; }
.top .wrap { display: flex; align-items: center; gap: 10px; height: 58px; }
.brand { font-weight: 800; text-decoration: none; letter-spacing: -0.01em; color: #fff; font-size: 18px; }
.brand span { opacity: .75; font-weight: 500; }
.brand .bolt { opacity: 1; margin-right: 6px; }
.tag { font-size: 12px; background: rgba(255,255,255,.2); border-radius: 99px; padding: 2px 9px; }

.hero { padding: 34px 0 6px; }
h1 { font-size: clamp(30px, 4.4vw, 44px); line-height: 1.08; margin: 0 0 10px; letter-spacing: -0.025em;
  background: linear-gradient(90deg, var(--brand), var(--brand2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lead { max-width: 740px; color: var(--muted); font-size: 18px; margin: 0; }
h2 { font-size: 20px; margin: 0 0 12px; letter-spacing: -0.01em; }
h2 small { color: var(--muted); font-weight: 400; font-size: 15px; margin-left: 6px; }

/* ovládání */
.controls { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px; margin: 20px 0; box-shadow: 0 6px 24px -18px rgba(37,99,235,.5); }
.fields { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; align-items: end; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.lbl { font-size: 13px; font-weight: 600; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
select, input { font: inherit; font-size: 15px; color: var(--ink); background: #f8faff; border: 1px solid var(--line); border-radius: 10px; padding: 0 10px; height: 42px; width: 100%; min-width: 0; }
select:focus, input:focus { outline: 2px solid var(--brand); outline-offset: 1px; }
select:disabled { color: var(--muted); }
.unit { position: relative; display: block; }
.unit input { padding-right: 112px; }
.unit em { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); font-style: normal; font-size: 12px; color: var(--muted); pointer-events: none; }
.toggles { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 22px; margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--line); }
.chk { display: inline-flex; align-items: center; gap: 8px; font-size: 15px; cursor: pointer; }
.chk input { width: 18px; height: 18px; accent-color: var(--brand); margin: 0; }
.chk small { color: var(--muted); }
#vatSwitch { margin-left: auto; }
#whatIn { margin: 10px 0 0; }

/* karty dnů */
.days { display: grid; grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); gap: 16px; }
.day, .card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 20px; }
.card { margin: 16px 0; }
.day.pending { display: flex; flex-direction: column; justify-content: center; background: linear-gradient(135deg, #eef2ff, #f5f3ff); }
.tarify { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.tarify.one { grid-template-columns: 1fr; }
.tarif { border-radius: 12px; padding: 12px 14px; }
.t-nt { background: linear-gradient(180deg, rgba(14,165,233,.12), rgba(14,165,233,.02)); border-top: 4px solid var(--nt); }
.t-vt { background: linear-gradient(180deg, rgba(249,115,22,.12), rgba(249,115,22,.02)); border-top: 4px solid var(--vt); }
.tarif-name { font-size: 14px; font-weight: 600; color: var(--muted); }
.big { font-size: 34px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.15; }
.big small { font-size: 14px; font-weight: 500; color: var(--muted); }
.parts { list-style: none; margin: 8px 0 10px; padding: 0; font-size: 13px; color: var(--muted); display: grid; gap: 3px; }
.parts li { display: grid; grid-template-columns: 12px 1fr auto; align-items: center; gap: 8px; }
.parts i { width: 10px; height: 10px; border-radius: 3px; display: block; }
.parts b { font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.range { font-size: 13px; color: var(--muted); padding-top: 8px; border-top: 1px dashed rgba(15,23,42,.12); }
.best { margin-top: 12px; padding: 8px 10px; background: rgba(255,255,255,.75); border-radius: 8px; min-width: 0; }
.best-label { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; }
.best-val { font-size: 14px; color: var(--muted); }
.best-val strong { font-size: 18px; color: var(--ink); }
.best-name { display: block; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.verdict { display: inline-block; margin-top: 8px; font-size: 13px; font-weight: 700; padding: 3px 9px; border-radius: 99px; }
.verdict.worse { background: #fee2e2; color: var(--bad); }
.verdict.better { background: #d1fae5; color: var(--good); }

.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #f8faff; }
.seg button { font: inherit; font-size: 14px; border: 0; background: transparent; padding: 7px 13px; cursor: pointer; color: var(--muted); }
.seg button.on { background: var(--brand); color: #fff; }

/* graf */
.chart svg { width: 100%; height: auto; display: block; }
.s-sil, .c-sil { fill: var(--sil); background: var(--sil); }
.s-neg, .c-neg { fill: var(--neg); background: var(--neg); }
.s-ds, .c-ds { fill: var(--ds); background: var(--ds); }
.s-ot, .c-ot { fill: var(--ot); background: var(--ot); }
.c-band { background: var(--band); border: 1px solid rgba(14,165,233,.35); }
.nt-band { fill: var(--band); }
.grid { stroke: var(--line); stroke-width: 1; }
.zero { stroke: #94a3b8; stroke-width: 1; }
.ax { font-size: 11px; fill: var(--muted); }
.l-nt, .l-vt { stroke-width: 2.5; stroke-dasharray: 7 5; }
.l-nt { stroke: #0369a1; }
.l-vt { stroke: #c2410c; }
.legend { font-size: 13px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; margin: 10px 0 0; }
.legend .sw { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.ln { display: inline-block; width: 20px; border-top: 2.5px dashed; margin-right: 6px; vertical-align: 3px; }
.ln-nt { border-color: #0369a1; } .ln-vt { border-color: #c2410c; }

/* tabulka */
.tablewrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { font-weight: 600; color: var(--muted); font-size: 13px; background: #f8faff; }
td:first-child { white-space: normal; }
a.plink { color: var(--brand); text-decoration: underline; text-decoration-color: rgba(37,99,235,.35); text-underline-offset: 3px; }
a.plink strong { color: var(--ink); }
a.plink:hover { text-decoration-color: var(--brand); }
a.plink .ext { font-size: 12px; margin-left: 4px; }
.typ { font-size: 12px; padding: 2px 8px; border-radius: 99px; background: #eef2ff; color: #3730a3; }
.typ.t-neurcito { background: #fff7ed; color: #9a3412; }
.typ.t-mesic { background: #fdf2f8; color: #9d174d; }
.tfilters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 0 0 10px; }
.tfilters select { width: auto; min-width: 190px; height: 38px; }
td .sub { font-size: 12px; color: var(--muted); }
tbody tr:hover { background: #f8faff; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
td.better { color: var(--good); font-weight: 700; }
td.worse { color: var(--bad); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.stat { font-size: 16px; }

.hist { display: flex; align-items: flex-end; gap: 4px; height: 160px; border-bottom: 1px solid var(--line); padding-top: 18px; }
.hbar { flex: 1; height: var(--h); min-height: 3px; border-radius: 5px 5px 0 0; position: relative; }
.hbar.worse { background: linear-gradient(180deg, #f87171, #fecaca); } .hbar.better { background: linear-gradient(180deg, #34d399, #a7f3d0); }
.hbar span { position: absolute; top: -16px; left: 50%; transform: translateX(-50%); font-size: 10px; color: var(--muted); white-space: nowrap; }
.hbar em { position: absolute; bottom: -18px; left: 50%; transform: translateX(-50%); font-size: 10px; font-style: normal; color: var(--muted); }

.notes ul { margin: 0; padding-left: 20px; color: var(--muted); }
.notes li { margin: 4px 0; }
.foot { color: var(--muted); font-size: 13px; padding-top: 8px; padding-bottom: 40px; }

@media (max-width: 860px) {
  .fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .fields { grid-template-columns: 1fr; }
  #vatSwitch { margin-left: 0; }
  .tarify { grid-template-columns: 1fr; }
  .big { font-size: 28px; }
  .chart { overflow-x: auto; }
  .chart svg { min-width: 680px; }
}
th.sortable button { font: inherit; font-weight: 600; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; white-space: nowrap; }
th.sortable button:hover { color: var(--brand); }
th.sortable.on { color: var(--brand); }
th.num.sortable button { text-align: right; }
.years { list-style: none; padding: 0; margin: 12px 0; display: grid; gap: 10px; }
.years li { display: grid; grid-template-columns: 56px 1fr; gap: 2px 12px; padding: 10px 12px; border-radius: 10px; background: #f8faff; border-left: 4px solid #94a3b8; color: var(--ink); }
.years li.good { border-left-color: var(--good); background: #ecfdf5; }
.years li.bad { border-left-color: var(--bad); background: #fef2f2; }
.years b { font-size: 18px; grid-row: span 2; }
.years .pill { font-size: 12px; font-weight: 600; color: var(--muted); }
.years p { margin: 0; font-size: 14px; color: var(--muted); }
.story > p { color: var(--ink); }
.top .stav { margin-left: auto; font-size: 13px; opacity: .85; }
.chartbox { position: relative; }
.chart svg { cursor: crosshair; }
.hl { fill: rgba(15,23,42,.08); }
.tip { position: absolute; z-index: 5; width: 250px; background: #0f172a; color: #e2e8f0; border-radius: 12px; padding: 10px 12px; font-size: 13px; box-shadow: 0 12px 32px -12px rgba(15,23,42,.6); pointer-events: none; }
.tip .th { font-weight: 600; color: #cbd5e1; }
.tip .tt { font-size: 11px; padding: 1px 6px; border-radius: 99px; margin-left: 4px; color: #fff; }
.tip .tt.nt { background: var(--nt); } .tip .tt.vt { background: var(--vt); }
.tip .tbig { font-size: 24px; font-weight: 800; color: #fff; margin: 2px 0 6px; }
.tip .tbig small { font-size: 12px; font-weight: 500; color: #94a3b8; }
.tip .tr { display: grid; grid-template-columns: 12px 1fr auto; gap: 8px; align-items: center; }
.tip .tr i { width: 10px; height: 10px; border-radius: 3px; display: block; }
.tip .tr b { color: #fff; font-variant-numeric: tabular-nums; }
.tip .tfix { margin-top: 8px; padding-top: 8px; border-top: 1px solid rgba(255,255,255,.12); color: #cbd5e1; }
.tip .tfix b { color: #fff; }
.tip .tfix small { color: #94a3b8; }
.tip .verdict { margin-top: 8px; }
.tip .teur { font-size: 12px; color: #94a3b8; margin: -4px 0 6px; }
@media (max-width: 560px) {
  .top .stav { font-size: 11px; }
  .tip { position: static; width: auto; margin-top: 10px; }
}
.foot .xsites { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
