/* =============================================================================
   Arkovia – nové rozhraní správy, směr A „Jasný“ v barvách značky (redesign 2026-11)
   -----------------------------------------------------------------------------
   Zdroj: schválený prototyp redesign_2026-11/06_prototyp/src/10_style.css
   (+ správcovské díly z 11_portaly.css). Načítá ho jen templates/base.html.

   Pravidla souboru:
   * Jeden světlý vzhled. Zlatá je jen akcent značky a navigace (znak, aktivní
     sekce, podtržení záložky), NIKDY neoznačuje stav.
   * Stavy: zelená = potvrzeno/zaplaceno, oranžová = upozornění, červená =
     problém, modrá = informace, čárkovaný obrys = plán, šedá = odloženo/převzato.
   * Stránky zatím stylují i utility Tailwind CDN. Proto tu nejsou globální
     selektory, které by s Tailwindem bojovaly; třída `.grid` se NEdefinuje
     (je to utilita Tailwindu) – mřížky mají vlastní třídy `.g-*`.
   * Globální výchozí hodnoty jen pro písmo, odkazy bez třídy, focus-visible
     a formulářové prvky v hlavním obsahu (#obsah / main form).
   * Pruh pro posouzení prototypu (.rv) sem nepatří; --rv-h je 0.
   ============================================================================= */


/* ─────────────────────────────────────────────────────────────────────────────
   1. Písma (vlastní hosting kvůli GDPR a CSP `font-src 'self'`)
   Geist a Geist Mono jsou proměnná písma (jeden soubor na sadu znaků), Cinzel
   jen řez 600 pro nápis ARKOVIA. Licence SIL OFL 1.1: ../fonts/OFL-*.txt.
   unicode-range = latin a latin-ext přesně podle Google Fonts (7. 11. 2026).
   ───────────────────────────────────────────────────────────────────────────── */
@font-face {
  font-family: "Geist";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("../fonts/geist-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Geist";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("../fonts/geist-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Geist Mono";
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url("../fonts/geist-mono-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Geist Mono";
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url("../fonts/geist-mono-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Cinzel";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/cinzel-600-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Cinzel";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/cinzel-600-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}


/* ─────────────────────────────────────────────────────────────────────────────
   2. Tokeny (jen světlý vzhled). Hodnoty z prototypu, kontrast ověřen
   v 06_prototyp/overeni/kontrast_tokenu.txt (text ≥ 4,5 : 1, prvky ≥ 3 : 1).
   ───────────────────────────────────────────────────────────────────────────── */
:root {
  color-scheme: light;
  /* značka */
  --navy-950: #0b1a33;
  --navy-900: #10223f;
  --navy-850: #142a4c;
  --navy-800: #16305a;
  --navy-700: #1f3d6e;
  --navy-600: #2d4d84;
  --navy-100: #dfe6f1;
  --navy-050: #eff3f9;
  --gold-300: #ead39a;
  --gold-400: #d4ae5c;
  --gold-600: #9c7a35;   /* zlatá na světlé ploše */
  --cream-50: #fcfbf8;
  --cream-100: #f7f4ee;
  --cream-150: #f3efe7;
  --cream-200: #ece6da;
  /* plochy a text */
  --bg: var(--cream-100);
  --surface: #ffffff;
  --surface-2: var(--cream-50);
  --surface-3: var(--cream-150);
  --border: #e5dfd3;
  --border-strong: #cdc4b3;
  --row-border: #eee9e0;
  --text: #172238;
  --heading: #13284b;
  --text-2: #454d5f;
  --muted: #636a78;
  --accent: var(--navy-800);
  --accent-hover: var(--navy-700);
  --accent-fg: #ffffff;
  --accent-soft: var(--navy-050);
  --accent-text: #1b3a6b;
  --focus: #2a5bb5;
  --btn-bg: #ffffff;
  --btn-border: #dad3c6;
  --btn-hover: #faf8f4;
  --field-border: #9a9282; /* pole a výběry: okraj s kontrastem 3 : 1 */
  /* stavy – jedna barva = jeden význam */
  --ok: #17663f; --ok-bg: #e6f3ea; --ok-line: #b8dbc5;
  --warn: #9a4a0b; --warn-bg: #fdf0e1; --warn-line: #efcba4;
  --bad: #b3261e; --bad-bg: #fdecea; --bad-line: #f1bdb6;
  --info: #1d5a88; --info-bg: #e8f1f8; --info-line: #bcd5ea;
  --plan: #4a586d; --plan-bg: #f5f7fa; --plan-line: #808b9d;
  --mute: #5a5f6b; --mute-bg: #efece6;
  --money-in: var(--heading); /* směr peněz nese šipka a znaménko, ne zelená */
  /* grafy */
  --chart-1: var(--navy-700);
  --chart-2: var(--plan-line);
  --chart-kauce: #6f86ab;
  --chart-grid: #ece6dc;
  /* pruh prototypu v produkci není – výška 0, aby převzaté calc() dál platily */
  --rv-h: 0px;
  /* typografie a tvary */
  --font-ui: "Geist", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --font-brand: "Cinzel", "Trajan Pro", Georgia, "Times New Roman", serif;
  --fs-base: 14px; --fs-sm: 12.5px; --fs-table: 13.5px;
  --r-card: 14px; --r-ctl: 10px; --r-item: 10px; --r-drawer: 16px;
  --card-pad: 20px;
  --shadow-card: 0 1px 2px rgba(19, 40, 75, .05);
  --shadow-pop: 0 24px 60px -12px rgba(16, 34, 63, .30), 0 2px 6px rgba(16, 34, 63, .08);
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px);
  --sar: env(safe-area-inset-right, 0px);
}


/* ─────────────────────────────────────────────────────────────────────────────
   3. Základ – minimální a bezpečný (Tailwind preflight zůstává)
   ───────────────────────────────────────────────────────────────────────────── */
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--sat) + 60px + 16px); }
body.ark {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
}
/* výřez displeje nahoře (iPhone při viewport-fit=cover) – bílý jako horní lišta */
body.ark::before {
  content: ""; position: fixed; inset: 0 0 auto; height: var(--sat); z-index: 90;
  background: var(--surface);
}
.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip {
  position: fixed; left: 12px; top: calc(var(--sat) + 8px); z-index: 200;
  padding: 10px 14px; border-radius: 10px; background: #ffffff; color: var(--heading); font-weight: 600;
  box-shadow: var(--shadow-pop); text-decoration: none;
  transform: translateY(-200%); transition: transform .15s;
}
.skip:focus { transform: none; }
/* jednotný viditelný fokus v celé správě */
.app :focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
/* odkaz bez vlastní třídy v obsahu stránky musí být poznat jako odkaz.
   Redesign 2026-11: :where(#obsah) drží jen výchozí váhu (0,1,1) – navigace v obsahu
   (záložky detailu .dtabs, přepínače .seg, pohledy, měsíc) má vlastní vzhled a nepodtrhává se;
   dřív ID přebilo i .dtabs a / .seg a (vizuální kontrola 8. 11.: podtržené záložky). */
:where(#obsah) a:not([class]) { color: var(--accent-text); text-decoration: underline; text-underline-offset: 2px; text-decoration-thickness: 1px; }
/* čísla v tabulkách stejně široká (zarovnání částek) */
#obsah table { font-variant-numeric: tabular-nums; }
a, button, summary, label { -webkit-tap-highlight-color: transparent; }


/* ─────────────────────────────────────────────────────────────────────────────
   4. Pomocné třídy převzaté z původního base.html (MOBILE-WAVE-2/3)
   ───────────────────────────────────────────────────────────────────────────── */
/* Sdílený baseline admin formulářových prvků (MOBILE-WAVE-2): jen `main form`,
   netýká se navigace ani tabulkových prvků mimo formuláře. Checkboxy, radia
   a hidden inputy jsou vyloučené; kompaktní `text-xs` akce také. */
main form input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
main form select,
main form textarea {
  min-height: 44px;
}
main form button:not([class*="text-xs"]) {
  min-height: 44px;
}
main form input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):focus-visible,
main form select:focus-visible,
main form textarea:focus-visible,
main form button:focus-visible,
main form input[type="checkbox"]:focus-visible,
main form input[type="radio"]:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 1px;
}
/* Zalamování dlouhých hodnot (MOBILE-WAVE-3): opt-in na konkrétní hodnotu
   (jméno, e-mail, adresa, ID/VS, soubor), nikdy globálně. `overflow-x-hidden`
   se na body/html záměrně nepřidává – řeší se zalomením, ne maskováním. */
.wrap-anywhere {
  overflow-wrap: anywhere;
  word-break: break-word;
}
/* Agresivnější zalomení jen pro identifikátory (VS, interní ID, soubor, IBAN). */
.break-identifier {
  overflow-wrap: anywhere;
  word-break: break-all;
}


/* ─────────────────────────────────────────────────────────────────────────────
   5. Ikony (sprite templates/_ikony.html, Lucide, licence ISC)
   ───────────────────────────────────────────────────────────────────────────── */
.ic {
  display: inline-block; vertical-align: middle;
  width: 20px; height: 20px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.85; stroke-linecap: round; stroke-linejoin: round;
}
.ic-sm { width: 16px; height: 16px; }
.ic-xs { width: 14px; height: 14px; }


/* ─────────────────────────────────────────────────────────────────────────────
   6. Kostra: levý panel, horní lišta s podsekcemi, obsah
   ───────────────────────────────────────────────────────────────────────────── */
.app {
  --rail-collapsed: 72px;
  --rail-open: 252px;
  /* sloupec panelu včetně levého okraje výřezu (iPhone naležato, viewport-fit=cover) */
  --rail-slot: calc(var(--rail-collapsed) + var(--sal));
  --topbar-h: 60px;
  --gap: 16px;
  position: relative;
  display: grid;
  grid-template-columns: var(--rail-slot) minmax(0, 1fr);
  min-height: 100vh;
  min-height: calc(100dvh - var(--sat) - var(--sab));
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: var(--fs-base);
  line-height: 1.45;
  transition: grid-template-columns .2s ease;
}
/* „Nechat panel rozbalený“ – třídu nastaví static/js/arkovia.js ještě před vykreslením */
html.ark-pinned .app { --rail-slot: calc(var(--rail-open) + var(--sal)); }

/* Levý panel – námořnická modrá, zlatý znak a zlatá značka aktivní sekce */
.rail {
  position: sticky; top: var(--sat);
  height: 100vh;
  height: calc(100dvh - var(--sat) - var(--sab));
  z-index: 40;
}
.rail-panel {
  position: absolute; top: 0; bottom: 0; left: 0;
  /* + levý okraj výřezu: ikony nesmí být pod výřezem displeje (iPhone naležato) */
  width: calc(var(--rail-collapsed) + var(--sal));
  --rail-pad: 10px;
  --item-pad: calc((var(--rail-collapsed) - 2 * var(--rail-pad) - 20px) / 2);
  display: flex; flex-direction: column; gap: 4px;
  padding: 14px var(--rail-pad) 12px calc(var(--rail-pad) + var(--sal));
  /* Redesign 2026-11 (vizuální kontrola 8. 11.): když panel pokračuje pod spodní hranou
     (nízké okno), je u hrany zlatavý přechod a šipka; na konci obsahu je zakryje vrstva
     posouvaná s obsahem (local), takže v plném okně ani po doposunutí nejsou vidět. */
  background:
    linear-gradient(var(--navy-950), var(--navy-950)) 0 100% / 100% 36px no-repeat local,
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23d4ae5c' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") 50% calc(100% - 8px) / 16px 16px no-repeat scroll,
    linear-gradient(rgba(212, 174, 92, 0), rgba(212, 174, 92, .24)) 0 100% / 100% 36px no-repeat scroll,
    linear-gradient(180deg, var(--navy-850) 0%, var(--navy-900) 50%, var(--navy-950) 100%);
  color: #c9cfda;
  /* Nízké okno (telefon naležato, zvětšení 125–150 %, otevřený profil): obsah
     panelu je vyšší než okno – panel se svisle posouvá, Nastavení, Profil
     a Odhlásit zůstanou dosažitelné. Vodorovně dál ořez (sbalený panel). */
  overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain;
  scrollbar-width: none;
  transition: width .2s cubic-bezier(.23, 1, .32, 1), box-shadow .2s ease-out;
}
.rail-panel::-webkit-scrollbar { display: none; }
.rail :focus-visible { outline: 2px solid var(--gold-300); outline-offset: -2px; }
/* atribut hidden v prvcích kostry vždy skryje (třídy prvků mají vlastní display) */
.rail [hidden], .topbar [hidden], .bottombar [hidden], .sheet [hidden] { display: none !important; }
.rail.no-anim .rail-panel, .rail.no-anim .rail-label { transition: none; }
/* rozbalení: najetí myší / fokus z klávesnice (JS), připnutí, otevřený profil;
   bez JS (třída .ark-js chybí) rozbalí panel přímo najetí myší */
.rail.is-open .rail-panel, html.ark-pinned .rail-panel { width: calc(var(--rail-open) + var(--sal)); }
.rail:has(:focus-visible) .rail-panel { width: calc(var(--rail-open) + var(--sal)); }   /* klávesnice i bez JS */
.rail:has(.rail-profil[open]) .rail-panel { width: calc(var(--rail-open) + var(--sal)); }
html:not(.ark-js) .rail:hover .rail-panel { width: calc(var(--rail-open) + var(--sal)); }
.rail.is-open .rail-panel, html:not(.ark-js) .rail:hover .rail-panel { box-shadow: 16px 0 40px -12px rgba(11, 26, 51, .45); }
html.ark-pinned .rail.is-open .rail-panel { box-shadow: none; }
.rail-brand {
  display: flex; align-items: center; gap: 12px; height: 48px; flex: none;
  padding: 0 0 0 calc(var(--item-pad) - 10px); margin-bottom: 14px;
  text-decoration: none; border-radius: var(--r-item); white-space: nowrap;
}
.brand-mark {
  width: 40px; height: 40px; flex: none; display: grid; place-items: center;
  border-radius: 999px; border: 1px solid rgba(212, 174, 92, .6);
  background: radial-gradient(circle at 32% 26%, rgba(234, 211, 154, .16), rgba(234, 211, 154, 0) 62%);
  color: var(--gold-400);
  font: 600 19px/1 var(--font-brand); padding-top: 2px;
}
.brand-text { display: flex; flex-direction: column; gap: 5px; line-height: 1; }
.brand-text strong { font: 600 15px/1 var(--font-brand); letter-spacing: .17em; color: var(--gold-300); }
.brand-orn { display: block; width: 70px; height: 6px; color: var(--gold-400); opacity: .75; }
.rail-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.rail-item {
  position: relative;
  display: flex; align-items: center; gap: 14px;
  height: 44px; width: 100%;
  padding: 0 0 0 var(--item-pad);
  border: 0; background: transparent; cursor: pointer;
  color: #dfe3ea; text-decoration: none; text-align: left; font: inherit; font-weight: 500;
  border-radius: var(--r-item); white-space: nowrap;
}
.rail-item .ic { color: #b7c0cf; }
.rail-item[aria-current="page"] { background: rgba(255, 255, 255, .09); color: #ffffff; font-weight: 600; }
.rail-item[aria-current="page"] .ic { color: var(--gold-300); }
#rail-pin[aria-pressed="true"] { color: #ffffff; }
#rail-pin[aria-pressed="true"] .ic { color: var(--gold-300); }
.rail-item[aria-current="page"]::before {
  content: ""; position: absolute; left: calc(-1 * var(--rail-pad)); top: 10px; bottom: 10px; width: 3px;
  border-radius: 0 3px 3px 0; background: var(--gold-400);
}
.rail-label { opacity: 0; transition: opacity .12s ease; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.rail.is-open .rail-label, html.ark-pinned .rail-label { opacity: 1; transition-delay: .05s; }
.rail:has(:focus-visible) .rail-label { opacity: 1; }
.rail:has(.rail-profil[open]) .rail-label { opacity: 1; }
html:not(.ark-js) .rail:hover .rail-label { opacity: 1; }
.rail-bottom { margin-top: auto; display: flex; flex-direction: column; gap: 4px; padding-top: 10px; border-top: 1px solid rgba(255, 255, 255, .1); }
.avatar {
  width: 30px; height: 30px; flex: none; margin-left: -5px; border-radius: 999px;
  display: grid; place-items: center; background: var(--navy-700); color: var(--gold-300);
  box-shadow: 0 0 0 1.5px rgba(212, 174, 92, .7);
  font: 700 11.5px/1 var(--font-ui); letter-spacing: .02em;
}
/* Profil: <details> funguje i bez JS; otevřený profil panel rozbalí */
.rail-profil > summary { list-style: none; }
.rail-profil > summary::-webkit-details-marker { display: none; }
.rail-profile .rail-label { display: flex; flex-direction: column; line-height: 1.15; }
.rail-profile .rail-label small { color: #aab3c2; font-weight: 400; font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; }
.rail-profil[open] > summary { background: rgba(255, 255, 255, .07); }
.rail-profil-telo {
  display: flex; flex-direction: column; gap: 8px; margin: 6px 0 2px; padding: 12px;
  border-radius: var(--r-item); background: rgba(255, 255, 255, .06); color: #dfe3ea;
  font-size: var(--fs-sm); white-space: normal; min-width: calc(var(--rail-open) - 2 * var(--rail-pad));
}
.rail-profil-telo dl { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 4px 10px; margin: 0; }
.rail-profil-telo dt { color: #aab3c2; }
.rail-profil-telo dd { margin: 0; min-width: 0; overflow-wrap: anywhere; color: #ffffff; }
.rail-profil-telo .btn { width: 100%; }

/* Hlavní sloupec a horní lišta se záložkami podsekcí */
.main { grid-column: 2; min-width: 0; display: flex; flex-direction: column; position: relative; z-index: 1; }
/* Celoobrazovkový prohlížeč fotek fotokontroly (portal/_fotokontrola_prohlizec.html,
   z-index 60) je uvnitř obsahu, tedy ve vrstvě .main. Otevřený ho skript označí
   třídou body.fk-bez-scrollu – vrstva obsahu se pak zvedne nad panel (40),
   spodní lištu (50) i pruh výřezu (90), jinak by panel na počítači zakryl
   šipku „Předchozí fotografie“ a spodní lišta na telefonu popisek fotky.
   Totéž prohlížeč fotek portálu (portal/_lightbox.html, třída je-bez-scrollu):
   v portálu majitele je uvnitř .main a spodní lišta by zakryla jeho ovládání. */
body.fk-bez-scrollu .main, body.je-bez-scrollu .main { z-index: 95; }
.topbar {
  position: sticky; top: var(--sat); z-index: 30;
  display: flex; align-items: stretch; gap: 22px;
  height: var(--topbar-h);
  /* vlevo je panel, který levý okraj výřezu už pokrývá (na telefonu viz oddíl 11) */
  padding-left: 24px;
  padding-right: max(24px, var(--sar));
  background: rgba(255, 255, 255, .94);
  border-bottom: 1px solid var(--border);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  backdrop-filter: saturate(1.4) blur(10px);
}
.tb-brand { display: none; }
.tb-section { display: flex; align-items: center; gap: 10px; min-width: 0; font-weight: 650; font-size: 15px; color: var(--heading); white-space: nowrap; }
.tb-section .ic { color: var(--navy-600); }
.subnav {
  position: relative; display: flex; align-items: stretch; gap: 2px; min-width: 0;
  overflow-x: auto; scrollbar-width: none;
}
.subnav::-webkit-scrollbar { display: none; }
.subnav a {
  position: relative; flex: none;
  display: flex; align-items: center; padding: 0 12px;
  color: var(--text-2); text-decoration: none; font-weight: 500; white-space: nowrap;
  transition: color .15s ease;
}
.subnav a:focus-visible { outline-offset: -6px; border-radius: 10px; }
/* Tučná aktivní záložka nesmí posunout sousedy: místo pro tučný text je rezervované */
.subnav a > span, .dtabs a > span { display: inline-grid; }
.subnav a > span::after, .dtabs a > span::after { content: attr(data-t); font-weight: 650; height: 0; visibility: hidden; overflow: hidden; }
/* aktivní podsekce: tučně a zlaté podtržení (bez JS, bez posuvného ukazatele) */
.subnav a[aria-current="page"] { color: var(--heading); font-weight: 650; box-shadow: inset 0 -2px 0 var(--gold-600); }
.tb-tools { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.icon-btn {
  position: relative; width: 40px; height: 40px; display: grid; place-items: center; flex: none;
  border-radius: var(--r-ctl); border: 1px solid var(--btn-border); background: var(--btn-bg); color: var(--text-2); cursor: pointer;
  text-decoration: none;
}
.icon-btn:disabled { opacity: .45; cursor: default; }

/* Obsah stránky (bez flexu: dnešní šablony jsou v běžném toku) */
.view {
  width: 100%; max-width: 1360px;
  padding-top: 24px; padding-bottom: 64px;
  padding-left: 24px;   /* levý okraj výřezu pokrývá panel */
  padding-right: max(24px, var(--sar));
}
.view:focus { outline: none; }
/* Část nad obsahem, kterou skládá base.html: Zpět, přepínač pohledu, hlášky */
.view-head { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; margin-bottom: 20px; }
.view-head > .zpravy { align-self: stretch; }
.back {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 4px;
  color: var(--accent-text); font-weight: 600; text-decoration: none; font-size: var(--fs-sm);
  border-radius: 8px;
}
/* Přepínač pohledu uvnitř podsekce (např. Banka: Pohyby · Výpisy) – odkazy */
.pohledy {
  /* position: relative – offsetLeft odkazů se měří od pásu (posun aktivního pohledu do středu v arkovia.js) */
  position: relative;
  display: inline-flex; align-items: center; gap: 2px; padding: 3px; max-width: 100%;
  border-radius: var(--r-ctl); background: var(--surface-3); border: 1px solid var(--border);
  overflow-x: auto; scrollbar-width: none;
}
.pohledy::-webkit-scrollbar { display: none; }
.pohledy a {
  flex: none; display: inline-flex; align-items: center; min-height: 36px; padding: 0 12px;
  border-radius: calc(var(--r-ctl) - 3px); color: var(--text-2); font-weight: 500; text-decoration: none; white-space: nowrap;
}
.pohledy a[aria-current="page"] { background: var(--surface); color: var(--heading); font-weight: 600; box-shadow: 0 1px 2px rgba(19, 40, 75, .1); }
/* flash zprávy (base.html): kontejner .zpravy, text zprávy v .flash-text */
.zpravy { display: flex; flex-direction: column; gap: 8px; }


/* ─────────────────────────────────────────────────────────────────────────────
   7. Telefon: spodní lišta, list „Další“, zatemnění
   ───────────────────────────────────────────────────────────────────────────── */
.bottombar { display: none; }
.scrim {
  position: fixed; inset: 0; z-index: 60; background: rgba(16, 34, 63, .34);
  opacity: 0; visibility: hidden; transition: opacity .2s ease, visibility 0s linear .2s;
}
.scrim.is-on { opacity: 1; visibility: visible; transition: opacity .2s ease; }
.sheet {
  position: fixed; z-index: 70; left: 0; right: 0; bottom: 0;
  max-height: calc(100dvh - var(--sat) - 24px); overflow-y: auto; overscroll-behavior: contain;
  padding: 12px max(16px, var(--sar)) calc(16px + var(--sab)) max(16px, var(--sal));
  background: var(--surface); color: var(--text); border-radius: 22px 22px 0 0;
  box-shadow: 0 -18px 48px rgba(16, 34, 63, .22); font-family: var(--font-ui); font-size: var(--fs-base);
  transform: translateY(105%); visibility: hidden;
  transition: transform .24s cubic-bezier(.2, .8, .2, 1), visibility 0s linear .24s;
}
/* .is-on = otevřeno skriptem; :target = otevřeno odkazem #dalsi BEZ JS (jen telefon).
   Se skriptem (html.ark-js) :target neplatí: history.replaceState :target nezruší
   a list by po Zavřít zůstal viset přes celou stránku. */
.sheet.is-on { transform: none; visibility: visible; transition: transform .24s cubic-bezier(.2, .8, .2, 1); }
@media (max-width: 767px) {
  html:not(.ark-js) .sheet:target { transform: none; visibility: visible; transition: transform .24s cubic-bezier(.2, .8, .2, 1); }
  html:not(.ark-js) .sheet:target ~ .scrim { opacity: 1; visibility: visible; }
}
.sheet-grip { width: 40px; height: 5px; border-radius: 99px; background: var(--border-strong); margin: 0 auto 12px; }
.sheet-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.sheet-item {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 84px; padding: 16px 8px; border-radius: 16px;
  background: var(--surface-2); border: 1px solid var(--border); text-decoration: none; color: var(--heading); font-weight: 600; font-size: 13px; text-align: center;
}
.sheet-item .ic { color: var(--navy-600); }
.sheet-item[aria-current="page"] { background: var(--navy-050); border-color: var(--navy-100); }
.sheet-profil { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--row-border); }
.sheet-profil .avatar { margin-left: 0; width: 36px; height: 36px; }
.sheet-profil > div { flex: 1 1 160px; min-width: 0; display: flex; flex-direction: column; }
.sheet-profil b { color: var(--heading); overflow-wrap: anywhere; }
.sheet-profil span { color: var(--muted); font-size: var(--fs-sm); overflow-wrap: anywhere; }
.sheet-zavrit { display: flex; justify-content: center; margin-top: 10px; }


/* ─────────────────────────────────────────────────────────────────────────────
   8. Krátké potvrzení (toast) – window.Arkovia.toast('…')
   ───────────────────────────────────────────────────────────────────────────── */
.toast {
  position: fixed; z-index: 85; left: 50%; bottom: calc(24px + var(--sab)); transform: translate(-50%, 30px);
  background: var(--navy-900); color: #ffffff; padding: 11px 16px; border-radius: 12px; font-weight: 600; font-family: var(--font-ui);
  box-shadow: var(--shadow-pop); opacity: 0; transition: opacity .2s, transform .2s; pointer-events: none; max-width: calc(100vw - 32px);
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }


/* ─────────────────────────────────────────────────────────────────────────────
   9. Komponenty pro přestylované stránky (třídy jako v prototypu 41_sprava.js)
   ───────────────────────────────────────────────────────────────────────────── */

/* 9.1 Hlavička stránky a typografie */
.page-head { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 4px; }
.page-head > div:first-child { min-width: 0; flex: 1 1 320px; }
.page-head h1, .dhead h1 {
  margin: 0; font-size: 26px; line-height: 1.15; font-weight: 650; letter-spacing: -.02em;
  text-wrap: balance; color: var(--heading);
}
.page-head h1:focus, .dhead h1:focus { outline: none; }
.page-head p { margin: 6px 0 0; color: var(--text-2); max-width: 70ch; }
.meta { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 8px; color: var(--muted); font-size: var(--fs-sm); }
.meta span { display: inline-flex; align-items: center; gap: 6px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
h2.h2 { margin: 0; font-size: 15.5px; font-weight: 650; letter-spacing: -.005em; color: var(--heading); }
h3.h3 { margin: 0; font-size: 14px; font-weight: 650; color: var(--heading); }
.lbl { font-size: 12.5px; font-weight: 500; color: var(--muted); }
.muted { color: var(--muted); }
.sm { font-size: var(--fs-sm); }
.mono { font-family: var(--font-mono); font-size: .92em; letter-spacing: -.01em; }
.nowrap { white-space: nowrap; }
.wrap-any { overflow-wrap: anywhere; }
.orn { display: block; width: 70px; height: 6px; color: var(--gold-600); opacity: .8; }
hr.sep { border: 0; border-top: 1px solid var(--row-border); margin: 4px 0; }

/* 9.2 Rozložení (mřížky mají vlastní třídy – `.grid` je utilita Tailwindu) */
.stack { display: flex; flex-direction: column; gap: var(--gap, 16px); min-width: 0; }
.row-gap { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.g-kpi, .g-main, .g-2, .g-3, .facts { display: grid; gap: var(--gap, 16px); }
.g-kpi { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); align-items: start; }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* 9.3 Tlačítka a odkazy */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 0 16px; border-radius: var(--r-ctl);
  border: 1px solid var(--btn-border); background: var(--btn-bg); color: var(--heading);
  font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; white-space: nowrap;
}
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }
.btn-danger { background: var(--bad); border-color: var(--bad); color: #ffffff; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--accent-text); padding: 0 10px; }
.btn-sm { min-height: 32px; padding: 0 12px; font-size: var(--fs-sm); }
.btn-block { width: 100%; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.link {
  color: var(--accent-text); font-weight: 600; text-decoration: none; display: inline-flex; align-items: center; gap: 4px;
  background: none; border: 0; padding: 0; cursor: pointer; border-radius: 4px; font: inherit; font-weight: 600;
}
.btn, .icon-btn, .fchip { transition: transform .16s ease-out, background-color .12s ease-out, border-color .12s ease-out; touch-action: manipulation; }
.btn:active, .icon-btn:active, .fchip:active { transform: scale(.97); }

/* 9.4 Segmentový přepínač (tlačítka) a výběr měsíce */
.seg { display: inline-flex; align-items: center; gap: 2px; padding: 3px; border-radius: var(--r-ctl); background: var(--surface-3); border: 1px solid var(--border); }
.seg button, .seg a { border: 0; background: transparent; padding: 6px 12px; border-radius: calc(var(--r-ctl) - 3px); cursor: pointer; color: var(--text-2); font: inherit; font-weight: 500; text-decoration: none; }
.seg button[aria-pressed="true"], .seg a[aria-current="page"] { background: var(--surface); color: var(--heading); font-weight: 600; box-shadow: 0 1px 2px rgba(19, 40, 75, .1); }
.seg-wrap { flex-wrap: wrap; }
.month {
  display: inline-flex; align-items: center; gap: 2px; height: 40px; padding: 0 4px;
  border-radius: var(--r-ctl); border: 1px solid var(--btn-border); background: var(--btn-bg);
}
.month button, .month a { width: 32px; height: 32px; border: 0; background: transparent; border-radius: calc(var(--r-ctl) - 4px); display: grid; place-items: center; cursor: pointer; color: var(--text-2); }
.month button:disabled { opacity: .35; cursor: default; }
.month output, .month .month-t { min-width: 128px; text-align: center; font-weight: 600; color: var(--heading); }

/* 9.5 Formuláře */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > span, .field > label, .field-label { font-size: var(--fs-sm); color: var(--muted); font-weight: 500; }
.field-help { font-size: var(--fs-sm); color: var(--muted); margin: 0; }
.field-err { margin: 0; color: var(--bad); font-weight: 600; font-size: var(--fs-sm); }
.input {
  height: 40px; padding: 0 12px; border-radius: var(--r-ctl); border: 1px solid var(--field-border);
  background: #ffffff; color: var(--text); min-width: 0; font: inherit;
}
textarea.input { height: auto; min-height: 88px; padding: 10px 12px; resize: vertical; }
select.input {
  appearance: none; -webkit-appearance: none; padding-right: 34px; cursor: pointer;
  background: #ffffff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23636a78' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center / 14px;
}
.input:focus { outline: 2px solid var(--focus); outline-offset: 1px; }
.input[aria-invalid="true"], .input.is-invalid { border-color: var(--bad); }
.input:disabled { background: var(--surface-3); color: var(--muted); cursor: not-allowed; }
.input-amt { width: 120px; height: 34px; text-align: right; }
/* výběr ve filtrech (kulatý) */
.select {
  appearance: none; -webkit-appearance: none;
  height: 34px; padding: 0 32px 0 12px; border-radius: 999px;
  border: 1px solid var(--field-border); color: var(--text-2); font: inherit; font-weight: 500; cursor: pointer;
  background: #ffffff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23636a78' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center / 14px;
}
.select.is-set { border-color: var(--navy-600); color: var(--heading); font-weight: 600; background-color: var(--navy-050); }
/* zaškrtávací pole a přepínač s popiskem */
.check { display: inline-flex; align-items: flex-start; gap: 10px; min-height: 44px; padding: 10px 0; cursor: pointer; color: var(--text); }
.check input[type="checkbox"], .check input[type="radio"] { width: 18px; height: 18px; margin: 1px 0 0; flex: none; accent-color: var(--navy-800); }
.check small { display: block; color: var(--muted); font-size: var(--fs-sm); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.form-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 8px; }

/* 9.6 Panel filtrů a hledání */
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.filters .search { margin-left: auto; width: 240px; height: 36px; }
.search {
  display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px; width: 230px;
  border-radius: var(--r-ctl); border: 1px solid var(--field-border); background: var(--btn-bg); color: var(--muted);
}
.search input { border: 0; background: transparent; outline: none; width: 100%; min-width: 0; color: var(--text); font: inherit; min-height: 0; }
.search input::placeholder { color: var(--muted); }
.search:focus-within { outline: 2px solid var(--focus); outline-offset: 1px; }
.fchip {
  display: inline-flex; align-items: center; gap: 8px; min-height: 34px; padding: 0 12px;
  border-radius: 999px; border: 1px solid var(--btn-border); background: var(--btn-bg);
  color: var(--text-2); cursor: pointer; font: inherit; font-weight: 500; text-decoration: none;
}
.fchip .n { font-variant-numeric: tabular-nums; color: var(--muted); font-weight: 600; }
.fchip[aria-pressed="true"], .fchip[aria-current="page"] { background: var(--navy-800); border-color: var(--navy-800); color: #ffffff; font-weight: 600; }
.fchip[aria-pressed="true"] .n, .fchip[aria-current="page"] .n { color: #ffffff; opacity: .78; }
.fsep { width: 1px; height: 22px; background: var(--border); margin: 0 4px; }
/* kontext filtru (např. otevřeno z Účetnictví do Banky) */
.ctx {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 12px 10px 14px; border-radius: 12px;
  background: var(--navy-050); border: 1px solid var(--navy-100); color: var(--text); font-size: var(--fs-sm);
}
.ctx > .ic { color: var(--navy-600); }
.ctx b { color: var(--heading); }
.ctx-acts { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; }

/* 9.7 Karty */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card);
  box-shadow: var(--shadow-card); padding: var(--card-pad); min-width: 0;
}
.card-head { display: flex; align-items: center; gap: 10px; justify-content: space-between; margin-bottom: 14px; flex-wrap: wrap; }
.card-head .h2 { display: flex; align-items: center; gap: 8px; }
.card-head .h2 .ic { color: var(--navy-600); }
.card.flush { padding: 0; overflow: clip; }
.card.flush > .card-head { padding: var(--card-pad) var(--card-pad) 0; }
.card.flush > .card-head + .table-wrap, .card.flush > .card-head + table { margin-top: 0; }

/* 9.8 Souhrnné dlaždice (KPI) a průběh */
.kpi { display: flex; flex-direction: column; gap: 10px; text-decoration: none; color: inherit; transition: border-color .15s, box-shadow .15s; }
.kpi-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.kpi-icon { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: var(--navy-050); color: var(--navy-700); }
.kpi-icon .ic { width: 17px; height: 17px; }
.kpi-value { font: 600 28px/1.08 var(--font-ui); letter-spacing: -.02em; font-variant-numeric: tabular-nums; color: var(--heading); }
.kpi-value .cur, .v .cur { font-size: .55em; font-weight: 500; color: var(--muted); margin-left: .2em; letter-spacing: 0; }
.kpi-sub { color: var(--text-2); font-size: var(--fs-sm); }
.kpi-foot { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.kpi.is-plan { border-style: dashed; border-color: var(--plan-line); background: var(--plan-bg); }
.meter { position: relative; height: 8px; border-radius: 99px; background: #ede8df; overflow: hidden; }
.meter > i { position: absolute; inset: 0 auto 0 0; border-radius: inherit; background: var(--navy-700); }

/* 9.9 Stavové štítky – jedna barva = jeden význam */
.st {
  display: inline-flex; align-items: center; gap: 5px; min-height: 24px; padding: 3px 9px 3px 7px;
  border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; line-height: 1.1;
  border: 1px solid transparent; vertical-align: middle;
}
.st .ic { width: 13px; height: 13px; stroke-width: 2.2; }
.st-ok { color: var(--ok); background: var(--ok-bg); border-color: var(--ok-line); }
.st-warn { color: var(--warn); background: var(--warn-bg); border-color: var(--warn-line); }
.st-bad { color: var(--bad); background: var(--bad-bg); border-color: var(--bad-line); }
.st-info { color: var(--info); background: var(--info-bg); border-color: var(--info-line); }
.st-plan { color: var(--plan); background: var(--plan-bg); border: 1px dashed var(--plan-line); }
.st-mute { color: var(--mute); background: var(--mute-bg); }
.st-neutral { color: var(--text-2); background: var(--surface-2); border-color: var(--border); }
.st.wrapping, .q-meta .st, .kpi-foot .st, .row-gap .st { white-space: normal; text-align: left; max-width: 100%; }
button.st { cursor: pointer; font-family: inherit; }
.dot-st { width: 8px; height: 8px; border-radius: 99px; display: inline-block; flex: none; }
.cell-chips { display: inline-flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; min-width: 0; }
@media (min-width: 768px) { .cell-chips { justify-content: flex-start; } }

/* 9.10 Částky (formát: 29 000 Kč, záporné se skutečným minusem −) */
.money { font-variant-numeric: tabular-nums; white-space: nowrap; font-feature-settings: "tnum" 1; }
.money .cur { color: var(--muted); font-weight: 400; }
.money.in { color: var(--money-in); }
.money.plan { color: var(--plan); }
.na { color: var(--muted); }
.big-amount { font: 600 30px/1.1 var(--font-ui); letter-spacing: -.02em; font-variant-numeric: tabular-nums; color: var(--heading); }

/* 9.11 Fronta úkolů a „Proč to vidím“ */
.queue { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.q {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 4px 14px; align-items: center;
  padding: 14px 0; border-top: 1px solid var(--row-border);
}
.queue > .q:first-child { border-top: 0; padding-top: 4px; }
.q-mark { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; align-self: start; }
.q-mark .ic { width: 18px; height: 18px; }
.q-mark.k-bad { background: var(--bad-bg); color: var(--bad); }
.q-mark.k-warn { background: var(--warn-bg); color: var(--warn); }
.q-mark.k-term { background: var(--info-bg); color: var(--info); }
.q-mark.k-plan { background: var(--plan-bg); color: var(--plan); border: 1px dashed var(--plan-line); }
.q-mark.k-mute { background: var(--mute-bg); color: var(--mute); }
.q-mark.k-ok { background: var(--ok-bg); color: var(--ok); }
.q-mark.k-num { background: var(--navy-050); color: var(--heading); font-weight: 700; font-size: 13px; }
.q-title { font-weight: 600; color: var(--heading); }
.q-desc { color: var(--text-2); font-size: var(--fs-sm); margin-top: 2px; }
.q-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.q-act { display: flex; align-items: center; gap: 6px; }
.q details { grid-column: 2 / -1; }
.why summary {
  list-style: none; cursor: pointer; color: var(--muted); font-size: var(--fs-sm);
  display: inline-flex; align-items: center; gap: 4px; margin-top: 2px; border-radius: 6px;
}
.why summary::-webkit-details-marker { display: none; }
.why summary .ic { width: 14px; height: 14px; transition: transform .15s; }
.why[open] summary .ic { transform: rotate(90deg); }
.why-body {
  margin-top: 8px; padding: 10px 12px; border-radius: 10px; background: var(--surface-2);
  color: var(--text-2); font-size: var(--fs-sm); border: 1px solid var(--border);
}
.why-body dl { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 4px 12px; margin: 0; }
.why-body dt { color: var(--muted); }
.why-body dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.why-body ol { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; list-style: decimal; }
.fold { border-top: 1px solid var(--row-border); padding-top: 12px; margin-top: 4px; }
.fold > summary, .fold-card > summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; font-weight: 600; color: var(--text-2);
  padding: 4px 0; border-radius: 8px;
}
.fold > summary::-webkit-details-marker, .fold-card > summary::-webkit-details-marker { display: none; }
.fold > summary .ic, .fold-card > summary .chev { transition: transform .15s; }
.fold[open] > summary .chev, .fold-card[open] > summary .chev { transform: rotate(90deg); }
.fold > summary .note-i { font-weight: 400; color: var(--muted); font-size: var(--fs-sm); }
.fold-card > .queue { margin-top: 12px; }

/* 9.12 Termíny */
.timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.tl { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 12px; padding: 10px 0; border-top: 1px solid var(--row-border); align-items: start; }
.timeline .tl:first-child { border-top: 0; padding-top: 2px; }
.tl-date { text-align: center; border-radius: 10px; padding: 6px 0; background: var(--surface-2); border: 1px solid var(--border); line-height: 1.05; }
.tl-date b { display: block; font-size: 17px; color: var(--heading); font-variant-numeric: tabular-nums; }
.tl-date span { font-size: 11px; color: var(--muted); }
.tl-title { font-weight: 600; color: var(--heading); }
.tl-desc { color: var(--text-2); font-size: var(--fs-sm); }

/* 9.13 Tabulky; na telefonu třída `.cards` udělá z řádků karty (žádný údaj
   nezmizí: buňky s data-k="Popisek" dostanou popisek vlevo) */
.table-wrap { min-width: 0; }
.tbl-scroll { overflow-x: auto; }
/* Redesign 2026-11 (vizuální kontrola 8. 11.): na počítači se hlavní text tabulky nesrazí
   na pár znaků – `overflow-wrap: anywhere` jinak v automatickém rozložení dá sloupci
   s nejdelším textem nejméně místa (e-maily, názvy bytů, popis nákladu). Tabulka širší
   než karta má u okraje stín (zmizí po doposunutí – vrstvy posouvané s obsahem). */
@media (min-width: 768px) {
  .tbl .tbl-txt { display: block; min-width: 11rem; }
  .tbl .tbl-txt-l { min-width: 14rem; }
  .tbl-scroll {
    background:
      linear-gradient(90deg, var(--surface) 40%, rgba(255, 255, 255, 0)) 0 0 / 32px 100% no-repeat local,
      linear-gradient(270deg, var(--surface) 40%, rgba(255, 255, 255, 0)) 100% 0 / 32px 100% no-repeat local,
      linear-gradient(90deg, rgba(19, 40, 75, .16), rgba(19, 40, 75, 0)) 0 0 / 14px 100% no-repeat scroll,
      linear-gradient(270deg, rgba(19, 40, 75, .16), rgba(19, 40, 75, 0)) 100% 0 / 14px 100% no-repeat scroll;
  }
}
.tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: var(--fs-table); }
.tbl caption { text-align: left; }
.tbl th {
  position: sticky; top: calc(var(--sat) + var(--rv-h) + var(--topbar-h)); z-index: 2;
  background: var(--surface-2); color: var(--muted); font-weight: 500; font-size: var(--fs-sm);
  text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); white-space: nowrap;
}
.tbl td { padding: 11px 12px; border-bottom: 1px solid var(--row-border); vertical-align: middle; color: var(--text); }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl th:first-child, .tbl td:first-child { padding-left: var(--card-pad); }
.tbl th:last-child, .tbl td:last-child { padding-right: var(--card-pad); }
.tbl .num { text-align: right; }
.tbl tbody tr.row { cursor: pointer; }
.tbl tbody tr.row.is-sel td, .tbl tbody tr.row.is-cur td, .tbl tbody tr.crow.is-cur td { background: var(--navy-050); }
.tbl tbody tr.row.is-cur td:first-child, .tbl tbody tr.crow.is-cur td:first-child { box-shadow: inset 3px 0 0 var(--navy-800); }
.tbl .grp td {
  background: #f8f5ef; font-weight: 600; color: var(--text-2); padding-top: 9px; padding-bottom: 9px; font-size: var(--fs-sm);
  border-bottom: 1px solid var(--row-border);
}
.tbl .grp td .grp-sum { float: right; font-weight: 500; color: var(--muted); font-variant-numeric: tabular-nums; }
.tbl tfoot td { font-weight: 600; border-bottom: 0; border-top: 1px solid var(--border); background: #f8f5ef; }
.rowbtn {
  border: 0; background: transparent; padding: 0; cursor: pointer; text-align: left; color: var(--heading);
  font: inherit; font-weight: 600; display: block; border-radius: 6px; max-width: 100%; text-decoration: none;
}
.rowbtn small { display: block; color: var(--muted); font-weight: 400; font-size: var(--fs-sm); margin-top: 1px; }
.cell-sub { display: block; color: var(--muted); font-size: var(--fs-sm); }
.dir { width: 28px; height: 28px; border-radius: 99px; display: grid; place-items: center; flex: none; background: var(--surface-3); color: var(--text-2); border: 1px solid var(--border); }
.dir .ic { width: 15px; height: 15px; stroke-width: 2.2; }
.who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.only-m { display: none; }
.more { padding: 12px var(--card-pad); border-top: 1px solid var(--row-border); display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; color: var(--muted); font-size: var(--fs-sm); }

/* 9.14 Grafy */
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart text { fill: var(--muted); font: 500 11px var(--font-ui); }
.chart .grid-l { stroke: var(--chart-grid); stroke-width: 1; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--text-2); font-size: var(--fs-sm); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.legend i.plan { background: transparent !important; border: 1.5px dashed var(--plan-line); }
.bar-stack { display: flex; height: 14px; gap: 3px; align-items: stretch; }
.bar-stack > span { border-radius: 4px; min-width: 4px; }
.bar-stack .b-plan { background: repeating-linear-gradient(135deg, #e9edf3 0 6px, transparent 6px 12px); border: 1.5px dashed var(--plan-line); }
.bar-gap { width: 14px; flex: none; background: none !important; position: relative; }
.bar-gap::after { content: ""; position: absolute; left: 6px; top: -4px; bottom: -4px; width: 1.5px; background: var(--border-strong); }

/* 9.15 Souhrnné řádky (štítek – hodnota); plán za čárkovaným oddělovačem, nikdy v součtu */
.sumrow { display: grid; grid-template-columns: repeat(var(--cols, 4), minmax(0, 1fr)); gap: 0; }
.sumrow > div { padding: 2px 18px; border-left: 1px solid var(--row-border); min-width: 0; }
.sumrow > div:first-child { border-left: 0; padding-left: 0; }
.sumrow .v { font: 600 20px/1.2 var(--font-ui); font-variant-numeric: tabular-nums; color: var(--heading); margin-top: 4px; letter-spacing: -.01em; }
.sumrow .s { color: var(--muted); font-size: var(--fs-sm); margin-top: 2px; }
.sumrow .is-plan .v { color: var(--plan); }
.sumrow .is-plan { border-left-style: dashed; border-left-color: var(--plan-line); }
.sumrow .is-total .v { color: var(--heading); }
.sumrow.two { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 14px; }
.sumrow.two > div:nth-child(odd) { border-left: 0; padding-left: 0; }

/* 9.16 Řádky peněz (štítek vlevo, částka vpravo; podřádky odsazené) */
.lines { list-style: none; margin: 0; padding: 0; }
.lines li { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 10px 0; border-top: 1px solid var(--row-border); }
.lines li:first-child { border-top: 0; padding-top: 2px; }
.lines li > span:first-child { min-width: 0; }
.lines .amt { font-variant-numeric: tabular-nums; white-space: nowrap; text-align: right; font-weight: 600; color: var(--heading); }
.lines li.sub { padding: 5px 0 5px 16px; border-top: 0; color: var(--text-2); font-size: var(--fs-sm); }
.lines li.sub .amt { font-weight: 500; color: var(--text-2); }
.lines li.total { font-weight: 650; color: var(--heading); }
.lines li.total:not(:first-child) { margin-top: 6px; }
.lines li.warn .amt { color: var(--warn); }
.lines li.bad .amt { color: var(--bad); }

/* 9.17 Tok platby (co přišlo → k čemu se přiřadilo) */
.flow { display: grid; grid-template-columns: minmax(0, 1fr) 28px minmax(0, 1.2fr); align-items: center; gap: 8px; }
.flow-src, .flow-dst { border: 1px solid var(--border); border-radius: 12px; padding: 12px; background: var(--surface-2); min-width: 0; }
.flow-dst { display: flex; flex-direction: column; gap: 8px; }
.flow-arrow { color: var(--muted); display: grid; place-items: center; }
.alloc { display: flex; justify-content: space-between; gap: 10px; padding-bottom: 8px; border-bottom: 1px dashed var(--row-border); }
.alloc:last-child { border-bottom: 0; padding-bottom: 0; }

/* 9.18 Detail objektu: hlavička, záložky, fakta, klíč–hodnota */
.dhead { display: flex; flex-direction: column; gap: 12px; }
.dhead-main { display: flex; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.dhead-main > div:first-child { flex: 1 1 320px; min-width: 0; }
.dhead-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.dtabs {
  display: flex; gap: 2px; border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: none;
  margin-top: 4px;
}
.dtabs::-webkit-scrollbar { display: none; }
/* Redesign 2026-11: na telefonu se záložky širší než displej vpravo ztrácí do ztracena
   (náznak dalších); prázdný konec dovolí poslední záložku doposunout mimo přechod. */
@media (max-width: 767px) {
  .dtabs, .subnav {
    -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent);
    mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent);
  }
  .dtabs::after, .subnav::after { content: ""; flex: none; width: 28px; }
}
.dtabs a {
  flex: none; display: flex; align-items: center; gap: 6px; min-height: 44px; padding: 10px 12px 11px; color: var(--text-2); text-decoration: none;
  font-weight: 500; white-space: nowrap; border-radius: 8px 8px 0 0;
}
.dtabs a[aria-current="page"] { color: var(--heading); font-weight: 650; box-shadow: inset 0 -2px 0 var(--navy-800); }
.dtabs a .n { font-size: 11.5px; font-weight: 600; color: var(--muted); background: var(--surface-3); border-radius: 99px; padding: 1px 7px; }
.dtabs a:focus-visible { outline-offset: -4px; }
.facts { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.tile { display: flex; flex-direction: column; gap: 6px; text-decoration: none; color: inherit; transition: border-color .15s, box-shadow .15s; }
.tile .v { font: 600 20px/1.2 var(--font-ui); font-variant-numeric: tabular-nums; color: var(--heading); letter-spacing: -.01em; }
.tile .s { color: var(--muted); font-size: var(--fs-sm); }
.kv { display: grid; grid-template-columns: minmax(110px, max-content) minmax(0, 1fr); gap: 8px 16px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.kv-wrap { grid-template-columns: minmax(96px, 46%) minmax(0, 1fr); }
.list-plain { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.list-plain > li { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-top: 1px solid var(--row-border); min-width: 0; }
.list-plain > li:first-child { border-top: 0; padding-top: 2px; }
.list-plain .grow { flex: 1; min-width: 0; }
.file-ic { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--navy-050); color: var(--navy-700); flex: none; }

/* 9.19 Fotky, sady fotokontrol, kroky postupu, potvrzení */
.ph-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); gap: 12px; }
.ph {
  position: relative; margin: 0; border-radius: 12px; overflow: hidden; aspect-ratio: 4 / 3; max-width: 100%;
  background: var(--surface-3); border: 1px solid var(--border);
}
.ph img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ph-ph { width: 100%; height: 100%; display: grid; place-items: center; color: #7d8696; }
.ph-ph .ic { width: 26px; height: 26px; stroke-width: 1.5; }
.ph figcaption { position: absolute; left: 8px; right: 8px; bottom: 8px; display: flex; gap: 6px; align-items: center; }
.ph figcaption span {
  background: rgba(255, 255, 255, .93); color: var(--heading); border-radius: 6px; padding: 2px 7px;
  font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%;
}
.ph .ph-x { position: absolute; top: 6px; right: 6px; width: 28px; height: 28px; border-radius: 99px; border: 0; background: rgba(255, 255, 255, .93); color: var(--heading); display: grid; place-items: center; cursor: pointer; }
.ph .ph-x .ic { width: 15px; height: 15px; }
.sada { display: flex; flex-direction: column; gap: 14px; }
.sada-head { display: flex; align-items: flex-start; gap: 12px; flex-wrap: wrap; justify-content: space-between; }
.steps { display: flex; gap: 6px; flex-wrap: wrap; list-style: none; padding: 0; margin: 0; }
.step {
  display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px 5px 5px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2); font-weight: 500; font-size: var(--fs-sm);
}
.step b { width: 22px; height: 22px; border-radius: 99px; display: grid; place-items: center; background: #ffffff; border: 1px solid var(--border-strong); font-size: 11.5px; color: var(--text-2); }
.step b .ic { width: 13px; height: 13px; stroke-width: 2.4; }
.step.is-done { color: var(--ok); }
.step.is-done b { background: var(--ok); border-color: var(--ok); color: #ffffff; }
.step.is-now { background: var(--navy-050); border-color: var(--navy-100); color: var(--heading); font-weight: 600; }
.step.is-now b { background: var(--navy-800); border-color: var(--navy-800); color: #ffffff; }
.confirm {
  border: 1px solid var(--navy-100); background: var(--navy-050); border-radius: 12px; padding: 14px 16px;
  display: flex; flex-direction: column; gap: 10px;
}
.confirm:focus { outline: 2px solid var(--focus); outline-offset: 2px; }

/* 9.20 Hlášky a poznámky (flash zprávy z base.html používají totéž) */
.note {
  display: flex; gap: 10px; padding: 12px 14px; border-radius: 12px; font-size: var(--fs-sm);
  background: var(--info-bg); color: var(--text); border: 1px solid var(--info-line);
}
.note > .ic { color: var(--info); flex: none; margin-top: 1px; }
.note > div { min-width: 0; overflow-wrap: anywhere; }
.note.info { background: var(--info-bg); border-color: var(--info-line); }
.note.warn { background: var(--warn-bg); border-color: var(--warn-line); }
.note.warn > .ic { color: var(--warn); }
.note.plan { background: var(--plan-bg); border: 1px dashed var(--plan-line); }
.note.plan > .ic { color: var(--plan); }
.note.bad { background: var(--bad-bg); border-color: var(--bad-line); }
.note.bad > .ic { color: var(--bad); }
.note.ok { background: var(--ok-bg); border-color: var(--ok-line); }
.note.ok > .ic { color: var(--ok); }
.note.mute { background: var(--surface-3); border-color: var(--border); }
.note.mute > .ic { color: var(--mute); }
/* vysvětlivka bez stavu – modrá zůstává jen pro údaje o datech (avízo, platba předem) */
.note.help { background: var(--surface-2); border-color: var(--border); color: var(--text-2); }
.note.help > .ic { color: var(--muted); }
.note-act { margin-top: 8px; display: flex; gap: 8px; flex-wrap: wrap; }

/* 9.21 Nahrání souboru */
.drop {
  border: 1.5px dashed var(--border-strong); border-radius: 14px; padding: 22px; text-align: center; cursor: pointer;
  background: var(--surface-2); color: var(--text-2); display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.drop > .ic { width: 26px; height: 26px; color: var(--navy-600); }
.drop b { color: var(--heading); }
.drop:focus-within { outline: 2px solid var(--focus); outline-offset: 2px; }
.drop.is-over { border-color: var(--navy-600); background: var(--navy-050); }
.drop.is-done { border-style: solid; border-color: var(--warn-line); background: var(--warn-bg); cursor: default; }
.drop.is-done > .ic { color: var(--warn); }

/* 9.22 Prázdný stav: zelený jen když opravdu nic nezbývá, jinak neutrální */
.empty { padding: 36px 20px; text-align: center; color: var(--text-2); display: flex; flex-direction: column; align-items: center; gap: 8px; }
.empty > .ic { width: 30px; height: 30px; color: var(--ok); }
.empty > .ic.neutral { color: var(--muted); }
.empty b { color: var(--heading); font-size: 15px; }
.empty .orn { margin: 2px 0; }

/* 9.23 Byty – karty, tabule závad, kontrolní body */
.prop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--gap, 16px); }
.prop { display: flex; flex-direction: column; gap: 14px; text-decoration: none; color: inherit; transition: border-color .15s, box-shadow .15s; }
.prop-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.prop-title { font-weight: 650; font-size: 16px; color: var(--heading); }
.prop-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding-top: 12px; border-top: 1px solid var(--row-border); }
.prop-stats .v { font-weight: 600; font-variant-numeric: tabular-nums; color: var(--heading); }
.prop-foot { display: flex; gap: 6px; flex-wrap: wrap; }
.board { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap, 16px); align-items: start; }
.board-col { background: var(--surface-2); }
.n-badge { min-width: 24px; height: 24px; padding: 0 7px; border-radius: 999px; display: inline-grid; place-items: center; background: var(--surface-3); border: 1px solid var(--border); color: var(--heading); font-weight: 600; font-size: 12.5px; }
.zav { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; text-align: left; width: 100%; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; font: inherit; color: inherit; text-decoration: none; }
.zav-t { font-weight: 600; color: var(--heading); }
.zav .row-gap { margin-top: 4px; }
.chks { display: flex; flex-wrap: wrap; gap: 4px 6px; }
.chk { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; padding: 2px 8px; border-radius: 999px; border: 1px dashed var(--border-strong); color: var(--muted); white-space: nowrap; }
.chk.is-ok { border-style: solid; border-color: var(--ok-line); background: var(--ok-bg); color: var(--ok); }

/* 9.24 Detailový panel (zásuvka) – pro pozdější detaily; base.html ho zatím nevkládá */
.drawer {
  position: fixed; z-index: 70; top: calc(var(--sat) + 8px); right: max(8px, var(--sar)); bottom: calc(var(--sab) + 8px);
  width: min(500px, calc(100vw - 16px));
  display: flex; flex-direction: column;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--r-drawer);
  box-shadow: var(--shadow-pop);
  transform: translateX(calc(100% + 24px)); transition: transform .26s cubic-bezier(.32, .72, 0, 1);
  font-family: var(--font-ui); font-size: var(--fs-base); line-height: 1.45;
}
.drawer.is-on { transform: none; }
.drawer-head { display: flex; align-items: flex-start; gap: 12px; padding: 18px 18px 12px 22px; border-bottom: 1px solid var(--row-border); }
.drawer-head h2 { margin: 0; font-size: 18px; line-height: 1.25; flex: 1; text-wrap: balance; color: var(--heading); overflow-wrap: anywhere; }
.drawer-head .lbl { display: block; margin-bottom: 4px; }
.drawer-body { overflow-y: auto; overscroll-behavior: contain; padding: 18px 22px 28px; display: flex; flex-direction: column; gap: 18px; }
.drawer-foot { padding: 14px 22px calc(14px + var(--sab)); border-top: 1px solid var(--row-border); display: flex; gap: 8px; flex-wrap: wrap; }
.dsec h3 { margin: 0 0 10px; font-size: 13px; font-weight: 600; color: var(--muted); }


/* ─────────────────────────────────────────────────────────────────────────────
   10. Efekty najetí jen pro zařízení s myší (na telefonu by zůstaly viset)
   ───────────────────────────────────────────────────────────────────────────── */
@media (hover: hover) and (pointer: fine) {
  .rail-item:hover { background: rgba(255, 255, 255, .07); color: #ffffff; }
  .rail-item:hover .ic { color: #ffffff; }
  .subnav a:hover, .dtabs a:hover, .pohledy a:hover { color: var(--heading); }
  .icon-btn:hover { color: var(--heading); background: var(--btn-hover); }
  .btn:hover { background: var(--btn-hover); }
  .btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
  .btn-danger:hover { background: #9a2019; border-color: #9a2019; }
  .btn-ghost:hover { background: var(--accent-soft); }
  .link:hover, .back:hover { text-decoration: underline; text-underline-offset: 3px; }
  .month button:hover:not(:disabled) { background: var(--surface-3); color: var(--heading); }
  a.kpi:hover, a.prop:hover, a.tile:hover { border-color: #c9d3e3; box-shadow: 0 6px 18px -10px rgba(19, 40, 75, .25); }
  .tbl tbody tr.row:hover td { background: #faf8f3; }
  .fchip:hover:not([aria-pressed="true"]):not([aria-current="page"]) { border-color: var(--border-strong); color: var(--heading); }
  .sheet-item:hover { border-color: #c9d3e3; }
  .zav:hover { border-color: var(--border-strong); }
}


/* ─────────────────────────────────────────────────────────────────────────────
   11. Přizpůsobení šířce
   ───────────────────────────────────────────────────────────────────────────── */
@media (max-width: 1180px) {
  .g-kpi, .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-main { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 960px) {
  .sumrow { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 0; }
  .sumrow > div:nth-child(odd) { border-left: 0; padding-left: 0; }
  .tb-section span.t { display: none; }
  .g-2, .g-3, .board, .form-grid { grid-template-columns: minmax(0, 1fr); }
}
/* Dotykový tablet (768–960 px): panel se najetím nerozbalí a popisky sekcí
   nejsou vidět – název aktuální sekce proto zůstává v horní liště. */
@media (max-width: 960px) and (pointer: coarse) {
  .tb-section span.t { display: inline; overflow: hidden; text-overflow: ellipsis; }
}
/* Dotykové ovládání na každé šířce: prvky kostry a tlačítka nejméně 44 px
   (na telefonu totéž v bloku níže; tady hlavně tablet od 768 px) */
@media (pointer: coarse) {
  .pohledy a, .btn, .btn-sm, .fchip { min-height: 44px; }
  .icon-btn { width: 44px; height: 44px; }
}
/* Telefon: panel vlevo mizí, spodní lišta, podsekce posuvné pod záhlavím */
@media (max-width: 767px) {
  .app { grid-template-columns: minmax(0, 1fr); --topbar-h: 104px; padding-bottom: calc(68px + var(--sab)); }
  .app.bez-podsekci { --topbar-h: 60px; }
  html.ark-pinned .app { --rail-slot: 0px; }
  .rail { display: none; }
  .main { grid-column: 1; }
  .topbar {
    flex-wrap: wrap; align-content: flex-start; gap: 0 10px; height: auto; min-height: var(--topbar-h);
    padding-top: 8px; padding-left: max(16px, var(--sal)); padding-right: max(16px, var(--sar));
  }
  .tb-brand {
    position: relative;
    display: grid; place-items: center; width: 34px; height: 34px; flex: none; align-self: center;
    border-radius: 999px; background: var(--navy-900); color: var(--gold-400);
    font: 600 16px/1 var(--font-brand); padding-top: 2px; text-decoration: none;
  }
  /* dotykový cíl 44 × 44 px kolem kruhu 34 px (vzhled ani rozložení se nemění) */
  .tb-brand::after { content: ""; position: absolute; inset: -5px; }
  .tb-section { flex: 1; height: 44px; }
  .tb-section span.t { display: inline; overflow: hidden; text-overflow: ellipsis; }
  .tb-tools { height: 44px; }
  .icon-btn { width: 44px; height: 44px; }
  .subnav { order: 3; flex-basis: 100%; height: 48px; margin: 0 -8px; }
  .subnav a { min-height: 44px; }
  .view { padding-left: max(16px, var(--sal)); padding-right: max(16px, var(--sar)); padding-top: 18px; }
  .pohledy a { min-height: 44px; }
  .bottombar {
    display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
    position: fixed; z-index: 50; left: 0; right: 0; bottom: 0;
    padding: 6px max(16px, var(--sar)) calc(6px + var(--sab)) max(16px, var(--sal));
    background: rgba(255, 255, 255, .96); border-top: 1px solid var(--border);
    -webkit-backdrop-filter: saturate(1.4) blur(16px); backdrop-filter: saturate(1.4) blur(16px);
    font-family: var(--font-ui);
  }
  .bb-item {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 52px; padding: 6px 2px;
    border: 0; background: transparent; color: var(--muted); text-decoration: none; font: inherit; font-size: 10.5px; font-weight: 600;
    border-radius: 12px; cursor: pointer; position: relative; text-align: center;
  }
  .bb-item .ic { width: 22px; height: 22px; }
  /* dlouhý popisek (Nemovitosti) na úzkém displeji nebo při zvětšení nepřeteče do sousedů */
  .bb-item span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .bb-item[aria-current="page"] { color: var(--heading); }
  .bb-item[aria-current="page"] .ic { stroke-width: 2.3; color: var(--navy-800); }
  .bb-item[aria-current="page"]::before {
    content: ""; position: absolute; top: -6px; left: 50%; width: 26px; height: 3px; margin-left: -13px;
    border-radius: 0 0 3px 3px; background: var(--gold-600);
  }
  .page-head h1, .dhead h1 { font-size: 23px; }
  .g-kpi, .facts { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
  .kpi-value { font-size: 23px; }
  .filters .search { margin-left: 0; width: 100%; }
  .card { --card-pad: 16px; }
  .btn, .btn-sm { min-height: 44px; }
  .fchip { min-height: 44px; }
  .ctx-acts { margin-left: 0; }
  .q { grid-template-columns: auto minmax(0, 1fr); }
  .q .q-act { grid-column: 2; }
  .tbl-scroll { overflow: visible; }
  .tbl.cards thead { display: none; }
  .tbl.cards, .tbl.cards tbody, .tbl.cards tr, .tbl.cards td, .tbl.cards tfoot { display: block; width: 100%; }
  .tbl.cards tr.row, .tbl.cards tr.crow { padding: 12px var(--card-pad); border-bottom: 1px solid var(--row-border); display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 5px 12px; }
  .tbl.cards td { padding: 0 !important; border: 0; }
  .tbl.cards td[data-k] { display: flex; justify-content: space-between; gap: 12px; grid-column: 1 / -1; color: var(--text-2); font-size: var(--fs-sm); text-align: right; }
  .tbl.cards td[data-k]::before { content: attr(data-k); color: var(--muted); text-align: left; flex: none; }
  .tbl.cards tr.row.is-cur, .tbl.cards tr.row.is-sel, .tbl.cards tr.crow.is-cur { background: var(--navy-050); box-shadow: inset 3px 0 0 var(--navy-800); }
  .tbl.cards tr.row.is-cur td, .tbl.cards tr.row.is-sel td, .tbl.cards tr.crow.is-cur td { background: none !important; box-shadow: none !important; }
  .tbl.cards td.c-main { grid-column: 1; }
  .tbl.cards td.c-side { grid-column: 2; grid-row: 1; text-align: right; }
  .tbl.cards td.c-hide { display: none; }
  .only-m { display: inline; }
  .tbl.cards tr.grp { padding: 0; }
  .tbl.cards tr.grp td { padding: 9px var(--card-pad) !important; }
  .tbl.cards tfoot tr { padding: 12px var(--card-pad); display: flex; justify-content: space-between; gap: 12px; background: #f8f5ef; }
  .tbl.cards tfoot td { background: none; border: 0; }
  .flow { grid-template-columns: minmax(0, 1fr); }
  .flow-arrow { transform: rotate(90deg); }
  .drawer { top: auto; left: 0; right: 0; bottom: 0; width: 100%; max-height: calc(100dvh - var(--sat) - 12px); border-radius: 22px 22px 0 0; transform: translateY(105%); }
  .drawer.is-on { transform: none; }
  .drawer-body { padding: 16px max(18px, var(--sar)) 24px max(18px, var(--sal)); }
  .drawer-head { padding-left: max(18px, var(--sal)); padding-right: max(14px, var(--sar)); }
  .drawer-foot { padding-left: max(18px, var(--sal)); padding-right: max(18px, var(--sar)); }
  /* iOS Safari přibližuje stránku u polí s písmem pod 16 px – v celé správě 16 px */
  .app input:not([type="checkbox"]):not([type="radio"]):not([type="range"]), .app select, .app textarea { font-size: 16px !important; }
  /* fokus a kotvy nekončí pod přilepenou horní lištou ani pod spodní lištou */
  html { scroll-padding-top: calc(var(--sat) + 104px + 12px); scroll-padding-bottom: calc(68px + var(--sab)); }
  /* Přilepený pruh s tlačítky formuláře (Tailwind `sticky bottom-0`, např. Uložit
     změny ve fotokontrole) se drží NAD spodní lištou (6 + 52 + 6 px + okraj 1 px
     + bezpečná zóna), jinak by ho lišta zakryla. Váha 0,3,0 přebije `.bottom-0`. */
  .view .sticky.bottom-0 { bottom: calc(65px + var(--sab)); }
}
@media (max-width: 767px) {
  /* otevřená klávesnice (fokus v textovém poli): spodní lišta se schová, aby nepřekrývala pole */
  .app:has(:is(input:not([type="checkbox"]):not([type="radio"]):not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="file"]):not([type="range"]), textarea, select):focus) .bottombar { display: none; }
  /* … a přilepený pruh formuláře se pak vrátí ke spodnímu okraji */
  .app:has(:is(input:not([type="checkbox"]):not([type="radio"]):not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="file"]):not([type="range"]), textarea, select):focus) .view .sticky.bottom-0 { bottom: 0; }
}
@media (max-width: 360px) {
  .bottombar { padding-left: max(6px, var(--sal)); padding-right: max(6px, var(--sar)); }
}
@media (max-width: 420px) {
  .g-kpi, .facts { gap: 8px; }
  .g-kpi .card, .facts .card { --card-pad: 14px; }
  .kpi { gap: 8px; }
  .kpi-value, .tile .v { font-size: 20px; }
  .kpi-icon { width: 28px; height: 28px; }
  .kpi-sub, .tile .s { font-size: 12px; }
  .kpi-foot .st, .tile .st { font-size: 11.5px; }
  .sumrow > div { padding: 2px 12px; }
  .sumrow .v { font-size: 18px; }
  .month output, .month .month-t { min-width: 104px; }
  .ph-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .sheet-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 340px) {
  .g-kpi, .facts, .sumrow { grid-template-columns: minmax(0, 1fr); }
  .sumrow > div { border-left: 0 !important; padding-left: 0 !important; }
}


/* ─────────────────────────────────────────────────────────────────────────────
   12. Přístupnost a tisk
   ───────────────────────────────────────────────────────────────────────────── */
@media (prefers-reduced-transparency: reduce), (prefers-contrast: more) {
  .topbar, .bottombar { background: #ffffff; -webkit-backdrop-filter: none; backdrop-filter: none; }
}
@media (prefers-reduced-motion: reduce) {
  /* .app sám kvůli přechodu šířky sloupce panelu (připnutí) */
  .app, .app *, .app *::before, .app *::after, .sheet, .scrim, .toast, .skip, .drawer { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
/* Tisk: jen obsah stránky, bez panelu, lišt a listu Další */
@media print {
  body.ark::before, .skip, .rail, .topbar, .bottombar, .sheet, .scrim, .toast, .view-head .back, .view-head .pohledy { display: none !important; }
  .app { display: block; padding: 0; background: #ffffff; }
  .view { max-width: none; padding: 0; }
}


/* ─────────────────────────────────────────────────────────────────────────────
   13. Pojistka proti preflightu Tailwind CDN
   Styl Tailwindu se vkládá do stránky až za tento soubor. Starší verze
   preflightu nulují pozadí tlačítek selektorem [type='button'|'submit'] se
   stejnou vahou jako třída – pozadí tlačítek se proto opakuje s vyšší vahou.
   ───────────────────────────────────────────────────────────────────────────── */
button.btn, input.btn { background-color: var(--btn-bg); }
button.btn-primary, input.btn-primary { background-color: var(--accent); }
button.btn-danger, input.btn-danger { background-color: var(--bad); }
button.btn-ghost { background-color: transparent; }
button.icon-btn { background-color: var(--btn-bg); }
button.fchip { background-color: var(--btn-bg); }
button.fchip[aria-pressed="true"] { background-color: var(--navy-800); }
button.sheet-item { background-color: var(--surface-2); }
button.zav { background-color: var(--surface); }
@media (hover: hover) and (pointer: fine) {
  button.btn:hover { background-color: var(--btn-hover); }
  button.btn-primary:hover { background-color: var(--accent-hover); }
  button.btn-danger:hover { background-color: #9a2019; }
  button.btn-ghost:hover { background-color: var(--accent-soft); }
  button.icon-btn:hover { background-color: var(--btn-hover); }
}


/* ─────────────────────────────────────────────────────────────────────────────
   14. Doplňky z balíčků stránek (redesign 2026-11, koordinátor)
   Společná pravidla, která si jednotlivé balíčky dopisovaly samy.
   ───────────────────────────────────────────────────────────────────────────── */
/* Atribut hidden platí i u komponent s vlastním display (tlačítko, hláška). */
#obsah [hidden] { display: none !important; }
/* Pole s upozorněním (vytěžený údaj k ověření) vedle .input.is-invalid. */
.input.is-warn { border-color: var(--warn); background-color: var(--warn-bg); }
/* Dotyk na každé šířce: ovládací prvky obsahu nejméně 44 px, písmo polí 16 px
   (iOS jinak při klepnutí do pole stránku přiblíží). */
@media (pointer: coarse) {
  #obsah .btn, #obsah .btn-sm, #obsah .seg a, #obsah .fchip, #obsah .select, #obsah .input,
  #obsah .why > summary, #obsah .fold > summary, #obsah a.link { min-height: 44px; }
  .app input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="hidden"]),
  .app select, .app textarea { font-size: 16px; }
}
/* Telefon: hlavní buňka karty tabulky vždy nahoře; dlouhé popisky tlačítek se zalomí. */
@media (max-width: 767px) {
  .tbl.cards td.c-main { grid-row: 1; }
  .btn { white-space: normal; text-align: center; }
}
/* Tabulka v posuvném obalu (.tbl-scroll, overflow-x-auto…): obal se pro přilepené záhlaví stává
   posuvnou plochou, takže odsazení o výšku horní lišty by záhlaví posunulo PŘES první řádek
   (v historii plateb tak zmizel nejnovější měsíc). V obalu je záhlaví normálně v toku. */
.tbl-scroll .tbl th, [class*="overflow-x-auto"] .tbl th, [class*="overflow-auto"] .tbl th,
[class*="overflow-x-scroll"] .tbl th, .responsive-table .tbl th { position: static; }


/* ─────────────────────────────────────────────────────────────────────────────
   15. Vysvětlivka „i“ (templates/_vysvetlivka.html, úprava 12. 11. 2026)
   Doplňující vysvětlení u položky schované za ikonou „i“ v kolečku. Bublinu
   vykreslí static/js/arkovia.js přímo do <body> (position: fixed), takže ji
   neořízne žádný rodič (tabulka, karta, posuvný obal) a vejde se do okna.
   Bez JS se text ukáže vedle ikony při najetí myší nebo při fokusu.
   ───────────────────────────────────────────────────────────────────────────── */
.tip { display: inline-flex; align-items: center; vertical-align: middle; position: relative; margin-left: 4px; line-height: 1; }
.tip-btn {
  position: relative; display: inline-grid; place-items: center; flex: none;
  width: 22px; height: 22px; padding: 0; margin: -3px 0;
  border: 0; border-radius: 999px; background: transparent; color: var(--muted);
  font: inherit; line-height: 1; cursor: help; touch-action: manipulation;
}
/* main form button má jinak min-height 44 px (oddíl 4) */
main form .tip .tip-btn, .tip .tip-btn { min-height: 0; }
button.tip-btn { background-color: transparent; }
.tip-btn .ic { width: 16px; height: 16px; stroke-width: 2; }
/* větší plocha pro prst, ikona přitom nezabírá víc místa */
.tip-btn::after { content: ""; position: absolute; inset: -6px; border-radius: 999px; }
.tip-btn[aria-expanded="true"], button.tip-btn[aria-expanded="true"] { color: var(--accent-text); background-color: var(--navy-050); }
.tip-btn:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
@media (hover: hover) and (pointer: fine) {
  button.tip-btn:hover { color: var(--accent-text); background-color: var(--navy-050); }
}
/* text v obsahu stránky: se skriptem jen zdroj bubliny (čtečka ho dostane přes aria-describedby) */
.tip-text { display: none; }
.tip-pop,
html:not(.ark-js) .tip:hover > .tip-text,
html:not(.ark-js) .tip:focus-within > .tip-text {
  box-sizing: border-box; width: max-content; max-width: min(360px, calc(100vw - 24px));
  padding: 10px 12px; border-radius: 10px;
  background: var(--surface); border: 1px solid var(--border-strong); box-shadow: var(--shadow-pop);
  color: var(--text-2); font: 400 var(--fs-sm)/1.45 var(--font-ui); text-align: left;
  letter-spacing: normal; text-transform: none; white-space: normal; overflow-wrap: break-word;
}
html:not(.ark-js) .tip:hover > .tip-text,
html:not(.ark-js) .tip:focus-within > .tip-text { display: block; position: absolute; z-index: 120; top: calc(100% + 6px); left: 0; }
.tip-pop { position: fixed; z-index: 120; top: 0; left: 0; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; }
.tip-pop[hidden] { display: none; }
.tip-pop.je-pripnuta { padding-right: 38px; }
.tip-pop strong, .tip-pop b { color: var(--text); font-weight: 600; }
.tip-p { display: block; }
.tip-li { display: list-item; list-style: disc; margin-left: 18px; }
.tip-p + .tip-p, .tip-p + .tip-li, .tip-li + .tip-p { margin-top: 6px; }
.tip-pop-x {
  display: none; position: absolute; top: 5px; right: 5px; width: 28px; height: 28px; padding: 0;
  place-items: center; border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer;
}
button.tip-pop-x { background-color: transparent; }
.tip-pop.je-pripnuta .tip-pop-x { display: inline-grid; }
.tip-pop-x::after { content: ""; position: absolute; inset: -6px; }
/* sonda pro okraje výřezu displeje (env() v JS přímo přečíst nejde) */
.tip-sonda {
  position: fixed; top: 0; left: 0; width: 0; height: 0; visibility: hidden; pointer-events: none;
  padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
}
@media (pointer: coarse) {
  .tip-pop { font-size: 14px; }
}
/* telefon: bublina přes celou šířku mezi okraji, skript nastaví jen svislou polohu */
@media (max-width: 640px) {
  .tip-pop { left: max(12px, var(--sal)) !important; right: max(12px, var(--sar)); width: auto; max-width: none; }
}
@media print {
  .tip-btn, .tip-pop { display: none !important; }
}
