/* budzet PWA - K0 shell (login, security settings). Layout: phone < 1000 px, desktop >= 1000 px. */
* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
html, body { min-height: 100%; }
body {
  background: var(--paper); color: var(--ink); font: var(--fs)/1.42 var(--sans);
  -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: 100%;
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.muted { color: var(--ink-3); }

/* icons (SVG from app/web/icons, colour = currentColor) */
.icon { display: inline-flex; flex: none; width: 20px; height: 20px; color: inherit; }
.icon > svg { display: block; width: 100%; height: 100%; }
.tile { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; flex: none; background: var(--paper-2); color: var(--ink-2); }

/* app background: ruled paper */
.app {
  min-height: 100vh; background: var(--paper);
  background-image: repeating-linear-gradient(to bottom, transparent 0 31px, color-mix(in srgb, var(--rule) 40%, transparent) 31px 32px);
}

/* buttons, links, fields */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 0 14px;
  border-radius: 12px; background: var(--ink); color: var(--paper); font-weight: 600; font-size: 14px;
  text-decoration: none; text-align: center;
}
.btn .icon { width: 17px; height: 17px; }
.btn.ghost { background: transparent; color: var(--ink-2); border: 1px solid var(--rule-2); }
.btn.red { background: var(--red); color: var(--on-red); }
.btn.ghost.danger:not(.armed) { color: var(--red); }
.btn.armed { background: var(--red); color: var(--on-red); border-color: var(--red); }
.btn.wide { width: 100%; min-height: 50px; font-size: 15px; border-radius: 14px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.link {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 2px; font-size: 13.5px; color: var(--ink-2);
  text-decoration: underline; text-underline-offset: 3px; cursor: pointer; text-align: left;
}
.link.cancel { min-width: 44px; justify-content: center; }   /* "Anuluj": a target of at least 44 x 44 */
.link.armed { color: var(--red); font-weight: 600; }
.link.danger { color: var(--red); }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span, .field > label, .field > .info-row > label { font-size: 12.5px; color: var(--ink-2); }
.field input {
  width: 100%; min-height: 48px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--rule-2);
  background: var(--card); font-size: 16px;
}
.field input[aria-invalid=true] { border-color: var(--red); }
.count { font-size: 12px; color: var(--ink-3); }
.count.ok { color: var(--green); }
.err { color: var(--red); font-size: 13.5px; }
.err:empty { display: none; }
.note { font-size: 13px; color: var(--ink-2); }
.note:empty { display: none; }
.hint { font-size: 12.5px; color: var(--ink-3); }
.warn { background: var(--amber-soft); color: var(--amber); border-radius: 12px; padding: 10px 12px; font-size: 13.5px; }
.ok-box { background: var(--green-soft); color: var(--green); border-radius: 12px; padding: 10px 12px; font-size: 13.5px; }
.warn:empty, .ok-box:empty { display: none; }

/* segmented control */
.seg { display: inline-flex; border: 1px solid var(--rule-2); border-radius: 999px; padding: 3px; background: var(--card); flex: none; }
.seg button { padding: 0 12px; min-height: 44px; border-radius: 999px; font-size: 13px; color: var(--ink-2); white-space: nowrap; }
.seg button[aria-pressed=true] { background: var(--ink); color: var(--paper); }

/* ---------- auth screens (card 360 px) ---------- */
.login { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 32px 22px; }
.login .inner { width: 100%; max-width: 360px; }
.brand { font-family: var(--serif); font-size: 28px; letter-spacing: -.02em; line-height: 1; display: flex; align-items: center; gap: 10px; }
.brand i { color: var(--red); font-style: normal; }
.logo { display: inline-flex; width: 34px; height: 34px; flex: none; }
.logo img { width: 100%; height: 100%; border-radius: 9px; box-shadow: 0 0 0 1px var(--rule-2); }
.login .brand { font-size: 46px; }
.login .logo { width: 56px; height: 56px; }
.login .logo img { border-radius: 14px; }
.login h1.step { font-family: var(--serif); font-weight: 400; font-size: 32px; letter-spacing: -.01em; line-height: 1.1; margin-top: 8px; }
.login p.sub { color: var(--ink-2); margin: 10px 0 24px; }
.label { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); }
.lf { display: flex; flex-direction: column; gap: 14px; }
.kind { display: flex; gap: 8px; border: 0; }
.kind legend { font-size: 12.5px; color: var(--ink-2); margin-bottom: 6px; }
.kind label { flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; border-radius: 12px; border: 1px solid var(--rule-2); background: var(--card); cursor: pointer; font-size: 14px; }
.kind input { width: 18px; height: 18px; accent-color: var(--ink); }
.kind label:has(input:checked) { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.kind-wrap { border: 0; }
.secure { display: flex; gap: 8px; align-items: flex-start; font-size: 12.5px; color: var(--ink-3); margin-top: 22px; }
.secure .icon { width: 18px; height: 18px; margin-top: 1px; }

/* 6-digit code */
.otp { display: flex; gap: 8px; justify-content: space-between; border: 0; }
.otp input {
  width: 46px; min-width: 0; flex: 1 1 0; height: 56px; text-align: center; font: 500 24px var(--mono); padding: 0;
  border-radius: 12px; border: 1px solid var(--rule-2); background: var(--card);
}
.otp input[aria-invalid=true] { border-color: var(--red); }

/* TOTP setup */
.totp-key { font: 500 17px/1.5 var(--mono); letter-spacing: .04em; overflow-wrap: anywhere; background: var(--card); border: 1px dashed var(--rule-2); border-radius: 12px; padding: 10px 12px; user-select: all; -webkit-user-select: all; }
.totp-actions { display: flex; flex-direction: column; gap: 10px; }
.qr-box { display: flex; justify-content: center; background: #fff; border-radius: 14px; padding: 12px; border: 1px solid var(--rule); }
.qr-box svg { width: 220px; height: 220px; max-width: 100%; display: block; }
.collapsed .qr-box { display: none; }
.totp-grid { display: flex; flex-direction: column; gap: 14px; }
.steps { padding-left: 20px; font-size: 14px; color: var(--ink-2); display: flex; flex-direction: column; gap: 4px; }

/* recovery codes */
.codes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px; padding: 14px; background: var(--card); border: 1px solid var(--rule); border-radius: 14px; }
.codes li { list-style: none; font: 500 16px var(--mono); letter-spacing: .03em; }
.btns { display: flex; gap: 8px; flex-wrap: wrap; }
.btns.fill .btn { flex: 1; }
.check-row { display: flex; align-items: center; gap: 10px; min-height: 44px; cursor: pointer; font-size: 14px; }
.check-row input { width: 22px; height: 22px; accent-color: var(--ink); flex: none; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: 1fr; min-height: 100vh; }
.side { display: none; }
.main { position: relative; min-width: 0; display: flex; flex-direction: column; min-height: 100vh; }
.page { padding: 0 18px 110px; flex: 1; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 0 10px; }
.title { font-family: var(--serif); font-size: 26px; font-weight: 400; letter-spacing: -.01em; line-height: 1.05; }
.title small { display: block; font: 11px/1 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 5px; }
.card { background: var(--card); border: 1px solid var(--rule); border-radius: 18px; padding: 16px; margin-top: 14px; box-shadow: var(--shadow); }
.card h2 { font-size: 11px; font-weight: 400; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); }
.h { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 6px; min-height: 44px; }
.empty-state { font-family: var(--serif); font-size: 22px; line-height: 1.2; margin: 6px 0; }

.row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--rule); }
.row:last-child { border-bottom: 0; }
.row .t { flex: 1; min-width: 0; }
.row .t b { display: block; font-weight: 600; font-size: 14px; overflow-wrap: anywhere; }
.row .t span { display: block; font-size: 12px; color: var(--ink-3); overflow-wrap: anywhere; }
.row .acts { display: flex; gap: 4px 12px; flex-wrap: wrap; justify-content: flex-end; flex: none; max-width: 55%; }
.row.edit { flex-wrap: wrap; }
.row.edit .field { flex: 1 1 180px; }
.pill { display: inline-block; font: 500 10px/1.5 var(--sans); letter-spacing: .06em; text-transform: uppercase; padding: 1px 6px; border-radius: 99px; border: 1px solid var(--rule-2); color: var(--ink-2); margin-left: 6px; vertical-align: 1px; }
.pill.green { border-color: var(--green); color: var(--green); }
.pill.amber { border-color: var(--amber); color: var(--amber); }

.set { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--rule); min-height: 56px; flex-wrap: wrap; }
.set:last-child { border: 0; }
.set b { font-size: 14px; font-weight: 600; display: block; }
.set span { font-size: 12.5px; color: var(--ink-3); display: block; }
.panel { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--rule-2); display: flex; flex-direction: column; gap: 12px; }
.pair-code { font: 500 28px var(--mono); letter-spacing: .06em; text-align: center; padding: 8px 0; user-select: all; -webkit-user-select: all; }
.log time { font-size: 12px; color: var(--ink-3); white-space: nowrap; flex: none; }

/* bottom navigation (phone) */
.bottom {
  position: fixed; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: repeat(2, 1fr); z-index: 10;
  padding: 8px 10px calc(10px + env(safe-area-inset-bottom)); background: linear-gradient(transparent, var(--paper) 30%);
}
.bottom button { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 11.5px; color: var(--ink-3); padding: 6px 0; min-height: 48px; }
.bottom button[aria-current=page] { color: var(--ink); font-weight: 600; }
.bottom .icon { width: 23px; height: 23px; }

/* side navigation (desktop) */
.nv { display: flex; align-items: center; gap: 11px; padding: 0 10px; min-height: 44px; border-radius: 10px; color: var(--ink-2); font-size: 14px; width: 100%; text-align: left; }
.nv .icon { width: 19px; height: 19px; }
.nv:hover { background: var(--paper-2); }
.nv[aria-current=page] { background: var(--ink); color: var(--paper); }
.side .brand { padding: 4px 8px 18px; }
.side .me { margin-top: auto; font-size: 13px; color: var(--ink-3); padding: 10px; border-top: 1px solid var(--rule); display: flex; gap: 8px; align-items: center; overflow-wrap: anywhere; }

/* re-auth dialog: bottom sheet on phone, 420 px modal on desktop */
dialog.sheet {
  margin: auto 0 0; width: 100%; max-width: 100%; border: 0; border-top: 1px solid var(--rule);
  border-radius: 22px 22px 0 0; background: var(--card); color: var(--ink); padding: 20px 18px calc(20px + env(safe-area-inset-bottom));
}
dialog.sheet::backdrop { background: #0007; }
dialog.sheet h2 { font-family: var(--serif); font-weight: 400; font-size: 24px; margin-bottom: 6px; }
dialog.sheet .btns .btn { flex: 1; }

/* new version banner (v1.8, T5) */
.update-bar {
  position: fixed; left: 50%; top: calc(10px + env(safe-area-inset-top, 0px)); transform: translateX(-50%);
  display: flex; align-items: center; justify-content: space-between; gap: 12px; z-index: 250;
  max-width: 420px; width: calc(100% - 32px); padding: 8px 8px 8px 14px; border-radius: 12px;
  background: var(--card); color: var(--ink); border: 1px solid var(--rule-2); box-shadow: var(--shadow); font-size: 14px;
}
.update-bar[hidden] { display: none; }
/* v1.9: while the banner is shown the page reserves its height (measured by main.js into --update-bar-h),
   so it never covers the logo, the title or the first group */
:root { --update-bar-h: 62px; }
body.has-update-bar {
  --update-bar-space: calc(var(--update-bar-h) + 18px + env(safe-area-inset-top, 0px));
  padding-top: var(--update-bar-space);
}
body.has-update-bar .app, body.has-update-bar .shell, body.has-update-bar .main, body.has-update-bar .login {
  min-height: calc(100vh - var(--update-bar-space));
}
@media (min-width: 1000px) {
  body.has-update-bar .side { top: var(--update-bar-space); height: calc(100vh - var(--update-bar-space)); }
}

/* toast */
.toast {
  position: fixed; left: 50%; bottom: 96px; transform: translate(-50%, 20px); background: var(--ink); color: var(--paper);
  padding: 12px 14px; border-radius: 12px; font-size: 14px; z-index: 300; opacity: 0; transition: .25s; pointer-events: none;
  max-width: 420px; width: calc(100% - 36px);
}
.toast.on { transform: translate(-50%, 0); opacity: 1; }
.toast.warn { background: var(--amber); color: var(--paper); }

.only-desk { display: none !important; }

@media (min-width: 1000px) {
  .shell { grid-template-columns: 240px 1fr; }
  .side {
    display: flex; flex-direction: column; gap: 2px; padding: 22px 14px; border-right: 1px solid var(--rule);
    background: color-mix(in srgb, var(--card) 60%, transparent); height: 100vh; position: sticky; top: 0;
  }
  .bottom { display: none; }
  .page { padding: 0 32px 60px; }
  .top { padding: 26px 0 14px; }
  .grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
  .only-phone { display: none !important; }
  .only-desk { display: revert !important; }
  .collapsed .qr-box { display: flex; }
  .login .inner.wide { max-width: 640px; }
  .totp-grid { display: grid; grid-template-columns: 250px 1fr; gap: 22px; align-items: start; }
  dialog.sheet { margin: auto; width: 420px; border: 1px solid var(--rule); border-radius: 22px; padding: 22px; box-shadow: 0 40px 90px -30px #000a; }
  .toast { bottom: 28px; }
}

@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; padding: 0; margin: -1px; }
@media (min-width: 1000px) { .totp-grid .qr-col { order: -1; } }
.row .t .pill { display: inline-block; font-size: 10px; color: var(--ink-2); }
.row .t .pill.green { color: var(--green); }
@media (max-width: 999px) {
  .row { flex-wrap: wrap; }
  .row .t { flex: 1 1 170px; }
  .row .acts { max-width: none; margin-left: 48px; justify-content: flex-start; }
  .log .row .t { flex-basis: 0; }
}
.login .inner > .warn, .login .inner > .ok-box { margin-bottom: 14px; }

/* settings: collapsible groups (v1.7, T3) - native <details>/<summary> */
.groups { display: flex; flex-direction: column; gap: 12px; margin-top: 4px; }
details.group { border-top: 1px solid var(--rule-2); }
details.group > summary {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; padding: 8px 2px;
  cursor: pointer; list-style: none; font-family: var(--serif); font-size: 22px; letter-spacing: -.01em; color: var(--ink);
}
details.group > summary::-webkit-details-marker { display: none; }
details.group > summary::after {
  content: ""; flex: none; width: 10px; height: 10px; margin-right: 6px; border-right: 2px solid var(--ink-2);
  border-bottom: 2px solid var(--ink-2); transform: rotate(45deg) translate(-2px, -2px); transition: transform .15s;
}
details.group[open] > summary::after { transform: rotate(-135deg) translate(-2px, -2px); }
details.group > summary:hover { color: var(--ink-2); }
details.group > .group-body { padding-bottom: 8px; }
details.group > .group-body > div > .card:first-child { margin-top: 0; }
@media (max-width: 999px) {
  details.group > .group-body > div + div > .card:first-child { margin-top: 14px; }
}

/* login: "Nie pamiętasz hasła?" (v1.7, T4) */
.forgot { display: flex; flex-direction: column; gap: 4px; margin-top: -8px; }
.forgot .link { align-self: flex-start; }
.forgot .note { background: var(--paper-2); border-radius: 12px; padding: 10px 12px; }

/* login: invitation code (K0 v1.11, §13.2) - read-only login from the code, links under the form */
.field input[readonly] { background: var(--paper-2); color: var(--ink-2); border-style: dashed; }
.auth-alt { margin-top: 10px; display: flex; flex-direction: column; align-items: flex-start; }
.login .field > .info-row { justify-content: space-between; flex-wrap: nowrap; }
.login .field > .info-row .ibtn { width: 44px; height: 44px; margin: -12px -10px -12px 0; }

/* ======================= K1: accounts, categories, projects (spec K1 §4, §6) ======================= */
.serif { font-family: var(--serif); font-weight: 400; }
.tile.tc-none { background: var(--paper-2); color: var(--ink-2); }
.tile .icon { width: 20px; height: 20px; }
.tile.sm { width: 28px; height: 28px; border-radius: 8px; }
.tile.sm .icon { width: 16px; height: 16px; }
.tile.lg { width: 46px; height: 46px; border-radius: 14px; }
.tile.lg .icon { width: 24px; height: 24px; }
:root[data-theme=dark] .tile.tc-1d1a16 { box-shadow: inset 0 0 0 1px #ffffff33; }
@media (prefers-color-scheme: dark) { :root:not([data-theme=light]) .tile.tc-1d1a16 { box-shadow: inset 0 0 0 1px #ffffff33; } }
.out { color: var(--red); }

/* top bar, back link */
.top-acts { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.back { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; margin-top: 8px; color: var(--ink-2); text-decoration: none; font-size: 14px; }
.back .icon { width: 18px; height: 18px; }
.lead { margin: -2px 0 6px; }
.tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 6px; }


/* "Więcej" */
.more-list { padding: 6px 16px; }
.more-item { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 60px; padding: 8px 0; border-bottom: 1px solid var(--rule); text-align: left; }
.more-item:last-child { border-bottom: 0; }
.more-item .t { flex: 1; display: flex; flex-direction: column; }
.more-item .t b { font-size: 15px; }
.more-item .t span { font-size: 12.5px; color: var(--ink-3); }
.chev { font-size: 22px; color: var(--ink-3); line-height: 1; }
.set-link { text-decoration: none; }

/* rows, amounts, menus */
.row .a { font: 500 15px var(--mono); font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; flex: none; }
.row .a small { display: block; font: 11px var(--sans); color: var(--ink-3); }
.row.dim { opacity: .6; }
.row.flat { border: 0; padding-top: 0; }
.row a.t { text-decoration: none; min-height: 44px; display: flex; flex-direction: column; justify-content: center; }
.ibtn { width: 44px; height: 44px; display: inline-grid; place-items: center; border-radius: 12px; color: var(--ink-2); flex: none; }
.ibtn:hover { background: var(--paper-2); }
.mw { position: relative; flex: none; }
.menu {
  position: absolute; right: 0; top: calc(100% + 4px); background: var(--card); border: 1px solid var(--rule); border-radius: 12px;
  padding: 6px; z-index: 25; box-shadow: 0 20px 40px -20px #000a; min-width: 240px;
}
.menu button { display: flex; gap: 10px; align-items: center; width: 100%; min-height: 44px; padding: 0 10px; border-radius: 8px; font-size: 14px; text-align: left; }
.menu button:hover { background: var(--paper-2); }
.menu button:disabled { opacity: .5; cursor: not-allowed; }
.menu small { display: block; font-size: 11px; color: var(--ink-3); }
.menu .icon { width: 18px; height: 18px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 12px; border-radius: 99px;
  border: 1px solid var(--rule-2); background: var(--card); font-size: 13px; color: var(--ink-2); white-space: nowrap;
}
.chip .icon { width: 16px; height: 16px; }
.chip.cat { padding: 0 12px 0 6px; white-space: normal; text-align: left; }
.chip.dim { opacity: .6; }
.dot { width: 14px; height: 14px; border-radius: 5px; flex: none; }
.dot.tc-none { background: var(--rule-2); }

/* accounts list + detail */
.split { display: block; }
.split.has-detail .list-col { display: none; }
.acc { border-bottom: 1px solid var(--rule); }
.acc:last-child { border-bottom: 0; }
.acc > .row { border-bottom: 0; }
.acc.sel > .row { background: color-mix(in srgb, var(--s1) 10%, transparent); border-radius: 12px; }
.acc-env { padding: 0 0 12px 48px; }
.envsplit { display: flex; flex-direction: column; gap: 8px; margin: 4px 0 10px; }
svg.envbar { display: block; width: 100%; height: 14px; border-radius: 99px; overflow: hidden; }
svg.envbar rect { fill: var(--tc, var(--rule-2)); }
svg.envbar rect.free { fill: var(--rule-2); }
.legend { display: flex; gap: 6px 14px; flex-wrap: wrap; font-size: 12px; color: var(--ink-2); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.legend i.free, .legend i.tc-none { background: var(--rule-2); }
details.card > summary { list-style: none; cursor: pointer; min-height: 44px; display: flex; align-items: center; }
details.card > summary::-webkit-details-marker { display: none; }
details.card > summary::after { content: "›"; margin-left: auto; font-size: 20px; transition: transform .15s; }
details.card[open] > summary::after { transform: rotate(90deg); }
.facts { display: flex; gap: 10px 22px; flex-wrap: wrap; margin: 10px 0 6px; }
.facts > div { display: flex; flex-direction: column; }
.facts span { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
.facts b { font: 500 20px var(--mono); letter-spacing: -.02em; }
.acc-head .row .t b, .card.project .t b.serif { font-size: 22px; font-weight: 400; }
.acc-head .btns { margin-top: 10px; }
.empty-card { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.h-acts { display: flex; gap: 6px; flex-wrap: wrap; }

/* sheets (dialog): bottom sheet on phone, modal on desktop; .full = full screen on phone */
dialog.sheet { max-height: 92vh; overflow: auto; }
dialog.sheet.full { margin: 0; height: 100%; max-height: 100%; border-radius: 0; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.sheet-head h2 { margin: 0; }
.sheet-body > .lf { gap: 14px; }
.field select, .field textarea {
  width: 100%; min-height: 48px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--rule-2); background: var(--card); font-size: 16px;
}
.field input[type=date] { min-width: 0; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-items: start; }
.two > * { min-width: 0; }
.amount-side { display: flex; flex-direction: column; gap: 8px; }
.amount-side .seg { align-self: flex-start; }
.field-label { font-size: 12.5px; color: var(--ink-2); }
.info-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.info-row .field { flex: 1; }
.info-text { background: var(--paper-2); border-radius: 10px; padding: 8px 10px; }
.type-tiles { border: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.type-tiles legend, .swatches legend, .checklist legend, .comps legend { font-size: 12.5px; color: var(--ink-2); margin-bottom: 6px; }
.type-opt {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; min-height: 64px; padding: 8px 4px;
  border-radius: 12px; border: 1px solid var(--rule-2); background: var(--card); font-size: 12px; text-align: center; cursor: pointer;
}
.type-opt input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.type-opt:has(input:checked) { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.type-opt:has(input:disabled) { opacity: .45; cursor: not-allowed; }
.type-opt:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }
.card-section { display: flex; flex-direction: column; gap: 10px; padding: 12px; border-radius: 14px; background: var(--paper-2); }
.icon-field { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.icon-field .field-label { width: 100%; }
.swatches { border: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.swatches legend { width: 100%; }
.swatch { position: relative; width: 44px; height: 44px; border-radius: 12px; cursor: pointer; display: grid; place-items: center; }
.swatch input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; margin: 0; cursor: pointer; }
.swatch:has(input:checked) { box-shadow: 0 0 0 3px var(--card), 0 0 0 5px var(--ink); }
.swatch:has(input:checked)::after { content: ""; width: 12px; height: 7px; border-left: 2px solid #fff; border-bottom: 2px solid #fff; transform: rotate(-45deg) translate(1px, -2px); }
.swatch:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 4px; }
.rec-live { font-size: 14px; color: var(--ink-2); min-height: 22px; }
.rec-live .diff { color: var(--amber); }
.search { display: flex; align-items: center; gap: 8px; border: 1px solid var(--rule-2); background: var(--card); border-radius: 12px; padding: 0 10px; min-height: 48px; }
.search input { border: 0; background: transparent; outline: 0; flex: 1; font-size: 16px; min-width: 0; min-height: 44px; }
.search .icon { width: 18px; height: 18px; color: var(--ink-3); }
.icon-grid { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.icon-grid .icons { display: grid; grid-template-columns: repeat(auto-fill, minmax(48px, 1fr)); gap: 6px; }
.icon-opt { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 12px; }
.icon-opt[aria-pressed=true] { box-shadow: 0 0 0 2px var(--ink); }
.icon-opt:hover { background: var(--paper-2); }

/* categories */
.cat-list { display: flex; flex-direction: column; }
.cat-row { display: flex; align-items: center; gap: 6px; min-height: 52px; border-bottom: 1px solid var(--rule); }
.cat-row.sub { padding-left: 34px; min-height: 48px; }
.cat-row .exp .chev { display: inline-block; transition: transform .15s; }
.cat-row .exp.open .chev { transform: rotate(90deg); }
.exp-sp { width: 44px; flex: none; }
.cat-open { flex: 1; display: flex; align-items: center; gap: 10px; min-height: 44px; min-width: 0; text-align: left; }
.cat-name { font-weight: 600; font-size: 14px; overflow-wrap: anywhere; }
.cat-row.sub .cat-name { font-weight: 500; }
.cat-open .count { font-size: 12px; color: var(--ink-3); }
.hide-btn { flex: none; color: var(--ink-3); }
.hide-btn .icon { width: 20px; height: 20px; }
.row.tap { width: 100%; text-align: left; border-radius: 0; }
@media (hover: hover) { .row.tap:hover { background: color-mix(in srgb, var(--paper-2) 70%, transparent); } }
.row.tap:focus-visible { outline-offset: -2px; }
.cat-children { border-bottom: 1px solid var(--rule); padding-bottom: 8px; }
.cat-children .cat-row:last-of-type { border-bottom: 0; }
.add-sub { margin: 6px 0 0 34px; }
.hidden-cats .row { padding: 6px 0; }
.btns.order .btn { flex: 1; }

/* rules */
.row.rule { align-items: flex-start; }
.row.rule .chips { margin-top: 6px; }
.suggest { margin-top: 10px; min-height: 22px; }
.checklist { border: 0; max-height: 46vh; overflow: auto; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.checklist .check-row { gap: 10px; }
.checklist .check-row.sub { padding-left: 28px; }
.inline-field select { min-height: 44px; padding: 0 10px; border-radius: 10px; border: 1px solid var(--rule-2); background: var(--card); font-size: 14px; }

/* projects */
.grid3 { display: grid; grid-template-columns: 1fr; gap: 14px; margin-top: 14px; }
.grid3 > .card { margin-top: 0; }
.card.project { display: block; text-decoration: none; }
.card.project:hover { border-color: var(--rule-2); }
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 10px; }
.tbl th { font-weight: 500; color: var(--ink-3); text-align: right; padding: 6px 8px; border-bottom: 1px solid var(--rule-2); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; }
.tbl th:first-child, .tbl td:first-child { text-align: left; font-family: var(--sans); }
.tbl td { padding: 7px 8px; border-bottom: 1px solid var(--rule); text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; }
.group-label { margin-top: 12px; }
.totals { border-top: 1px dashed var(--rule-2); padding-top: 10px; }
.split-box { display: flex; flex-direction: column; gap: 8px; }
.comps { border: 0; display: flex; flex-direction: column; gap: 8px; }
.comp-input { display: flex; gap: 6px; align-items: center; }
.comp-input input { flex: 1; min-height: 48px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--rule-2); background: var(--card); font-size: 16px; min-width: 0; }
.comps .chip { align-self: flex-start; }

/* toast with "Cofnij" */
.toast { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.toast.has-action { pointer-events: auto; padding: 6px 6px 6px 14px; }
.toast-btn { min-height: 44px; padding: 0 14px; border-radius: 10px; font-weight: 600; color: var(--paper); text-decoration: underline; text-underline-offset: 3px; flex: none; }


@media (max-width: 999px) {
  #p-view .row .acts { margin-left: auto; flex: none; max-width: 100%; }
  .acc-env { padding-left: 0; }
  .acc > .row { flex-wrap: nowrap; }
  .acc > .row .t { flex: 1 1 auto; }
}
@media (max-width: 420px) {
  .type-tiles { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1000px) {
  .split.has-detail { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 18px; align-items: start; }
  .split.has-detail .list-col { display: block; }
  .split:not(.has-detail) .list-col { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; align-items: start; }
  .grid3 { grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); }
  dialog.sheet.full { margin: auto; width: 560px; height: auto; max-height: 90vh; border-radius: 22px; }
  dialog.sheet.wide { width: 560px; }
}

/* ======================= K1 UX fixes (docs/specs/K1_UX_poprawki.md) ======================= */
/* U1: sheet form = header · fields · pinned footer (sticky inside the scrolling dialog, safe area) */
.sheet-foot {
  position: sticky; bottom: 0; z-index: 2; margin: 14px -18px 0; padding: 10px 18px calc(10px + env(safe-area-inset-bottom));
  background: var(--card); border-top: 1px solid var(--rule); display: flex; flex-direction: column; gap: 8px;
}
dialog.sheet:has(.sheet-foot) { padding-bottom: 0; }
.foot-btns { display: flex; align-items: center; gap: 12px; }
.foot-btns .btn.primary { flex: 1; min-height: 48px; font-size: 15px; border-radius: 14px; }
.foot-btns .cancel { display: none; }
.sheet-sub { font-size: 14px; color: var(--ink-2); margin: -4px 0 8px; }
/* "Więcej" */
details.more { border-top: 1px solid var(--rule); }
details.more > summary {
  list-style: none; cursor: pointer; min-height: 44px; display: flex; align-items: center; gap: 4px; font-size: 13.5px; color: var(--ink-2);
}
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary::after { content: "\25BE"; margin-left: auto; padding-left: 8px; font-size: 14px; transition: transform .15s; }
details.more[open] > summary::after { transform: rotate(180deg); }
.more-t { font-weight: 600; flex: none; }
.more-sum { color: var(--ink-3); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
details.more[open] .more-sum { display: none; }
.more-body { display: flex; flex-direction: column; gap: 12px; padding: 4px 0 6px; }
/* inline field error */
.field-err { font-size: 12.5px; }
.field select[aria-invalid=true] { border-color: var(--red); }
/* "Wygląd" row */
.looks { display: flex; align-items: center; gap: 10px; }
.looks .field-label { flex: 1; }
/* chip radios (type of account, kind of project, envelope target): one row */
.chip-radios { border: 0; min-width: 0; }
.chip-radios legend { font-size: 12.5px; color: var(--ink-2); margin-bottom: 6px; }
.chip-row { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 2px; margin: -2px; }
.chip-row::-webkit-scrollbar { display: none; }
.chip-row .type-opt {
  position: relative; flex: none; display: inline-flex; flex-direction: row; align-items: center; gap: 6px; min-height: 44px;
  padding: 0 12px 0 8px; border-radius: 99px; border: 1px solid var(--rule-2); background: var(--card); font-size: 13px;
  white-space: nowrap; cursor: pointer;
}
.chip-row .type-opt:not(:has(.tile)) { padding: 0 14px; }
.chip-row .type-opt input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.chip-row .type-opt:has(input:checked) { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.chip-row .type-opt:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }
.chip-row .type-opt .tile.sm { width: 26px; height: 26px; }
.chip-row .type-opt .amt { color: var(--ink-3); font-family: var(--mono); font-size: 12px; }
.type-locked { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink-2); flex-wrap: wrap; }
/* colour swatches: one scrolling row, the last one half visible */
.swatches.row1 { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding: 6px 4px; margin: 0 -4px; }
.swatches.row1::-webkit-scrollbar { display: none; }
.swatches.row1 .swatch { flex: none; }
/* amount + "Wszystko" */
.amt-row { display: flex; gap: 8px; align-items: flex-end; }
.amt-row .field { flex: 1; }
.amt-row .chip { flex: none; min-height: 48px; }
.amt-hint { margin-top: -6px; }
/* action sheet / menu (U2) */
.menu-list { display: flex; flex-direction: column; }
dialog.action-sheet .menu-list button, .action-menu .menu-list button {
  display: flex; gap: 12px; align-items: center; width: 100%; min-height: 52px; padding: 0 8px; border-radius: 10px;
  font-size: 15px; text-align: left; border-bottom: 1px solid var(--rule);
}
.action-menu .menu-list button { min-height: 44px; font-size: 14px; border-bottom: 0; }
dialog.action-sheet .menu-list button:last-child { border-bottom: 0; }
.menu-list button.danger { color: var(--red); }
.menu-list button.armed { background: var(--red); color: var(--on-red); }
.menu-list button:disabled { opacity: .55; cursor: not-allowed; }
.menu-list button small { display: block; font-size: 11.5px; color: var(--ink-3); }
.menu-list button:hover:not(:disabled) { background: var(--paper-2); }
.menu-list .icon { width: 19px; height: 19px; }
/* envelope row = button (52 px) */
.env-item { position: relative; }
.env-btn { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 52px; text-align: left; border-bottom: 1px solid var(--rule); }
.env-item:last-of-type .env-btn { border-bottom: 0; }
.env-btn .t { flex: 1; min-width: 0; font-weight: 600; font-size: 14px; overflow-wrap: anywhere; }
.env-btn .a { font: 500 15px var(--mono); font-variant-numeric: tabular-nums; }
.env-btn .chev { font-size: 20px; }
@media (hover: hover) { .env-btn:hover { background: color-mix(in srgb, var(--paper-2) 70%, transparent); } }
.env-empty { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
a.envsplit-link { display: block; text-decoration: none; min-height: 44px; }
/* account / project head: "⋯" */
[data-menu-host] { position: relative; }
.head-row { display: flex; align-items: flex-start; gap: 8px; }
.head-row > .row { flex: 1; min-width: 0; }
/* history (U4) */
.hist-filter { margin: 2px 0 6px; }
.hist-more { margin-top: 8px; }
.detail-facts { display: flex; flex-direction: column; font-size: 14px; }
.detail-facts > div { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--rule); padding: 8px 0; }
.detail-facts > div:last-child { border-bottom: 0; }
.detail-facts span { color: var(--ink-3); }
/* projects: estimate groups by component */
.grp-head { display: flex; align-items: center; gap: 4px; margin-top: 10px; border-bottom: 1px solid var(--rule-2); }
.grp-head .grp-btn {
  flex: 1; display: flex; align-items: center; gap: 8px; min-height: 44px; text-align: left; font-size: 11px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--ink-2); font-weight: 600;
}
.grp-head .grp-btn .mono { margin-left: auto; letter-spacing: 0; font-size: 13px; color: var(--ink-2); text-transform: none; }
.grp-head .grp-btn.static { cursor: default; }
.plan-line { margin-top: 8px; font-size: 14px; color: var(--ink-2); }
.plan-line b { font-family: var(--mono); font-weight: 500; }
.total-big { display: flex; flex-direction: column; margin-top: 4px; }
.total-big span { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
.total-big b { font: 500 24px var(--mono); letter-spacing: -.02em; }
.per-person { display: flex; flex-direction: column; margin-top: 6px; }
.per-person > div { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 4px 0; font-size: 14px; }
@media (min-width: 1000px) { #p-view [data-role=estimates] { max-width: 760px; } }
.per-person b { font-family: var(--mono); font-weight: 500; font-variant-numeric: tabular-nums; }
.row .t span .shares, .row .t span .shares b { display: inline; }
.shares b.mono { font-weight: 600; color: var(--ink-2); font-size: 12px; }
.row .t span.info-row { display: flex; }
/* estimate form */
.comp-chip { align-self: flex-start; }
.comp-new { font-size: 12.5px; color: var(--ink-2); }
.split-amounts { display: flex; flex-direction: column; gap: 10px; }
/* category picker (B2) */
.cat-pick {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 48px; padding: 0 12px 0 8px; border-radius: 12px;
  border: 1px solid var(--rule-2); background: var(--card); text-align: left; font-size: 15px;
}
.cat-pick-v { flex: 1; display: flex; align-items: center; gap: 8px; min-width: 0; overflow-wrap: anywhere; }
.cat-pick-list { display: flex; flex-direction: column; margin-top: 10px; }
.cat-opt { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 48px; padding: 0 6px; text-align: left; border-bottom: 1px solid var(--rule); font-size: 15px; cursor: pointer; }
.cat-opt.sub { padding-left: 34px; font-size: 14px; }
.cat-opt[aria-pressed=true] { font-weight: 600; }
.cat-opt[aria-selected=true] { background: var(--paper-2); }
.combo { position: relative; }
.cat-listbox {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 5; max-height: 300px; overflow: auto; background: var(--card);
  border: 1px solid var(--rule-2); border-radius: 12px; box-shadow: 0 20px 40px -20px #000a; padding: 4px;
}
.cat-listbox .cat-opt { min-height: 44px; border-bottom: 0; border-radius: 8px; }
.rule-cats { display: flex; flex-direction: column; gap: 8px; }
@media (min-width: 1000px) {
  .sheet-foot { margin: 14px -22px 0; padding: 12px 22px 14px; }
  .foot-btns { justify-content: space-between; }
  .foot-btns .cancel { display: inline-flex; }
  .foot-btns .btn.primary { flex: 0 1 auto; min-width: 180px; }
  .chip-row { flex-wrap: wrap; overflow: visible; }
  dialog.sheet.action-sheet { width: 360px; }
  .action-menu { right: 0; top: calc(100% - 4px); }
}

/* ======================= K1 UX round 2 (K1_UX_poprawki.md "Runda 2", mockup k1-konta-wyglad) ======================= */
/* 1: no horizontal scrolling of a sheet (a fieldset is min-width: min-content by default) */
.swatches { min-width: 0; }
dialog.sheet { overflow-x: hidden; }
.sheet-head .sheet-back { margin-left: -10px; }
.sheet-head h2 { flex: 1; min-width: 0; }

/* 2: "Wygląd" picker - preview, quick icons, "Więcej ikon", colours; "Wszystkie ikony" in the same dialog */
dialog.sheet.looks-pick[open] { display: flex; flex-direction: column; overflow: hidden; padding: 0; }
.looks-pick .sheet-head { flex: none; margin: 0; padding: 12px 8px 4px 18px; min-height: 60px; }
.looks-pick .sheet-body {
  flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; padding: 4px 18px 16px; overscroll-behavior: contain;
  scrollbar-width: thin; scrollbar-color: var(--rule-2) transparent;
}
.looks-pick .sheet-foot { position: static; flex: none; margin: 0; }
.looks-pick .pv { display: flex; align-items: center; gap: 12px; padding: 2px 0 14px; }
.looks-pick .pv .t { display: flex; flex-direction: column; min-width: 0; }
.looks-pick .pv .t b { font-weight: 600; font-size: 15px; overflow-wrap: anywhere; }
.looks-pick .pv .t span { font-size: 12.5px; color: var(--ink-3); }
.looks-pick p.label { display: block; margin: 6px 0 8px; }
.looks-pick .icon-grid { margin-top: 0; gap: 4px; }
.looks-pick .icon-grid p.label { margin: 12px 0 6px; }
.looks-pick .icon-grid p.label .mono { letter-spacing: 0; }
.icon-opt[aria-pressed=true] { box-shadow: 0 0 0 2px var(--card), 0 0 0 4px var(--ink); }
.more-row {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 48px; margin-top: 10px; padding: 0 6px 0 12px;
  border: 1px solid var(--rule-2); border-radius: 12px; text-align: left; font-size: 14px; color: var(--ink-2);
}
.more-row .icon { width: 18px; height: 18px; color: var(--ink-3); }
.more-row .ml { flex: 1; }
.more-row .cnt { font-size: 12px; color: var(--ink-3); }
.looks-main .more-row + p.label { margin-top: 16px; }
/* colours: phone = one row scrolling only inside itself (snap, no chaining to the page) */
.looks-pick .swatches.row1 {
  margin: 0 -18px; padding: 6px 18px 8px; gap: 8px; scroll-snap-type: x proximity; overscroll-behavior-x: contain;
  scroll-padding: 0 18px;
}
.looks-pick .swatch { scroll-snap-align: start; }
.looks-pick .search { position: sticky; top: 0; z-index: 2; box-shadow: 0 -8px 0 var(--card); }
.chipf { display: flex; gap: 6px; flex-wrap: wrap; margin: 10px 0 2px; }
.chipf-b {
  min-height: 44px; padding: 0 12px; border-radius: 99px; border: 1px solid var(--rule-2); font-size: 12.5px; color: var(--ink-2);
}
.chipf-b[aria-pressed=true] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.looks-pick.all-view { height: 100%; max-height: 100%; margin: 0; border-radius: 0; }

/* 3: account list - collapsible groups, rows = links, thin envelope bar, tooltip with the envelopes */
.card.grp { padding: 0; }
.card h2.grp-hd { margin: 0; font: inherit; letter-spacing: normal; text-transform: none; color: inherit; }
.grp-h {
  display: flex; align-items: center; gap: 8px; width: 100%; min-height: 48px; padding: 0 14px; text-align: left;
  border-radius: 17px;
}
.grp[data-open=true] .grp-h { border-radius: 17px 17px 0 0; }
.grp-h .label { flex: 1; }
.grp-h .chv { width: 18px; text-align: center; color: var(--ink-3); transition: transform .15s; }
.grp[data-open=false] .chv { transform: rotate(-90deg); }
.grp-h .cnt { font-size: 11px; color: var(--ink-3); border: 1px solid var(--rule-2); border-radius: 99px; padding: 0 6px; }
.grp-h .sum { font-size: 13.5px; font-weight: 500; color: var(--ink-2); }
.grp-h .sum-k { margin-left: 6px; font: 11px var(--sans); color: var(--ink-3); }
.acc-row { position: relative; border-top: 1px solid var(--rule); }
.acc-row.dim { opacity: .6; }
.acc-link { display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 8px 14px; text-decoration: none; color: inherit; }
.acc-link:focus-visible { outline-offset: -2px; }
.grp-b > .acc-row:last-child .acc-link { border-radius: 0 0 17px 17px; }
.acc-link .t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.acc-link .t b { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acc-link .t .sub { font-size: 12px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acc-link .a { font: 500 15px var(--mono); font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; flex: none; }
.acc-link .a small { display: block; font: 11px var(--sans); color: var(--ink-3); }
@media (hover: hover) { .acc-link:hover { background: color-mix(in srgb, var(--paper-2) 70%, transparent); } }
.minibar-wrap { position: relative; display: block; padding: 3px 0; }
svg.minibar { display: block; width: 100%; height: 4px; border-radius: 99px; }
svg.minibar rect { fill: var(--tc, var(--rule-2)); }
svg.minibar rect.free { fill: var(--rule-2); }
.env-tip {
  display: none; position: absolute; left: 0; top: 100%; z-index: 30; min-width: 230px; max-width: 320px; padding: 8px 12px;
  background: var(--card); color: var(--ink); border: 1px solid var(--rule-2); border-radius: 12px; box-shadow: 0 20px 40px -20px #000a;
  font-size: 13px; white-space: nowrap;
}
.tip-row { display: flex; align-items: center; gap: 8px; min-height: 26px; }
.tip-row span { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.tip-row b { font-weight: 500; }
.tip-row.free { color: var(--ink-2); border-top: 1px solid var(--rule); margin-top: 2px; }
.tip-row .dot { width: 10px; height: 10px; border-radius: 3px; }
.tip-row .dot.free { background: var(--rule-2); }
details.card.inactive { padding: 0; }
details.card.inactive > summary { padding: 0 14px; min-height: 48px; }

/* 6: estimate preview */
.ep-amt { font: 500 30px var(--mono); letter-spacing: -.02em; }
.ep-desc { font-size: 20px; margin-top: 2px; overflow-wrap: anywhere; }
.kv { margin-top: 14px; border-top: 1px solid var(--rule); }
.kv > div {
  display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 48px; padding: 6px 0;
  border-bottom: 1px solid var(--rule); font-size: 14px;
}
.kv > div > span:first-child { color: var(--ink-3); flex: none; }
.kv .v { display: flex; align-items: center; gap: 8px; text-align: right; justify-content: flex-end; min-width: 0; overflow-wrap: anywhere; }
.kv .v .sub { display: block; font-size: 12.5px; color: var(--ink-3); }
@media (max-width: 999px) { dialog.sheet.no-edit .sheet-foot { display: none; } }

@media (min-width: 1000px) {
  .looks-pick .sheet-head { padding: 12px 8px 4px 22px; }
  .looks-pick .sheet-body { padding: 4px 22px 18px; }
  .looks-pick .sheet-foot { padding: 12px 22px 14px; }
  .looks-pick.all-view { height: min(720px, 86vh); max-height: none; margin: auto; border-radius: 22px; }
  .looks-pick .swatches.row1 {
    display: grid; grid-template-columns: repeat(9, 44px); gap: 10px; overflow: visible; margin: 0; padding: 6px 2px 4px;
  }
  dialog.sheet.narrow { width: 440px; }
  .acc-link .minibar-wrap:hover .env-tip, .acc-link:focus-visible .env-tip { display: block; }
  .acc-link[data-tip-off] .env-tip { display: none !important; }

  /* 4: accounts page = column of the viewport height; list and details scroll on their own */
  #p-view[data-view=accounts] {
    flex: none; height: calc(100vh - var(--update-bar-space, 0px)); display: flex; flex-direction: column; padding-bottom: 0;
    overflow: hidden;
  }
  #p-view[data-view=accounts] > .top { flex: none; }
  #p-view[data-view=accounts] > .split {
    flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px;
  }
  #p-view[data-view=accounts] > .split.has-detail { grid-template-columns: 340px minmax(0, 1fr); align-items: stretch; }
  #p-view[data-view=accounts] .pane {
    min-height: 0; overflow-y: auto; overflow-x: hidden; padding: 0 6px 24px 0; overscroll-behavior: contain;
    scrollbar-width: thin; scrollbar-color: var(--rule-2) transparent; scrollbar-gutter: stable;
  }
  #p-view[data-view=accounts] .pane:hover { scrollbar-color: var(--ink-3) transparent; }
  #p-view[data-view=accounts] .pane:focus-visible { outline-offset: -2px; }
  .split:not(.has-detail) .list-col { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; align-content: start; align-items: start; }
  .split .list-col > .card { margin-top: 0; }
  .list-col .grp-hd { position: sticky; top: 0; z-index: 3; }
  .list-col .grp-h { background: var(--card); }
  .list-col .grp[data-open=true] .grp-h { box-shadow: 0 1px 0 var(--rule); }
  .list-col .grp[data-open=true] .grp-b > .acc-row:first-child { border-top: 0; }
  /* compact list next to the details: 44 px rows, no envelope bar, selected row marked */
  .split.has-detail .list-col { display: block; }
  .split.has-detail .list-col > .card { margin: 0; border-radius: 0; box-shadow: none; border-top-width: 0; }
  .split.has-detail .list-col > .card:first-child { border-top-width: 1px; border-radius: 18px 18px 0 0; }
  .split.has-detail .list-col > .card:last-child { border-radius: 0 0 18px 18px; }
  .split.has-detail .list-col > .card:only-child { border-radius: 18px; }
  .split.has-detail .grp-h { min-height: 44px; border-radius: 0; }
  .split.has-detail .list-col > .card:first-child .grp-h { border-radius: 17px 17px 0 0; }
  .split.has-detail .acc-link { min-height: 44px; padding: 0 14px; gap: 10px; border-radius: 0; }
  .split.has-detail .acc-link .tile { width: 28px; height: 28px; border-radius: 8px; }
  .split.has-detail .acc-link .tile .icon { width: 16px; height: 16px; }
  .split.has-detail .acc-link .t b { font-weight: 400; font-size: 13.5px; }
  .split.has-detail .acc-link .sub, .split.has-detail .acc-link .minibar-wrap, .split.has-detail .acc-link .a small { display: none; }
  .split.has-detail .acc-link .a { font-size: 13px; color: var(--ink-2); }
  .acc-link[aria-current=true] { background: color-mix(in srgb, var(--s1) 13%, var(--card)); box-shadow: inset 3px 0 0 var(--s1); }
  .acc-link[aria-current=true] .t b { font-weight: 600; }
  .acc-link[aria-current=true] .a { color: var(--ink); }
  .detail-col { padding-right: 10px; }
  .detail-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; align-items: start; }
  .detail-grid > .card { margin-top: 0; }
  .detail-grid > .acc-head, .detail-grid > .span { grid-column: 1 / -1; }
}

/* T1 (spec K2 §17.12a, T-K2-30, v1.10 r2): small muted text in --ink-3 only on --paper and --card; on --paper-2
   and the *-soft backgrounds it is --ink-2 (--ink-3 on --paper-2 = 4,40 : 1, below AA) */
.info-text, .info-text .hint, .card-section .hint, .card-section .label, .card-section small, .card-section .count,
.tx-notes .label, .preview, .warn .hint, .ok-box .hint { color: var(--ink-2); }
