/* ======================= K2a / K2a-UX: navigation, entry form, transactions (spec K2 §8, §16) ======================= */
/* navigation: phone "Pulpit · Transakcje · [+] · Więcej" (M1: rotated square), desktop "+ Dodaj" top right */
.bottom {
  grid-template-columns: repeat(4, 1fr); align-items: end; background: var(--paper); border-top: 1px solid var(--rule);
  padding: 6px 10px calc(8px + env(safe-area-inset-bottom));
}
.bottom .plus-btn { justify-content: center; padding: 0; }
.plus {
  width: 54px; height: 54px; margin: -16px auto 0; border-radius: 17px; background: var(--red); color: var(--on-red); display: grid;
  place-items: center; box-shadow: 0 12px 24px -10px var(--red); transform: rotate(-10deg);
}
.plus .icon { transform: rotate(10deg); }
.bottom .plus .icon { width: 26px; height: 26px; }
.btn.add { background: var(--red); color: var(--on-red); min-height: 48px; padding: 0 22px 0 18px; font-size: 15px; border-radius: 14px; gap: 8px; min-width: 120px; }
.btn.add .icon { width: 20px; height: 20px; }
/* P1 (r5, mockup R7): the main action of a screen ("+ Konto", "+ Projekt", "+ Kategoria", "+ Reguła") = the size of
   "+ Dodaj" in ink; red only for "+ Dodaj" of an entry */
.btn.add.ink { background: var(--ink); color: var(--paper); }
@media (max-width: 999px) { .btn.add { min-height: 44px; } }
.side .kbd { font: 11px var(--mono); border: 1px solid var(--rule-2); border-radius: 5px; padding: 0 5px; margin-left: auto; color: var(--ink-3); }
#p-home .top-acts { margin-left: auto; }

/* sheets: drag handle (phone), popovers (desktop) */
.sheet-head { position: relative; }
.sheet-head .grabber { position: absolute; top: -13px; left: 50%; width: 36px; height: 4px; margin-left: -18px; border-radius: 9px; background: var(--rule-2); }
dialog.sheet.full > .sheet-head .grabber { display: none; }
/* desktop: sheets are windows in the middle - no drag handle */
@media (min-width: 1000px) { .sheet-head .grabber { display: none; } }
dialog.sheet.dragging { transition: none; }
dialog.sheet:not(.dragging) { transition: transform .15s ease-out; }
.sheet-head { touch-action: none; }
.pop {
  position: fixed; z-index: 80; background: var(--card); color: var(--ink); border: 1px solid var(--rule-2); border-radius: 16px;
  padding: 10px 12px 12px; box-shadow: 0 24px 60px -24px #000b; max-height: calc(100vh - 16px); overflow: auto;
}
.pop.pop-list { padding: 4px 6px; }
.pop .menu-list button { min-height: 48px; border-bottom: 1px solid var(--rule); padding: 0 8px; display: flex; gap: 10px; align-items: center; width: 100%; text-align: left; border-radius: 8px; }
.pop .menu-list button:last-child { border-bottom: 0; }

/* dropdown-like buttons ("Konto ▾", "Filtry") */
.dd {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 12px; border-radius: 12px;
  border: 1px solid var(--rule-2); background: var(--card); font-size: 13.5px; color: var(--ink); white-space: nowrap;
  min-width: 0; max-width: 100%;
}
.dd .icon { width: 16px; height: 16px; color: var(--ink-2); }
.dd .tile .icon { color: inherit; }
.dd .dd-t { overflow: hidden; text-overflow: ellipsis; min-width: 0; flex: 1; text-align: left; }
.dd .cv { color: var(--ink-3); font-size: 11px; }
.dd.on { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.dd .n { font: 600 10px var(--mono); background: var(--ink); color: var(--paper); border-radius: 99px; padding: 1px 6px; }
.chip.on { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.chip.cat .tile.sm { width: 28px; height: 28px; border-radius: 99px; }
.chip.cat.on .tile { box-shadow: 0 0 0 2px var(--paper); }
.tile.xs { width: 24px; height: 24px; border-radius: 99px; }
.tile.xs .icon { width: 14px; height: 14px; }
.chip.sug { border-style: dashed; border-color: var(--ink); }
.chip .chev { font-size: 16px; color: var(--ink-3); margin-left: 1px; }
.chip.on .chev { color: var(--paper); }
.chip.up { font-weight: 600; }

/* status pills 22 px: icon 16 + label (§16.14) */
.spill {
  display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 7px 0 5px; border-radius: 99px; font-size: 11.5px;
  white-space: nowrap; background: var(--paper-2); color: var(--ink-2); flex: none;
}
.spill .icon { width: 16px; height: 16px; }
.spill.wait { background: var(--amber-soft); color: var(--amber); }
.spill.out { background: var(--red-soft); color: var(--red); }
.spill.mon { background: color-mix(in srgb, var(--s1) 14%, var(--card)); color: var(--s1); }
.spill.more { padding: 0 7px; font-family: var(--mono); }

/* own calendar and month grid (§16.10) */
.cal-head { display: flex; align-items: center; gap: 2px; min-height: 44px; }
.cal-head .mt { flex: 1; text-align: left; font-family: var(--serif); font-size: 19px; padding: 0 6px; min-height: 44px; border-radius: 10px; }
.cal-head .mt i { font-style: normal; font-size: 13px; color: var(--ink-3); margin-left: 4px; }
.cal-head .ibtn { font-size: 22px; }
.cal-quick { display: flex; gap: 6px; margin: 2px 0 6px; flex-wrap: wrap; }
.cal-wd { display: grid; grid-template-columns: repeat(7, 1fr); }
.cal-wd span { text-align: center; font-size: 11px; color: var(--ink-3); height: 22px; line-height: 22px; letter-spacing: .06em; }
.cal-g [role=row] { display: grid; grid-template-columns: repeat(7, 1fr); }
.cal-g [role=gridcell] { display: grid; place-items: center; min-height: 44px; }
.cal-g button { width: 44px; height: 44px; border-radius: 99px; font: 500 15px var(--mono); }
.cal-g button:hover { background: var(--paper-2); }
.cal-g button.today { box-shadow: inset 0 0 0 1.5px var(--ink); }
.cal-g button.sel { background: var(--ink); color: var(--paper); }
.cal-g button.sel.today { box-shadow: inset 0 0 0 1.5px var(--ink), inset 0 0 0 3px var(--paper); }
.cal-g button.we { color: var(--red); }
.cal-g button[aria-disabled=true] { color: var(--rule-2); cursor: default; background: none; }
.mg-head { display: flex; align-items: center; justify-content: space-between; min-height: 44px; }
.mg-head b { font: 600 16px var(--mono); }
.mg-head .ibtn { font-size: 22px; }
.mg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 6px; }
.mg button { min-height: 48px; border-radius: 12px; font-size: 14px; border: 1px solid transparent; }
.mg button:hover { background: var(--paper-2); }
.mg button.cur { border-color: var(--ink); }
.mg button.sel { background: var(--ink); color: var(--paper); font-weight: 600; }
.mg button[aria-disabled=true] { color: var(--rule-2); cursor: default; background: none; }
.mg-foot { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.mg-foot .chip[aria-pressed=true] { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* date field of forms: text "20.11.2026" + calendar button */
.datef {
  display: flex; align-items: center; border: 1px solid var(--rule-2); border-radius: 12px; background: var(--card); min-height: 48px;
  padding-left: 12px; min-width: 0;
}
.datef:focus-within { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.field .datef input, .datef input {
  flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font: 500 15px var(--mono); min-height: 44px; padding: 0; border-radius: 0;
}
.datef .ibtn .icon { width: 18px; height: 18px; }
.field .datef input[aria-invalid=true] { color: var(--red); }
.period { border: 0; min-width: 0; }
.period legend { font-size: 12.5px; color: var(--ink-2); margin-bottom: 6px; }

/* ---------- entry form - phone: bottom sheet up to 763 px, no scrolling (§16.10, K2a_UX pkt 16) ---------- */
dialog.sheet.entry-sheet { padding: 0; background: var(--paper); overflow: hidden; }
dialog.sheet.entry-sheet.full { margin: auto 0 0; height: min(763px, 100%); max-height: 100%; border-radius: 22px 22px 0 0; }
dialog.sheet.entry-sheet[open] { display: flex; flex-direction: column; }
.entry-sheet > .sheet-head { flex: none; height: 44px; margin: 0; padding: 0 2px 0 16px; gap: 2px; cursor: grab; }
.entry-sheet > .sheet-head .grabber { display: block; top: 5px; }
.entry-sheet > .sheet-head h2 { font-size: 19px; margin: 0; line-height: 1; }
.entry-sheet .e-off { color: var(--amber); }
.entry-sheet > .sheet-body { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
form.entry { position: relative; flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; gap: 6px; }
.e-row { flex: none; padding: 0 14px; }
.e-types-row { height: 50px; display: flex; align-items: center; gap: 10px; }
.e-types { width: 100%; border-radius: 13px; }
.e-types button { flex: 1; border-radius: 10px; font-size: 14px; }
.e-types button[aria-pressed=true] { font-weight: 600; }
.e-amount { height: 58px; display: flex; align-items: center; justify-content: flex-end; gap: 6px; }
.e-amt { display: flex; align-items: baseline; justify-content: flex-end; gap: 6px; width: 100%; height: 100%; padding: 6px; border-radius: 12px; }
.e-amt .v { font: 500 42px/1 var(--mono); letter-spacing: -.05em; overflow: hidden; text-overflow: ellipsis; }
.e-amt.exp .v { color: var(--red); }
.e-amt.inc .v { color: var(--green); }
.e-amt .v.zero { color: var(--rule-2); }
.e-amt.sel { box-shadow: inset 0 0 0 2px var(--ink); }
.e-amt .cur, .e-types-row .cur { font-size: 18px; color: var(--ink-3); }
.e-desc { height: 46px; display: flex; align-items: center; margin: 0 14px; padding: 0; border-bottom: 1px solid var(--rule-2); }
.e-desc-in { flex: 1; min-width: 0; height: 44px; border: 0; background: transparent; outline: 0; font-size: 17px; padding: 0 4px; }
.e-desc-in:focus-visible { box-shadow: 0 2px 0 var(--ink); }
.e-dyn { flex: 1 1 auto; min-height: 0; overflow: hidden; display: flex; flex-direction: column; gap: 6px; padding: 2px 14px 0; }
.e-dyn > * { flex: none; }
/* category grid: chips wrap; rows that do not fit are hidden by fitChips() */
.e-catrow {
  flex: 1 1 auto; min-height: 0; overflow: hidden; display: flex; flex-wrap: wrap; align-content: flex-start; gap: 6px; padding-top: 2px;
}
.e-catrow .chip { flex: none; max-width: 100%; }
.e-catrow .chip .cn { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.e-catrow .chip.cat { padding: 0 12px 0 8px; }
/* "Konto · Data · Więcej": label 11 px above the value (1.5fr 1fr .9fr) */
/* r5 (mockup r2): 1.3fr 1fr .95fr so that "Notatka" / "Paragon +1" fit without an ellipsis */
.e-ctx { display: grid; grid-template-columns: 1.3fr 1fr .95fr; gap: 6px; height: 52px; min-width: 0; }
.ctx-b {
  display: flex; flex-direction: column; justify-content: center; align-items: flex-start; min-width: 0; min-height: 52px; padding: 0 10px;
  border-radius: 12px; border: 1px solid var(--rule-2); background: var(--card); text-align: left;
}
.ctx-b .ctx-l { font-size: 11px; color: var(--ink-3); line-height: 1.1; }
.ctx-b b { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; line-height: 1.3; }
.e-bud { display: flex; align-items: center; height: 44px; }
.e-bud .dd { flex: 0 1 auto; }
.e-info { min-height: 20px; font-size: 12.5px; line-height: 20px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.e-info.err { color: var(--red); white-space: normal; }
.e-info.warn-t { color: var(--amber); }
.keypad {
  flex: none; display: grid; grid-template-columns: repeat(3, 1fr); grid-auto-rows: 52px; height: 208px;
  border-top: 1px solid var(--rule); background: var(--paper);
}
.keypad button { font: 500 22px var(--mono); border-left: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.keypad button:nth-child(3n+1) { border-left: 0; }
.keypad button:nth-last-child(-n+3) { border-bottom: 0; }
.keypad button:active { background: var(--paper-2); }
.e-save { flex: none; height: 62px; padding: 7px 14px calc(7px + env(safe-area-inset-bottom)); border-top: 1px solid var(--rule); display: flex; gap: 12px; align-items: center; }
.e-save .btn { flex: 1; min-height: 48px; font-size: 15px; border-radius: 14px; }
.e-save .cancel { display: none; }
.e-save.covered { visibility: hidden; }
/* "Odrzucić wpis?" [Wróć] [Odrzuć] over the save button (§16.12) */
.discard {
  position: absolute; left: 0; right: 0; bottom: 0; height: 62px; z-index: 5; display: flex; align-items: center; gap: 8px; padding: 0 14px;
  background: var(--ink); color: var(--paper);
}
.discard b { flex: 1; font-weight: 600; font-size: 15px; }
.discard .btn { min-height: 44px; }
.discard .btn.ghost { color: var(--paper); border-color: color-mix(in srgb, var(--paper) 40%, transparent); }
.discard .btn.red { background: var(--red); color: var(--on-red); }
/* receipt (phone): tile + name (2 lines) | amount 88 | budget 28 | ⋯ 44 | ✕ 44 (R2-T1) */
.e-receipt { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.e-lines { flex: 0 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column; }
.e-lrow {
  display: grid; grid-template-columns: minmax(0, 1fr) 88px 44px 44px 44px; align-items: center; min-height: 44px; flex: none;
  box-shadow: inset 0 -1px 0 var(--rule);
}
.e-lrow.sel { background: color-mix(in srgb, var(--s1) 10%, transparent); }
.e-lcat { display: flex; align-items: center; gap: 8px; min-height: 44px; min-width: 0; text-align: left; padding: 2px 0; }
.e-lname { font-size: 14px; line-height: 1.2; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.e-lamt { min-height: 44px; font: 500 15px var(--mono); text-align: right; padding: 0 6px; border-radius: 10px; }
button.e-lamt.sel { box-shadow: inset 0 0 0 2px var(--ink); }
.e-lb { position: relative; width: 44px; height: 44px; display: grid; place-items: center; color: var(--ink-2); font: 600 10px var(--mono); }
.e-lb::before { content: ""; position: absolute; left: 8px; right: 8px; top: 8px; bottom: 8px; border: 1px solid var(--rule-2); border-radius: 8px; }
.e-lb.on::before { border-color: var(--ink); }
.e-lb .icon { width: 14px; height: 14px; }
.e-lfoot { display: flex; justify-content: space-between; align-items: center; min-height: 44px; flex: none; }
/* receipt foot (§16.10 r5): "Reszta X zł" / excess in red (role=alert) / "Suma pozycji X zł" muted - one line */
.e-lsum { flex: 1 1 auto; min-width: 0; text-align: right; font-size: 13.5px; color: var(--ink-2); white-space: nowrap; overflow: hidden; }
.e-lsum b { font: 600 14px var(--mono); color: var(--ink); }
.e-lsum.bad, .e-lsum.bad b { color: var(--red); }
.e-lsum.sumv { color: var(--ink-3); }
.e-lsum.sumv b { color: var(--ink-2); font-weight: 500; }
/* the sheet "Pozycja N": the rest under Kwota (R2-T1) */
.e-lsum.lp-rest { text-align: left; margin: 6px 0 0; white-space: normal; }
.e-lfoot { gap: 8px; }
.e-lfoot .chip { flex: none; }
/* counted fields: line 1 in Reszta, the amount on top in Suma (dashed, paper-2) - still editable */
.e-lamt.auto { border: 1px dashed var(--rule-2); background: var(--paper-2); color: var(--ink-2); }
.e-lamt.bad { color: var(--red); border: 1px solid var(--red); }
.e-amt.sum { border: 1px dashed var(--rule-2); }
.e-amount .sumlab { margin-right: auto; align-self: center; font: 11.5px var(--sans); color: var(--ink-3); border: 1px dashed var(--rule-2); border-radius: 99px; padding: 2px 8px; white-space: nowrap; }
/* "Odrzucić wpis?" bubble under ✕ (§16.12 r5, mockup R3 / R5): ink, arrow to ✕, role=alertdialog */
.confirm {
  position: absolute; z-index: 30; top: calc(100% + 6px); right: 8px; width: 300px; max-width: calc(100% - 24px); background: var(--ink);
  color: var(--paper); border-radius: 14px; padding: 12px 12px 12px 14px; box-shadow: 0 20px 50px -18px #000c; display: flex; flex-direction: column;
  gap: 10px; cursor: default; text-align: left;
}
.confirm::before { content: ""; position: absolute; top: -6px; right: 16px; width: 12px; height: 12px; background: var(--ink); transform: rotate(45deg); border-radius: 2px; }
.confirm b { font-size: 15px; font-weight: 600; font-family: var(--sans); }
.confirm .row { display: flex; gap: 8px; justify-content: flex-end; }
.confirm .btn { min-height: 44px; flex: 1; }
.confirm .btn.ghost { color: var(--paper); border-color: color-mix(in srgb, var(--paper) 40%, transparent); background: transparent; }
.confirm .btn.red { background: var(--red); color: var(--on-red); }
.confirm .btn:focus-visible { outline: 2px solid var(--paper); outline-offset: 2px; }
.prow { display: flex; align-items: center; gap: 12px; }
.prow .t { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.prow .t b { font-weight: 600; font-size: 14.5px; }
.prow .t span { font-size: 12px; color: var(--ink-3); }
.prow.on .t b::after { content: " \2713"; color: var(--green); }
.cat-opt-row { display: flex; align-items: center; border-bottom: 1px solid var(--rule); }
.cat-opt-row .cat-opt { border-bottom: 0; flex: 1; }
.cat-opt-row .exp .chev { display: inline-block; transition: transform .15s; font-size: 18px; }
.cat-opt-row .exp.open .chev { transform: rotate(90deg); }
.cat-hidden { margin-left: auto; font-size: 11.5px; color: var(--amber); white-space: nowrap; }

/* ---------- transactions (§16) ---------- */
.mtitle-h { display: inline-flex; min-width: 0; }
.mtitle { display: inline-flex; flex-direction: column; align-items: flex-start; text-align: left; padding: 2px 6px 2px 0; border-radius: 10px; min-height: 44px; justify-content: center; }
.mtitle small { display: block; font: 11px/1 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 5px; }
.mtitle > span { font-family: var(--serif); font-size: 24px; line-height: 1.05; letter-spacing: -.01em; white-space: nowrap; }
.mtitle > span i { font-style: normal; font-size: 14px; color: var(--ink-3); margin-left: 5px; vertical-align: 3px; }
.monthnav { display: inline-flex; }
.monthnav .ibtn { font-size: 22px; }
.phead { display: flex; flex-direction: column; gap: 8px; padding-top: 10px; }
.hrow { display: flex; align-items: center; gap: 2px; min-height: 52px; }
.hrow .grow { flex: 1; min-width: 0; display: flex; align-items: center; gap: 2px; }
/* budget strip: fixed height 52 (placeholder in K2a, numbers in K2b - §16.16) */
.bstrip {
  display: flex; align-items: center; gap: 4px; height: 52px; padding: 0 2px 0 12px; border: 1.5px dashed var(--rule-2); border-radius: 14px; flex: none;
}
.bstrip > div { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.bstrip > div span { font-size: 11px; color: var(--ink-3); }
.bstrip > div b { font: 500 15px var(--mono); color: var(--ink-3); white-space: nowrap; }
.bstrip > div.key b { color: var(--ink); font-weight: 600; }
.bstrip .ibtn.info { width: 44px; height: 44px; }
.tx-views { display: flex; width: 100%; }
.tx-views button { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.tx-views button[aria-pressed=true] { font-weight: 600; }
.tx-views .cnt { font: 600 10.5px/16px var(--mono); min-width: 18px; padding: 0 5px; border-radius: 99px; background: var(--amber-soft); color: var(--amber); }
.tx-tools { margin-top: 0; flex-wrap: nowrap; }
.tx-tools .search, .ltools .search { flex: 1; min-width: 0; min-height: 44px; padding: 0 4px 0 10px; }
.search .clr { width: 44px; height: 44px; display: grid; place-items: center; color: var(--ink-3); flex: none; }
.search .clr .icon { width: 16px; height: 16px; }
/* the search of the list has its own ✕ (.clr, 44 px): the browser's own clear button is hidden (WebKit / Blink;
   Firefox draws none). The pickers keep the native one - it is their only clear control. */
.search input[data-input=tx-q]::-webkit-search-cancel-button,
.search input[data-input=tx-q]::-webkit-search-decoration { -webkit-appearance: none; appearance: none; display: none; }
.fbtn { position: relative; border: 1px solid var(--rule-2); background: var(--card); }
.fbtn.on { border-color: var(--ink); color: var(--ink); }
.fbtn .dot { position: absolute; top: 8px; right: 8px; width: 8px; height: 8px; border-radius: 99px; background: var(--red); }
.fchips { margin-top: 8px; }
.tx-col { display: flex; flex-direction: column; min-width: 0; }
.tlist { padding: 0; }
.tx-list { display: flex; flex-direction: column; }
.day {
  display: flex; justify-content: space-between; gap: 8px; font-size: 11.5px; color: var(--ink-3); letter-spacing: .06em;
  text-transform: uppercase; margin: 14px 0 0; padding-bottom: 4px; border-bottom: 1px solid var(--rule-2);
}
.day .mono { letter-spacing: 0; text-transform: none; font-size: 12px; }
.sep { display: flex; align-items: center; gap: 10px; margin: 18px 0 0; font-size: 12px; color: var(--ink-2); font-weight: 600; }
.sep::before, .sep::after { content: ""; flex: 1; border-top: 1px dashed var(--rule-2); }
.mhead {
  display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin: 18px 0 0; padding-bottom: 5px;
  border-bottom: 2px solid var(--ink); font-family: var(--serif); font-size: 19px;
}
.mhead .mono { font-size: 12.5px; color: var(--ink-2); font-family: var(--mono); }
.tx-list > .mhead:first-child, .tx-list > .day:first-child { margin-top: 6px; }
.ogrp { margin-top: 18px; border: 1px solid var(--rule-2); border-radius: 14px; padding: 0 10px; background: color-mix(in srgb, var(--card) 70%, transparent); }
.ogrp-h { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 46px; text-align: left; }
.ogrp-h .t { flex: 1; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.ogrp-h .chv { color: var(--ink-3); transition: transform .15s; }
.ogrp[data-open=false] .chv { transform: rotate(-90deg); }
.ogrp[data-open=false] .ogrp-b { display: none; }
.ogrp-h .cnt { font: 11px var(--mono); color: var(--ink-3); border: 1px solid var(--rule-2); border-radius: 99px; padding: 0 6px; }
.ogrp-h .mono { font-size: 13px; }
.ogrp .trow:last-child { border-bottom: 0; }
/* row (§16.13, §16.14 r5): two lines on the phone and in a list < 800 px - "tile | description (+ project) |
   amount" / "leaf (+ lock) · account (+ card) … budget pills"; a wider list = one line with columns (below) */
.trow { display: flex; align-items: center; gap: 2px; border-bottom: 1px solid var(--rule); border-radius: 8px; }
.trow-a {
  flex: 1; min-width: 0; display: grid; grid-template-columns: 36px minmax(0, 1fr) max-content; grid-template-areas: "ti de am" "ti l2 l2";
  column-gap: 10px; row-gap: 3px; align-items: center; min-height: 62px; padding: 7px 0 7px 2px; text-decoration: none; color: inherit; border-radius: 8px;
}
.trow-a > .tile { grid-area: ti; }
.c-de { grid-area: de; display: flex; align-items: center; gap: 5px; min-width: 0; font-weight: 600; font-size: 14.5px; }
.c-de .dt { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.l2 { grid-area: l2; display: flex; align-items: center; gap: 6px; min-width: 0; }
.c-su { flex: 1 1 0; display: flex; align-items: center; gap: 4px; min-width: 0; font-size: 12px; color: var(--ink-3); white-space: nowrap; overflow: hidden; }
.c-su .t { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.c-su .t.an { flex: 0 1 auto; }
.c-su .sep-dot { flex: none; }
.c-su .mk { width: 14px; height: 14px; }
.c-am { grid-area: am; text-align: right; font: 500 15px var(--mono); letter-spacing: -.02em; white-space: nowrap; }
.c-am.in, .ep-amt.in { color: var(--green); }
/* pills are never cut in half: whole ones + "+N" (fitPills in screens-tx.js) */
.c-st { flex: 0 1 auto; margin-left: auto; display: flex; gap: 4px; justify-content: flex-start; min-width: 0; max-width: 62%; overflow: hidden; }
.c-ca, .c-ac { display: none; }
/* markers 16 px: unpaid card after the account (accent), project after the description, lock after the leaf */
.mk { display: inline-flex; flex: none; width: 16px; height: 16px; color: var(--ink-3); }
.mk .icon { width: 100%; height: 100%; }
.mk.cardi { color: var(--red); }
/* the trash: ↩ after the title of a refund (".row .t span" is a block line) */
.row .t b .mk { display: inline-flex; vertical-align: -3px; margin-left: 6px; }
.trow.sel, .trow:has(.trow-a[aria-current=true]) { background: color-mix(in srgb, var(--s1) 12%, transparent); box-shadow: inset 3px 0 0 var(--s1); }
@media (hover: hover) { .trow:hover { background: color-mix(in srgb, var(--paper-2) 70%, transparent); } }
.trow.hl { animation: k2hl 1.5s ease-out; }
@keyframes k2hl { from { background: color-mix(in srgb, var(--amber) 40%, transparent); } to { background: transparent; } }
.okbtn { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px; color: var(--rule-2); flex: none; }
.okbtn.off { visibility: hidden; }
.okbtn .icon { width: 22px; height: 22px; }
.okbtn.on { color: var(--green); }
.okbtn:hover { background: var(--paper-2); }
.empty { padding: 28px 8px; text-align: center; color: var(--ink-2); display: flex; flex-direction: column; align-items: center; gap: 10px; }
.empty b { font-family: var(--serif); font-weight: 400; font-size: 20px; color: var(--ink); }
.more-btn { justify-content: center; margin: 14px 0 4px; }
/* footer (D1): 4 cells, small label above the value; phone: stuck above the bottom bar */
.tfoot {
  display: grid; grid-template-columns: repeat(3, 1fr) .6fr; align-items: center; min-height: 50px; padding: 0 12px; gap: 4px;
  border-top: 1px solid var(--rule-2); background: var(--card); position: sticky; bottom: calc(62px + env(safe-area-inset-bottom)); z-index: 4;
  margin: 12px -18px 0;
}
.tfoot > div { display: flex; flex-direction: column; min-width: 0; }
.tfoot span { font-size: 10.5px; color: var(--ink-3); letter-spacing: .04em; display: flex; align-items: center; gap: 3px; }
.tfoot span .icon { width: 12px; height: 12px; color: var(--red); }
.tfoot b { font-weight: 600; font-size: 13.5px; letter-spacing: -.03em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tfoot b.in { color: var(--green); }
.tfoot b.neg { color: var(--red); }
.tfoot > div:last-child { text-align: right; align-items: flex-end; }
/* details (§16.11): actions top right, notes under the facts (M2) */
.dethead { display: flex; align-items: center; justify-content: space-between; min-height: 52px; margin: 6px -8px 0 -4px; }
.dethead .back { margin-top: 0; }
.tx-card .acts, .phd .acts { display: flex; gap: 2px; align-items: center; }
.ibtn.danger { color: var(--red); }
.tx-card .detail { padding: 6px 0 24px; }
.tx-card .label { margin-bottom: 2px; }
.ep-amt { font: 500 34px var(--mono); letter-spacing: -.03em; }
.ep-desc { font-size: 22px; margin-top: 2px; overflow-wrap: anywhere; }
.ep-meta { font-size: 13px; color: var(--ink-3); margin-top: 2px; }
.ep-pills { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.kv .v > span { display: inline-flex; align-items: center; gap: 8px; }
.tx-notes { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; padding: 10px 12px; border-radius: 12px; background: var(--paper-2); }
.tx-notes p { font-size: 14px; overflow-wrap: anywhere; white-space: pre-wrap; margin-top: 2px; }
.lines-h { margin: 16px 0 2px; }
.my-budget { margin-top: 12px; }
.my-budget .hint { width: 100%; }
.tx-lines .row.tap { border-bottom: 1px solid var(--rule); }
.tx-card .check-row { margin-top: 8px; }
.empty-detail { flex: 1; display: grid; place-items: center; color: var(--ink-3); font-size: 15px; min-height: 240px; }

/* settings: Moje przychody (§16.9) */
.srow { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 60px; padding: 8px 4px; border-bottom: 1px solid var(--rule); text-align: left; }
.srow:last-child { border-bottom: 0; }
.srow.sub { padding-left: 28px; }
.srow .t { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.srow .t b { font-weight: 600; font-size: 14.5px; }
.srow .t span { font-size: 12.5px; color: var(--ink-3); }
.srow .chev { color: var(--ink-3); font-size: 20px; }
.srow[aria-current=true] { background: color-mix(in srgb, var(--s1) 10%, transparent); border-radius: 10px; }
.income-list { padding: 4px 12px; }
.seg.wide { display: flex; width: 100%; }
.seg.wide button { flex: 1; }
.days { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; margin-top: 10px; }
.days button { min-height: 44px; border-radius: 12px; border: 1px solid var(--rule-2); font: 500 15px var(--mono); background: var(--card); }
.days button.sel { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.days.off { opacity: .35; }
.preview { margin-top: 12px; padding: 10px 12px; border-radius: 12px; background: var(--paper-2); font-size: 14px; display: flex; gap: 8px; align-items: center; }
.preview .icon { width: 18px; height: 18px; color: var(--ink-3); }
.btns.end { justify-content: flex-end; margin-top: 12px; }
.income-editor .err { margin-top: 8px; }

/* accounts: "Uzgodnij saldo · ⋯" top right of the head card (§16.13) */
.head-acts { display: flex; gap: 6px; align-items: center; flex: none; }

@media (max-width: 999px) {
  #p-view[data-view=tx] { padding-bottom: 80px; }
  .tx-card.phone .detail { padding-bottom: 40px; }
}

@media (min-width: 1000px) {
  /* entry form - desktop modal 560 px (receipt 760 px): no keypad, amount field, date field with typing */
  dialog.sheet.entry-sheet { background: var(--card); overflow: visible; }
  dialog.sheet.entry-sheet.full { margin: auto; height: fit-content; max-height: 90vh; border-radius: 22px; }
  dialog.sheet.entry-sheet.r760 { width: 760px; }
  .entry-sheet > .sheet-head { height: 56px; padding: 6px 8px 0 22px; cursor: default; }
  .entry-sheet > .sheet-head .grabber { display: none; }
  .entry-sheet > .sheet-head h2 { font-size: 22px; }
  form.entry { gap: 12px; }
  form.entry .e-row, .entry .e-dyn { padding: 0 22px; }
  form.entry .e-row.e-desc { margin: 0 22px; padding: 0; }
  .entry .e-types-row { height: 64px; }
  .entry .e-types { width: auto; flex: none; }
  .e-amt-in {
    flex: 1; min-width: 0; text-align: right; font: 500 36px var(--mono); border: 0; border-bottom: 2px solid var(--rule-2);
    background: transparent; outline: 0; padding: 2px 4px;
  }
  .e-amt-in.exp { color: var(--red); }
  .e-amt-in.inc { color: var(--green); }
  .e-amt-in:focus-visible { border-bottom-color: var(--ink); }
  .entry .e-dyn { overflow: visible; gap: 12px; }
  .entry .e-catrow { overflow: visible; flex: none; }
  .e-ctx.desk { grid-template-columns: 1.1fr 1fr 1fr; gap: 8px; height: auto; }
  .e-ctx.desk .dd-t.plh { color: var(--ink-3); }
  .amtbox { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: stretch; }
  .amtbox .e-amt-in { width: 100%; }
  .e-amt-in.sum { border-bottom-style: dashed; }
  .amtcap { font-size: 11.5px; color: var(--ink-3); margin-top: 2px; text-align: right; }
  .e-lrow.desk input.e-lamt.auto { border-style: dashed; background: var(--paper-2); color: var(--ink-2); }
  .e-lrow.desk input.e-lamt.bad { color: var(--red); border-color: var(--red); border-style: solid; }
  .fld { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
  .fld > span { font-size: 11px; color: var(--ink-3); letter-spacing: .04em; }
  .fld .dd { width: 100%; }
  .fld .datef { min-height: 44px; padding-left: 10px; }
  .fld .datef .ibtn { width: 44px; height: 44px; }
  .e-lhead, .e-lrow.desk { display: grid; grid-template-columns: minmax(300px, 1fr) 110px 130px 44px 44px; gap: 6px; align-items: center; }
  .e-lhead { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); padding: 0 2px; }
  .e-lhead .r { text-align: right; }
  .e-lrow.desk { box-shadow: none; min-height: 50px; }
  .e-lrow.desk .e-lcat { display: block; }
  .e-lrow.desk .e-lcat > label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .e-lrow.desk input.e-lamt { min-height: 44px; border: 1px solid var(--rule-2); border-radius: 10px; background: var(--card); width: 100%; }
  .e-lrow.desk .dd { width: 100%; }
  .entry .e-receipt { flex: none; }
  .entry .e-lines { overflow: visible; gap: 0; }
  .entry .e-save { padding: 12px 22px 14px; height: auto; justify-content: space-between; }
  .entry .e-save .cancel { display: inline-flex; }
  .entry .e-save .btn { flex: 0 1 auto; min-width: 180px; }
  .entry .e-save.covered { display: none; }
  .entry.desk .discard { position: static; border-radius: 0 0 22px 22px; height: 64px; padding: 0 22px; }
  .entry .e-info { white-space: normal; }

  /* transactions: the page is a column of the viewport height; list and panel scroll on their own */
  #p-view[data-view=tx] {
    flex: none; height: calc(100vh - var(--update-bar-space, 0px)); display: flex; flex-direction: column; padding-bottom: 0; overflow: hidden;
  }
  #p-view[data-view=tx] > .txpage { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
  .dtop { flex: none; display: flex; align-items: center; gap: 10px; padding: 22px 0 14px; min-height: 92px; min-width: 0; }
  /* the title and ‹ › never shrink under each other; the budget strip gives way first */
  .dtop .mtitle-h, .dtop .monthnav, .dtop .acts { flex: none; }
  .dtop .bstrip { flex: 0 1 520px; margin-left: 14px; min-width: 0; overflow: hidden; }
  /* cells sized by their amounts first (a long amount takes room from a short one), then the rest shared */
  .dtop .bstrip > div { flex: 1 1 auto; }
  .dtop { position: relative; }
  .dtop > .info-text { position: absolute; top: calc(100% - 8px); left: 0; z-index: 20; max-width: 380px; box-shadow: 0 12px 30px -16px #000a; }
  .dtop .acts { margin-left: auto; display: flex; gap: 6px; align-items: center; }
  /* list (from 480 px) + panel 360–440 px; below 1180 px the panel is a drawer over the list (no side scroll) */
  .txsplit {
    flex: 1 1 auto; min-height: 0; display: grid; grid-template-rows: minmax(0, 1fr); grid-template-columns: minmax(480px, 1fr) minmax(360px, 440px);
    gap: 22px; padding-bottom: 20px; position: relative;
  }
  .txsplit > * { min-width: 0; }
  .txcol {
    background: var(--card); border: 1px solid var(--rule); border-radius: 18px; box-shadow: var(--shadow); overflow: hidden; min-height: 0;
    container: txl / inline-size;
  }
  .ltools { flex: none; display: flex; gap: 8px; align-items: center; padding: 12px 16px 10px; }
  .ltools .tx-views { width: auto; flex: none; }
  .ltools .search { min-width: 160px; }
  .tpanel .drawer-x { display: none; }
  .txcol [data-role=chips-box] { flex: none; padding: 0 16px; }
  .txcol [data-role=chips-box]:empty { display: none; }
  .txcol .fchips { margin: 0 0 8px; }
  .txcol .tlist {
    flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; padding: 0 16px 10px; overscroll-behavior: contain;
    scrollbar-width: thin; scrollbar-color: var(--rule-2) transparent;
  }
  .txcol .tfoot { position: static; margin: 0; flex: none; }
  .thead { display: none; }
  .tpanel { min-height: 0; display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--rule); border-radius: 18px; box-shadow: var(--shadow); overflow: hidden; }
  .tpanel > .tx-card { flex: 1; min-height: 0; display: flex; flex-direction: column; }
  .phd { flex: none; display: flex; justify-content: flex-end; align-items: center; gap: 4px; padding: 10px 10px 0 18px; }
  .phd .label { margin-right: auto; }
  .phd .acts { flex-wrap: nowrap; }
  .tpanel .detail { flex: 1; min-height: 0; overflow-y: auto; padding: 4px 22px 22px; scrollbar-width: thin; }

  /* settings: sections 280 px on the left, content ≤ 720 px on the right (M4) */
  .sgrid { display: grid; grid-template-columns: 280px minmax(0, 720px); gap: 28px; align-items: start; }
  .snav { display: flex; flex-direction: column; gap: 2px; position: sticky; top: 14px; }
  .snav a { display: flex; align-items: center; min-height: 44px; padding: 0 12px; border-radius: 10px; color: var(--ink-2); font-size: 14px; text-decoration: none; }
  .snav a:hover { background: var(--paper-2); }
  .snav a[aria-current=page] { background: var(--card); color: var(--ink); font-weight: 600; box-shadow: inset 0 0 0 1px var(--rule-2); }
  .spane > .back { display: none; }
  .spane > .top { padding-top: 0; }
  .spane > .top .title { font-size: 24px; }
  .spane > .card:first-of-type, .spane > .shd + .card { margin-top: 0; }
  .shd { display: flex; align-items: center; gap: 4px; margin-bottom: 10px; min-height: 44px; }
  .shd h2 { font-size: 24px; flex: 1; }
  #p-settings .top-acts .btn:not(.add) { min-height: 44px; }
}
.dimlist { display: none; }
@media (min-width: 1000px) and (max-width: 1179px) {
  .txsplit { grid-template-columns: minmax(0, 1fr); }
  .txsplit:not(.has-detail) > .tpanel { display: none; }
  .txsplit.has-detail > .tpanel {
    position: absolute; top: 0; right: 0; bottom: 20px; width: min(440px, 100%); z-index: 15;
    box-shadow: 0 28px 70px -24px #000c, 0 0 0 1px var(--rule-2);
  }
  .tpanel .drawer-x { display: inline-grid; }
  /* r5 (mockup R2): the list card under the drawer is dimmed; a click on it = ✕ (the title bar stays active) */
  .txsplit.has-detail > .dimlist {
    display: block; position: absolute; left: 0; top: 0; right: 0; bottom: 20px; z-index: 14; border-radius: 18px;
    background: color-mix(in srgb, var(--ink) 14%, transparent); cursor: pointer;
  }
}
/* a narrow list: the search goes to its own line (no squeezed placeholder) */
@container txl (max-width: 620px) {
  .ltools { flex-wrap: wrap; }
  .ltools .search { order: 3; flex: 1 1 100%; }
}
/* §16.13 r5 (mockup R1): one line from 800 px of list width; the columns fit the longest content of the loaded
   rows (subgrid of the list grid), limits per band (--cap-*); an empty "Budżet" collapses; Kwota and ✓ never shrink.
   fitColumns (screens-tx.js) sets --w-ca / --w-ac / --w-st in px through CSSOM so that the room is given back in
   the order of the spec: Opis to 160 -> Konto to 90 -> Kategoria to 120 -> fewer pills + "+N" (fit-content = the
   fallback before the first measure) */
@container txl (min-width: 800px) {
  .tx-list {
    --cap-ca: 200; --cap-ac: 140; --cap-st: 220;
    display: grid; column-gap: 10px;
    grid-template-columns: 36px minmax(160px, 1fr) var(--w-ca, fit-content(200px)) var(--w-ac, fit-content(140px))
      var(--w-st, fit-content(220px)) max-content 44px;
  }
  .tx-list > *, .ogrp > *, .ogrp-b > * { grid-column: 1 / -1; }
  .ogrp, .ogrp-b { display: grid; grid-template-columns: subgrid; }
  .ogrp { padding: 0; }
  .ogrp-h { padding: 0 10px; }
  .ogrp[data-open=false] .ogrp-b { display: none; }
  .trow { display: grid; grid-template-columns: subgrid; }
  .trow-a { grid-column: 1 / 7; display: grid; grid-template-columns: subgrid; grid-template-areas: none; min-height: 50px; padding: 4px 0; row-gap: 0; }
  .trow > .okbtn { grid-column: 7; }
  .tx-list .trow-a > *, .tx-list .l2 > * { grid-area: auto; grid-row: 1; }
  .l2 { display: contents; }
  .c-su { display: none; }
  .c-de .dt { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.25; overflow-wrap: anywhere; }
  .c-ca, .c-ac { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: 13.5px; color: var(--ink-2); white-space: nowrap; overflow: hidden; }
  .c-ca .nm, .c-ac .nm { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
  .c-st { max-width: none; margin-left: 0; }
  .c-am { min-width: 104px; }
  .thead {
    display: grid; grid-template-columns: subgrid; position: sticky; top: 0; z-index: 2; background: var(--card); padding: 10px 0 6px;
    font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); border-bottom: 1px solid var(--rule-2);
  }
  .thead > span { contain: inline-size; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .thead .r { text-align: right; }
  .tx-list > .thead + .day, .tx-list > .thead + .mhead { margin-top: 6px; }
}
@container txl (min-width: 1100px) {
  .tx-list {
    --cap-ca: 260; --cap-ac: 180; --cap-st: 300;
    grid-template-columns: 36px minmax(160px, 1fr) var(--w-ca, fit-content(260px)) var(--w-ac, fit-content(180px))
      var(--w-st, fit-content(300px)) max-content 44px;
  }
  .c-de .dt { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}
@media (min-width: 1800px) {
  .txsplit { grid-template-columns: minmax(560px, 1fr) 520px; }
  .detail-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .detail-grid > .acc-head, .detail-grid > .span { grid-column: 1 / -1; }
}

/* category combobox: a layer over the window, at least 360 px wide, up when there is no room below (K2a_UX pkt 12) */
@media (min-width: 1000px) {
  .cat-listbox { min-width: 360px; max-height: 320px; z-index: 30; }
  .cat-listbox.up { top: auto; bottom: calc(100% + 4px); }
}

/* Moje przychody: a subcategory inheriting the parent's rule - options one under another (§16.9) */
.seg.wide.col { flex-direction: column; border-radius: 16px; gap: 2px; }
.seg.wide.col button { border-radius: 12px; justify-content: flex-start; text-align: left; white-space: normal; padding: 0 14px; display: flex; align-items: center; }
.seg button:disabled { color: var(--rule-2); cursor: default; }
/* r3: the locked type of a refund - the whole segment greyed, the pressed type without the ink fill */
.seg.lock button[aria-disabled=true] { color: var(--ink-3); cursor: default; }
.seg.lock button[aria-pressed=true] { background: var(--rule-2); color: var(--ink-2); }
.income-editor > .hint { margin-top: 6px; font-size: 12.5px; }
/* category lists with both kinds (Filtry, Typ Wszystko): a heading per kind */
.cat-grp { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); padding: 12px 8px 4px; }
/* accounts details at 1000–1179 px: a narrower list; the head wraps its actions (still right) before the name breaks */
.acc-head .head-row { flex-wrap: wrap; }
.acc-head .head-row > .row { flex: 1 1 200px; }
.acc-head .head-acts { margin-left: auto; }
@media (min-width: 1000px) and (max-width: 1179px) {
  #p-view[data-view=accounts] > .split.has-detail { grid-template-columns: minmax(240px, 280px) minmax(0, 1fr); }
}

/* ======================= K2b-1: przelewy i koperty (spec K2 §17.12a, mockup docs/mockups/k2b-1.html) ======================= */
/* errors in one line (K2b_UX §1.5 v2): nowrap + ellipsis, the full text in title / the status region */
.e-info.err, .entry .e-info.err { white-space: nowrap; }
.e-amt.tr .v { color: var(--ink); }
.e-amt .v.lock { color: var(--ink-2); }
/* cells: tile 20 px before the name (Z / Na), lamp of an account of saving in the label line, P5 frame, O2 lock */
.e-ctx.two { grid-template-columns: 1fr 1fr; }
.ctx-b .v { display: flex; align-items: center; gap: 6px; min-width: 0; max-width: 100%; }
.ctx-b .v b { min-width: 0; }
.ctx-b .tile.xs { width: 20px; height: 20px; border-radius: 6px; flex: none; }
.ctx-b .tile.xs .icon { width: 13px; height: 13px; }
.ctx-b.bad { border-color: var(--red); box-shadow: inset 0 0 0 1px var(--red); }
.ctx-b.bad .ctx-l { color: var(--red); }
.ctx-l .lamp, .fld .lamp { display: inline-flex; width: 14px; height: 14px; margin-left: 4px; vertical-align: -3px; color: var(--ink-2); }
.ctx-l .lamp .icon, .fld .lamp .icon { width: 100%; height: 100%; }
.ctx-b.lock, .dd.lock, .datef.lock { background: var(--paper-2); border-style: dashed; cursor: default; }
.ctx-b.lock b, .dd.lock .dd-t { color: var(--ink-2); }
.ctx-b.lock .ctx-l { color: var(--ink-2); }
.lk2 { display: inline-flex; width: 12px; height: 12px; margin-left: 4px; vertical-align: -2px; color: var(--ink-2); }
.lk2 .icon { width: 100%; height: 100%; }
/* rows "Z" / "Na" of a transfer: account 1.3fr · envelope 1fr (one cell without envelopes) */
.e-tr { display: grid; grid-template-columns: 1.3fr 1fr; gap: 6px; height: 52px; min-width: 0; }
.e-tr.one { grid-template-columns: 1fr; }
/* the switch row 44 px (K2b_UX §1.4): label …. month chip (when on) + switch 48×28 (target 52×44); in Tab the chip
   comes after the switch (DOM order switch -> chip, CSS order chip -> switch) */
.e-sw { display: flex; align-items: center; gap: 6px; height: 44px; padding-left: 4px; min-width: 0; flex: none; }
.e-sw .lab { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; line-height: 1.15; order: 0; }
.e-sw .lab .l1 { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.e-sw .lab small { font-size: 11px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.e-sw .e-swm { order: 1; min-height: 44px; padding: 0 10px; flex: none; }
.e-sw .swb { order: 2; }
.swb { width: 52px; height: 44px; display: grid; place-items: center; flex: none; border-radius: 12px; }
.swb:disabled { opacity: .6; cursor: default; }
.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); }
.e-bud { gap: 6px; min-width: 0; }
/* M-K2b-1 / M-K2b-2: the budget row on the full width (44) under "Konto · Data · Więcej" */
.e-budw {
  display: flex; align-items: center; gap: 8px; height: 44px; width: 100%; padding: 0 10px 0 12px; border-radius: 12px;
  border: 1px solid var(--rule-2); background: var(--card); text-align: left; color: var(--ink); font-size: 14px; flex: none; min-width: 0;
}
.e-budw > .icon { width: 16px; height: 16px; color: var(--ink-2); flex: none; }
.e-budw .t { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.e-budw .cv { color: var(--ink-3); font-size: 11px; flex: none; }
.e-budw:disabled { color: var(--ink-3); }
/* K2b-1+ P4/P5: an account with envelopes - "Koperta ▾" + the budget tile in halves (44); a receipt - the envelope
   alone; without envelopes the budget tile of an income on the full width */
.e-bud2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 6px; height: 44px; min-width: 0; flex: none; }
.e-bud2.one { grid-template-columns: minmax(0, 1fr); }
.e-bud2 > .e-budw, .e-bud2 > .dd { width: 100%; height: 44px; min-width: 0; }
.e-bud2 > .e-budw { padding: 0 8px 0 10px; gap: 6px; }
.e-budw.lock { background: var(--paper-2); border-style: dashed; cursor: default; color: var(--ink-2); }
.e-budw.bad { border-color: var(--red); box-shadow: inset 0 0 0 1px var(--red); }
.e-bud.full .dd { flex: 1 1 auto; }
.prow .t .note { font-size: 12px; color: var(--ink-2); }
/* pills: "odłożone" (acc-envelope) */
.spill.sav { background: var(--green-soft); color: var(--green); }
/* list: the budget strip with numbers (L1), negative "Do wydania" red, old numbers dimmed while a month loads */
.bstrip > div b { color: var(--ink); }
.bstrip > div b.neg { color: var(--red); }
.bstrip.stale > div b { opacity: .5; }
/* K2b-1+ P3: "Odłożone" in the strip only from 1000 px (phone: 3 cells, Odłożone under "i"); the "i" as rows
   label …… amount (sign column, "= Do wydania" bold, red when < 0, a short note under them) */
.bstrip > div.sv { display: none; }
.strip-i { font-size: 13px; }
.si-rows { margin: 0; display: flex; flex-direction: column; gap: 2px; max-width: 340px; }
.si-r { display: flex; align-items: baseline; gap: 8px; min-height: 22px; }
.si-r dt { flex: 1; min-width: 0; display: flex; gap: 4px; color: var(--ink); }
.si-r dt .sg { flex: none; width: 12px; text-align: center; color: var(--ink-2); }
.si-r dd { margin: 0; font: 500 13px var(--mono); color: var(--ink); white-space: nowrap; text-align: right; }
.si-r.sub { min-height: 18px; }
.si-r.sub dt, .si-r.sub dd { font-size: 12px; color: var(--ink-2); }
.si-r.sub dt .lb { padding-left: 8px; }
.si-r.tot { border-top: 1px solid var(--rule-2); margin-top: 4px; padding-top: 4px; }
.si-r.tot dt, .si-r.tot dd { font-weight: 700; }
.si-r.tot.neg dd { color: var(--red); }
.strip-i .si-note { margin: 6px 0 0; font-size: 12px; max-width: 340px; }
.tfoot.two { grid-template-columns: 1fr .6fr; }
.my-budget .chip { min-height: 44px; }
.my-budget .chip.wide { white-space: normal; text-align: left; }
/* accounts: the switch in the sheets "Odłóż do koperty" / "Oddaj do Wolne", a move of an entry "z wpisu ›" */
.lf .e-sw { padding-left: 0; }
.sheet-foot .btn .sub { font-weight: 400; font-size: 12.5px; opacity: .8; margin-left: 4px; }
.hist-wrap { display: flex; align-items: center; gap: 4px; min-width: 0; }
.hist-wrap > .hist-row { flex: 1; min-width: 0; }
.from-tx {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 4px 0 8px; font-size: 12.5px; color: var(--ink-2);
  text-decoration: underline; text-underline-offset: 3px; white-space: nowrap; flex: none;
}
@media (min-width: 1000px) {
  .e-amt-in.tr { color: var(--ink); }
  .e-ctx.desk.two { grid-template-columns: 1fr 1fr; }
  /* DF1: "Z" and "Na" with ⇅ between the rows (Tab: Z konto, Z koperta, ⇅, Na konto, Na koperta) */
  .df-tr { display: grid; grid-template-columns: 1.1fr 1fr 44px; gap: 8px; align-items: end; }
  .df-tr .swap {
    grid-column: 3; grid-row: 1 / 3; align-self: center; width: 44px; height: 44px; border: 1px solid var(--rule-2); border-radius: 12px;
    display: grid; place-items: center; font-size: 18px; background: var(--card);
  }
  .df-tr > .fld:nth-child(4) { grid-column: 1; grid-row: 2; }
  .df-tr > .fld:nth-child(5) { grid-column: 2; grid-row: 2; }
  .entry .e-sw { padding-left: 2px; }
  .entry .e-budw { min-height: 44px; }
}
/* K2b-1+ P3 (audit): "Odłożone" as the 4th cell only from 1180 px; at 1000–1179 px the strip (3 cells) takes its
   own line under the title, so amounts up to "123 457 zł" are never cut */
@media (min-width: 1180px) {
  .bstrip > div.sv { display: flex; }
}
@media (min-width: 1000px) and (max-width: 1179px) {
  .dtop { flex-wrap: wrap; row-gap: 8px; padding-bottom: 10px; }
  .dtop .bstrip { order: 5; flex: 1 1 100%; margin-left: 0; }
}

/* ======================= K2b-2: zwroty i szybkie wpisywanie (spec K2 §17.12b, mockup docs/mockups/k2b.html F4, F7, F9) ======================= */
/* "Więcej" on the phone: a bubble with tiles 2 × 56 over the cell (§1.3, F4 / F11); the cell outlined while open */
.mbub {
  position: fixed; z-index: 85; padding: 8px; background: var(--card); border: 1px solid var(--rule-2); border-radius: 16px;
  box-shadow: 0 24px 60px -24px #000b; display: grid; grid-template-columns: 1fr 1fr; gap: 6px;
}
.mbub::before {
  content: ""; position: absolute; bottom: -7px; left: calc(var(--ax, 50%) - 6px); width: 12px; height: 12px; background: var(--card);
  border-right: 1px solid var(--rule-2); border-bottom: 1px solid var(--rule-2); transform: rotate(45deg); border-radius: 0 0 2px 0;
}
.mtile {
  display: flex; align-items: center; gap: 10px; height: 56px; padding: 0 10px; border-radius: 12px; border: 1px solid var(--rule-2);
  background: var(--card); color: var(--ink); text-align: left; min-width: 0;
}
.mtile > .icon { width: 20px; height: 20px; color: var(--ink-2); flex: none; }
.mtile .t { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.mtile .t b { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mtile .t span { font-size: 11px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mtile.on { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.mtile.on > .icon { color: var(--paper); }
.mtile.on .t span { color: color-mix(in srgb, var(--paper) 85%, transparent); }
.mtile:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.ctx-b.on { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
/* description chips (F9): one row 44 under the description; over the rows Z / Na of a transfer (0 px) */
.e-sugs { display: flex; gap: 6px; height: 44px; align-items: center; min-width: 0; }
.e-sugs .chip { flex: 0 1 auto; min-width: 0; min-height: 44px; color: var(--ink); }
.e-sugs .chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.e-dyn { position: relative; }
.e-sugs.ov { position: absolute; left: 14px; right: 14px; top: 2px; z-index: 6; background: var(--paper); box-shadow: 0 10px 18px -14px #0008; }
.e-catrow .chip.split { border-style: dashed; border-color: var(--ink); color: var(--ink); min-width: 0; }
.e-catrow .chip.split .icon { width: 18px; height: 18px; flex: none; }
/* the row "Zwrot za" 44 (§4.3 UX, M-K2b-2) */
.e-ref {
  display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 6px 0 8px; border-radius: 12px; border: 1px solid var(--rule-2);
  background: var(--card); color: var(--ink); text-align: left; width: 100%; min-width: 0; flex: none;
}
.e-ref.lock { background: var(--paper-2); border-style: dashed; }
.e-ref .tile.sm { width: 28px; height: 28px; flex: none; }
.e-ref .t { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.15; }
.e-ref .t span { font-size: 11px; color: var(--ink-2); }
.e-ref .t b { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.e-ref .of { font: 500 13px var(--mono); color: var(--ink-2); white-space: nowrap; flex: none; }
.e-ref .chv { color: var(--ink-3); font-size: 18px; width: 18px; text-align: center; flex: none; }
/* the lines of a refund: kafelek + nazwa | kwota 88 | budżet 44 (the frame 28) | ✕ 44; 3+ lines - a box (2.5 lines) + the foot 24 */
.e-lrow.ref { grid-template-columns: minmax(0, 1fr) 88px 44px 44px; }
.e-lcat.lock { cursor: default; }
.e-receipt.ref { flex: none; }
.e-lines.box { height: 138px; flex: none; overflow-y: auto; border-bottom: 1px solid var(--rule-2); }
.e-lfoot24 {
  position: sticky; bottom: 0; flex: none; height: 24px; display: flex; align-items: center; justify-content: flex-end; padding: 0 4px;
  margin-top: auto; background: var(--red-soft); color: var(--red); font-size: 12.5px; white-space: nowrap; overflow: hidden;
}
.e-lfoot24[hidden] { display: none; }
.e-lfoot24 > span:first-child { overflow: hidden; text-overflow: ellipsis; }
button.e-lamt.bad { color: var(--red); box-shadow: inset 0 0 0 1px var(--red); }
.e-amt.tr.bad .v { color: var(--red); }
/* "Zwrot za…" (F3, F4): a full sheet on the phone, a window 560 × 760 on the desktop (the list scrolls inside) */
dialog.sheet.rp-sheet[open] { display: flex; flex-direction: column; overflow: hidden; }
.rp-sheet > .sheet-body { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.rp { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; gap: 4px; }
.rp .search { flex: none; min-height: 44px; }
.rp-list { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.rp-list .sec { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-2); margin: 10px 0 0; }
.rp-list .day { margin-top: 8px; }
.rprow {
  display: grid; grid-template-columns: 36px minmax(0, 1fr) max-content; grid-template-areas: "ti de am" "ti l2 su"; column-gap: 10px;
  row-gap: 2px; align-items: center; min-height: 60px; padding: 6px 0; border-bottom: 1px solid var(--rule); width: 100%; text-align: left;
  color: var(--ink);
}
.rprow > .tile { grid-area: ti; }
.rprow .de { grid-area: de; font-weight: 600; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.rprow .l2 { grid-area: l2; font-size: 12px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.rprow .am { grid-area: am; font: 500 15px var(--mono); text-align: right; white-space: nowrap; }
.rprow .su { grid-area: su; font-size: 11.5px; color: var(--ink-2); text-align: right; white-space: nowrap; display: flex; justify-content: flex-end; }
.rprow[aria-disabled=true] { opacity: .55; cursor: default; }
.rp-lines { display: flex; flex-direction: column; }
.rstep { display: grid; grid-template-columns: 44px minmax(0, 1fr) 88px; align-items: center; column-gap: 8px; min-height: 60px; border-bottom: 1px solid var(--rule); }
.rstep .cb { width: 44px; height: 44px; display: grid; place-items: center; }
.rstep .cb i {
  width: 22px; height: 22px; border-radius: 6px; border: 1.5px solid var(--ink-3); display: grid; place-items: center; font-style: normal;
  font-size: 14px; background: var(--card);
}
.rstep .cb.on i { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.rstep .n { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 14px; }
.rstep .n > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rstep .am { display: flex; flex-direction: column; align-items: flex-end; }
.rstep .am .f {
  width: 88px; min-height: 44px; border: 1px solid var(--rule-2); border-radius: 10px; background: var(--card); font: 500 15px var(--mono);
  text-align: right; padding: 0 8px;
}
.rstep .am .f.bad { color: var(--red); border-color: var(--red); }
.rstep .am small { font-size: 11px; color: var(--ink-2); }
.rstep.off { opacity: .55; }
.rp-foot { display: flex; flex-direction: column; gap: 6px; width: 100%; }
.rp-foot .btn { width: 100%; min-height: 52px; font-size: 15px; border-radius: 14px; }
.rp-foot .err:empty { display: none; }
/* details (S2, S3): the block "Zwroty", "zwrócono X" of a receipt line, the link "Zwrot za ›" */
.refbox { margin-top: 14px; padding: 10px 12px; border-radius: 12px; background: var(--paper-2); display: flex; flex-direction: column; gap: 2px; }
.refbox .rh { display: flex; flex-direction: column; gap: 2px; margin-bottom: 4px; }
.refbox .rh b { font-size: 14.5px; font-weight: 600; }
.refbox .rr { display: flex; align-items: center; gap: 10px; min-height: 44px; color: var(--ink); text-decoration: none; border-top: 1px solid var(--rule); }
.refbox .rr .d { font: 500 12.5px var(--mono); color: var(--ink-2); flex: none; }
.refbox .rr .t { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 14px; }
.refbox .rr .chv { color: var(--ink-3); font-size: 18px; }
.refbox .btn { align-self: flex-start; margin-top: 6px; min-height: 44px; }
.tx-card .add-refund { margin-top: 12px; min-height: 44px; }
.rf { color: var(--green); }
.kv .lnk { display: inline-flex; align-items: center; min-height: 44px; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
/* K2b-4r G1, G2: the facts "Konto" / "Z" / "Na" / "Projekt" - [tile] text ›; the tile is a part of the target */
.kv .lnk.kv-link { gap: 8px; text-decoration: none; color: var(--ink); min-width: 0; }
.kv-link .u { text-decoration: underline; text-underline-offset: 3px; overflow-wrap: anywhere; }
.kv-link .chv { color: var(--ink-3); }
.kv-link .tile { flex: none; }
@media (hover: hover) { .kv-link:hover { cursor: pointer; } .kv-link:hover .u { color: var(--ink); text-decoration-thickness: 2px; } }
.kv-link:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; border-radius: 8px; }
.kv .v .kv-pr { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.kv .v .kv-links { display: flex; flex-direction: column; align-items: flex-end; }
.my-budget .hint { display: flex; align-items: center; gap: 2px; }
.my-budget .ibtn.info { width: 44px; height: 44px; }
.my-budget > .info-text { width: 100%; margin: 0 0 4px; }
@media (min-width: 1000px) {
  dialog.sheet.rp-sheet.full { width: 560px; height: min(760px, 92vh); max-height: 92vh; }
  .e-amt-in.bad { color: var(--red); }
  .e-lhead.ref, .e-lrow.desk.ref { grid-template-columns: minmax(0, 1fr) 110px 150px 44px; }
  .e-desc { position: relative; }
  .e-combo {
    position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 30; background: var(--card); border: 1px solid var(--rule-2);
    border-radius: 14px; box-shadow: 0 20px 50px -24px #000b; padding: 4px; display: flex; flex-direction: column;
  }
  .e-combo[hidden] { display: none; }
  .e-combo .opt { display: flex; flex-direction: column; justify-content: center; min-height: 48px; padding: 4px 10px; border-radius: 10px; cursor: pointer; }
  .e-combo .opt b { font-size: 14.5px; font-weight: 600; }
  .e-combo .opt span { font-size: 12px; color: var(--ink-2); }
  .e-combo .opt.on, .e-combo .opt:hover { background: var(--paper-2); }
}
.menu-list .icon.ph { display: inline-block; flex: none; }
.e-act { align-self: flex-start; min-height: 44px; flex: none; }
@media (min-width: 1000px) { .entry.combo-open .e-catfield { visibility: hidden; } }

/* ======================= K2b-4: Konta i projekt (spec K2 §17.12e, mockup docs/mockups/k2b-4.html) ======================= */
/* F4: the drawer of an entry over the history of an account / a project (desktop, 520 px at the right edge) */
dialog.sheet.drawer {
  margin: 0 0 0 auto; width: 520px; max-width: 100vw; height: 100vh; max-height: 100vh; border-radius: 18px 0 0 18px;
  padding: 0; overflow: hidden; border: 1px solid var(--rule); background: var(--card);
}
dialog.sheet.drawer[open] { display: flex; flex-direction: column; }
dialog.sheet.drawer > .sheet-head { display: none; }
dialog.sheet.drawer > .sheet-body { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
dialog.sheet.drawer .tx-card { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
dialog.sheet.drawer .phd { flex: none; display: flex; justify-content: flex-end; align-items: center; gap: 4px; padding: 14px 12px 0 22px; }
dialog.sheet.drawer .phd .label { margin-right: auto; }
dialog.sheet.drawer .detail { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 4px 22px 22px; scrollbar-width: thin; }
dialog.sheet.drawer::backdrop { background: color-mix(in srgb, var(--ink) 28%, transparent); }
/* F4: the fact "Projekt ›" (st-shared 14) and the marker of a line of a receipt (nav-projects 14) */
.kv .mk.sh, .tx-lines .mk.pm, .mk.pm { width: 14px; height: 14px; color: var(--ink-3); }
.tx-lines .t b .mk.pm { display: inline-flex; vertical-align: -2px; margin-left: 6px; }
/* F1 / F2: tabs, rows, "Cała historia ›", the error block */
.hist-card .hist-tabs { margin: 4px 0 6px; }
.hist-tabs button { flex: 1; }
/* D3: tabs (role=tab) - the selected one by aria-selected, not aria-pressed */
.hist-tabs button[aria-selected=true] { background: var(--ink); color: var(--paper); }
.hist-entries .trow:last-child, .hist-list .trow:last-child { border-bottom: 0; }
/* K2b-4r G4: "Cała historia ›" as a ghost in the head of the card Historia (always there, top right) */
.hist-card > .h { flex-wrap: nowrap; }
.hist-card > .h h2 { min-width: 100px; }
.hist-all-btn { white-space: nowrap; flex: none; }
.hist-err { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding: 12px 0 6px; }
.hist-err p { font-size: 14px; color: var(--ink-2); }
.c-am.shift { color: var(--ink-2); }
.c-su .mk.sh { width: 14px; height: 14px; color: var(--ink-3); }
/* F2: the screen "Historia konta" - the bar and the segment stuck at the top, the bubble of "i" under the segment */
.hist-pane { padding-bottom: 24px; }
.ah-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 44px; position: sticky; top: 0; z-index: 6;
  background: var(--paper);
}
.ah-bar .back { margin-top: 0; min-width: 0; }
.ah-bar .back span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ah-bar .head-acts { display: flex; gap: 6px; align-items: center; }
.ah-title { padding: 4px 0 10px; }
.ah-title .label { margin-bottom: 2px; }
.ah-title h1 { font-family: var(--serif); font-weight: 400; font-size: 24px; line-height: 1.15; overflow-wrap: anywhere; }
.ah-title h1:focus { outline: none; }
.ah-bal { font-size: 13px; color: var(--ink-2); margin-top: 2px; }
.ah-seg {
  display: flex; align-items: center; gap: 6px; position: sticky; top: 44px; z-index: 5; background: var(--paper); padding: 2px 0 8px;
}
.ah-seg .hist-tabs { flex: 1 1 auto; min-width: 0; }
.ah-seg .ah-info {
  position: absolute; right: 0; top: calc(100% - 4px); z-index: 7; max-width: min(300px, 90%); margin: 0; padding: 10px 12px;
  background: var(--card); border: 1px solid var(--rule-2); border-radius: 12px; box-shadow: 0 12px 30px -16px #000a; font-size: 13.5px;
}
.hist-list > .day:first-child { margin-top: 4px; }
.hist-list .day[data-day] { align-items: baseline; }
.hist-k1 .hist-row:last-child { border-bottom: 0; }
/* a move of an entry: the line under the whole row (with "z wpisu ›"), not under its left part only */
.hist-wrap { border-bottom: 1px solid var(--rule); }
.hist-wrap > .hist-row { border-bottom: 0; }
.hist-k1 > .hist-wrap:last-child { border-bottom: 0; }
.hist-more .btn.wide { width: 100%; }
@media (max-width: 999px) {
  /* the screen of the history starts with "‹ <konto>" (no "Konta i podziały" above it) */
  #p-view[data-view=accounts]:has(.split.has-history) > .top { display: none; }
}
@media (min-width: 1000px) {
  #p-view[data-view=accounts] .hist-pane { max-width: 760px; width: 100%; justify-self: start; padding-left: 2px; }
}
/* F10: room for the toast of the second 429 under "Spróbuj ponownie" (T-K2-76) */
#main.toast-reserve, .pane.toast-reserve { padding-bottom: var(--toast-reserve, 0px) !important; }
/* K2b-4r G6 (R6, R8): the row [Projekt][Składnik] - cells like `Konto · Data · Więcej`, 48 (phone) / 52 (window) */
.e-pp { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 6px; min-width: 0; flex: none; }
.e-pp.one { grid-template-columns: minmax(0, 1fr); }
.e-pp > .ctx-b.e-pc { position: relative; min-height: 48px; height: 48px; width: 100%; padding: 0 26px 0 10px; }
.e-pc .v { display: flex; align-items: center; gap: 6px; min-width: 0; max-width: 100%; }
.e-pc .v b { min-width: 0; }
.e-pc b.plh { color: var(--ink-3); font-weight: 500; }
.e-pc .tile.xs { width: 20px; height: 20px; border-radius: 6px; flex: none; }
.e-pc .tile.xs .icon { width: 13px; height: 13px; }
.e-pc .mk.sh, .lp-proj .mk.sh { width: 16px; height: 16px; color: var(--ink-2); flex: none; }
.e-pc > .cv { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); color: var(--ink-3); font-size: 11px; }
.e-pc > .cv.lk2 .icon { width: 14px; height: 14px; color: var(--ink-2); }
.e-pc.lock { background: var(--paper-2); border-style: dashed; cursor: default; }
.entry:not(.desk) .e-dyn.tight { gap: 4px; }
@media (min-width: 1000px) {
  .entry .e-pp > .ctx-b.e-pc { min-height: 52px; height: 52px; }
}
.e-lcat .mk.pm { flex: none; }
@media (min-width: 1000px) {
  .e-lrow.desk .e-lcat { position: relative; }
  .e-lrow.desk .e-lcat > .mk.pm { position: absolute; right: 40px; top: 50%; transform: translateY(-50%); pointer-events: none; }
}
.lp-proj { width: 100%; justify-content: flex-start; gap: 8px; }
.lp-proj .dd-t { flex: 1; min-width: 0; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lp-proj .tile.xs { width: 22px; height: 22px; border-radius: 7px; }
.prow > .mk.sh { width: 16px; height: 16px; color: var(--ink-2); margin-left: auto; flex: none; }
/* F8 (UX-Q31): the type of an estimate - Przychód and Przelew greyed, Wydatek pressed in ink */
.seg.elock button[aria-disabled=true] { color: var(--ink-3); cursor: default; }
/* F6: the Wpisy of a project; the detail in two columns from 1180 px (max 1480) */
.prj-lines .h h2 { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); font-family: var(--sans); font-weight: 400; }
.pl-row { border-bottom: 1px solid var(--rule); border-radius: 8px; }
.pl-row:last-child { border-bottom: 0; }
.pl-a, .pl-row.ro {
  display: grid; grid-template-columns: 36px minmax(0, 1fr) max-content 14px; column-gap: 10px; align-items: center; min-height: 60px;
  padding: 6px 2px; color: inherit; text-decoration: none; border-radius: 8px;
}
.pl-row.ro { cursor: default; }
.pl-row.ro:focus { outline: none; }
.pl-row.ro:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.pl-t { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.pl-1 { display: flex; align-items: center; gap: 5px; min-width: 0; font-weight: 600; font-size: 14.5px; }
.pl-1 .dt { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.pl-1 .mk { width: 16px; height: 16px; }
.pl-2 { display: flex; align-items: center; min-width: 0; font-size: 12px; color: var(--ink-3); white-space: nowrap; overflow: hidden; }
.pl-2 > span { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.pl-2 > .f { flex: none; white-space: pre; }
.pl-2 .mk.sh { width: 14px; height: 14px; color: var(--ink-3); margin-right: 3px; flex: none; }
.pl-am { font: 500 15px var(--mono); letter-spacing: -.02em; white-space: nowrap; text-align: right; }
.pl-am.in { color: var(--green); }
.pl-a .chev { color: var(--ink-3); font-size: 18px; }
@media (hover: hover) { .pl-a:hover { background: color-mix(in srgb, var(--paper-2) 70%, transparent); } }
.pl-row.hl { animation: k2hl 2s ease-out; }
@media (min-width: 1180px) {
  .prj-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; max-width: 1480px; align-items: start; }
  .prj-col > .card:first-child { margin-top: 0; }
}
/* F7: the states of an estimate (pills in --ink-2 on --paper-2, the amount of a realized one without a strike) */
.epill {
  display: inline-flex; align-items: center; gap: 3px; padding: 1px 7px; border-radius: 99px; background: var(--paper-2); color: var(--ink-2);
  font-size: 11px; line-height: 1.5; white-space: nowrap; vertical-align: 1px;
}
.epill .icon { width: 12px; height: 12px; }
.row .t .epill { display: inline-flex; width: auto; margin-left: 2px; }
.row .t .epill span { display: inline; font-size: 11px; color: var(--ink-2); }
.row .a.done { color: var(--ink-2); }
.foot-btns.ep-foot { display: grid; grid-template-columns: 70px 100px minmax(0, 1fr); gap: 8px; align-items: center; }
.foot-btns.ep-foot.n2 { grid-template-columns: 70px 100px; }
.foot-btns.ep-foot.n1 { grid-template-columns: 70px; }
.foot-btns.ep-foot .btn { min-height: 48px; border-radius: 14px; }
.foot-btns.ep-foot .btn.primary { min-width: 0; font-size: 14px; padding: 0 10px; }
.foot-btns.ep-foot .ep-close { justify-self: start; }
@media (min-width: 1000px) {
  .foot-btns.ep-foot { grid-template-columns: 80px 110px minmax(0, 1fr); }
  .foot-btns.ep-foot .btn.primary { min-width: 0; }
}

/* ---------- K2b-4r G7: the envelope preview (phone: a sheet; desktop: a window of 480 in the middle) ---------- */
dialog[data-role=envelope-view] .sheet-head h2 { flex: 1; min-width: 0; }
.envp-more { margin-left: auto; }
.envp-name { display: flex; align-items: center; gap: 10px; font-size: 24px; margin: 2px 0 0; overflow-wrap: anywhere; }
.envp-name .dot { width: 12px; height: 12px; border-radius: 50%; flex: none; }
dialog[data-role=envelope-view] .ep-amt { font: 500 40px var(--mono); letter-spacing: -.03em; margin-top: 2px; }
.envp-mh { margin: 14px 0 0; }
.envp-moves .hist-row { min-height: 52px; }
.envp-moves > .hint { padding: 10px 0; }
.envp-all { display: flex; justify-content: flex-end; border-top: 1px solid var(--rule); }
.envp-all .lnk { 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; }
.foot-btns.envp-foot { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.2fr); gap: 8px; align-items: center; }
.foot-btns.envp-foot.n2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.foot-btns.envp-foot .btn { min-height: 44px; min-width: 0; padding: 0 10px; width: 100%; flex: none; font-size: 14px; }
.foot-btns.envp-foot .btn[aria-disabled=true] { opacity: .45; cursor: not-allowed; }
.env-item.ctx > .env-btn { background: color-mix(in srgb, var(--paper-2) 80%, transparent); }
@media (min-width: 1000px) {
  dialog.sheet.narrow.envp { width: 480px; }
}

/* ---------- K2b-4r G6 (T-K2-81): the window 560 / 760 - the zone in its natural height, the three steps of fitDesk() ---------- */
@media (min-width: 1000px) {
  .entry .e-dyn { flex: none; overflow: visible; }
  form.entry.fit-scroll { overflow-y: auto; overscroll-behavior: contain; }
  form.entry.fit-scroll > .e-save { position: sticky; bottom: 0; z-index: 4; background: var(--card); border-top: 1px solid var(--rule); }
  form.entry.desk .e-lines.fit-lines { overflow-y: auto; max-height: var(--fit-lines, 240px); }
  .cat-listbox.fixed { position: fixed; right: auto; z-index: 60; }
}

/* ---------- K2b-4r G8: the project screen - the name is the h1 inside the head card ---------- */
.acc-head .t h1.prj-name { font-size: 22px; font-weight: 400; margin: 0; line-height: 1.25; overflow-wrap: anywhere; }
.acc-head .t h1.prj-name:focus:not(:focus-visible) { outline: none; }
