/* ======================= K2b-3: Pulpit and Ustawienia → Pulpit (spec K2 §17.12c; mockup k2b-1.html "K2b-3 — podgląd") ======================= */
/* header: "Dzień dobry, <imię> · <data>" (K2-Q46), "Pulpit", ⋯ (phone) / "+ Dodaj" ⋯ (desktop, top right) */
.home-top { align-items: flex-end; }
.home-top .title { min-width: 0; flex: 1 1 auto; font-size: 30px; }
.home-top .title small.home-line { display: flex; gap: .4em; min-width: 0; white-space: nowrap; }
#home-hello { flex: none; }
#home-date { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
/* r3: too long for one line (screens-home.js fitHomeLine) - the date on the second line, nothing cut */
.home-top .title small.home-line.wrap { flex-direction: column; gap: 4px; white-space: normal; }
.home-line.wrap #home-hello { overflow-wrap: anywhere; line-height: 1.2; }
.home-line.wrap #home-date { overflow: visible; line-height: 1.2; }
.home-line.wrap #home-date .hsep { display: none; }
.home-top .top-acts { flex: none; flex-wrap: nowrap; align-items: center; gap: 6px; }
/* r3: "+ Dodaj" (addEntryBtn, the same button as Transakcje) only on the desktop - the phone has "+" in the nav */
@media (max-width: 999px) { #p-home [data-role=screen-add] { display: none; } }
.home-menu .menu-list button { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 48px; padding: 0 10px; border-radius: 8px; font-size: 14.5px; text-align: left; }
.home-menu .menu-list button:hover { background: var(--paper-2); }
.home-menu .menu-list .icon { width: 18px; height: 18px; }

/* columns: one on the phone, always 2 independent stacks on the desktop from the layout "Komputer" (K2b-3r F4) */
.home-body { padding-bottom: 16px; }
.dcols { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; align-items: start; }
.dcol { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.home-body.stale .big, .home-body.stale .kpi b, .home-body.stale .mid, .home-body.stale .crows,
.home-body.stale [data-tile=accounts] .mono, .home-body.stale .hwait .mono { opacity: .5; }

/* cards */
.hcard { background: var(--card); border: 1px solid var(--rule); border-radius: 18px; box-shadow: var(--shadow); padding: 4px 14px 12px; min-width: 0; }
.hcard.pad0 { padding: 0; }
.hc-h { display: flex; align-items: center; gap: 2px; min-height: 44px; }
.hc-h .label { flex: 1; min-width: 0; }
.hc-h .grow { flex: 1; }
.hc-h .ibtn { width: 44px; height: 44px; font-size: 22px; line-height: 1; }
.hc-h .ibtn:disabled { color: var(--rule-2); cursor: default; }
.mt { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; padding: 0 4px; font-size: 15px; font-weight: 600; white-space: nowrap; color: var(--ink); }
.mt i { font-style: normal; font-size: 12px; color: var(--ink-3); }
.hlab-row { display: flex; align-items: center; gap: 8px; min-height: 22px; }
.hlab { flex: 1; font-size: 13px; color: var(--ink-2); }
.hlab-row .chip.cur { flex: none; font-size: 12.5px; padding: 0 12px; }
.big { font: 500 40px/1.1 var(--mono); letter-spacing: -.04em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.big.neg, .mid.neg { color: var(--red); }
.mid { display: inline-flex; align-items: center; min-height: 44px; font: 500 28px/1.15 var(--mono); letter-spacing: -.03em; white-space: nowrap; color: var(--ink); text-decoration: none; }
.hsub { font-size: 12.5px; color: var(--ink-3); }
.hcard .info-text { margin: 0 0 6px; }

/* KPI cells: three buttons with › (inactive: aria-disabled, no ›) */
.kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-top: 12px; }
.kpi {
  display: flex; flex-direction: column; justify-content: center; align-items: flex-start; min-height: 64px; padding: 6px 10px; border-radius: 12px;
  background: var(--paper); border: 1px solid var(--rule); text-align: left; min-width: 0; color: var(--ink);
}
.kpi .l { font-size: 11.5px; color: var(--ink-3); }
.kpi b { font: 600 17px var(--mono); letter-spacing: -.03em; white-space: nowrap; display: flex; align-items: center; gap: 3px; max-width: 100%; }
.kpi b .chv { font: 400 15px var(--sans); color: var(--ink-3); }
.kpi small { font-size: 11px; color: var(--ink-3); line-height: 1.15; white-space: normal; max-width: 100%; }
.kpi[aria-disabled=true] { cursor: default; }
@media (hover: hover) { .kpi:not([aria-disabled=true]):hover { border-color: var(--rule-2); } }

/* Poczekalnia: "Tylko suma" = the compact row 60; empty = a quiet row 52 (UX-Q10); with entries = rows as "Ostatnie" */
.hwait { display: flex; align-items: center; gap: 10px; min-height: 60px; width: 100%; text-align: left; padding: 0 14px; color: var(--ink); text-decoration: none; }
.hwait .t { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.hwait .t b { font-size: 14.5px; font-weight: 600; }
.hwait .t span { font-size: 12px; color: var(--ink-3); }
.hwait .mono { font-size: 15px; white-space: nowrap; }
.hwait .chv { color: var(--ink-3); font-size: 18px; }
.hwait.empty { min-height: 52px; cursor: default; }
.hwait.empty .tile { background: var(--paper-2); color: var(--ink-3); opacity: .7; }
.hwait.empty .t b { font-weight: 500; }
.hwait.empty .st { font-size: 13.5px; color: var(--ink-2); }
.wsum { display: flex; align-items: center; gap: 4px; min-height: 24px; font-size: 13px; color: var(--ink-2); margin-top: -6px; padding-bottom: 2px; border-bottom: 1px solid var(--rule); }
.wsum .mono { font-size: 13px; color: var(--ink-2); }
/* line 2 of a row of Poczekalnia: "12.11 · Jedzenie · Konto główne" - the date and the category whole, the account cut */
.home-wait .c-su .d { flex: none; }
.home-wait .c-su .t:not(.an) { flex: none; max-width: 45%; }
.home-body.stale .wsum .mono, .home-body.stale .home-wait .c-am { opacity: .5; }

/* Wydatki: rows 44 with a 4 px bar against the biggest */
.crow2 {
  display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; grid-template-rows: auto 4px; column-gap: 10px; align-items: center; min-height: 44px;
  padding: 4px 0; border-top: 1px solid var(--rule); width: 100%; text-align: left; color: var(--ink); text-decoration: none;
}
.crows .crow2:first-child { border-top: 0; }
.crow2 .tile { grid-row: 1 / 3; }
.crow2 .n { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crow2 .a { font-size: 14px; white-space: nowrap; text-align: right; }
.crow2 .a small { font: 11.5px var(--sans); color: var(--ink-3); margin-left: 4px; }
.crow2 .a.neg { color: var(--ink-2); }
.crow2 .bar { grid-column: 2 / 4; height: 4px; border-radius: 99px; background: var(--paper-2); overflow: hidden; }
.crow2 .bar i { display: block; height: 100%; background: var(--ink-2); border-radius: 99px; }
.more-l {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px; min-width: 44px; font-size: 13.5px; color: var(--ink-2);
  text-decoration: underline; text-underline-offset: 3px;
}
.h-empty { padding: 4px 0 6px; font-size: 13.5px; color: var(--ink-2); }

/* Konta */
.hr { display: flex; align-items: center; gap: 10px; min-height: 44px; border-top: 1px solid var(--rule); font-size: 14px; width: 100%; color: var(--ink); text-decoration: none; }
.hc-h + .hr { border-top: 0; }
.hr .t { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hr .t small { display: block; font-size: 11.5px; color: var(--ink-3); line-height: 1.1; }
.hr .mono { font-size: 14px; white-space: nowrap; }
.hr .mono.neg { color: var(--red); }

/* Ostatnie: rows as in the list (grosze, pills) */
.home-recent .trow:last-child { border-bottom: 0; }

/* first run, error */
.empty-c { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; padding: 16px 14px; }
.empty-c p { font-size: 15px; color: var(--ink-2); }

/* KPI windows: phone sheet (max 75 %), desktop popover 360 */
dialog.sheet.kpi-sheet[open] { display: flex; flex-direction: column; max-height: 75vh; overflow: hidden; padding: 20px 0 calc(8px + env(safe-area-inset-bottom)); }
.kpi-sheet .sheet-head { flex: none; padding: 0 6px 0 18px; margin: 0; }
.kpi-sheet .sheet-head h2 { font: 13px var(--sans); color: var(--ink-2); margin: 0; }
.kpi-sheet .sheet-head h2:focus { outline: none; }
.kpi-sheet .sheet-head h2:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.kpi-sheet .sheet-body { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.kh-sum { flex: none; display: flex; flex-direction: column; padding: 0 18px 8px; }
.kh-sum .s { font: 500 28px/1.15 var(--mono); letter-spacing: -.03em; white-space: nowrap; }
.kh-sum .s2 { font-size: 12.5px; color: var(--ink-2); }
.krows { flex: 1 1 auto; min-height: 0; overflow-y: auto; scrollbar-width: thin; }
.krow { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 4px 18px; border-top: 1px solid var(--rule); color: var(--ink); width: 100%; text-align: left; text-decoration: none; }
.krow .t { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.krow .t b { font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.krow .t span { font-size: 12px; color: var(--ink-2); display: flex; align-items: center; gap: 4px; }
.krow .t span .icon { width: 14px; height: 14px; color: var(--ink-2); }
.krow .a { display: flex; flex-direction: column; align-items: flex-end; flex: none; }
.krow .a .mono { font: 500 15px var(--mono); white-space: nowrap; }
.krow .a .mono.neg { color: var(--ink-2); }
.krow .a small { font-size: 11.5px; color: var(--ink-3); white-space: nowrap; }
.krow .chv { width: 12px; color: var(--ink-3); font-size: 18px; flex: none; text-align: center; }
.krow.note { background: var(--paper-2); }
.krow.note .t b { font-weight: 500; }
@media (hover: hover) { a.krow:hover { background: color-mix(in srgb, var(--paper-2) 70%, transparent); } }
.k-empty { padding: 12px 18px; }
.kf44 { flex: none; display: flex; align-items: center; min-height: 44px; padding: 0 18px; border-top: 1px solid var(--rule); }
.kf44 a { display: inline-flex; align-items: center; min-height: 44px; font-size: 14px; font-weight: 600; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.pop.kpop { padding: 8px 0 0; display: flex; flex-direction: column; max-height: min(520px, calc(100vh - 120px)); overflow: hidden; }
.kpop .kh2 { flex: none; padding: 0 18px 4px; }
.kpop .kh2 .t { display: flex; flex-direction: column; }
.kpop .kh2 .t:focus { outline: none; }
.kpop .kh2 .t:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.kpop .kh2 .l { font-size: 13px; color: var(--ink-2); }
.kpop .kh-sum { padding: 0; }

/* Ustawienia → Pulpit (§20.1, §23.3, §23.4): rows 56 [handle 44] ([icon 20]) [name / sub] [chip] ([↑ ↓]) [switch 52] */
.stitle { display: flex; align-items: center; gap: 2px; min-height: 52px; }
.stitle .title { font-size: 28px; }
.saved-st { margin-left: auto; font-size: 12px; color: var(--ink-2); padding-right: 8px; min-width: 60px; text-align: right; }
.ds-head h2 { flex: none; }
.ds-head .saved-st { margin-left: 8px; }
.ds-head .btn { margin-left: auto; min-height: 44px; }
.ulist { margin-top: 4px; background: var(--card); border: 1px solid var(--rule); border-radius: 18px; box-shadow: var(--shadow); padding: 0 6px 0 2px; position: relative; }
.urow { display: grid; grid-template-columns: 44px minmax(0, 1fr) 52px; align-items: center; column-gap: 4px; min-height: 56px; border-top: 1px solid var(--rule); background: var(--card); }
.urow:first-child { border-top: 0; }
.uh { width: 44px; height: 44px; display: grid; place-items: center; color: var(--ink-3); border-radius: 10px; touch-action: none; cursor: grab; }
.uh .icon { width: 18px; height: 18px; }
.uh svg { width: 100%; height: 100%; }
.uh.lock { cursor: default; }
.uh.lock .icon { width: 16px; height: 16px; }
.urow .n { display: flex; flex-direction: column; min-width: 0; align-items: flex-start; }
.urow .n b { font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.urow .n > span { font-size: 12px; color: var(--ink-3); line-height: 1.2; }
.urow.off .n b { color: var(--ink-2); font-weight: 500; }
.urow .sp { width: 52px; }
.swb { width: 52px; height: 44px; display: grid; place-items: center; flex: none; border-radius: 12px; }
.sw { position: relative; display: block; width: 48px; height: 28px; border-radius: 99px; background: var(--rule-2); }
.sw::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 99px; background: var(--card); box-shadow: 0 1px 3px #0005; transition: left .12s; }
.swb[aria-checked=true] .sw { background: var(--ink); }
.swb[aria-checked=true] .sw::after { left: 23px; background: var(--paper); }
.ulist.dragging .urow:not(.lifted) { transition: transform .12s ease-out; }
.urow.lifted { position: relative; z-index: 3; border-radius: 12px; border-top-color: transparent; box-shadow: 0 22px 44px -18px #000b, 0 0 0 1px var(--rule-2); cursor: grabbing; }
.ureset { width: 100%; margin-top: 12px; min-height: 44px; justify-content: center; }
.urow .ar { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 10px; color: var(--ink-2); }
.urow .ar .icon { width: 18px; height: 18px; }
.urow .ar svg { width: 100%; height: 100%; }
.urow .ar:disabled { color: var(--rule-2); cursor: default; }
@media (hover: hover) { .urow .ar:not(:disabled):hover, .uh:not(.lock):hover { background: var(--paper-2); } }
.urow.u2 { grid-template-columns: 44px minmax(100px, 1fr) auto 52px; }
.urow.u2.dk2 { grid-template-columns: 44px 20px minmax(100px, 1fr) auto 52px; }
.urow.u2.ar2 { grid-template-columns: 44px 20px minmax(100px, 1fr) auto 44px 44px 52px; }
.urow.u2 > .icon { color: var(--ink-2); width: 20px; height: 20px; }
/* §23.3 the chip of the tile details: 32 px to see, 44 px to hit; dimmed (still active) when the tile is off */
.chipw { display: inline-flex; align-items: center; justify-content: flex-end; min-height: 44px; min-width: 44px; padding: 0 2px; flex: none; }
.chipw .chip.sel { min-height: 32px; height: 32px; padding: 0 9px 0 12px; border-radius: 16px; border: 1px solid var(--rule-2); font-size: 13px; color: var(--ink); background: var(--card); gap: 0; }
.chipw .cv { font-size: 10px; color: var(--ink-3); white-space: pre; }
.chipw.dim .chip { opacity: .6; }
@media (hover: hover) { .chipw:hover .chip.sel { border-color: var(--ink-2); } }
.nochip { width: 0; }
/* §23.4 desktop: the tabs Komputer · Telefon, two columns (drop places), the phone list 560 */
.useg { margin: 2px 0 16px; }
.useg button { min-height: 44px; padding: 0 16px; }
.useg button[aria-selected=true] { background: var(--ink); color: var(--paper); }
.ucols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.ucol { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.ucol > .label { padding-left: 4px; }
.ulist.desk2 { margin: 0; padding: 0 6px 0 2px; }
.ulist.slot { padding-bottom: 56px; }
.ucol.over .ulist.desk2 { background: var(--paper-2); }
.ucol.over .urow:not(.lifted) { background: transparent; }
/* on --paper-2 the secondary text is --ink-2 (--ink-3 there = 4,40 : 1 in the light theme, T-K2-30) */
.ucol.over .urow .n > span { color: var(--ink-2); }
.ulist.w560 { width: 560px; max-width: 100%; margin: 0; }
.uempty {
  display: flex; align-items: center; justify-content: center; min-height: 56px; margin: 5px 0; border: 1.5px dashed var(--rule-2); border-radius: 12px;
  font-size: 13px; color: var(--ink-2);
}
.urow.lifted.u2 { background: var(--card); }

@media (min-width: 1000px) {
  .home-top .title { font-size: 26px; }
  /* F4 (UX-Q13): two columns at most 720 px each with a 40 px gap, max. 1480 px, left aligned (no third column) */
  .dcols.c2 { grid-template-columns: repeat(2, minmax(0, 720px)); gap: 18px 40px; max-width: 1480px; }
  .dcols .dcol { gap: 18px; }
  .hcard { padding: 6px 18px 14px; }
  .hcard.pad0 { padding: 0; }
  .big { font-size: 46px; }
  .home-body { padding-bottom: 20px; }
}

/* ======================= K2b-3r F1: the context menu of an entry (K2b_UX §23.1; mockup k2b-3r.html C6–C9) ======================= */
/* the row for the time of the menu: --paper-2 with a 1 px outline; its secondary text in --ink-2 (T-K2-30) */
.trow.ctx, .trow.ctx:hover, .row.ctx { background: var(--paper-2); box-shadow: inset 0 0 0 1px var(--rule-2); }
.trow.ctx .c-su, .trow.ctx .c-ca, .trow.ctx .c-ac, .trow.ctx .c-am.muted, .row.ctx .t span { color: var(--ink-2); }
/* the menu at the point: fixed, 240 px (left / top through CSSOM) */
.menu.action-menu.ctx-menu { position: fixed; right: auto; top: auto; width: 240px; min-width: 0; z-index: 40; }
.ctx-menu .menu-list button { gap: 10px; padding: 0 10px; border-radius: 8px; color: var(--ink); }
.ctx-menu .menu-list .icon { width: 16px; height: 16px; flex: none; color: var(--ink-2); }
.ctx-menu .menu-list button.danger, .ctx-menu .menu-list button.danger .icon { color: var(--red); }
.ctx-menu .menu-list button:has(> .lbl.armed) { background: var(--red); color: var(--on-red); font-weight: 600; }
.ctx-menu .menu-list button:has(> .lbl.armed) .icon { color: var(--on-red); }
.ctx-menu .menu-list button:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; background: var(--paper-2); }
.ctx-menu .msep { height: 1px; background: var(--rule); margin: 4px 6px; }
