/* Písma Lexend a Manrope (SIL Open Font License 1.1, viz pisma/OFL-*.txt) – uložená přímo v aplikaci */
@font-face { font-family: "Lexend"; font-style: normal; font-display: swap; font-weight: 100 900;
  src: url(pisma/lexend-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-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Lexend"; font-style: normal; font-display: swap; font-weight: 100 900;
  src: url(pisma/lexend-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: "Manrope"; font-style: normal; font-display: swap; font-weight: 200 800;
  src: url(pisma/manrope-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-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Manrope"; font-style: normal; font-display: swap; font-weight: 200 800;
  src: url(pisma/manrope-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; }

/* ============ Domácí Technik – vzhled aplikace ============ */
:root {
  --bg: #F2F5F8;
  --surface: #FFFFFF;
  --surface-2: #EBF1F6;
  --line: #D8E1E9;
  --line-strong: #B7C6D4;
  --ink: #0F2436;
  --ink-2: #3F5467;
  --ink-3: #5B6F82;
  --brand: #2A70A0;
  --brand-strong: #1B5580;
  --brand-soft: #E2EDF6;
  --on-brand: #FFFFFF;
  --pow-a: #7DB25E;
  --pow-b: #E6CF5B;
  --on-pow: #0F2436;
  --planned: #2A70A0;   --planned-soft: #E2EDF6;
  --overdue: #B93A31;   --overdue-soft: #FBE6E3;
  --unpaid: #8A5A00;    --unpaid-soft: #FFF1CC;
  --done: #2F7A3A;      --done-soft: #E3F2E1;
  --cancel: #5A6674;    --cancel-soft: #ECEFF3;
  --shadow: 0 1px 2px rgba(15, 36, 54, .05), 0 6px 20px rgba(15, 36, 54, .07);
  --shadow-up: 0 -1px 0 rgba(15, 36, 54, .06), 0 -8px 24px rgba(15, 36, 54, .06);
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --f-display: "Lexend", "Manrope", system-ui, sans-serif;
  --f-ui: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --tab-h: 66px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0C1620; --surface: #13212E; --surface-2: #1A2B3A; --line: #243748; --line-strong: #36506A;
    --ink: #E7EEF5; --ink-2: #B3C3D2; --ink-3: #91A5B8;
    --brand: #6AAAD9; --brand-strong: #9CC7EA; --brand-soft: #173247; --on-brand: #0C1620;
    --on-pow: #0C1620;
    --planned: #7DB6E3; --planned-soft: #173247;
    --overdue: #F29389; --overdue-soft: #3B1E1C;
    --unpaid: #E7C160;  --unpaid-soft: #3A2F13;
    --done: #8DCB85;    --done-soft: #1B3321;
    --cancel: #A3B0BD;  --cancel-soft: #222E3A;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
    --shadow-up: 0 -1px 0 rgba(255, 255, 255, .04), 0 -8px 24px rgba(0, 0, 0, .3);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0C1620; --surface: #13212E; --surface-2: #1A2B3A; --line: #243748; --line-strong: #36506A;
  --ink: #E7EEF5; --ink-2: #B3C3D2; --ink-3: #91A5B8;
  --brand: #6AAAD9; --brand-strong: #9CC7EA; --brand-soft: #173247; --on-brand: #0C1620;
  --on-pow: #0C1620;
  --planned: #7DB6E3; --planned-soft: #173247;
  --overdue: #F29389; --overdue-soft: #3B1E1C;
  --unpaid: #E7C160;  --unpaid-soft: #3A2F13;
  --done: #8DCB85;    --done-soft: #1B3321;
  --cancel: #A3B0BD;  --cancel-soft: #222E3A;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
  --shadow-up: 0 -1px 0 rgba(255, 255, 255, .04), 0 -8px 24px rgba(0, 0, 0, .3);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 500 15px/1.45 var(--f-ui);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--brand); }
svg { display: block; }
.ico { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.ico.sm { width: 18px; height: 18px; }
.ico .fill { fill: currentColor; stroke: none; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-3); }
.d-only { display: none; }
@media (min-width: 960px) { .d-only { display: block; } }
.col { min-width: 0; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* ---------- rozvržení ---------- */
.app { min-height: 100%; }
.side { display: none; }
.main {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 4px 16px calc(var(--tab-h) + 32px + env(safe-area-inset-bottom, 0px));
}
.topbar {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 30;
  display: flex; align-items: center; gap: 12px;
  min-height: 58px; padding: 8px 16px;
  background: var(--bg);
  border-bottom: 1px solid transparent;
}
.topbar.scrolled { border-bottom-color: var(--line); }
.topbar h1 { margin: 0; font: 600 19px/1.2 var(--f-display); letter-spacing: -.01em; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mark { width: 36px; height: 36px; border-radius: 10px; background: #fff; box-shadow: 0 0 0 1px var(--line); overflow: hidden; flex: none; }
.mark img { width: 100%; height: 100%; display: block; }
.icon-btn {
  width: 44px; height: 44px; margin-left: -8px; border: 0; border-radius: 12px; background: transparent;
  display: grid; place-items: center; color: var(--ink);
}
.icon-btn:hover { background: var(--surface-2); }
.demo-pill {
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink-2);
  font: 700 11px/1 var(--f-ui); letter-spacing: .08em; text-transform: uppercase;
  padding: 8px 10px; border-radius: 999px; white-space: nowrap;
}

/* spodní lišta (mobil) */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  height: calc(var(--tab-h) + env(safe-area-inset-bottom, 0px));
  padding: 0 6px env(safe-area-inset-bottom, 0px);
  display: grid; grid-template-columns: repeat(5, 1fr); align-items: stretch;
  background: var(--surface); box-shadow: var(--shadow-up);
}
.tab {
  border: 0; background: transparent; color: var(--ink-3);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  font: 700 11px/1.1 var(--f-ui); letter-spacing: .01em; padding: 6px 0;
}
.tab[aria-current="page"] { color: var(--brand); }
.tab[aria-current="page"] .ico { stroke-width: 2.2; }
.tab-power { position: relative; }
.tab-power .pw {
  width: 58px; height: 58px; margin-top: -26px; border-radius: 50%;
  background: var(--surface); display: grid; place-items: center;
  box-shadow: 0 0 0 5px var(--bg), var(--shadow);
}
.tab-power .pw .ico { width: 30px; height: 30px; stroke: url(#pwgrad); stroke-width: 2.6; }
.tab-power[aria-current="page"] .pw { background: linear-gradient(135deg, var(--pow-a), var(--pow-b)); }
.tab-power[aria-current="page"] .pw .ico { stroke: var(--on-pow); }
.tab-power span:last-child { margin-top: 1px; }

/* počítač */
@media (min-width: 960px) {
  .app { display: grid; grid-template-columns: 252px minmax(0, 1fr); }
  .side {
    display: flex; flex-direction: column; gap: 4px;
    position: sticky; top: 0; height: 100vh; padding: 22px 14px;
    border-right: 1px solid var(--line); background: var(--surface);
  }
  .brand { display: flex; align-items: center; gap: 12px; padding: 4px 8px 22px; }
  .brand .mark { width: 44px; height: 44px; border-radius: 12px; }
  .brand b { display: block; font: 600 17px/1.15 var(--f-display); letter-spacing: -.01em; }
  .brand small { color: var(--ink-3); font-size: 12px; }
  .nav-item {
    display: flex; align-items: center; gap: 12px; border: 0; background: transparent; text-align: left;
    padding: 11px 12px; border-radius: 10px; color: var(--ink-2); font-weight: 650;
  }
  .nav-item:hover { background: var(--surface-2); color: var(--ink); }
  .nav-item[aria-current="page"] { background: var(--brand-soft); color: var(--brand-strong); }
  .nav-item.power { margin: 6px 0; padding: 12px; background: linear-gradient(135deg, var(--pow-a), var(--pow-b)); color: var(--on-pow); font-weight: 800; }
  .nav-item.power:hover { filter: brightness(1.04); color: var(--on-pow); }
  .nav-item.power[aria-current="page"] { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--pow-a); }
  .side-foot { margin-top: auto; padding: 12px; border-radius: 12px; background: var(--surface-2); color: var(--ink-2); font-size: 12.5px; }
  .side-foot b { display: block; color: var(--ink); font-size: 13px; }
  .tabbar, .topbar { display: none; }
  .main { padding: 26px 40px 56px; }
  .fab { display: none !important; }
}

/* ---------- typografie stránek ---------- */
.page-h { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 20px; margin: 6px 0 18px; }
.page-h h1, .page-h h2 { margin: 0; font: 600 28px/1.1 var(--f-display); letter-spacing: -.02em; text-wrap: balance; }
.eyebrow { margin: 0 0 6px; color: var(--ink-3); font: 700 12px/1.2 var(--f-ui); letter-spacing: .08em; text-transform: uppercase; }
.h-sec { margin: 0 0 12px; color: var(--ink-3); font: 800 12px/1.2 var(--f-ui); letter-spacing: .08em; text-transform: uppercase; }
.sec-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.sec-row .link { border: 0; background: none; color: var(--brand); font-weight: 700; font-size: 13.5px; padding: 6px 0; }
@media (max-width: 959px) { .page-h.m-hide { display: none; } }

/* ---------- panely a mřížky ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px; }
.stack { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.grid2 { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; margin-top: 16px; }
.grid2 > * { min-width: 0; }
@media (min-width: 960px) { .grid2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; } }

/* dlaždice s čísly */
.kpis {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1px; overflow: hidden;
  background: var(--line); border: 1px solid var(--line); border-radius: var(--r-lg);
}
.kpi { background: var(--surface); padding: 14px 16px 16px; min-width: 0; }
.kpi-l { color: var(--ink-3); font-size: 12.5px; font-weight: 700; }
.kpi-v { margin-top: 4px; font: 600 25px/1.1 var(--f-display); letter-spacing: -.02em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.kpi-s { margin-top: 4px; color: var(--ink-3); font-size: 12.5px; line-height: 1.3; }
@media (min-width: 720px) { .kpis { grid-template-columns: repeat(4, 1fr); } .kpi-v { font-size: 28px; } }

/* upozornění */
.attn { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
@media (min-width: 720px) { .attn { grid-template-columns: repeat(4, 1fr); } }
.attn-i {
  text-align: left; border: 1px solid transparent; border-radius: var(--r-md); padding: 12px 14px;
  background: var(--surface-2); color: var(--ink); display: flex; flex-direction: column; gap: 2px; min-width: 0;
}
.attn-i:hover { border-color: var(--line-strong); }
.attn-i .t { font-size: 12.5px; font-weight: 700; color: var(--ink-2); }
.attn-i .v { font: 600 21px/1.15 var(--f-display); font-variant-numeric: tabular-nums; }
.attn-i .s { font-size: 12.5px; color: var(--ink-3); line-height: 1.3; }
.tone-unpaid { background: var(--unpaid-soft); } .tone-unpaid .v, .tone-unpaid .s { color: var(--unpaid); }
.tone-overdue { background: var(--overdue-soft); } .tone-overdue .v, .tone-overdue .s { color: var(--overdue); }
.tone-planned { background: var(--planned-soft); } .tone-planned .v { color: var(--planned); }
.tone-done { background: var(--done-soft); } .tone-done .v, .tone-done .s { color: var(--done); }

/* roky */
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px; margin: -2px; }
.chips::-webkit-scrollbar { display: none; }
@media (min-width: 960px) { .chips.wrap { flex-wrap: wrap; overflow: visible; } }
.chip {
  flex: none; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink-2);
  border-radius: 999px; padding: 8px 14px; font-weight: 700; font-size: 13.5px; line-height: 1.1;
  display: inline-flex; align-items: center; gap: 6px;
}
.chip .n { font-variant-numeric: tabular-nums; color: var(--ink-3); font-weight: 700; }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.chip[aria-pressed="true"] .n { color: var(--bg); opacity: .75; }

/* štítky */
.pill {
  display: inline-flex; align-items: center; gap: 5px; border-radius: 999px; padding: 3px 9px;
  font-size: 12px; font-weight: 750; line-height: 1.35; white-space: nowrap;
}
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.planned { background: var(--planned-soft); color: var(--planned); }
.pill.overdue { background: var(--overdue-soft); color: var(--overdue); }
.pill.unpaid { background: var(--unpaid-soft); color: var(--unpaid); }
.pill.done { background: var(--done-soft); color: var(--done); }
.pill.cancel { background: var(--cancel-soft); color: var(--cancel); }

/* ---------- seznamy ---------- */
.list { display: flex; flex-direction: column; gap: 8px; }
.up {
  width: 100%; display: grid; grid-template-columns: 76px 1fr auto; align-items: center; gap: 12px; text-align: left;
  border: 0; border-radius: var(--r-md); background: var(--surface-2); padding: 10px 12px; color: var(--ink);
}
.up:hover { background: var(--brand-soft); }
.up-when { font: 700 12px/1.2 var(--f-ui); color: var(--planned); text-transform: none; }
.up-when.overdue { color: var(--overdue); letter-spacing: .04em; }
.up-when.today { color: var(--done); }
.up b { display: block; font-weight: 750; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.up .muted { display: block; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.up > .ico { color: var(--ink-3); }
.empty { padding: 18px; text-align: center; color: var(--ink-3); border: 1px dashed var(--line-strong); border-radius: var(--r-md); }

.job {
  width: 100%; text-align: left; display: flex; flex-direction: column; gap: 6px;
  border: 1px solid var(--line); background: var(--surface); border-radius: var(--r-md); padding: 12px 14px; color: var(--ink);
}
.job:hover { border-color: var(--line-strong); }
.job.sel { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
.job-top { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.job-name { font-weight: 750; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.job-amt { font: 600 15.5px/1.2 var(--f-display); font-variant-numeric: tabular-nums; white-space: nowrap; }
.job-amt.pre { color: var(--ink-3); font-weight: 500; }
.job-meta { font-size: 13px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.job-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.job.cancelled .job-name { text-decoration: line-through; color: var(--ink-3); }
.group-h { margin: 18px 2px 8px; color: var(--ink-3); font: 800 12px/1.2 var(--f-ui); letter-spacing: .08em; text-transform: uppercase; }
.group-h:first-child { margin-top: 14px; }

.search { position: relative; margin-bottom: 12px; }
.search .ico { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--ink-3); }
.search input { padding-left: 42px; }

.split { display: block; }
@media (min-width: 960px) {
  .split { display: grid; grid-template-columns: minmax(340px, 420px) minmax(0, 1fr); gap: 24px; align-items: start; }
  .split > .pane { position: sticky; top: 24px; }
}
.pane-empty { display: grid; place-items: center; min-height: 280px; color: var(--ink-3); text-align: center; }

/* detail */
.det-h { display: flex; flex-direction: column; gap: 8px; }
.det-h h2 { margin: 0; font: 600 23px/1.2 var(--f-display); letter-spacing: -.01em; text-wrap: balance; }
.acts { display: grid; grid-template-columns: repeat(auto-fit, minmax(74px, 1fr)); gap: 8px; margin: 16px 0; }
.act {
  border: 1px solid var(--line); background: var(--surface-2); border-radius: var(--r-md); color: var(--brand-strong);
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 6px; font-size: 12.5px; font-weight: 750; text-decoration: none;
}
.act:hover { border-color: var(--brand); }
.act.power { background: linear-gradient(135deg, var(--pow-a), var(--pow-b)); color: var(--on-pow); border-color: transparent; }
.dl { display: grid; grid-template-columns: 1fr; margin: 0; }
.dl > div { display: grid; grid-template-columns: 118px minmax(0, 1fr); gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.dl dd .pill { white-space: normal; }
.dl dt { color: var(--ink-3); font-size: 13px; font-weight: 700; }
.dl dd { margin: 0; overflow-wrap: anywhere; }
.dl dd.big { font: 600 20px/1.2 var(--f-display); font-variant-numeric: tabular-nums; }
.dl dd .dd-sub { display: block; margin-top: 3px; font: 500 14px/1.35 var(--f-ui); color: var(--ink-2); letter-spacing: 0; }
.det-foot { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }

/* ---------- formuláře ---------- */
.form { display: flex; flex-direction: column; gap: 14px; }
.fset { border: 1px solid var(--line); background: var(--surface); border-radius: var(--r-lg); padding: 16px; margin: 0; display: flex; flex-direction: column; gap: 14px; }
.fset > .h-sec { margin: 0; }
#jobform { max-width: 780px; }
.row { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
.row.three { grid-template-columns: 1fr 1fr 1fr; }
@media (max-width: 420px) { .row.three { grid-template-columns: 1fr 1fr; } }
.fld { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.fld > label, .fld > .lbl { font-size: 13px; font-weight: 750; color: var(--ink-2); }
.hint { font-size: 12.5px; color: var(--ink-3); line-height: 1.35; }
.inp, select.inp, textarea.inp {
  width: 100%; min-height: 48px; padding: 11px 13px; border-radius: 11px;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink);
  font-weight: 600; font-size: 16px; line-height: 1.3; appearance: none; -webkit-appearance: none;
}
select.inp {
  padding-right: 38px;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-3) 50%), linear-gradient(135deg, var(--ink-3) 50%, transparent 50%);
  background-position: calc(100% - 20px) 21px, calc(100% - 15px) 21px; background-size: 5px 5px; background-repeat: no-repeat;
}
textarea.inp { min-height: 88px; resize: vertical; }
.inp:focus { outline: 2px solid var(--brand); outline-offset: 0; border-color: var(--brand); }
.inp.num { font-variant-numeric: tabular-nums; }
.inp[aria-invalid="true"] { border-color: var(--overdue); }
.unit { position: relative; }
.unit .inp { padding-right: 52px; }
.unit > span { position: absolute; right: 13px; top: 50%; transform: translateY(-50%); color: var(--ink-3); font-weight: 700; font-size: 14px; pointer-events: none; }
.time-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.now-btn { min-width: 64px; border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--brand-strong); border-radius: 11px; font-weight: 800; font-size: 14px; padding: 0 12px; }
.now-btn:hover { border-color: var(--brand); }

.seg { display: flex; padding: 3px; gap: 3px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); }
.seg button {
  flex: 1 1 0; min-height: 42px; border: 0; border-radius: 9px; background: transparent; color: var(--ink-2);
  font-weight: 750; font-size: 14px; padding: 6px 8px; line-height: 1.15;
}
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(15, 36, 54, .12), 0 0 0 1px var(--line-strong); }
.seg.warn button[aria-pressed="true"].is-cancel { background: var(--cancel-soft); color: var(--ink); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 10px 18px; border-radius: 12px; border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--ink); font-weight: 800; font-size: 15px; text-decoration: none;
}
.btn:hover { border-color: var(--ink-3); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.btn.primary:hover { background: var(--brand-strong); border-color: var(--brand-strong); }
.btn.danger { color: var(--overdue); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--brand); }
.btn.block { width: 100%; }
.btn.power {
  width: 100%; min-height: 58px; font-size: 17px; border: 0; color: var(--on-pow);
  background: linear-gradient(135deg, var(--pow-a), var(--pow-b));
  box-shadow: 0 1px 0 rgba(255, 255, 255, .4) inset, 0 6px 18px rgba(125, 178, 94, .35);
}
.btn.power .ico { stroke-width: 2.6; }
.btn.power:hover { filter: brightness(1.04); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.fab {
  position: fixed; right: 16px; bottom: calc(var(--tab-h) + 18px + env(safe-area-inset-bottom, 0px)); z-index: 35;
  width: 58px; height: 58px; border-radius: 18px; border: 0; background: var(--brand); color: var(--on-brand);
  display: grid; place-items: center; box-shadow: var(--shadow);
}
.fab .ico { width: 26px; height: 26px; stroke-width: 2.4; }

/* ---------- Na místě ---------- */
.onsite { display: flex; flex-direction: column; gap: 16px; }
.o-left, .o-right { display: contents; }
.o1 { order: 1; } .o2 { order: 2; } .o3 { order: 3; } .o4 { order: 4; } .o5 { order: 5; }
@media (min-width: 960px) {
  .onsite { display: grid; grid-template-columns: minmax(0, 1fr) 380px; align-items: start; }
  .o-left, .o-right { display: flex; flex-direction: column; gap: 16px; }
  .o-right { position: sticky; top: 24px; }
}
.row.times { grid-template-columns: 1fr; }
@media (min-width: 560px) { .row.times { grid-template-columns: 1fr 1fr; } }
.pick { display: flex; flex-direction: column; gap: 8px; }
.pick-i {
  display: grid; grid-template-columns: 24px 1fr; gap: 10px; align-items: start; text-align: left;
  border: 1px solid var(--line); background: var(--surface); border-radius: var(--r-md); padding: 11px 12px; color: var(--ink);
}
.pick-i .dot { width: 20px; height: 20px; margin-top: 1px; border-radius: 50%; border: 2px solid var(--line-strong); display: grid; place-items: center; }
.pick-i[aria-pressed="true"] { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); background: var(--brand-soft); }
.pick-i[aria-pressed="true"] .dot { border-color: var(--brand); }
.pick-i[aria-pressed="true"] .dot::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--brand); }
.pick-i b { display: block; font-weight: 750; }
.pick-i small { display: block; color: var(--ink-3); font-size: 13px; }
.pick-i small .overdue { color: var(--overdue); font-weight: 800; }
.link-btn { align-self: flex-start; border: 0; background: none; color: var(--brand); font-weight: 750; font-size: 14px; padding: 6px 2px; }
.prep { background: var(--surface-2); border-radius: var(--r-md); padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; }
.prep p { margin: 0; }
.prep .acts { margin: 0; }
.price {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px; display: flex; flex-direction: column; gap: 14px;
}
.price-l { color: var(--ink-3); font: 800 12px/1.2 var(--f-ui); letter-spacing: .08em; text-transform: uppercase; }
.price-v { font: 600 44px/1 var(--f-display); letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.price-v.zero { color: var(--cancel); }
.price-v small { font-size: 22px; letter-spacing: 0; margin-left: 4px; color: var(--ink-2); }
.price-why { color: var(--ink-2); font-size: 14px; }
.price-why b { color: var(--ink); }
.ruler { display: flex; flex-wrap: wrap; gap: 8px 10px; }
.ruler .hr { display: flex; flex-direction: column; gap: 4px; }
.ruler .q { display: flex; gap: 3px; }
.ruler .c { width: 22px; height: 26px; border-radius: 5px; background: var(--surface-2); border: 1px solid var(--line); position: relative; overflow: hidden; }
.ruler .c.billed { border-color: var(--brand); background: var(--brand-soft); }
.ruler .c > i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--brand); }
.ruler .hr > span { font-size: 11.5px; font-weight: 700; color: var(--ink-3); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12.5px; color: var(--ink-3); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.legend .w { background: var(--brand); }
.legend .b { background: var(--brand-soft); border: 1px solid var(--brand); }
.cancel-note { background: var(--cancel-soft); color: var(--ink-2); border-radius: var(--r-md); padding: 10px 12px; font-size: 14px; }

/* ---------- Škola ---------- */
.sch-sum { display: flex; flex-wrap: wrap; gap: 8px; }
.sch-sum .pill::before { display: none; }
.task {
  display: grid; grid-template-columns: 28px 104px minmax(0, 1fr) 36px; gap: 8px; align-items: center;
  grid-template-areas: "no txt txt x" ". min note note";
  padding: 10px 0; border-top: 1px solid var(--line);
}
.task .no { grid-area: no; } .task .txt { grid-area: txt; } .task .min { grid-area: min; } .task .note { grid-area: note; } .task .x { grid-area: x; }
@media (min-width: 720px) {
  .task { grid-template-columns: 28px minmax(0, 1fr) 110px 36px; grid-template-areas: "no txt min x" ". note note ."; }
}
.task:first-child { border-top: 0; }
.task .no { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 800; background: var(--surface-2); color: var(--ink-3); }
.task.done .no { background: var(--done-soft); color: var(--done); }
.task .inp { min-height: 42px; padding: 8px 10px; font-size: 15px; }
.task textarea.inp { min-height: 42px; resize: none; overflow: hidden; line-height: 1.35; }
.task .x { width: 36px; height: 36px; border: 0; background: transparent; color: var(--ink-3); border-radius: 10px; display: grid; place-items: center; }
.task .x:hover { background: var(--overdue-soft); color: var(--overdue); }
.add-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin-top: 10px; }
details.arch { border-top: 1px solid var(--line); }
details.arch:first-of-type { border-top: 0; }
details.arch summary { list-style: none; cursor: pointer; display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 12px 0; }
details.arch summary::-webkit-details-marker { display: none; }
details.arch summary b { font-weight: 750; }
details.arch summary .muted { font-size: 13px; grid-column: 1; }
details.arch summary .amt { grid-row: 1 / 3; grid-column: 2; align-self: center; font: 600 16px/1 var(--f-display); font-variant-numeric: tabular-nums; }
.mini { width: 100%; border-collapse: collapse; font-size: 13.5px; margin-bottom: 12px; }
.mini td, .mini th { padding: 7px 8px; border-top: 1px solid var(--line); text-align: left; vertical-align: top; }
.mini th { color: var(--ink-3); font-size: 12px; font-weight: 800; }
.mini td.r, .mini th.r { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------- grafy a tabulky ---------- */
.chart { width: 100%; height: auto; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .ax { fill: var(--ink-3); font: 600 11.5px var(--f-ui); }
.chart .unit { fill: var(--ink-3); font: 700 11px var(--f-ui); }
.chart .val { fill: var(--ink-2); font: 750 11.5px var(--f-ui); }
.chart .bar { fill: var(--brand); }
.chart .bar.cur { fill: var(--pow-a); }
.chart .zero { fill: var(--line); }
.tbl-wrap { overflow-x: auto; margin-top: 8px; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 360px; }
.tbl th, .tbl td { padding: 8px 8px; border-top: 1px solid var(--line); text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl th:first-child, .tbl td:first-child { text-align: left; }
.tbl thead th { color: var(--ink-3); font-size: 12px; font-weight: 800; border-top: 0; }
.tbl tfoot td { font-weight: 800; border-top: 2px solid var(--line-strong); }
.tbl tr.dim td { color: var(--ink-3); }
.bars { display: flex; flex-direction: column; gap: 10px; }
.bar-r { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; font-size: 14px; }
.bar-r .nm { font-weight: 700; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-r .vv { font-variant-numeric: tabular-nums; font-weight: 750; white-space: nowrap; }
.bar-r .track { grid-column: 1 / -1; height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.bar-r .track i { display: block; height: 100%; border-radius: 99px; background: var(--brand); }
.bar-r .sub { grid-column: 1 / -1; font-size: 12.5px; color: var(--ink-3); margin-top: -2px; }

/* Daně */
.tax-hero { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; align-items: flex-end; }
.tax-hero .v { font: 600 38px/1 var(--f-display); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.explain { color: var(--ink-2); font-size: 14px; }
.explain ul { margin: 8px 0 0; padding-left: 18px; }
.explain li + li { margin-top: 6px; }
details.fold summary { cursor: pointer; font-weight: 800; color: var(--brand); padding: 4px 0; }

/* Více (mobil) */
.menu { display: flex; flex-direction: column; gap: 8px; }
.menu button {
  display: grid; grid-template-columns: 40px 1fr 20px; align-items: center; gap: 12px; text-align: left;
  border: 1px solid var(--line); background: var(--surface); border-radius: var(--r-md); padding: 12px 14px; color: var(--ink);
}
.menu button .ic { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-strong); }
.menu button b { display: block; font-weight: 750; }
.menu button small { color: var(--ink-3); font-size: 13px; }

/* Nastavení */
.list-edit { display: flex; flex-direction: column; gap: 8px; }
.list-edit .li { display: grid; grid-template-columns: 1fr 44px; gap: 8px; }
.list-edit .x { border: 1px solid var(--line); background: var(--surface); color: var(--ink-3); border-radius: 11px; display: grid; place-items: center; }
.list-edit .x:hover { color: var(--overdue); border-color: var(--overdue); }
.iban { font-variant-numeric: tabular-nums; letter-spacing: .02em; }

/* ---------- toast a dialog ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--tab-h) + 20px + env(safe-area-inset-bottom, 0px)); z-index: 60;
  transform: translate(-50%, 12px); opacity: 0; pointer-events: none;
  max-width: min(92vw, 460px); width: max-content;
  background: var(--ink); color: var(--bg); border-radius: 14px; padding: 12px 16px; font-weight: 700; font-size: 14.5px;
  box-shadow: var(--shadow); transition: opacity .18s ease, transform .18s ease;
  display: flex; gap: 10px; align-items: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { background: var(--overdue); color: #fff; }
@media (min-width: 960px) { .toast { bottom: 28px; left: calc(50% + 126px); } }
.modal { position: fixed; inset: 0; z-index: 70; display: grid; align-items: end; justify-items: center; background: rgba(8, 18, 28, .48); padding: 0; }
.modal[hidden] { display: none; }
.sheet {
  width: 100%; max-width: 520px; max-height: 92vh; overflow: auto;
  background: var(--surface); border-radius: 22px 22px 0 0; padding: 20px 18px calc(18px + env(safe-area-inset-bottom, 0px));
  box-shadow: var(--shadow);
}
@media (min-width: 600px) { .modal { align-items: center; padding: 24px; } .sheet { border-radius: 20px; padding: 24px; } }
.sheet h3 { margin: 0 0 8px; font: 600 21px/1.2 var(--f-display); }
.sheet p { margin: 0 0 10px; color: var(--ink-2); }
.sheet-acts { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; margin-top: 18px; }
.sheet-acts .btn { flex: 1 1 140px; }
.qr-box { background: #fff; border-radius: 16px; padding: 12px; width: min(100%, 300px); margin: 6px auto 12px; box-shadow: 0 0 0 1px var(--line); }
.qr-box svg { width: 100%; height: auto; }
.qr-amt { text-align: center; font: 600 32px/1.1 var(--f-display); font-variant-numeric: tabular-nums; }
.qr-meta { text-align: center; color: var(--ink-3); font-size: 13px; }

/* ---------- Fušky (školy a firmy) ---------- */
.stats3 {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); gap: 1px; overflow: hidden;
  background: var(--line); border: 1px solid var(--line); border-radius: var(--r-lg);
}
.stat { background: var(--surface); padding: 12px 14px; min-width: 0; }
.stat .t { display: block; color: var(--ink-3); font-size: 12.5px; font-weight: 700; }
.stat .v { display: block; margin-top: 3px; font: 600 17px/1.25 var(--f-display); font-variant-numeric: tabular-nums; }
.stat.unpaid .v { color: var(--unpaid); }
.suggest {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 6px 12px;
  background: var(--surface-2); border-radius: var(--r-md); padding: 6px 6px 6px 12px; font-size: 14px; color: var(--ink-2);
}
.suggest b { color: var(--ink); }
.suggest .btn { min-height: 38px; padding: 6px 12px; }
.seg .cnt { font-weight: 700; color: var(--ink-3); margin-left: 4px; font-variant-numeric: tabular-nums; }
.odb-contact { margin: 6px 0 0; color: var(--ink-3); font-size: 14px; overflow-wrap: anywhere; }
.arch-foot { display: flex; flex-wrap: wrap; gap: 4px 16px; align-items: center; margin: -4px 0 12px; }
.login-mark { display: flex; align-items: center; gap: 12px; }
.login-mark .mark { width: 44px; height: 44px; border-radius: 12px; }
.login-mark b { display: block; font: 600 17px/1.15 var(--f-display); letter-spacing: -.01em; }
.login-mark small { color: var(--ink-3); font-size: 12.5px; }
.dev { width: 100%; display: grid; grid-template-columns: 40px 1fr auto; align-items: center; gap: 12px; border-radius: var(--r-md); background: var(--surface-2); padding: 10px 12px; }
.dev .ic { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-strong); }
.dev b { display: block; font-weight: 750; }
.dev .muted { display: block; font-size: 13px; }
.dev .btn { min-height: 38px; padding: 6px 10px; }

/* ---------- dlouhé texty: vždy se zalomí, dlouhé se zkrátí na pár řádků ---------- */
.main, .sheet, .toast, .prep, .dl dd, .det-h h2, .page-h h1, .odb-contact, .pick-i b, .pick-i small { overflow-wrap: anywhere; word-break: break-word; }
.main { overflow-x: clip; }
.onsite > *, .prep > *, .form > *, .fset > * { min-width: 0; }
.clamp { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden; }
.clamp.l2 { -webkit-line-clamp: 2; line-clamp: 2; }
.clamp.l5 { -webkit-line-clamp: 5; line-clamp: 5; }
.more-btn { display: inline-flex; border: 0; background: none; padding: 6px 0 2px; color: var(--brand); font-weight: 750; font-size: 13.5px; line-height: 1.2; }
.more-btn:hover { text-decoration: underline; }
.sheet.reader { padding: 0; display: flex; flex-direction: column; }
.reader-h { position: sticky; top: 0; z-index: 1; display: flex; align-items: flex-start; gap: 8px; padding: 12px 8px 12px 18px; background: var(--surface); border-bottom: 1px solid var(--line); }
.reader-h h3 { flex: 1; min-width: 0; margin: 10px 0 0; font: 600 19px/1.25 var(--f-display); overflow-wrap: anywhere; }
.reader-h .icon-btn { margin: 0; flex: none; }
.reader-body { padding: 16px 18px calc(28px + env(safe-area-inset-bottom, 0px)); font-size: 16px; line-height: 1.6; color: var(--ink); overflow-wrap: anywhere; word-break: break-word; }
@media (max-width: 599px) {
  .modal.full { align-items: stretch; }
  .modal.full .sheet.reader { max-width: none; height: 100%; max-height: none; border-radius: 0; }
  .modal.full .reader-h { padding-top: calc(12px + env(safe-area-inset-top, 0px)); }
}
.arch-items { list-style: none; margin: 0 0 12px; padding: 0; }
.arch-items li { padding: 9px 0; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; }
.ai-top { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: baseline; }
.ai-min { color: var(--ink-3); font-size: 13.5px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ai-pozn { color: var(--ink-3); font-size: 13.5px; }

/* finální částka fušky */
.fin { display: flex; flex-direction: column; gap: 2px; background: var(--brand-soft); border-radius: var(--r-md); padding: 12px 14px; }
.fin-v { font: 600 28px/1.1 var(--f-display); letter-spacing: -.02em; font-variant-numeric: tabular-nums; color: var(--ink); }
.fin-v.zero { color: var(--ink-3); }
.fin-why { font-size: 13.5px; color: var(--ink-2); }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ============ napojení na tabulku ============ */
/* stav spojení v horní liště */
.sync-pill {
  display: inline-flex; align-items: center; gap: 6px; flex: none;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink-2);
  font: 700 12.5px/1 var(--f-ui); padding: 7px 11px 7px 9px; border-radius: 999px; white-space: nowrap; min-height: 34px;
}
.sync-pill .ico { width: 18px; height: 18px; }
.sync-pill.ok { color: var(--done); border-color: transparent; background: var(--done-soft); }
.sync-pill.sync { color: var(--planned); border-color: transparent; background: var(--planned-soft); }
.sync-pill.sync .ico { animation: dt-toc 1.2s linear infinite; }
.sync-pill.off { color: var(--unpaid); border-color: transparent; background: var(--unpaid-soft); }
.sync-pill.err { color: var(--overdue); border-color: transparent; background: var(--overdue-soft); }
@keyframes dt-toc { to { transform: rotate(360deg); } }
@media (max-width: 380px) { .sync-pill.ok span { display: none; } .sync-pill.ok { padding: 7px; } }

/* stav spojení v bočním panelu (počítač) */
.side-foot.sync-box { border: 0; text-align: left; line-height: 1.35; cursor: pointer; }
.side-foot.sync-box .sf-row { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.side-foot.sync-box .sf-row b { display: inline; }
.side-foot.sync-box .sf-row .ico { width: 18px; height: 18px; flex: none; }
.side-foot.sync-box.ok .sf-row { color: var(--done); }
.side-foot.sync-box.sync .sf-row { color: var(--planned); }
.side-foot.sync-box.off .sf-row { color: var(--unpaid); }
.side-foot.sync-box.err .sf-row { color: var(--overdue); }
.side-foot.sync-box:hover { filter: brightness(.98); }

/* přihlašovací obrazovka */
body.login .side, body.login .col, body.login .tabbar { display: none !important; }
body.login .app { display: block; }
.login-wrap {
  position: fixed; inset: 0; z-index: 60; overflow-y: auto; background: var(--bg);
  display: flex; align-items: flex-start; justify-content: center;
  padding: calc(28px + env(safe-area-inset-top, 0px)) 16px calc(28px + env(safe-area-inset-bottom, 0px));
}
.login-wrap[hidden] { display: none; }
.login-card {
  width: 100%; max-width: 420px; margin: auto 0; display: flex; flex-direction: column; gap: 16px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 24px 20px; box-shadow: var(--shadow);
}
@media (min-width: 600px) { .login-card { padding: 30px 28px; } }
.login-card .login-mark { margin-bottom: 4px; }
.login-msg { margin: 0; padding: 10px 12px; border-radius: var(--r-md); background: var(--planned-soft); color: var(--planned); font-weight: 650; font-size: 14px; }
.login-msg.err { background: var(--overdue-soft); color: var(--overdue); }
.login-msg[hidden] { display: none; }
.login-note { margin: 0; padding: 10px 12px; border-radius: var(--r-md); background: var(--unpaid-soft); color: var(--unpaid); font-weight: 650; }
.login-inst { border-top: 1px solid var(--line); padding-top: 14px; }
.login-inst .h-sec { margin-bottom: 8px; }
.login-card .link-btn { align-self: center; }

/* změny, které tabulka nepřijala */
.zasekle { display: flex; flex-direction: column; gap: 8px; }
.zasekle .dev .ic { background: var(--overdue-soft); color: var(--overdue); }
.zasekle .dev .muted { white-space: normal; }
