/* Výhradně místní Finance podle schváleného návrhu. */
html.compact-finance { zoom:1 !important; --cf-scale:1; --fs-scale:var(--cf-scale); }
html.compact-finance.font-small { --cf-scale:.9; }
html.compact-finance.font-large { --cf-scale:1.12; }
html.compact-finance.font-xlarge { --cf-scale:1.28; }
html.compact-finance:not(.dark) { --bg:#f6f9fc; --surface:#fff; --surface2:#fffafb; --text:#4a0f1a; --text2:#a25765; --text3:#b07580; --accent:#962d43; --accent-light:#ffeaee; --border:#ffcad4; }
html.compact-finance body { padding-left:max(14px,env(safe-area-inset-left)); padding-right:max(14px,env(safe-area-inset-right)); background:linear-gradient(145deg,var(--bg),var(--surface)); }
html.compact-finance .app { max-width:1320px; }
html.compact-finance header { padding:12px 0; margin:0 0 12px; border:0; gap:14px; }
html.compact-finance .logo { display:grid; grid-template-columns:48px minmax(130px,1.1fr) minmax(0,2.5fr) auto auto; grid-auto-rows:48px; gap:12px; align-items:center; width:100%; }
html.compact-finance #main-logo { width:48px; height:48px; border-radius:6px; }
html.compact-finance .logo-text-wrapper { min-width:0; height:48px; align-items:start; justify-content:center; }
html.compact-finance header h1 { max-height:48px; height:auto !important; text-align:left; line-height:1.4 !important; white-space:normal !important; overflow:visible !important; overflow-wrap:anywhere; }
html.compact-finance #stanice-logo[style*="hidden"] { display:none; }
html.compact-finance #stanice-logo { grid-column:4; width:40px; height:40px; }
html.compact-finance .logo:has(#stanice-logo:not([style*="hidden"])) { grid-template-columns:48px minmax(130px,1.1fr) minmax(0,2.5fr) 40px auto auto; }
html.compact-finance .compact-statuses { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; height:46px; min-width:0; }
html.compact-finance #cloud-badge { display:contents !important; }
html.compact-finance #cloud-badge > * { display:grid !important; grid-template-columns:auto minmax(0,1fr); align-content:center; gap:0 5px !important; width:100% !important; min-width:0 !important; max-width:none !important; height:46px !important; min-height:0 !important; padding:5px !important; border-radius:5px !important; box-sizing:border-box; white-space:normal !important; overflow:visible !important; }
html.compact-finance #cloud-badge svg { grid-row:1 / 3; align-self:center; width:18px; height:18px; }
html.compact-finance #cloud-badge span { font-size:inherit !important; overflow:visible !important; text-overflow:clip !important; }
html.compact-finance .compact-badge-state { grid-column:2; font-size:inherit; }
html.compact-finance #header-backup-tile { display:flex !important; flex-direction:column; align-items:center; justify-content:center; height:46px !important; min-height:0; width:100%; padding:4px; border-radius:5px; box-shadow:none; box-sizing:border-box; }
html.compact-finance #header-backup-tile span { font-size:inherit !important; line-height:1.2; text-transform:none !important; letter-spacing:0 !important; }
html.compact-finance #header-backup-tile::after { inset:0; width:auto; height:auto; transform:none; }
html.compact-finance #header-version-tile { display:flex !important; width:auto; min-width:0; padding:0; background:transparent; border:0; box-shadow:none; height:44px; }
html.compact-finance #header-version-line1, html.compact-finance .ver-update-ico { display:none; }
html.compact-finance #header-version-line2 { font-size:10px !important; }
html.compact-finance #lang-pill-wrap { min-width:62px; z-index:502; }
html.compact-finance #lang-pill-btn { height:44px; width:100%; border:1px solid var(--border); border-radius:5px; background:var(--surface); color:var(--accent); }
html.compact-finance .ios-tab-bar { width:min(1320px,calc(100% - 28px)); max-width:1320px; left:50%; bottom:0; transform:translateX(-50%); padding:5px max(4px,env(safe-area-inset-right)) max(5px,env(safe-area-inset-bottom)) max(4px,env(safe-area-inset-left)); height:calc(76px + env(safe-area-inset-bottom)); box-sizing:border-box; border:1px solid var(--border); border-radius:6px 6px 0 0; background:var(--surface); box-shadow:0 -2px 8px #13462408; display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); }
html.compact-finance .tab-item { height:62px; min-height:0; border:1px solid transparent; border-radius:4px; }
html.compact-finance .tab-item.active { background:#f8e2e6; border-color:#c97685; }
html.compact-finance .tab-icon, html.compact-finance .tab-icon svg { width:30px; height:30px; }
html.compact-finance .tab-icon svg > rect { fill:transparent; stroke:none; }
html.compact-finance .tab-icon svg > text { font-size:36px !important; }
html.compact-finance .tab-item.active .tab-icon { transform:none; filter:none; }
html.compact-finance .tab-label { height:24px; line-height:1.2 !important; color:var(--text2) !important; font-weight:500; transition:none !important; overflow:visible; text-overflow:clip; }
html.compact-finance .tab-item.active .tab-label { color:#661221 !important; }
html.compact-finance #header-row2 { display:block !important; width:100%; }
html.compact-finance .header-right-group { display:contents; }
html.compact-finance #header-row2 .header-left-group { display:grid !important; grid-template-columns:minmax(100px,1fr) repeat(4,minmax(0,1fr)); gap:8px; width:100%; align-items:center; }
html.compact-finance #header-row2 .header-left-group > * { min-width:0 !important; width:100% !important; max-width:none !important; }
html.compact-finance #fin-sort-bar, html.compact-finance .filters-row-4col { display:none !important; }
html.compact-finance .cf-heading { order:0; margin:0; height:44px; display:flex; align-items:center; justify-content:start; text-align:left; font-weight:700; }
html.compact-finance #add-income-btn { order:1; }
html.compact-finance #add-expense-btn { order:2; }
html.compact-finance #global-search-btn { order:3; }
html.compact-finance #fin-export-btn { order:4; }
html.compact-finance #header-row2 .h-tile { width:100% !important; min-width:0 !important; max-width:none !important; height:44px !important; min-height:44px; padding:4px 6px; box-sizing:border-box; border:1px solid #cc6e7f !important; border-radius:5px; background:var(--surface); color:var(--accent); box-shadow:none; white-space:nowrap !important; font-family:inherit; font-weight:600; line-height:1.2; transform:none !important; transition-property:background-color,border-color,color !important; }
html.compact-finance #header-row2 .h-tile > span { font-size:inherit !important; }
html.compact-finance #header-row2 .h-tile { text-overflow:clip !important; }
html.compact-finance #header-row2 #add-income-btn { background:#318043; border-color:#318043 !important; color:#fff; }
html.compact-finance #header-row2 #add-expense-btn { background:#b52e3c; border-color:#b52e3c !important; color:#fff; }
html.compact-finance .cf-filters { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; margin-top:8px; }
html.compact-finance .cf-filter { border:1px solid #cc6e7f; border-radius:4px; background:var(--surface); height:44px; display:grid; grid-template-columns:auto minmax(0,1fr); align-items:center; gap:6px; padding:0 8px; min-width:0; box-sizing:border-box; color:var(--accent); }
html.compact-finance .cf-filter-label { font-size:12px; line-height:16px; }
html.compact-finance .cf-filter select { border:0; border-radius:0; background:transparent; color:var(--accent); width:100%; min-width:0; height:40px; box-sizing:border-box; font-family:inherit; font-size:13px; font-weight:600; padding:2px 16px 2px 0; text-align:center; }
html.compact-finance #tab-platby, html.compact-finance .cf-ledger { grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; align-items:start; }
html.compact-finance #tab-platby.active, html.compact-finance .cf-ledger { display:grid; }
html.compact-finance #tab-platby > :not(.cf-card), html.compact-finance .cf-ledger > :not(.cf-card) { grid-column:1 / -1; min-width:0; }
html.compact-finance .cf-overview { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:8px; }
html.compact-finance .cf-stat { box-sizing:border-box; height:124px; min-width:0 !important; border:1px solid var(--border) !important; border-radius:5px !important; background:var(--surface) !important; padding:8px !important; display:grid !important; grid-template-rows:60px 20px 18px; gap:2px !important; align-content:center; text-align:center; box-shadow:none !important; transform:none !important; transition:none !important; }
html.compact-finance .cf-stat[data-cf-stat="income"][aria-pressed="true"] { border:2px solid #318043 !important; background:#f2fbf5 !important; }
html.compact-finance .cf-stat[data-cf-stat="expenses"][aria-pressed="true"] { border:2px solid #b52e3c !important; background:#fff4f5 !important; }
html.compact-finance .cf-stat-value { display:flex !important; align-items:center !important; justify-content:center !important; min-width:0; width:100%; height:60px; overflow:auto; font-size:24px; font-weight:700; line-height:1.2; white-space:normal !important; }
html.compact-finance .cf-stat-value .castky-mrizka { margin:auto; flex-shrink:0; }
html.compact-finance .cf-stat-label { text-transform:uppercase; font-weight:700; color:var(--text2); font-size:13px; line-height:20px; }
html.compact-finance .cf-stat-hint { font-size:11px; line-height:18px; color:var(--text2); }
html.compact-finance .cf-stat[data-cf-stat="income"] :is(.cf-stat-value,.cf-stat-label) { color:#267038; }
html.compact-finance .cf-stat[data-cf-stat="expenses"] :is(.cf-stat-value,.cf-stat-label), html.compact-finance .cf-stat[data-cf-stat="refund"] :is(.cf-stat-value,.cf-stat-label) { color:#a5243c; }
html.compact-finance .cf-formula { margin:0 0 4px; text-align:center; font-size:11px; line-height:1.4; color:var(--text2); }
html.compact-finance .cf-source-sections[hidden] { display:none !important; }
html.compact-finance .cf-months { display:grid; gap:14px; }
html.compact-finance .cf-month-heading { display:flex; align-items:center; justify-content:space-between; gap:10px; min-height:30px; margin-bottom:8px; }
html.compact-finance .cf-month-heading h3 { margin:0; font-size:18px; text-transform:capitalize; }
html.compact-finance .cf-month-heading .fin-castky { min-width:0; font-size:13px; font-weight:700; color:var(--accent); }
html.compact-finance .cf-month-cards { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; }
html.compact-finance :is(.income-total-bar,.expense-total-bar) { padding:8px 0 !important; margin:0 !important; min-height:32px; border:0 !important; border-bottom:1px solid var(--border) !important; border-radius:0 !important; background:none !important; gap:12px; box-sizing:border-box; }
html.compact-finance .cf-total-label { line-height:1.2; min-width:0; }
html.compact-finance .cf-card { box-sizing:border-box; height:184px; width:100%; min-width:0; margin:0 !important; padding:0 !important; border:1px solid var(--border) !important; border-radius:5px !important; background:var(--surface) !important; box-shadow:none !important; transform:none !important; overflow:hidden; }
html.compact-finance .cf-card[data-cf-record*="refund"] { border-color:#e6abb5 !important; background:var(--surface2) !important; }
html.compact-finance .cf-original[hidden] { display:none !important; }
html.compact-finance .cf-view { box-sizing:border-box; height:100%; padding:10px; display:grid; grid-template-columns:minmax(0,1.35fr) minmax(0,1fr); grid-template-rows:40px 30px 20px 44px; gap:6px 8px; align-items:start; }
html.compact-finance .cf-view :is(button,span,div) { min-width:0; box-sizing:border-box; }
html.compact-finance .cf-name { grid-area:1 / 1; height:40px; width:100%; padding:0; border:0; background:none; color:var(--text); font-family:inherit; font-size:14px; font-weight:700; line-height:1.2; text-align:left; overflow:hidden; overflow-wrap:anywhere; cursor:pointer; }
html.compact-finance .cf-amount { grid-area:1 / 2; width:100%; height:40px; padding:0; border:0; background:none; color:var(--accent); font-family:inherit; font-weight:700; line-height:1.2; text-align:right; cursor:pointer; overflow:auto; overflow-wrap:anywhere; }
html.compact-finance .cf-amount > span > span { font-size:inherit !important; white-space:normal !important; }
html.compact-finance .cf-amount .castky-mrizka { font-size:inherit; }
html.compact-finance .cf-meta { grid-area:2 / 1 / 3 / -1; height:30px; color:var(--text2); font-size:11px; line-height:1.2; overflow:hidden; overflow-wrap:anywhere; }
html.compact-finance .cf-fullname { grid-area:3 / 1 / 4 / -1; height:20px; width:max-content; max-width:100%; border:0; padding:0; background:none; color:var(--accent); font-family:inherit; font-size:11px; line-height:1.2; cursor:pointer; }
html.compact-finance .cf-paid { grid-area:4 / 1; height:44px; display:flex; flex-direction:column; justify-content:center; gap:5px; color:var(--text2); font-size:11px; line-height:1.2; overflow:hidden; overflow-wrap:anywhere; }
html.compact-finance .cf-progress { width:100% !important; flex-shrink:0; }
html.compact-finance .cf-detail { grid-area:4 / 2; height:44px; width:100%; max-width:90px; justify-self:end; border:1px solid var(--border); border-radius:4px; background:var(--surface2); color:var(--accent); font-family:inherit; font-size:12px; font-weight:600; text-overflow:clip; cursor:pointer; }
html.compact-finance .cf-dialog { box-sizing:border-box; width:min(550px,calc(100% - 24px)); max-height:calc(100dvh - 24px); padding:16px; margin:auto; border:1px solid var(--border); border-radius:6px; color:var(--text); background:var(--surface); overflow:auto; }
html.compact-finance .cf-dialog::backdrop { background:#13462470; }
html.compact-finance .cf-dialog h2 { font-size:19px; line-height:1.3; margin:0 0 16px; max-height:32dvh; overflow:auto; overflow-wrap:anywhere; }
html.compact-finance .cf-dialog-body { max-height:40dvh; overflow:auto; overflow-wrap:anywhere; font-size:14px; line-height:1.5; }
html.compact-finance .cf-dialog-body [onclick] { min-height:44px; min-width:44px; }
html.compact-finance .cf-close { margin-top:16px; width:100%; min-height:44px; border:1px solid var(--border); border-radius:4px; color:var(--accent); background:var(--surface2); font-family:inherit; }
html.compact-finance :is(button,[role="button"],select):focus-visible { outline:2px solid var(--accent); outline-offset:2px; }
@media (max-width:1100px) {
  html.compact-finance .logo { grid-template-columns:44px minmax(130px,1fr) auto auto; gap:8px; }
  html.compact-finance .compact-statuses { grid-column:1 / -1; grid-row:2; width:100%; }
}
@media (min-width:601px) and (max-width:999px) {
  html.compact-finance #tab-platby, html.compact-finance .cf-ledger { grid-template-columns:repeat(2,minmax(0,1fr)); }
  html.compact-finance .cf-month-cards { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media (max-width:600px) {
  html.compact-finance body { padding-inline:10px; }
  html.compact-finance header { gap:6px; padding:10px 0 6px; margin-bottom:6px; }
  html.compact-finance .logo, html.compact-finance .logo:has(#stanice-logo:not([style*="hidden"])) { grid-template-columns:40px minmax(0,1fr) 58px; grid-template-rows:24px 18px 44px; grid-auto-rows:auto; gap:3px 6px; }
  html.compact-finance #main-logo { width:40px; height:40px; grid-row:1 / 3; }
  html.compact-finance .logo-text-wrapper { grid-column:2; grid-row:1; height:24px; }
  html.compact-finance header h1 { max-height:24px; }
  html.compact-finance #stanice-logo { grid-column:2; grid-row:2; width:18px; height:18px; justify-self:end; }
  html.compact-finance #header-version-tile { grid-column:2; grid-row:2; height:18px; justify-self:start; }
  html.compact-finance #lang-pill-wrap { grid-column:3; grid-row:1 / 3; min-width:0; }
  html.compact-finance .compact-statuses { grid-row:3; height:44px; gap:5px; }
  html.compact-finance :is(#cloud-badge > *,#header-backup-tile) { height:44px !important; }
  html.compact-finance #cloud-badge svg { width:14px; height:14px; }
  html.compact-finance #header-row2 .header-left-group { grid-template-columns:repeat(4,minmax(0,1fr)); gap:5px; }
  html.compact-finance .cf-heading { grid-column:1 / -1; height:30px; }
  html.compact-finance .cf-filters { gap:5px; margin-top:5px; }
  html.compact-finance .cf-filter { height:48px; grid-template-columns:minmax(0,1fr); grid-template-rows:14px 26px; gap:1px; padding:3px 4px; }
  html.compact-finance .cf-filter-label { line-height:14px; font-size:10px; }
  html.compact-finance .cf-filter select { height:26px; font-size:11px; text-align:left; padding-right:12px; }
  html.compact-finance .cf-overview { grid-template-columns:repeat(2,minmax(0,1fr)); gap:5px; }
  html.compact-finance .cf-stat { height:106px; grid-template-rows:50px 18px 16px; padding:6px !important; }
  html.compact-finance .cf-stat-value { height:50px; font-size:20px; }
  html.compact-finance .cf-stat-label { line-height:18px; }
  html.compact-finance .cf-stat-hint { line-height:16px; }
  html.compact-finance #tab-platby, html.compact-finance .cf-ledger { grid-template-columns:minmax(0,1fr); gap:6px; }
  html.compact-finance .cf-month-cards { grid-template-columns:minmax(0,1fr); gap:6px; }
  html.compact-finance .cf-months { gap:10px; }
  html.compact-finance .cf-month-heading { margin-bottom:6px; }
  html.compact-finance .cf-month-heading h3 { font-size:16px; }
  html.compact-finance .cf-card { height:100px; }
  html.compact-finance .cf-view { padding:7px 8px; grid-template-columns:minmax(0,1.6fr) minmax(0,1fr); grid-template-rows:28px 20px 24px; gap:5px 6px; }
  html.compact-finance .cf-name, html.compact-finance .cf-amount { height:28px; }
  html.compact-finance .cf-meta { grid-area:2 / 1; height:20px; font-size:10px; }
  html.compact-finance .cf-parent { display:none; }
  html.compact-finance .cf-fullname { display:none; }
  html.compact-finance .cf-paid { grid-area:3 / 1; height:24px; font-size:10px; }
  html.compact-finance .cf-detail { grid-area:2 / 2 / 4 / 3; height:49px; min-height:44px; max-width:70px; }
  html.compact-finance .ios-tab-bar { width:100%; height:calc(68px + env(safe-area-inset-bottom)); border-radius:0; }
  html.compact-finance .tab-item { height:56px; }
  html.compact-finance .tab-icon, html.compact-finance .tab-icon svg { width:25px; height:25px; }
}
/* ===== Doladění Financí: mezery, rohy 6 px, písmo, perleťové přechody (PC i telefon) ===== */
html.compact-finance header { padding:8px 0 0; margin:0 0 6px; gap:8px; }
html.compact-finance .cf-filters { margin-top:6px; }
html.compact-finance .cf-overview { gap:8px; }
html.compact-finance .cf-stat { height:112px; }
html.compact-finance .cf-formula { margin:2px 0 0; }
html.compact-finance .cf-months { gap:8px; }
html.compact-finance .cf-month-heading { min-height:26px; margin-bottom:6px; }
html.compact-finance .cf-month-cards { gap:8px; }
html.compact-finance :is(#header-row2 .h-tile, #header-row2 button, .cf-filter, .cf-stat, .cf-card, .cf-detail, .cf-original, .income-total-bar, #cloud-badge > *, #header-backup-tile, #lang-pill-btn, .ios-tab-bar .tab-item) { border-radius:6px !important; }
html.compact-finance #header-row2 #fin-export-btn { font-weight:600 !important; }
@media (min-width:1101px) { html.compact-finance #header-row2 .header-left-group { grid-template-columns:130px repeat(4,minmax(0,1fr)) 130px; } }
@media (max-width:600px) { html.compact-finance header { gap:5px; padding:8px 0 0; margin-bottom:4px; } html.compact-finance .cf-stat { height:auto; min-height:96px; } }
/* Perleťové barvy jako na úvodní obrazovce */
html.compact-finance:not(.dark) {
  --bg:#fcedf0; --surface:#fff; --surface2:#fff2f4; --text:#4d0f1a; --text2:#934c59; --text3:#975460; --accent:#962d43; --accent-light:#ffe3e8; --border:#f4c9d1;
  --pearl-face:linear-gradient(135deg,#fffffff5,#fffafbdf 52%,#fce6eabd); --pearl-edge:#f4c9d1; --pearl-light:#ffffffed; --pearl-shade:#92d9bb29; --pearl-shadow:#519e8312;
}
html.compact-finance.dark { --pearl-face:linear-gradient(135deg,#274337f5,#21352def 52%,#264139e8); --pearl-edge:#824e57; --pearl-light:#8cb3af2b; --pearl-shade:#0d241a2e; --pearl-shadow:#00000024; }
html.compact-finance:not(.dark) body { background:radial-gradient(ellipse at 9% 4%,#dcfaee99,transparent 48%),radial-gradient(ellipse at 94% 36%,#ddf5f655,transparent 52%),linear-gradient(135deg,#fff8f9,#fcedf0 60%,#fffafb); background-attachment:fixed; }
html.compact-finance :is(#header-row2 #global-search-btn, #header-row2 #fin-export-btn, .cf-filter, #lang-pill-btn) {
  border-color:var(--pearl-edge) !important; background:var(--pearl-face) !important;
  box-shadow:inset 1px 1px 0 var(--pearl-light), inset -1px -1px 0 var(--pearl-shade), 0 2px 5px var(--pearl-shadow) !important; }
html.compact-finance .cf-card { box-shadow:inset 1px 1px 0 var(--pearl-light), inset -1px -1px 0 var(--pearl-shade), 0 3px 8px var(--pearl-shadow) !important; background-image:linear-gradient(135deg,#ffffff70,#ffffff00 60%) !important; }
html.compact-finance .cf-stat[aria-pressed="true"] { box-shadow:inset 1px 1px 0 var(--pearl-light), 0 2px 6px var(--pearl-shadow) !important; background-image:linear-gradient(135deg,#ffffff70,#ffffff00 60%) !important; }
html.compact-finance header :is(#badge-device, #badge-cloud, #header-backup-tile) { background-image:linear-gradient(135deg,#ffffff35,#ffffff08 58%,#a0cfc110) !important; box-shadow:inset 1px 1px 0 var(--pearl-light), inset -1px -1px 0 var(--pearl-shade), 0 1px 3px var(--pearl-shadow) !important; }
html.compact-finance .ios-tab-bar { border-color:var(--pearl-edge); background:var(--pearl-face); background-color:var(--surface); box-shadow:inset 0 1px 0 var(--pearl-light), 0 -2px 12px var(--pearl-shadow); }
html.compact-finance #tab-platby div[style*="#f59e0b"] { border-radius:6px !important; padding:8px 12px !important; margin-bottom:8px !important; }
/* Aktivní výběr: zvýraznění je kolem celé zaoblené dlaždice, ne ostrý obdélník kolem samotného výběru. */
html.compact-finance .cf-filter select:focus, html.compact-finance .cf-filter select:focus-visible { outline:none !important; box-shadow:none !important; }
html.compact-finance .cf-filter:focus-within { outline:2px solid var(--accent); outline-offset:-2px; border-radius:6px !important; }
@media (max-width:600px) { html.compact-finance .cf-filters { grid-template-columns:minmax(0,.8fr) minmax(0,.8fr) minmax(0,1.4fr); } html.compact-finance .cf-filter select { text-overflow:ellipsis; } }
/* ===== K doplacení: tři nejvyšší dluhy jako dlaždice ve stejné řadě jako čísla + „+ N dalších“ ===== */
html.compact-finance .cf-dluhy { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:6px; margin:6px 0 6px; }
html.compact-finance .cf-dluh { box-sizing:border-box; height:72px; min-width:0; display:flex; flex-direction:column; align-items:flex-start; justify-content:center; gap:2px; padding:6px 12px; text-align:left; cursor:pointer;
  font-family:inherit; color:var(--text); border:1.5px solid rgba(245,158,11,.55); border-radius:6px; background:var(--pearl-face, #fff);
  box-shadow:inset 1px 1px 0 var(--pearl-light, #fff), inset -1px -1px 0 var(--pearl-shade, #0001), 0 2px 5px var(--pearl-shadow, #0001); }
html.compact-finance .cf-dluh-jmeno { max-width:100%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:13px; font-weight:600; }
html.compact-finance .cf-dluh b { font-size:17px; color:#b45309; line-height:1.2; }
html.compact-finance .cf-dluh-stav { font-size:11px; color:var(--text2); }
html.compact-finance .cf-dluh-vice { align-items:center; background:#fffaf0; }
html.compact-finance .cf-dluh-vice b { color:var(--accent); }
html.compact-finance .cf-dluh-tecka { display:inline-block; width:8px; height:8px; border-radius:50%; margin-right:6px; background:#f59e0b; }
html.compact-finance .cf-dluh-tecka.p { background:#16a34a; }
@media (max-width:600px) { html.compact-finance .cf-dluhy { grid-template-columns:repeat(2,minmax(0,1fr)); } }
dialog.cf-dluhy-okno { box-sizing:border-box; width:min(460px,calc(100% - 28px)); max-height:calc(100dvh - 40px); overflow:auto; padding:14px; border:1.5px solid #f4c9d1; border-radius:8px; background:#fff; color:#4d0f1a; box-shadow:0 8px 30px #13462430; }
dialog.cf-dluhy-okno::backdrop { background:#13462470; }
.cf-dluhy-hlava { display:flex; justify-content:space-between; align-items:center; gap:10px; margin-bottom:10px; }
.cf-dluhy-hlava h2 { margin:0; font-size:16px; }
.cf-dluhy-zavrit { min-height:44px; padding:4px 14px; border:1.5px solid rgba(70, 24, 32,.4); border-radius:6px; background:#fff; color:#962d43; font:600 14px 'IBM Plex Sans',sans-serif; cursor:pointer; }
.cf-dluhy-seznam { display:flex; flex-direction:column; gap:6px; font-size:13px; }
.cf-dluhy-radek { display:flex; justify-content:space-between; gap:10px; }
.cf-dluhy-radek em { font-style:normal; color:#934c59; font-size:12px; }
.cf-dluhy-radek b { white-space:nowrap; }
.cf-dluh-tecka { display:inline-block; width:8px; height:8px; border-radius:50%; margin-right:6px; background:#f59e0b; }
.cf-dluh-tecka.p { background:#16a34a; }
dialog.cf-dluhy-okno { margin:auto; inset:0; width:min(460px,calc(100% - 28px)); height:fit-content; }
.cf-dluhy-hlava h2 { white-space:nowrap; }
/* K doplacení: nízké dlaždice (44 px), jméno + stav vlevo, částka vpravo. */
html.compact-finance .cf-dluh { height:44px; display:grid; grid-template-columns:minmax(0,1fr) auto; grid-template-rows:auto auto; align-items:center; align-content:center; column-gap:8px; row-gap:0; padding:3px 10px; }
html.compact-finance .cf-dluh-jmeno { grid-column:1; grid-row:1; font-size:12.5px; line-height:1.25; }
html.compact-finance .cf-dluh-stav { grid-column:1; grid-row:2; font-size:11px; line-height:1.2; }
html.compact-finance .cf-dluh b { grid-column:2; grid-row:1 / 3; font-size:15px; white-space:nowrap; }
html.compact-finance .cf-dluh-vice { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:0; }
html.compact-finance .cf-dluh-vice b { font-size:14px; }
html.compact-finance .cf-dluh-vice .cf-dluh-stav { font-size:11px; }
@media (max-width:600px) { html.compact-finance .cf-dluh { height:52px; } }
@media (max-width:600px) {
  html.compact-finance .cf-dluh { height:54px; }
  html.compact-finance .cf-dluh-jmeno { grid-column:1 / 3; grid-row:1; }
  html.compact-finance .cf-dluh-stav { grid-column:1; grid-row:2; }
  html.compact-finance .cf-dluh b { grid-column:2; grid-row:2; font-size:14px; }
}
/* ===== Finance (návrh 3): čísla v jednom pruhu s předěly, záznamy jako tabulka ===== */
html.compact-finance .cf-overview { display:grid !important; grid-template-columns:repeat(4,minmax(0,1fr)); gap:0 !important; border:1.5px solid var(--pearl-edge); border-radius:6px; background:var(--pearl-face); box-shadow:inset 1px 1px 0 var(--pearl-light), inset -1px -1px 0 var(--pearl-shade), 0 2px 5px var(--pearl-shadow); overflow:hidden; }
html.compact-finance .cf-overview > .cf-stat { height:auto !important; min-height:56px; border:0 !important; border-left:1px solid var(--pearl-edge) !important; border-radius:0 !important; background:none !important; background-image:none !important; box-shadow:none !important;
  display:flex !important; flex-wrap:wrap; align-content:center; align-items:baseline; column-gap:8px; row-gap:1px; padding:6px 14px !important; text-align:left; }
html.compact-finance .cf-overview > .cf-stat:first-child { border-left:0 !important; }
html.compact-finance .cf-stat-label { order:1; height:auto !important; line-height:1.2 !important; font-size:11px !important; }
html.compact-finance .cf-stat-hint { order:2; height:auto !important; line-height:1.2 !important; font-size:11px !important; }
html.compact-finance .cf-stat-value { order:3; flex:0 0 100%; height:auto !important; width:100%; min-width:0; justify-content:flex-start !important; text-align:left; font-size:16px !important; line-height:1.25 !important; overflow:visible !important; }
html.compact-finance .cf-stat-value .castky-mrizka { display:flex !important; flex-wrap:wrap; justify-content:flex-start !important; column-gap:0 !important; margin:0 !important; font-size:16px !important; }
html.compact-finance .cf-stat-value .castky-mrizka > span:nth-child(3n+1):not(:first-child) { margin-left:12px; }
html.compact-finance .cf-stat-value .castky-mrizka > span:nth-child(3n+2), html.compact-finance .cf-stat-value .castky-mrizka > span:nth-child(3n+3) { text-align:left !important; }
html.compact-finance .cf-stat[aria-pressed="true"] { box-shadow:inset 0 -3px 0 currentColor !important; }
html.compact-finance .cf-stat[data-cf-stat="income"][aria-pressed="true"] { box-shadow:inset 0 -3px 0 #318043 !important; }
html.compact-finance .cf-stat[data-cf-stat="expenses"][aria-pressed="true"] { box-shadow:inset 0 -3px 0 #b52e3c !important; }
/* záznamy jako tabulka v jednom rámečku */
html.compact-finance .cf-month-cards { display:flex !important; flex-direction:column; gap:0 !important; border:1.5px solid var(--pearl-edge); border-radius:6px; background:var(--pearl-face); box-shadow:inset 1px 1px 0 var(--pearl-light), inset -1px -1px 0 var(--pearl-shade), 0 2px 5px var(--pearl-shadow); overflow:hidden; }
html.compact-finance .cf-month-cards > .cf-card { height:42px !important; border:0 !important; border-top:1px solid var(--pearl-edge) !important; border-radius:0 !important; background:none !important; background-image:none !important; box-shadow:none !important; }
html.compact-finance .cf-month-cards > .cf-card:first-child { border-top:0 !important; }
html.compact-finance .cf-month-cards > .cf-card[data-cf-record*="refund"] { background:rgba(165,36,60,.05) !important; }
html.compact-finance .cf-month-cards .cf-view { height:100% !important; padding:0 12px !important; display:grid !important; grid-template-columns:minmax(0,1.5fr) minmax(0,1.7fr) minmax(0,1.1fr) 150px 84px; grid-template-rows:1fr !important; gap:12px !important; align-items:center; }
html.compact-finance .cf-month-cards .cf-name { grid-area:1 / 1 !important; height:auto !important; font-size:13.5px !important; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; -webkit-line-clamp:1; display:block !important; text-align:left; }
html.compact-finance .cf-month-cards .cf-meta { grid-area:1 / 2 !important; height:auto !important; font-size:12px !important; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
html.compact-finance .cf-month-cards .cf-fullname { display:none !important; }
html.compact-finance .cf-month-cards .cf-paid { grid-area:1 / 3 !important; height:auto !important; font-size:11px !important; white-space:nowrap; justify-content:center; gap:3px; }
html.compact-finance .cf-month-cards .cf-amount { grid-area:1 / 4 !important; height:auto !important; justify-self:end; text-align:right; font-size:14px !important; }
html.compact-finance .cf-month-cards .cf-amount .castky-mrizka { justify-content:flex-end; }
html.compact-finance .cf-month-cards .cf-detail { grid-area:1 / 5 !important; height:30px !important; min-height:0; max-width:none; width:100%; font-size:12.5px !important; }
html.compact-finance .cf-months { gap:6px !important; }
@media (max-width:600px) {
  html.compact-finance .cf-overview { grid-template-columns:repeat(2,minmax(0,1fr)); }
  html.compact-finance .cf-overview > .cf-stat:nth-child(odd) { border-left:0 !important; }
  html.compact-finance .cf-overview > .cf-stat:nth-child(n+3) { border-top:1px solid var(--pearl-edge) !important; }
  html.compact-finance .cf-month-cards > .cf-card { height:60px !important; }
  html.compact-finance .cf-month-cards .cf-view { grid-template-columns:minmax(0,1fr) auto 64px; grid-template-rows:auto auto !important; gap:2px 8px !important; padding:6px 10px !important; }
  html.compact-finance .cf-month-cards .cf-name { grid-area:1 / 1 / 2 / 3 !important; }
  html.compact-finance .cf-month-cards .cf-meta { grid-area:2 / 1 / 3 / 3 !important; font-size:11px !important; }
  html.compact-finance .cf-month-cards .cf-paid { display:none !important; }
  html.compact-finance .cf-month-cards .cf-amount { grid-area:1 / 3 / 2 / 4 !important; }
  html.compact-finance .cf-month-cards .cf-detail { grid-area:2 / 3 / 3 / 4 !important; height:26px !important; font-size:11.5px !important; }
}
html.compact-finance .cf-month-cards .cf-amount, html.compact-finance .cf-month-cards .cf-amount * { white-space:nowrap !important; }
@media (max-width:600px) {
  html.compact-finance .cf-stat-value .castky-mrizka { display:grid !important; grid-template-columns:max-content max-content max-content; justify-content:start !important; }
  html.compact-finance .cf-stat-value .castky-mrizka > span:nth-child(3n+1):not(:first-child) { margin-left:0; }
  html.compact-finance .cf-stat-value, html.compact-finance .cf-stat-value .castky-mrizka { font-size:15px !important; }
  html.compact-finance .cf-stat-label, html.compact-finance .cf-stat-hint { flex:0 0 100%; }
  html.compact-finance .cf-month-cards .cf-view { grid-template-columns:minmax(0,1fr) auto 70px; }
  html.compact-finance .cf-month-cards .cf-amount { justify-self:end; }
}
/* Vybraná volba v pruhu: bez silného rámečku, jen jemné zbarvení a tenký proužek dole. */
html.compact-finance .cf-overview > .cf-stat[aria-pressed="true"][data-cf-stat] { border:0 !important; border-left:1px solid var(--pearl-edge) !important; border-radius:0 !important; }
html.compact-finance .cf-overview > .cf-stat[data-cf-stat="income"][aria-pressed="true"] { background:linear-gradient(180deg,rgba(49,128,67,.09),rgba(49,128,67,.03)) !important; box-shadow:inset 0 -2px 0 #318043 !important; }
html.compact-finance .cf-overview > .cf-stat[data-cf-stat="expenses"][aria-pressed="true"] { background:linear-gradient(180deg,rgba(181,46,60,.09),rgba(181,46,60,.03)) !important; box-shadow:inset 0 -2px 0 #b52e3c !important; }
html.compact-finance .cf-overview > .cf-stat[data-cf-stat="income"][aria-pressed="true"]:first-child { border-left:0 !important; }
/* Pruh čísel: segmenty s mezerou 4 px, vybraná volba má tenké lemování kolem celé volby (decentní). */
html.compact-finance .cf-overview { padding:4px !important; gap:4px !important; }
html.compact-finance .cf-overview > .cf-stat, html.compact-finance .cf-overview > .cf-stat[aria-pressed="true"][data-cf-stat], html.compact-finance .cf-overview > .cf-stat:first-child, html.compact-finance .cf-overview > .cf-stat:nth-child(odd), html.compact-finance .cf-overview > .cf-stat:nth-child(n+3) {
  border:1.5px solid transparent !important; border-radius:4px !important; box-shadow:none !important; min-height:54px; }
html.compact-finance .cf-overview > .cf-stat[data-cf-stat="income"][aria-pressed="true"] { border-color:rgba(49,128,67,.45) !important; background:rgba(49,128,67,.05) !important; box-shadow:none !important; }
html.compact-finance .cf-overview > .cf-stat[data-cf-stat="expenses"][aria-pressed="true"] { border-color:rgba(181,46,60,.45) !important; background:rgba(181,46,60,.05) !important; box-shadow:none !important; }
html.compact-finance .cf-overview > .cf-stat:not([aria-pressed="true"]) { border-color:transparent !important; }
html.compact-finance .cf-overview > .cf-stat:not([aria-pressed="true"]) { background:none !important; }
html.compact-finance #tab-platby .cf-overview > .cf-stat:not([aria-pressed="true"]) { border-color:transparent !important; background:none !important; background-image:none !important; box-shadow:none !important; }
html.compact-finance #tab-platby .cf-overview > .cf-stat[data-cf-stat="income"][aria-pressed="true"] { border-color:rgba(49,128,67,.45) !important; background:rgba(49,128,67,.05) !important; background-image:none !important; box-shadow:none !important; }
html.compact-finance #tab-platby .cf-overview > .cf-stat[data-cf-stat="expenses"][aria-pressed="true"] { border-color:rgba(181,46,60,.45) !important; background:rgba(181,46,60,.05) !important; background-image:none !important; box-shadow:none !important; }
/* Každá hodnota má vlastní lemování (ne společný rámeček); vybraná volba barevně, ostatní fialově. */
html.compact-finance #tab-platby .cf-overview { padding:0 !important; gap:6px !important; border:0 !important; background:none !important; box-shadow:none !important; overflow:visible !important; }
html.compact-finance #tab-platby .cf-overview > .cf-stat:not([aria-pressed="true"]) { border:1.5px solid var(--pearl-edge) !important; border-radius:6px !important; background:var(--pearl-face) !important;
  box-shadow:inset 1px 1px 0 var(--pearl-light), inset -1px -1px 0 var(--pearl-shade), 0 2px 5px var(--pearl-shadow) !important; }
html.compact-finance #tab-platby .cf-overview > .cf-stat[aria-pressed="true"] { border-radius:6px !important; border-width:1.5px !important; border-style:solid !important; }
html.compact-finance #tab-platby .cf-overview > .cf-stat { min-height:56px; padding:6px 14px !important; }
html.compact-finance #tab-platby .cf-overview > .cf-stat[data-cf-stat="income"][aria-pressed="true"] { border-color:rgba(49,128,67,.55) !important; background:rgba(49,128,67,.06) !important; }
html.compact-finance #tab-platby .cf-overview > .cf-stat[data-cf-stat="expenses"][aria-pressed="true"] { border-color:rgba(181,46,60,.55) !important; background:rgba(181,46,60,.06) !important; }
/* Filtry (Období, Rok, Řazení) jsou jedna dlaždice v řadě s ostatními tlačítky; výběry se otevřou v okénku. */
html.compact-finance .cf-filtry-pop { position:fixed; z-index:1700; margin:0; padding:12px 14px; display:grid !important; grid-template-columns:1fr !important; gap:8px; background:#fff; border:1.5px solid #f4c9d1; border-radius:8px; box-shadow:0 8px 30px #13462430; box-sizing:border-box; }
html.compact-finance .cf-filtry-pop[hidden] { display:none !important; }
html.compact-finance .cf-filtry-pop .cf-filter { display:grid !important; grid-template-columns:90px 1fr !important; height:44px !important; padding:0 10px !important; background:#fff !important; }
html.compact-finance .cf-filtry-pop .cf-filter-label { font-size:13px !important; }
html.compact-finance .cf-filtry-btn.aktivni { border-color:var(--accent) !important; }
html.compact-finance #header-row2 .header-left-group { grid-template-columns:minmax(100px,1fr) repeat(5,minmax(0,1fr)) !important; }
@media (min-width:1101px) { html.compact-finance #header-row2 .header-left-group { grid-template-columns:130px repeat(5,minmax(0,1fr)) 130px !important; } }
@media (max-width:600px) { html.compact-finance #header-row2 .header-left-group { grid-template-columns:repeat(6,minmax(0,1fr)) !important; } html.compact-finance #header-row2 .header-left-group > .cf-heading { grid-column:1 / -1; } html.compact-finance #header-row2 .header-left-group > :not(.cf-heading) { grid-column:span 2; } html.compact-finance #header-row2 .header-left-group > #global-search-btn, html.compact-finance #header-row2 .header-left-group > #fin-export-btn { grid-column:span 2; } }
html.compact-finance #header-row2 .header-left-group > .cf-filtry-btn { order:20; }
@media (max-width:600px) { html.compact-finance #header-row2 .header-left-group > #fin-export-btn, html.compact-finance #header-row2 .header-left-group > .cf-filtry-btn { grid-column:span 3 !important; } }
html.compact-finance .cf-filtry-pop .cf-filter { grid-template-columns:90px minmax(0,1fr) !important; grid-template-rows:auto !important; align-items:center; gap:8px !important; height:48px !important; }
html.compact-finance .cf-filtry-pop .cf-filter select { height:40px !important; font-size:16px !important; }
html.compact-finance .cf-filtry-pop .cf-filter-label { font-size:13px !important; line-height:1.2 !important; max-height:none !important; }
/* Filtry: úzká nabídka pod tlačítkem; klepnutí na řádek otevře jeho krátký seznam. */
html.compact-finance .cf-filtry-zdroj { display:none !important; }
html.compact-finance .cf-filtry-pop { padding:4px !important; gap:0 !important; display:flex !important; flex-direction:column; border-radius:8px; }
html.compact-finance .cf-filtry-pop[hidden] { display:none !important; }
html.compact-finance .cf-menu-radek { box-sizing:border-box; height:44px; padding:0 12px; border:0; border-radius:6px; background:none; color:#4d0f1a; font:600 14px 'IBM Plex Sans',sans-serif; text-align:left; cursor:pointer; white-space:nowrap; }
html.compact-finance .cf-menu-radek:hover { background:#fde9ec; }
html.compact-finance .cf-menu-radek.ck { background:#fde9ec; color:#962d43; font-weight:700; }
html.compact-finance .cf-menu-zpet { color:#934c59; border-bottom:1px solid #f4c9d1; border-radius:6px 6px 0 0; }
/* Mezery mezi bloky Financí: všude 6 px. */
html.compact-finance #tab-platby, html.compact-finance .cf-ledger { gap:6px; }
html.compact-finance #tab-platby .cf-dluhy { margin:0 !important; }
html.compact-finance #tab-platby .income-total-bar { margin:0 !important; }
/* Telefon: popisky dlaždic čísel začínají u všech ve stejné výšce. */
@media (max-width:600px) { html.compact-finance .cf-overview > .cf-stat { align-content:flex-start !important; } }
/* Bez nadpisu „Finance“; pět tlačítek je roztažených přes celý řádek. */
html.compact-finance .cf-heading { display:none !important; }
@media (min-width:601px) { html.compact-finance #header-row2 .header-left-group { grid-template-columns:repeat(5,minmax(0,1fr)) !important; gap:6px; } }
/* Finance: i vnitřní okraje dlaždic a řádků 6 px. */
html.compact-finance header { gap:6px !important; }
html.compact-finance #tab-platby .cf-overview > .cf-stat { padding:6px !important; }
html.compact-finance #tab-platby .cf-dluh { padding:6px !important; }
html.compact-finance .cf-view { padding:6px !important; }
html.compact-finance .cf-ledger .cf-view, html.compact-finance .cf-month-cards .cf-view, html.compact-finance .cf-card > .cf-view { padding:0 6px !important; gap:6px !important; column-gap:6px !important; }
@media (max-width:600px) { html.compact-finance .cf-ledger .cf-view, html.compact-finance .cf-month-cards .cf-view, html.compact-finance .cf-card > .cf-view { padding:6px !important; gap:6px !important; } }
/* Částky v dlaždicích se zmenšují podle místa (nesmí přetéct). */
html.compact-finance .cf-stat-value .castky-mrizka, html.compact-finance .cf-stat-value .castky-mrizka * { font-size:inherit !important; }
/* Částky: každá měna na vlastním řádku, aby se vešla i velká čísla. */
html.compact-finance .cf-stat-value .castky-mrizka { display:grid !important; grid-template-columns:max-content max-content max-content; justify-content:start !important; column-gap:0 !important; }
html.compact-finance .cf-stat-value .castky-mrizka > span:nth-child(3n+1):not(:first-child) { margin-left:0 !important; }
/* Částky v horních dlaždicích jsou zarovnané doprava, popisky vlevo. */
html.compact-finance .cf-stat-value { justify-content:flex-end !important; text-align:right !important; }
html.compact-finance .cf-stat-value .castky-mrizka { justify-content:end !important; margin-left:auto !important; }
html.compact-finance .cf-stat-value .castky-mrizka > span { text-align:right !important; }
/* Bez vysvětlujících popisků v dlaždicích (po vrácení plateb, příjmy – výdaje). */
html.compact-finance .cf-stat-hint { display:none !important; }
html.compact-finance .cf-overview > .cf-stat { align-content:flex-start !important; }
/* Záznamy: stejné dvouřádkové karty na PC i telefonu, pevná písma. */
html.compact-finance .cf-month-cards .cf-name { font-size:14px !important; }
html.compact-finance .cf-month-cards .cf-meta { font-size:11px !important; }
html.compact-finance .cf-month-cards .cf-amount { font-size:14px !important; }
html.compact-finance .cf-month-cards .cf-detail { font-size:12px !important; }
@media (min-width:601px) {
  html.compact-finance .cf-month-cards { display:grid !important; grid-template-columns:repeat(3,minmax(0,1fr)); gap:6px !important; border:0 !important; background:none !important; box-shadow:none !important; overflow:visible !important; }
  html.compact-finance .cf-month-cards > .cf-card { height:60px !important; border:1.5px solid var(--pearl-edge) !important; border-radius:6px !important; background:var(--pearl-face) !important; box-shadow:inset 1px 1px 0 var(--pearl-light), inset -1px -1px 0 var(--pearl-shade), 0 2px 5px var(--pearl-shadow) !important; }
  html.compact-finance .cf-month-cards > .cf-card:first-child { border-top:1.5px solid var(--pearl-edge) !important; }
  html.compact-finance .cf-month-cards > .cf-card[data-cf-record*="refund"] { background:linear-gradient(135deg,rgba(165,36,60,.07),rgba(165,36,60,.02)) !important; }
  html.compact-finance .cf-month-cards .cf-view { grid-template-columns:minmax(0,1fr) auto 70px !important; grid-template-rows:auto auto !important; gap:2px 6px !important; padding:6px !important; }
  html.compact-finance .cf-month-cards .cf-name { grid-area:1 / 1 / 2 / 3 !important; }
  html.compact-finance .cf-month-cards .cf-meta { grid-area:2 / 1 / 3 / 3 !important; }
  html.compact-finance .cf-month-cards .cf-paid { display:none !important; }
  html.compact-finance .cf-month-cards .cf-amount { grid-area:1 / 3 / 2 / 4 !important; }
  html.compact-finance .cf-month-cards .cf-detail { grid-area:2 / 3 / 3 / 4 !important; height:26px !important; }
}
@media (min-width:601px) and (max-width:999px) { html.compact-finance .cf-month-cards { grid-template-columns:repeat(2,minmax(0,1fr)); } }
/* Částka u záznamu: sloupec se přizpůsobí obsahu (−20 000 Kč se nevešlo do 70 px). */
@media (min-width:601px) { html.compact-finance .cf-month-cards .cf-view { grid-template-columns:minmax(0,1fr) auto auto !important; } html.compact-finance .cf-month-cards .cf-detail { width:74px; justify-self:end; } html.compact-finance .cf-month-cards .cf-amount { padding-left:6px; text-align:right; } }

/* Finance: všechny mezery 4 px (PC i telefon). */
html.compact-finance header { gap:4px !important; margin-bottom:4px !important; }
html.compact-finance .logo, html.compact-finance .logo:has(#stanice-logo:not([style*="hidden"])), html.compact-preview.compact-finance header .logo, html.compact-preview.compact-finance header .logo:has(#stanice-logo:not([style*="hidden"])) { gap:4px !important; column-gap:4px !important; row-gap:4px !important; }
html.compact-finance .compact-statuses { gap:4px !important; }
html.compact-finance #header-row2, html.compact-finance #header-row2 .header-left-group { gap:4px !important; }
html.compact-finance .cf-filters { gap:4px !important; margin-top:4px !important; }
html.compact-finance #tab-platby, html.compact-finance .cf-ledger { gap:4px !important; }
html.compact-finance .cf-overview, html.compact-finance #tab-platby .cf-overview { gap:4px !important; }
html.compact-finance .cf-dluhy, html.compact-finance #tab-platby .cf-dluhy { gap:4px !important; margin:0 !important; }
html.compact-finance .cf-dluh { column-gap:4px !important; }
html.compact-finance .cf-months, html.compact-finance .cf-month { gap:4px !important; row-gap:4px !important; }
html.compact-finance .cf-month-heading { margin-bottom:4px !important; gap:4px !important; }
html.compact-finance .cf-month-cards { gap:4px !important; row-gap:4px !important; column-gap:4px !important; }
html.compact-finance .cf-view, html.compact-finance .cf-month-cards .cf-view { column-gap:4px !important; }
html.compact-finance .cf-month-cards .cf-view { padding:4px !important; row-gap:4px !important; }
html.compact-finance .cf-month-cards .cf-meta { align-self:start !important; }
@media (min-width:601px) { html.compact-finance .cf-month-cards .cf-view { grid-template-rows:17px 26px !important; } }
@media (max-width:600px) { html.compact-finance .cf-month-cards .cf-view { grid-template-rows:20px 28px !important; } }
html.compact-finance .cf-month-cards .cf-view :is(.cf-name,.cf-amount,.cf-meta,.cf-detail) { align-self:start !important; }
@media (min-width:601px) { html.compact-finance .cf-month-cards .cf-view :is(.cf-name,.cf-amount) { height:17px !important; line-height:17px !important; } }
@media (max-width:600px) { html.compact-finance .cf-month-cards .cf-view :is(.cf-name,.cf-amount) { height:20px !important; line-height:20px !important; } }
@media (max-width:600px) { html.compact-finance .cf-month-cards .cf-view { grid-template-columns:minmax(0,1fr) 0 max-content !important; } }
@media (max-width:600px) { html.compact-finance .cf-month-cards .cf-view .cf-detail { width:70px !important; justify-self:end !important; } html.compact-finance .cf-month-cards .cf-view .cf-amount { justify-self:end !important; width:auto !important; white-space:nowrap; } }

/* Finance: písmo podle společného měřítka --ts (základ ve Normální). */
html.compact-finance .cf-month-cards .cf-view :is(.cf-name,.cf-amount) { font-size:calc(14px * var(--ts)) !important; }
html.compact-finance .cf-meta { font-size:calc(11px * var(--ts)) !important; }
html.compact-finance .cf-detail { font-size:calc(12px * var(--ts)) !important; height:calc(26px * var(--ts)) !important; }
html.compact-finance .cf-month-heading h3 { font-size:calc(16px * var(--ts)) !important; }
html.compact-finance .cf-dluh-jmeno { font-size:calc(12.5px * var(--ts)) !important; }
html.compact-finance .cf-dluh .b, html.compact-finance .cf-dluh b { font-size:calc(14px * var(--ts)) !important; }
html.compact-finance .cf-dluh-stav { font-size:calc(11px * var(--ts)) !important; }
html.compact-finance .cf-dluh { height:auto !important; min-height:calc(44px * var(--ts)); }
@media (min-width:601px) {
  html.compact-finance .cf-month-cards .cf-view { grid-template-rows:calc(17px * var(--ts)) calc(26px * var(--ts)) !important; }
  html.compact-finance .cf-month-cards .cf-view :is(.cf-name,.cf-amount) { height:calc(17px * var(--ts)) !important; line-height:calc(17px * var(--ts)) !important; }
}
@media (max-width:600px) {
  html.compact-finance .cf-month-cards .cf-view { grid-template-rows:calc(20px * var(--ts)) calc(28px * var(--ts)) !important; }
  html.compact-finance .cf-month-cards .cf-view :is(.cf-name,.cf-amount) { height:calc(20px * var(--ts)) !important; line-height:calc(20px * var(--ts)) !important; }
  html.compact-finance .cf-month-cards .cf-view .cf-detail { width:calc(70px * var(--ts)) !important; }
}
html.compact-finance .cf-month-cards .cf-meta { font-size:calc(11px * var(--ts)) !important; }
html.compact-finance .cf-month-cards .cf-detail { font-size:calc(12px * var(--ts)) !important; height:calc(26px * var(--ts)) !important; }
html.compact-finance .cf-dluhy-nadpis { grid-column: 1 / -1; font-size: 11px; font-weight: 800; letter-spacing: .5px; text-transform: uppercase; color: var(--text2); }

/* Test 25. 10. 2026: na tabletu/PC se řádek „datum · způsob · Matka: …“ uřízl třemi tečkami a „Detail“ měl 23–30 px.
   Text se teď zalomí (žádné tři tečky), tlačítko Detail má aspoň 44 px na výšku. */
html.compact-finance .cf-month-cards .cf-meta { white-space: normal !important; overflow: visible !important; text-overflow: clip !important; overflow-wrap: anywhere; line-height: 1.35; }
html.compact-finance .cf-month-cards > .cf-card { height: auto !important; }
html.compact-finance .cf-month-cards .cf-view { grid-template-rows: auto auto !important; }
html.compact-finance .cf-month-cards .cf-view .cf-detail { height: 44px !important; min-height: 44px !important; align-self: end !important; display: flex; align-items: center; justify-content: center; white-space: normal; line-height: 1.15; padding: 2px 4px; }
/* Telefon: Detail vpravo přes oba řádky (44 px), částka vedle jména, popisek pod nimi – karta se zvětší jen o pár px. */
@media (max-width: 600px) {
  html.compact-finance .cf-month-cards .cf-view { grid-template-columns: minmax(0,1fr) max-content minmax(70px, max-content) !important; grid-template-rows: auto auto !important; }
  html.compact-finance .cf-month-cards .cf-view .cf-name { grid-area: 1 / 1 / 2 / 2 !important; }
  html.compact-finance .cf-month-cards .cf-view .cf-amount { grid-area: 1 / 2 / 2 / 3 !important; justify-self: end !important; }
  html.compact-finance .cf-month-cards .cf-view .cf-meta { grid-area: 2 / 1 / 3 / 3 !important; }
  html.compact-finance .cf-month-cards .cf-view .cf-detail { grid-area: 1 / 3 / 3 / 4 !important; height: auto !important; min-height: 44px !important; align-self: stretch !important; width: auto !important; min-width: 70px; }
}
/* Dlouhé názvy (např. „Darwin A1 · Vratka zálohy – zájemce odstoupil“) se zalomí; Detail se roztáhne podle textu (ruské „Подробнее ›“). */
html.compact-finance .cf-month-cards .cf-view .cf-name { white-space: normal !important; overflow: visible !important; text-overflow: clip !important; overflow-wrap: anywhere; height: auto !important; line-height: 1.25 !important; }
@media (min-width: 601px) { html.compact-finance .cf-month-cards .cf-view .cf-detail { width: auto !important; min-width: 74px; } }
/* Úzký telefon (≤ 360 px): stav (Rezervace…) v dlaždici K doplacení přes celou šířku, aby se nevytlačil ven velkým písmem. */
@media (max-width: 360px) {
  html.compact-finance .cf-dluh { grid-template-columns: minmax(0,1fr) !important; grid-template-rows: auto auto auto !important; height: auto !important; }
  html.compact-finance .cf-dluh .cf-dluh-jmeno { grid-column: 1 !important; grid-row: 1 !important; }
  html.compact-finance .cf-dluh .cf-dluh-stav { grid-column: 1 !important; grid-row: 2 !important; overflow-wrap: anywhere; }
  html.compact-finance .cf-dluh b { grid-column: 1 !important; grid-row: 3 !important; justify-self: start; }
}
