/* Vzhled aplikace: bílá plocha, jedna kobaltová barva, ostatní barvy jen tam, kde něco znamenají. */
/* Písma značky MOLO jsou lokální (brand/fonts, licence OFL), nic se nenačítá z cizích serverů. */
@font-face { font-family: Inter; src: url("../brand/fonts/Inter-Variable.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Space Grotesk"; src: url("../brand/fonts/SpaceGrotesk-Variable.woff2") format("woff2"); font-weight: 300 700; font-style: normal; font-display: swap; }
:root {
  /* barvy podle MOLO / Signál 1.2 (design-tokens/molo.css): kobalt na značku a akce, stavové barvy jen na stav dat */
  --page: #fff; --paper: #F5F7FB; --paper-2: #E8ECF4; --white: #fff;
  --ink: #111820; --ink-hover: #2B3442; --muted: #536176; --title-muted: #111820;
  --accent: #294BFF; --accent-hover: #203ED8; --accent-tint: #EEF1FF; --focus: #172CC5; --block-grey: #D8DEEA;
  --warn: #805A00; --warn-bg: #FFF4D6;
  --on-dark: #fff; --on-dark-muted: rgb(255 255 255 / .86);
  --line: #D8DEEA; --line-strong: #A9B4C8; --field-line: #718096;
  --good: #176447; --good-bg: #E8F5EE; --good-on-dark: #7FD1A3; --bad: #B42332; --bad-hover: #961E2A; --miss-bg: #FDECEF; --miss-hover: #FBDDE2;
  /* zaoblení: ovládací prvky 6, karty 12, dialogy 16, popisky a přepínače pilulka */
  --r-s: 6px; --r-l: 12px; --r-modal: 16px; --r-pill: 999px;
  /* mezery: čtyřbodová stupnice */
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-6: 24px; --s-8: 32px; --gap-cards: 12px; --gap-sec: 24px;
  /* písmo: nadpis stránky, nadpis sekce, číslo na kartě, text 16/24, rozhraní 14/20, drobný text 12/16 */
  --fs-title: clamp(26px, 2.2vw, 32px); --fs-sec: clamp(20px, 1.9vw, 24px); --fs-num: clamp(22px, 1.9vw, 28px); --fs-body: 16px; --fs-ui: 14px; --fs-small: 12px;
  /* výška tlačítek a polí: ovládací plocha nejméně 44 px */
  --h-ctl: 44px; --h-ctl-sm: 36px;
  --font: Inter, Arial, ui-sans-serif, system-ui, sans-serif; --font-head: "Space Grotesk", Arial, sans-serif;
  /* pohyb: odezva, drobný panel, dialog */
  --t-fast: 120ms; --t-pop: 160ms; --t-modal: 200ms; --ease: cubic-bezier(.23, 1, .32, 1);
  --bar-h: 44px; --max-w: 1280px;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background-color: var(--page); color: var(--ink); font: 400 var(--fs-body)/1.5 var(--font); -webkit-font-smoothing: antialiased;
}
button, select, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .5; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
::placeholder { color: var(--muted); opacity: 1; }
input[type="radio"], input[type="checkbox"] { -webkit-appearance: none; appearance: none; display: grid; place-content: center; flex: none; width: 20px; height: 20px; margin: 1px 0 0; background: var(--white); border: 1.5px solid var(--field-line); cursor: pointer; transition: background-color var(--t-fast), border-color var(--t-fast); }
input[type="radio"] { border-radius: 50%; }
input[type="checkbox"] { border-radius: 6px; }
input[type="radio"]::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--ink); transform: scale(0); transition: transform var(--t-fast); }
input[type="checkbox"]::before { content: ""; width: 12px; height: 12px; background: var(--ink); clip-path: polygon(14% 52%, 0 66%, 38% 100%, 100% 22%, 85% 8%, 37% 70%); transform: scale(0); transition: transform var(--t-fast); }
input[type="radio"]:hover, input[type="checkbox"]:hover { border-color: var(--accent); }
input[type="radio"]:checked, input[type="checkbox"]:checked { background: var(--accent); border-color: var(--accent); }
input[type="radio"]:checked::before, input[type="checkbox"]:checked::before { transform: scale(1); background: #fff; }
input[type="radio"]:focus-visible, input[type="checkbox"]:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
summary { list-style: none; }
summary::-webkit-details-marker { display: none; }
summary::after { content: ""; flex: none; width: 12px; height: 12px; background: url("../assets/chevron.svg") center / 12px 12px no-repeat; transition: transform var(--t-fast); }
details[open] > summary::after { transform: rotate(180deg); }
::selection { background: rgb(41 75 255 / .22); }
h1, h2, h3, h4 { margin: 0; letter-spacing: -.03em; text-wrap: balance; }
h1, h2, h3 { font-family: var(--font-head); font-weight: 700; letter-spacing: -.035em; }
p { margin: 0; text-wrap: pretty; }
small { font-size: var(--fs-small); }
.muted { color: var(--muted); }
/* Částky: Space Grotesk s tabulkovými číslicemi, aby se čísla dala srovnat pod sebou. */
.num, .kpi > b, .dash-t > b, .opt-r b, .plan-b b { font-family: var(--font-head); font-variant-numeric: tabular-nums; }
.page-h h1, .sentence, .sim-h { font: 700 var(--fs-title)/1.2 var(--font-head); letter-spacing: -.035em; color: var(--title-muted); text-wrap: pretty; }
.sentence.small, .sim-h { font-size: var(--fs-sec); line-height: 1.25; }
.mk { color: inherit; }
/* Jeden popisek: nad nadpisem stránky i nad kartou. */
.eyebrow, .pill, .card-t, .ev-head h4 { display: flex; align-items: center; justify-self: start; align-self: start; width: fit-content; max-width: 100%; font: 600 15px/1.3 var(--font); letter-spacing: -.005em; text-wrap: pretty; }
.eyebrow { font-size: 14px; font-weight: 500; color: var(--muted); }
.card-t { margin-bottom: var(--s-3); }

/* ---------- lišta dema ---------- */
.demobar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 10px; min-height: var(--bar-h); padding: 6px 16px; background: var(--ink); color: var(--on-dark); font-size: var(--fs-small); flex-wrap: wrap; }
.demobar > b { color: var(--on-dark); letter-spacing: -.01em; }
.demo-note { color: var(--on-dark-muted); margin-right: 8px; }
.sync { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; color: var(--on-dark-muted); font-size: var(--fs-small); }
/* Podpis značky jako indikátor spojení: dva propojené kruhy svítí bíle, když je spojení navázané, při ukládání dýchají. */
.sync::before { content: ""; width: 24px; height: 12px; flex: none; background: var(--warn-bg); -webkit-mask: url("../brand/logos/molo-symbol-micro-white.svg") center / contain no-repeat; mask: url("../brand/logos/molo-symbol-micro-white.svg") center / contain no-repeat; transition: background-color var(--t-pop) var(--ease); }
.sync.on::before { background: var(--on-dark); }
/* Bez spojení se symbol vymění za varovný trojúhelník, aby stav nenesla jen barva (na mobilu je text skrytý). */
.sync.off::before { width: 16px; height: 16px; -webkit-mask-image: url("../brand/icons/warning.svg"); mask-image: url("../brand/icons/warning.svg"); }
.sync.busy::before { animation: breathe 1.2s var(--ease) infinite; }
@keyframes breathe { 50% { opacity: .4; } }
.no-anim * { animation: none !important; transition: none !important; }
.reset { display: inline-flex; align-items: center; margin-left: 0; border: 0; background: none; color: var(--on-dark-muted); text-decoration: underline; text-underline-offset: 3px; padding: 4px; }
.reset:hover { color: var(--on-dark); }
.demobar form { margin: 0; }
.bar-firm { max-width: 220px; min-height: 30px; padding: 2px 8px; border: 1px solid rgb(255 255 255 / .35); border-radius: var(--r-s); background: transparent; color: var(--on-dark); font: inherit; }
.bar-firm option { color: var(--ink); }
.acc-link { width: 100%; min-height: var(--h-ctl); padding: 0 12px; border: 1px solid var(--field-line); border-radius: var(--r-s); font: inherit; margin: var(--s-2) 0; }
.acc-steps { margin: var(--s-2) 0 var(--s-3); padding-left: 20px; display: grid; gap: var(--s-2); font-size: var(--fs-ui); }
.acc-e { color: var(--bad, #b42318); font-size: var(--fs-ui); }
.acc-h { margin: var(--s-4) 0 var(--s-2); font-size: var(--fs-ui); font-weight: 600; }
.acc-l li { align-items: center; flex-wrap: wrap; }
.acc-l b { font-weight: 500; }
.acc-r { display: flex; align-items: center; gap: var(--s-3); flex-wrap: wrap; }
.acc-r input { min-height: var(--h-ctl-sm); padding: 0 10px; border: 1px solid var(--field-line); border-radius: var(--r-s); font: inherit; width: min(240px, 100%); }
.acc-a { display: flex; gap: var(--s-2); flex-wrap: wrap; }
.acc-f { display: grid; gap: var(--s-2); margin: var(--s-3) 0; padding: 0; border: 0; }
.acc-f legend { padding: 0 0 var(--s-2); font-weight: 600; font-size: var(--fs-ui); }
.acc-f label { display: flex; align-items: center; gap: var(--s-2); font-size: var(--fs-ui); }

.seg { display: inline-flex; padding: 3px; background: var(--white); border: 1px solid var(--line); border-radius: var(--r-pill); max-width: 100%; }
.seg button { border: 0; background: none; min-height: var(--h-ctl-sm); padding: 0 14px; border-radius: var(--r-pill); font-weight: 600; color: var(--muted); white-space: nowrap; font-size: var(--fs-small); transition: color var(--t-fast), background-color var(--t-fast); }
.seg button:hover { color: var(--ink); }
.seg button.on { background: var(--accent-tint); color: var(--accent); }
.seg.dk { background: rgb(255 255 255 / .1); border-color: rgb(255 255 255 / .2); }
.seg.dk button { color: var(--on-dark-muted); min-height: 26px; padding: 0 11px; font-size: var(--fs-small); }
.seg.dk button:hover { color: var(--on-dark); }
.seg.dk button.on { background: var(--white); color: var(--ink); }

/* ---------- rozložení ---------- */
.layout { min-height: calc(100vh - var(--bar-h)); }
.top { background: var(--white); border-bottom: 1px solid var(--line); }
.side { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-3) var(--s-4); max-width: var(--max-w); margin-inline: auto; padding: var(--s-2) clamp(16px, 3vw, 44px); }
/* Značka: kancelář první, platforma jako malý podpis s wordmarkem (minimum 96 px šířky, ochranný prostor čtvrtina výšky). */
.brand { display: grid; gap: 2px; min-width: 0; max-width: 280px; }
.brand-o { font: 600 15px/1.25 var(--font); letter-spacing: -.01em; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand-by { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: var(--fs-small); line-height: 1; white-space: nowrap; }
.brand-by img { display: block; width: 96px; height: auto; margin: 6px 0; }
.nav { display: flex; flex-wrap: wrap; gap: 2px; flex: 1 1 auto; }
.nav button { position: relative; display: flex; align-items: center; gap: 6px; border: 0; background: none; min-height: var(--h-ctl); padding: 0 14px; border-radius: var(--r-s); font-weight: 500; color: var(--muted); white-space: nowrap; transition: background-color var(--t-fast); }
.nav button .ic { display: none; }
.nav button:hover { background: var(--paper); color: var(--ink); }
.nav button.on { background: var(--accent-tint); color: var(--accent); font-weight: 600; }
.nav-m { position: relative; }
.nav-m > button > span { width: 7px; height: 7px; margin: -3px 0 0 2px; border-right: 1.5px solid; border-bottom: 1.5px solid; transform: rotate(45deg); }
.nav-bg { position: fixed; inset: 0; z-index: 20; }
.nav-p { position: absolute; left: 0; top: calc(100% + 6px); z-index: 21; display: grid; gap: 2px; min-width: 200px; padding: 6px; background: var(--white); border-radius: var(--r-l); box-shadow: 0 8px 24px rgb(24 24 27 / .18); }
.nav .nav-p button { color: var(--ink); border-radius: var(--r-s); }
.nav .nav-p button:hover { background: var(--paper); }
.nav .nav-p button.on { background: var(--accent-tint); color: var(--accent); }
.nav .badge { margin-left: 0; }
.main { min-width: 0; margin-inline: auto; padding: var(--s-4) clamp(16px, 3vw, 44px) 40px; max-width: var(--max-w); display: grid; gap: var(--gap-sec); grid-template-columns: minmax(0, 1fr); }
.toolbar { display: flex; align-items: center; gap: var(--s-2); flex-wrap: wrap; min-height: var(--h-ctl); }
.mp { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: var(--fs-small); font-weight: 600; }
.foot { color: var(--muted); font-size: 12px; padding-top: 12px; }
.tabs { display: none; }

a.btn { text-decoration: none; color: inherit; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: var(--h-ctl); padding: 0 18px; border-radius: var(--r-s); border: 1px solid transparent; font-weight: 600; white-space: nowrap; transition: background-color var(--t-fast), border-color var(--t-fast), transform var(--t-fast); }
.btn:active:not(:disabled) { transform: scale(.98); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-secondary { background: var(--white); color: var(--ink); border-color: var(--field-line); }
.btn-secondary:hover { background: var(--paper); border-color: var(--ink); }
.btn:disabled { background: #E2E6ED; color: #697586; border-color: transparent; opacity: 1; }
/* Probíhající akce: tlačítko drží text i šířku, jen přidá kolečko a nedá se spustit znovu. */
.btn[aria-busy="true"] { cursor: progress; pointer-events: none; }
.btn[aria-busy="true"]::before { content: ""; width: 14px; height: 14px; flex: 0 0 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin 700ms linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.btn-small { min-height: var(--h-ctl-sm); padding: 0 12px; font-size: var(--fs-small); background: var(--ink); color: var(--white); }
.btn-small:hover { background: var(--ink-hover); }
.wide { width: 100%; }
.link { text-align: left; border: 0; background: none; color: var(--accent); font-weight: 600; font-size: var(--fs-small); padding: 6px 2px; }
.link:hover { text-decoration: underline; }
.back { border: 0; background: none; padding: 4px 0; color: var(--muted); font-weight: 600; justify-self: start; }
.back:hover { color: var(--ink); }

/* ---------- oznámení a štítky ---------- */
.verdict { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); }
.hint { color: var(--muted); font-size: var(--fs-small); margin-left: 4px; }
.evidence { min-height: 250px; }
.evidence.swap > * { animation: rise var(--t-pop) var(--ease); }
.ev-tabs { display: flex; width: fit-content; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.ev-tabs button { flex: none; }
.ev-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 16px; margin-bottom: 12px; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.banner { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: var(--s-3) var(--s-4); background: var(--white); border: 1px solid var(--line); border-radius: var(--r-l); font-weight: 500; font-size: var(--fs-ui); }
.banner span { display: flex; align-items: center; gap: 10px; }
.banner.info { background: var(--accent-tint); border-color: var(--accent-tint); color: var(--accent); }
.banner.good { background: var(--good-bg); border-color: var(--good-bg); color: var(--good); }
.banner.warn { background: var(--warn-bg); border-color: var(--warn-bg); color: var(--warn); }
.banner.mny-err, .banner.bad { background: var(--miss-bg); border-color: var(--miss-bg); color: var(--bad); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex: none; }

/* Štítek stavu: text na jemném podkladu, význam nese slovo, barva ho jen doprovází. */
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 24px; max-width: 100%; padding: 4px 8px; border-radius: var(--r-s); font-size: var(--fs-small); font-weight: 600; line-height: 16px; white-space: nowrap; border: 0; background: var(--paper-2); color: var(--ink); }
.chip.good { color: var(--good); background: var(--good-bg); } .chip.bad { color: var(--bad); background: var(--miss-bg); }
.chip.warn { color: var(--warn); background: var(--warn-bg); }
.chip.info { color: var(--accent); background: var(--accent-tint); }

/* ---------- komentář ---------- */
.note { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--gap-sec); align-content: space-between; }
.note-main { display: grid; gap: 16px; }
.note-body { display: grid; gap: 12px; font-size: var(--fs-body); line-height: 1.5; max-width: 72ch; }
.muted-d { color: var(--muted); }
.note-sign { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 12px; align-items: center; }
.note-sign > img { width: 52px; height: 52px; object-fit: cover; border-radius: 50%; }
.note-sign div { display: grid; }
.sig { height: 40px; width: auto; justify-self: start; margin-bottom: 4px; }
.note-sign span { color: var(--muted); font-size: var(--fs-small); }

/* ---------- sekce a karty ---------- */
.sec { font: 700 var(--fs-sec)/1.25 var(--font-head); letter-spacing: -.035em; }
.sec-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 8px; }
.page-h, .ov-h { display: grid; gap: var(--s-3); }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--gap-cards); }
.kpis.k2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.kpis.k3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.kpis.k5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.kpi { background: var(--white); border: 1px solid var(--line); border-radius: var(--r-l); padding: var(--s-6); display: grid; gap: 6px; align-content: start; min-width: 0; text-align: left; }
.kpi > span { font-size: var(--fs-ui); font-weight: 500; color: var(--muted); }
.kpi > b { font-size: var(--fs-num); line-height: 1.15; letter-spacing: -.025em; font-weight: 700; overflow-wrap: normal; }
.kpi > small { color: var(--muted); font-size: var(--fs-small); }
.kpi > small.good { color: var(--good); font-weight: 600; } .kpi > small.bad { color: var(--bad); font-weight: 600; }
.tile { font: inherit; transition: border-color var(--t-fast), transform var(--t-fast); }
.tile:hover { border-color: var(--line-strong); transform: translateY(-1px); }
.tile.on { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
/* Přehled: bloky a dvousloupec */
.ov-h > .seg { justify-self: start; }
.dash-v { display: grid; justify-items: start; gap: var(--s-2); padding: var(--s-2) 0 var(--s-1); }
/* Stav nese štítek s ikonou a slovem, věta pod ním říká to nejdůležitější. */
.dv-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 8px; border-radius: var(--r-pill); font-size: var(--fs-small); font-weight: 700; letter-spacing: .01em; background: var(--paper); color: var(--ink); }
.dv-ic { width: 15px; height: 15px; }
.dash-v.bad .dv-chip { background: var(--miss-bg); color: var(--bad); } .dash-v.warn .dv-chip { background: var(--warn-bg); color: var(--warn); } .dash-v.good .dv-chip { background: var(--good-bg); color: var(--good); }
.dash-v p { margin: 0; max-width: 30ch; font-family: var(--font-head); font-size: clamp(24px, 2.6vw, 34px); font-weight: 700; line-height: 1.15; letter-spacing: -.03em; text-wrap: balance; }
.dash-v small { color: var(--muted); font-size: var(--fs-small); }
.sum-l { list-style: none; margin: var(--s-2) 0 0; padding: 0; display: grid; }
.sum-l li { display: flex; justify-content: space-between; gap: var(--s-3); padding: 8px 0; border-top: 1px solid var(--line); font-size: var(--fs-ui); }
.sum-l li:first-child { border-top: 0; }
.sum-l b { font-weight: 500; white-space: nowrap; font-variant-numeric: tabular-nums; }
.sum-l .t { border-top: 1px solid var(--ink); font-weight: 600; }
.sum-l .t b { font-weight: 600; }
.dash-k { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--gap-cards); }
.dash-t { gap: 6px; padding: var(--s-4); cursor: pointer; }
.dash-t > b { font-size: clamp(24px, 2.2vw, 32px); font-weight: 700; letter-spacing: -.025em; overflow-wrap: normal; }
.np { white-space: nowrap; }
.dash-t > b.bad { color: var(--bad); }
.dash-t > small { font-size: var(--fs-small); }
.dash-t > small.bad { color: var(--bad); font-weight: 600; }
/* Hlavní částka přehledu: kobaltová karta, varování na ní nese text, ne barva. */
.dash-t.hero { background: var(--accent); border-color: var(--accent); color: var(--white); }
.dash-t.hero > span, .dash-t.hero > small { color: var(--on-dark-muted); }
.dash-t.hero > b, .dash-t.hero > b.bad { color: var(--white); }
.dash-t.hero > small.bad { color: var(--white); font-weight: 700; }
.dash-t.hero:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.dash-t.hero.on { border-color: var(--accent-hover); box-shadow: inset 0 0 0 2px var(--white); }
.dash-s { margin: 2px 0 var(--s-3); color: var(--muted); font-size: var(--fs-ui); }
.dash-s b { color: var(--ink); font-weight: 600; }
.d-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: var(--gap-cards); }
.d-row.wide-l { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1180px) { .d-row.wide-l { grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); } }
.d-row > * { min-width: 0; }
.d-row .card { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s-3); align-content: start; }
.plan-b { display: flex; align-items: flex-end; gap: 6px; height: 170px; }
.plan-b > div { flex: 1; min-width: 0; min-height: 66px; padding: 10px; border-radius: var(--r-s) var(--r-s) 0 0; font-size: var(--fs-small); }
.plan-b b { display: block; font: 700 22px/1.1 var(--font-head); letter-spacing: -.025em; }
.plan-p { background: var(--block-grey); }
.plan-a { background: var(--ink); color: #fff; }
.plan-l { display: grid; gap: 8px; margin: 0; }
.plan-l > div { display: flex; justify-content: space-between; gap: 12px; font-size: var(--fs-ui); }
.plan-l dd { margin: 0; font-weight: 600; white-space: nowrap; }
.doc-l { display: grid; }
.doc-l button { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 12px; min-height: 44px; padding: 7px 0; border: 0; border-top: 1px solid var(--line); background: none; text-align: left; font-size: var(--fs-ui); cursor: pointer; }
.doc-l button:first-child { border-top: 0; }
.doc-l .chip { max-width: 100%; }
.doc-l button:hover b { color: var(--accent); }
.doc-l b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-l em { font-style: normal; font-weight: 600; white-space: nowrap; }
.g2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap-cards); }
.card { background: var(--white); border: 1px solid var(--line); border-radius: var(--r-l); padding: var(--s-6); min-width: 0; }
.card.flush { padding: 0; overflow: hidden; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: var(--fs-small); color: var(--muted); margin-bottom: 8px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.sw { display: inline-block; width: 12px; height: 12px; border-radius: 3px; background: var(--c); }
.sw.dash { height: 0; width: 16px; border-radius: 0; background: none; border-top: 2px dashed var(--c); }
.chart { width: 100%; min-width: 0; }
.chart svg { display: block; max-width: 100%; }
.ct { font: 500 12px var(--font); fill: var(--muted); }
.ct.on { fill: var(--ink); font-weight: 700; }
.ct.ref { fill: var(--ink); font-weight: 600; }
.cv { font: 700 12px var(--font); fill: var(--ink); paint-order: stroke; stroke: var(--white); stroke-width: 3px; stroke-linejoin: round; }
.hit { outline: none; }
.hit .xh { opacity: 0; transition: opacity var(--t-fast); }
.hit:hover .xh, .hit:focus .xh { opacity: 1; }
.hit .mark { transition: opacity var(--t-fast); }
.hit:hover .mark, .hit:focus .mark { opacity: .78; }
.minis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.mini { display: grid; grid-template-columns: minmax(0, 1fr); align-content: space-between; gap: 4px; }
.mini-h { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; font-size: var(--fs-small); color: var(--muted); }
.mini-h b { color: var(--ink); font-size: var(--fs-small); white-space: nowrap; }
.dt { margin-top: 8px; font-size: var(--fs-small); }
.dt summary { display: flex; align-items: center; gap: 8px; width: fit-content; color: var(--muted); cursor: pointer; font-weight: 500; padding: 4px 0; }
.dt summary:hover { color: var(--ink); }
.dt table { width: 100%; border-collapse: collapse; margin-top: 6px; }
.dt th, .dt td { text-align: left; padding: 5px 8px 5px 0; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tw { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.hb { display: grid; gap: 14px; }
.hb-row { display: grid; gap: 5px; }
.hb-top { display: flex; justify-content: space-between; gap: 10px; font-size: var(--fs-ui); }
.hb-track { position: relative; height: 12px; }
.hb-bar { height: 100%; background: var(--field-line); border-radius: var(--r-pill); min-width: 2px; }
.hb-bar.hot { background: var(--accent); }
.hb-plan { position: absolute; top: -3px; bottom: -3px; width: 3px; margin-left: -1.5px; background: var(--ink); border-radius: var(--r-pill); }
.hb-row small { color: var(--muted); }
.tbl { width: 100%; border-collapse: collapse; font-size: var(--fs-ui); line-height: 20px; }
.tbl th { text-align: left; font-size: var(--fs-ui); font-weight: 500; color: var(--muted); padding: var(--s-3) var(--s-4); border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { height: 48px; padding: var(--s-3) var(--s-4); border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl .r { font-variant-numeric: tabular-nums; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl td small { display: block; color: var(--muted); }
.tbl .r { text-align: right; white-space: nowrap; }
.tbl .sigs .chip { margin: 1px 4px 1px 0; }
.sheet td, .sheet th { white-space: nowrap; font-variant-numeric: tabular-nums; }
/* Výkazy: v okně je vždy celý počet sloupců a posun se zastaví na hraně sloupce, takže první sloupec nikdy nepřekryje část čísla. */
.tw:has(> .sheet) { container-type: inline-size; scroll-snap-type: x mandatory; }
.sheet { --sticky: 130px; --k: 2; }
.sheet .st2 { position: sticky; left: 0; z-index: 2; width: var(--sticky); min-width: var(--sticky); max-width: var(--sticky); white-space: normal; background: var(--white); box-shadow: 1px 0 0 var(--line-strong); }
.sheet .r { width: calc((100cqw - var(--sticky)) / var(--k)); min-width: calc((100cqw - var(--sticky)) / var(--k)); padding-inline: 8px var(--s-4); }
.sheet thead .r { scroll-snap-align: start; scroll-margin-left: var(--sticky); }
@container (min-width: 478px) { .sheet { --k: 3; } }
@container (min-width: 560px) { .sheet { --sticky: 170px; } }
@container (min-width: 640px) { .sheet { --k: 4; } }
@container (min-width: 750px) { .sheet { --k: 5; } }
@container (min-width: 866px) { .sheet { --k: 6; } }
@container (min-width: 982px) { .sheet { --k: 7; } }
@container (min-width: 1098px) { .sheet { --k: 8; } }
@container (min-width: 1214px) { .sheet { --k: 9; } }
.sheet .cur { background: var(--accent-tint); font-weight: 600; }
.sheet .strong td { font-weight: 700; border-top: 1px solid var(--line-strong); }
.dl { list-style: none; padding: 0; margin: 0; display: grid; gap: 2px; }
.dl li { display: grid; grid-template-columns: 62px minmax(0, 1fr) auto; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--line); align-items: baseline; }
.dl time { color: var(--accent); font-weight: 700; }
.fine { color: var(--muted); font-size: var(--fs-small); margin-top: 10px; }

/* ---------- rozhodnutí ---------- */
.sim { display: grid; grid-template-columns: 330px minmax(0, 1fr); gap: var(--gap-cards); align-items: start; }
.sim-c { display: grid; gap: 16px; }
.sl { display: grid; gap: 8px; }
.sl span { display: flex; justify-content: space-between; gap: 8px; font-size: var(--fs-ui); font-weight: 500; }
.sl input { --fill: var(--accent); --rest: rgb(24 24 27 / .2); --bar: 6px; -webkit-appearance: none; appearance: none; display: block; width: 100%; height: 44px; margin: 0; padding-block: 11px; overflow: hidden; background: none; border-radius: var(--r-pill); cursor: pointer; }
.sl input::-webkit-slider-runnable-track { height: 22px; background: none; }
.sl input::-moz-range-track { height: 22px; background: none; }
.sl input::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 22px; height: 22px; border-radius: 50%; background: var(--ink); box-shadow: inset 0 0 0 2px var(--ink), inset 0 0 0 4px var(--white); border-image: linear-gradient(90deg, var(--fill) 50%, var(--rest) 0) 0 1 / calc(50% - var(--bar) / 2) 100vw / 0 100vw; }
.sl input::-moz-range-thumb { width: 22px; height: 22px; box-sizing: border-box; border: 0; border-radius: 50%; background: var(--ink); box-shadow: inset 0 0 0 2px var(--ink), inset 0 0 0 4px var(--white); border-image: linear-gradient(90deg, var(--fill) 50%, var(--rest) 0) 0 1 / calc(50% - var(--bar) / 2) 100vw / 0 100vw; }
.sl input:hover::-webkit-slider-thumb { background: var(--accent); }
.sl input:hover::-moz-range-thumb { background: var(--accent); }
.sl input:focus-visible { outline: 3px solid var(--focus); outline-offset: 0; }
.sim-r { display: grid; gap: 12px; }


/* ---------- tým ---------- */
.steps { list-style: none; display: flex; gap: 6px; flex-wrap: wrap; padding: 0; margin: 0; }
.steps li { display: flex; align-items: center; gap: 8px; padding: 6px 14px 6px 7px; border-radius: var(--r-pill); background: var(--white); border: 1px solid var(--line); color: var(--muted); font-weight: 600; font-size: var(--fs-small); }
.steps i { font-style: normal; width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; background: var(--paper-2); font-size: 12px; }
.steps .now { background: var(--ink); color: var(--white); border-color: var(--ink); }
.steps .now i { background: var(--accent); color: #fff; }
.steps .done { color: var(--ink); }
.steps .done i { background: var(--ink); color: var(--white); }
.ed { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: var(--gap-cards); align-items: start; }
.ed-l { display: grid; gap: var(--gap-cards); grid-template-columns: minmax(0, 1fr); container: ed / inline-size; }
.ed-r { display: grid; gap: 10px; grid-template-columns: minmax(0, 1fr); min-width: 0; position: sticky; top: calc(var(--bar-h) + 16px); }
.checks { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 8px; }
.checks li { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: var(--fs-ui); }
.sig-row { display: flex; gap: 6px; flex-wrap: wrap; padding-top: 12px; border-top: 1px solid var(--line); }
textarea { width: 100%; padding: var(--s-3); border: 1px solid var(--field-line); border-radius: var(--r-s); background: var(--white); resize: vertical; line-height: 1.5; }
.ed-tools { display: flex; gap: 10px; align-items: center; margin-top: 10px; flex-wrap: wrap; }
.ed-tools small { color: var(--muted); flex: 1; min-width: 180px; }
.ed-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.preview { display: grid; gap: var(--s-3); padding: var(--s-4); border: 1px solid var(--line-strong); border-radius: var(--r-l); background: var(--paper); }
.preview .note-body { font-size: var(--fs-body); }
.preview .note-sign { grid-template-columns: 52px 1fr; align-items: center; }
.preview .note-sign > img { width: 52px; height: 52px; }
.preview .sig { height: 30px; }
.preview .kpi > b { font-size: 18px; }

/* ---------- daně ---------- */
.ladder { width: 100%; border-collapse: collapse; font-size: var(--fs-ui); font-variant-numeric: tabular-nums; }
.ladder td { padding: 9px 0; border-bottom: 1px solid var(--line); }
.ladder td:last-child { text-align: right; white-space: nowrap; font-weight: 500; }
.ladder .sub td { font-weight: 700; border-top: 1px solid var(--line-strong); }
.ladder tr:last-child td { border-bottom: 0; }
.ladder .tot td { font-weight: 700; font-size: var(--fs-body); background: var(--accent-tint); padding-inline: var(--s-2); }
.opt { display: grid; gap: 12px; margin-top: 8px; }
.opt-l { color: var(--muted); margin-top: -6px; }
.opt-g { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: var(--gap-cards); }
.opt-g.one { grid-template-columns: minmax(0, 1fr); gap: 8px; }
.opt-i { display: flex; gap: var(--s-3); align-items: flex-start; padding: var(--s-4); min-height: 44px; background: var(--white); border: 1px solid var(--line); border-radius: var(--r-l); cursor: pointer; transition: border-color var(--t-fast); }
.opt-i:hover { border-color: var(--line-strong); }
.opt-i.on { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.opt-i div { display: grid; gap: 5px; }
.opt-i b { letter-spacing: -.02em; font-size: var(--fs-body); }
.opt-i span { color: var(--muted); font-size: var(--fs-ui); }
.opt-i small { font-size: var(--fs-small); font-weight: 600; color: var(--accent); }
.opt-r { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-3); padding: var(--s-4); border-radius: var(--r-l); background: var(--paper-2); }
.opt-r.muted { display: block; }
.opt-r div { display: grid; gap: 2px; min-width: 0; }
.opt-r span { font-size: var(--fs-small); color: var(--muted); font-weight: 600; }
.opt-r b { font-size: var(--fs-num); font-weight: 700; letter-spacing: -.025em; overflow-wrap: anywhere; }

/* ---------- rejstřík ---------- */
.fld-g > .wide { grid-column: 1 / -1; min-width: 0; }
#ares-hint:empty { display: none; }
.ares { font-size: var(--fs-ui); color: var(--muted); }
.ares.found { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; color: var(--ink); padding: 10px 12px; background: var(--paper); border-radius: var(--r-s); }
.ares.err { color: var(--bad); font-weight: 500; }

/* ---------- logo a klikací graf ---------- */
.logo-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.logo-prev { max-width: 200px; max-height: 80px; object-fit: contain; padding: 8px; background: #fff; border: 1px solid var(--line); border-radius: var(--r-s); }
.logo-empty { display: grid; place-items: center; width: 140px; height: 72px; color: var(--muted); border: 1px dashed var(--line-strong); border-radius: var(--r-s); font-size: var(--fs-ui); }
.logo-a { display: flex; gap: 8px; flex-wrap: wrap; }
.hit[data-act] { cursor: pointer; }
.hit:focus-visible rect:first-child { fill: var(--accent-tint); stroke: var(--accent); stroke-width: 1.5; }

#inv-send:empty { display: none; }
.send-b { white-space: normal; height: auto; padding-block: 8px; overflow-wrap: anywhere; }
#inv-send .btn { white-space: normal; height: auto; min-height: var(--h-ctl); padding-block: 8px; overflow-wrap: anywhere; }
.sent-to { margin: 0; }

/* ---------- zprávy ---------- */
.msg-card { display: grid; gap: 12px; padding: 16px; }
.msg-who { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.msg-who > div:not(.msg-call) { display: grid; }
.msg-who span { color: var(--muted); font-size: var(--fs-small); }
.msg-call { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.thread { display: flex; flex-direction: column; gap: 8px; min-height: 240px; max-height: 52vh; overflow-y: auto; padding: 6px 2px; }
.thread-e { margin: auto; color: var(--muted); text-align: center; padding: 24px; }
.msg { max-width: min(78%, 560px); padding: 10px 14px; border-radius: var(--r-l); background: var(--paper); align-self: flex-start; border-bottom-left-radius: 4px; }
.msg p { white-space: pre-wrap; overflow-wrap: anywhere; }
.msg small { display: block; margin-top: 3px; color: var(--muted); font-size: var(--fs-small); }
.msg.mine { align-self: flex-end; background: var(--ink); color: var(--white); border-bottom-left-radius: 16px; border-bottom-right-radius: 4px; }
.msg.mine small { color: var(--on-dark-muted); }
.msg-f { display: flex; gap: 8px; align-items: flex-end; }
.msg-f textarea { flex: 1; min-width: 0; resize: none; }
.msg-g { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 16px; align-items: start; }
.msg-l { display: grid; gap: 4px; }
.msg-li { position: relative; display: grid; gap: 2px; padding: 12px 40px 12px 14px; text-align: left; border: 1px solid var(--line); border-radius: var(--r-l); background: var(--white); min-height: 44px; }
.msg-li:hover { border-color: var(--line-strong); }
.msg-li.on { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.msg-li span { color: var(--muted); font-size: var(--fs-small); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.msg-li .badge { position: absolute; right: 12px; top: 12px; }

/* ---------- nastavení a prázdné stavy ---------- */
.tgl { display: flex; align-items: center; gap: 10px; min-height: 44px; font-weight: 500; cursor: pointer; }
.vat-pick { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: var(--gap-cards); }
.vat-pick label { display: flex; align-items: flex-start; gap: 10px; padding: var(--s-4); border: 1px solid var(--line); border-radius: var(--r-l); cursor: pointer; transition: border-color var(--t-fast); }
.vat-pick label.on { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.vat-pick b { display: block; }
.vat-pick small { display: block; margin-top: 2px; color: var(--muted); }
.fld.short { width: calc(50% - 6px); }
.wide-f { width: 100%; }
.empty-c { display: grid; gap: 3px; padding: var(--s-4); background: var(--white); border: 1px solid var(--line); border-radius: var(--r-l); }
.empty-c span { color: var(--muted); }
.fine.pad { padding: 0 var(--s-4) var(--s-3); margin: var(--s-2) 0 0; }

/* ---------- účetní ---------- */
.av { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; flex: none; }
.av-t { display: grid; place-items: center; background: var(--paper-2); color: var(--ink); font-weight: 700; font-size: var(--fs-ui); }
.note-sign .av { width: 52px; height: 52px; }
.note-sign .av-t { font-size: 16px; }
.note-c { display: grid; gap: 2px; margin-top: 6px; }
.note-c a { color: var(--accent); font-weight: 600; font-size: var(--fs-small); text-decoration: none; overflow-wrap: anywhere; }
.note-c a:hover { text-decoration: underline; }
.clients th { white-space: normal; }
select.acc-s { width: auto; max-width: 200px; font-size: var(--fs-ui); }
.preview .note-sign .av { width: 52px; height: 52px; }

/* ---------- přehlednost ---------- */
.empty { padding: var(--s-4) !important; color: var(--muted); }
.photo { display: none; }

.ic { width: 20px; height: 20px; flex: none; }
.ic-xs { width: 14px; height: 14px; }
.btn .ic { width: 18px; height: 18px; margin-left: -2px; }
.miss-bar .ic { width: 20px; height: 20px; }
.drawer-x .ic { width: 20px; height: 20px; }
.lead { color: var(--muted); }
.ev-tabs { margin-bottom: 14px; }
.more-d { border: 1px solid var(--line); border-radius: var(--r-l); background: var(--white); }
.more-d > summary { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); padding: var(--s-3) var(--s-4); cursor: pointer; font-weight: 600; min-height: 48px; }
.more-d > summary:hover { color: var(--accent); }
.more-b { display: grid; gap: var(--gap-cards); padding: var(--s-1) var(--s-4) var(--s-4); }
.more-b .card { border: 1px solid var(--line); }
.more-d.in { margin-top: var(--s-3); background: none; border-radius: var(--r-s); }
.more-d.in > summary { padding: 0 var(--s-3); min-height: var(--h-ctl); font-size: var(--fs-ui); font-weight: 500; }
.more-d.in .more-b { padding: var(--s-1) var(--s-3) var(--s-3); }
.row-open { cursor: pointer; }
.row-open:focus-visible { outline: 3px solid var(--focus); outline-offset: -3px; }
.row-open:hover td { background: var(--paper); }
.row-miss.row-open:hover td { background: var(--miss-hover); }
.link-row { display: flex; gap: 14px; flex-wrap: wrap; margin: 0 0 12px; }

/* ---------- chybějící doklady a upozornění ---------- */
.miss-bar { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); flex-wrap: wrap; padding: var(--s-3) var(--s-4); background: var(--miss-bg); border-radius: var(--r-l); color: var(--bad); font-weight: 600; font-size: var(--fs-ui); }
.miss-bar span { display: flex; align-items: center; gap: 10px; }
.badge { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; margin-left: auto; padding: 0 6px; border-radius: var(--r-pill); background: var(--bad); color: #fff; font-size: 12px; font-weight: 700; font-style: normal; line-height: 1; font-variant-numeric: lining-nums tabular-nums; }
.tabs .badge { margin-left: 4px; min-width: 16px; height: 16px; font-size: 10.5px; padding: 0 4px; }
.row-miss td { background: var(--miss-bg); }
.row-miss td:first-child { box-shadow: inset 4px 0 0 var(--bad); }
.link.danger, .danger-b { color: var(--bad); }
.danger-b { border-color: var(--bad); }
.del-acc { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); }
.del-acc summary { display: inline-flex; align-items: center; min-height: 44px; color: var(--bad); font-weight: 600; cursor: pointer; }
.del-acc[open] summary { margin-bottom: 4px; }
.del-acc .fld { margin: 12px 0; max-width: 360px; }
.bell { position: relative; order: 4; color: var(--ink); }
.bell-b { position: relative; display: grid; place-items: center; width: var(--h-ctl); height: var(--h-ctl); border-radius: var(--r-s); border: 1px solid var(--line); background: var(--white); }
.bell-b:hover { background: var(--paper); }
.bell-b em { position: absolute; top: -5px; right: -5px; min-width: 19px; height: 19px; padding: 0 4px; display: grid; place-items: center; border-radius: var(--r-pill); background: var(--bad); color: #fff; font-size: 11px; font-weight: 700; font-style: normal; }
.bell-bg { position: fixed; inset: 0; z-index: 20; }
.bell-p { position: absolute; right: 0; top: calc(100% + 8px); z-index: 21; width: min(360px, calc(100vw - 32px)); max-height: 60vh; overflow-y: auto; display: grid; gap: var(--s-1); padding: var(--s-4); background: var(--white); border-radius: var(--r-l); box-shadow: 0 8px 24px rgb(24 24 27 / .18); }
.bell-p .card-t { margin-bottom: var(--s-2); }
.bell-i { display: grid; gap: 2px; padding: 10px 12px; border: 0; border-radius: var(--r-s); background: none; text-align: left; font-size: var(--fs-ui); }
.bell-i:hover { background: var(--paper); }
.bell-i.new { background: var(--accent-tint); }
.bell-i span { color: var(--muted); }
.bell-i small { color: var(--muted); }

.page-h-a { grid-template-columns: minmax(0, 1fr) auto; align-items: end; }
.page-h-a > div { display: grid; gap: 10px; }
.card-t.pad { margin: var(--s-4) var(--s-4) var(--s-3); }

/* ---------- vystavení faktury ---------- */
.fld-g { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.fld-g.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.fld { display: grid; grid-template-rows: 1fr auto; gap: 5px; min-width: 0; font-size: var(--fs-small); font-weight: 500; color: var(--muted); }
.fld > span { align-self: end; overflow-wrap: anywhere; }
.fld.wide { grid-column: 1 / -1; }
.fld.inv-note-f { margin-top: 14px; }
.fld input, .fld select, .filters input, .filters select, .mp select, .acc-s { width: 100%; min-width: 0; height: var(--h-ctl); padding: 0 var(--s-3); border: 1px solid var(--field-line); border-radius: var(--r-s); background-color: var(--white); font-size: var(--fs-body); font-weight: 400; color: var(--ink); }
.inv-rows { display: grid; gap: 12px; margin-bottom: 12px; }
.inv-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; align-items: end; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.inv-row .fld.grow { grid-column: 1 / -1; }
@container ed (max-width: 620px) { .inv-row { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.inv-x { grid-column: 1 / -1; justify-self: end; padding: 2px; }
.sheet-inv { position: relative; overflow: clip; display: flex; flex-direction: column; gap: 16px; aspect-ratio: 210 / 297; width: 100%; padding: 7%; background: #fff; border: 1px solid var(--line); font-size: 13.5px; }
.sheet-inv .wm { position: absolute; right: -18px; bottom: 36px; font: 700 64px var(--font-head); letter-spacing: .04em; color: rgb(17 24 32 / .05); transform: rotate(-16deg); pointer-events: none; }
.sheet-inv header { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding-bottom: 12px; border-bottom: 2px solid var(--ink); }
.inv-title { margin-left: auto; text-align: right; }
.inv-logo { max-width: 45%; max-height: 64px; object-fit: contain; }
.sheet-inv header small { color: var(--muted); }
.sheet-inv h4, .sheet-doc h4, .sheet-inv .inv-sum .sum td { font-family: var(--font-head); letter-spacing: -.025em; }
.sheet-inv h4 { font-size: 20px; overflow-wrap: anywhere; }
.sheet-inv dt { font-size: 13px; font-weight: 600; color: var(--muted); }
.sheet-inv dd { margin: 2px 0 0; overflow-wrap: anywhere; }
.inv-parties { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.inv-dates { display: flex; flex-wrap: wrap; gap: 10px 22px; }
.inv-items, .inv-sum { width: 100%; border-collapse: collapse; }
.inv-items th { text-align: left; font-size: 11px; color: var(--muted); padding: 6px 8px 6px 0; border-bottom: 1px solid var(--line-strong); white-space: nowrap; }
.inv-items td { padding: 7px 8px 7px 0; border-bottom: 1px solid var(--line); overflow-wrap: break-word; }
.inv-items .r { text-align: right; white-space: nowrap; }
.inv-sum { width: min(300px, 100%); align-self: flex-end; font-variant-numeric: tabular-nums; }
.inv-sum td { padding: 4px 0; }
.inv-sum td:last-child { text-align: right; white-space: nowrap; }
.inv-sum .sum td { padding-top: 8px; border-top: 2px solid var(--ink); font-weight: 700; font-size: 16px; }
.fld-bad { display: block; color: var(--bad); font-size: var(--fs-small); font-weight: 500; }
.fld input[aria-invalid="true"], .fld select[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--bad); box-shadow: inset 0 0 0 1px var(--bad); }
.fld-bad:empty { display: none; }
.inv-note { color: var(--muted); }
.inv-foot { margin-top: auto; padding-top: 8px; border-top: 1px solid var(--line); font-size: 11px; color: var(--muted); }

/* ---------- doklady ---------- */
body.locked { overflow: hidden; }
.vh { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
label.btn { cursor: pointer; position: relative; }
label.btn:focus-within { outline: 3px solid var(--focus); outline-offset: 2px; }
.drop { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; padding: var(--s-4); border: 1.5px dashed var(--line-strong); border-radius: var(--r-l); background: var(--white); transition: border-color var(--t-fast), background-color var(--t-fast); }
.drop.over { border-color: var(--accent); background: var(--accent-tint); }
.drop > div:first-child { display: grid; }
.drop small { color: var(--muted); }
.drop-a, .need-a { display: flex; gap: 8px; flex-wrap: wrap; }
.need { display: grid; gap: var(--s-3); padding: var(--s-4); border-radius: var(--r-l); background: var(--miss-bg); border: 1px solid var(--bad); }
.need .sec { color: var(--bad); }
.need-h p { color: var(--ink); margin-top: 2px; }
.need ul { list-style: none; margin: 0; padding: 0; display: grid; }
.need li { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 11px 0; border-top: 1px solid rgb(180 35 50 / .25); }
.need li > div:first-child { display: grid; min-width: 0; }
.need small { color: var(--muted); }
.filters { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.filters input { flex: 3 1 260px; width: auto; }
.filters select { flex: 1 1 130px; width: auto; max-width: 100%; }
.filters select:disabled { opacity: .55; }
.mp select { width: auto; }
.mp select, .filters select, .fld select, .acc-s { appearance: none; -webkit-appearance: none; padding-right: 34px; background-image: url("../assets/chevron.svg"); background-repeat: no-repeat; background-position: right 13px center; background-size: 12px 12px; cursor: pointer; }
.count { color: var(--muted); font-size: var(--fs-small); font-weight: 600; margin: 0; }
.count .link { margin-left: var(--s-2); padding-block: 0; }
.more-btn { justify-self: center; }
.docs .dc-act { white-space: nowrap; }
.docs.team .dc-act { white-space: normal; min-width: 170px; }
.docs td[data-l="Datum"], .docs td[data-l="Splatnost"], .docs .dc-main b { white-space: nowrap; }
.drawer-bg { position: fixed; inset: 0; z-index: 40; background: rgb(17 24 32 / .42); }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; z-index: 41; width: min(880px, 100vw); display: flex; flex-direction: column; background: var(--paper); animation: slide var(--t-modal) var(--ease); }
@keyframes slide { from { transform: translateX(32px); opacity: 0; } to { transform: none; opacity: 1; } }
.drawer-h { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s-3); padding: var(--s-4) 22px; border-bottom: 1px solid var(--line); background: var(--white); }
.drawer-h h2 { font-size: var(--fs-sec); margin-top: var(--s-2); overflow-wrap: anywhere; }
.drawer-x { display: grid; place-items: center; width: var(--h-ctl); height: var(--h-ctl); flex: none; border-radius: 50%; border: 1px solid var(--line-strong); background: var(--white); }
.drawer-x:hover { background: var(--paper); }
.drawer-b { flex: 1; min-height: 0; overflow-y: auto; display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 18px; padding: 20px 22px; align-items: start; }
.dv { min-width: 0; }
.dv-img { width: 100%; border-radius: var(--r-s); display: block; }
.dv-pdf { width: 100%; height: 70vh; border: 1px solid var(--line); border-radius: var(--r-s); background: #fff; }
.dv-none { display: grid; gap: 8px; padding: 28px; border: 1px dashed var(--line-strong); border-radius: var(--r-l); }
.sheet-doc { position: relative; overflow: hidden; display: grid; gap: 20px; align-content: start; min-height: 480px; padding: 28px; background: #fff; border: 1px solid var(--line); }
.sheet-doc .wm { position: absolute; right: -18px; bottom: 56px; font: 700 64px var(--font-head); letter-spacing: .04em; color: rgb(17 24 32 / .05); transform: rotate(-16deg); pointer-events: none; }
.sheet-doc header { display: flex; justify-content: space-between; gap: 12px; padding-bottom: 14px; border-bottom: 2px solid var(--ink); }
.sheet-doc header small { color: var(--muted); }
.sheet-doc h4 { font-size: 20px; overflow-wrap: anywhere; }
.sheet-doc dl, .dm dl { margin: 0; display: grid; gap: 10px; }
.sheet-doc dt, .dm dt { font-size: 13px; font-weight: 600; color: var(--muted); }
.sheet-doc dd, .dm dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }
.sheet-doc table { width: 100%; border-collapse: collapse; }
.sheet-doc td { padding: 8px 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.sheet-doc td:last-child { text-align: right; }
.sheet-doc .sum td { font-weight: 700; border-bottom: 0; }
.dm { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; justify-items: start; min-width: 0; }
.dm > * { max-width: 100%; }
.dm .btn { white-space: normal; height: auto; padding-block: 8px; text-align: center; overflow-wrap: anywhere; }

.tip { position: fixed; z-index: 60; pointer-events: none; padding: 8px 11px; background: var(--ink); color: var(--white); border-radius: var(--r-s); font-size: var(--fs-small); line-height: 1.4; white-space: pre-line; max-width: 260px; }
.toast { position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%); z-index: 60; width: min(440px, calc(100vw - 32px)); padding: var(--s-3) var(--s-4); border-radius: var(--r-l); background: var(--ink); color: var(--white); font-size: var(--fs-ui); text-align: center; }

/* Tenké posuvníky: v Chrome a Safari zabírají vlastní místo, takže nepřekryjí poslední řádek. */
@supports selector(::-webkit-scrollbar) {
  .msg-l::-webkit-scrollbar, .tw::-webkit-scrollbar, .drawer-b::-webkit-scrollbar { width: 6px; height: 6px; }
  .msg-l::-webkit-scrollbar-track, .tw::-webkit-scrollbar-track, .drawer-b::-webkit-scrollbar-track { background: transparent; }
  .msg-l::-webkit-scrollbar-thumb, .tw::-webkit-scrollbar-thumb, .drawer-b::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: var(--r-pill); }
}
@supports not selector(::-webkit-scrollbar) {
  .msg-l, .tw, .drawer-b { scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
  .tw:has(> .sheet) { padding-bottom: 10px; }
}

@media (max-width: 1180px) {
  .kpis.k5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .minis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ed { grid-template-columns: minmax(0, 1fr); }
  .ed-r { position: static; }
  .sim { grid-template-columns: minmax(0, 1fr); }
  /* Tabulky jako karty. Týmové mají sedm sloupců, proto se skládají už tady, klientské Doklady až pod 960 px. */
  .docs.team, .docs.team tbody, .clients, .clients tbody, .tbl:has([data-act="tax-edit"]), .tbl:has([data-act="tax-edit"]) tbody { display: block; }
  .docs.team thead, .clients thead, .tbl:has([data-act="tax-edit"]) thead { display: none; }
  .docs.team tr, .clients tr, .tbl:has([data-act="tax-edit"]) tr { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 6px 12px; padding: var(--s-4); border-bottom: 1px solid var(--line); }
  .docs.team tr:last-child, .clients tr:last-child, .tbl:has([data-act="tax-edit"]) tr:last-child { border-bottom: 0; }
  .docs.team td, .clients td, .tbl:has([data-act="tax-edit"]) td { display: block; height: auto; padding: 0; border: 0; min-width: 0; font-size: var(--fs-small); text-align: left !important; white-space: normal; }
  .docs.team td[data-l]::before { content: attr(data-l); display: block; font-size: var(--fs-small); font-weight: 600; color: var(--muted); }
  .docs.team .dc-main, .docs.team .dc-act, .docs.team td[data-l="Klient"] { grid-column: 1 / -1; }
  .docs.team .dc-main { font-size: var(--fs-body); }
  .docs.team tr.row-miss { background: var(--miss-bg); }
  .docs.team tr.row-miss td { background: none; box-shadow: none; }
  .clients td:not(:first-child):not(:last-child)::before, .tbl:has([data-act="tax-edit"]) td:not(:first-child):not(:last-child)::before { display: block; margin-bottom: 2px; font-size: var(--fs-small); font-weight: 600; color: var(--muted); }
  .clients td:first-child, .tbl:has([data-act="tax-edit"]) td:first-child { grid-column: 1 / -1; font-size: var(--fs-body); }
  .clients td:nth-child(2), .clients td:nth-child(5), .clients td:last-child, .tbl:has([data-act="tax-edit"]) td:last-child { grid-column: 1 / -1; }
  .clients td:nth-child(2)::before { content: "Účetní"; }
  .clients td:nth-child(3)::before { content: "Přehled"; }
  .clients td:nth-child(4)::before { content: "Doklady"; }
  .clients td:nth-child(5)::before { content: "Upozornění"; }
  .clients td:nth-child(6)::before { content: "Klient naposledy otevřel"; }
  .tbl:has([data-act="tax-edit"]) td:nth-child(2)::before { content: "Odhad daně"; }
  .tbl:has([data-act="tax-edit"]) td:nth-child(3)::before { content: "Zálohy za rok"; }
  .tbl:has([data-act="tax-edit"]) td:nth-child(4)::before { content: "Doplatek / přeplatek"; }
  .tbl:has([data-act="tax-edit"]) td:nth-child(5)::before { content: "Možná úspora"; }
  .tbl:has([data-act="tax-edit"]) td:nth-child(6)::before { content: "Stav"; }
  .clients .acc-s { width: 100%; max-width: 320px; }
  .clients .chip, .tbl:has([data-act="tax-edit"]) .chip { max-width: 100%; white-space: normal; }
}
@media (min-width: 961px) and (max-width: 1180px) {
  .tbl th, .tbl td { padding-inline: 10px; }
  .tbl th:first-child, .tbl td:first-child { padding-left: var(--s-4); }
  .tbl th:last-child, .tbl td:last-child { padding-right: var(--s-4); }
}
@media (min-width: 761px) and (max-width: 1180px) {
  .clients td:nth-child(2), .clients td:nth-child(5) { grid-column: span 2; }
  .clients td:last-child, .tbl:has([data-act="tax-edit"]) td:last-child { grid-column: auto; align-self: end; }
  .clients td:last-child .btn, .tbl:has([data-act="tax-edit"]) td:last-child .btn { width: 100%; }
}
@media (max-width: 960px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g2 { grid-template-columns: minmax(0, 1fr); }
  :root { --bar-h: 56px; --h-ctl: 44px; --h-ctl-sm: 44px; }
  .demobar { padding-block: 4px; }
  .seg.dk { padding: 0; }
  .seg.dk button, .link, .back, .reset, .nav button, .more-d.in > summary, .dt summary { min-height: 44px; }
  .link, .back, .note-c a { display: inline-flex; align-items: center; min-height: 44px; }
  .msg-g { grid-template-columns: minmax(0, 1fr); }
  .msg-l { grid-auto-flow: column; grid-auto-columns: 220px; overflow-x: auto; padding-bottom: 4px; }
  .fld-g, .fld-g.three { grid-template-columns: minmax(0, 1fr); }
  .inv-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fld.short { width: 100%; }

  /* Klientské tabulky dokladů jako karty. */
  .docs, .docs tbody { display: block; }
  .docs thead { display: none; }
  .docs tr { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 6px 12px; padding: var(--s-4); border-bottom: 1px solid var(--line); }
  .docs tr:last-child { border-bottom: 0; }
  .docs td { display: block; height: auto; padding: 0; border: 0; min-width: 0; font-size: var(--fs-small); text-align: left !important; white-space: normal; }
  .docs td[data-l]::before { content: attr(data-l); display: block; font-size: var(--fs-small); font-weight: 600; color: var(--muted); }
  .docs .dc-main { grid-column: 1 / -1; font-size: var(--fs-body); }
  .docs .dc-act { grid-column: 1 / -1; }
  .docs tr.row-miss { background: var(--miss-bg); }
  .docs tr.row-miss td { background: none; box-shadow: none; }
  /* Klient: doklad jako kompaktní řádek seznamu (číslo a protistrana vlevo, částka a stav vpravo), klepnutí otevře detail. */
  .docs.arch tr { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "main amt" "who st" "date st"; gap: 2px 12px; padding: 12px var(--s-4); align-items: center; }
  .docs.arch td[data-l]::before { content: none; }
  .docs.arch .dc-main { grid-area: main; font-size: var(--fs-ui); }
  .docs.arch .dc-main small { display: none; }
  .docs.arch td[data-l="Částka"] { grid-area: amt; font-family: var(--font-head); font-size: var(--fs-ui); font-weight: 700; text-align: right !important; white-space: nowrap; }
  .docs.arch td[data-l="Od koho / komu"] { grid-area: who; color: var(--ink); font-size: var(--fs-small); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .docs.arch td[data-l="Datum"] { grid-area: date; color: var(--muted); }
  .docs.arch td[data-l="Stav"] { grid-area: st; justify-self: end; }
  .docs.arch .dc-act { display: none; }
}
@media (max-width: 760px) {
  .doc-l button { grid-template-columns: minmax(0, 1fr) auto; }
  .doc-l .chip { grid-row: 2; }
  .doc-l em { grid-row: 1 / span 2; grid-column: 2; }
  .side { flex-wrap: nowrap; justify-content: space-between; padding: 12px 16px 0; }
  .side .nav { display: none; }
  .brand { flex: 1 1 0; max-width: none; }
  /* Dlouhý název kanceláře se na mobilu zalomí až na tři řádky místo ořezu. */
  .brand-o { font-size: 13px; white-space: normal; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; line-height: 1.2; }
  .bell { order: 4; }
  .sync { font-size: 0; gap: 0; }
  .main { padding: 14px 16px 100px; gap: 16px; }
  .toolbar { justify-content: space-between; }
  .mp span { display: none; }
  .btn-pdf { display: none; }
  .dash-k { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-t { padding: var(--s-3); }
  .dash-t > b { font-size: 20px; }
  .hint { margin-left: 0; width: 100%; }
  .demobar { padding: 6px 16px; gap: 6px; --bar-h: auto; position: static; }
  .demo-note { display: none; }
  .tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); background: var(--white); border-top: 1px solid var(--line); padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); }
  .photo { display: inline-flex; }
  .kpis.k3, .kpis.k5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tabs.t4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .msg-call { margin-left: 0; width: 100%; }
  .msg-call .btn { flex: 1; }
  .thread { max-height: 46vh; }
  .msg { max-width: 88%; }
  .page-h-a { grid-template-columns: minmax(0, 1fr); }
  .inv-parties { grid-template-columns: minmax(0, 1fr); }
  .toolbar { justify-content: space-between; }
  .drop { flex-direction: column; align-items: stretch; }
  .drawer-b { grid-template-columns: minmax(0, 1fr); padding: 14px 16px 32px; }
  .drawer-h { padding: 14px 16px; }
  .sheet-doc { min-height: 0; padding: 20px; }
  .tabs button { position: relative; display: grid; justify-items: center; align-content: center; gap: 2px; min-height: 54px; border: 0; background: none; border-radius: var(--r-s); font-size: var(--fs-small); font-weight: 600; color: var(--muted); padding: 2px; }
  .tabs .badge { position: absolute; top: 3px; right: 18%; margin: 0; }
  .sheet-inv { font-size: 12.5px; }
  .inv-items th, .inv-items th.r { white-space: normal; vertical-align: bottom; font-size: 10.5px; padding-right: 5px; line-height: 1.25; }
  .dt th:last-child, .dt td:last-child { padding-right: 0; }
  .inv-items td { padding-right: 4px; font-size: 11px; }
  .clients .acc-s { max-width: none; }
  .clients td:last-child .btn, .tbl:has([data-act="tax-edit"]) td:last-child .btn { width: 100%; }
  .kpis > :last-child:nth-child(odd) { grid-column: 1 / -1; }
  .tabs button.on { background: var(--accent-tint); color: var(--accent); }
  .steps li { font-size: var(--fs-small); }
  .card, .kpi { padding: var(--s-4); }
  .ed-actions .btn { flex: 1 1 100%; }
}
/* ---------- Money S3: poslední synchronizace a kontrola čísel ---------- */
.mny-b { justify-content: flex-start; }
.mny-b details { flex-basis: 100%; }
.mny-b summary { cursor: pointer; font-weight: 500; min-height: 26px; }
.mny-w { margin: var(--s-2) 0 0; padding-left: 18px; display: grid; gap: var(--s-1); font-size: var(--fs-ui); }
.mny-err { color: var(--bad); background: var(--miss-bg); }
.mny-f { margin-top: var(--s-3); }
.mny-f textarea { width: 100%; min-height: 150px; padding: var(--s-3); border: 1px solid var(--field-line); border-radius: var(--r-s); background: var(--white); color: var(--ink); font: var(--fs-small)/1.45 ui-monospace, Menlo, monospace; resize: vertical; }
.mny-a { display: flex; flex-wrap: wrap; gap: var(--s-2); margin-top: var(--s-3); }
.mny-r { display: grid; gap: var(--s-2); justify-items: start; padding: 0 var(--s-4) var(--s-3); }
.mny-h { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-2); padding: var(--s-4) var(--s-4) var(--s-3); }
.mny-h .card-t { margin: 0; }
.mny-t td { border-top: 1px solid var(--line-strong); }
/* Přehled klienta: úkoly jako hlavní karta, živější dlaždice, proužky u rozpadu peněz, odkazy na podrobnosti. */
.todo { display: grid; gap: var(--s-3); padding: var(--s-4); border: 1.5px solid var(--accent); border-radius: var(--r-modal); background: var(--white); box-shadow: 0 10px 28px -12px rgb(41 75 255 / .35); }
.todo-h { display: flex; align-items: center; gap: var(--s-2); }
.todo-h h2 { margin: 0; font-family: var(--font-head); font-size: var(--fs-sec); letter-spacing: -.02em; }
.todo-n { display: grid; place-items: center; min-width: 26px; height: 26px; padding: 0 8px; border-radius: var(--r-pill); background: var(--accent); color: var(--white); font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.todo-l { display: grid; gap: var(--s-2); }
.todo-i { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: var(--s-3); min-height: 56px; padding: var(--s-3); border: 0; border-radius: var(--r-l); background: var(--paper); text-align: left; color: var(--ink); cursor: pointer; transition: background-color var(--t-fast); }
.todo-i:hover { background: var(--accent-tint); }
.todo-i b { display: block; font-size: var(--fs-ui); font-weight: 600; line-height: 1.3; }
.todo-i small { display: block; margin-top: 2px; color: var(--muted); font-size: var(--fs-small); line-height: 1.35; }
.todo-ic { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; }
.todo-ic .ic { width: 18px; height: 18px; }
.todo-i.bad .todo-ic { background: var(--miss-bg); color: var(--bad); } .todo-i.warn .todo-ic { background: var(--warn-bg); color: var(--warn); }
.todo-go { width: 18px; height: 18px; color: var(--muted); }
.todo.ok { grid-template-columns: auto 1fr; align-items: center; border-color: var(--line); box-shadow: none; }
.todo.ok .todo-ic { background: var(--good-bg); color: var(--good); }
.todo.ok h2 { margin: 0; font-size: var(--fs-ui); font-family: var(--font); } .todo.ok p { margin: 0; color: var(--muted); font-size: var(--fs-small); }
.dt-h { display: flex; align-items: center; justify-content: space-between; gap: var(--s-2); font-size: var(--fs-ui); font-weight: 500; color: var(--muted); }
.dt-ic { width: 30px; height: 30px; flex: none; padding: 7px; border-radius: 50%; background: var(--paper); color: var(--ink); }
.dash-t.hero .dt-h { color: var(--on-dark-muted); } .dash-t.hero .dt-ic { background: rgb(255 255 255 / .16); color: var(--white); }
.trend { justify-self: start; display: inline-flex; align-items: center; gap: 4px; margin-top: 2px; padding: 3px 8px 3px 6px; border-radius: var(--r-pill); font-style: normal; font-size: var(--fs-small); font-weight: 600; line-height: 1.3; }
.trend.good { background: var(--good-bg); color: var(--good); } .trend.bad { background: var(--miss-bg); color: var(--bad); }
.tr-ic { width: 13px; height: 13px; flex: none; }
.dash-t.hero .trend { background: rgb(17 24 32 / .22); color: var(--white); }
.stack { display: flex; gap: 2px; height: 12px; margin: var(--s-3) 0 var(--s-2); overflow: hidden; border-radius: var(--r-pill); background: var(--paper-2); }
.stack i, .dot-s { background: var(--line-strong); }
.stack .s-free, .dot-s.s-free { background: var(--accent); } .stack .s-vat, .dot-s.s-vat { background: #9AA6BC; } .stack .s-pay, .dot-s.s-pay { background: #718096; } .stack .s-tax, .dot-s.s-tax { background: #536176; } .stack .s-supp, .dot-s.s-supp { background: var(--bad); }
.dot-s { display: inline-block; width: 8px; height: 8px; margin-right: 8px; border-radius: 50%; vertical-align: 1px; }
.mv-l .mv { display: grid; grid-template-columns: minmax(0, 1fr) auto; row-gap: 6px; }
.mv-b { grid-column: 1 / -1; display: block; height: 4px; border-radius: 2px; }
.mv-b.pos { background: var(--accent); } .mv-b.neg { background: var(--line-strong); }
.dash-more { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--gap-cards); }
.dash-more button { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: var(--s-3); padding: var(--s-4); border: 1px solid var(--line); border-radius: var(--r-l); background: var(--white); text-align: left; color: var(--ink); cursor: pointer; transition: border-color var(--t-fast), background-color var(--t-fast); }
.dash-more button:hover { border-color: var(--accent); background: var(--accent-tint); }
.dash-more b { display: block; font-size: var(--fs-ui); } .dash-more small { display: block; margin-top: 2px; color: var(--muted); font-size: var(--fs-small); }
.dm-ic { width: 38px; height: 38px; padding: 9px; border-radius: var(--r-l); background: var(--accent-tint); color: var(--accent); }
.dm-go { width: 18px; height: 18px; color: var(--muted); }
/* Nastavení: ozubené kolečko v horní liště, karta účetní. */
.gear { order: 4; display: grid; place-items: center; width: var(--h-ctl); height: var(--h-ctl); border: 1px solid var(--line); border-radius: var(--r-s); background: var(--white); color: var(--ink); cursor: pointer; }
.gear:hover, .gear.on { background: var(--paper); }
.gear .ic { width: 19px; height: 19px; }
.set-acc { display: flex; align-items: center; gap: var(--s-3); margin-bottom: var(--s-3); }
.set-acc b { display: block; } .set-acc small { color: var(--muted); font-size: var(--fs-small); }
.set-a { display: flex; flex-wrap: wrap; gap: var(--s-2); }

/* Archiv dokladů: hledání a rok v jedné řadě, měsíce jako vodorovný přepínač, druhy jako štítky s počtem. */
.arch-bar { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--s-2); }
.arch-bar.one { grid-template-columns: minmax(0, 1fr); }
.inv-arch { display: grid; gap: var(--s-3); }
.arch-bar input, .arch-bar select { height: var(--h-ctl); padding: 0 var(--s-3); border: 1px solid var(--field-line); border-radius: var(--r-s); background-color: var(--white); font: inherit; color: var(--ink); min-width: 0; }
.arch-bar select { appearance: none; -webkit-appearance: none; padding-right: 34px; background-image: url("../assets/chevron.svg"); background-repeat: no-repeat; background-position: right 12px center; background-size: 14px; }
.mchips, .tchips { display: flex; gap: var(--s-2); overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none; margin-inline: calc(var(--s-1) * -1); padding: 2px var(--s-1); }
.mchips::-webkit-scrollbar, .tchips::-webkit-scrollbar { display: none; }
.mchip { position: relative; flex: none; display: grid; gap: 1px; min-width: 84px; padding: 8px 14px; border: 1px solid var(--line); border-radius: var(--r-l); background: var(--white); text-align: left; color: var(--ink); cursor: pointer; scroll-snap-align: start; transition: border-color var(--t-fast), background-color var(--t-fast); }
.mchip b { font-size: var(--fs-ui); } .mchip small { color: var(--muted); font-size: var(--fs-small); font-variant-numeric: tabular-nums; }
.mchip:hover { border-color: var(--line-strong); }
.mchip.on { border-color: var(--ink); background: var(--ink); color: var(--white); } .mchip.on small { color: var(--on-dark-muted); }
.mchip-dot { position: absolute; top: 8px; right: 8px; width: 7px; height: 7px; border-radius: 50%; background: var(--bad); }
.tchip { flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 14px; border: 1px solid var(--line); border-radius: var(--r-pill); background: var(--white); font-size: var(--fs-ui); font-weight: 600; color: var(--ink); cursor: pointer; scroll-snap-align: start; }
.tchip span { color: var(--muted); font-weight: 500; font-variant-numeric: tabular-nums; }
.tchip.on { border-color: var(--accent); background: var(--accent-tint); color: var(--accent); } .tchip.on span { color: var(--accent); }
.arch-g { overflow: hidden; }
.arch-gh { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s-3); padding: var(--s-4) var(--s-4) var(--s-2); }
.arch-gh h3 { margin: 0; font-family: var(--font-head); font-size: 17px; letter-spacing: -.015em; }
.arch-gh span { color: var(--muted); font-size: var(--fs-small); font-variant-numeric: tabular-nums; white-space: nowrap; }
.arch-all { display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; min-height: 48px; border: 0; border-top: 1px solid var(--line); background: var(--white); color: var(--accent); font-weight: 600; font-size: var(--fs-ui); cursor: pointer; }
.arch-all:hover { background: var(--accent-tint); }
.arch-all .ic { width: 16px; height: 16px; }

/* Hlavička klienta: firma jako titulek, kancelář a značka drobně pod ní. */
.brand.cl { gap: 0; max-width: 360px; }
.firm-t { display: block; justify-self: start; max-width: 100%; margin: 0; padding: 0 22px 0 0; border: 0; background-color: transparent; color: var(--ink); font-family: var(--font-head); font-size: 20px; font-weight: 700; letter-spacing: -.025em; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
select.firm-t { appearance: none; -webkit-appearance: none; field-sizing: content; min-height: 32px; background-image: url("../assets/chevron.svg"); background-repeat: no-repeat; background-position: right 2px center; background-size: 14px; cursor: pointer; }
.molo { font-family: var(--font-head); font-weight: 700; color: var(--accent); letter-spacing: -.01em; }
.brand.cl .brand-by { line-height: 1.3; white-space: normal; }
@media (max-width: 760px) {
  .dash-more { grid-template-columns: minmax(0, 1fr); }
  .firm-t { font-size: 22px; }
  .side { align-items: flex-start; padding: 12px 16px 10px; }
  .bell-b { border: 0; border-radius: 50%; background: var(--paper); }
  .toolbar .mp select { height: 36px; border: 0; border-radius: var(--r-pill); background-color: var(--paper); font-weight: 600; padding-left: 14px; }
  .todo { padding: var(--s-3); }
  /* Na telefonu má hlavní dlaždice celou šířku, ostatní dvě vedle sebe a poslední zase celou. */
  .dash-t.hero, .dash-k > .dash-t:last-child { grid-column: 1 / -1; }
  .dash-k > .dash-t:not(.hero) .dt-ic { display: none; }
  .dash-t.hero > b { font-size: 34px; letter-spacing: -.035em; }
}

/* Klient: kobaltová hlava obrazovek (směr A z Figmy). Na telefonu nese i firmu a ovládání, na počítači je to karta pod horní lištou.
   Při tisku se nezobrazuje, tisk má původní nadpisy a dlaždice. */
.mhero, .tabs .fab { display: none; }
@media screen {
  body.m-client .main > .page-h, body.m-client .msg-who, body.m-client[data-view="invoices"] .main > .page-h + .kpis,
  body.m-client[data-view="overview"] .toolbar, body.m-client[data-view="overview"] .dash-v, body.m-client[data-view="overview"] .dash-t.hero { display: none; }
  .mhero { display: grid; gap: 0; padding: 28px 32px; border-radius: 28px; background: var(--accent); color: var(--white); }
  .mh-top { display: none; align-items: center; gap: 8px; margin-bottom: 18px; }
  .mh-who { flex: 1; min-width: 0; display: grid; gap: 2px; }
  .mh-who small { color: rgb(255 255 255 / .82); font-size: var(--fs-small); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .mh-who small b { font-family: var(--font-head); font-weight: 700; color: var(--white); }
  .mh-firm { position: relative; justify-self: start; display: inline-flex; align-items: center; max-width: 100%; min-width: 0; }
  .mh-firm b, .mh-firm select { font-family: var(--font); font-size: 17px; font-weight: 700; letter-spacing: -.01em; color: var(--white); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .mh-firm select { appearance: none; -webkit-appearance: none; min-width: 0; max-width: 100%; min-height: 32px; padding: 0 24px 0 0; border: 0; background: none; }
  .mh-firm select option { color: var(--ink); }
  .mh-chev { position: absolute; right: 0; width: 18px; height: 18px; pointer-events: none; color: var(--white); }
  .mh-btn { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 50%; background: rgb(255 255 255 / .14); color: var(--white); cursor: pointer; }
  .mh-btn .ic { width: 20px; height: 20px; }
  .mhero .bell { order: 0; }
  .mhero .bell-b { border: 0; border-radius: 50%; background: rgb(255 255 255 / .14); color: var(--white); }
  .mhero .bell-b:hover { background: rgb(255 255 255 / .22); }
  .mhero .bell-p { color: var(--ink); }
  .mh-label { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: rgb(255 255 255 / .86); font-size: var(--fs-ui); }
  .mh-month { appearance: none; -webkit-appearance: none; min-height: 32px; padding: 0 12px; border: 0; border-radius: var(--r-pill); background: rgb(17 24 32 / .2); color: var(--white); font: inherit; font-weight: 600; cursor: pointer; }
  .mh-month option { color: var(--ink); }
  .mh-print { margin-left: auto; min-height: 32px; padding: 0 14px; border: 0; border-radius: var(--r-pill); background: rgb(255 255 255 / .14); color: var(--white); font: inherit; font-size: var(--fs-small); font-weight: 600; cursor: pointer; }
  .mh-print:hover, .mh-minis button:hover { background: rgb(255 255 255 / .22); }
  html.is-app .mh-print { display: none; }
  .mh-num { margin: 4px 0 0; font-family: var(--font-head); font-size: 44px; font-weight: 700; line-height: 1.1; letter-spacing: -.035em; font-variant-numeric: tabular-nums; }
  .mh-asof { margin-top: 2px; color: rgb(255 255 255 / .86); font-size: var(--fs-small); }
  .mh-num.wait { font-size: 28px; letter-spacing: -.02em; }
  .mh-chip { justify-self: start; display: inline-flex; align-items: center; gap: 6px; margin: 10px 0 16px; padding: 6px 12px 6px 10px; border-radius: var(--r-pill); background: rgb(17 24 32 / .2); font-size: 13px; font-weight: 600; line-height: 1.3; }
  .mh-ic { width: 16px; height: 16px; flex: none; }
  .mh-minis { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  .mh-minis button { display: grid; gap: 2px; padding: 12px 14px; border: 0; border-radius: 14px; background: rgb(255 255 255 / .12); color: var(--white); text-align: left; cursor: pointer; transition: background-color var(--t-fast); }
  .mh-minis small { color: var(--white); font-size: var(--fs-small); }
  .mh-minis b { font-family: var(--font-head); font-size: 20px; font-weight: 700; letter-spacing: -.02em; }
  .mh-title { margin: 0; font-family: var(--font-head); font-size: 30px; line-height: 1.15; letter-spacing: -.03em; color: var(--white); }
  .mh-sub { margin: 4px 0 0; color: rgb(255 255 255 / .86); font-size: var(--fs-ui); }
  .mh-callout { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; margin-top: 16px; padding: 14px; border-radius: 16px; background: rgb(255 255 255 / .12); }
  .mh-callout b { display: block; font-size: var(--fs-ui); } .mh-callout small { display: block; color: var(--white); font-size: var(--fs-small); }
  .mh-white { min-height: 44px; padding: 0 18px; border: 0; border-radius: var(--r-pill); background: var(--white); color: var(--ink); font: inherit; font-weight: 600; cursor: pointer; }
  .mh-white:hover { background: var(--accent-tint); }
  .mh-white.wide { width: 100%; margin-top: 6px; }
  .mhero.v-invoices .mh-title { margin-bottom: 14px; }
  .mh-acc { display: flex; align-items: center; gap: 12px; }
  .mh-acc > span:not(.av) { flex: 1; min-width: 0; }
  .mh-acc small { color: rgb(255 255 255 / .82); font-size: var(--fs-small); }
  .mh-name { margin: 0; font-size: 17px; font-weight: 700; color: var(--white); }
  .mh-av { width: 48px; height: 48px; background: var(--white); color: var(--accent); }
}
@media screen and (min-width: 761px) {
  /* Počítač: firmu, Nastavení a upozornění nese horní lišta, hlava má jen obsah obrazovky. */
  body.m-client[data-view="overview"] .dash-k { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .mhero.v-overview .mh-minis button { padding: 16px 18px; }
  .mhero.v-overview .mh-minis b { font-size: 24px; }
  .mh-num { font-size: 56px; }
  .mh-title { font-size: 34px; }
  .mhero.v-invoices .mh-white.wide { justify-self: start; width: auto; margin-top: 16px; padding: 0 24px; }
  .mhero.v-documents .mh-callout { max-width: 640px; }
  /* Užší obrazovka (tablet): lišta se nesmí zalomit, název firmy se zkrátí a tlačítka navigace jsou těsnější. */
  body.m-client .side { column-gap: 8px; }
  body.m-client .brand.cl { max-width: 180px; }
  .side .nav button { padding: 0 8px; }
}
@media screen and (min-width: 1100px) {
  /* Široká obrazovka: hlavní číslo vlevo, souvislosti vpravo. Na užší by se číslo zalomilo. */
  .mhero.v-overview { grid-template-columns: minmax(0, 1fr) minmax(280px, 420px); column-gap: 40px; align-items: start; }
  .mhero.v-overview > :not(.mh-minis) { grid-column: 1; }
  .mhero.v-overview .mh-minis { grid-column: 2; grid-row: 1 / span 4; align-self: center; grid-template-columns: minmax(0, 1fr); }
  .mhero.v-overview .mh-chip { margin-bottom: 0; }
  .side .nav button { padding: 0 14px; }
  body.m-client .side { column-gap: var(--s-4); }
  body.m-client .brand.cl { max-width: 360px; }
}
@media (max-width: 760px) {
  body.m-client .top { display: none; }
  body.m-client:not(.with-bar)::before { background: var(--accent); }
  body.m-client[data-view="overview"] .dash-k > .dash-t:nth-child(2) { grid-column: auto; }
  .mhero { margin: -14px -16px 0; padding: 12px 20px 22px; border-radius: 0 0 28px 28px; }
  .mh-top { display: flex; }
  .mh-print { display: none; }
  /* Lišta: čtyři záložky a kobaltový fotoaparát uprostřed. */
  .tabs.cam { grid-template-columns: repeat(2, minmax(0, 1fr)) auto repeat(2, minmax(0, 1fr)); align-items: center; }
  .tabs .fab { display: grid; place-items: center; width: 56px; height: 56px; margin: 0 6px; border-radius: 50%; background: var(--accent); color: var(--white); box-shadow: 0 8px 20px -8px rgb(41 75 255 / .7); cursor: pointer; }
  .tabs .fab .ic { width: 26px; height: 26px; }
  .tabs .fab:active { background: var(--accent-hover); }
  .tabs .fab:focus-within { outline: 3px solid var(--focus); outline-offset: 2px; }
}

/* Průvodce po prvním otevření: karta dole na telefonu, uprostřed na počítači. */
.tour { position: fixed; inset: 0; z-index: 80; display: grid; align-items: end; justify-items: center; padding: 16px 16px calc(16px + env(safe-area-inset-bottom)); }
.tour-bg { position: absolute; inset: 0; background: rgb(17 24 32 / .48); }
.tour-card { position: relative; width: min(420px, 100%); padding: var(--s-6); border-radius: var(--r-modal); background: var(--white); animation: tour-in var(--t-modal) var(--ease); }
.tour-card h2 { margin: var(--s-4) 0 var(--s-2); font-family: var(--font-head); font-size: var(--fs-sec); line-height: 1.25; letter-spacing: -.02em; }
.tour-card p { margin: 0; color: var(--muted); }
.tour-art { display: flex; }
.tour-art .tour-ic { width: 52px; height: 52px; padding: 13px; border-radius: 50%; background: var(--accent-tint); color: var(--accent); }
.tour-art .tour-av { width: 52px; height: 52px; font-size: 16px; }
.tour-dots { display: flex; gap: 6px; margin: var(--s-6) 0 var(--s-4); }
.tour-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--line); transition: width var(--t-pop) var(--ease), background-color var(--t-pop); }
.tour-dots i.on { width: 18px; border-radius: 3px; background: var(--accent); }
.tour-a { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-2); }
@keyframes tour-in { from { opacity: 0; transform: translateY(12px); } }
@media (min-width: 761px) { .tour { align-items: center; } }

/* Aplikace pro telefon: obsah nesmí pod výřez displeje a tisk, který webový náhled v telefonu neumí, se skrývá. V prohlížeči je výřez 0. */
body { padding-top: env(safe-area-inset-top); }
body::before { content: ""; position: fixed; inset: 0 0 auto; z-index: 70; height: env(safe-area-inset-top); background: var(--white); }
body.with-bar::before { background: var(--ink); }
.demobar { top: env(safe-area-inset-top); }
.drawer { top: env(safe-area-inset-top); }
.toast { bottom: calc(84px + env(safe-area-inset-bottom)); }
html.is-app .btn-pdf, html.is-app [data-act="print"] { display: none !important; }

@media print {
  @page { size: A4; }
  body.print-doc #root > *:not(.drawer), body.print-doc .drawer-h, body.print-doc .dm { display: none !important; }
  body.print-doc .drawer { position: static; width: auto; animation: none; }
  body.print-doc .drawer-b { display: block; padding: 0; overflow: visible; }
  body.print-doc .sheet-inv { border: 0; }
  .demobar, .side, .tabs, .toolbar, .hint, .btn, .dt, .toast, .tip, .miss-bar, .bell, .top, .dash-more { display: none !important; }
  .layout { display: block; min-height: 0; }
  body { background: #fff; }
  .main { padding: 0; }
  .note, .card, .kpi { break-inside: avoid; }
}
@media (prefers-reduced-motion: reduce) { * { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; } }
