:root {
  --bg: #f2f5fa;
  --card: #ffffff;
  --ink: #18212f;
  --muted: #66728a;
  --line: #dfe5ee;
  --accent: #1f5fd1;
  --accent-ink: #ffffff;
  --stop: #c2412d;
  --ok-bg: #e7effd;
  --err-bg: #fbe6e2;
  --radius: 12px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #10141b; --card: #171d26; --ink: #e5eaf2; --muted: #96a1b5; --line: #263042;
    --accent: #5b9bff; --accent-ink: #0a1220; --stop: #e0644e; --ok-bg: #16243d; --err-bg: #3a1f1a;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.5 'Montserrat', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2 { margin: 0 0 .75rem; line-height: 1.2; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.1rem; }
code { background: var(--line); padding: 0 .3em; border-radius: 4px; }

/* Rozvržení: menu vlevo, obsah na celou šířku */
:root { --side: 232px; }
.brand { font-weight: 700; color: var(--ink); font-size: 1.1rem; }
.brand:hover { text-decoration: none; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--side); z-index: 30;
  background: var(--card); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 1rem; padding: 18px 12px;
  overflow-y: auto;
}
.side-brand { padding: 0 10px; }
.sidebar nav { display: flex; flex-direction: column; gap: 2px; }
.sidebar nav a {
  display: flex; align-items: center; gap: .7rem; padding: .6rem .75rem; border-radius: 8px;
  color: var(--muted); font-size: .97rem;
}
.sidebar nav a:hover { text-decoration: none; }
/* Zvýraznění při najetí jen na zařízeních s myší – na dotykových (iPhone) by „ulpělo“ na klepnuté položce */
@media (hover: hover) { .sidebar nav a:not(.active):hover { background: var(--bg); color: var(--ink); } }
.sidebar nav a:not(.active):active { background: var(--bg); color: var(--ink); }
.sidebar nav a.active, .sidebar nav a.active:hover, .sidebar nav a.active:focus { background: var(--accent); color: var(--accent-ink); }
.sidebar nav a:focus { outline: none; }
.sidebar nav a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ico { width: 1.2rem; text-align: center; font-size: 1rem; }
.side-brand i { color: var(--accent); margin-right: .2rem; }
.kpi-label i { color: var(--accent); width: 1rem; }
button.link i, a i.fa-arrow-right { font-size: .85em; }
.side-foot { margin-top: auto; padding: 0 10px; display: flex; flex-direction: column; gap: .2rem; }
.running-box {
  display: flex; align-items: center; gap: .6rem; margin: 0 4px; padding: .6rem .75rem;
  border-radius: 8px; background: var(--err-bg); color: var(--stop); font-variant-numeric: tabular-nums;
}
.running-box:hover { text-decoration: none; }
.running-pill { display: inline-flex; align-items: center; gap: .4rem; background: var(--err-bg); color: var(--stop); padding: .15rem .6rem; border-radius: 999px; font-variant-numeric: tabular-nums; font-size: .9rem; margin-left: auto; }
.dot { width: .5rem; height: .5rem; border-radius: 50%; background: var(--stop); animation: pulse 1.4s infinite; flex: none; }
@keyframes pulse { 50% { opacity: .3; } }

.mobilebar { display: none; }
.scrim { display: none; }
main { padding: 24px 28px; }
body.has-nav main { margin-left: var(--side); }

@media (max-width: 899px) {
  .mobilebar {
    display: flex; align-items: center; gap: .75rem; position: sticky; top: 0; z-index: 20;
    background: var(--card); border-bottom: 1px solid var(--line); padding: .55rem 16px;
  }
  .burger { width: 40px; height: 40px; border: 0; background: none; cursor: pointer; margin-left: -8px; color: var(--ink); font-size: 1.3rem; }
  .sidebar { transform: translateX(-100%); transition: transform .2s ease; width: min(280px, 82vw); }
  body.nav-open .sidebar { box-shadow: 0 0 40px rgba(0,0,0,.25); }
  .sidebar .side-brand, .sidebar .running-box { display: none; }
  body.nav-open .sidebar { transform: none; }
  body.nav-open { overflow: hidden; touch-action: none; }
  body.nav-open .sidebar { touch-action: pan-y; }
  body.nav-open .scrim { display: block; position: fixed; inset: 0; z-index: 25; background: rgba(0,0,0,.35); }
  body.has-nav main { margin-left: 0; }
  main { padding: 16px; }
}

/* Nástěnka */
.page-title { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.page-title h1 { margin: 0; }
.kpis { display: grid; gap: 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 1100px) { .kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 420px) { .kpis { grid-template-columns: 1fr; } }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; display: flex; flex-direction: column; gap: .2rem; color: var(--ink); min-width: 0; }
.kpi:hover { text-decoration: none; border-color: var(--accent); }
.kpi-label { font-size: .8rem; color: var(--muted); }
.kpi-value { font-size: 1.45rem; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-sub { font-size: .82rem; color: var(--muted); }
.warn-text { color: var(--stop); }

.vchart { position: relative; height: 240px; margin: 1rem 0 2rem 3.4rem; }
.vchart-grid { position: absolute; inset: 0; }
.gl { position: absolute; left: 0; right: 0; border-top: 1px solid var(--line); }
.gl span { position: absolute; right: calc(100% + 8px); top: -.6em; font-size: .72rem; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.vchart-bars { position: absolute; inset: 0; display: flex; align-items: flex-end; gap: 2px; }
.vbar-col { position: relative; flex: 1; height: 100%; display: flex; align-items: flex-end; justify-content: center; outline: none; cursor: default; }
.vbar { width: min(70%, 34px); background: var(--accent); border-radius: 4px 4px 0 0; min-height: 0; opacity: .8; transition: opacity .15s; }
.vbar-col.current .vbar { opacity: 1; }
.vbar-col:hover .vbar, .vbar-col:focus .vbar { opacity: 1; }
.vbar-col:hover, .vbar-col:focus { background: color-mix(in srgb, var(--accent) 7%, transparent); border-radius: 6px; }
.vlabel { position: absolute; top: calc(100% + 6px); font-size: .72rem; color: var(--muted); }
.vbar-col.current .vlabel { color: var(--ink); font-weight: 600; }
.vbar-col[data-tip]:hover::after, .vbar-col[data-tip]:focus::after {
  content: attr(data-tip); position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%);
  background: var(--ink); color: var(--card); font-size: .8rem; padding: .35rem .55rem; border-radius: 6px; white-space: nowrap; z-index: 2; pointer-events: none;
}
.vbar-col:first-child[data-tip]:hover::after, .vbar-col:first-child[data-tip]:focus::after { left: 0; transform: none; }
.vbar-col:last-child[data-tip]:hover::after, .vbar-col:last-child[data-tip]:focus::after { left: auto; right: 0; transform: none; }
@media (max-width: 560px) { .vlabel { font-size: .62rem; } .vchart { margin-left: 2.8rem; } }

.hbars { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .8rem; }
.hbar-head { display: flex; justify-content: space-between; gap: .75rem; font-size: .92rem; margin-bottom: .3rem; }
.hbar-head a { color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar-track { height: 10px; background: var(--bg); border-radius: 4px; }
.hbar { height: 100%; background: var(--accent); border-radius: 4px; }
details summary { cursor: pointer; margin-top: .25rem; }

/* Mřížka karet na širokém displeji */
.grid { display: grid; gap: 16px; grid-template-columns: 1fr; align-items: start; }
.grid > .card { margin-bottom: 0; }
@media (min-width: 1100px) { .grid.two { grid-template-columns: 1fr 1fr; } .grid.main-side { grid-template-columns: 2fr 1fr; } }
.page > * + * { margin-top: 16px; }
.form-narrow { max-width: 760px; }

/* Karty */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 16px; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: .5rem; }
.card-head h2 { margin: 0; }
.auth-box { max-width: 380px; margin: 10vh auto 0; }

/* Formuláře */
.stack { display: flex; flex-direction: column; gap: .8rem; }
label { display: flex; flex-direction: column; gap: .3rem; font-size: .9rem; color: var(--muted); }
label.check { flex-direction: row; align-items: center; gap: .5rem; color: var(--ink); font-size: 1rem; }
label.check.grow { flex: 1; align-items: flex-start; }
label.check input { width: 1.15rem; height: 1.15rem; margin-top: .15rem; flex: none; }
input, select, textarea {
  font: inherit; color: var(--ink); background: var(--bg); border: 1px solid var(--line);
  border-radius: 8px; padding: .6rem .7rem; width: 100%; min-width: 0; min-height: 2.75rem;
}
textarea { min-height: 0; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.row2, .row3 { display: grid; gap: .8rem; grid-template-columns: 1fr; }
.row3 { grid-template-columns: 1fr 1fr; }
.row3 label:first-child { grid-column: 1 / -1; }
@media (min-width: 560px) {
  .row2 { grid-template-columns: 1fr 1fr; }
  .row3 { grid-template-columns: 2fr 1fr 1fr; }
  .row3 label:first-child { grid-column: auto; }
}
.row4 { display: grid; gap: .8rem; grid-template-columns: 1fr 1fr; align-items: end; }
@media (min-width: 560px) { .row4 { grid-template-columns: 1fr 1fr 1fr 1.2fr; } }
.calc { display: flex; flex-direction: column; gap: .3rem; background: var(--bg); border-radius: 8px; padding: .45rem .7rem; min-height: 2.75rem; justify-content: center; }
.calc strong { font-size: 1.1rem; font-variant-numeric: tabular-nums; }
input[readonly] { color: var(--muted); }

/* Tabulky */
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; padding: .5rem .5rem; border-bottom: 1px solid var(--line); }
.table td { padding: .6rem .5rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tbody tr:hover { background: var(--bg); }
.table .r { text-align: right; }
@media (max-width: 760px) {
  .table thead { display: none; }
  .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table tr { border-bottom: 1px solid var(--line); padding: .6rem 0; display: grid; grid-template-columns: 1fr auto; gap: .15rem .75rem; }
  .table td { border: 0; padding: 0; text-align: left; }
  .table td.r { text-align: right; }
  .entries-table tr { grid-template-areas: "date act" "proj proj" "desc desc" "time amt" "qty amt"; }
  .entries-table td[data-l="Datum"] { grid-area: date; font-size: .85rem; color: var(--muted); }
  .entries-table td.act { grid-area: act; }
  .entries-table td[data-l="Projekt"] { grid-area: proj; }
  .entries-table td[data-l="Popis"] { grid-area: desc; }
  .entries-table td[data-l="Popis"]:empty, .entries-table td.no-time { display: none; }
  .entries-table td[data-l="Čas"] { grid-area: time; font-size: .85rem; }
  .entries-table td[data-l="Čas"] .block { display: inline; margin-left: .3rem; }
  .entries-table td[data-l="Cena/MJ"] { display: none; }
  .entries-table td[data-l="Množství"] { grid-area: qty; text-align: left; font-size: .85rem; color: var(--muted); }
  .entries-table td[data-l="Částka"] { grid-area: amt; align-self: end; }
}

.actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.actions form { margin: 0; }
.right { text-align: right; margin-top: .5rem; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  font: inherit; font-weight: 600; padding: .55rem 1rem; border-radius: 8px; cursor: pointer;
  border: 1px solid var(--line); background: var(--card); color: var(--ink);
}
.btn:hover { text-decoration: none; filter: brightness(.97); }
.btn.primary, .btn.start { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.stop { background: var(--stop); border-color: var(--stop); color: #fff; }
.btn.danger { color: var(--stop); }
.btn.big { font-size: 1.2rem; padding: .9rem; width: 100%; }
.btn.small { padding: .3rem .7rem; font-size: .9rem; }
button.link { background: none; border: 0; padding: 0; font: inherit; color: var(--accent); cursor: pointer; }
button.link.danger { color: var(--stop); }

/* Časovač */
.timer.is-running { border-color: var(--stop); }
.timer-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.timer-project { font-size: 1.2rem; font-weight: 700; }
.clock { font-size: 2.4rem; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }

/* Seznamy */
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; padding: .65rem 0; border-top: 1px solid var(--line); }
.list li:first-child { border-top: 0; }
.list li.day { font-weight: 700; font-size: .85rem; color: var(--muted); padding-top: 1rem; border-top: 0; }
.list li.inactive { opacity: .55; }
.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tag { display: inline-block; font-size: .75rem; padding: .05rem .45rem; border-radius: 999px; background: var(--line); color: var(--muted); margin-left: .3rem; }
.tag.ok { background: var(--ok-bg); color: var(--accent); }
.tag.err { background: var(--err-bg); color: var(--stop); }
.filters { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; margin-bottom: .8rem; }
@media (min-width: 700px) { .filters { grid-template-columns: repeat(3, 1fr); } }
.summary { display: flex; gap: .5rem; margin: .5rem 0 1rem; }
.summary > div { flex: 1; background: var(--bg); border-radius: 8px; padding: .5rem .7rem; display: flex; flex-direction: column; }
.summary strong { font-variant-numeric: tabular-nums; }

.muted { color: var(--muted); }
.small { font-size: .85rem; }
.block { display: block; }
.pre { white-space: pre-line; }
.nowrap { white-space: nowrap; }

.flash { padding: .7rem .9rem; border-radius: 8px; margin-bottom: 1rem; background: var(--ok-bg); }
.flash.err { background: var(--err-bg); }

/* Faktura */
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.toolbar, .invoice { max-width: 900px; }
.invoice { background: #fff; color: #1d2321; border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; }
.invoice .muted { color: #6b726f; }
.inv-head { display: flex; justify-content: space-between; align-items: baseline; border-bottom: 2px solid #1d2321; padding-bottom: .5rem; margin-bottom: 1.2rem; }
.inv-head h1 { margin: 0; font-size: 1.8rem; }
.inv-number { font-size: 1.2rem; font-weight: 700; }
.inv-parties { display: grid; grid-template-columns: 1fr; gap: 1.2rem; margin-bottom: 1.2rem; }
@media (min-width: 600px) { .inv-parties { grid-template-columns: 1fr 1fr; } }
.inv-label { font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: #6b726f; margin-bottom: .2rem; }
.inv-meta { display: grid; grid-template-columns: 1fr 1fr; gap: .4rem 1.2rem; background: #f2f5fa; border-radius: 8px; padding: .8rem 1rem; margin-bottom: 1.2rem; font-size: .95rem; }
.inv-meta span { display: block; font-size: .75rem; color: #6b726f; }
.inv-items { width: 100%; border-collapse: collapse; margin-bottom: 1rem; }
.inv-items th { text-align: left; font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: #6b726f; border-bottom: 1px solid #ccc; padding: .4rem .3rem; }
.inv-items td { border-bottom: 1px solid #e3e1da; padding: .5rem .3rem; vertical-align: top; }
.inv-items tfoot td { font-weight: 700; border-bottom: 0; }
.inv-items .r { text-align: right; white-space: nowrap; }
.inv-total-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; margin: 1rem 0; }
.inv-total { margin-left: auto; text-align: right; }
.inv-total span { display: block; color: #6b726f; font-size: .85rem; }
.inv-total strong { font-size: 1.6rem; }
.qr-box { text-align: center; }
.qr-box #qr { width: 150px; background: #fff; }
.qr-box svg { display: block; width: 100%; height: auto; }
.inv-appendix { margin-top: 2rem; page-break-before: always; break-before: page; }
@media screen { .inv-appendix { break-before: auto; page-break-before: auto; border-top: 1px dashed #ccc; padding-top: 1.2rem; } }
.inv-appendix h2 { font-size: 1rem; }

@media print {
  @page { size: A4; margin: 14mm; }
  body { background: #fff; }
  .sidebar, .mobilebar, .scrim, .no-print, .flash { display: none !important; }
  main, body.has-nav main { padding: 0; margin: 0; max-width: none; }
  .invoice { border: 0; padding: 0; }
}

/* Ruční faktura – položky */
.form-wide { max-width: 1100px; }
.items { display: flex; flex-direction: column; gap: .5rem; }
.item-row { display: grid; grid-template-columns: minmax(0, 1fr) 90px 90px 120px 130px 40px; gap: .5rem; align-items: center; }
#ie-items { display: flex; flex-direction: column; gap: .5rem; }
.item-head { font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.item-total { font-variant-numeric: tabular-nums; white-space: nowrap; }
.r { text-align: right; }
.icon-btn { width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--muted); cursor: pointer; }
.icon-btn:hover { color: var(--stop); border-color: var(--stop); }
.items-foot { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-top: .25rem; }
.inv-sum { text-align: right; display: flex; flex-direction: column; }
.inv-sum strong { font-size: 1.4rem; font-variant-numeric: tabular-nums; }
@media (max-width: 760px) {
  .item-head { display: none; }
  .item-row { grid-template-columns: 1fr 1fr 1fr; padding-bottom: .6rem; border-bottom: 1px solid var(--line); }
  .item-row input[name="item_desc[]"] { grid-column: 1 / -1; }
  .item-row .item-total { grid-column: 1 / 3; text-align: left; }
  .item-row .icon-btn { grid-column: 3; justify-self: end; }
}
.row4.dates { align-items: end; }

/* Seznam faktur */
.year-tabs { display: flex; gap: .3rem; flex-wrap: wrap; margin-bottom: .75rem; }
.year-tabs a { padding: .3rem .75rem; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); font-variant-numeric: tabular-nums; font-size: .92rem; }
.year-tabs a:hover { text-decoration: none; color: var(--ink); }
.year-tabs a.active { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (max-width: 760px) {
  .inv-table tr { grid-template-areas: "num act" "cli amt" "dat st"; }
  .inv-table td[data-l="Číslo"] { grid-area: num; }
  .inv-table td.act { grid-area: act; }
  .inv-table td[data-l="Klient"] { grid-area: cli; }
  .inv-table td[data-l="Částka"] { grid-area: amt; }
  .inv-table td[data-l="Vystaveno"] { grid-area: dat; font-size: .85rem; color: var(--muted); }
  .inv-table td[data-l="Splatnost"] { display: none; }
  .inv-table td[data-l="Stav"] { grid-area: st; text-align: right; }
}
.inv-appendix.internal { border: 1px dashed var(--line); border-radius: 8px; padding: 1rem; background: #f8fafd; }
.vbar-col:hover { text-decoration: none; }

.card-head { flex-wrap: wrap; }
@media (max-width: 560px) {
  .summary { flex-wrap: wrap; }
  .summary > div { flex: 1 1 40%; }
}
/* popisky sloupců grafu: v úzkém grafu (užší dlaždice, mobil) zkrácené */
.vchart { container-type: inline-size; }
.vlabel .y-short { display: none; }
@container (max-width: 480px) { .vlabel .y-full { display: none; } .vlabel .y-short { display: inline; } }

.icon-link { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 6px; }
.icon-link:hover { background: var(--bg); text-decoration: none; }

/* Nástěnka – dlaždice */
.tiles { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; align-items: stretch; }
.tile { grid-column: span var(--w, 12); min-width: 0; display: flex; flex-direction: column; position: relative; }
.tile-body { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.tile-body > .card, .tile-body > .kpi { flex: 1; margin: 0; }
/* šířka dlaždic se řídí šířkou levé části (vedle může být sloupec s termíny) */
.dash-main { container-type: inline-size; min-width: 0; }
@container (max-width: 760px) {
  .tile { grid-column: span 12; }
  .tile[data-w="3"] { grid-column: span 6; }
}
@container (max-width: 440px) { .tile, .tile[data-w="3"], .tile[data-w="4"] { grid-column: span 12; } }

.tile-tools { display: none; }
#dashboard .edit-only { display: none; }
#dashboard.editing .edit-only { display: inline-flex; }
#dashboard.editing .view-only { display: none; }
#dashboard.editing .tile { outline: 2px dashed var(--line); outline-offset: 4px; border-radius: var(--radius); cursor: grab; }
#dashboard.editing .tile:hover { outline-color: var(--accent); }
#dashboard.editing .tile.dragging { opacity: .4; }
#dashboard.editing .tile-body { pointer-events: none; user-select: none; }
#dashboard.editing .tile-tools {
  display: flex; justify-content: space-between; align-items: center; gap: .5rem; margin-bottom: 6px;
  font-size: .82rem; color: var(--muted);
}
.tile-handle { display: inline-flex; align-items: center; gap: .4rem; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.tile-btns { display: inline-flex; gap: 4px; flex: none; }
.tile-btns button { height: 30px; min-width: 30px; padding: 0 .45rem; border: 1px solid var(--line); background: var(--card); border-radius: 6px; color: var(--ink); cursor: pointer; font: inherit; font-size: .8rem; }
.tile-btns button:hover { border-color: var(--accent); color: var(--accent); }

/* Přepínač období */
.seg { display: inline-flex; background: var(--bg); border-radius: 8px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: none; padding: .3rem .7rem; border-radius: 6px; font: inherit; font-size: .85rem; color: var(--muted); cursor: pointer; }
.seg button[aria-selected="true"] { background: var(--card); color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(0,0,0,.08); }
@media (max-width: 760px) { #dashboard.editing .dash-hint { display: none; } }

/* IČO + ARES */
.ares-row { display: flex; gap: .6rem; align-items: flex-end; }
.ares-row label { flex: 0 1 220px; }
.ares-row .btn { min-height: 2.75rem; white-space: nowrap; }
[data-ares-msg]:empty { display: none; }
[data-ares-msg] { margin: -.4rem 0 0; }
.table tr.inactive td { opacity: .55; }
@media (max-width: 760px) {
  .clients-table tr { grid-template-areas: "name act" "ico rate" "addr addr" "proj proj"; }
  .clients-table td[data-l="Název"] { grid-area: name; }
  .clients-table td.act { grid-area: act; }
  .clients-table td[data-l="IČO"] { grid-area: ico; font-size: .85rem; color: var(--muted); }
  .clients-table td[data-l="IČO"]::before { content: "IČO "; }
  .clients-table td[data-l="Sazba"] { grid-area: rate; }
  .clients-table td[data-l="Adresa"] { grid-area: addr; color: var(--muted); }
  .clients-table td[data-l="Projekty"] { grid-area: proj; text-align: left; }
}
@media (max-width: 760px) { .clients-table td.empty { display: none; } }

/* Spuštění z plochy iPhonu (bez lišty Safari): respektovat výřez a spodní lištu */
@supports (padding: env(safe-area-inset-top)) {
  .mobilebar { padding-top: calc(.55rem + env(safe-area-inset-top)); }
  main { padding-bottom: calc(16px + env(safe-area-inset-bottom)); }
  .sidebar { padding-top: calc(18px + env(safe-area-inset-top)); padding-bottom: calc(18px + env(safe-area-inset-bottom)); }
}

/* Úkoly */
.filters.two-col { grid-template-columns: 1fr 1fr; }
@media (min-width: 700px) { .filters.two-col { grid-template-columns: 1fr 1fr; max-width: 640px; } }
.task-group { margin-top: 1rem; }
.task-group-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; padding: .3rem 0; border-bottom: 2px solid var(--line); }
.task-list { list-style: none; margin: 0; padding: 0; }
.task { display: flex; align-items: center; gap: .6rem; padding: .55rem 0; border-bottom: 1px solid var(--line); }
.task-check button { border: 0; background: none; font-size: 1.25rem; color: var(--muted); cursor: pointer; width: 34px; height: 34px; border-radius: 50%; }
.task-check button:hover { color: var(--accent); background: var(--bg); }
.task.st-doing .task-check button { color: var(--accent); }
.task.st-done .task-check button { color: var(--accent); }
.task.st-done .task-title { text-decoration: line-through; color: var(--muted); }
.task-main { flex: 1; min-width: 0; }
.task-title { color: var(--ink); font-weight: 500; }
.task-meta { display: flex; flex-wrap: wrap; gap: .2rem .8rem; margin-top: .1rem; }
.task-act form { margin: 0; }
.running-btn { color: var(--stop); border-color: var(--stop); }
.running-btn .dot { margin-right: .1rem; }
.timer-task { margin-top: .15rem; font-size: .95rem; }
.task-time { margin-top: 1.25rem; border-top: 1px solid var(--line); padding-top: 1rem; }
.task-time h3 { font-size: 1rem; margin: 0 0 .5rem; }
.list li form { margin: 0; }
@media (max-width: 560px) { .hide-sm { display: none; } }

/* Úkoly – boxy podle klientů */
.task-boxes { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 380px), 1fr)); gap: 16px; align-items: start; margin-top: .5rem; }
.task-box { border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); padding: .3rem .9rem .5rem; min-width: 0; }
.task-box-head { display: flex; align-items: center; gap: .5rem; padding: .5rem 0; border-bottom: 2px solid var(--line); }
.task-box-head .box-title { font-size: 1.02rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-box-head .box-add { margin-left: auto; white-space: nowrap; }
.box-grip, .task-grip { color: var(--muted); cursor: grab; touch-action: none; display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 30px; opacity: .55; flex: none; }
.box-grip:hover, .task-grip:hover { opacity: 1; color: var(--accent); }
.box-grip:active, .task-grip:active { cursor: grabbing; }
.task-box .task { gap: .35rem; }
.task-box .task:last-child { border-bottom: 0; }
.task-empty { padding: .7rem 0; }
.task-meta .tag { margin-left: 0; }
.sort-ghost { opacity: .35; }
.sort-chosen { background: var(--bg); border-radius: 8px; }
.task-box.sort-chosen { box-shadow: 0 8px 24px rgba(0,0,0,.12); }
.sort-hint { margin: .25rem 0 0; }
@media (max-width: 760px) { .sort-hint { display: none; } }

/* Úkoly – boxy přes celou šířku, strom úkolů */
.task-boxes { grid-template-columns: 1fr; }
.task-tree .task { padding-left: calc(var(--d, 0) * 28px); position: relative; }
.task-tree .task[data-depth="1"]::before, .task-tree .task[data-depth="2"]::before {
  content: ""; position: absolute; top: 0; bottom: 0; left: calc(var(--d) * 28px - 16px); border-left: 2px solid var(--line);
}
.task-tree .task[data-depth="1"] .task-title, .task-tree .task[data-depth="2"] .task-title { font-weight: 400; }
.task-dragging { display: none !important; }
.task-placeholder {
  list-style: none; margin: 4px 0 4px calc(var(--d, 0) * 28px); border: 2px dashed var(--accent); border-radius: 8px;
  background: color-mix(in srgb, var(--accent) 6%, transparent); transition: margin-left .12s ease;
}
.task-ghost {
  position: fixed; left: 0; top: 0; z-index: 100; pointer-events: none; background: var(--card); border-radius: 10px;
  box-shadow: 0 12px 30px rgba(0,0,0,.18); opacity: .95; list-style: none; padding: 0 .5rem;
}
.task-ghost .task { display: flex; align-items: center; gap: .35rem; padding: .45rem 0 .45rem calc(var(--d, 0) * 28px); border-bottom: 1px solid var(--line); }
.task-ghost .task:last-child { border-bottom: 0; }
.task-ghost .task-act, .task-ghost .sub-add { display: none; }
.sub-add { color: var(--muted); opacity: 0; transition: opacity .15s; }
.task:hover .sub-add, .sub-add:focus { opacity: 1; }
@media (hover: none) { .sub-add { opacity: .8; } }
body.dragging-task { user-select: none; cursor: grabbing; }
@media (max-width: 560px) {
  .task-tree .task { padding-left: calc(var(--d, 0) * 18px); }
  .task-tree .task[data-depth="1"]::before, .task-tree .task[data-depth="2"]::before { left: calc(var(--d) * 18px - 10px); }
  .task-placeholder { margin-left: calc(var(--d, 0) * 18px); }
}

/* Poznámky – lístečky */
.notes-filters { grid-template-columns: 1fr 1fr; }
.notes-filters input[type=search] { grid-column: 1 / -1; }
@media (min-width: 900px) { .notes-filters { grid-template-columns: 2fr 1fr 1fr; } .notes-filters input[type=search] { grid-column: auto; } }
.color-filter { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem; margin-bottom: 1rem; }
.cf-all { font-size: .85rem; padding: .25rem .7rem; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
.cf-all.active { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.cf-all:hover { text-decoration: none; }
.cf-dot { position: relative; width: 28px; height: 28px; border-radius: 50%; border: 2px solid; display: inline-block; }
.cf-dot.active { box-shadow: 0 0 0 2px var(--card), 0 0 0 4px var(--accent); }
.cf-count { position: absolute; right: -6px; top: -6px; min-width: 16px; height: 16px; padding: 0 3px; border-radius: 8px; background: var(--ink); color: var(--card); font-size: .65rem; line-height: 16px; text-align: center; }
.cf-dot:hover { text-decoration: none; transform: scale(1.08); }

.notes-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: 18px; align-items: start; }
.note {
  background: var(--note-bg, #fff4b8); border: 1px solid var(--note-border, #eedc7a); border-radius: 4px 4px 14px 4px;
  color: #2b2b26; padding: .7rem .85rem .55rem; box-shadow: 0 1px 2px rgba(0,0,0,.06), 0 6px 14px rgba(0,0,0,.06);
  display: flex; flex-direction: column; gap: .45rem; min-width: 0; cursor: grab; transition: box-shadow .15s, transform .15s;
}
.note:hover { box-shadow: 0 2px 4px rgba(0,0,0,.08), 0 10px 22px rgba(0,0,0,.1); }
.note:nth-child(3n+1) { transform: rotate(-.4deg); } .note:nth-child(3n+2) { transform: rotate(.35deg); }
.note-chosen { transform: rotate(0) scale(1.02) !important; box-shadow: 0 16px 34px rgba(0,0,0,.18); }
.note-head { display: flex; align-items: flex-start; gap: .35rem; }
.note-grip { color: rgba(0,0,0,.3); padding-top: .1rem; touch-action: none; }
.note-title { flex: 1; color: #1d2321; font-weight: 700; line-height: 1.3; overflow-wrap: anywhere; }
.note-untitled { font-weight: 400; font-style: italic; color: rgba(0,0,0,.45); }
.note-colors { display: none; flex-wrap: wrap; gap: 3px; max-width: 92px; justify-content: flex-end; }
.note:hover .note-colors, .note:focus-within .note-colors { display: flex; }
@media (hover: none) { .note-colors { display: none !important; } }
.note-colors button { width: 14px; height: 14px; border-radius: 50%; border: 1.5px solid; padding: 0; cursor: pointer; }
.note-colors button[aria-pressed="true"] { box-shadow: 0 0 0 1.5px #1d2321; }
.note-body { white-space: normal; overflow-wrap: anywhere; font-size: .92rem; line-height: 1.45; max-height: 15.5em; overflow: hidden; position: relative; }
.note-body.expanded { max-height: none; }
.note-more { align-self: flex-start; border: 0; background: none; padding: 0; font: inherit; font-size: .8rem; color: #1f5fd1; cursor: pointer; text-decoration: underline; }
.note-foot { display: flex; justify-content: space-between; gap: .5rem; font-size: .75rem; color: rgba(0,0,0,.5); border-top: 1px dashed rgba(0,0,0,.12); padding-top: .4rem; }
.note-project { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.note-form { background: var(--note-bg); color: #1d2321; transition: background .2s; }
.note-form label, .note-form legend { color: rgba(0,0,0,.6); }
.note-form input, .note-form select, .note-form textarea { background: rgba(255,255,255,.65); color: #1d2321; border-color: rgba(0,0,0,.12); }
.note-body-input { min-height: 10rem; line-height: 1.45; }
.color-pick { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: .5rem; }
.color-pick legend { font-size: .9rem; margin-bottom: .35rem; padding: 0; }
.color-pick label { flex-direction: row; }
.color-pick input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.color-pick .swatch { width: 34px; height: 34px; border-radius: 50%; border: 2px solid; cursor: pointer; display: inline-block; }
.color-pick input:checked + .swatch { box-shadow: 0 0 0 3px #fff, 0 0 0 5px #1d2321; }
.color-pick input:focus-visible + .swatch { outline: 2px solid var(--accent); outline-offset: 4px; }

.notes-grid.masonry { grid-auto-rows: 6px; row-gap: 18px; align-items: start; }

/* Poznámky – širší lístečky, boční výpis projektů, HTML obsah, editor */
.notes-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 500px), 1fr)); }
.notes-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 24px; align-items: start; }
.notes-side { position: sticky; top: 16px; display: flex; flex-direction: column; gap: 1px; max-height: calc(100vh - 32px); overflow-y: auto; padding-right: 4px; }
.side-item, .side-client { display: flex; align-items: center; gap: .5rem; padding: .45rem .6rem; border-radius: 8px; color: var(--ink); font-size: .93rem; }
.side-item:hover, .side-client:hover { background: var(--bg); text-decoration: none; }
.side-item.active, .side-client.active { background: var(--accent); color: var(--accent-ink); }
.side-client { margin-top: .7rem; font-weight: 700; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.side-project { padding-left: 1rem; }
.side-project i { color: var(--muted); }
.side-item.active i { color: inherit; }
.side-count { margin-left: auto; font-size: .78rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.side-item.active .side-count { color: inherit; opacity: .85; }
.notes-filters .mobile-only { display: none; }
.notes-filters { grid-template-columns: 1fr !important; max-width: 520px; }
@media (max-width: 899px) {
  .notes-layout { grid-template-columns: 1fr; }
  .notes-side { display: none; }
  .notes-filters { grid-template-columns: 1fr 1fr !important; max-width: none; }
  .notes-filters input[type=search] { grid-column: 1 / -1; }
  .notes-filters .mobile-only { display: block; }
}
.rich p { margin: 0 0 .5em; }
.rich p:last-child { margin-bottom: 0; }
.rich h2 { font-size: 1.1rem; margin: .6em 0 .3em; }
.rich h3 { font-size: 1rem; margin: .6em 0 .3em; }
.rich h2:first-child, .rich h3:first-child { margin-top: 0; }
.rich ul, .rich ol { margin: 0 0 .5em; padding-left: 1.4em; }
.rich li { margin: .1em 0; }
.rich .ql-indent-1 { margin-left: 1.5em; } .rich .ql-indent-2 { margin-left: 3em; } .rich .ql-indent-3 { margin-left: 4.5em; }
.rich blockquote { margin: .4em 0; padding: .1em .8em; border-left: 3px solid rgba(0,0,0,.2); color: rgba(0,0,0,.7); }
.rich pre { margin: .4em 0; padding: .5em .7em; background: rgba(255,255,255,.55); border-radius: 6px; white-space: pre-wrap; font-size: .85rem; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.rich a { color: #1a4fb0; text-decoration: underline; }
.field { display: flex; flex-direction: column; gap: .3rem; }
.field-label { font-size: .9rem; color: rgba(0,0,0,.6); }
.note-form .ql-toolbar.ql-snow { background: rgba(255,255,255,.75); border-color: rgba(0,0,0,.12); border-radius: 8px 8px 0 0; font-family: inherit; }
.note-form .ql-container.ql-snow { background: rgba(255,255,255,.65); border-color: rgba(0,0,0,.12); border-radius: 0 0 8px 8px; font: inherit; font-size: .95rem; }
.note-form .ql-editor { min-height: 220px; line-height: 1.5; color: #1d2321; }
.note-form .ql-editor.ql-blank::before { color: rgba(0,0,0,.4); font-style: normal; }
.note-form .ql-snow .ql-tooltip { z-index: 5; }
.notes-grid.masonry { grid-auto-rows: 2px; row-gap: 0; }

/* Úkoly: zaškrtávátko, úchyt a tlačítka zarovnané na řádek s názvem úkolu (i když je pod ním datum/čas) */
.task-box .task { align-items: flex-start; }
.task-box .task-grip { height: 34px; }
.task-box .task-main { padding-top: 6px; }
.task-box .task-act { padding-top: 2px; }

.task-act { display: flex; align-items: center; gap: .3rem; }
.task-meta:not(:has(*)) { display: none; }
.task-box .task-main { padding-bottom: 4px; }

/* Montserrat i v editoru poznámek a v tlačítkách */
.ql-snow, .ql-snow .ql-picker, .ql-editor { font-family: inherit; }
h1, h2, h3, .brand, .kpi-value, .timer-project { letter-spacing: -.01em; }

/* Lístečky bez úchytu a bez „Bez nadpisu“: ovládání v rohu jen po najetí, klepnutí otevře úpravu */
.note { position: relative; cursor: pointer; }
.note-tools { position: absolute; top: 6px; right: 6px; display: flex; align-items: center; gap: 6px; padding: 3px 4px 3px 6px;
  border-radius: 999px; background: rgba(255,255,255,.75); box-shadow: 0 1px 3px rgba(0,0,0,.08); opacity: 0; transition: opacity .15s; z-index: 2; }
.note:hover .note-tools, .note:focus-within .note-tools { opacity: 1; }
.note-tools .note-colors { display: flex; max-width: none; flex-wrap: nowrap; }
.note-edit { width: 24px; height: 24px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; color: #1d2321; font-size: .75rem; }
.note-edit:hover { background: rgba(0,0,0,.08); text-decoration: none; }
@media (hover: none) { .note-tools { opacity: 1; background: none; box-shadow: none; } .note-tools .note-colors { display: none !important; } }
.note-title { display: block; padding-right: 30px; }
.note-body:first-child, .note-tools + .note-body { padding-right: 30px; }

/* Oddělovače skupin v levém menu */
.nav-sep { border: 0; border-top: 1px solid var(--line); margin: 7px 10px; }

/* Formuláře na celou šířku */
.form-narrow, .form-wide { max-width: none; }
form.inline { display: inline; margin: 0; }
button.icon-link { border: 0; background: none; cursor: pointer; color: var(--accent); font-size: 1.05rem; }
.fa-toggle-off { color: var(--muted); }
.inactive-section { opacity: .85; }
.projects-table .facts { display: flex; flex-direction: column; gap: .15rem; font-size: .88rem; }
.projects-table .facts a { color: var(--ink); }
.projects-table .facts i { color: var(--muted); width: 1.1em; }
@media (max-width: 760px) {
  .projects-table tr { grid-template-areas: "name act" "client client" "facts facts"; }
  .projects-table td[data-l="Projekt"] { grid-area: name; }
  .projects-table td.act { grid-area: act; }
  .projects-table td[data-l="Klient"] { grid-area: client; font-size: .85rem; }
  .projects-table td[data-l="Přehled"] { grid-area: facts; margin-top: .3rem; }
}

/* Levý sloupec úkolů: červené puntíky, oddělovač, box neaktivních */
.side-dot { margin-left: auto; min-width: 1.35rem; height: 1.35rem; padding: 0 .35rem; border-radius: 999px; background: #d93a2b; color: #fff;
  font-size: .72rem; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; font-variant-numeric: tabular-nums; line-height: 1; }
.side-item.active .side-dot { background: #fff; color: #d93a2b; }
.side-sep { border: 0; border-top: 1px solid var(--line); margin: .6rem .3rem; width: auto; }
.side-add { color: var(--muted); font-size: .85rem; }
.side-add i { color: var(--muted); }
.side-box { margin-top: 1rem; padding: .3rem .3rem .5rem; border: 1px dashed var(--line); border-radius: 10px; opacity: .9; }
.side-heading { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: .35rem .3rem 0; }
.side-box .side-client:first-of-type { margin-top: .35rem; }
span.side-client:hover { background: none; }
.tasks-side .side-item i { width: 1.1em; text-align: center; }
.today-text { color: var(--accent); font-weight: 600; }
.head-actions { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; justify-content: flex-end; }
.card-head h2 .block-sm { display: block; font-weight: 500; margin-top: .2rem; }
.tasks-mobile-pick { display: none; }
@media (max-width: 899px) {
  .tasks-mobile-pick { display: flex !important; gap: .5rem; margin-bottom: 1rem; }
  .tasks-mobile-pick select { flex: 1; min-width: 0; }
}

/* Detail projektu */
.project-head .card-head { align-items: flex-start; }
.project-head h2 { margin: 0 0 .2rem; display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.project-tabs { margin: 1rem 0 0; }
.project-tabs .tab-count { display: inline-block; min-width: 1.3rem; padding: 0 .3rem; margin-left: .15rem; border-radius: 999px; background: var(--bg); color: var(--ink); font-size: .75rem; text-align: center; }
.project-tabs a.active .tab-count { background: rgba(255,255,255,.25); color: inherit; }
@media (max-width: 560px) {
  .project-head .card-head { flex-direction: column; }
  .project-tabs { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 2px; }
  .project-tabs a { white-space: nowrap; }
}

/* Nastavení – cron */
.cron-help { margin-top: 1.2rem; border-top: 1px solid var(--line); padding-top: .8rem; }
.cron-help summary { cursor: pointer; font-weight: 600; }
.copy-row input { width: 100%; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .82rem; }
.projects-table td { vertical-align: middle; }
.projects-table .facts a:hover { color: var(--accent); }
.side-projects { display: flex; flex-direction: column; gap: 1px; }
#side-projects .side-item { cursor: grab; }
#side-projects .side-item.sort-chosen { cursor: grabbing; }
.side-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Nástěnka: skryté dlaždice a lišta pro přidání */
#dashboard .tile.is-hidden { display: none !important; }
#dashboard.editing .tile-tray { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; padding: .75rem 1rem; margin-bottom: 1rem;
  border: 2px dashed var(--line); border-radius: var(--radius); background: var(--card); }
.tile-tray .tray-items { display: contents; }
.tile-tray .tray-empty { display: none; }
.tile-tray.all-shown .tray-empty { display: inline; }
.tile-btns .tile-remove:hover { border-color: var(--stop); color: var(--stop); }
.day-tag { display: inline-block; font-size: .75rem; font-weight: 600; color: var(--accent); background: var(--ok-bg); border-radius: 6px; padding: 0 .4rem; margin-right: .2rem; white-space: nowrap; }

/* Úkoly: pohledy podle data */
.side-views { display: flex; flex-direction: column; gap: 1px; margin: .15rem 0 .35rem; }
.side-view { padding-left: 1rem; font-size: .9rem; }
.side-view i { color: var(--muted); }
.date-group { font-size: .95rem; margin: 1.2rem 0 .2rem; display: flex; gap: .5rem; align-items: baseline; }
.date-group:first-of-type { margin-top: .4rem; }

/* Kalendář */
.cal-nav { display: flex; align-items: center; gap: .5rem; margin-bottom: .8rem; }
.cal-title { font-size: 1.05rem; min-width: 9.5rem; text-align: center; }
.cal-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 16px; align-items: start; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.cal-dow { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: .35rem .45rem; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--bg); }
.cal-day { min-height: 108px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: .25rem; display: flex; flex-direction: column; min-width: 0; }
.cal-day.weekend { background: color-mix(in srgb, var(--bg) 45%, transparent); }
.cal-day.other .cal-num { opacity: .4; }
.cal-day.today { box-shadow: inset 0 0 0 2px var(--accent); }
.cal-day.today .cal-num { color: var(--accent); font-weight: 700; }
.cal-head { display: flex; align-items: center; justify-content: space-between; padding: 0 .2rem; }
.cal-num { font-size: .82rem; }
.cal-dow-m, .cal-mon-m { display: none; }
.cal-add { opacity: 0; color: var(--muted); font-size: .75rem; padding: .1rem .25rem; }
.cal-day:hover .cal-add, .cal-add:focus { opacity: 1; }
.cal-list { flex: 1; display: flex; flex-direction: column; gap: 3px; min-height: 28px; }
.cal-task { display: flex; align-items: baseline; gap: .3rem; font-size: .78rem; line-height: 1.25; padding: .2rem .35rem; border-radius: 6px;
  background: var(--ok-bg); color: var(--ink); border-left: 3px solid var(--accent); cursor: grab; min-width: 0; touch-action: manipulation; }
.cal-task:hover { text-decoration: none; filter: brightness(.97); }
.cal-task i { font-size: .65rem; color: var(--muted); flex: none; }
.cal-t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.cal-c { display: none; }
.cal-task.doing { border-left-color: #d9a21b; }
.cal-task.late { background: var(--err-bg); border-left-color: var(--stop); }
.cal-task.done { opacity: .55; text-decoration: line-through; cursor: pointer; border-left-color: var(--line); background: var(--bg); }
.cal-chosen { box-shadow: 0 4px 14px rgba(0,0,0,.15); }
.cal-undated { position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow-y: auto; border: 1px dashed var(--line); border-radius: 10px; padding: .6rem; }
.cal-undated h3 { font-size: .9rem; margin: 0 0 .2rem; }
.cal-undated p { margin: 0 0 .5rem; }
.cal-undated .cal-task { flex-direction: column; align-items: stretch; gap: 0; }
.cal-undated .cal-t { white-space: normal; }
.cal-undated .cal-c { display: block; font-size: .7rem; color: var(--muted); }
.cal-hint { margin-top: .8rem; }
@media (max-width: 1180px) {
  .cal-wrap { grid-template-columns: 1fr; }
  .cal-undated { position: static; max-height: none; }
  .cal-undated .cal-list { flex-direction: row; flex-wrap: wrap; }
}
@media (max-width: 700px) {
  .cal { display: block; border: 0; }
  .cal-dow { display: none; }
  .cal-day { min-height: 0; border: 0; border-bottom: 1px solid var(--line); padding: .45rem .1rem; flex-direction: row; gap: .6rem; }
  .cal-day.empty:not(.today), .cal-day.other.empty { display: none; }
  .cal-day.today { box-shadow: none; background: var(--ok-bg); border-radius: 8px; }
  .cal-head { flex-direction: column; align-items: flex-start; width: 4.6rem; flex: none; white-space: nowrap; }
  .cal-dow-m, .cal-mon-m { display: inline; }
  .cal-add { opacity: 1; }
  .cal-task { font-size: .88rem; padding: .35rem .5rem; }
  .cal-t { white-space: normal; }
}
/* Kalendář: splatnosti faktur */
.cal-inv { display: flex; align-items: baseline; gap: .3rem; font-size: .76rem; line-height: 1.25; padding: .2rem .35rem; border-radius: 6px;
  background: #fff4dc; color: #6b4a00; border-left: 3px solid #d9a21b; min-width: 0; }
.cal-inv:hover { text-decoration: none; filter: brightness(.97); }
.cal-inv i { font-size: .7rem; flex: none; }
.cal-inv .cal-t { white-space: normal; overflow-wrap: anywhere; }
.cal-inv.late { background: var(--err-bg); color: var(--stop); border-left-color: var(--stop); font-weight: 600; }
@media (prefers-color-scheme: dark) { .cal-inv { background: #3a2f12; color: #f0cf7a; } }
@media (max-width: 700px) { .cal-inv { font-size: .86rem; padding: .35rem .5rem; } .cal-inv .cal-t { white-space: normal; } }

/* Barvy dlaždic na nástěnce */
.tile[data-color="blue"]   { --tile-bg: #eaf1ff; --tile-line: #c9dafc; }
.tile[data-color="sky"]    { --tile-bg: #e6f6fd; --tile-line: #c4e8f7; }
.tile[data-color="teal"]   { --tile-bg: #e4f7f4; --tile-line: #bfe8e1; }
.tile[data-color="green"]  { --tile-bg: #e8f7ec; --tile-line: #c6e8cf; }
.tile[data-color="yellow"] { --tile-bg: #fff8dd; --tile-line: #f3e3a3; }
.tile[data-color="orange"] { --tile-bg: #fff0e3; --tile-line: #f8d3b2; }
.tile[data-color="red"]    { --tile-bg: #fdece9; --tile-line: #f6cbc4; }
.tile[data-color="pink"]   { --tile-bg: #fdebf5; --tile-line: #f4c9df; }
.tile[data-color="purple"] { --tile-bg: #f2ecfd; --tile-line: #d9cbf7; }
.tile[data-color="gray"]   { --tile-bg: #eef1f6; --tile-line: #d5dbe5; }
.tile[data-color]:not([data-color=""]) .tile-body > .card,
.tile[data-color]:not([data-color=""]) .tile-body > .kpi { background: var(--tile-bg); border-color: var(--tile-line); }
.tile[data-color]:not([data-color=""]) .seg { background: rgba(0,0,0,.05); }
.tile[data-color]:not([data-color=""]) .list li, .tile[data-color]:not([data-color=""]) .table td { border-color: var(--tile-line); }
/* tmavě modrá: bílé písmo */
.tile[data-color="navy"] { --tile-bg: #1f3f7a; --tile-line: #1f3f7a; }
.tile[data-color="navy"] .tile-body { --ink: #f2f6ff; --muted: #b7c6e6; --line: rgba(255,255,255,.18); --accent: #9cc2ff; --accent-ink: #0a1220; --bg: rgba(255,255,255,.08); --card: #2a4c8a; --ok-bg: rgba(255,255,255,.1); }
.tile[data-color="navy"] .tile-body > .card, .tile[data-color="navy"] .tile-body > .kpi { color: var(--ink); }
.tile[data-color="navy"] .tile-body a:not(.btn) { color: #cfe0ff; }
.tile[data-color="navy"] .seg { background: rgba(255,255,255,.1); }
.tile[data-color="navy"] .seg button[aria-selected="true"] { background: rgba(255,255,255,.2); color: #fff; }
@media (prefers-color-scheme: dark) {
  .tile[data-color="blue"]   { --tile-bg: #17284a; --tile-line: #233a66; }
  .tile[data-color="sky"]    { --tile-bg: #132f3d; --tile-line: #1d4457; }
  .tile[data-color="teal"]   { --tile-bg: #123331; --tile-line: #1b4a46; }
  .tile[data-color="green"]  { --tile-bg: #15301f; --tile-line: #20462d; }
  .tile[data-color="yellow"] { --tile-bg: #342c12; --tile-line: #4b4019; }
  .tile[data-color="orange"] { --tile-bg: #3a2715; --tile-line: #54381d; }
  .tile[data-color="red"]    { --tile-bg: #3a1d1a; --tile-line: #552b26; }
  .tile[data-color="pink"]   { --tile-bg: #381b2c; --tile-line: #522840; }
  .tile[data-color="purple"] { --tile-bg: #271d42; --tile-line: #382a5e; }
  .tile[data-color="gray"]   { --tile-bg: #1e2531; --tile-line: #2c3545; }
  .tile[data-color]:not([data-color=""]) .seg { background: rgba(255,255,255,.06); }
}
.tile-colors { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px; margin-bottom: 6px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 6px 18px rgba(0,0,0,.08); }
.tile-colors[hidden] { display: none; }
#dashboard:not(.editing) .tile-colors { display: none; }
.tile-colors button { width: 26px; height: 26px; border-radius: 50%; border: 1px solid rgba(0,0,0,.15); cursor: pointer; padding: 0; }
.tile-colors button[data-set-color=""] { background-image: linear-gradient(135deg, transparent 46%, #c2412d 46%, #c2412d 54%, transparent 54%) !important; }
.tile-colors button[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--card), 0 0 0 4px var(--accent); }
/* Nástěnka: odškrtnutí úkolu */
.dash-check button { border: 0; background: none; padding: 0 .1rem 0 0; cursor: pointer; color: var(--muted); font-size: 1.05rem; line-height: 1; vertical-align: -1px; }
.dash-check button:hover { color: var(--accent); }
.dash-check button:hover i::before { content: "\f058"; font-weight: 900; }

/* Levé menu v modré */
.sidebar {
  --side-bg: #1f5fd1; --side-bg2: #1a4fb3;
  background: linear-gradient(180deg, var(--side-bg) 0%, var(--side-bg2) 100%); border-right: 0;
  color: #fff;
}
.sidebar .brand, .sidebar .side-brand i { color: #fff; }
.sidebar nav a { color: rgba(255,255,255,.82); }
@media (hover: hover) { .sidebar nav a:not(.active):hover { background: rgba(255,255,255,.12); color: #fff; } }
.sidebar nav a:not(.active):active { background: rgba(255,255,255,.12); color: #fff; }
.sidebar nav a.active, .sidebar nav a.active:hover, .sidebar nav a.active:focus { background: #fff; color: #1f5fd1; font-weight: 600; box-shadow: 0 2px 8px rgba(0,0,0,.12); }
.sidebar nav a:focus-visible { outline-color: #fff; }
.sidebar .nav-sep { border-top-color: rgba(255,255,255,.2); }
.sidebar .side-foot .muted { color: rgba(255,255,255,.7); }
.sidebar .side-foot button.link { color: #fff; }
.sidebar .running-box { background: rgba(255,255,255,.95); }
@media (prefers-color-scheme: dark) {
  .sidebar { --side-bg: #15284d; --side-bg2: #0f1d3a; }
  .sidebar nav a.active, .sidebar nav a.active:hover, .sidebar nav a.active:focus { background: #5b9bff; color: #0a1220; }
}
/* Sloučení klientů / projektů */
.merge-box { margin-top: 1.4rem; border-top: 1px solid var(--line); padding-top: .9rem; }
.merge-box summary { cursor: pointer; font-weight: 600; color: var(--accent); }
.merge-box form { margin-top: .8rem; }
.tag.warn { background: #fff1d6; color: #8a5a00; }
@media (prefers-color-scheme: dark) { .tag.warn { background: #3a2f12; color: #f0cf7a; } }

/* Drobečková navigace */
.crumbs { margin: -4px 0 14px; font-size: .84rem; color: var(--muted); }
.crumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; align-items: center; gap: .15rem .1rem; }
.crumbs li { display: inline-flex; align-items: center; min-width: 0; max-width: 100%; }
.crumbs li + li::before { content: "\f054"; font-family: "Font Awesome 6 Free"; font-weight: 900; font-size: .6rem; opacity: .55; margin: 0 .5rem; }
.crumbs a { color: var(--muted); display: inline-flex; align-items: center; gap: .35rem; }
.crumbs a:hover { color: var(--accent); text-decoration: none; }
.crumbs a, .crumbs span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 28ch; }
.crumbs [aria-current] { color: var(--ink); font-weight: 600; }
@media (max-width: 560px) {
  .crumbs ol { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .crumbs ol::-webkit-scrollbar { display: none; }
  .crumbs li { flex: none; }
  .crumbs a, .crumbs span { max-width: 18ch; }
}
@media print { .crumbs { display: none; } }
/* mřížky formulářů: sloupce se nesmí roztáhnout přes šířku (date input na iOS) */
.row2, .row3, .row4 { grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); }
.row2 > *, .row3 > *, .row4 > * { min-width: 0; }
.row2 input, .row3 input, .row4 input, .row2 select, .row3 select, .row4 select { min-width: 0; width: 100%; }
@media (max-width: 559px) { .row4 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .row2 { grid-template-columns: minmax(0, 1fr); } .row3 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
@media (min-width: 560px) { .row2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .row3 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr); } .row4 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.2fr); } }
@media (max-width: 560px) { .crumbs li:first-child a { font-size: 0; gap: 0; } .crumbs li:first-child a i { font-size: .84rem; } }

/* Řazení tabulek */
.table th[data-sortable] { cursor: pointer; user-select: none; white-space: nowrap; }
.table th[data-sortable]:hover, .table th[data-sortable]:focus-visible { color: var(--ink); outline: none; }
.table th[data-sortable]::after { content: "\f0dc"; font-family: "Font Awesome 6 Free"; font-weight: 900; margin-left: .35rem; opacity: .25; font-size: .7rem; }
.table th[data-dir="asc"]::after { content: "\f0de"; opacity: .9; color: var(--accent); }
.table th[data-dir="desc"]::after { content: "\f0dd"; opacity: .9; color: var(--accent); }
.table th.sorted { color: var(--ink); }
.table-sort { display: none; }
@media (max-width: 760px) {
  .table-sort { display: flex; align-items: center; gap: .5rem; margin: .2rem 0 .6rem; font-size: .85rem; color: var(--muted); flex-direction: row; }
  .table-sort select { flex: 1; min-width: 0; padding: .35rem .5rem; font-size: .85rem; }
}

/* Pravidelné faktury */
.rec-box { border: 1px solid var(--line); border-radius: 10px; padding: .6rem 1rem 1rem; margin: 0; display: flex; flex-direction: column; gap: .8rem; min-width: 0; }
.rec-box legend { font-weight: 600; padding: 0 .4rem; }
.radio-row { display: flex; flex-wrap: wrap; gap: .4rem 1.5rem; }
.vars-help summary { cursor: pointer; color: var(--accent); font-weight: 600; }
.vars-help table { margin-top: .5rem; }
.vars-help code { font-size: .85rem; background: var(--bg); padding: .05rem .35rem; border-radius: 5px; }
.rec-danger { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-top: 1.2rem; padding-top: .9rem; border-top: 1px solid var(--line); flex-wrap: wrap; }
.rec-table tr.is-off td { opacity: .6; }
.sent-info { margin: 0 0 .8rem; font-size: .88rem; color: var(--muted); }

/* Jednotná výška polí formuláře – <select> vlastní šipkou (Safari jinak ignoruje padding) */
select, input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=file]):not([type=color]):not([type=hidden]) { height: 2.75rem; line-height: 1.3; }
select:not([multiple]):not([size]) {
  -webkit-appearance: none; -moz-appearance: none; appearance: none;
  padding-right: 2.2rem; text-overflow: ellipsis;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%2366728a' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right .8rem center; background-size: 12px 8px;
}
select::-ms-expand { display: none; }
@media (prefers-color-scheme: dark) {
  select:not([multiple]):not([size]) { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%2396a1b5' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
}
input[type=date], input[type=time] { -webkit-appearance: none; appearance: none; display: block; }
input[type=date]::-webkit-date-and-time-value, input[type=time]::-webkit-date-and-time-value { text-align: left; margin: 0; }
.table-sort select, .seg select { height: auto; min-height: 0; padding-top: .35rem; padding-bottom: .35rem; }

/* Checklisty */
.hidden { display: none !important; }
.cl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 14px; }
.cl-card { display: flex; flex-direction: column; gap: .45rem; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); color: var(--ink); transition: border-color .15s, box-shadow .15s; }
.cl-card:hover { text-decoration: none; border-color: var(--accent); box-shadow: 0 4px 14px rgba(31, 95, 209, .08); }
.cl-card-name { font-weight: 700; font-size: 1rem; }
.cl-card.is-done .cl-card-name { color: var(--muted); }
.cl-next { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cl-next i { font-size: .7rem; color: var(--accent); }
.cl-empty { padding: 1rem 0; }
.cl-progress { display: flex; align-items: center; gap: .7rem; }
.cl-bar { flex: 1; height: 8px; background: var(--bg); border-radius: 999px; overflow: hidden; border: 1px solid var(--line); }
.cl-bar span { display: block; height: 100%; background: var(--accent); border-radius: 999px; transition: width .3s ease; }
.cl-card.is-done .cl-bar span, .cl-done-tag ~ .x { background: #2f9e62; }
.cl-detail .cl-progress { margin: .4rem 0 1rem; max-width: 520px; }
.cl-count { font-variant-numeric: tabular-nums; }
.cl-done-tag { color: #2f9e62; font-weight: 600; font-size: .9rem; }
.cl-desc { color: var(--muted); margin: 0 0 .6rem; }
.cl-detail h2 .tag { margin-left: 0; vertical-align: middle; }
.cl-use { display: flex; gap: .5rem; align-items: center; }
.cl-use select { height: 2.2rem; min-height: 0; padding-top: .3rem; padding-bottom: .3rem; font-size: .9rem; max-width: 240px; }
.cl-list { list-style: none; margin: 0; padding: 0; }
.cl-item { display: flex; align-items: center; gap: .55rem; padding: .5rem .2rem; border-bottom: 1px solid var(--line); min-height: 2.8rem; }
.cl-item:hover { background: var(--bg); }
.cl-grip { color: var(--muted); opacity: .35; cursor: grab; padding: 0 .15rem; touch-action: none; }
.cl-item:hover .cl-grip { opacity: .8; }
.cl-check { display: inline-flex; flex: none; cursor: pointer; flex-direction: row; }
.cl-check input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.cl-check span { width: 22px; height: 22px; border-radius: 6px; border: 2px solid var(--muted); display: inline-flex; align-items: center; justify-content: center; transition: background .15s, border-color .15s; }
.cl-check input:checked + span { background: var(--accent); border-color: var(--accent); }
.cl-check input:checked + span::after { content: "\f00c"; font-family: "Font Awesome 6 Free"; font-weight: 900; color: #fff; font-size: .75rem; }
.cl-check input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.cl-bullet { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); opacity: .5; flex: none; margin: 0 7px; }
.cl-title { flex: 1; min-width: 0; overflow-wrap: anywhere; cursor: text; border-radius: 4px; padding: .1rem .25rem; }
.cl-title.editing { outline: 2px solid var(--accent); background: var(--card); cursor: text; }
.cl-item.is-done .cl-title { color: var(--muted); text-decoration: line-through; text-decoration-color: rgba(0,0,0,.25); }
.cl-when { flex: none; }
.cl-del { opacity: 0; color: var(--muted) !important; font-size: .95rem !important; }
.cl-item:hover .cl-del, .cl-del:focus { opacity: 1; }
.cl-del:hover { color: var(--stop) !important; }
@media (hover: none) { .cl-del { opacity: .6; } .cl-grip { opacity: .6; } }
.cl-heading { border-bottom: 0; padding-top: 1.1rem; }
.cl-heading .cl-title { font-weight: 700; font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--accent); }
.cl-add { display: flex; gap: .5rem; align-items: flex-start; margin-top: .8rem; }
.cl-add textarea { min-height: 2.75rem; height: 2.75rem; resize: none; line-height: 1.4; }
.cl-add .btn { height: 2.75rem; flex: none; }
.cl-foot { display: flex; flex-wrap: wrap; gap: .3rem 1.2rem; margin-top: 1rem; padding-top: .8rem; border-top: 1px solid var(--line); }
.cl-foot form { display: flex; flex-wrap: wrap; gap: .3rem 1.2rem; }
/* průhledné (vedlejší) tlačítko */
.btn.ghost { background: transparent; border: 1px dashed var(--line); color: var(--muted); box-shadow: none; }
.btn.ghost:hover { border-style: solid; border-color: var(--accent); color: var(--accent); background: transparent; text-decoration: none; }

/* Úkoly: pohledy podle data zarovnané s ostatními položkami; podúkoly bez svislé čáry */
.side-view { padding-left: .6rem; font-size: .93rem; }
.task-tree .task[data-depth="1"]::before, .task-tree .task[data-depth="2"]::before { display: none; }
/* Barevné složky */
.side-item.has-color .folder-ico { color: var(--fc); }
.side-item.active.has-color .folder-ico { color: inherit; }
.folder-colors { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: .45rem; }
.folder-colors legend { font-size: .9rem; margin-bottom: .35rem; padding: 0; }
.folder-colors label { flex-direction: row; cursor: pointer; }
.folder-colors input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.fc-swatch { width: 40px; height: 40px; border-radius: 10px; border: 2px solid var(--line); display: inline-flex; align-items: center; justify-content: center; font-size: 1.05rem; color: var(--fc, var(--muted)); background: var(--card); }
.folder-colors input:checked + .fc-swatch { border-color: var(--fc, var(--accent)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--fc, var(--accent)) 25%, transparent); }
.folder-colors input:focus-visible + .fc-swatch { outline: 2px solid var(--accent); outline-offset: 2px; }
/* Kalendář: úkoly z barevných složek v barvě složky */
.cal-task.has-color { border-left-color: var(--fc); background: color-mix(in srgb, var(--fc) 16%, var(--card)); }
.cal-task.has-color.late { border-left-color: var(--stop); }
.cal-task.has-color.done { background: var(--bg); border-left-color: var(--line); }
@media (prefers-color-scheme: dark) { .cal-task.has-color { background: color-mix(in srgb, var(--fc) 28%, var(--card)); } }
.cal-done-toggle { margin-left: auto; font-size: .88rem; color: var(--muted); }
.cal.hide-done .cal-task.done { display: none; }
@media (max-width: 700px) { .cal-nav { flex-wrap: wrap; } .cal-done-toggle { margin-left: 0; width: 100%; } }

/* Kalendář: události a boční panel */
.cal-ev { display: flex; align-items: baseline; gap: .3rem; font-size: .78rem; line-height: 1.25; padding: .2rem .4rem; border-radius: 6px; min-width: 0;
  background: var(--ec); color: #fff; font-weight: 600; cursor: grab; touch-action: manipulation; }
.cal-ev:hover { text-decoration: none; filter: brightness(1.07); }
.cal-ev.rec { cursor: pointer; }
.cal-ev i { font-size: .62rem; opacity: .85; flex: none; margin-left: auto; }
.cal-ev .ev-time { font-weight: 500; opacity: .9; flex: none; font-variant-numeric: tabular-nums; }
.cal-ev.multi:not(.last) { border-top-right-radius: 0; border-bottom-right-radius: 0; margin-right: -5px; }
.cal-ev.multi:not(.first) { border-top-left-radius: 0; border-bottom-left-radius: 0; margin-left: -5px; }
.cal-day.past .cal-ev { opacity: .75; }
.cal-task i.fa-square-check { color: var(--muted); }
.legend-ev { display: inline-block; width: 12px; height: 10px; border-radius: 3px; background: #1f5fd1; vertical-align: -1px; }
.cal-wrap { grid-template-columns: minmax(0, 1fr) 240px; }
.cal-side { position: sticky; top: 16px; display: flex; flex-direction: column; gap: 12px; max-height: calc(100vh - 32px); overflow-y: auto; }
.cal-side .cal-undated { position: static; max-height: none; overflow: visible; }
.cal-box { border: 1px dashed var(--line); border-radius: 10px; padding: .6rem .7rem; }
.cal-box h3 { font-size: .9rem; margin: 0 0 .4rem; }
.cal-cals { list-style: none; margin: 0 0 .4rem; padding: 0; display: flex; flex-direction: column; gap: .15rem; }
.cal-cals li { display: flex; align-items: center; gap: .5rem; font-size: .9rem; min-height: 1.9rem; }
.cal-cals .icon-link { margin-left: auto; font-size: .8rem; opacity: .5; }
.cal-cals li:hover .icon-link { opacity: 1; }
.cal-cal-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); }
.cal-cals li.is-off .cal-cal-name { color: var(--muted); text-decoration: line-through; }
.cal-vis { width: 18px; height: 18px; border-radius: 5px; border: 2px solid var(--ec); background: var(--ec); color: #fff; font-size: .6rem; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; }
.cal-vis[aria-pressed="false"] { background: transparent; color: transparent; }
@media (max-width: 1180px) {
  .cal-wrap { grid-template-columns: 1fr; }
  .cal-side { position: static; max-height: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
}
@media (max-width: 700px) {
  .cal-ev { font-size: .88rem; padding: .35rem .5rem; }
  .cal-ev .cal-t { white-space: normal; }
  .cal-ev.multi { margin: 0 !important; border-radius: 6px !important; }
}

/* Nástěnka – sloupec s termíny (úkoly, události, splatnosti faktur na 14 dní) */
.dash-cols { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.dash-agenda { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); min-width: 0; }
.ag-inner { display: flex; flex-direction: column; }
.ag-top { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .9rem 1rem .5rem; }
.ag-top h2 { margin: 0; font-size: 1.05rem; }
.ag-scroll { padding: 0 .75rem .75rem; }
@media (min-width: 1200px) {
  .dash-cols { grid-template-columns: minmax(0, 1fr) 320px; }
  #dashboard.no-agenda .dash-cols { grid-template-columns: minmax(0, 1fr); }
  .ag-inner { position: sticky; top: 0; max-height: 100vh; max-height: 100dvh; }
  .ag-scroll { overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
}
@media (min-width: 1500px) { .dash-cols { grid-template-columns: minmax(0, 1fr) 360px; } }
.ag-day { border-top: 1px solid var(--line); padding: .45rem 0 .55rem; }
.ag-day:first-child { border-top: 0; }
.ag-day.week-start { border-top: 2px solid var(--line); }
.ag-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; min-height: 28px; padding: 0 .25rem; font-size: .85rem; }
.ag-date strong { font-weight: 600; }
.ag-day.today .ag-date strong { color: var(--accent); }
.ag-day.weekend .ag-date strong { color: var(--muted); }
.ag-day.overdue .ag-date { color: var(--stop); font-weight: 600; }
.ag-count { font-size: .75rem; color: var(--muted); background: var(--bg); border-radius: 999px; padding: .05rem .5rem; }
.ag-add { display: inline-flex; gap: 2px; opacity: .55; transition: opacity .15s; }
.ag-day:hover .ag-add, .ag-add:focus-within { opacity: 1; }
@media (hover: none) { .ag-add { opacity: 1; } }
.ag-add a { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 6px; color: var(--muted); font-size: .8rem; }
.ag-add a:hover { background: var(--bg); color: var(--accent); text-decoration: none; }
.ag-list { display: flex; flex-direction: column; gap: 4px; min-height: 10px; padding-top: 2px; }
.ag-day.empty .ag-list { min-height: 18px; border: 1px dashed transparent; border-radius: 8px; }
body.ag-dragging .ag-day.empty .ag-list, body.ag-dragging .ag-list[data-date]:empty { border-color: var(--line); background: var(--bg); }
.ag-item { display: flex; align-items: flex-start; gap: .4rem; padding: .4rem .55rem; border-radius: 8px; background: var(--bg); border-left: 3px solid var(--line);
  font-size: .86rem; line-height: 1.3; color: var(--ink); min-width: 0; }
.ag-item:hover { text-decoration: none; }
.ag-task, .ag-ev:not(.rec) { cursor: grab; }
.ag-body { flex: 1; min-width: 0; display: flex; flex-direction: column; color: inherit; }
.ag-body:hover { text-decoration: none; }
.ag-body:hover .ag-t, .ag-ev:hover .ag-t, .ag-inv:hover .ag-t { color: var(--accent); }
.ag-item:not(.ag-task) { flex-direction: column; gap: 0; }
.ag-t { font-weight: 500; overflow-wrap: anywhere; }
.ag-t .dot { display: inline-block; vertical-align: 1px; }
.ag-meta { font-size: .75rem; color: var(--muted); overflow-wrap: anywhere; }
.ag-meta i { font-size: .7rem; }
.ag-check button { border: 0; background: none; padding: .05rem 0 0; cursor: pointer; color: var(--muted); font-size: 1rem; line-height: 1; }
.ag-check button:hover { color: var(--accent); }
.ag-check button:hover i::before { content: "\f058"; font-weight: 900; }
.ag-task.doing { border-left-color: #d9a21b; }
.ag-task.has-color { border-left-color: var(--fc); background: color-mix(in srgb, var(--fc) 12%, var(--card)); }
.ag-task.late { border-left-color: var(--stop); }
.ag-task.late:not(.has-color) { background: var(--err-bg); }
.ag-ev { border-left-color: var(--ec); background: color-mix(in srgb, var(--ec) 14%, var(--card)); }
.ag-ev .ag-meta i.fa-calendar { color: var(--ec); }
.ag-inv { background: #fff6dc; border-left-color: #d9a21b; }
.ag-inv .ag-t i { color: #b7860b; font-size: .8rem; }
.ag-inv.late { background: var(--err-bg); border-left-color: var(--stop); }
.ag-inv.late .ag-t, .ag-inv.late .ag-t i { color: var(--stop); }
@media (prefers-color-scheme: dark) {
  .ag-task.has-color { background: color-mix(in srgb, var(--fc) 24%, var(--card)); }
  .ag-ev { background: color-mix(in srgb, var(--ec) 26%, var(--card)); }
  .ag-inv { background: #3a2f12; }
}
.ag-chosen { box-shadow: 0 4px 14px rgba(0,0,0,.15); }
.ag-day.later summary { cursor: pointer; list-style: none; }
.ag-day.later summary::-webkit-details-marker { display: none; }
.ag-day.later summary .ag-date::after { content: " \25B8"; color: var(--muted); }
.ag-day.later[open] summary .ag-date::after { content: " \25BE"; }
.ag-day.later p { margin: .4rem .25rem 0; }
#dashboard.editing .dash-agenda { opacity: .6; pointer-events: none; }
.ag-day.overdue .ag-list + .ag-list, .ag-day.overdue .ag-list + .ag-more { margin-top: 4px; }
.ag-more summary { cursor: pointer; list-style: none; font-size: .84rem; padding: .4rem .55rem; border-radius: 8px; background: var(--err-bg); color: var(--stop); border-left: 3px solid var(--stop); font-weight: 500; }
.ag-more summary::-webkit-details-marker { display: none; }
.ag-more summary::after { content: " \25B8"; }
.ag-more[open] summary::after { content: " \25BE"; }
.ag-more[open] summary { margin-bottom: 4px; }
@container (max-width: 1000px) { .tile .kpi { padding: 12px 13px; } .tile .kpi-value { font-size: 1.22rem; } }
@container (max-width: 940px) and (min-width: 761px) { .tile[data-w="4"], .tile[data-w="8"] { grid-column: span 6; } }
/* graf Výkon: přepínač Kč / hodiny hned vedle nadpisu */
.card-head .seg-metric { margin-right: auto; }
.card-head h2 + .seg-metric { margin-left: -.25rem; }

/* Finance */
.narrow-card { max-width: 640px; }
button.icon-link.danger-link, .icon-link.danger-link { color: var(--muted); }
button.icon-link.danger-link:hover { color: var(--stop); }
.fin-type { border: 0; padding: 0; margin: 0; display: flex; gap: 1.25rem; flex-wrap: wrap; align-items: center; }
.fin-type legend { font-size: .9rem; color: var(--muted); padding: 0; margin-bottom: .3rem; }
.fin-type[hidden], [data-sub-only][hidden] { display: none; }
.fin-in { color: #1d8a4e; }
.fin-out { color: var(--stop); }
@media (prefers-color-scheme: dark) { .fin-in { color: #5fd08f; } }
.fin-accounts { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.fin-acc { flex: 1 1 170px; max-width: 260px; display: flex; flex-direction: column; gap: .15rem; padding: .7rem .9rem; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink); }
.fin-acc:hover { text-decoration: none; border-color: var(--accent); }
.fin-acc.active { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.fin-acc-name { font-size: .82rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fin-acc strong { font-size: 1.15rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.fin-acc.total { background: var(--ok-bg); border-color: transparent; }
.fin-form { display: grid; gap: .7rem; grid-template-columns: 1fr 1fr; align-items: end; }
.fin-form label { display: flex; flex-direction: column; gap: .3rem; min-width: 0; }
.fin-f-amount, .fin-f-cat, .fin-f-note { grid-column: 1 / -1; }
.fin-f-btn { grid-column: 1 / -1; display: flex; gap: .5rem; }
.fin-f-btn .btn { height: 2.75rem; }
@media (min-width: 900px) {
  .fin-form { grid-template-columns: 170px minmax(200px, 1.3fr) minmax(160px, 1.4fr) 150px minmax(130px, 1fr) auto; }
  .fin-f-amount, .fin-f-cat, .fin-f-note, .fin-f-btn { grid-column: auto; }
}
.fin-amount-wrap { position: relative; display: block; }
.fin-amount-wrap input { width: 100%; padding-left: 1.7rem; font-size: 1.05rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.fin-sign { position: absolute; left: .65rem; top: 50%; transform: translateY(-50%); font-weight: 700; color: var(--muted); pointer-events: none; }
.fin-form.is-out .fin-sign, .fin-form.is-out .fin-amount-wrap input { color: var(--stop); }
.fin-form.is-in .fin-sign, .fin-form.is-in .fin-amount-wrap input { color: #1d8a4e; }
.fin-entry.editing { border-color: var(--accent); }
.fin-tabs { margin-bottom: 1rem; }
.fin-tabs i { font-size: .8rem; margin-right: .2rem; }
.fin-sum strong { font-size: 1.1rem; }
.fin-table tr.is-editing td { background: var(--ok-bg); }
.fin-h3 { font-size: 1rem; margin: 1.25rem 0 .5rem; }
.fin-h3:first-of-type { margin-top: .25rem; }
.fin-sum-table tfoot th { border-top: 2px solid var(--line); padding-top: .6rem; font-variant-numeric: tabular-nums; }
.fin-sum-table td, .fin-cat-table td { font-variant-numeric: tabular-nums; }
.fin-cat-sums { display: grid; gap: 1rem 2rem; grid-template-columns: 1fr; }
@media (min-width: 900px) { .fin-cat-sums { grid-template-columns: 1fr 1fr; } }
.fin-cat-table tr.d0 td { font-weight: 600; }
.fin-cat-table tr.d1 td:first-child { padding-left: 1.4rem; }
.fin-cat-table tr.d2 td:first-child { padding-left: 2.6rem; font-size: .92rem; }
.fin-cat-table tr.d1 td, .fin-cat-table tr.d2 td { font-weight: 400; }
.fin-pct { width: 3.5rem; }
.fin-cat-cols { display: grid; gap: 1.5rem; grid-template-columns: 1fr; }
@media (min-width: 800px) { .fin-cat-cols { grid-template-columns: 1fr 1fr; } }
.fin-cat-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .4rem; }
.fin-cat-head h3 { margin: 0; font-size: 1rem; }
.fin-cat-tree { list-style: none; margin: 0; padding: 0; }
.fin-cat-tree li { display: flex; align-items: center; gap: .5rem; min-height: 2.4rem; border-bottom: 1px solid var(--line); }
.fin-cat-tree li.d0 { font-weight: 600; }
.fin-cat-tree li.d1 { padding-left: 1.4rem; }
.fin-cat-tree li.d2 { padding-left: 2.8rem; font-size: .94rem; }
.fin-cat-tree li.d1::before, .fin-cat-tree li.d2::before { content: "└"; color: var(--line); margin-right: -.2rem; }
.fin-cat-tree li.inactive .fin-cat-name { color: var(--muted); }
.fin-cat-tools { margin-left: auto; display: inline-flex; align-items: center; opacity: .55; }
.fin-cat-tree li:hover .fin-cat-tools, .fin-cat-tools:focus-within { opacity: 1; }
@media (hover: none) { .fin-cat-tools { opacity: 1; } }
.fin-pct { white-space: nowrap; width: 4rem; }
.fin-table td.fin-meta-m { display: none; }
.fin-sum-table tfoot th { text-transform: none; letter-spacing: normal; font-size: .95rem; color: var(--ink); font-weight: 700; padding: .6rem .5rem; }
.fin-sum-table tfoot th.fin-in { color: #1d8a4e; } .fin-sum-table tfoot th.fin-out { color: var(--stop); }
@media (prefers-color-scheme: dark) { .fin-sum-table tfoot th.fin-in { color: #5fd08f; } }
@media (max-width: 760px) {
  .fin-table tr { grid-template-columns: 1fr auto; grid-template-areas: "cat amt" "meta act"; align-items: baseline; }
  .fin-table td.fin-c-cat { grid-area: cat; font-weight: 600; }
  .fin-table td.fin-c-amt { grid-area: amt; }
  .fin-table td.fin-c-act { grid-area: act; align-self: center; }
  .fin-table td.fin-c-date, .fin-table td.fin-c-note, .fin-table td.fin-c-acc { grid-area: meta; font-size: .84rem; color: var(--muted); }
  /* datum · účet · poznámka v jednom řádku */
  .fin-table td.fin-c-date { display: none; }
  .fin-table td.fin-c-note, .fin-table td.fin-c-acc { display: none; }
  .fin-table td.fin-meta-m { display: block; grid-area: meta; font-size: .84rem; color: var(--muted); }
}

/* Finance – přehled: kategorie × měsíce */
.fin-pivot-note { margin: 0 0 .5rem; }
.fin-pivot-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.fin-pivot { border-collapse: separate; border-spacing: 0; width: 100%; min-width: 980px; font-variant-numeric: tabular-nums; font-size: .86rem; }
.fin-pivot th, .fin-pivot td { padding: .42rem .45rem; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
.fin-pivot thead th { font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; }
.fin-pivot thead th a { color: inherit; }
.fin-pivot thead th.cur, .fin-pivot thead th.cur a { color: var(--accent); }
.fin-pivot td.cur { background: color-mix(in srgb, var(--accent) 6%, transparent); }
.fin-pivot td.fut { color: var(--muted); }
.fin-pivot td a { color: inherit; display: block; }
.fin-pivot td a:hover { color: var(--accent); text-decoration: none; }
.fin-pivot .fin-pv-cat { text-align: left; position: sticky; left: 0; background: var(--card); z-index: 1; min-width: 11rem; max-width: 16rem; overflow: hidden; text-overflow: ellipsis; font-weight: 400; }
.fin-pivot thead .fin-pv-cat { font-size: .9rem; color: var(--ink); text-transform: none; letter-spacing: 0; font-weight: 700; }
.fin-pivot .fin-pv-cat a { color: var(--ink); }
.fin-pivot tr.d0 .fin-pv-cat { font-weight: 600; }
.fin-pivot tr.d1 .fin-pv-cat { padding-left: 1.3rem; }
.fin-pivot tr.d2 .fin-pv-cat { padding-left: 2.3rem; font-size: .84rem; }
.fin-pivot tr.d1 td, .fin-pivot tr.d2 td { color: var(--muted); }
.fin-pivot tr.d0 td { font-weight: 600; }
.fin-pivot tr.inactive .fin-pv-cat a { color: var(--muted); }
.fin-pivot .tot { background: var(--bg); font-weight: 700; }
.fin-pivot tr.sec th, .fin-pivot tr.sec td { padding-top: 1rem; }
.fin-pivot tr.sec th { font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; font-weight: 700; }
.fin-pv-in tr.sec th { color: #1d8a4e; }
.fin-pv-out tr.sec th { color: var(--stop); }
.fin-pivot tr.sum th, .fin-pivot tr.sum td { font-weight: 700; border-top: 2px solid var(--line); border-bottom-width: 2px; }
.fin-pv-in tr.sum td { color: #1d8a4e; }
.fin-pv-out tr.sum td { color: var(--stop); }
.fin-pivot tr.diff th, .fin-pivot tr.diff td { font-weight: 700; font-size: .92rem; border-bottom: 0; padding-top: .7rem; }
.fin-pivot td.pos { color: #1d8a4e; } .fin-pivot td.neg { color: var(--stop); }
@media (prefers-color-scheme: dark) { .fin-pv-in tr.sec th, .fin-pv-in tr.sum td, .fin-pivot td.pos { color: #5fd08f; } }
@media (max-width: 600px) { .fin-pivot .fin-pv-cat { min-width: 8.5rem; max-width: 10rem; } .fin-pivot { min-width: 900px; } }

/* Finance – tabulka pohybů (jako v Excelu) */
.fin-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem 1rem; margin-bottom: 14px; }
.fin-top .fin-tabs { margin: 0; }
.fin-top .fin-accounts { margin: 0; flex: 1 1 auto; justify-content: flex-end; }
.fin-top .fin-acc { flex: 0 1 auto; min-width: 130px; padding: .5rem .8rem; }
.fin-top .fin-acc strong { font-size: 1rem; }
.fin-acc-set { min-width: 0 !important; align-items: center; justify-content: center; color: var(--muted); }
.fin-grid-card .card-head { align-items: flex-start; }
.fin-month { display: flex; gap: .4rem; align-items: center; }
.fin-month select { width: auto; min-width: 11rem; }
.fin-month .btn.small { height: 2.75rem; }
.fin-quick { position: relative; }
.fin-quick > summary { list-style: none; cursor: pointer; }
.fin-quick > summary::-webkit-details-marker { display: none; }
.fin-quick[open] > summary { background: var(--ok-bg); border-color: var(--accent); }
.fin-quick[open] { flex-basis: 100%; }
.fin-quick[open] .fin-form { margin-top: .75rem; padding: .9rem; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); }
.fin-filter-note { margin: 0 0 .5rem; }
.fin-grid-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--line); border-radius: 10px; }
.fin-grid { border-collapse: separate; border-spacing: 0; width: 100%; font-variant-numeric: tabular-nums; font-size: .88rem; }
.fin-grid th, .fin-grid td { border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); padding: 0; vertical-align: middle; }
.fin-grid th:last-child, .fin-grid td:last-child { border-right: 0; }
.fin-grid thead tr:first-child th { background: var(--bg); font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; padding: .55rem .5rem; text-align: left; white-space: nowrap; position: sticky; top: 0; z-index: 2; }
.fin-grid thead tr:first-child th.g-amt, .fin-grid thead tr:first-child th.g-sum { text-align: right; text-transform: none; letter-spacing: 0; font-size: .82rem; color: var(--ink); }
.fin-grid input, .fin-grid select { border: 0; border-radius: 0; background: transparent; height: 2.3rem; min-height: 0; width: 100%; padding: 0 .5rem; font: inherit; color: inherit; box-shadow: none; }
.fin-grid select { padding-right: 1.6rem; background-position: right .4rem center; }
.fin-grid input:focus, .fin-grid select:focus { outline: 2px solid var(--accent); outline-offset: -2px; background: var(--card); position: relative; z-index: 1; }
.fin-grid td.g-date { width: 8.6rem; min-width: 8.6rem; }
.fin-grid td.g-cat { min-width: 12rem; width: 16rem; }
.fin-grid td.g-note { min-width: 10rem; }
.fin-grid td.g-amt { width: 8.5rem; min-width: 7.5rem; }
.fin-grid .fin-cell { text-align: right; font-weight: 500; }
.fin-grid .fin-cell.neg { color: var(--stop); }
.fin-grid .fin-cell.pos { color: #1d8a4e; }
.fin-grid td.g-sum { text-align: right; padding: 0 .55rem; white-space: nowrap; font-weight: 600; background: var(--bg); width: 8rem; }
.fin-grid td.g-sum.neg { color: var(--stop); } .fin-grid td.g-sum.pos { color: #1d8a4e; }
.fin-grid td.g-sum.unbal { box-shadow: inset 0 0 0 2px #d9a21b; }
.fin-grid td.g-del { width: 2.2rem; text-align: center; }
.fin-grid td.g-del .icon-link { width: 28px; height: 28px; opacity: 0; }
.fin-grid tr:hover td.g-del .icon-link, .fin-grid td.g-del .icon-link:focus { opacity: 1; }
@media (hover: none) { .fin-grid td.g-del .icon-link { opacity: .6; } }
.fin-grid tbody tr:hover td { background: color-mix(in srgb, var(--accent) 3%, transparent); }
.fin-grid tbody tr:hover td.g-sum { background: var(--bg); }
.fin-grid tbody tr:last-child td { background: color-mix(in srgb, var(--accent) 4%, var(--card)); }
.fin-grid tbody tr:last-child td.g-note input::placeholder { color: var(--accent); opacity: .7; }
.fin-grid tr.saving td { opacity: .7; }
.fin-grid tr.saved td.g-sum { background: var(--ok-bg); transition: background .3s; }
.fin-grid tr.err td { background: var(--err-bg) !important; }
.fin-grid tr.g-bal th, .fin-grid tr.g-bal td { padding: .55rem .55rem; text-align: right; white-space: nowrap; font-weight: 700; background: var(--bg); }
.fin-grid tr.g-bal th { text-align: left; font-size: .82rem; }
.fin-grid tr.g-start th, .fin-grid tr.g-start td { font-weight: 500; color: var(--muted); font-size: .84rem; }
.fin-grid tfoot tr.g-end th, .fin-grid tfoot tr.g-end td { border-top: 2px solid var(--line); border-bottom: 0; font-size: .95rem; }
.fin-grid tr.g-bal td.neg { color: var(--stop); }
.fin-grid-help { margin: .6rem 0 0; }
.fin-grid-help kbd { font: inherit; font-size: .8em; border: 1px solid var(--line); border-radius: 4px; padding: 0 .3em; background: var(--bg); }
@media (prefers-color-scheme: dark) { .fin-grid .fin-cell.pos, .fin-grid td.g-sum.pos { color: #5fd08f; } }
@media (max-width: 700px) {
  .fin-top .fin-accounts { justify-content: flex-start; }
  .fin-grid td.g-cat { min-width: 10rem; width: auto; }
  .fin-grid td.g-note { min-width: 8rem; }
}

/* Nástěnka – finanční dlaždice */
a.card.fin-tile { display: flex; flex-direction: column; gap: .2rem; color: var(--ink); }
a.card.fin-tile:hover { text-decoration: none; border-color: var(--accent); }
.fin-tile .kpi-label i { color: var(--accent); width: 1rem; }
.fin-tile-bars { list-style: none; margin: .7rem 0 0; padding: 0; display: flex; flex-direction: column; gap: .45rem; }
.fin-tile-bars li { display: grid; grid-template-columns: 1fr auto; gap: .15rem .5rem; font-size: .84rem; }
.fin-tile-bars .ft-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fin-tile-bars .ft-val { font-variant-numeric: tabular-nums; color: var(--muted); }
.fin-tile-bars .ft-bar { grid-column: 1 / -1; height: 5px; border-radius: 3px; background: var(--bg); overflow: hidden; }
.fin-tile-bars .ft-bar span { display: block; height: 100%; background: var(--stop); opacity: .7; border-radius: 3px; }
.fin-tile-accs { list-style: none; margin: 0; padding: 0; }
.fin-tile-accs li { display: flex; justify-content: space-between; align-items: baseline; gap: .75rem; padding: .45rem 0; border-bottom: 1px solid var(--line); }
.fin-tile-accs li:last-child { border-bottom: 0; }
.fin-tile-accs strong { font-variant-numeric: tabular-nums; white-space: nowrap; }
.fin-tile-accs li.total { border-top: 2px solid var(--line); border-bottom: 0; margin-top: .1rem; }
.fin-tile-accs li.total strong { font-size: 1.1rem; }
.fin-tile-pl { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; margin: .7rem 0 0; }
.fin-tile-pl div { background: var(--bg); border-radius: 8px; padding: .45rem .6rem; }
.fin-tile-pl dt { font-size: .75rem; color: var(--muted); }
.fin-tile-pl dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tile[data-color="navy"] .fin-in { color: #8ff0b5; }
.tile[data-color="navy"] .fin-out { color: #ffb4a6; }

/* Finance – plán */
.fin-plan-range { min-width: 10rem; text-align: center; font-variant-numeric: tabular-nums; }
.fin-plan-h { margin: 1.1rem 0 .45rem; }
.fin-plan-card .fin-plan-h:first-of-type { margin-top: .25rem; }
.fin-plan td.g-cat { min-width: 11rem; width: 13rem; }
.fin-plan td.g-note { min-width: 9rem; width: 11rem; }
.fin-plan td.g-amt { min-width: 5.6rem; width: auto; }
.fin-plan .fin-pcell { text-align: right; }
.fin-plan[data-type="in"] .fin-pcell { color: #1d8a4e; }
.fin-plan[data-type="out"] .fin-pcell { color: var(--stop); }
.fin-grid thead th.cur { color: var(--accent) !important; }
.fin-grid td.g-tools { width: 4.2rem; white-space: nowrap; }
.fin-grid td.g-tools .icon-link { width: 26px; height: 26px; }
.fin-plan-bal th { text-align: left; padding: .5rem .55rem; font-weight: 600; font-size: .86rem; background: var(--bg); white-space: nowrap; }
.fin-plan-bal td { text-align: right; padding: .5rem .55rem; white-space: nowrap; font-variant-numeric: tabular-nums; }
.fin-plan-bal td.neg { color: var(--stop); }
.fin-plan-bal .pb-in td { color: #1d8a4e; }
.fin-plan-bal .pb-out td { color: var(--stop); }
.fin-plan-bal .pb-diff td { font-weight: 600; }
.fin-plan-bal .pb-bal th, .fin-plan-bal .pb-bal td { font-weight: 700; border-top: 2px solid var(--line); border-bottom: 0; }
.fin-plan-bal .pb-bal td.neg { color: var(--stop); }
@media (prefers-color-scheme: dark) { .fin-plan[data-type="in"] .fin-pcell, .fin-plan-bal .pb-in td { color: #5fd08f; } }
/* plán v Přehledu */
.fin-pivot-bar { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: .5rem; }
.fin-pivot-bar .fin-pivot-note { margin: 0; flex: 1 1 320px; }
.fin-pivot td.pl { font-style: italic; color: var(--muted); font-weight: 400 !important; }
.fin-pivot tr.sum td.pl, .fin-pivot tr.diff td.pl { font-weight: 600 !important; opacity: .8; }
.fin-pivot .pl-sub { display: block; font-size: .7rem; color: var(--muted); font-style: italic; font-weight: 400; line-height: 1.1; }
.pl-legend { font-style: italic; }

/* Levé menu: tlačítko zmenšení a úzký režim (jen ikony) */
.side-collapse { align-self: flex-end; width: 34px; height: 34px; border: 0; border-radius: 8px; background: rgba(255,255,255,.12); color: #fff; cursor: pointer; font-size: .85rem; flex: none; }
.side-collapse:hover { background: rgba(255,255,255,.22); }
.side-collapse i { transition: transform .2s; }
@media (max-width: 899px) { .side-collapse { display: none; } }
@media (min-width: 900px) {
  html.side-mini { --side: 68px; }
  html.side-mini .sidebar { padding: 14px 10px; overflow-x: hidden; }
  html.side-mini .side-collapse { align-self: center; }
  html.side-mini .side-collapse i { transform: rotate(180deg); }
  html.side-mini .sidebar .lbl { display: none; }
  html.side-mini .sidebar nav a { justify-content: center; padding: .65rem 0; gap: 0; position: relative; }
  html.side-mini .sidebar .ico { width: auto; font-size: 1.1rem; }
  html.side-mini .running-box { justify-content: center; padding: .6rem 0; margin: 0; }
  html.side-mini .running-box > span:not(.dot) { display: none; }
  html.side-mini .side-foot { padding: 0; align-items: center; }
  /* popisek při najetí myší */
  html.side-mini .sidebar nav a:hover::after { content: attr(data-tip); position: fixed; left: 74px; margin-top: 0; padding: .35rem .6rem; border-radius: 6px; background: #18212f; color: #fff; font-size: .85rem; font-weight: 500; white-space: nowrap; pointer-events: none; z-index: 50; box-shadow: 0 4px 14px rgba(0,0,0,.2); }
}
/* Přehled financí: rozbalování podkategorií */
.fin-pivot tr[hidden] { display: none; }
.pv-tog, .pv-tog-sp { display: inline-flex; width: 1.3rem; height: 1.3rem; margin-right: .25rem; vertical-align: -2px; flex: none; }
.pv-tog { align-items: center; justify-content: center; border: 0; background: none; cursor: pointer; padding: 0; border-radius: 4px; color: var(--muted); }
.pv-tog::before { content: "▸"; font-size: .9rem; transition: transform .15s; }
.pv-tog[aria-expanded="true"]::before { transform: rotate(90deg); }
.pv-tog:hover { background: var(--bg); color: var(--accent); }
.fin-pivot tr.d1 .fin-pv-cat { padding-left: 1.4rem; }
.fin-pivot tr.d2 .fin-pv-cat { padding-left: 2.6rem; }
.fin-pivot-bar { align-items: center; }
.fin-pivot-bar .btn + .btn { margin-left: -.5rem; }
/* Plán: při posouvání do strany zůstává vidět kategorie */
.fin-plan td.g-cat, .fin-plan th.g-cat, .fin-plan tfoot th, .fin-plan-bal tbody th, .fin-plan-bal thead th.g-cat { position: sticky; left: 0; z-index: 2; background: var(--card); }
.fin-plan thead th.g-cat, .fin-plan tfoot th, .fin-plan-bal tbody th, .fin-plan-bal thead th.g-cat { background: var(--bg); }
.fin-plan tbody tr:last-child td.g-cat { background: color-mix(in srgb, var(--accent) 4%, var(--card)); }
.fin-plan td.g-cat { box-shadow: 1px 0 0 var(--line); }
.fin-grid.fin-plan thead tr:first-child th.g-cat, .fin-grid.fin-plan-bal thead tr:first-child th.g-cat { z-index: 3; }
.fin-plan-bal tbody th.g-cat { min-width: 11rem; width: 13rem; box-shadow: 1px 0 0 var(--line); }
.fin-plan-bal td.g-note, .fin-plan-bal th.g-note { min-width: 9rem; width: 11rem; }
.fin-plan tfoot th.g-cat { box-shadow: 1px 0 0 var(--line); text-align: left; }
/* Přehled financí: zůstatky na konci měsíce */
.fin-pivot tr.bal-sec th, .fin-pivot tr.bal-sec td { padding-top: 1.2rem; border-top: 2px solid var(--line); }
.fin-pivot tr.bal-sec th { color: var(--accent); }
.fin-pivot tr.bal-acc td { color: var(--muted); }
.fin-pivot tr.bal-acc td.neg, .fin-pivot tr.bal-tot td.neg { color: var(--stop); }
.fin-pivot tr.bal-tot th, .fin-pivot tr.bal-tot td { font-weight: 700; border-top: 2px solid var(--line); border-bottom: 0; }
.fin-pivot tr.bal-tot td.pl { font-weight: 600 !important; color: var(--muted); }
/* Nástěnka – Finance tento měsíc */
.fin-month-tile .list li.day { display: flex; justify-content: space-between; align-items: baseline; text-transform: none; }
.fin-month-tile .list li.day + li { border-top: 0; }
.fin-month-tile .fm-tot { font-variant-numeric: tabular-nums; font-size: .85rem; }
.fin-month-tile .fm-main { flex: 1; min-width: 0; }
.fin-month-tile .fm-main > a { color: var(--ink); font-weight: 500; }
.fin-month-tile .num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.fm-bar { display: block; height: 4px; border-radius: 2px; background: var(--bg); margin-top: .35rem; overflow: hidden; max-width: 260px; }
.fm-bar span { display: block; height: 100%; border-radius: 2px; }
.fm-bar.in span { background: #1d8a4e; }
.fm-bar.out span { background: var(--accent); }
.fm-bar.over span { background: var(--stop); }
.fin-month-tile .fm-diff { border-top: 2px solid var(--line); align-items: baseline; }
.fin-month-tile .block { display: block; text-align: right; }
.fin-month-tile .list li:not(.day):not(.fm-diff) { padding: .5rem 0; align-items: center; }
.fin-month-tile .fm-bar { margin-top: .3rem; max-width: none; }
.fin-month-tile .list li, .fin-month-tile .fm-diff { border-top: 0; }
.fin-month-tile .fm-diff { padding-top: .8rem; }
/* Přehled financí: zpětné doplnění */
.fin-hist-note { background: var(--ok-bg); border-radius: 8px; padding: .6rem .8rem; font-size: .88rem; margin: 0 0 .75rem; }
.fin-pivot td.he { padding: 0; }
.fin-pivot .fin-hcell { width: 100%; min-width: 4.6rem; height: 2.1rem; min-height: 0; border: 0; border-radius: 0; background: color-mix(in srgb, var(--accent) 5%, var(--card)); text-align: right; padding: 0 .4rem; font: inherit; color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.fin-pivot .fin-hcell:focus { outline: 2px solid var(--accent); outline-offset: -2px; background: var(--card); }
.fin-pivot td.he.saving .fin-hcell { opacity: .6; }
.fin-pivot td.he.saved .fin-hcell { background: var(--ok-bg); }
.fin-pivot td.he.err .fin-hcell { background: var(--err-bg); }
.fin-pivot tr.d1 .fin-hcell, .fin-pivot tr.d2 .fin-hcell { color: var(--muted); }
.fin-pivot .fin-bcell { width: 100%; min-width: 4.6rem; height: 2.1rem; min-height: 0; border: 0; border-radius: 0; background: color-mix(in srgb, var(--accent) 5%, var(--card)); text-align: right; padding: 0 .4rem; font: inherit; color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.fin-pivot .fin-bcell:focus { outline: 2px solid var(--accent); outline-offset: -2px; background: var(--card); }
.fin-pivot td.he.saved .fin-bcell { background: var(--ok-bg); }
.fin-pivot td.he.err .fin-bcell { background: var(--err-bg); }
.fin-pivot tr.bal-acc td.man { font-style: italic; }
.fin-pivot .fin-bcell::placeholder { color: var(--muted); opacity: .7; font-style: italic; }
/* tlačítko zmenšení menu dole v patičce */
.side-foot .side-collapse { align-self: flex-start; margin: 0 0 .6rem -2px; }
html.side-mini .side-foot .side-collapse { align-self: center; margin: 0 0 .6rem; }

/* Úkoly: počet podúkolů v seznamu */
.task-main .sub-badge { display: inline-flex; align-items: center; gap: .3rem; margin-left: .5rem; padding: .05rem .5rem; border-radius: 999px; background: var(--ok-bg); color: var(--accent); font-size: .76rem; font-weight: 600; white-space: nowrap; vertical-align: 1px; }
.task-main .sub-badge:hover { text-decoration: none; background: var(--accent); color: var(--accent-ink); }
.task-main .sub-badge.all-done { background: var(--bg); color: var(--muted); }
.task-main .sub-badge i { font-size: .72rem; }

/* Úkoly: detail */
.task-detail .td-head { display: flex; align-items: flex-start; gap: .75rem; flex-wrap: wrap; }
.task-detail .td-check { margin-top: .15rem; }
.task-detail .td-check button { font-size: 1.35rem; }
.task-detail .td-title { flex: 1 1 260px; min-width: 0; }
.task-detail .td-title h2 { margin: 0; font-size: 1.3rem; overflow-wrap: anywhere; }
.task-detail.st-done .td-title h2 { text-decoration: line-through; color: var(--muted); }
.task-detail .td-parent { display: inline-block; margin-bottom: .2rem; }
.task-detail .td-actions { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.task-detail .td-actions form { margin: 0; }
.td-meta { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1rem 0; }
.td-meta div { background: var(--bg); border-radius: 8px; padding: .4rem .7rem; min-width: 120px; }
.td-meta dt { font-size: .74rem; color: var(--muted); }
.td-meta dd { margin: 0; font-weight: 500; }
.td-desc { white-space: normal; background: var(--bg); border-radius: 8px; padding: .75rem .9rem; margin-bottom: 1rem; line-height: 1.5; }
.td-subs h3 { display: flex; align-items: baseline; gap: .5rem; font-size: 1rem; margin: 1.25rem 0 .5rem; }
.td-progress { height: 5px; border-radius: 3px; background: var(--bg); overflow: hidden; margin-bottom: .5rem; }
.td-progress span { display: block; height: 100%; background: #1d8a4e; border-radius: 3px; }
.td-add { display: flex; gap: .5rem; margin-top: .6rem; }
.td-add input { flex: 1; min-width: 0; }
.td-foot { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-top: 1.5rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.td-foot form { margin: 0; }
.td-bulk { margin: .4rem 0 0; }

/* Úkoly: přílohy v detailu */
.td-files h3 { display: flex; align-items: baseline; gap: .5rem; font-size: 1rem; margin: 1.25rem 0 .5rem; }
.tf-images { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .6rem; margin-bottom: .6rem; }
.tf-img { margin: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--bg); display: flex; flex-direction: column; }
.tf-img a { display: block; aspect-ratio: 4 / 3; }
.tf-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tf-img figcaption { display: flex; align-items: center; gap: .25rem; padding: .2rem .2rem .2rem .55rem; font-size: .78rem; background: var(--card); }
.tf-img figcaption span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.tf-img form, .tf-list form { margin: 0; }
.tf-list { list-style: none; margin: 0 0 .6rem; padding: 0; }
.tf-list li { display: flex; align-items: center; gap: .6rem; padding: .4rem 0; border-bottom: 1px solid var(--line); }
.tf-list li > i { color: var(--accent); width: 1.1rem; text-align: center; }
.tf-list li a { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.tf-drop { position: relative; display: block; border: 2px dashed var(--line); border-radius: 10px; padding: .9rem 1rem; text-align: center; cursor: pointer; color: var(--ink); transition: border-color .15s, background .15s; }
.tf-drop:hover, .tf-drop.over { border-color: var(--accent); background: var(--ok-bg); }
.tf-drop.busy { opacity: .6; pointer-events: none; }
.tf-drop input[type=file] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.tf-drop i { color: var(--accent); }
.tf-drop .block { display: block; margin-top: .15rem; }
.tf-img a { aspect-ratio: auto; }
.tf-img img { height: auto; aspect-ratio: 4 / 3; }
.tf-images { align-items: start; }

/* Důležitý úkol (vykřičník) */
.prio-mark { display: inline-flex; align-items: center; justify-content: center; width: 1.15em; height: 1.15em; border-radius: 50%; background: var(--stop); color: #fff; font-weight: 800; font-size: .8em; line-height: 1; vertical-align: .08em; flex: none; font-style: normal; text-decoration: none; }
.task.prio { background: linear-gradient(90deg, color-mix(in srgb, var(--stop) 7%, transparent), transparent 60%); box-shadow: inset 3px 0 0 var(--stop); }
.task.prio .task-title { font-weight: 600; }
.prio-form { margin: 0; }
.prio-toggle { width: 28px; height: 28px; border-radius: 50%; border: 1px solid transparent; background: none; color: var(--muted); font-weight: 800; font-size: 1rem; cursor: pointer; opacity: 0; transition: opacity .15s; }
.task:hover .prio-toggle, .prio-toggle:focus-visible, .prio-toggle.on { opacity: 1; }
@media (hover: none) { .prio-toggle { opacity: .45; } }
.prio-toggle:hover { border-color: var(--stop); color: var(--stop); }
.prio-toggle.on { background: var(--stop); color: #fff; border-color: var(--stop); }
.prio-btn .prio-mark { background: var(--muted); }
.prio-btn.on { border-color: var(--stop); color: var(--stop); }
.prio-btn.on .prio-mark { background: var(--stop); }
.prio-check { align-self: flex-start; }
.task-detail .td-title h2 .prio-mark { font-size: .75em; vertical-align: .15em; }
.cal-task .prio-mark, .ag-t .prio-mark { font-size: .72em; margin-right: .1rem; }
/* Úkoly: poznámka (popis) vedle ikonky v seznamu */
.task-meta .task-desc { flex: 1 1 200px; min-width: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notes-main, .task-list, .task-list .task, .task-main { min-width: 0; }
.task-main { flex: 1 1 auto; }
.tasks-side + .notes-main .head-actions { flex-wrap: wrap; }
.task-desc a, .td-desc a { overflow-wrap: anywhere; }

/* Úkoly: důležité úkoly v levém sloupci */
.side-prio { margin: .35rem 0 .5rem; padding: .5rem; border-radius: 10px; background: color-mix(in srgb, var(--stop) 7%, var(--card)); border: 1px solid color-mix(in srgb, var(--stop) 22%, transparent); }
.side-prio-head { display: flex; align-items: center; gap: .4rem; font-size: .8rem; font-weight: 700; color: var(--stop); text-transform: uppercase; letter-spacing: .04em; padding: .1rem .3rem .35rem; }
.side-prio-head .muted { text-transform: none; letter-spacing: 0; font-weight: 500; }
.side-prio-item { display: flex; flex-direction: column; gap: .05rem; padding: .35rem .4rem; border-radius: 7px; color: var(--ink); }
.side-prio-item:hover { text-decoration: none; background: var(--card); }
.spi-title { font-size: .9rem; font-weight: 500; line-height: 1.25; overflow-wrap: anywhere; }
.spi-meta { font-size: .74rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.spi-meta i { font-size: .7rem; }
.side-prio-m .side-prio { margin: 0 0 .75rem; }
.side-prio-m { display: none; }
@media (max-width: 899px) { .side-prio-m { display: block; } }
.side-prio-link .prio-mark { font-size: .72rem; width: 1.2rem; height: 1.2rem; margin-right: .1rem; }
.task.task-leaving { opacity: 0; transition: opacity .25s; }

/* Plán: příjmy k fakturaci */
.fin-plan .g-amt { position: relative; }
.pv-inv { display: none; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; padding: 0; border-radius: 50%; border: 1.5px solid #b9c2d0; background: var(--card); cursor: pointer; z-index: 2; }
.fin-plan tr.to-invoice td.has-v .pv-inv { display: block; }
.fin-plan tr.to-invoice td.has-v:not(.invoiced) .fin-pcell { background: color-mix(in srgb, #d9a21b 10%, transparent); }
.fin-plan td.invoiced .pv-inv { background: #1d8a4e; border-color: #1d8a4e; }
.fin-plan td.invoiced .pv-inv::after { content: ""; position: absolute; left: 4px; top: 1px; width: 3px; height: 7px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.fin-plan tr.to-invoice td.invoiced .fin-pcell { color: var(--muted) !important; }
.pv-inv:hover { border-color: #1d8a4e; }
.inv-flag { color: var(--muted); opacity: .55; }
.inv-flag.on { color: #b7860b; opacity: 1; }
.inv-flag:hover { opacity: 1; }
.fin-grid td.g-tools { width: 5.6rem; }
/* Nástěnka: Zbývá vyfakturovat */
.fin-inv-tile .fit-total { font-size: 1.25rem; margin: -.2rem 0 .4rem; font-variant-numeric: tabular-nums; }
.fin-inv-tile .fit-total strong { color: #b7860b; }
.fin-inv-tile .list li.day { padding-top: .6rem; }
.fin-inv-tile .fit-check { border: 0; background: none; padding: 0 .15rem 0 0; cursor: pointer; color: var(--muted); font-size: 1.05rem; vertical-align: -1px; }
.fin-inv-tile .fit-check:hover { color: #1d8a4e; }
.fin-inv-tile .fit-check:hover i::before { content: "\f058"; font-weight: 900; }
.fin-inv-tile .fit-name { font-weight: 500; }
.fin-inv-tile .num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.fin-inv-tile .fit-done { opacity: .35; transition: opacity .3s; }
.fin-inv-tile .fit-done .fit-check { color: #1d8a4e; }
.fin-inv-tile .list li.day.warn-text { color: var(--stop); }

/* ===== Finance – Nástěnka ===== */
.fd { display: flex; flex-direction: column; gap: 16px; }
.fd-kpis { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.fd-kpi .kpi-value { font-size: 1.35rem; }
.fd-meter { position: relative; display: block; height: 6px; border-radius: 3px; background: var(--bg); margin: .35rem 0 .1rem; overflow: visible; }
.fd-meter > span { display: block; height: 100%; border-radius: 3px; background: var(--accent); }
.fd-meter.in > span { background: #1d8a4e; }
.fd-meter.out > span { background: var(--accent); }
.fd-meter.out.warn > span { background: #d9a21b; }
.fd-meter.out.over > span { background: var(--stop); }
.fd-meter > i { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--ink); opacity: .35; border-radius: 1px; }
.fd-grid { display: grid; gap: 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.fd-grid > .card { margin: 0; min-width: 0; }
.fd-wide { grid-column: 1 / -1; }
@media (max-width: 900px) { .fd-grid { grid-template-columns: minmax(0, 1fr); } }
.fd-legend { display: inline-flex; align-items: center; gap: .35rem .5rem; flex-wrap: wrap; font-size: .78rem; color: var(--muted); }
.fd-legend .lg { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-left: .4rem; }
.fd-legend .lg.in { background: #1d8a4e; } .fd-legend .lg.out { background: var(--stop); }
.fd-legend .lg.pl { background: repeating-linear-gradient(45deg, var(--muted) 0 2px, transparent 2px 4px); border: 1px solid var(--muted); }
.fd-legend .lg.line { width: 16px; height: 0; border-top: 2px solid var(--accent); border-radius: 0; }
.fd-legend .lg.line.dash { border-top-style: dashed; }
/* sloupce příjmy/výdaje */
.fd-bars { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .5rem; height: 250px; padding-bottom: 2.4rem; }
.fd-axis { display: flex; flex-direction: column; justify-content: space-between; font-size: .7rem; color: var(--muted); text-align: right; white-space: nowrap; }
.fd-cols { position: relative; display: flex; align-items: stretch; gap: 4px; border-bottom: 1px solid var(--line);
  background: linear-gradient(to bottom, var(--line) 1px, transparent 1px) 0 0 / 100% 50%; }
.fd-col { position: relative; flex: 1; display: flex; flex-direction: column; justify-content: flex-end; color: var(--ink); border-radius: 6px 6px 0 0; min-width: 0; }
.fd-col:hover { text-decoration: none; background: color-mix(in srgb, var(--accent) 6%, transparent); }
.fd-pair { display: flex; align-items: flex-end; justify-content: center; gap: 2px; height: 100%; padding: 0 12%; }
.fd-pair .b { flex: 1; max-width: 18px; border-radius: 3px 3px 0 0; min-height: 0; }
.fd-pair .b.in { background: #1d8a4e; } .fd-pair .b.out { background: var(--stop); opacity: .85; }
.fd-col.plan .b { opacity: .45; background-image: repeating-linear-gradient(45deg, rgba(255,255,255,.55) 0 3px, transparent 3px 6px); }
.fd-col.cur .fd-lbl { color: var(--accent); font-weight: 700; }
.fd-lbl { position: absolute; top: calc(100% + 4px); left: 0; right: 0; text-align: center; font-size: .7rem; color: var(--muted); white-space: nowrap; }
.fd-net { position: absolute; top: calc(100% + 1.25rem); left: -4px; right: -4px; text-align: center; font-size: .64rem; font-weight: 600; white-space: nowrap; }
.fd-net.pos { color: #1d8a4e; } .fd-net.neg { color: var(--stop); }
.fd-col.plan .fd-net { opacity: .6; font-style: italic; }
.fd-col[data-tip]:hover::after, .fd-dot[data-tip]:hover::after, .fd-dot[data-tip]:focus::after {
  content: attr(data-tip); position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--card);
  font-size: .78rem; padding: .35rem .55rem; border-radius: 6px; white-space: nowrap; z-index: 5; pointer-events: none; font-weight: 400; font-style: normal; }
.fd-col:first-child[data-tip]:hover::after, .fd-col:nth-child(2)[data-tip]:hover::after { left: 0; transform: none; }
.fd-col:last-child[data-tip]:hover::after, .fd-col:nth-last-child(2)[data-tip]:hover::after { left: auto; right: 0; transform: none; }
.fd-col[data-tip]:hover::after { bottom: auto; top: -6px; transform: translate(-50%, -100%); }
.fd-col:first-child[data-tip]:hover::after, .fd-col:nth-child(2)[data-tip]:hover::after { transform: translateY(-100%); }
.fd-col:last-child[data-tip]:hover::after, .fd-col:nth-last-child(2)[data-tip]:hover::after { transform: translateY(-100%); }
/* čára zůstatku */
.fd-line { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .5rem; height: 230px; padding-bottom: 1.6rem; }
.fd-svgwrap { position: relative; border-bottom: 1px solid var(--line); background: linear-gradient(to bottom, var(--line) 1px, transparent 1px) 0 0 / 100% 50%; }
.fd-svgwrap svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.fd-svgwrap polyline { fill: none; stroke-width: 2.5; vector-effect: non-scaling-stroke; stroke-linejoin: round; stroke-linecap: round; }
.fd-svgwrap polyline.real { stroke: var(--accent); }
.fd-svgwrap polyline.plan { stroke: var(--accent); stroke-dasharray: 6 5; opacity: .7; }
.fd-svgwrap polygon.area { fill: color-mix(in srgb, var(--accent) 12%, transparent); stroke: none; }
.fd-svgwrap line.zero { stroke: var(--stop); stroke-width: 1; stroke-dasharray: 3 3; vector-effect: non-scaling-stroke; }
.fd-dot { position: absolute; width: 9px; height: 9px; margin: -4.5px 0 0 -4.5px; border-radius: 50%; background: var(--card); border: 2px solid var(--accent); cursor: default; z-index: 2; }
.fd-dot.plan { border-style: dashed; opacity: .8; }
.fd-dot:hover, .fd-dot:focus { background: var(--accent); outline: none; }
.fd-xl { position: absolute; left: 0; right: 0; top: calc(100% + 4px); height: 1rem; }
.fd-xl span { position: absolute; transform: translateX(-50%); font-size: .7rem; color: var(--muted); white-space: nowrap; }
.fd-xl span.cur { color: var(--accent); font-weight: 700; }
/* kategorie */
.fd-cats { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .7rem; }
.fd-cats li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .15rem .6rem; }
.fd-cat-name { color: var(--ink); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fd-cat-val { font-variant-numeric: tabular-nums; font-weight: 600; }
.fd-cat-bar { grid-column: 1 / -1; height: 6px; border-radius: 3px; background: var(--bg); overflow: hidden; }
.fd-cat-bar span { display: block; height: 100%; background: var(--stop); opacity: .75; border-radius: 3px; }
.fd-cat-sub { grid-column: 1 / -1; }
/* účty */
.fd-accs { list-style: none; margin: 0; padding: 0; }
.fd-accs li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .2rem .6rem; padding: .45rem 0; border-bottom: 1px solid var(--line); }
.fd-accs li:last-child { border-bottom: 0; }
.fd-accs strong { font-variant-numeric: tabular-nums; }
.fd-acc-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fd-acc-bar { grid-column: 1 / -1; height: 4px; border-radius: 2px; background: var(--bg); overflow: hidden; }
.fd-acc-bar span { display: block; height: 100%; background: var(--accent); opacity: .7; }
.fd-acc-bar.neg span { background: var(--stop); }
.fd-accs li.total { border-top: 2px solid var(--line); margin-top: .1rem; }
.fd-accs li.total strong { font-size: 1.1rem; }
.fd-big { font-size: 1.4rem; font-weight: 700; font-variant-numeric: tabular-nums; margin: -.2rem 0 .3rem; }
.fin-warn { color: #b7860b; }
.fd-list li .num { font-variant-numeric: tabular-nums; white-space: nowrap; }
@media (max-width: 560px) { .fd-net { display: none; } .fd-bars { padding-bottom: 1.4rem; } .fd-lbl { font-size: .6rem; } }
.fd-grid { align-items: start; }
@media (max-width: 700px) {
  .fd-col:nth-child(even) .fd-lbl, .fd-xl span:nth-child(even) { visibility: hidden; }
  .fd-col.cur .fd-lbl, .fd-xl span.cur { visibility: visible; }
}

/* Finance → Pravidelné platby */
.fin-sched-table { min-width: 860px; }
.fin-sched-table td, .fin-sched-table th { vertical-align: middle; }
.fin-sched-table tr.muted td { color: var(--muted); }
.fin-sched-table tr.muted strong { opacity: .6; }
.fin-sched-pivot { min-width: 900px; }
.fin-sched-pivot tr.d1 td.pos { color: #1d8a4e; }
.fin-sched-pivot tr.d1 td.neg { color: var(--stop); }
.fin-sched-pivot tr.d1 .fin-pv-cat a:hover { color: var(--accent); }
.fin-sched-pivot tr.sec th { color: var(--ink); }
@media (prefers-color-scheme: dark) { .fin-sched-pivot tr.d1 td.pos { color: #5fd08f; } }
.fin-sched-form .right { text-align: right; margin-top: .5rem; }
.fin-sched-pivot th, .fin-sched-pivot td { padding-left: .3rem; padding-right: .3rem; }
.fin-sched-pivot .fin-pv-cat { min-width: 8.5rem; }

/* Finance → Krypto */
.fc-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: .7rem; margin: .3rem 0 1rem; }
.fc-kpi { background: var(--bg); border-radius: 10px; padding: .7rem .9rem; display: flex; flex-direction: column; gap: .15rem; min-width: 0; }
.fc-kpi span { font-size: .78rem; color: var(--muted); }
.fc-kpi strong { font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.fc-kpi strong small { font-size: .78rem; font-weight: 600; }
.fc-kpi.main strong { font-size: 1.45rem; color: var(--accent); }
.fc-table { min-width: 900px; font-variant-numeric: tabular-nums; }
.fc-table tfoot th { border-top: 2px solid var(--line); padding-top: .6rem; }
.fc-src { margin: .6rem 0 0; }
a.fin-acc-crypto { color: inherit; text-decoration: none; }
a.fin-acc-crypto:hover { border-color: var(--accent); }
.fin-acc-crypto .fa-bitcoin { color: #f7931a; }
.fc-table tfoot th { text-transform: none; letter-spacing: 0; font-size: .95rem; color: var(--ink); font-weight: 700; }

/* Nástěnka – horní řada dlaždic přes celou šířku (nad Termíny); dlaždice se dělí rovným dílem */
.tiles-top { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); margin-bottom: 16px; container-type: inline-size; }
.tiles-top > .tile { grid-column: auto !important; }
.tiles-top.is-empty { display: none; }
#dashboard.editing .tiles-top { display: grid; min-height: 90px; padding: 8px; margin: -8px -8px 8px; border: 2px dashed var(--line); border-radius: var(--radius); }
#dashboard.editing .tiles-top.is-empty::before { content: 'Horní řada – sem přetáhni dlaždici'; color: var(--muted); font-size: .85rem; align-self: center; justify-self: center; }
#dashboard.editing .tiles-top [data-width] { display: none; }
.tile .fa-bitcoin { color: #f7931a; }
@container (max-width: 1250px) { .tiles-top .kpi { padding: 12px 13px; } .tiles-top .kpi-value { font-size: 1.22rem; } }
@media (max-width: 1199px) {
  .tiles-top { grid-auto-flow: row; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
}
@media (max-width: 480px) { .tiles-top { grid-template-columns: minmax(0, 1fr); } }
/* Nástěnka – přejmenování dlaždice */
.tile-handle { min-width: 0; flex: 1 1 auto; }
.tile-name { overflow: hidden; text-overflow: ellipsis; }
.tile-rename { flex: 1; min-width: 4rem; font: inherit; font-size: .82rem; padding: .15rem .4rem; border: 1px solid var(--accent); border-radius: 6px; background: var(--card); color: var(--ink); cursor: text; }
.tile-tools:has(.tile-rename) .tile-btns { display: none; }

/* Poznámky – editor s průběžným ukládáním a sloupcem posledních poznámek */
.note-workspace { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; align-items: start; }
@media (min-width: 1000px) { .note-workspace { grid-template-columns: minmax(0, 1fr) 270px; } }
.note-stage { min-width: 0; perspective: 1400px; }
.note-form-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.note-form-head h2 { margin-bottom: .6rem; }
.note-save-state { color: rgba(0,0,0,.55); white-space: nowrap; }
.note-save-state.warn-text { color: var(--stop); }
.note-recent { min-width: 0; }
.note-recent-head { display: flex; justify-content: space-between; align-items: baseline; font-size: .8rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 0 2px .5rem; }
.note-recent-list { display: flex; flex-direction: column; gap: 6px; }
@media (min-width: 1000px) {
  .note-recent { position: sticky; top: 16px; }
  .note-recent-list { max-height: calc(100vh - 70px); max-height: calc(100dvh - 70px); overflow-y: auto; overscroll-behavior: contain; padding: 2px 6px 8px 2px; scrollbar-width: thin; }
}
@media (max-width: 999px) {
  .note-recent { order: -1; }
  .note-recent-list { flex-direction: row; overflow-x: auto; padding-bottom: 6px; scroll-snap-type: x proximity; }
  .nr-item { flex: 0 0 170px; scroll-snap-align: start; }
}
.nr-item { display: flex; flex-direction: column; gap: 1px; padding: .5rem .65rem .45rem; border-radius: 10px; background: var(--nr-bg, #fff4b8); border: 1px solid var(--nr-border, #eedc7a); color: #1d2321;
  text-decoration: none; position: relative; transition: transform .18s ease, box-shadow .18s ease, opacity .18s; opacity: .82; }
.nr-item:hover { text-decoration: none; transform: translateX(-3px); opacity: 1; box-shadow: 0 3px 10px rgba(0,0,0,.08); }
.nr-item.active { opacity: 1; box-shadow: 0 0 0 2px var(--accent), 0 4px 14px rgba(0,0,0,.1); transform: translateX(-4px); }
.nr-head { font-size: .86rem; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nr-snip { font-size: .78rem; line-height: 1.3; color: rgba(0,0,0,.62); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.nr-meta { font-size: .7rem; color: rgba(0,0,0,.45); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 2px; }
.nr-new { animation: nr-new .45s ease; }
@keyframes nr-new { from { opacity: 0; transform: translateY(-8px) scale(.96); } }
.nr-pulse { animation: nr-pulse .45s ease; }
@keyframes nr-pulse { 40% { transform: translateX(-8px) scale(1.03); } }

/* přechod mezi poznámkami: lísteček odjede nahoru/dolů s lehkým natočením, nový přiletí z druhé strany */
.note-stage .note-form { transform-origin: 50% 0; will-change: transform, opacity; }
.nt-out-up   { animation: nt-out-up .2s ease-in forwards; }
.nt-out-down { animation: nt-out-down .2s ease-in forwards; }
.nt-in-up    { animation: nt-in-up .42s cubic-bezier(.2, .8, .25, 1.15); }
.nt-in-down  { animation: nt-in-down .42s cubic-bezier(.2, .8, .25, 1.15); }
@keyframes nt-out-up   { to { opacity: 0; transform: translateY(-36px) rotateX(10deg) scale(.97); } }
@keyframes nt-out-down { to { opacity: 0; transform: translateY(36px) rotateX(-10deg) scale(.97); } }
@keyframes nt-in-up    { from { opacity: 0; transform: translateY(46px) rotateX(-8deg) scale(.97); } }
@keyframes nt-in-down  { from { opacity: 0; transform: translateY(-46px) rotateX(8deg) scale(.97); } }
@media (prefers-reduced-motion: reduce) { .nt-out-up, .nt-out-down, .nt-in-up, .nt-in-down, .nr-pulse, .nr-new { animation: none; } }

/* zaškrtávací políčka (Quill: li[data-list=checked|unchecked]) – v editoru i v náhledu */
.rich li[data-list="checked"], .rich li[data-list="unchecked"] { list-style: none; position: relative; padding-left: 1.55em; margin-left: -1.4em; }
.rich li[data-list]::before { content: ''; position: absolute; left: .1em; top: .2em; width: 1em; height: 1em; border: 1.5px solid rgba(0,0,0,.45); border-radius: 4px; background: rgba(255,255,255,.7); box-sizing: border-box; }
.rich li[data-list="checked"]::before { background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 8.5l3 3 6-7' fill='none' stroke='white' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 85% no-repeat; border-color: var(--accent); }
.rich li[data-list="checked"] { text-decoration: line-through; color: rgba(0,0,0,.5); }
.note-body.rich li[data-list] { cursor: default; }
.note-body.rich li[data-list]::before { cursor: pointer; }
.note-form .ql-editor li[data-list="checked"] > .ql-ui, .note-form .ql-editor li[data-list="unchecked"] > .ql-ui { color: var(--accent); }
.note-form .ql-editor li[data-list="checked"] { text-decoration: line-through; color: rgba(0,0,0,.5); }
.rich ul:has(> li[data-list]) + ul:has(> li[data-list]) { margin-top: -.5em; }
@media (max-width: 999px) {
  .note-recent-head .small { display: none; }
  .nr-item:hover, .nr-item.active { transform: none; }
  .note-recent-list { padding: 3px 3px 8px; }
  @keyframes nr-pulse { 40% { transform: translateY(-3px) scale(1.03); } }
}
/* Poznámky – vlevo jen projekty pod sebou (bez klientů) */
.notes-side .side-project { padding-left: .6rem; }
.notes-side > .side-item:first-child { margin-bottom: .5rem; }
.notes-side .side-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notes-side .side-box { margin-top: .8rem; }

/* Poznámky – mřížka stejně velkých lístečků (5 vedle sebe, podle šířky méně) */
.notes-main { container-type: inline-size; }
.notes-grid, .notes-grid.masonry { grid-template-columns: repeat(5, minmax(0, 1fr)); grid-auto-rows: auto; gap: 16px; row-gap: 16px; align-items: stretch; }
@container (max-width: 820px) { .notes-grid, .notes-grid.masonry { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@container (max-width: 640px) { .notes-grid, .notes-grid.masonry { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@container (max-width: 470px) { .notes-grid, .notes-grid.masonry { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; } }
.notes-grid .note { aspect-ratio: 4 / 4.6; min-height: 170px; overflow: hidden; gap: .35rem; padding: .65rem .75rem .5rem; transform: none !important; border-radius: 12px; }
.notes-grid .note:hover { transform: translateY(-2px) !important; }
.notes-grid .note-chosen { transform: scale(1.03) !important; }
.notes-grid .note-title { font-size: .92rem; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; flex: none; }
.notes-grid .note-body { flex: 1; min-height: 0; max-height: none; font-size: .8rem; line-height: 1.4; overflow: hidden;
  -webkit-mask-image: linear-gradient(to bottom, #000 72%, transparent); mask-image: linear-gradient(to bottom, #000 72%, transparent); }
.notes-grid .note-body.rich h2 { font-size: .9rem; } .notes-grid .note-body.rich h3 { font-size: .85rem; }
.notes-grid .note-more { display: none; }
.notes-grid .note-foot { flex: none; margin-top: auto; font-size: .7rem; }
.notes-grid .note-project { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.notes-grid .note-tools .note-colors button { width: 12px; height: 12px; }

/* Formulář poznámky: projekt a nadpis vedle sebe */
.note-form .nf-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: .8rem; }
@media (max-width: 600px) { .note-form .nf-row { grid-template-columns: minmax(0, 1fr); } }
.notes-grid .note-tools { border-radius: 12px; } .notes-grid .note-tools .note-colors { flex-wrap: wrap; max-width: 80px; gap: 3px; }
/* Poznámky – archiv a koš */
.notes-side .side-sep { border-top: 1px solid var(--line); margin: .6rem .4rem; }
.note-leaving { animation: note-leave .26s ease-in forwards; pointer-events: none; }
@keyframes note-leave { to { opacity: 0; transform: scale(.85) translateY(10px) !important; } }
.note-state-bar { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; padding: .5rem .7rem; border-radius: 8px; background: rgba(255,255,255,.6); font-size: .9rem; }
.note-del-actions { display: flex; justify-content: flex-end; gap: 1.2rem; flex-wrap: wrap; }
.note-del-actions .link:not(.danger) { color: rgba(0,0,0,.6); }
.note-tools .note-edit { border: 0; background: none; cursor: pointer; padding: 0; font: inherit; font-size: .75rem; }
.note-tools .note-edit.danger-link { color: var(--stop); }
.note-view-hint { margin: 0 0 .8rem; }
/* Poznámky – lístečky mají pevnou velikost a stejné mezery; při širší obrazovce se jich vejde víc vedle sebe */
.notes-grid, .notes-grid.masonry { grid-template-columns: repeat(auto-fill, 182px) !important; justify-content: start; gap: 16px !important; }
.notes-grid .note { width: 182px; height: 182px; aspect-ratio: auto; min-height: 0; }
@media (max-width: 420px) {
  .notes-grid, .notes-grid.masonry { grid-template-columns: repeat(auto-fill, calc(50% - 6px)) !important; gap: 12px !important; }
  .notes-grid .note { width: auto; }
}
/* Poznámky – náhled: lísteček („papír“) a pod ním projekt a datum úpravy, drobnější písmo */
.notes-grid .note { width: 182px; height: auto; padding: 0; background: none; border: 0; box-shadow: none; border-radius: 0; gap: 6px; overflow: visible; }
.notes-grid .note:hover { box-shadow: none; transform: none !important; }
.notes-grid .note-paper { position: relative; height: 182px; display: flex; flex-direction: column; gap: .3rem; overflow: hidden;
  background: var(--note-bg, #fff); border: 1px solid var(--note-border, #d9dee4); border-radius: 12px; padding: .6rem .65rem;
  box-shadow: 0 1px 2px rgba(0,0,0,.05), 0 4px 10px rgba(0,0,0,.05); transition: box-shadow .15s, transform .15s; color: #2b2b26; }
.notes-grid .note:hover .note-paper { box-shadow: 0 2px 4px rgba(0,0,0,.08), 0 10px 20px rgba(0,0,0,.1); transform: translateY(-2px); }
.notes-grid .note-chosen .note-paper { transform: scale(1.03); box-shadow: 0 14px 30px rgba(0,0,0,.18); }
.notes-grid .note-title { font-size: .78rem; line-height: 1.25; }
.notes-grid .note-body { font-size: .68rem; line-height: 1.38; }
.notes-grid .note-body.rich h2 { font-size: .76rem; } .notes-grid .note-body.rich h3 { font-size: .72rem; }
.notes-grid .note-body.rich p, .notes-grid .note-body.rich ul, .notes-grid .note-body.rich ol { margin-bottom: .35em; }
.notes-grid .note-foot { flex-direction: column; align-items: center; justify-content: flex-start; gap: 0; border: 0; padding: 0 4px; margin: 0; text-align: center; font-size: .72rem; line-height: 1.3; color: var(--muted); }
.notes-grid .note-foot .note-project { font-weight: 600; color: var(--ink); max-width: 100%; }
.notes-grid .note-foot span:empty { display: none; }
.notes-grid .note-leaving .note-paper { opacity: .5; }
@media (max-width: 420px) { .notes-grid .note { width: auto; } }
/* Poslední poznámky: vybraná položka se neposouvá (rámeček se u okraje sloupce neořízne) */
.nr-item:hover, .nr-item.active { transform: none; }
.note-recent-list { padding: 4px 8px 8px 4px; }
@media (min-width: 1000px) { .note-recent-list { padding: 4px 8px 8px 4px; } }
@keyframes nr-pulse { 40% { transform: scale(1.03); } }

/* Úkoly – rychlé přidání řádkem pod seznamem */
.quick-add { display: flex; align-items: center; gap: .55rem; margin-top: .5rem; padding: .35rem .6rem; border: 1px dashed var(--line); border-radius: 10px; transition: border-color .15s, background .15s; }
.quick-add:focus-within { border-style: solid; border-color: var(--accent); background: var(--card); }
.quick-add-icon { color: var(--muted); width: 1.4rem; text-align: center; flex: none; }
.quick-add:focus-within .quick-add-icon { color: var(--accent); }
.quick-add input[name="title"] { flex: 1; min-width: 0; border: 0; background: transparent; padding: .35rem 0; font: inherit; box-shadow: none; outline: none; }
.quick-add.busy .quick-add-icon i { animation: qa-spin .8s linear infinite; }
@keyframes qa-spin { to { transform: rotate(90deg); } }
.task-new { animation: task-new .5s ease; }
@keyframes task-new { from { opacity: 0; transform: translateY(-6px); background: color-mix(in srgb, var(--accent) 12%, transparent); } }

/* Nastavení – výběr položek levého menu */
.menu-pick { display: flex; flex-direction: column; gap: .2rem; }
.menu-pick-group { display: flex; flex-wrap: wrap; gap: .3rem 1.4rem; padding: .45rem 0; border-bottom: 1px solid var(--line); }
.menu-pick-group:last-of-type { border-bottom: 0; }
.menu-pick .check { display: inline-flex; align-items: center; gap: .45rem; min-width: 9.5rem; }
.menu-pick .check i { width: 1.1em; text-align: center; color: var(--muted); }
.menu-pick .actions { margin-top: .6rem; }

/* Projekty – atributy a výběr sloupců */
.attr-fields { border: 1px solid var(--line); border-radius: 10px; padding: .7rem .9rem .8rem; margin: 0; min-width: 0; }
.attr-fields legend { padding: 0 .4rem; font-weight: 600; font-size: .9rem; }
.attr-fields legend a { font-weight: 400; margin-left: .5rem; }
.attr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .6rem .9rem; margin-bottom: .6rem; }
.attr-grid .attr-check { align-self: end; padding-bottom: .55rem; }
.attr-new summary { cursor: pointer; color: var(--accent); font-size: .9rem; list-style: none; }
.attr-new summary::-webkit-details-marker { display: none; }
.attr-new-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: .6rem .9rem; margin-top: .6rem; }
.attr-new-row [hidden] { display: none; }
.attr-form { margin-top: 1.2rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.attr-form h3 { margin: 0; font-size: 1rem; }
.attr-chip { display: inline-block; padding: .05rem .5rem; border-radius: 999px; background: color-mix(in srgb, var(--accent) 10%, transparent); color: var(--accent); font-size: .82rem; font-weight: 500; white-space: nowrap; }
.th-sort { color: inherit; text-decoration: none; white-space: nowrap; }
.th-sort i { font-size: .75em; opacity: .35; margin-left: .15rem; }
th.sorted .th-sort i { opacity: 1; color: var(--accent); }
.projects-table td.empty-cell { color: var(--muted); }
.cols-pick { position: relative; }
.cols-pick > summary { list-style: none; cursor: pointer; }
.cols-pick > summary::-webkit-details-marker { display: none; }
.cols-pick[open] > summary { background: var(--bg); }
.cols-pop { position: absolute; right: 0; top: calc(100% + 6px); z-index: 40; min-width: 240px; max-height: 70vh; overflow: auto; background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 30px rgba(0,0,0,.14); padding: .7rem .85rem; display: flex; flex-direction: column; gap: .35rem; }
.cols-pop .check { display: flex; align-items: center; gap: .5rem; font-size: .9rem; white-space: nowrap; }
.cols-pop-foot { display: flex; justify-content: space-between; align-items: center; gap: .8rem; margin-top: .4rem; padding-top: .55rem; border-top: 1px solid var(--line); }
.attr-list { display: flex; flex-wrap: wrap; gap: .3rem 1.4rem; margin: .55rem 0 0; font-size: .86rem; }
.attr-list div { display: flex; gap: .4rem; align-items: baseline; }
.attr-list dt { color: var(--muted); }
.attr-list dt::after { content: ':'; }
.attr-list dd { margin: 0; font-weight: 500; }

/* Projekty – filtr podle atributů */
.proj-filter { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .6rem .9rem; padding: .8rem .9rem; margin: 0 0 1rem; background: var(--bg); border-radius: 12px; }
.proj-filter[hidden] { display: none; }
.proj-filter label, .proj-filter .range { display: flex; flex-direction: column; gap: .2rem; font-size: .8rem; color: var(--muted); min-width: 150px; flex: 0 1 190px; }
.proj-filter input, .proj-filter select { font-size: .9rem; }
.proj-filter .range { border: 0; padding: 0; margin: 0; flex-basis: 230px; }
.proj-filter .range legend { padding: 0; margin-bottom: .2rem; }
.proj-filter .range { flex-direction: row; flex-wrap: wrap; align-items: center; }
.proj-filter .range legend { width: 100%; }
.proj-filter .range input { flex: 1; min-width: 0; width: 5rem; }
.proj-filter .range span { color: var(--muted); }
.proj-filter-actions { display: flex; gap: .5rem; margin-left: auto; }
.btn.active-filter { border-color: var(--accent); color: var(--accent); }
.filter-count { display: inline-grid; place-items: center; min-width: 1.2rem; height: 1.2rem; padding: 0 .3rem; border-radius: 999px; background: var(--accent); color: #fff; font-size: .7rem; font-weight: 700; margin-left: .15rem; }
.proj-filter-box { background: var(--bg); border-radius: 12px; margin: 0 0 1rem; }
.proj-filter-box[hidden] { display: none; }
.proj-filter-box .proj-filter { margin: 0; background: none; padding-bottom: .5rem; }
.view-save { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; padding: .55rem .9rem; border-top: 1px dashed var(--line); }
.view-save-new { border-top: 0; padding-top: 0; }
.view-save input[name="name"] { flex: 0 1 280px; min-width: 0; font-size: .88rem; padding: .35rem .6rem; }
.view-save-hint { margin: 0; padding: 0 .9rem .6rem; }
.view-chips { display: flex; flex-wrap: wrap; gap: .4rem; margin: 0 0 .8rem; }
.view-chip { display: inline-flex; align-items: center; gap: .15rem; border: 1px solid var(--line); border-radius: 999px; background: var(--card); font-size: .85rem; }
a.view-chip, .view-chip > a { padding: .3rem .75rem; color: var(--ink); text-decoration: none; display: inline-flex; align-items: center; gap: .35rem; }
.view-chip i { font-size: .8em; color: var(--muted); }
.view-chip:hover { border-color: var(--accent); }
.view-chip.active { background: var(--accent); border-color: var(--accent); }
.view-chip.active, .view-chip.active > a, .view-chip.active i { color: #fff; }
.view-chip-x { border: 0; background: none; color: #fff; cursor: pointer; padding: .25rem .6rem .25rem .1rem; opacity: .8; }
.view-chip-x:hover { opacity: 1; }

/* Finance → Pohyby: filtr období, účtu a kategorie */
.fin-filterbar { flex-wrap: wrap; gap: .4rem; }
.fin-filterbar select { max-width: 15rem; }
.fin-filterbar select.is-set { border-color: var(--accent); color: var(--accent); font-weight: 600; }
.fin-range { display: inline-flex; align-items: center; gap: .35rem; flex-wrap: wrap; }
.fin-range[hidden] { display: none; }
.fin-range input[type="month"] { width: 9.5rem; padding: .35rem .5rem; }
.fin-grid tr.g-sums th, .fin-grid tr.g-sums td { font-weight: 600; background: color-mix(in srgb, var(--accent) 5%, transparent); }

/* =========================================================================
   Poznámky – profesionální rozložení: složky | seznam | editor
   ========================================================================= */
.nx { display: grid; grid-template-columns: 210px 320px minmax(0, 1fr); height: calc(100vh - 110px); height: calc(100dvh - 110px); min-height: 520px;
  background: var(--card); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; box-shadow: 0 1px 2px rgba(16,24,40,.04), 0 8px 24px rgba(16,24,40,.05); }
/* 1) složky */
.nx-nav { display: flex; flex-direction: column; gap: .7rem; padding: .9rem .7rem; background: color-mix(in srgb, var(--bg) 70%, var(--card)); border-right: 1px solid var(--line); overflow-y: auto; min-width: 0; }
.nx-new { justify-content: center; width: 100%; }
.nx-search { position: relative; }
.nx-search i { position: absolute; left: .65rem; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: .8rem; pointer-events: none; }
.nx-search input { width: 100%; padding: .45rem .6rem .45rem 1.9rem; font-size: .88rem; border-radius: 9px; background: var(--card); }
.nx-folders { display: flex; flex-direction: column; gap: 1px; }
.nx-folder { display: flex; align-items: center; gap: .55rem; padding: .42rem .6rem; border-radius: 8px; color: var(--ink); text-decoration: none; font-size: .88rem; }
.nx-folder i { width: 1.05rem; text-align: center; color: var(--muted); flex: none; }
.nx-folder span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nx-folder em { font-style: normal; font-size: .75rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.nx-folder:hover { background: color-mix(in srgb, var(--ink) 5%, transparent); text-decoration: none; }
.nx-folder.active { background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent); font-weight: 600; }
.nx-folder.active i, .nx-folder.active em { color: var(--accent); }
.nx-heading { font-size: .68rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); padding: .8rem .6rem .25rem; }
.nx-sep { height: 1px; background: var(--line); margin: .5rem .4rem; }
.nx-colors { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 .55rem; margin-top: auto; }
.nx-cdot { width: 16px; height: 16px; border-radius: 50%; background: var(--dot); border: 1.5px solid var(--dot-b); }
.nx-cdot.active { box-shadow: 0 0 0 2px var(--card), 0 0 0 4px var(--accent); }
.nx-mobile-folder { display: none; }
/* 2) seznam */
.nx-list { display: flex; flex-direction: column; min-width: 0; min-height: 0; border-right: 1px solid var(--line); }
.nx-list-head { display: flex; align-items: center; justify-content: space-between; gap: .6rem; padding: .9rem 1rem .7rem; border-bottom: 1px solid var(--line); }
.nx-list-head h2 { margin: 0; font-size: 1.05rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nx-list-head > div { min-width: 0; }
.nx-sort select { font-size: .8rem; padding: .3rem 1.6rem .3rem .5rem; border-radius: 8px; max-width: 10.5rem; }
.nx-hint { margin: 0; padding: .5rem 1rem; font-size: .78rem; color: var(--muted); border-bottom: 1px solid var(--line); }
.nx-items { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: .35rem .45rem .8rem; scrollbar-width: thin; }
.nx-group { position: sticky; top: -.35rem; z-index: 1; background: var(--card); font-size: .7rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: .7rem .6rem .3rem; }
.nx-empty { color: var(--muted); padding: 1rem .6rem; margin: 0; }
.nx .nr-item { display: flex; flex-direction: column; gap: 2px; padding: .6rem .7rem; margin: 0 0 1px; border: 0; border-radius: 10px; background: none; color: var(--ink);
  opacity: 1; box-shadow: none; transform: none; position: relative; text-decoration: none; transition: background .12s; }
.nx .nr-item::after { content: ''; position: absolute; left: .7rem; right: .7rem; bottom: -1px; height: 1px; background: var(--line); }
.nx .nr-item:hover { background: color-mix(in srgb, var(--ink) 4%, transparent); transform: none; box-shadow: none; }
.nx .nr-item.active { background: color-mix(in srgb, var(--accent) 11%, transparent); box-shadow: none; transform: none; }
.nx .nr-item.active::after, .nx .nr-item:hover::after { opacity: 0; }
.nx .nr-head { font-size: .9rem; font-weight: 650; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nx .nr-line { display: flex; gap: .45rem; font-size: .8rem; color: var(--muted); min-width: 0; }
.nx .nr-date { flex: none; color: var(--ink); opacity: .75; font-variant-numeric: tabular-nums; }
.nx .nr-snip { display: block; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; -webkit-line-clamp: unset; }
.nx .nr-meta { display: flex; align-items: center; gap: .55rem; font-size: .72rem; color: var(--muted); margin: 1px 0 0; min-height: 0; }
.nx .nr-meta:empty { display: none; }
.nx .nr-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--nr-bg); box-shadow: inset 0 0 0 1.5px var(--nr-border); flex: none; }
.nx .nr-proj { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.nx .nr-chk.done { color: #1d8a4e; }
.nx .nr-item.sort-ghost { opacity: .4; }
/* 3) editor */
.nx-editor { min-width: 0; min-height: 0; overflow-y: auto; position: relative; }
.nx-blank { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .8rem; color: var(--muted); text-align: center; padding: 2rem; }
.nx-blank > i { font-size: 2.6rem; opacity: .35; }
.nx-doc.note-form { background: var(--card); color: var(--ink); border: 0; border-radius: 0; box-shadow: none; padding: 0; min-height: 100%; display: flex; flex-direction: column; }
.nx-doc::before { content: ''; display: block; height: 4px; background: var(--note-border); opacity: .9; flex: none; }
.nx-doc-bar { position: sticky; top: 0; z-index: 4; display: flex; align-items: center; gap: .8rem; padding: .55rem 1.2rem; background: color-mix(in srgb, var(--card) 92%, transparent); backdrop-filter: blur(6px); border-bottom: 1px solid var(--line); }
.nx-doc-bar .note-save-state { margin-right: auto; color: var(--muted); }
.nx-back { display: none; }
.nx-doc-actions { display: flex; gap: .2rem; }
.icon-btn { border: 0; background: none; color: var(--muted); width: 2rem; height: 2rem; border-radius: 8px; cursor: pointer; display: inline-grid; place-items: center; font-size: .95rem; }
.icon-btn:hover { background: color-mix(in srgb, var(--ink) 6%, transparent); color: var(--ink); }
.icon-btn.danger:hover { color: var(--stop); }
.nx-doc-form { display: flex; flex-direction: column; flex: 1; padding: 1.4rem 2.2rem 2rem; gap: .6rem; max-width: 900px; width: 100%; margin: 0 auto; box-sizing: border-box; }
.nx-doc .nx-title { border: 0; background: none; padding: .1rem 0; font-size: 1.75rem; font-weight: 700; letter-spacing: -.01em; color: var(--ink); box-shadow: none; outline: none; width: 100%; }
.nx-doc .nx-title::placeholder { color: color-mix(in srgb, var(--muted) 70%, transparent); }
.nx-props { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1.1rem; padding-bottom: .7rem; border-bottom: 1px solid var(--line); }
.nx-prop { display: inline-flex; align-items: center; gap: .4rem; color: var(--muted); font-size: .85rem; }
.nx-doc .nx-prop select { border: 0; background: none; padding: .2rem 1.4rem .2rem .2rem; font-size: .85rem; color: var(--ink); font-weight: 500; }
.nx-doc .nx-prop select:hover { background-color: color-mix(in srgb, var(--ink) 5%, transparent); border-radius: 6px; }
.nx-doc .color-pick { border: 0; padding: 0; margin: 0; gap: 5px; display: inline-flex; flex-wrap: wrap; }
.nx-doc .color-pick .swatch { width: 15px; height: 15px; }
.nx-meta { margin-left: auto; }
.nx-doc label, .nx-doc legend { color: var(--muted); }
.nx-doc .ql-toolbar.ql-snow { position: sticky; top: 49px; z-index: 3; background: var(--card); border: 0; border-bottom: 1px solid var(--line); border-radius: 0; padding: .35rem 0; }
.nx-doc .ql-container.ql-snow { border: 0; background: none; font-size: 1rem; flex: 1; }
.nx-doc .ql-editor { min-height: 50vh; padding: .9rem 0 3rem; line-height: 1.65; color: var(--ink); }
.nx-doc .ql-editor.ql-blank::before { left: 0; color: var(--muted); }
.nx-doc .ql-editor li[data-list="checked"] { color: var(--muted); }
.nx-doc .note-state-bar { background: color-mix(in srgb, var(--accent) 8%, transparent); }
/* přepínání poznámek: jemný přechod */
.nx .nt-out-up, .nx .nt-out-down { animation: nx-out .14s ease-in forwards; }
.nx .nt-in-up    { animation: nx-in-up .26s cubic-bezier(.2, .8, .3, 1); }
.nx .nt-in-down  { animation: nx-in-down .26s cubic-bezier(.2, .8, .3, 1); }
@keyframes nx-out { to { opacity: 0; transform: translateY(0) scale(.995); } }
@keyframes nx-in-up { from { opacity: 0; transform: translateY(14px); } }
@keyframes nx-in-down { from { opacity: 0; transform: translateY(-14px); } }
.nx .nr-pulse { animation: none; }
/* menší šířky */
@media (max-width: 1250px) { .nx { grid-template-columns: 190px 280px minmax(0, 1fr); } .nx-doc-form { padding: 1.2rem 1.5rem 2rem; } }
@media (max-width: 1000px) {
  .nx { grid-template-columns: 280px minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
  .nx-nav { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; align-items: center; padding: .6rem; gap: .5rem; border-right: 0; border-bottom: 1px solid var(--line); overflow: visible; }
  .nx-nav .nx-folders, .nx-nav .nx-colors { display: none; }
  .nx-nav .nx-new { width: auto; flex: none; }
  .nx-nav .nx-search { flex: 1 1 160px; min-width: 120px; }
  .nx-mobile-folder { display: block; flex: 1 1 180px; font-size: .9rem; }
  .nx-list-head { flex-wrap: wrap; }
}
@media (max-width: 720px) {
  main:has(.nx) { padding: 12px; }
  .nx { grid-template-columns: minmax(0, 1fr); height: calc(100dvh - 90px); border-radius: 12px; }
  .nx-mobile-folder { flex-basis: 100%; }
  .nx-editor { display: none; }
  .nx.nx-open .nx-nav, .nx.nx-open .nx-list { display: none; }
  .nx.nx-open .nx-editor { display: block; grid-row: 1 / span 2; }
  .nx-back { display: inline-flex; }
  .nx-doc-form { padding: 1rem 1rem 2rem; }
  .nx-doc .nx-title { font-size: 1.4rem; }
  .nx-meta { margin-left: 0; width: 100%; }
}
.nx-doc label.nx-prop { display: inline-flex; flex-direction: row; align-items: center; gap: .35rem; margin: 0; }
.nx-doc .nx-prop i { color: var(--muted); }
.nx-sort { display: inline-flex; align-items: center; gap: .3rem; color: var(--muted); font-size: .8rem; flex: none; }
.nx-sort select { border: 0; background-color: transparent; padding: .2rem 1.3rem .2rem .2rem; font-size: .8rem; color: var(--muted); max-width: 8.5rem; }
.nx-sort select:hover { color: var(--ink); }
/* rozložení poznámek: přebít starší pravidla „posledních poznámek“ pro úzké obrazovky */
.nx .note-recent { order: 0; position: static; }
.nx .note-recent-list { display: block; flex-direction: column; overflow-x: hidden; max-height: none; scroll-snap-type: none; }
.nx .nr-item { flex: none; scroll-snap-align: none; }
@media (max-width: 1000px) {
  .nx .nx-nav { grid-row: 1; grid-column: 1 / -1; }
  .nx .nx-list { grid-row: 2; grid-column: 1; }
  .nx .nx-editor { grid-row: 2; grid-column: 2; }
}
@media (max-width: 720px) {
  .nx .nx-list { grid-column: 1; }
  .nx.nx-open .nx-editor { grid-row: 1 / span 2; grid-column: 1; }
}

/* Finance → Nástěnka: výdaje vybraných kategorií v čase */
.fd-catpick { display: flex; flex-wrap: wrap; gap: .35rem; margin: 0 0 1rem; }
.fd-catpick.busy { opacity: .6; pointer-events: none; }
.fd-chip { --c: var(--muted); display: inline-flex; align-items: center; gap: .4rem; padding: .25rem .65rem; border: 1px solid var(--line); border-radius: 999px; font-size: .8rem; cursor: pointer; user-select: none; background: var(--card); color: var(--ink); transition: border-color .12s, background .12s; }
.fd-chip input { position: absolute; opacity: 0; pointer-events: none; }
.fd-chip .sw { width: 10px; height: 10px; border-radius: 50%; border: 1.5px solid var(--line); background: transparent; flex: none; }
.fd-chip:hover { border-color: var(--accent); }
.fd-chip.d0 { font-weight: 600; }
.fd-chip.d1, .fd-chip.d2 { color: var(--muted); }
.fd-chip.on { border-color: var(--c); background: color-mix(in srgb, var(--c) 10%, var(--card)); color: var(--ink); }
.fd-chip.on .sw { background: var(--c); border-color: var(--c); }
.fd-chip:focus-within { outline: 2px solid var(--accent); outline-offset: 1px; }
.fd-cat-hint { margin: 0; }
.fd-svgwrap polyline.cat { fill: none; stroke-width: 2.5; vector-effect: non-scaling-stroke; stroke-linejoin: round; stroke-linecap: round; }
.fd-svgwrap polyline.cat.plan { stroke-dasharray: 6 5; opacity: .75; }
.fd-dot.cat { border-color: var(--c); width: 8px; height: 8px; margin: -4px 0 0 -4px; }
.fd-cat-sum { display: flex; flex-wrap: wrap; gap: .3rem 1.4rem; margin-top: .6rem; font-size: .8rem; color: var(--muted); }
.fd-cat-sum i { display: inline-block; width: 14px; height: 3px; border-radius: 2px; vertical-align: middle; margin-right: .2rem; }
.fd-cat-sum strong { color: var(--ink); font-weight: 600; }
.fd-dot.cat:hover, .fd-dot.cat:focus { background: var(--c); }
.fd-chip { position: relative; } .fd-chip input { left: 0; top: 0; width: 1px; height: 1px; }
.fd-catpick label.fd-chip { flex-direction: row; margin: 0; }
.fd-legend.neutral .lg.line { border-top-color: var(--muted); }

/* Dostupnost webů */
.mon-top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.mon-kpi { display: flex; align-items: center; gap: .9rem; padding: .9rem 1.2rem; border-radius: 14px; background: var(--card); border: 1px solid var(--line); flex: 1; min-width: 260px; }
.mon-kpi > i { font-size: 1.8rem; color: var(--muted); }
.mon-kpi.good > i { color: #1d8a4e; } .mon-kpi.bad { border-color: var(--stop); background: color-mix(in srgb, var(--stop) 6%, var(--card)); } .mon-kpi.bad > i { color: var(--stop); }
.mon-kpi strong { display: block; font-size: 1.1rem; }
.mon-cron-warn a { color: inherit; text-decoration: underline; }
.mon-table-wrap { overflow-x: auto; }
.mon-table { min-width: 980px; }
.mon-table td { vertical-align: middle; }
.mon-table tr.mon-off td { opacity: .55; }
.mon-badge { display: inline-flex; align-items: center; gap: .35rem; padding: .2rem .6rem; border-radius: 999px; font-size: .78rem; font-weight: 700; white-space: nowrap; }
.mon-badge::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.mon-badge.up { color: #157347; background: #e3f5ea; }
.mon-badge.down { color: #b42318; background: #fde7e6; }
.mon-badge.down::before { animation: mon-pulse 1.4s ease-in-out infinite; }
.mon-badge.wait { color: #8a6d00; background: #fff4cc; }
.mon-badge.off { color: var(--muted); background: var(--bg); }
@keyframes mon-pulse { 50% { opacity: .25; } }
.mon-url { color: var(--muted); }
.mon-code { display: inline-block; min-width: 2.4rem; text-align: center; padding: .05rem .35rem; border-radius: 6px; font-weight: 700; font-size: .8rem; font-variant-numeric: tabular-nums; }
.mon-code.c2 { background: #e3f5ea; color: #157347; } .mon-code.c3 { background: #e7effc; color: #1f5fd1; }
.mon-code.c4, .mon-code.c5, .mon-code.c0 { background: #fde7e6; color: #b42318; }
.mon-bars { display: flex; gap: 2px; align-items: stretch; height: 22px; }
.mon-bars span { width: 5px; border-radius: 2px; background: var(--line); }
.mon-bars span.ok { background: #34b36b; } .mon-bars span.warn { background: #f0b429; } .mon-bars span.bad { background: #e5484d; }
.mon-add { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-top: 1rem; padding-top: .9rem; border-top: 1px solid var(--line); }
.mon-add select { max-width: 18rem; } .mon-add input { flex: 1 1 200px; max-width: 22rem; }
.mon-events { list-style: none; margin: 0; padding: 0; }
.mon-events li { display: flex; align-items: baseline; gap: .7rem; padding: .45rem 0; border-bottom: 1px solid var(--line); font-size: .9rem; flex-wrap: wrap; }
.mon-events li:last-child { border-bottom: 0; }
.mon-ev-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; align-self: center; }
.mon-events li.up .mon-ev-dot { background: #34b36b; } .mon-events li.down .mon-ev-dot { background: #e5484d; }
.mon-ev-time { color: var(--muted); font-variant-numeric: tabular-nums; min-width: 8.5rem; }
.mon-notify { max-width: 640px; }
/* přepínač v seznamu projektů */
.mon-cell { white-space: nowrap; }
.mon-toggle { display: inline-flex; align-items: center; cursor: pointer; vertical-align: middle; position: relative; margin: 0; }
.mon-toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.mon-toggle .sw-track { width: 32px; height: 18px; border-radius: 999px; background: var(--line); position: relative; transition: background .15s; }
.mon-toggle .sw-track::after { content: ''; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: transform .15s; }
.mon-toggle input:checked + .sw-track { background: var(--accent); }
.mon-toggle input:checked + .sw-track::after { transform: translateX(14px); }
.mon-toggle input:focus-visible + .sw-track { outline: 2px solid var(--accent); outline-offset: 2px; }
.mon-mini { display: inline-block; margin-left: .4rem; min-width: 2.1rem; text-align: center; padding: 0 .3rem; border-radius: 6px; font-size: .75rem; font-weight: 700; text-decoration: none; vertical-align: middle; }
.mon-mini.up { background: #e3f5ea; color: #157347; } .mon-mini.down { background: #fde7e6; color: #b42318; } .mon-mini.wait { background: #fff4cc; color: #8a6d00; }
.mon-ask { display: inline-flex; gap: .3rem; margin-left: .4rem; vertical-align: middle; }
.mon-ask input { width: 12rem; padding: .25rem .45rem; font-size: .85rem; }
.mon-ask input.invalid { border-color: var(--stop); }
.mon-th { white-space: nowrap; }

/* Dostupnost webů – DNS záznamy */
.mon-sub { display: flex; align-items: center; gap: .6rem; margin-top: .15rem; flex-wrap: wrap; }
.mon-dns-btn { padding: 0; }
.mon-dns-changed { font-size: .72rem; font-weight: 700; color: #8a6d00; background: #fff4cc; padding: .05rem .45rem; border-radius: 6px; }
.mon-table tr.mon-dns-row > td { background: color-mix(in srgb, var(--bg) 60%, var(--card)); padding: .8rem 1rem 1rem; }
.mon-dns-table { width: 100%; border-collapse: collapse; font-size: .84rem; }
.mon-dns-table th { text-align: left; font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: .2rem .5rem; }
.mon-dns-table td { padding: .28rem .5rem; vertical-align: top; border-top: 1px solid transparent; }
.mon-dns-table tr.grp td { border-top-color: var(--line); }
.mon-dns-table tr.new td { background: #e3f5ea; }
.mon-dns-val { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .8rem; word-break: break-all; }
.mon-rr { display: inline-block; min-width: 3.2rem; text-align: center; padding: .05rem .35rem; border-radius: 6px; background: color-mix(in srgb, var(--accent) 10%, transparent); color: var(--accent); font-weight: 700; font-size: .75rem; }
.mon-new-tag { font-family: inherit; font-size: .68rem; font-weight: 700; color: #157347; }
.mon-dns-del { margin-top: .6rem; padding: .5rem .7rem; border-radius: 8px; background: #fde7e6; color: #8a1c14; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.mon-dns-del strong { font-family: var(--font, inherit); }
.mon-dns-foot { margin: .6rem 0 0; }

/* Dostupnost webů – historie webu */
.mon-name { border: 0; background: none; padding: 0; font: inherit; color: var(--accent); cursor: pointer; text-align: left; }
.mon-name i { font-size: .65rem; opacity: .6; margin-left: .15rem; transition: transform .15s; }
.mon-name[aria-expanded="true"] i { transform: rotate(180deg); }
.mon-hist { display: flex; flex-direction: column; gap: 1rem; }
.mon-hist-h { font-size: .72rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); margin-bottom: .35rem; }
.mon-hist-h .small { text-transform: none; letter-spacing: 0; font-weight: 400; margin-left: .4rem; }
.mon-hist-svg { position: relative; padding-top: 2px; }
.mon-hist-svg svg { width: 100%; height: 120px; display: block; background: var(--card); border: 1px solid var(--line); border-radius: 8px; }
.mon-hist-svg polyline { fill: none; stroke: var(--accent); stroke-width: 1.8; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.mon-hist-svg rect.fail { fill: #e5484d; opacity: .75; }
.mon-hist-max { position: absolute; top: 6px; left: 8px; font-size: .68rem; color: var(--muted); }
.mon-hist-x { display: flex; justify-content: space-between; font-size: .68rem; color: var(--muted); margin-top: .2rem; }
.mon-hist-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem 1.6rem; }
.mon-mini-table { width: 100%; border-collapse: collapse; font-size: .82rem; }
.mon-mini-table td { padding: .22rem .35rem; border-top: 1px solid var(--line); vertical-align: middle; }
.mon-mini-table tr:first-child td { border-top: 0; }
.mon-mini-table tr.th td { font-size: .68rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.mon-mini-table tr.bad td { background: #fdf1f0; }
.mon-sub .mon-dns-btn { display: inline-flex; align-items: center; gap: .3rem; width: auto; }
.mon-table td[data-l="Web"] { min-width: 260px; } .mon-sub { gap: .3rem .9rem; }

/* Dostupnost webů – mobil: každý web jako karta */
@media (max-width: 760px) {
  .mon-top { flex-direction: column; align-items: stretch; }
  .mon-check-now .btn { width: 100%; justify-content: center; }
  .mon-table-wrap { overflow: visible; }
  .mon-table { min-width: 0; }
  .mon-table tr[hidden] { display: none; }
  .mon-table tbody tr:not(.mon-dns-row) { grid-template-columns: 1fr 1fr 1fr; grid-template-areas: "st st code" "web web web" "since since ms" "d d7 d30" "bars bars act"; gap: .45rem .6rem; padding: .9rem 0; }
  .mon-table td[data-l="Stav"] { grid-area: st; }
  .mon-table td[data-l="Kód"] { grid-area: code; text-align: right; }
  .mon-table td[data-l="Web"] { grid-area: web; min-width: 0; }
  .mon-table td[data-l="Web"] .mon-name strong { font-size: 1.05rem; }
  .mon-table td[data-l="Odezva"] { grid-area: ms; text-align: right; align-self: end; }
  .mon-table td[data-l="Od"] { grid-area: since; }
  .mon-table td[data-l="Dnes"] { grid-area: d; }
  .mon-table td[data-l="7 dní"] { grid-area: d7; }
  .mon-table td[data-l="30 dní"]:not(.mon-bars-cell) { grid-area: d30; }
  .mon-table td[data-l="Dnes"], .mon-table td[data-l="7 dní"], .mon-table td[data-l="30 dní"]:not(.mon-bars-cell) { text-align: left; background: var(--bg); border-radius: 8px; padding: .35rem .5rem; font-weight: 600; font-variant-numeric: tabular-nums; }
  .mon-table td[data-l="Dnes"]::before, .mon-table td[data-l="7 dní"]::before, .mon-table td[data-l="30 dní"]:not(.mon-bars-cell)::before { content: attr(data-l); display: block; font-size: .68rem; font-weight: 500; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
  .mon-table td.mon-bars-cell { grid-area: bars; align-self: center; }
  .mon-bars { height: 20px; gap: 2px; }
  .mon-bars span { flex: 1; width: auto; }
  .mon-table td.act { grid-area: act; text-align: right; align-self: center; }
  .mon-table td.act .icon-link { padding: .35rem; font-size: 1.05rem; }
  .mon-sub { gap: .3rem 1.1rem; }
  .mon-sub .mon-dns-btn { padding: .2rem 0; }
  .mon-table tr.mon-dns-row { display: block; padding: 0 0 .9rem; border-bottom: 1px solid var(--line); }
  .mon-table tr.mon-dns-row[hidden] { display: none; }
  .mon-table tr.mon-dns-row > td { padding: .8rem .7rem; border-radius: 10px; }
  .mon-hist-svg svg { height: 100px; }
  .mon-hist-cols { grid-template-columns: minmax(0, 1fr); }
  .mon-mini-table { font-size: .8rem; }
  .mon-dns-table thead { display: none; }
  .mon-dns-table, .mon-dns-table tbody { display: block; }
  .mon-dns-table tr { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .1rem .5rem; padding: .35rem 0; border-top: 1px solid var(--line); }
  .mon-dns-table tr:not(.grp) { border-top-style: dashed; }
  .mon-dns-table td { padding: 0; border: 0; }
  .mon-dns-table td:first-child { min-width: 3.4rem; }
  .mon-dns-table tr:not(.grp) td:first-child:empty { visibility: hidden; }
  .mon-dns-table td.muted:not(.r) { font-size: .72rem; }
  .mon-dns-table td.r { text-align: left; font-size: .7rem; }
  .mon-add { flex-direction: column; align-items: stretch; }
  .mon-add select, .mon-add input { max-width: none; }
  .mon-events li { gap: .15rem .6rem; }
  .mon-ev-time { min-width: 0; font-size: .8rem; }
  .mon-events li > span:last-child { flex-basis: 100%; padding-left: 1.2rem; }
}
@media (max-width: 760px) {
  /* vnořené tabulky v rozbalené historii: obyčejné tabulky (ne karty) */
  .mon-table .mon-mini-table { display: table; width: 100%; }
  .mon-table .mon-mini-table tbody { display: table-row-group; width: auto; }
  .mon-table .mon-mini-table tbody tr { display: table-row; width: auto; padding: 0; border: 0; }
  .mon-table .mon-mini-table td { display: table-cell; width: auto; padding: .3rem .3rem; border-top: 1px solid var(--line); }
  .mon-table .mon-mini-table tr:first-child td { border-top: 0; }
  .mon-table .mon-mini-table td.r { text-align: right; }
  .mon-table .mon-dns-table tr { width: auto; }
  .mon-table .mon-dns-table td { width: auto; }
}
@media (max-width: 760px) {
  .mon-table .mon-dns-table tbody tr { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "t v v" "t n ttl"; gap: .1rem .6rem; padding: .45rem 0; background: none; }
  .mon-table .mon-dns-table td { display: block; padding: 0; background: none; }
  .mon-table .mon-dns-table td:nth-child(1) { grid-area: t; }
  .mon-table .mon-dns-table td:nth-child(2) { grid-area: n; font-size: .72rem; }
  .mon-table .mon-dns-table td:nth-child(3) { grid-area: v; }
  .mon-table .mon-dns-table td:nth-child(4) { grid-area: ttl; font-size: .7rem; text-align: right; }
  .mon-table .mon-dns-table tbody tr.new { background: #e3f5ea; border-radius: 6px; padding-left: .3rem; padding-right: .3rem; }
  .mon-dns-val { font-size: .76rem; overflow-wrap: anywhere; word-break: normal; }
  .mon-dns-del { overflow-wrap: anywhere; font-size: .75rem; }
}
@media (max-width: 760px) {
  .projects-table td.mon-cell { display: flex; align-items: center; gap: .1rem; }
  .projects-table td.mon-cell::before { content: 'Hlídat web'; font-size: .78rem; color: var(--muted); margin-right: .5rem; }
  .projects-table td.mon-cell .mon-ask { flex-wrap: wrap; margin: .3rem 0 0; }
  .projects-table td.mon-cell .mon-ask input { width: 100%; }
}

/* Kontrola webů – záložky, změny obsahu, rychlost, SEO */
.mon-kpi-hack { color: inherit; text-decoration: none; } .mon-kpi-hack:hover { text-decoration: none; filter: brightness(.98); }
.mon-kpi-hack .small { color: var(--stop); display: block; }
.mon-tabs { display: flex; gap: .3rem; margin: 0 0 1rem; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.mon-tabs::-webkit-scrollbar { display: none; }
.mon-tabs a { display: inline-flex; align-items: center; gap: .45rem; padding: .6rem .95rem; color: var(--muted); font-weight: 600; font-size: .92rem; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; text-decoration: none; }
.mon-tabs a:hover { color: var(--ink); text-decoration: none; }
.mon-tabs a.on { color: var(--accent); border-bottom-color: var(--accent); }
.mon-tab-b { min-width: 1.25rem; height: 1.25rem; padding: 0 .35rem; border-radius: 999px; background: #f0b429; color: #fff; font-size: .7rem; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.mon-tab-b.bad { background: #e5484d; }
.mon-intro { margin: -.2rem 0 1rem; max-width: 900px; }
.mon-xs { display: flex; flex-direction: column; gap: .6rem; }
.mon-x { border: 1px solid var(--line); border-radius: 12px; background: var(--card); }
.mon-x.lvl-high { border-color: #e5484d; box-shadow: 0 0 0 3px color-mix(in srgb, #e5484d 12%, transparent); }
.mon-x.lvl-low { border-color: #f0b429; }
.mon-x > summary { display: flex; align-items: center; gap: .8rem; padding: .7rem 1rem; cursor: pointer; list-style: none; flex-wrap: wrap; }
.mon-x > summary::-webkit-details-marker { display: none; }
.mon-x > summary::after { content: "\f078"; font-family: "Font Awesome 6 Free"; font-weight: 900; font-size: .7rem; color: var(--muted); transition: transform .15s; }
.mon-x[open] > summary::after { transform: rotate(180deg); }
.mon-x-name { min-width: 0; overflow-wrap: anywhere; }
.mon-x-meta { margin-left: auto; }
.mon-x-body { padding: .2rem 1rem 1rem; border-top: 1px solid var(--line); }
.mon-x-act { display: flex; align-items: center; gap: .9rem; flex-wrap: wrap; margin-top: .9rem; padding-top: .8rem; border-top: 1px dashed var(--line); }
.mon-x-act label.check { flex-direction: row; display: inline-flex; align-items: center; gap: .35rem; margin: 0; }
.mon-badge.warn { color: #8a6d00; background: #fff4cc; }
.good-text { color: #1d8a4e; } .bad-text { color: var(--stop); font-weight: 600; }
.mon-alert { display: flex; gap: .7rem; align-items: flex-start; margin: .9rem 0 .6rem; padding: .7rem .9rem; border-radius: 10px; background: #fde7e6; color: #8a1c14; }
.mon-alert i { font-size: 1.3rem; margin-top: .1rem; }
.mon-find { list-style: none; margin: .8rem 0 .4rem; padding: 0; display: flex; flex-direction: column; gap: .7rem; }
.mon-find > li { padding-left: .8rem; border-left: 3px solid #f0b429; }
.mon-find > li.high { border-left-color: #e5484d; }
.mon-find-h i { color: #c98a00; } .mon-find > li.high .mon-find-h i { color: #e5484d; }
.mon-find-items { margin: .3rem 0 0; padding-left: 1.1rem; font-size: .84rem; }
.mon-find-items code { word-break: break-all; font-size: .8rem; }
.mon-tip { margin: .4rem 0 0; font-size: .84rem; color: var(--ink); background: color-mix(in srgb, var(--accent) 7%, var(--card)); padding: .45rem .65rem; border-radius: 8px; }
.mon-tip i { color: var(--accent); margin-right: .2rem; }
.mon-diff { margin-top: .4rem; font-size: .82rem; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; max-height: 22rem; overflow-y: auto; }
.mon-diff div { padding: .15rem .6rem; overflow-wrap: anywhere; }
.mon-diff .add { background: #e3f5ea; color: #10512f; } .mon-diff .del { background: #fde7e6; color: #8a1c14; text-decoration: line-through; text-decoration-color: rgba(138,28,20,.35); }
.mon-steps { margin: 1rem 0 .4rem; padding: .8rem 1rem; border-radius: 10px; background: var(--bg); font-size: .88rem; }
.mon-steps ol { margin: .4rem 0 0; padding-left: 1.3rem; } .mon-steps li { margin: .25rem 0; }
/* skóre v kroužku */
.mon-ring { --c: var(--muted); width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto;
  background: radial-gradient(closest-side, var(--card) 79%, transparent 80% 100%), conic-gradient(var(--c) calc(var(--p) * 1%), color-mix(in srgb, var(--c) 15%, transparent) 0); }
.mon-ring span { font-weight: 700; font-size: 1.05rem; color: var(--c); font-variant-numeric: tabular-nums; }
.mon-ring.sm { width: 38px; height: 38px; } .mon-ring.sm span { font-size: .82rem; }
.mon-ring.good { --c: #1d9a55; } .mon-ring.mid { --c: #d98a00; } .mon-ring.bad { --c: #e5484d; } .mon-ring.none { --p: 0; }
.mon-ring-l { font-size: .74rem; color: var(--muted); text-align: center; margin-top: .25rem; }
.mon-x-scores { display: inline-flex; }
.mon-psi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1rem 2rem; margin-top: .9rem; }
.mon-psi-h { font-size: .72rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); margin-bottom: .5rem; }
.mon-psi-h .small { text-transform: none; letter-spacing: 0; font-weight: 400; }
.mon-rings { display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; }
.mon-ring-w { position: relative; }
.mon-delta { position: absolute; top: -4px; right: 2px; font-size: .68rem; font-weight: 700; padding: 0 .25rem; border-radius: 5px; }
.mon-delta.up { color: #157347; background: #e3f5ea; } .mon-delta.down { color: #b42318; background: #fde7e6; }
.mon-metrics { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: .4rem; margin: .9rem 0 0; }
.mon-metrics > div { padding: .35rem .5rem; border-radius: 8px; background: var(--bg); border-left: 3px solid var(--line); }
.mon-metrics > div.good { border-left-color: #1d9a55; } .mon-metrics > div.mid { border-left-color: #d98a00; } .mon-metrics > div.bad { border-left-color: #e5484d; }
.mon-metrics dt { font-size: .7rem; color: var(--muted); } .mon-metrics dd { margin: 0; font-weight: 700; font-size: .9rem; }
.mon-field { margin-top: .9rem; display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.mon-fchip { padding: .1rem .5rem; border-radius: 6px; font-weight: 700; background: var(--bg); }
.mon-fchip.good { background: #e3f5ea; color: #157347; } .mon-fchip.mid { background: #fff4cc; color: #8a6d00; } .mon-fchip.bad { background: #fde7e6; color: #b42318; }
.mon-opps { margin-top: 1.1rem; }
.mon-opp { border-top: 1px solid var(--line); }
.mon-opp > summary { padding: .45rem 0; cursor: pointer; font-size: .9rem; display: flex; align-items: baseline; gap: .5rem; flex-wrap: wrap; }
.mon-opp > p { margin: 0 0 .6rem 1.1rem; color: var(--muted); }
.mon-opp code { font-size: .8rem; }
.mon-dot { width: 9px; height: 9px; border-radius: 2px; flex: none; background: var(--muted); align-self: center; }
.mon-dot.bad { background: #e5484d; transform: rotate(45deg); } .mon-dot.mid { background: #d98a00; border-radius: 50%; }
.mon-seo { list-style: none; margin: .8rem 0 0; padding: 0; }
.mon-seo li { display: flex; gap: .7rem; padding: .55rem 0; border-bottom: 1px solid var(--line); font-size: .9rem; }
.mon-seo li:last-child { border-bottom: 0; }
.mon-seo li > i { margin-top: .2rem; font-size: 1rem; }
.mon-seo li.ok > i { color: #1d9a55; } .mon-seo li.warn > i { color: #d98a00; } .mon-seo li.bad > i { color: #e5484d; } .mon-seo li.info > i { color: var(--muted); }
.mon-seo li > div { min-width: 0; flex: 1; }
.mon-seo-v { color: var(--muted); overflow-wrap: anywhere; }
.mon-psi-key { margin: 1.2rem 0 1rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.mon-psi-key details p { margin: .4rem 0 0; }
button.is-busy { opacity: .7; cursor: progress; }
@media (prefers-color-scheme: dark) {
  .mon-alert, .mon-diff .del { background: #3a1f1a; color: #f3b3a8; }
  .mon-diff .add { background: #16301f; color: #9fe0b5; }
  .mon-fchip.good, .mon-delta.up { background: #16301f; color: #9fe0b5; } .mon-fchip.mid, .mon-badge.warn { background: #3a2f12; color: #f0cf7a; } .mon-fchip.bad, .mon-delta.down { background: #3a1f1a; color: #f3b3a8; }
}
@media (max-width: 760px) {
  .mon-x > summary { gap: .5rem; padding: .65rem .8rem; }
  .mon-x-meta { margin-left: 0; width: 100%; order: 3; }
  .mon-x > summary::after { order: 2; }
  .mon-x-body { padding: .2rem .8rem .9rem; }
  .mon-ring { width: 52px; height: 52px; }
  .mon-psi-grid { grid-template-columns: 1fr; }
  .mon-tabs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; }
  .mon-tabs a { flex-direction: column; gap: .2rem; padding: .5rem .2rem; font-size: .76rem; position: relative; text-align: center; white-space: normal; line-height: 1.2; }
  .mon-tabs a i { font-size: 1rem; }
  .mon-tab-b { position: absolute; top: .2rem; right: calc(50% - 1.6rem); }
}

.mon-free { display: inline-block; padding: 0 .4rem; border-radius: 6px; background: var(--bg); border: 1px solid var(--line); font-size: .72rem; }
.mon-add input[data-mon-name] { flex: 0 1 12rem; }
@media (max-width: 760px) { .mon-add select, .mon-add input, .mon-add input[data-mon-name] { flex: 1 1 100%; max-width: none; } }

.icon-link.mon-muted { color: #c98a00; }
.mon-nomail { display: inline-flex; align-items: center; gap: .3rem; font-size: .72rem; color: var(--muted); padding: 0 .4rem; border: 1px solid var(--line); border-radius: 6px; }
@media (min-width: 761px) {
  .mon-table td.act form { display: inline-grid; grid-template-columns: repeat(2, auto); gap: .1rem .2rem; justify-items: center; }
  .mon-table td.act form input[type=hidden] { display: none; }
}
@media (min-width: 761px) and (max-width: 1500px) { .mon-bars span { width: 3px; } .mon-bars { gap: 1.5px; } }

/* Projekty: rychlá úprava atributů v seznamu */
.projects-table td.attr-cell:not([data-type="check"]) { cursor: pointer; position: relative; }
.projects-table td.attr-cell:not([data-type="check"]):hover { background: color-mix(in srgb, var(--accent) 5%, transparent); }
.projects-table td.attr-cell { vertical-align: middle; }
.attr-pen { position: absolute; right: .15rem; top: 50%; transform: translateY(-50%); border: 0; background: none; padding: .2rem; color: var(--muted); font-size: .7rem; cursor: pointer; opacity: 0; vertical-align: middle; }
td.attr-cell:hover .attr-pen, .attr-pen:focus-visible { opacity: .8; }
@media (hover: none) { .attr-pen { opacity: .45; } }
td.attr-cell.editing .attr-val, td.attr-cell.editing .attr-pen { display: none; }
.attr-ed { width: 100%; min-width: 7rem; padding: .25rem .4rem; font: inherit; font-size: .88rem; border: 1px solid var(--accent); border-radius: 6px; background: var(--card); color: var(--ink); }
.attr-tgl { width: 1.35rem; height: 1.35rem; border-radius: 5px; border: 1.5px solid var(--line); background: var(--card); color: transparent; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; font-size: .72rem; transition: background .12s, border-color .12s; }
.attr-tgl:hover { border-color: var(--accent); }
.attr-tgl.on { background: var(--accent); border-color: var(--accent); color: #fff; }
td.attr-saving { opacity: .55; }
td.attr-err { box-shadow: inset 0 0 0 2px #e5484d; }
.projects-table th.c { text-align: center; }
.projects-table th.c .th-sort { justify-content: center; }
.projects-table td.attr-cell[data-type="check"] { text-align: center; }
@media (max-width: 760px) { .projects-table td.attr-cell[data-type="check"] { text-align: left; } }
.cols-hint { margin: 0 0 .4rem; }
.cols-list { display: flex; flex-direction: column; }
.cols-item { display: flex; align-items: center; gap: .35rem; padding: .15rem 0; border-radius: 6px; background: var(--card); }
.cols-item label.check { flex: 1; flex-direction: row; margin: 0; }
.cols-grip { cursor: grab; color: var(--muted); padding: .2rem .25rem; touch-action: none; }
.cols-grip:active { cursor: grabbing; }
.cols-move { display: inline-flex; gap: .1rem; }
.cols-move button { padding: .15rem .3rem; color: var(--muted); font-size: .72rem; }
.cols-move button:hover { color: var(--accent); }
.cols-item:first-child [data-cols-up], .cols-item:last-child [data-cols-down] { visibility: hidden; }
.cols-ghost { opacity: .4; background: color-mix(in srgb, var(--accent) 10%, var(--card)); }

/* Kalendář: odběr do telefonu (ICS) */
.ics-url { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; margin: 1rem 0; }
.ics-url input { flex: 1 1 22rem; min-width: 0; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .8rem; background: var(--bg); }
.ics-help { display: flex; flex-direction: column; gap: .4rem; margin-bottom: 1rem; }
.ics-help details { border: 1px solid var(--line); border-radius: 10px; padding: .55rem .85rem; }
.ics-help summary { cursor: pointer; font-weight: 600; }
.ics-help ol { margin: .5rem 0 .2rem; padding-left: 1.3rem; font-size: .9rem; }
.ics-help li { margin: .25rem 0; }
.ics-opts fieldset { border: 0; padding: 0; margin: 0 0 .6rem; display: flex; flex-direction: column; gap: .35rem; }
.ics-opts legend { font-weight: 600; margin-bottom: .4rem; }
.ics-opts label.check { flex-direction: row; align-items: center; gap: .45rem; margin: 0; padding: .1rem 0; min-height: 0; }
.fc-dot { width: .7rem; height: .7rem; border-radius: 50%; background: var(--fc); display: inline-block; flex: none; }
@media (max-width: 760px) { .ics-url .btn { flex: 1 1 auto; justify-content: center; } }
.ics-opts label.check input[type=checkbox] { min-height: 0; height: 1.1rem; width: 1.1rem; margin: 0; flex: none; }

/* ===== Nástěnka (kanban) ===== */
.kb-page.kb-full { max-width: none; }
.kb-top { display: flex; align-items: center; justify-content: space-between; gap: .8rem; flex-wrap: wrap; margin-bottom: .9rem; }
.kb-top h1 { margin: 0; }
.kb-top-act { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.kb-search { display: inline-flex; align-items: center; gap: .4rem; background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 0 .6rem; color: var(--muted); }
.kb-search input { border: 0; background: transparent; padding: .38rem 0; min-height: 0; width: 12rem; outline: none; color: var(--ink); }
.kb-board { display: flex; align-items: flex-start; gap: .8rem; overflow-x: auto; padding-bottom: 1rem; min-height: calc(100vh - 170px); scroll-snap-type: x proximity; }
.kb-cols { display: flex; align-items: flex-start; gap: .8rem; }
.kb-col { --cc: transparent; width: 280px; flex: none; background: color-mix(in srgb, var(--ink) 5%, var(--bg)); border-radius: 12px; display: flex; flex-direction: column; max-height: calc(100vh - 160px); border-top: 4px solid var(--cc); scroll-snap-align: start; }
.kb-col-head { display: flex; align-items: center; gap: .3rem; padding: .5rem .5rem .3rem .6rem; cursor: grab; }
.kb-col-name { flex: 1; min-width: 0; margin: 0; font-weight: 700; font-size: .95rem; padding: .3rem .4rem; border-radius: 6px; color: var(--ink); overflow-wrap: anywhere; line-height: 1.3; }
.kb-col-name:hover { background: color-mix(in srgb, var(--ink) 6%, transparent); }
.kb-col-name-ed { flex: 1; min-width: 0; font-weight: 700; font-size: .95rem; padding: .25rem .35rem; border: 1px solid var(--accent); border-radius: 6px; min-height: 0; }
.kb-col-count { font-size: .75rem; color: var(--muted); font-weight: 600; min-width: 1.2rem; text-align: center; }
.kb-col-menu { position: relative; }
.kb-col-menu > summary { list-style: none; cursor: pointer; padding: .3rem .45rem; border-radius: 6px; color: var(--muted); }
.kb-col-menu > summary::-webkit-details-marker { display: none; }
.kb-col-menu > summary:hover { background: color-mix(in srgb, var(--ink) 8%, transparent); color: var(--ink); }
.kb-pop { position: absolute; right: 0; top: calc(100% + 4px); z-index: 30; width: 230px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 30px rgba(15,25,45,.16); padding: .6rem; cursor: default; }
.kb-pop-t { font-size: .74rem; font-weight: 700; color: var(--muted); margin-bottom: .4rem; }
.kb-pop-item { display: flex; align-items: center; gap: .5rem; width: 100%; text-align: left; background: none; border: 0; padding: .45rem .4rem; border-radius: 6px; cursor: pointer; color: var(--ink); font: inherit; font-size: .88rem; }
.kb-pop-item:hover { background: var(--bg); }
.kb-pop-item.danger { color: var(--stop); }
.kb-swatches { display: flex; flex-wrap: wrap; gap: .3rem; margin-bottom: .5rem; }
.kb-swatches button { width: 1.6rem; height: 1.6rem; border-radius: 6px; border: 2px solid transparent; background: var(--sw); cursor: pointer; padding: 0; min-height: 0; }
.kb-swatches button:first-child { background: var(--card); border-color: var(--line); background-image: linear-gradient(135deg, transparent 45%, var(--muted) 46% 54%, transparent 55%); }
.kb-swatches button.on { box-shadow: 0 0 0 2px var(--card), 0 0 0 4px var(--ink); }
.kb-list { list-style: none; margin: 0; padding: .2rem .5rem .3rem; overflow-y: auto; min-height: 8px; display: flex; flex-direction: column; gap: .5rem; flex: 1 1 auto; }
.kb-card { --kc: transparent; background: var(--card); border-radius: 9px; box-shadow: 0 1px 0 rgba(15,25,45,.12), 0 1px 3px rgba(15,25,45,.06); padding: .55rem .7rem; cursor: pointer; position: relative; overflow: hidden; border-left: 4px solid var(--kc); }
.kb-card:not(.has-color) { border-left-width: 0; }
.kb-card:hover { box-shadow: 0 0 0 1.5px var(--accent), 0 2px 6px rgba(15,25,45,.1); }
.kb-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.kb-cover { margin: -.55rem -.7rem .5rem; max-height: 150px; overflow: hidden; background: var(--bg); }
.kb-card.has-color .kb-cover { margin-left: calc(-.7rem); }
.kb-cover img { width: 100%; display: block; object-fit: cover; max-height: 150px; }
.kb-card-title { font-size: .92rem; line-height: 1.35; overflow-wrap: anywhere; }
.kb-badges { display: flex; flex-wrap: wrap; gap: .3rem .55rem; margin-top: .4rem; font-size: .74rem; color: var(--muted); }
.kb-badge { display: inline-flex; align-items: center; gap: .25rem; }
.kb-badge.due { padding: .05rem .35rem; border-radius: 5px; background: var(--bg); }
.kb-badge.due.late { background: #fde7e6; color: #b42318; font-weight: 600; }
.kb-badge.due.today { background: #fff1d6; color: #9a5b00; font-weight: 600; }
.kb-badge.due.soon { background: #fff8e6; color: #8a6d00; }
.kb-badge.done { color: #157347; font-weight: 600; }
.kb-badge.proj { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kb-ghost { opacity: .35; }
.kb-drag { transform: rotate(2.5deg); box-shadow: 0 10px 24px rgba(15,25,45,.2) !important; }
.kb-add { padding: .3rem .5rem .55rem; }
.kb-add-btn, .kb-col-new-btn { width: 100%; text-align: left; background: none; border: 0; border-radius: 8px; padding: .5rem .55rem; color: var(--muted); cursor: pointer; font: inherit; font-size: .9rem; display: flex; align-items: center; gap: .45rem; }
.kb-add-btn:hover { background: color-mix(in srgb, var(--ink) 7%, transparent); color: var(--ink); }
.kb-add-form textarea { width: 100%; border: 0; border-radius: 9px; padding: .55rem .7rem; box-shadow: 0 1px 0 rgba(15,25,45,.12); resize: none; font: inherit; font-size: .92rem; background: var(--card); color: var(--ink); }
.kb-add-act { display: flex; align-items: center; gap: .5rem; margin-top: .4rem; }
.kb-col-new { width: 280px; flex: none; }
.kb-col-new-btn { background: color-mix(in srgb, var(--ink) 5%, var(--bg)); padding: .7rem .8rem; border-radius: 12px; font-weight: 600; }
.kb-col-new-btn:hover { background: color-mix(in srgb, var(--ink) 9%, var(--bg)); color: var(--ink); }
.kb-col-new-form { background: color-mix(in srgb, var(--ink) 5%, var(--bg)); border-radius: 12px; padding: .5rem; }
.kb-col-new-form input { width: 100%; }
/* detail karty */
.kb-dlg { width: min(760px, calc(100vw - 24px)); max-height: calc(100vh - 48px); padding: 0; border: 0; border-radius: 14px; background: var(--card); color: var(--ink); box-shadow: 0 24px 60px rgba(10,20,40,.35); }
.kb-dlg::backdrop { background: rgba(12,20,35,.55); }
.kb-dlg-in { max-height: calc(100vh - 48px); overflow-y: auto; }
.kb-d-head { --kc: transparent; display: flex; align-items: flex-start; gap: .6rem; padding: 1.1rem 1.2rem .4rem; border-top: 6px solid var(--kc); position: sticky; top: 0; background: var(--card); z-index: 2; }
.kb-d-ic { color: var(--muted); margin-top: .55rem; }
.kb-d-title { flex: 1; font-size: 1.25rem; font-weight: 700; border: 1px solid transparent; border-radius: 8px; padding: .25rem .4rem; resize: none; background: transparent; color: var(--ink); font-family: inherit; overflow: hidden; line-height: 1.3; min-height: 0; }
.kb-d-title:focus { border-color: var(--accent); background: var(--card); outline: none; }
.kb-d-close { border: 0; background: none; font-size: 1.15rem; color: var(--muted); padding: .4rem .55rem; border-radius: 8px; cursor: pointer; }
.kb-d-close:hover { background: var(--bg); color: var(--ink); }
.kb-d-main { padding: .2rem 1.2rem 1rem 3.1rem; }
.kb-d-props { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .6rem; margin-bottom: .8rem; }
.kb-d-props label { font-size: .74rem; font-weight: 600; color: var(--muted); display: flex; flex-direction: column; gap: .2rem; margin: 0; }
.kb-d-props select, .kb-d-props input { font-size: .88rem; width: 100%; min-width: 0; }
.kb-d-sec { margin-top: 1.1rem; }
.kb-d-label { font-weight: 700; font-size: .92rem; margin-bottom: .45rem; display: flex; align-items: center; gap: .45rem; }
.kb-d-label > i { color: var(--muted); width: 1rem; margin-left: -1.6rem; }
.kb-d-body { width: 100%; min-height: 4.5rem; resize: vertical; font: inherit; font-size: .92rem; line-height: 1.5; }
.kb-prog { height: 6px; border-radius: 3px; background: var(--bg); overflow: hidden; margin-bottom: .4rem; }
.kb-prog span { display: block; height: 100%; background: #2f9e62; transition: width .2s; }
.kb-items { list-style: none; margin: 0; padding: 0; }
.kb-items li { display: flex; align-items: center; gap: .4rem; padding: .1rem 0; border-radius: 6px; }
.kb-items li:hover { background: var(--bg); }
.kb-items .kb-grip { color: var(--muted); cursor: grab; padding: 0 .2rem; opacity: .5; touch-action: none; }
.kb-items input[type=checkbox] { width: 1.05rem; height: 1.05rem; min-height: 0; margin: 0; flex: none; }
.kb-item-t { flex: 1; min-width: 0; border: 1px solid transparent; background: transparent; padding: .3rem .35rem; font-size: .9rem; min-height: 0; color: var(--ink); }
.kb-item-t:focus { border-color: var(--accent); background: var(--card); }
.kb-items li.done .kb-item-t { text-decoration: line-through; color: var(--muted); }
.kb-x { opacity: 0; color: var(--muted); padding: .2rem .4rem; }
.kb-items li:hover .kb-x, .kb-x:focus { opacity: 1; }
@media (hover: none) { .kb-x { opacity: .6; } }
.kb-item-add, .kb-note-add { display: flex; gap: .4rem; margin-top: .4rem; align-items: flex-start; }
.kb-item-add input { flex: 1; min-width: 0; }
.kb-note-add { flex-direction: column; align-items: stretch; }
.kb-note-add textarea { width: 100%; resize: vertical; font: inherit; font-size: .9rem; }
.kb-note-add .btn { align-self: flex-start; }
.kb-notes { list-style: none; padding: 0; margin: .7rem 0 0; display: flex; flex-direction: column; gap: .55rem; }
.kb-notes li { background: var(--bg); border-radius: 9px; padding: .5rem .7rem; }
.kb-note-h { display: flex; justify-content: space-between; align-items: center; }
.kb-note-b { font-size: .9rem; line-height: 1.5; overflow-wrap: anywhere; margin-top: .15rem; }
.kb-files { list-style: none; padding: 0; margin: 0 0 .6rem; display: flex; flex-direction: column; gap: .5rem; }
.kb-files li { display: flex; gap: .7rem; align-items: center; }
.kb-file-th { width: 88px; height: 62px; flex: none; border-radius: 7px; background: var(--bg); display: grid; place-items: center; overflow: hidden; color: var(--muted); font-weight: 700; font-size: .78rem; text-decoration: none; }
.kb-file-th img { width: 100%; height: 100%; object-fit: cover; }
.kb-file-i { min-width: 0; display: flex; flex-direction: column; font-size: .9rem; }
.kb-file-i > a { font-weight: 600; overflow-wrap: anywhere; }
.kb-file-i .link { padding: 0; }
.kb-drop { display: block; border: 2px dashed var(--line); border-radius: 10px; padding: .8rem; text-align: center; color: var(--muted); font-size: .88rem; cursor: pointer; margin: 0; }
.kb-drop:hover, .kb-drop.over { border-color: var(--accent); color: var(--accent); background: color-mix(in srgb, var(--accent) 5%, transparent); }
.kb-drop.busy { opacity: .6; pointer-events: none; }
.kb-d-foot { display: flex; justify-content: space-between; align-items: center; gap: .6rem; flex-wrap: wrap; padding: .8rem 1.2rem 1rem; border-top: 1px solid var(--line); }
.kb-d-foot-act { display: flex; gap: .4rem; }
/* archiv */
.kb-arch { list-style: none; padding: 0; margin: 0; }
.kb-arch li { display: flex; align-items: center; gap: .3rem .8rem; flex-wrap: wrap; padding: .6rem 0; border-bottom: 1px solid var(--line); }
.kb-arch li:last-child { border-bottom: 0; }
.kb-arch-t { font-weight: 600; text-align: left; padding: 0; }
.kb-arch-act { margin-left: auto; display: flex; gap: .4rem; }
@media (prefers-color-scheme: dark) {
  .kb-badge.due.late { background: #3a1f1a; color: #f3b3a8; } .kb-badge.due.today, .kb-badge.due.soon { background: #3a2f12; color: #f0cf7a; }
  .kb-card { box-shadow: 0 1px 0 rgba(0,0,0,.4); }
}
@media (max-width: 760px) {
  .kb-top h1 { font-size: 1.3rem; }
  .kb-search input { width: 8rem; }
  .kb-board { margin: 0 -16px; padding: 0 16px 1rem; min-height: calc(100vh - 150px); scroll-snap-type: x mandatory; scroll-padding: 0 16px; }
  .kb-col, .kb-col-new { width: 84vw; }
  .kb-col { max-height: calc(100vh - 150px); }
  .kb-col-head { cursor: default; }
  .kb-dlg { width: 100vw; max-width: 100vw; max-height: 100dvh; height: 100dvh; margin: 0; border-radius: 0; }
  .kb-dlg-in { max-height: 100dvh; }
  .kb-d-head { padding: .8rem .8rem .3rem; }
  .kb-d-main { padding: .2rem .9rem 1rem; }
  .kb-d-label > i { margin-left: 0; }
  .kb-d-props { grid-template-columns: 1fr 1fr; }
  .kb-d-props label:last-child { grid-column: 1 / -1; }
  .kb-d-foot { padding: .7rem .9rem calc(1rem + env(safe-area-inset-bottom)); }
}
.kb-page [hidden] { display: none !important; }
.kb-search { flex-direction: row; font-size: .9rem; }
.kb-search input { font-size: .9rem; }
.kb-list { min-height: 1.6rem; }

/* Kontrola webů – Vyhledávání (Search Console) */
.gsc-steps { margin: .4rem 0 1rem; padding-left: 1.3rem; font-size: .9rem; max-width: 820px; }
.gsc-steps li { margin: .45rem 0; }
.gsc-steps .ics-url { margin: .5rem 0 .2rem; }
.gsc-keys { margin-top: .6rem; }
.gsc-keys > summary { cursor: pointer; color: var(--muted); margin-bottom: .6rem; }
.gsc-keys form { max-width: 560px; }
.gsc-conn { margin: 0 0 .4rem; }
.gsc-links { display: flex; gap: .4rem 1.2rem; flex-wrap: wrap; }
.gsc-links .link { padding: 0; }
.gsc-spark { width: 90px; flex: none; }
.gsc-chart { width: 100%; display: block; }
.gsc-chart.mini { height: 26px; }
.gsc-chart polyline { fill: none; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.gsc-chart .clicks { stroke: var(--accent); stroke-width: 2; }
.gsc-chart.mini .clicks { stroke-width: 1.5; }
.gsc-chart .impr { stroke: #a78bfa; stroke-width: 1.5; opacity: .75; }
.gsc-chart .grid { stroke: var(--line); stroke-width: 1; vector-effect: non-scaling-stroke; }
.gsc-chart text { font-size: 10px; fill: var(--muted); }
.gsc-chart rect { fill: transparent; }
.gsc-chart rect:hover { fill: color-mix(in srgb, var(--accent) 10%, transparent); }
.gsc-chart-w { margin: .6rem 0 1rem; }
.gsc-chart-w .gsc-chart { height: 170px; }
.gsc-leg { display: flex; align-items: center; gap: .4rem; color: var(--muted); margin-top: .3rem; }
.gsc-leg span.c, .gsc-leg span.i { width: 14px; height: 3px; border-radius: 2px; background: var(--accent); display: inline-block; }
.gsc-leg span.i { background: #a78bfa; margin-left: .7rem; }
.gsc-sum { display: inline-flex; align-items: center; gap: .3rem; margin-right: .7rem; white-space: nowrap; }
.gsc-sum i { color: var(--muted); font-size: .8em; }
.gsc-d { font-size: .74rem; font-weight: 700; padding: 0 .3rem; border-radius: 5px; color: var(--muted); white-space: nowrap; }
.gsc-d.up { color: #157347; background: #e3f5ea; } .gsc-d.down { color: #b42318; background: #fde7e6; } .gsc-d.new { color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); font-weight: 600; }
.gsc-prop { margin: .8rem 0 .4rem; max-width: 420px; }
.gsc-prop label { font-size: .78rem; }
.gsc-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .6rem; margin-top: .6rem; }
.gsc-kpis > div { background: var(--bg); border-radius: 10px; padding: .6rem .8rem; display: flex; flex-direction: column; gap: .15rem; align-items: flex-start; }
.gsc-kpis strong { font-size: 1.3rem; font-variant-numeric: tabular-nums; }
.gsc-range { margin: .4rem 0 0; }
.gsc-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 1.5rem; margin-top: 1rem; }
.gsc-t { font-size: .85rem; margin: 0; }
.gsc-t td, .gsc-t th { padding: .35rem .45rem; }
.gsc-t td.r { white-space: nowrap; }
.gsc-k { overflow-wrap: break-word; word-break: normal; hyphens: auto; }
.gsc-k a { overflow-wrap: anywhere; }
.gsc-sub { margin-top: 1rem; }
.gsc-bars { display: flex; flex-direction: column; gap: .35rem; font-size: .85rem; }
.gsc-bars > div { display: grid; grid-template-columns: 7.5rem 1fr 3.2rem; gap: .5rem; align-items: center; }
.gsc-bar { height: 8px; background: var(--bg); border-radius: 4px; overflow: hidden; }
.gsc-bar span { display: block; height: 100%; background: var(--accent); border-radius: 4px; }
.gsc-facts { list-style: none; padding: 0; margin: .3rem 0 .5rem; display: flex; flex-direction: column; gap: .3rem; }
@media (prefers-color-scheme: dark) { .gsc-d.up { background: #16301f; color: #9fe0b5; } .gsc-d.down { background: #3a1f1a; color: #f3b3a8; } }
@media (max-width: 760px) {
  .gsc-kpis { grid-template-columns: 1fr 1fr; }
  .gsc-grid { grid-template-columns: 1fr; }
  .gsc-spark { width: 64px; }
  .gsc-chart-w .gsc-chart { height: 130px; }
  .mon-tabs { grid-template-columns: repeat(5, 1fr); }
  .gsc-t td, .gsc-t th { padding: .3rem; }
  .table.gsc-t { display: table; width: 100%; } .table.gsc-t tbody { display: table-row-group; }
  .table.gsc-t tr { display: table-row; padding: 0; } .table.gsc-t td, .table.gsc-t th { display: table-cell; width: auto; padding: .35rem .3rem; border-bottom: 1px solid var(--line); }
  .table.gsc-t thead { display: table-header-group; }
  .table.gsc-t td.r, .table.gsc-t th.r { white-space: nowrap; }
  .gsc-chart text { display: none; }
  .table.gsc-t td::before { content: none; }
}
.mon-site-q { white-space: nowrap; display: inline-flex; align-items: center; gap: .3rem; }

/* Detail projektu – Web (Kontrola webů) */
.pw-strip { display: flex; flex-wrap: wrap; gap: .4rem; margin: .7rem 0 .2rem; }
.pw-chip { display: inline-flex; align-items: center; gap: .35rem; padding: .2rem .6rem; border-radius: 999px; font-size: .8rem; font-weight: 600; text-decoration: none; background: var(--bg); color: var(--ink); border: 1px solid var(--line); }
.pw-chip:hover { text-decoration: none; border-color: var(--accent); }
.pw-chip span { font-weight: 400; color: var(--muted); }
.pw-chip.good { background: #e3f5ea; color: #157347; border-color: transparent; }
.pw-chip.mid, .pw-chip.warn { background: #fff4cc; color: #8a6d00; border-color: transparent; }
.pw-chip.bad { background: #fde7e6; color: #b42318; border-color: transparent; }
.pw-chip.off { color: var(--muted); }
.pw-card { scroll-margin-top: 80px; }
.pw-card.pw-alert { border: 1px solid #e5484d; box-shadow: 0 0 0 3px color-mix(in srgb, #e5484d 12%, transparent); }
.pw-links { display: flex; flex-wrap: wrap; gap: .3rem 1rem; align-items: center; }
.pw-row { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .7rem; }
.pw-up { display: grid; grid-template-columns: repeat(3, auto) 1fr; gap: .6rem 1.4rem; align-items: end; margin-top: 1rem; }
.pw-up > div { display: flex; flex-direction: column; gap: .15rem; }
.pw-up strong { font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.pw-bars .mon-bars { margin-top: .2rem; }
.pw-sub { margin-top: 1rem; }
.pw-events { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .25rem; }
.pw-events li::before { content: ''; display: inline-block; width: .5rem; height: .5rem; border-radius: 50%; margin-right: .45rem; background: #1d9a55; }
.pw-events li.down::before { background: #e5484d; }
.pw-lazy { margin-top: 1rem; display: flex; flex-direction: column; gap: .4rem; }
.pw-lazy details { border: 1px solid var(--line); border-radius: 10px; padding: .5rem .8rem; }
.pw-lazy summary { cursor: pointer; font-weight: 600; font-size: .9rem; }
.pw-load { margin-top: .6rem; overflow-x: auto; }
.pw-two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.pw-two > .card { margin: 0; }
.pw-rings { max-width: 340px; margin-bottom: .6rem; }
.pw-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .35rem; }
.pw-list li { display: flex; gap: .5rem; align-items: baseline; }
@media (prefers-color-scheme: dark) { .pw-chip.good { background: #16301f; color: #9fe0b5; } .pw-chip.mid, .pw-chip.warn { background: #3a2f12; color: #f0cf7a; } .pw-chip.bad { background: #3a1f1a; color: #f3b3a8; } }
@media (max-width: 900px) { .pw-two { grid-template-columns: 1fr; } }
@media (max-width: 760px) { .pw-up { grid-template-columns: repeat(3, 1fr); } .pw-bars { grid-column: 1 / -1; } }
.pw-row .mon-ring { margin: 0; }
.pw-two { align-items: start; }

/* Rychlé hledání v levém menu */
.qs { position: relative; margin: 0 2px; flex: none; }
.qs-box { display: flex; align-items: center; gap: .55rem; margin: 0; padding: 0 .7rem; height: 40px; border-radius: 9px; background: rgba(255,255,255,.14); color: rgba(255,255,255,.8); cursor: text; flex-direction: row; font-size: .95rem; transition: background .15s; }
.qs-box:hover { background: rgba(255,255,255,.2); }
.qs-box:focus-within { background: #fff; color: #5b6577; box-shadow: 0 4px 14px rgba(0,0,0,.15); }
.qs-box .ico { width: 1.2rem; text-align: center; flex: none; }
.qs-input { flex: 1; min-width: 0; border: 0 !important; background: transparent !important; padding: 0 !important; min-height: 0 !important; height: 100%; color: #fff; font: inherit; font-size: .92rem; outline: none !important; box-shadow: none !important; }
.qs-input::placeholder { color: rgba(255,255,255,.72); }
.qs-box:focus-within .qs-input { color: #1c2434; }
.qs-box:focus-within .qs-input::placeholder { color: #8a93a5; }
.qs-input::-webkit-search-cancel-button { filter: grayscale(1); }
.qs-kbd { font: 600 .7rem/1 ui-monospace, Menlo, monospace; padding: .2rem .4rem; border-radius: 5px; border: 1px solid rgba(255,255,255,.35); color: rgba(255,255,255,.75); }
.qs-box:focus-within .qs-kbd { display: none; }
.qs-res { position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 60; background: var(--card); color: var(--ink); border-radius: 10px; box-shadow: 0 12px 34px rgba(10,20,40,.28); padding: .35rem; max-height: min(70vh, 520px); overflow-y: auto; }
.qs-h { font-size: .7rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); padding: .45rem .55rem .25rem; }
.qs-it { display: flex; align-items: center; gap: .6rem; padding: .45rem .55rem; border-radius: 7px; color: var(--ink); text-decoration: none; }
.qs-it:hover, .qs-it.sel { background: color-mix(in srgb, var(--accent) 10%, transparent); text-decoration: none; }
.qs-it > i { color: var(--muted); width: 1rem; text-align: center; flex: none; }
.qs-it > span { min-width: 0; display: flex; flex-direction: column; }
.qs-n { font-size: .9rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qs-s { font-size: .76rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qs-it.off .qs-n { color: var(--muted); font-weight: 500; }
.qs-it mark { background: color-mix(in srgb, #f0b429 40%, transparent); color: inherit; border-radius: 2px; padding: 0; }
.qs-empty { padding: .7rem; color: var(--muted); font-size: .88rem; text-align: center; }
@media (min-width: 900px) {
  html.side-mini .qs { margin: 0; }
  html.side-mini .qs-box { justify-content: center; padding: 0; }
  html.side-mini .qs-kbd { display: none; }
  html.side-mini .qs-input { position: fixed; left: 74px; top: 14px; width: 300px; height: 40px; padding: 0 .8rem !important; border-radius: 9px; background: #fff !important; color: #1c2434; box-shadow: 0 6px 20px rgba(0,0,0,.2) !important; opacity: 0; pointer-events: none; z-index: 61; }
  html.side-mini .qs-box:focus-within .qs-input, html.side-mini .qs-input:focus { opacity: 1; pointer-events: auto; }
  html.side-mini .qs-input::placeholder { color: #8a93a5; }
  html.side-mini .qs-res { position: fixed; left: 74px; top: 60px; width: 300px; right: auto; }
  html.side-mini .qs-box:focus-within { background: rgba(255,255,255,.2); box-shadow: none; color: #fff; }
}

/* Detail projektu – Přehled */
.po-kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.po-kpis > a { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: .75rem .9rem; display: flex; flex-direction: column; gap: .15rem; color: var(--ink); text-decoration: none; min-width: 0; }
.po-kpis > a:hover { border-color: var(--accent); text-decoration: none; }
.po-kpis > a.bad { border-color: #f3b3a8; background: color-mix(in srgb, #e5484d 5%, var(--card)); }
.po-kpis strong { font-size: 1.2rem; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.po-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; align-items: start; }
.po-grid > .card { margin: 0; }
.po-card .card-head h2 { font-size: 1.02rem; display: flex; align-items: center; gap: .5rem; }
.po-card .card-head h2 i { color: var(--muted); font-size: .9em; }
.po-sub { margin-top: 1.2rem; }
.po-list { list-style: none; padding: 0; margin: 0 0 .5rem; }
.po-list li { display: flex; justify-content: space-between; align-items: baseline; gap: .8rem; padding: .42rem 0; border-bottom: 1px solid var(--line); font-size: .92rem; }
.po-list li:last-child { border-bottom: 0; }
.po-list li > a, .po-list li > span:first-child { min-width: 0; overflow-wrap: anywhere; }
.po-list li > a { color: var(--ink); }
.po-list li > a:hover { color: var(--accent); }
.po-prog { display: inline-flex; align-items: center; gap: .4rem; flex: none; }
.po-prog .cl-bar { width: 70px; }
.po-facts { margin: .2rem 0 0; display: flex; flex-direction: column; gap: .45rem; }
.po-facts > div { display: grid; grid-template-columns: 6.5rem 1fr; gap: .5rem; align-items: center; font-size: .9rem; }
.po-facts dt { color: var(--muted); font-size: .82rem; }
.po-facts dd { margin: 0; display: flex; flex-wrap: wrap; gap: .3rem; align-items: center; }
.po-spark { margin-top: .7rem; }
.po-spark .gsc-chart.mini { height: 34px; }
.po-last { margin-top: 1rem; }
@media (max-width: 1100px) { .po-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 760px) { .po-kpis { grid-template-columns: 1fr 1fr; gap: 8px; } .po-grid { grid-template-columns: 1fr; } }

/* Checklist webů */
.wc-top { display: flex; align-items: center; justify-content: space-between; gap: .8rem; flex-wrap: wrap; margin-bottom: 1rem; }
.wc-top h1 { margin: 0; }
.wc-top-act { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.wc-filter select { min-width: 12rem; }
.wc-sum { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; margin-bottom: 16px; }
.wc-sum-i { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: .7rem .9rem; display: flex; flex-direction: column; gap: .2rem; color: var(--ink); text-decoration: none; }
.wc-sum-i:hover { border-color: var(--accent); text-decoration: none; }
.wc-sum-i strong { font-size: 1.25rem; font-variant-numeric: tabular-nums; }
.wc-sum-i.ok { border-color: #9fdcb8; }
.wc-sum-i.late { border-color: #f3b3a8; }
.wc-prog { height: 6px; border-radius: 3px; background: var(--bg); overflow: hidden; margin: .15rem 0; }
.wc-prog span { display: block; height: 100%; background: #2f9e62; }
.wc-form-row { display: grid; grid-template-columns: 1fr 14rem; gap: .8rem; }
.wc-proj-h { font-weight: 600; font-size: .9rem; margin-bottom: .35rem; }
.wc-proj-q { width: 100%; max-width: 24rem; margin-bottom: .4rem; }
.wc-proj-list { max-height: 15rem; overflow-y: auto; border: 1px solid var(--line); border-radius: 9px; padding: .3rem; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 0 .4rem; }
.wc-proj-list label.check { flex-direction: row; align-items: center; gap: .45rem; margin: 0; padding: .3rem .4rem; border-radius: 6px; font-size: .88rem; cursor: pointer; }
.wc-proj-list label.check:hover { background: var(--bg); }
.wc-proj-list label.check.on { background: color-mix(in srgb, var(--accent) 9%, transparent); }
.wc-proj-list input[type=checkbox] { min-height: 0; width: 1rem; height: 1rem; margin: 0; flex: none; }
.wc-sec .card-head h2 { display: flex; align-items: baseline; gap: .6rem; flex-wrap: wrap; }
.wc-sec-k { font-size: .9rem; font-weight: 500; }
.wc-items { display: flex; flex-direction: column; gap: .8rem; }
.wc-item { border: 1px solid var(--line); border-radius: 12px; padding: .7rem .9rem; background: var(--card); scroll-margin-top: 80px; }
.wc-item.paused { opacity: .6; }
.wc-item:target { box-shadow: 0 0 0 2px var(--accent); }
.wc-item-h { display: flex; align-items: flex-start; gap: .5rem; }
.wc-grip { color: var(--muted); cursor: grab; padding: .15rem .2rem; opacity: .5; touch-action: none; }
.wc-item-t { flex: 1; min-width: 0; }
.wc-item-n { margin-top: .15rem; }
.wc-item-act { display: flex; gap: .1rem; align-items: center; }
.wc-rows { margin-top: .5rem; }
.wc-row { display: grid; grid-template-columns: minmax(8rem, 13rem) auto 1fr; gap: .4rem 1rem; align-items: center; padding: .45rem 0 .45rem 1.5rem; border-top: 1px solid var(--line); }
.wc-row-name { font-size: .9rem; overflow-wrap: anywhere; }
.wc-row-name a { color: var(--ink); font-weight: 600; }
.wc-hist { display: flex; gap: 3px; }
.wc-sq { width: 12px; height: 12px; border-radius: 3px; background: var(--bg); border: 1px solid var(--line); }
.wc-sq.done { background: #2f9e62; border-color: #2f9e62; }
.wc-sq.skip { background: #b8c2d3; border-color: #b8c2d3; }
.wc-sq.missed { background: #e5484d; border-color: #e5484d; }
.wc-sq.now { background: var(--card); border: 2px solid var(--accent); }
.wc-row.done .wc-sq.now { background: #2f9e62; border-color: #2f9e62; }
.wc-row.skip .wc-sq.now { background: #b8c2d3; border-color: #b8c2d3; }
.wc-row-st { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .7rem; min-width: 0; }
.wc-quick { display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; flex: 1; }
.wc-note-in { flex: 1 1 12rem; min-width: 0; font-size: .88rem; }
.wc-quick .link { padding: 0 .2rem; }
.wc-done-l { font-size: .9rem; font-weight: 600; }
.wc-note { flex-basis: 100%; color: var(--ink); background: var(--bg); border-radius: 8px; padding: .35rem .6rem; }
.wc-note-ed > summary { list-style: none; cursor: pointer; color: var(--accent); display: inline; }
.wc-note-ed > summary::-webkit-details-marker { display: none; }
.wc-note-ed[open] { flex-basis: 100%; }
.wc-mark textarea { width: 100%; margin-top: .3rem; font-size: .88rem; }
.wc-mark-act { display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; margin-top: .35rem; }
.wc-mark-act label { flex-direction: row; align-items: center; gap: .3rem; margin: 0; }
.wc-mark-act input[type=date] { width: auto; }
.wc-past { margin-top: .5rem; padding-left: 1.5rem; }
.wc-past > summary { cursor: pointer; color: var(--muted); }
.wc-past-t { font-size: .85rem; margin-top: .4rem; }
.wc-past-t td { padding: .35rem .5rem; vertical-align: top; }
.wc-past-n { min-width: 12rem; }
@media (max-width: 760px) {
  .wc-form-row { grid-template-columns: 1fr; }
  .wc-row { grid-template-columns: 1fr auto; padding-left: 0; }
  .wc-row-st { grid-column: 1 / -1; }
  .wc-past { padding-left: 0; }
  .table.wc-past-t tr { display: block; padding: .4rem 0; border-bottom: 1px solid var(--line); }
  .table.wc-past-t td { display: inline; padding: 0 .3rem 0 0; border: 0; }
  .table.wc-past-t td::before { content: none; }
  .table.wc-past-t td.wc-past-n { display: block; }
}
@media (prefers-color-scheme: dark) { .wc-sq.skip, .wc-row.skip .wc-sq.now { background: #4b5568; border-color: #4b5568; } }
@media (max-width: 760px) { .wc-sum { grid-template-columns: 1fr 1fr; gap: 8px; } .wc-sum-i { padding: .55rem .7rem; } .wc-sum-i strong { font-size: 1.1rem; } }
.wc-quick textarea.wc-note-in { flex: 1 1 100%; resize: vertical; min-height: 2.6rem; }
.wc-log-f { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; padding: .8rem; }
.wc-log-f input[type=search] { flex: 1 1 14rem; }
.wc-log-f select { flex: 0 1 14rem; }
.wc-log h2 { font-size: 1.05rem; }
.wc-log-l { list-style: none; padding: 0; margin: 0; }
.wc-log-l li { display: grid; grid-template-columns: 3.5rem 1fr; gap: .8rem; padding: .7rem 0; border-top: 1px solid var(--line); }
.wc-log-l li:first-child { border-top: 0; }
.wc-log-d { font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; padding-top: .05rem; }
.wc-log-l li.done .wc-log-d { color: #1d8a4e; }
.wc-log-b { min-width: 0; font-size: .92rem; }
.wc-log-n { margin-top: .3rem; background: var(--bg); border-radius: 8px; padding: .45rem .7rem; line-height: 1.5; overflow-wrap: anywhere; }

/* Search Console – měsíční historie */
.gsc-hist { margin-top: 1.4rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.gsc-hist-scroll { overflow-x: auto; margin-bottom: .6rem; }
.gsc-mt { min-width: 420px; }
.gsc-qm { border-collapse: separate; border-spacing: 2px; font-size: .8rem; font-variant-numeric: tabular-nums; }
.gsc-qm th { font-weight: 600; color: var(--muted); font-size: .72rem; padding: .2rem .3rem; white-space: nowrap; text-align: center; }
.gsc-qm th:first-child { text-align: left; }
.gsc-qm td { min-width: 2.5rem; text-align: center; padding: .28rem .3rem; border-radius: 4px; position: relative; }
.gsc-qm td.gsc-qm-k { text-align: left; min-width: 11rem; max-width: 18rem; padding-right: .6rem; overflow-wrap: anywhere; font-size: .82rem; position: sticky; left: 0; background: var(--card); z-index: 1; }
.gsc-qm td.na { color: var(--line); }
.gsc-qm td.p1, .gsc-qm-leg .p1 { background: #1d9a55; color: #fff; font-weight: 700; }
.gsc-qm td.p2, .gsc-qm-leg .p2 { background: #8fd3a9; color: #0f4d2c; font-weight: 600; }
.gsc-qm td.p3, .gsc-qm-leg .p3 { background: #fde9a8; color: #6b5300; }
.gsc-qm td.p4, .gsc-qm-leg .p4 { background: #f6d2cd; color: #8a1c14; }
.gsc-qm td.up::after, .gsc-qm td.down::after { position: absolute; right: 1px; top: -1px; font-size: .55rem; }
.gsc-qm td.up::after { content: '▲'; color: #0f4d2c; }
.gsc-qm td.p1.up::after { color: #fff; }
.gsc-qm td.down::after { content: '▼'; color: #8a1c14; }
.gsc-qm-leg { display: flex; align-items: center; gap: .35rem; flex-wrap: wrap; margin-bottom: .6rem; }
.gsc-qm-leg span { width: .9rem; height: .9rem; border-radius: 3px; display: inline-block; margin-left: .5rem; }
.gsc-qm-leg span:first-child { margin-left: 0; }
@media (prefers-color-scheme: dark) { .gsc-qm td.p2 { background: #2b6a46; color: #d5f5e1; } .gsc-qm td.p3 { background: #5a4a14; color: #f5e3a3; } .gsc-qm td.p4 { background: #5a2620; color: #f6c9c2; } }
@media (max-width: 760px) { .gsc-mt { min-width: 0; } .gsc-mt th:nth-child(3), .gsc-mt td:nth-child(3) { display: none; } }
.gsc-qm th:first-child { position: sticky; left: 0; background: var(--card); z-index: 1; }
.gsc-qm td.gsc-qm-k, .gsc-qm th:first-child { box-shadow: 3px 0 0 var(--card); }
.mon-x-act .mon-del { order: 9; margin-left: auto; } .mon-x-act .mon-del .link { padding: 0; }

/* Kontrola webů – sledované weby */
.mon-star { border: 0; background: none; padding: .1rem .25rem .1rem 0; margin: 0; cursor: pointer; color: #b8c2d3; font-size: .95rem; vertical-align: baseline; }
.mon-star:hover { color: #f0b429; }
.mon-star.on { color: #f0b429; }
.mon-star-ic { color: #f0b429; font-size: .9em; }
.mon-box-star { border-top: 3px solid #f0b429; }
.mon-star-hint { margin: 0; }
.mon-group { font-size: .74rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); margin: .6rem 0 -.1rem; display: flex; align-items: center; gap: .4rem; }
.mon-group:first-child { margin-top: 0; }
.mon-group i { color: #f0b429; }

/* Finance – nastavení záložek */
.fin-tabs-cfg { position: relative; align-self: center; }
.fin-tabs-cfg > summary { list-style: none; cursor: pointer; padding: .3rem .6rem; border-radius: 999px; color: var(--muted); border: 1px dashed var(--line); font-size: .85rem; }
.fin-tabs-cfg > summary::-webkit-details-marker { display: none; }
.fin-tabs-cfg > summary:hover { color: var(--ink); border-color: var(--muted); }
.fin-tabs-pop { position: absolute; z-index: 40; top: calc(100% + 6px); left: 0; width: 220px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 30px rgba(15,25,45,.16); padding: .7rem .8rem; display: flex; flex-direction: column; gap: .35rem; }
.fin-tabs-pop label.check { flex-direction: row; align-items: center; gap: .45rem; margin: 0; font-size: .9rem; }
.fin-tabs-pop label.check i { width: 1rem; text-align: center; color: var(--muted); }
.fin-tabs-pop input[type=checkbox] { min-height: 0; width: 1rem; height: 1rem; margin: 0; }
.fin-tabs-pop .btn { align-self: flex-start; margin-top: .3rem; }
@media (max-width: 760px) { .fin-tabs-pop { left: auto; right: 0; } }

/* Finance – Přehled: barevné sekce jako v Excelu, kompaktní řádky */
.fin-pivot { --pv-in: #2f9e62; --pv-in-l: #e7f6ed; --pv-out: #d64545; --pv-out-l: #fdeceb; --pv-sum: #e3e6eb; --pv-bal: #eaf2fd; --pv-bal-t: #d6e6fb; --pv-cur: #d92d20; }
.fin-pivot th, .fin-pivot td { padding: .2rem .45rem; }
.fin-pivot tr.sec th, .fin-pivot tr.sec td { padding-top: .3rem; padding-bottom: .3rem; }
.fin-pivot tr.diff th, .fin-pivot tr.diff td { padding-top: .35rem; }
.fin-pivot tr.bal-sec th, .fin-pivot tr.bal-sec td { padding-top: .3rem; }
.fin-pivot td.cur { background: transparent; }
.fin-pivot thead th.cur, .fin-pivot thead th.cur a { color: var(--pv-cur); }
.fin-pivot td.cur, .fin-pivot td.cur a, .fin-pivot tr.d1 td.cur, .fin-pivot tr.d2 td.cur { color: var(--pv-cur) !important; }
.fin-pivot tbody.fin-pv-in tr.sec > * { background: var(--pv-in); color: #fff; }
.fin-pivot tbody.fin-pv-in tr:not(.sec):not(.sum) > * { background: var(--pv-in-l); }
.fin-pivot tbody.fin-pv-out tr.sec > * { background: var(--pv-out); color: #fff; }
.fin-pivot tbody.fin-pv-out tr:not(.sec):not(.sum) > * { background: var(--pv-out-l); }
.fin-pivot tbody tr.sum > * { background: var(--pv-sum); }
.fin-pivot tbody tr.sec .fin-pv-cat, .fin-pivot tbody tr.sec .fin-pv-cat a { color: #fff; }
.fin-pivot tr.bal-sec > *, .fin-pivot tr.bal-acc > * { background: var(--pv-bal); }
.fin-pivot tr.bal-tot > * { background: var(--pv-bal-t); }
.fin-pivot tr.bal-sec th { color: #1e4f9c; }
.fin-pivot tbody tr > .tot, .fin-pivot tfoot tr > .tot { box-shadow: inset 1px 0 0 rgba(0,0,0,.06); }
@media (prefers-color-scheme: dark) {
  .fin-pivot { --pv-in: #237a4b; --pv-in-l: #18301f; --pv-out: #a83636; --pv-out-l: #3a1f1d; --pv-sum: #2a313d; --pv-bal: #1b2a40; --pv-bal-t: #22385a; --pv-cur: #ff7b72; }
  .fin-pivot tr.bal-sec th { color: #9cc3ff; }
}

/* Finance – Příjmy (ruční mřížka příjmů a paušálů) */
.fin-inc-bar { display: flex; align-items: center; gap: .6rem 1rem; flex-wrap: wrap; margin-bottom: .6rem; }
.fin-inc-bar .filters { margin: 0; }
.fin-inc-bar p { margin: 0; flex: 1 1 320px; }
.inc-red { color: #d92d20; font-weight: 600; }
.fin-inc-t { --inc-h: #2f9e62; --inc-l: #eef8f2; --inc-l2: #e1f3e8; --inc-sum: #cfeedd; border-collapse: separate; border-spacing: 0; width: 100%; min-width: 960px; font-size: .86rem; font-variant-numeric: tabular-nums; margin-bottom: 1.2rem; }
.fin-inc-flat { --inc-h: #4f9c74; --inc-l: #f2f9f4; --inc-l2: #e6f3ea; --inc-sum: #d7eee0; }
.fin-inc-t th, .fin-inc-t td { padding: 0; border-bottom: 1px solid rgba(47,158,98,.18); text-align: right; white-space: nowrap; height: 1.75rem; }
.fin-inc-t thead th { background: var(--inc-h); color: #fff; font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; font-weight: 600; padding: .3rem .45rem; }
.fin-inc-t thead th.inc-name { font-size: .88rem; text-transform: none; letter-spacing: 0; font-weight: 700; text-align: left; }
.fin-inc-t thead th.cur { background: color-mix(in srgb, var(--inc-h) 80%, #000); }
.fin-inc-t tbody tr:nth-child(odd) > * { background: var(--inc-l); }
.fin-inc-t tbody tr:nth-child(even) > * { background: var(--inc-l2); }
.fin-inc-t .inc-name { text-align: left; position: sticky; left: 0; z-index: 1; min-width: 9.5rem; width: 10rem; }
.fin-inc-t thead .inc-name { z-index: 2; }
.fin-inc-t tfoot .inc-name, .fin-inc-t tbody .inc-name { background: inherit; }
.inc-name-in { width: 100%; height: 1.75rem; min-height: 0; border: 0; border-radius: 0; background: transparent; padding: 0 .45rem; font: inherit; font-weight: 600; color: var(--ink); }
.inc-name-in:focus, .inc-in:focus { outline: 2px solid var(--inc-h); outline-offset: -2px; background: var(--card); }
.inc-c { position: relative; min-width: 4.3rem; }
.inc-in { width: 100%; height: 1.75rem; min-height: 0; border: 0; border-radius: 0; background: transparent; text-align: right; padding: 0 1.3rem 0 .3rem; font: inherit; color: var(--ink); }
.fin-inc-income .inc-c.open .inc-in { color: #d92d20; font-weight: 600; }
.fin-inc-income .inc-c.inv .inc-in { color: var(--ink); font-weight: 400; }
.inc-inv { position: absolute; top: 50%; right: 2px; transform: translateY(-50%); width: .95rem; height: .95rem; min-height: 0; padding: 0; border-radius: 50%; border: 1.5px solid #c3cbd6; background: var(--card); color: transparent; font-size: .5rem; display: none; align-items: center; justify-content: center; cursor: pointer; }
.inc-c.open .inc-inv, .inc-c.inv .inc-inv { display: inline-flex; }
.inc-c.inv .inc-inv { background: #2f9e62; border-color: #2f9e62; color: #fff; }
.inc-inv:hover { border-color: #2f9e62; }
.fin-inc-t .tot { font-weight: 700; padding: 0 .45rem; background: rgba(47,158,98,.14) !important; }
.fin-inc-t .inc-act { width: 1.8rem; text-align: center; }
.inc-del { opacity: 0; padding: 0 .3rem; min-height: 0; height: 1.5rem; }
.fin-inc-t tr:hover .inc-del, .inc-del:focus { opacity: 1; }
@media (hover: none) { .inc-del { opacity: .55; } }
.fin-inc-t tr.inc-new > * { background: transparent !important; border-bottom: 0; }
.fin-inc-t tr.inc-new .link { padding: .3rem .45rem; min-height: 0; }
.fin-inc-t tfoot tr.sum > * { background: var(--inc-sum); font-weight: 700; padding: 0 .45rem; border-top: 2px solid var(--inc-h); }
.fin-inc-t tfoot tr.open-row > * { background: transparent; color: #d92d20; font-size: .8rem; padding: 0 .45rem; border-bottom: 0; }
.fin-inc-t tfoot tr.open-row .inc-name { font-weight: 600; background: var(--card); }
.fin-inc-t tfoot .tot { background: var(--inc-sum) !important; }
.fin-inc-t td.saving .inc-in { opacity: .5; }
.fin-inc-t td.err { box-shadow: inset 0 0 0 2px #e5484d; }
.fin-inc-all { margin: .2rem 0 0; text-align: right; }
@media (prefers-color-scheme: dark) {
  .fin-inc-t { --inc-h: #237a4b; --inc-l: #15261b; --inc-l2: #1a2e21; --inc-sum: #21402c; }
  .fin-inc-flat { --inc-h: #2f6e4c; --inc-l: #172a1e; --inc-l2: #1c3224; --inc-sum: #234531; }
  .fin-inc-income .inc-c.open .inc-in, .inc-red, .fin-inc-t tfoot tr.open-row > * { color: #ff8a80; }
}
.fin-pivot .fin-hcell, .fin-pivot .fin-bcell { height: 1.55rem; background: rgba(255,255,255,.55); }
@media (prefers-color-scheme: dark) { .fin-pivot .fin-hcell, .fin-pivot .fin-bcell { background: rgba(0,0,0,.2); } }
.fin-pivot td.cur .fin-hcell, .fin-pivot td.cur .fin-bcell { color: var(--pv-cur); }
.fin-inc-t .inc-in, .fin-inc-t .inc-name-in { height: 1.75rem !important; }
.fin-pivot .fin-hcell, .fin-pivot .fin-bcell { height: 1.55rem !important; }
.fin-inc-t tbody tr.inc-auto > * { background: #d3eedd; font-weight: 600; color: var(--ink); cursor: default; }
.fin-inc-t tr.inc-auto td.inc-c { padding: 0 1.3rem 0 .3rem; }
.fin-inc-t tr.inc-auto th.inc-name { padding: 0 .45rem; }
.inc-auto-n { display: inline-flex; align-items: center; gap: .4rem; }
.inc-auto-n i { font-size: .7rem; color: #2f9e62; }
@media (prefers-color-scheme: dark) { .fin-inc-t tbody tr.inc-auto > * { background: #1f3a29; } }
.fin-inc-t .inc-in { padding: 0 1.1rem 0 .1rem; font-size: .84rem; letter-spacing: -.01em; }
.fin-inc-t .inc-inv { right: 1px; width: .9rem; height: .9rem; }
.fin-inc-t thead th.tot { background: color-mix(in srgb, var(--inc-h) 80%, #000) !important; color: #fff; }
.fin-inc-t tfoot tr.open-row .tot { background: transparent !important; }
.fin-inc-t tr.inc-auto td.inc-c { padding: 0 1.1rem 0 .1rem; }
.fin-inc-flat .inc-c.open .inc-in { color: #d92d20; font-weight: 600; }
.fin-inc-flat .inc-c.inv .inc-in { color: var(--ink); font-weight: 400; }
@media (prefers-color-scheme: dark) { .fin-inc-flat .inc-c.open .inc-in { color: #ff8a80; } }
.fin-inc-cat { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .6rem; margin: 0 0 .8rem; font-size: .88rem; }
.fin-inc-cat label { font-weight: 600; margin: 0; display: inline-flex; flex-direction: row; align-items: center; gap: .4rem; }
.fin-inc-cat select { width: auto; max-width: 100%; min-height: 0; padding: .25rem 1.8rem .25rem .5rem; }
.fin-inc-cat .muted { flex-basis: 100%; }
.fin-pivot tbody.fin-pv-in tr.pv-inc > * { background: #d3eedd; font-weight: 600; }
.fin-pivot tr.pv-inc .fin-pv-cat a { color: var(--ink); }
.fin-pivot tr.pv-inc .fin-pv-cat i, .fin-pivot .pv-osvc { font-size: .7rem; color: #2f9e62; margin-right: .2rem; }
@media (prefers-color-scheme: dark) { .fin-pivot tbody.fin-pv-in tr.pv-inc > * { background: #1f3a29; } }
/* Rozdíl i v aktuálním měsíci podle znaménka */
.fin-pivot tr.diff td.cur.pos { color: #1d8a4e !important; }
.fin-pivot tr.diff td.cur.neg { color: var(--stop) !important; }
@media (prefers-color-scheme: dark) { .fin-pivot tr.diff td.cur.pos { color: #5fd08f !important; } }
/* Kontrola webů – zobrazen jen jeden web (odkaz z detailu projektu) */
.mon-one { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem 1.2rem; padding: .6rem .9rem; margin: 0 0 1rem; border-radius: 10px; background: color-mix(in srgb, var(--accent) 9%, var(--card)); border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent); font-size: .92rem; }
.mon-one > span { flex: 1 1 auto; }
.mon-one i.fa-filter { color: var(--accent); margin-right: .2rem; }
.mon-offlist { margin: .8rem 0 0; }
.mon-offlist > summary { cursor: pointer; padding: .3rem 0; }

/* Zamrzlé záhlaví tabulek (posouvá se přes JS) */
table thead th, table thead td { will-change: auto; }
.th-stuck thead th, .th-stuck thead td { position: relative; z-index: 5; }
.th-stuck thead th[style*="sticky"], .th-stuck thead .fin-pv-cat, .th-stuck thead .inc-name, .th-stuck thead .g-cat { position: sticky; z-index: 6; }
.th-opq { background: var(--card); }
.th-stuck thead tr:first-child > * { box-shadow: 0 1px 0 var(--line), 0 4px 6px -4px rgba(15, 25, 45, .18); }
@media print { thead th, thead td { transform: none !important; } }

/* Finance → Krypto: vývoj kurzu */
.fc-hist-bar { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; margin-bottom: .7rem; }
.fc-hist-bar select { width: auto; max-width: 100%; min-height: 0; padding: .35rem 2rem .35rem .6rem; }
.fc-hist-bar .seg[hidden] { display: none; }
.fc-stats { display: flex; flex-wrap: wrap; align-items: baseline; gap: .3rem 1.2rem; margin-bottom: .6rem; font-size: .92rem; font-variant-numeric: tabular-nums; }
.fc-stats b { font-size: 1.25rem; }
.fc-chart { min-height: 120px; }
.fc-plot { position: relative; height: 300px; margin: 0 0 1.6rem 3.6rem; --fc: #1d8a4e; }
.fc-plot.down { --fc: #d64545; }
.fc-plot svg { width: 100%; height: 100%; display: block; overflow: visible; }
.fc-grid line { stroke: var(--line); stroke-width: 1; vector-effect: non-scaling-stroke; }
.fc-line { fill: none; stroke: var(--fc); stroke-width: 2; stroke-linejoin: round; }
.fc-area { fill: var(--fc); opacity: .09; }
.fc-cross { stroke: var(--muted); stroke-dasharray: 3 3; stroke-width: 1; }
.fc-yl { position: absolute; right: calc(100% + .4rem); transform: translateY(-50%); font-size: .72rem; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.fc-xl { position: absolute; top: calc(100% - 20px); transform: translateX(-50%); font-size: .72rem; color: var(--muted); white-space: nowrap; }
.fc-xl.f { transform: none; }
.fc-xl.l { transform: translateX(-100%); }
.fc-dot { position: absolute; width: 9px; height: 9px; border-radius: 50%; background: var(--fc); border: 2px solid var(--card); transform: translate(-50%, -50%); pointer-events: none; }
.fc-tip { position: absolute; top: -6px; transform: translate(-50%, -100%); background: var(--ink); color: var(--card); font-size: .78rem; padding: .3rem .5rem; border-radius: 6px; white-space: nowrap; pointer-events: none; text-align: center; z-index: 3; }
@media (max-width: 760px) { .fc-plot { height: 220px; margin-left: 3rem; } .fc-yl { font-size: .65rem; } }
.kpi-btc { position: relative; overflow: hidden; }
.kpi-btc .kpi-label i { color: #f7931a; }
.kpi-spark { position: absolute; right: 14px; top: 12px; width: 34%; height: 24px; opacity: .85; pointer-events: none; }
.kpi-spark path { fill: none; stroke: #1d8a4e; stroke-width: 1.6; stroke-linejoin: round; }
.kpi-spark.down path { stroke: #d64545; }
.ub-cl .list li { align-items: center; }
.ub-cl .ub-r { display: flex; flex-direction: column; align-items: flex-end; gap: .3rem; flex-shrink: 0; }
.ub-cl .ub-r .num { font-weight: 700; white-space: nowrap; }
.ub-cl .ub-proj { margin-top: .1rem; }
.ok-text { color: #1d8a4e; }

/* Weby – detail webu */
.site-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: 1rem; }
.site-head h1 { margin: 0 0 .2rem; }
.site-head p { margin: 0; }
.site-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.site-actions form { display: flex; gap: .5rem; flex-wrap: wrap; }
.site-edit > summary { list-style: none; cursor: pointer; }
.site-edit > summary::-webkit-details-marker { display: none; }
.site-edit > summary h2 { margin: 0; }
.site-edit[open] > summary { margin-bottom: .8rem; }
.site-edit .actions { display: flex; gap: .8rem; align-items: center; flex-wrap: wrap; }

/* Weby – nástěnka */
.wd-kpis { margin-bottom: 16px; }
@media (min-width: 1000px) { .wd-kpis { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.kpi.kpi-bad { border-color: color-mix(in srgb, var(--stop) 45%, var(--line)); background: color-mix(in srgb, var(--stop) 6%, var(--card)); }
.kpi.kpi-bad .kpi-value { color: var(--stop); }
.wd-grid { display: grid; gap: 16px; grid-template-columns: 1fr; align-items: start; }
.wd-grid > .card { margin: 0; }
@media (min-width: 1000px) { .wd-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.wd-att li > div > i { width: 1.1rem; }
.wd-att li.bad > div > i { color: var(--stop); }
.wd-att li.warn > div > i { color: #c98a0a; }
.good-t { color: #1d8a4e; } .mid-t { color: #c98a0a; } .bad-t { color: var(--stop); }

.mon-export { display: none; }
