/* Light only by choice. Layout: one calm column. A sticky strip with the three key numbers stays on top while you scroll through four numbered steps: class, income, costs, result. Costs are compact tiles; advanced options hide behind "Upravit". */
:root {
  --bg: #f5f4fa;
  --surface: #ffffff;
  --surface-2: #faf9fd;
  --ink: #1f2037;
  --muted: #5b5e7e;
  --line: #e1e0ee;
  --track: #e3e1ef;
  --accent: #8a2a69;
  --accent-ink: #ffffff;
  --accent-soft: #f7e7f1;
  --plus: #17744a;
  --plus-soft: #e2f3ea;
  --minus: #e60000;
  --minus-soft: #ffe4e4;
  --offer: #0a6cff;
  --offer-soft: #dce9ff;
  --offer-ink: #ffffff;
  --seg1: #8a2a69; --seg2: #b35a92; --seg3: #d392bb; --seg4: #e8c4da;
  --cseg1: #2d3157; --cseg2: #545a8c; --cseg3: #8c91bd; --cseg4: #bfc2de; --cseg5: #dfe1ef;
  --shadow: 0 6px 24px rgba(40, 30, 80, .10);
  --font-display: "Nunito", "Segoe UI", system-ui, sans-serif;
  --font-body: "Nunito Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  --r: 16px;
  --r-sm: 10px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
}
.wrap { max-width: 920px; margin: 0 auto; padding-inline: 16px; padding-block: 0 40px; }
@media (min-width: 640px) { .wrap { padding-inline: 24px; } }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.pos { color: var(--plus); } .neg { color: var(--minus); }

h1, h2, h3 { font-family: var(--font-display); text-wrap: balance; margin: 0; }

/* Header */
header.top { padding-block: 32px 20px; }
.eyebrow { font-family: var(--font-display); font-weight: 700; font-size: 14px; color: var(--accent); }
h1 { font-weight: 800; font-size: clamp(30px, 6vw, 44px); line-height: 1.1; margin: 4px 0 10px; }
.lede { color: var(--muted); max-width: 60ch; margin: 0 0 18px; font-size: 17px; }
.how { display: flex; flex-wrap: wrap; gap: 8px 10px; list-style: none; margin: 0; padding: 0; counter-reset: how; }
.how li { counter-increment: how; display: flex; gap: 8px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px 6px 8px; font-size: 14px; font-weight: 600; }
.how li::before { content: counter(how); display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-size: 13px; font-family: var(--font-display); font-weight: 800; }
.sample-note { margin-top: 14px; padding: 10px 14px; border-radius: var(--r-sm); background: var(--accent-soft); font-size: 14px; }
.sample-note b { color: var(--accent); }

/* Sticky key numbers */
.sum {
  position: sticky; top: calc(8px + env(safe-area-inset-top, 0px)); z-index: 30;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px 12px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow);
  padding: 12px 16px; margin-bottom: 8px;
}
.sum-item { min-width: 0; }
.sum-item + .sum-item { border-left: 1px solid var(--line); padding-left: 12px; }
.sum .k { font-size: 12px; font-weight: 700; color: var(--muted); line-height: 1.25; }
.sum .v { font-family: var(--font-display); font-weight: 800; font-size: clamp(16px, 4.6vw, 28px); line-height: 1.2; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.sum .tag { display: inline-block; font-size: 12px; font-weight: 700; padding: 1px 9px; border-radius: 999px; margin-top: 2px; }
.sum .is-plus .tag { background: var(--plus-soft); color: var(--plus); }
.sum .is-minus .tag { background: var(--minus-soft); color: var(--minus); }
.sum .is-plus .v { color: var(--plus); } .sum .is-minus .v { color: var(--minus); }
@media (max-width: 480px) { .sum { padding: 10px 12px; gap: 2px 8px; } .sum-item + .sum-item { padding-left: 8px; } .sum .tag { display: none; } }

/* Steps */
.step { margin-top: 36px; }
.step-head { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 14px; }
.badge { flex: none; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-family: var(--font-display); font-weight: 800; font-size: 18px; }
.step-head h2 { font-weight: 800; font-size: 26px; line-height: 1.2; }
.step-head p { margin: 2px 0 0; color: var(--muted); max-width: 62ch; }
.stack { display: flex; flex-direction: column; gap: 14px; }

/* Groups (collapsible cards) */
details.group { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
details.group > summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 16px 18px; border-radius: var(--r);
}
details.group > summary::-webkit-details-marker { display: none; }
details.group > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.g-title { font-family: var(--font-display); font-weight: 800; font-size: 20px; flex: 1 1 auto; }
.g-sum { font-family: var(--font-display); font-weight: 800; font-size: 18px; font-variant-numeric: tabular-nums; color: var(--accent); }
.chev { width: 10px; height: 10px; border-right: 2.5px solid var(--muted); border-bottom: 2.5px solid var(--muted); transform: rotate(45deg); margin: 0 4px 3px 2px; transition: transform .15s ease; }
details.group[open] > summary .chev { transform: rotate(-135deg); margin-bottom: -3px; }
.g-body { padding: 0 18px 18px; display: flex; flex-direction: column; gap: 14px; }
@media (max-width: 480px) { .g-body { padding: 0 12px 14px; } details.group > summary { padding: 14px; } }
.hint { color: var(--muted); font-size: 15px; margin: 0; max-width: 64ch; }
.callout { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 12px 14px; border-radius: 12px; background: var(--offer-soft); font-size: 15px; }
.callout .dot { width: 12px; height: 12px; border-radius: 50%; background: #1a6dff; flex: none; }
.callout span.t { flex: 1 1 240px; min-width: 0; }

/* Form controls */
input[type="text"], input[type="number"], select, textarea {
  font: inherit; font-size: 16px; color: var(--ink);
  background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--r-sm);
  padding: 10px 12px; width: 100%; min-width: 0;
}
input[type="number"] { font-variant-numeric: tabular-nums; text-align: right; }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
.fields { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
label.field { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 700; color: var(--muted); min-width: 0; }
.money { position: relative; display: block; min-width: 0; }
.money input { padding-right: 46px; }
.money > span { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 14px; font-weight: 600; pointer-events: none; }
.money.pcs input { padding-right: 38px; }
.field .tip { font-weight: 400; font-size: 13px; }
button { font: inherit; cursor: pointer; }

/* Sliders */
input[type="range"] {
  -webkit-appearance: none; appearance: none; width: 100%; height: 30px; margin: 0; background: transparent; cursor: pointer;
  --p: 0%;
}
input[type="range"]::-webkit-slider-runnable-track { height: 8px; border-radius: 99px; background: linear-gradient(to right, var(--accent) var(--p), var(--track) var(--p)); }
input[type="range"]::-moz-range-track { height: 8px; border-radius: 99px; background: linear-gradient(to right, var(--accent) var(--p), var(--track) var(--p)); }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 26px; height: 26px; margin-top: -9px; border-radius: 50%; background: var(--accent); border: 4px solid var(--surface); box-shadow: 0 1px 5px rgba(0,0,0,.4); }
input[type="range"]::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: var(--accent); border: 4px solid var(--surface); box-shadow: 0 1px 5px rgba(0,0,0,.4); }
input[type="range"]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
.big-slider { background: var(--surface-2); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; }
.big-slider label { font-weight: 700; }
.big-slider output { font-family: var(--font-display); font-weight: 800; font-size: 28px; color: var(--accent); font-variant-numeric: tabular-nums; }
.big-slider input[type="range"] { grid-column: 1 / -1; }
.big-slider .calc { grid-column: 1 / -1; }
.calc { font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* Cost / income tiles */
.items { display: flex; flex-direction: column; gap: 12px; }
.item { background: var(--surface-2); border: 1px solid var(--line); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.item-top { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; }
.item-name { flex: 1 1 220px; min-width: 0; font-size: 17px; font-weight: 700; background: transparent; border-color: transparent; padding: 6px 8px; margin-left: -8px; text-align: left; font-family: var(--font-display); }
.item-name:hover { border-color: var(--line); }
.item-name:focus { background: var(--surface); }
div.item-name { display: block; border: 1.5px solid transparent; }
.amt { position: relative; flex: 0 0 160px; margin-left: auto; }
.amt input { text-align: right; padding-right: 46px; font-weight: 700; font-size: 18px; font-family: var(--font-display); }
.amt .u { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 14px; font-weight: 600; pointer-events: none; }
/* Markers sit on the slider track itself: our price as a blue dot, recommended prices as small white notches */
.range-wrap { position: relative; min-width: 0; --th: 26px; }
.rec-tick {
  position: absolute; top: 8px; left: calc(var(--th) / 2 + (100% - var(--th)) * var(--f, 0));
  width: 4px; height: 14px; margin-left: -2px; border-radius: 3px;
  background: var(--surface); box-shadow: 0 0 0 1.5px var(--accent); pointer-events: none;
}
.offer-tick {
  position: absolute; top: 9px; left: calc(var(--th) / 2 + (100% - var(--th)) * var(--f, 0));
  width: 12px; height: 12px; margin-left: -6px; border-radius: 50%;
  background: #1a6dff;
  pointer-events: none;
}
.range-wrap .covered { visibility: hidden; }
.range-wrap.at-offer input[type="range"]::-webkit-slider-thumb { background: #1a6dff; }
.range-wrap.at-offer input[type="range"]::-moz-range-thumb { background: #1a6dff; }
.range-foot { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "min chips max"; gap: 6px 10px; align-items: center; }
.range-foot .end { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.range-foot .end:first-child { grid-area: min; } .range-foot .end:last-child { grid-area: max; text-align: right; }
.chips { grid-area: chips; display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
@media (max-width: 560px) {
  .range-foot { grid-template-areas: "min max" "chips chips"; grid-template-columns: 1fr 1fr; }
  .chips { justify-content: flex-start; }
}
.chip { border: 1.5px solid var(--line); background: var(--surface); color: var(--accent); border-radius: 999px; padding: 5px 13px; font-size: 14px; font-weight: 700; }
.chip:hover { border-color: var(--accent); }
.chip.on { background: var(--accent-soft); border-color: var(--accent); }
.chip.offer {
  border: 0; padding: 4px 12px; font-size: 13px; color: #fff;
  background: linear-gradient(180deg, #3b8fff 0%, #0a62ff 100%);
  box-shadow: 0 2px 8px rgba(10, 108, 255, .5);
  transition: box-shadow .15s ease, filter .15s ease, transform .15s ease;
}
.chip.offer::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 7px; border-radius: 50%; background: #cfe5ff; vertical-align: 1px; }
.chip.offer:hover { filter: brightness(1.1); box-shadow: 0 3px 12px rgba(10, 108, 255, .65); }
.chip.offer.on { box-shadow: 0 0 0 3px rgba(10, 108, 255, .3), 0 3px 12px rgba(10, 108, 255, .6); }
.item-meta { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; }
.item-meta select { width: auto; padding: 7px 10px; font-size: 14px; }
.pill input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.pill { position: relative; display: inline-flex; cursor: pointer; }
.pill span { display: inline-flex; align-items: center; gap: 7px; padding: 6px 13px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--surface); font-size: 14px; font-weight: 700; color: var(--muted); }
.pill span::before { content: ""; width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--muted); }
.pill input:checked + span { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.pill input:checked + span::before { background: var(--accent); border-color: var(--accent); box-shadow: inset 0 0 0 2px var(--accent-soft); }
.pill input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.link { background: none; border: 0; color: var(--accent); font-weight: 700; font-size: 14px; padding: 6px 4px; margin-left: auto; border-radius: 6px; }
.link:hover { text-decoration: underline; }
.link.danger { color: var(--minus); margin-left: 0; }
.item-meta .calc { flex: 1 1 auto; min-width: 0; }
.item-edit { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; padding-top: 12px; border-top: 1px dashed var(--line); }
.item-edit label.field { flex: 0 1 170px; }
.item-edit .link { margin-left: auto; }
.add { align-self: flex-start; background: var(--surface); color: var(--accent); border: 1.5px dashed var(--accent); border-radius: var(--r-sm); padding: 9px 16px; font-weight: 700; font-size: 15px; }
.add:hover { background: var(--accent-soft); }

.mini-row { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; background: var(--surface-2); border: 1px solid var(--line); border-radius: 14px; padding: 10px 14px; }
.mini-row .item-name { font-size: 16px; }
.del { width: 36px; height: 36px; border-radius: 8px; border: 0; background: transparent; color: var(--muted); font-size: 22px; line-height: 1; }
.del:hover { background: var(--minus-soft); color: var(--minus); }

/* Ticket spaces */
.spaces { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.space { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--surface-2); cursor: pointer; }
.space:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.space:focus-within { outline: 2px solid var(--accent); outline-offset: 1px; }
.space input[type="checkbox"] { width: 20px; height: 20px; flex: none; accent-color: var(--accent); }
.space > span:not(.money), .space label > span:not(.money) { display: flex; flex-direction: column; line-height: 1.3; }
.space b { font-weight: 700; }
.space small { color: var(--muted); font-size: 13px; }
.space.over { cursor: default; flex-wrap: wrap; }
.space.over label { display: flex; gap: 12px; align-items: center; flex: 1 1 auto; min-width: 0; cursor: pointer; }
.space.over .money { width: 100px; flex: none; }
.space.over input[type="number"] { padding-block: 7px; }

/* Results */
.cards { display: flex; flex-direction: column; gap: 16px; }
.flows { display: grid; gap: 22px 40px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.flows .flow + .flow { margin-top: 0; }
.share-top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.share-top .toast { margin: 0; min-height: 0; }
.share-more { display: grid; gap: 4px 32px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); margin-top: 6px; }
.share-more details.more { margin-top: 8px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; min-width: 0; }
.panel h3 { font-weight: 800; font-size: 18px; margin-bottom: 10px; }
.plain { font-size: 18px; line-height: 1.55; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px 20px; margin: 0 0 16px; max-width: none; }
.plain b { font-family: var(--font-display); font-weight: 800; }
.flow + .flow { margin-top: 22px; }
.flow-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-family: var(--font-display); font-weight: 800; font-size: 18px; }
.flow-head b { font-variant-numeric: tabular-nums; font-weight: 800; }
.bar { display: flex; height: 16px; border-radius: 99px; overflow: hidden; background: var(--track); margin: 8px 0 12px; }
.bar span { display: block; height: 100%; min-width: 0; border-right: 2px solid var(--surface); }
.bar span:last-child { border-right: 0; }
.legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 15px; }
.legend li { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto; gap: 10px; align-items: center; }
.legend i { width: 12px; height: 12px; border-radius: 4px; display: block; }
.legend .v { font-variant-numeric: tabular-nums; font-weight: 700; }
.flow-diff { margin-top: 20px; padding: 12px 14px; border-radius: 12px; display: flex; justify-content: space-between; gap: 12px; font-weight: 700; font-size: 16px; }
.flow-diff.is-plus { background: var(--plus-soft); color: var(--plus); }
.flow-diff.is-minus { background: var(--minus-soft); color: var(--minus); }
.flow-diff b { font-family: var(--font-display); font-weight: 800; font-size: 18px; font-variant-numeric: tabular-nums; }
.chart { width: 100%; height: auto; display: block; }
.chart .grid-l { stroke: var(--line); stroke-width: 1; }
.chart .zero { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 4 4; }
.chart .ln { fill: none; stroke: var(--ink); stroke-width: 2.4; }
.chart .area-plus { fill: var(--plus); opacity: .18; }
.chart .area-minus { fill: var(--minus); opacity: .18; }
.chart text { fill: var(--muted); font-family: var(--font-body); font-size: 12px; font-variant-numeric: tabular-nums; }
.chart .be { stroke: var(--accent); stroke-width: 1.5; }
.chart .be-t { fill: var(--accent); font-weight: 700; }
.chart .now { fill: var(--accent); stroke: var(--surface); stroke-width: 3; }
.be-text { margin: 10px 0 0; font-size: 15px; }
.be-text b { color: var(--accent); }
.table-wrap { overflow-x: auto; }
.scen { width: 100%; border-collapse: collapse; font-size: 15px; font-variant-numeric: tabular-nums; }
.scen th, .scen td { padding: 8px 6px; text-align: right; border-bottom: 1px solid var(--line); }
.scen th:first-child, .scen td:first-child { text-align: left; }
.scen th { font-size: 12px; font-weight: 700; color: var(--muted); }
.scen tr.cur td { font-weight: 800; }
.sub { margin: 0 0 8px; font-family: var(--font-display); font-size: 15px; font-weight: 800; }
.calc-cols { display: grid; gap: 16px 24px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.calc-cols > div { min-width: 0; }
.settle { margin: 0; display: grid; gap: 7px; font-size: 15px; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); }
.settle div { display: flex; justify-content: space-between; gap: 12px; }
.settle dt { color: var(--muted); }
.settle dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.settle .em { border-top: 1px solid var(--line); padding-top: 8px; margin-top: 2px; }
.settle .em dt { color: var(--ink); font-weight: 700; }
.settle .em dd { font-size: 17px; font-weight: 800; }
.settle .muted dt, .settle .muted dd { color: var(--muted); font-weight: 400; font-size: 13.5px; }

.actions { display: flex; flex-wrap: wrap; gap: 10px; }
.btn { border-radius: var(--r-sm); padding: 10px 16px; font-weight: 700; font-size: 15px; border: 1.5px solid var(--accent); background: var(--accent); color: var(--accent-ink); }
.btn.ghost { background: transparent; color: var(--accent); }
.btn.warn { border-color: var(--minus); color: var(--minus); background: transparent; }
.toast { font-size: 14px; color: var(--plus); min-height: 1.5em; margin: 8px 0 0; }
details.more { margin-top: 12px; }
details.more summary { cursor: pointer; font-weight: 700; color: var(--accent); font-size: 15px; }
details.more textarea { margin-top: 8px; height: 90px; font-size: 12px; font-family: ui-monospace, Consolas, monospace; resize: vertical; text-align: left; }
details.more p { font-size: 14px; color: var(--muted); margin: 8px 0; }
footer { color: var(--muted); font-size: 14px; margin-top: 32px; max-width: 70ch; }

/* Interactive chart */
.explore .hint { margin-bottom: 8px; }
.ex-head { display: flex; flex-direction: column; gap: 2px; margin: 4px 0 6px; }
.ex-head b { font-family: var(--font-display); font-weight: 800; font-size: 18px; }
.ex-head span { color: var(--muted); font-size: 14px; max-width: 70ch; }
.ex-svg { touch-action: pan-y; cursor: crosshair; user-select: none; -webkit-user-select: none; }
.chart .area-neutral { fill: var(--accent); opacity: .14; }
.chart .cur-line { stroke: var(--ink); stroke-width: 1.5; }
.chart .cur-dot { stroke: var(--surface); stroke-width: 3; }
.chart .tip-bg { fill: var(--surface); stroke: var(--line); stroke-width: 1.5; }
.chart text.tip-t { font-weight: 800; font-size: 13px; }
.chart text.xt2 { font-size: 11px; opacity: .8; }
.chart text.xt1 { font-size: 13px; font-weight: 700; fill: var(--ink); }
.chart .pct-bg { fill: var(--accent); }
.chart text.pct-t { fill: var(--accent-ink); font-weight: 800; font-size: 14px; }
.ex-slider output small { font-family: var(--font-body); font-weight: 600; font-size: 13px; color: var(--muted); margin-left: 6px; }
.chip b { font-weight: 800; }
.ex-legend { color: var(--muted); font-size: 13px; margin: 4px 0 14px; max-width: 70ch; }
.ex-slider { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; background: var(--surface-2); border: 1px solid var(--line); border-radius: 14px; padding: 12px 16px; }
.ex-slider label { font-weight: 700; }
.ex-slider output { font-family: var(--font-display); font-weight: 800; font-size: 28px; color: var(--accent); font-variant-numeric: tabular-nums; }
.ex-slider input[type="range"] { grid-column: 1 / -1; }
.ex-slider .chips { grid-column: 1 / -1; justify-content: flex-start; }
.seg { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 12px; }
.seg button { border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 999px; padding: 8px 16px; font-size: 15px; font-weight: 700; }
.seg button:hover { border-color: var(--accent); }
.seg button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.readout { margin-top: 16px; display: flex; flex-direction: column; gap: 12px; }
.readout h4 { margin: 0; font-family: var(--font-display); font-weight: 800; font-size: 17px; }
.say { margin: 0; font-size: 17px; line-height: 1.55; }
.say b { font-family: var(--font-display); font-weight: 800; }
.say.muted { font-size: 15px; color: var(--muted); }
.stats { display: none; }
.stat { text-align: left; background: var(--surface-2); border: 1.5px solid var(--line); border-radius: 12px; padding: 10px 14px; font: inherit; color: inherit; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
button.stat { cursor: pointer; }
button.stat:hover { border-color: var(--accent); }
button.stat[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }
.stat .k { font-size: 12px; font-weight: 700; color: var(--muted); }
.stat .v { font-family: var(--font-display); font-weight: 800; font-size: 20px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.stat .s { font-size: 13px; color: var(--muted); }

/* Phones and tablets */
@media (pointer: coarse) {
  .link { padding: 12px 10px; }
  .chip { padding: 8px 15px; }
  .chip.offer { padding: 7px 14px; }
  .seg button { padding: 11px 18px; }
  .del { width: 44px; height: 44px; }
  .add { padding: 12px 18px; }
  .btn { padding: 12px 18px; }
}
@media (max-width: 560px) {
  header.top { padding-block: 22px 14px; }
  .lede { font-size: 16px; }
  .how li { font-size: 13px; padding: 5px 12px 5px 6px; }
  .step { margin-top: 28px; }
  .step-head h2 { font-size: 23px; }
  .panel { padding: 14px; }
  .plain { font-size: 16px; padding: 14px 16px; }
  .g-title { font-size: 18px; }
  .item { padding: 12px; }
  .amt { flex: 1 1 100%; margin-left: 0; }
  .item-name { flex-basis: 100%; }
  .ex-slider { padding: 12px; }
  .seg { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .seg button { padding: 9px 6px; font-size: 13px; line-height: 1.25; border-radius: 14px; text-align: center; }
}
@media (max-height: 520px) and (orientation: landscape) {
  .sum { position: static; }
}

@media (prefers-reduced-motion: no-preference) {
  .sum .v, .chev { transition: color .2s ease, transform .15s ease; }
}

/* ===== Eventkalkulačka: přihlášení, seznam akcí, ukládání ===== */
:root { color-scheme: light; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); }
img { max-width: 100%; }
.loading { display: grid; place-items: center; min-height: 60vh; color: var(--muted); font-family: var(--font-display); font-weight: 700; }
.demo-banner { background: #fff3cd; color: #5b4200; font-size: 14px; font-weight: 700; text-align: center; padding: 8px 16px; }
.empty-note { color: var(--muted); font-size: 16px; margin: 20px 0 0; }

/* App bar */
.appbar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; padding-block: 14px 0; font-size: 14px; }
.appbar .brand { font-family: var(--font-display); font-weight: 800; color: var(--accent); }
.appbar .link { margin-left: 0; padding: 6px 2px; }
.appbar .back { font-size: 15px; }
.appbar .appname { flex: 1 1 160px; min-width: 0; font-family: var(--font-display); font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.appbar .who { margin-left: auto; color: var(--muted); }
.save-state { font-weight: 700; font-size: 13px; padding: 3px 11px; border-radius: 999px; background: var(--plus-soft); color: var(--plus); white-space: nowrap; }
.save-state[data-kind="saving"] { background: var(--accent-soft); color: var(--accent); }
.save-state[data-kind="error"] { background: var(--minus-soft); color: var(--minus); }

/* Login */
.gate { min-height: 100vh; display: grid; place-items: start center; padding: 28px 16px 48px; }
.gate-card { width: 100%; max-width: 460px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); padding: 26px 24px; }
.gate-card h1 { font-size: clamp(26px, 6vw, 32px); margin: 4px 0 10px; max-width: none; }
.gate-card .lede { font-size: 16px; margin-bottom: 18px; }
.tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; background: var(--bg); padding: 5px; border-radius: 12px; margin-bottom: 16px; }
.tabs button { border: 0; background: transparent; border-radius: 9px; padding: 10px; font-weight: 800; font-size: 15px; color: var(--muted); font-family: var(--font-display); }
.tabs button[aria-selected="true"] { background: var(--surface); color: var(--accent); box-shadow: 0 1px 4px rgba(40, 30, 80, .15); }
#authForm { display: flex; flex-direction: column; gap: 14px; }
#authForm input { text-align: left; }
.tip { color: var(--muted); font-size: 13.5px; margin: 0; }
.form-error { margin: 0; padding: 10px 12px; border-radius: 10px; background: var(--minus-soft); color: var(--minus); font-weight: 700; font-size: 15px; }
.gate-notes { margin: 18px 0 0; padding-left: 18px; color: var(--muted); font-size: 14px; display: grid; gap: 6px; }
.btn[disabled] { opacity: .6; cursor: progress; }

/* Seznam akcí */
.panel-title { margin: 0 0 12px; font-family: var(--font-display); font-weight: 800; font-size: 20px; }
.new-event { display: grid; gap: 12px 14px; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) auto; align-items: end; }
@media (max-width: 640px) { .new-event { grid-template-columns: minmax(0, 1fr); } }
.ev-list { display: flex; flex-direction: column; gap: 12px; margin-top: 16px; }
.ev-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; }
.ev-main { flex: 1 1 260px; min-width: 0; }
.ev-name { margin: 0; font-family: var(--font-display); font-weight: 800; font-size: 19px; overflow-wrap: anywhere; }
.ev-rename { font-family: var(--font-display); font-weight: 800; font-size: 18px; text-align: left; }
.ev-meta { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.tag { display: inline-block; padding: 1px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: 12.5px; margin-right: 6px; }
.ev-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; }
.ev-actions .link { margin-left: 0; }

/* Hlášky */
.flash { position: fixed; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 60; max-width: min(92vw, 520px); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 14px; font-size: 15px; font-weight: 700; box-shadow: var(--shadow); }
.flash.bad { background: var(--minus); }
input[type="password"] { font: inherit; font-size: 16px; color: var(--ink); background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--r-sm); padding: 10px 12px; width: 100%; min-width: 0; }
