:root {
  color-scheme: light;
  --page: #f4f3ee; --surface: #fcfcfb; --surface-2: #efede6; --hover: rgba(11,11,11,.045);
  --ink: #0b0b0b; --ink-2: #52514e; --muted: #7d7b75; --grid: #e1e0d9; --axis: #c3c2b7;
  --border: rgba(11,11,11,.10); --border-2: rgba(11,11,11,.18);
  --side: #14213a; --side-ink: #e9e4d8; --side-muted: #97a0b3; --side-hover: rgba(255,255,255,.07);
  --gold: #a8844a; --accent: #1c5cab; --accent-bg: #e3edfa;
  --good: #006300; --bad: #b3261e; --warn-bg: #fbf1dc; --warn-ink: #6b4a00;
  --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; --s4: #eda100;
  --shadow: 0 1px 2px rgba(11,11,11,.05), 0 8px 24px rgba(11,11,11,.06);
  --r: 10px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    color-scheme: dark;
    --page: #0d0d0d; --surface: #1a1a19; --surface-2: #242422; --hover: rgba(255,255,255,.06);
    --ink: #ffffff; --ink-2: #c3c2b7; --muted: #8f8d86; --grid: #2c2c2a; --axis: #383835;
    --border: rgba(255,255,255,.10); --border-2: rgba(255,255,255,.18);
    --side: #10151f; --side-ink: #e9e4d8; --side-muted: #8a93a6;
    --gold: #c9a66b; --accent: #6da7ec; --accent-bg: #16263d;
    --good: #0ca30c; --bad: #e66767; --warn-bg: #33280f; --warn-ink: #f2cf82;
    --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500;
    --shadow: 0 1px 2px rgba(0,0,0,.4);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #0d0d0d; --surface: #1a1a19; --surface-2: #242422; --hover: rgba(255,255,255,.06);
  --ink: #ffffff; --ink-2: #c3c2b7; --muted: #8f8d86; --grid: #2c2c2a; --axis: #383835;
  --border: rgba(255,255,255,.10); --border-2: rgba(255,255,255,.18);
  --side: #10151f; --side-ink: #e9e4d8; --side-muted: #8a93a6;
  --gold: #c9a66b; --accent: #6da7ec; --accent-bg: #16263d;
  --good: #0ca30c; --bad: #e66767; --warn-bg: #33280f; --warn-ink: #f2cf82;
  --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500;
  --shadow: 0 1px 2px rgba(0,0,0,.4);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 14px/1.5 var(--font); background: var(--page); color: var(--ink); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); }
.num, .amt, td.r { font-variant-numeric: tabular-nums; }
.sr { position: absolute; left: 0; top: 0; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* layout */
.app { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100vh; }
.side { background: var(--side); color: var(--side-ink); padding: 20px 14px; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 4px; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 22px; }
.brand-mark { width: 30px; height: 30px; border-radius: 8px; border: 1.5px solid var(--gold); display: grid; place-items: center; color: var(--gold); font-weight: 700; font-size: 15px; letter-spacing: .5px; }
.brand-name { font-weight: 650; font-size: 16px; letter-spacing: .2px; }
.brand-sub { font-size: 11px; color: var(--side-muted); }
.nav a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; color: var(--side-ink); text-decoration: none; font-weight: 500; position: relative; }
.nav a:hover { background: var(--side-hover); }
.nav a.on { background: rgba(255,255,255,.09); }
.nav a.on::before { content: ""; position: absolute; left: -14px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--gold); }
.nav svg { width: 18px; height: 18px; flex: none; opacity: .9; }
.nav .badge { margin-left: auto; background: var(--gold); color: #14213a; font-size: 11px; font-weight: 700; border-radius: 10px; padding: 0 7px; line-height: 18px; }
.side-foot { margin-top: auto; font-size: 12px; color: var(--side-muted); padding: 0 8px; }
.side-foot b { color: var(--side-ink); font-weight: 600; }

.main { padding: 22px 28px 60px; min-width: 0; }
.top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.top h1 { font-size: 22px; font-weight: 650; margin: 0; letter-spacing: -.2px; }
.top .sub { color: var(--muted); font-size: 12px; margin-top: 2px; }
.top .spacer { flex: 1; }
.period { display: flex; align-items: center; gap: 6px; }
.period .lbl { min-width: 150px; text-align: center; font-weight: 600; }

/* controls */
.btn { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--border-2); background: var(--surface); cursor: pointer; font-weight: 500; white-space: nowrap; }
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
:root[data-theme="dark"] .btn.primary { color: #0b0b0b; }
@media (prefers-color-scheme: dark) { :root:where(:not([data-theme="light"])) .btn.primary { color: #0b0b0b; } }
.btn.primary:hover { filter: brightness(1.07); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--hover); }
.btn.icon { width: 34px; padding: 0; justify-content: center; }
.btn.danger { color: var(--bad); }
.btn svg { width: 16px; height: 16px; }
.btn:focus-visible, .inp:focus-visible, select:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.inp, select.inp, textarea.inp { height: 34px; border: 1px solid var(--border-2); border-radius: 8px; background: var(--surface); padding: 0 10px; min-width: 0; }
textarea.inp { height: auto; padding: 8px 10px; resize: vertical; }
.seg { display: inline-flex; border: 1px solid var(--border-2); border-radius: 8px; overflow: hidden; }
.seg button { border: 0; background: var(--surface); padding: 0 12px; height: 32px; cursor: pointer; }
.seg button + button { border-left: 1px solid var(--border); }
.seg button.on { background: var(--accent-bg); color: var(--accent); font-weight: 600; }

/* cards */
.grid { display: grid; gap: 14px; }
.kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.two { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 16px 18px; box-shadow: var(--shadow); min-width: 0; }
.card h2 { font-size: 14px; font-weight: 650; margin: 0 0 2px; }
.card .hint { color: var(--muted); font-size: 12px; margin: 0 0 12px; }
.card-head { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 10px; }
.card-head > div:first-child { flex: 1; min-width: 0; }
.kpi .k { color: var(--ink-2); font-size: 12.5px; }
.kpi .v { font-size: 24px; font-weight: 650; letter-spacing: -.3px; margin-top: 2px; white-space: nowrap; }
.kpi .d { font-size: 12px; color: var(--muted); margin-top: 2px; }
.pos { color: var(--good); }
.neg { color: var(--bad); }
.mt { margin-top: 14px; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.muted { color: var(--muted); }
.small { font-size: 12px; }

.banner { display: flex; gap: 10px; align-items: center; background: var(--warn-bg); color: var(--warn-ink); border-radius: var(--r); padding: 10px 14px; margin-bottom: 14px; font-weight: 500; }
.banner .btn { margin-left: auto; }

/* bars list */
.bars { display: flex; flex-direction: column; gap: 9px; }
.bar-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; cursor: pointer; padding: 3px 6px; margin: 0 -6px; border-radius: 6px; }
.bar-row:hover { background: var(--hover); }
.bar-row .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-row .vl { text-align: right; font-variant-numeric: tabular-nums; }
.bar-row .vl span { color: var(--muted); font-size: 12px; margin-left: 6px; }
.bar-row .track { grid-column: 1 / -1; height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
.bar-row .fill { height: 100%; border-radius: 3px; background: var(--s1); }
.bar-row.sel { background: var(--accent-bg); }

/* chart */
.chart { position: relative; width: 100%; }
.chart svg { display: block; overflow: visible; }
.chart text { fill: var(--muted); font-size: 11px; font-family: var(--font); }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--ink-2); flex-wrap: wrap; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.tip { position: fixed; pointer-events: none; z-index: 60; background: var(--surface); border: 1px solid var(--border-2); border-radius: 8px; padding: 8px 10px; box-shadow: var(--shadow); font-size: 12px; min-width: 150px; display: none; }
.tip b { display: block; font-size: 12.5px; margin-bottom: 4px; }
.tip .l { display: flex; justify-content: space-between; gap: 14px; font-variant-numeric: tabular-nums; }
.tip i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 6px; }

/* transactions */
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.filters .inp.search { flex: 1 1 220px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.chip { border: 1px solid var(--border-2); background: var(--surface); border-radius: 999px; padding: 3px 11px; cursor: pointer; font-size: 12.5px; }
.chip.on { background: var(--accent-bg); border-color: transparent; color: var(--accent); font-weight: 600; }
.chip .n { margin-left: 4px; background: var(--gold); color: #14213a; border-radius: 9px; padding: 0 6px; font-size: 11px; font-weight: 700; }
.sumline { color: var(--ink-2); font-size: 12.5px; margin: 2px 0 10px; }
.tx-list { border: 1px solid var(--border); border-radius: var(--r); background: var(--surface); overflow: hidden; box-shadow: var(--shadow); }
.tx-day { display: flex; justify-content: space-between; padding: 7px 14px; background: var(--surface-2); color: var(--ink-2); font-size: 12px; font-weight: 600; }
.tx { display: grid; grid-template-columns: 34px minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, .9fr) auto; gap: 12px; align-items: center; padding: 9px 14px; border-top: 1px solid var(--border); cursor: pointer; }
.tx:hover { background: var(--hover); }
.tx .av { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 12px; color: #fff; }
.tx .who { min-width: 0; }
.tx .who .p { font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tx .who .s { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tx .cat { min-width: 0; }
.tx .cat select { max-width: 100%; border: 1px solid transparent; background: transparent; border-radius: 6px; padding: 3px 4px; cursor: pointer; }
.tx .cat select:hover { border-color: var(--border-2); background: var(--surface); }
.tx .cat select.none { color: var(--s2); font-weight: 600; }
.tx .acc { color: var(--ink-2); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tx .acc i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }
.tx .amt { text-align: right; font-weight: 600; white-space: nowrap; }
.tx .amt.in { color: var(--good); }
.tx .amt.tr { color: var(--muted); font-weight: 500; }
.tx .amt small { display: block; font-weight: 400; color: var(--muted); font-size: 11.5px; }
.tag { display: inline-block; font-size: 11px; border-radius: 5px; padding: 0 6px; background: var(--surface-2); color: var(--ink-2); margin-left: 6px; font-weight: 500; }
.more { text-align: center; padding: 12px; border-top: 1px solid var(--border); }

/* accounts */
.acc-grid { grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }
.acc-card .bank { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-2); }
.acc-card .bank i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.acc-card .bal { font-size: 26px; font-weight: 650; margin: 8px 0 0; letter-spacing: -.3px; }
.acc-card dl { display: grid; grid-template-columns: auto 1fr; gap: 3px 12px; font-size: 12.5px; margin: 12px 0; }
.acc-card dt { color: var(--muted); }
.acc-card dd { margin: 0; text-align: right; }

/* tables */
table.t { width: 100%; border-collapse: collapse; font-size: 13px; }
table.t th { text-align: left; font-weight: 600; color: var(--ink-2); font-size: 12px; padding: 6px 8px; border-bottom: 1px solid var(--border-2); }
table.t td { padding: 7px 8px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.t td.r, table.t th.r { text-align: right; }
table.t tr:last-child td { border-bottom: 0; }
code.pat { background: var(--surface-2); padding: 1px 6px; border-radius: 5px; font-size: 12px; word-break: break-all; }

/* modal */
.overlay { position: fixed; inset: 0; background: rgba(8,12,20,.5); display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px 16px; z-index: 50; overflow: auto; }
.modal { background: var(--surface); border-radius: 14px; width: min(640px, 100%); box-shadow: 0 20px 60px rgba(0,0,0,.35); border: 1px solid var(--border); }
.modal header { display: flex; align-items: center; gap: 10px; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.modal header h3 { margin: 0; font-size: 16px; flex: 1; }
.modal .body { padding: 16px 18px; }
.modal footer { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--border); }
.drop { border: 1.5px dashed var(--border-2); border-radius: 12px; padding: 28px 16px; text-align: center; cursor: pointer; background: var(--surface-2); }
.drop.over { border-color: var(--accent); background: var(--accent-bg); }
.drop b { display: block; font-size: 15px; margin-bottom: 4px; }
.imp-file { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; margin-top: 10px; }
.imp-file .h { display: flex; gap: 8px; align-items: center; font-weight: 600; }
.imp-file .h span:last-child { margin-left: auto; }
.imp-file .d { color: var(--ink-2); font-size: 12.5px; margin-top: 3px; }
.imp-file.err { border-color: var(--bad); }
.imp-file.err .d { color: var(--bad); }
.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.field > span { font-size: 12px; color: var(--ink-2); font-weight: 500; }
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 6px 12px; font-size: 13px; margin-bottom: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; word-break: break-word; }
.split-row { display: grid; grid-template-columns: minmax(0, 1fr) 120px 34px; gap: 8px; margin-bottom: 6px; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--side); color: var(--side-ink); border-radius: 10px; padding: 10px 14px; display: flex; gap: 12px; align-items: center; box-shadow: 0 10px 30px rgba(0,0,0,.3); z-index: 70; max-width: calc(100vw - 24px); }
.toast .btn { height: 28px; background: transparent; color: var(--gold); border-color: var(--gold); }

.empty { text-align: center; padding: 50px 20px; }
.empty .ic { width: 56px; height: 56px; border-radius: 16px; border: 1.5px solid var(--gold); color: var(--gold); display: grid; place-items: center; margin: 0 auto 14px; }
.empty h2 { margin: 0 0 6px; font-size: 20px; }
.empty p { color: var(--ink-2); max-width: 460px; margin: 0 auto 18px; }

.bottom-nav { display: none; }

@media (max-width: 1100px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .two { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .side { display: none; }
  .main { padding: 14px 14px 88px; }
  .top h1 { font-size: 19px; }
  .top .period { order: 3; width: 100%; justify-content: space-between; }
  .period .lbl { min-width: 0; flex: 1; }
  .kpi .v { font-size: 20px; }
  .tx { grid-template-columns: 30px minmax(0, 1fr) auto; gap: 10px; padding: 9px 12px; }
  .tx .av { width: 30px; height: 30px; }
  .tx .acc { display: none; }
  .tx .cat { grid-column: 2; grid-row: 2; margin-top: -4px; }
  .tx .amt { grid-column: 3; grid-row: 1 / span 2; }
  .tx .cat select { padding: 0; font-size: 12px; }
  .bottom-nav { display: grid; grid-template-columns: repeat(7, 1fr); position: fixed; left: 0; right: 0; bottom: 0; background: var(--surface); border-top: 1px solid var(--border-2); padding: 6px 0 calc(6px + env(safe-area-inset-bottom)); z-index: 40; }
  .bottom-nav a { display: flex; flex-direction: column; align-items: center; gap: 2px; text-decoration: none; color: var(--muted); font-size: 10.5px; position: relative; }
  .bottom-nav a.on { color: var(--accent); font-weight: 600; }
  .bottom-nav svg { width: 20px; height: 20px; }
  .bottom-nav .badge { position: absolute; top: -3px; left: calc(50% + 6px); background: var(--s2); color: #fff; font-size: 10px; border-radius: 8px; padding: 0 5px; line-height: 15px; }
  .kv { grid-template-columns: 1fr; gap: 0 0; }
  .kv dt { margin-top: 6px; }
  .split-row { grid-template-columns: minmax(0, 1fr) 96px 34px; }
}
@media print { .side, .bottom-nav, .btn { display: none !important; } .app { display: block; } }
.chart svg[data-h] .g { opacity: .4; transition: opacity .12s; }
.chart svg[data-h] .g.h { opacity: 1; }
.chart .hit { fill: transparent; cursor: pointer; }
.banner svg { width: 18px; height: 18px; flex: none; }
.empty .ic svg { width: 26px; height: 26px; }
.tx-list, .card, .main { overflow-wrap: break-word; }

.kpi .v.txt { font-size: 18px; white-space: normal; line-height: 1.25; }
.chart { overflow: hidden; }
@media (max-width: 760px) {
  .toast { bottom: calc(76px + env(safe-area-inset-bottom)); }
  .filters select.inp { flex: 1 1 45%; }
}

@media (max-width: 760px) { .hide-m { display: none; } }

.kpi.link { cursor: pointer; }
.kpi.link:hover { border-color: var(--border-2); }
@media (max-width: 760px) { .bottom-nav a { font-size: 9.5px; } }

@media (max-width: 760px) {
  .card-head { flex-wrap: wrap; }
  .card-head > .seg { width: 100%; }
  .card-head > .seg button { flex: 1; padding: 0 6px; }
}

/* v3 */
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.card.link { cursor: pointer; }
.card.link:hover { border-color: var(--border-2); }
.nav-sec { font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--side-muted); padding: 16px 10px 6px; }
.nav-gap { height: 14px; }
.side { overflow-y: auto; }
tr.dim td { opacity: .55; }
.tag.farm { background: color-mix(in srgb, var(--s3) 18%, transparent); color: var(--good); }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 4px 12px; max-height: 320px; overflow: auto; }
.check { display: flex; align-items: center; gap: 8px; font-size: 13px; padding: 3px 0; cursor: pointer; }
.check small { color: var(--muted); margin-left: auto; }
.check.inline { padding: 0 6px; }
.check input, td input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--accent); }
.menu-list { display: grid; gap: 2px; }
.menu-list a { display: flex; gap: 12px; align-items: center; padding: 11px 8px; border-radius: 8px; text-decoration: none; color: var(--ink); font-weight: 500; }
.menu-list a:hover, .menu-list a.on { background: var(--hover); }
.menu-list svg { width: 20px; height: 20px; }
.banner.mt { margin-top: 14px; margin-bottom: 0; }
@media (max-width: 1100px) { .grid.three { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 760px) {
  .bottom-nav { grid-template-columns: repeat(5, 1fr); }
  .bottom-nav a { font-size: 10.5px; }
}

.grid.halves { grid-template-columns: repeat(2, minmax(0, 1fr)); }
table.nowrap td, table.nowrap th { white-space: nowrap; }
@media (max-width: 1100px) { .grid.halves { grid-template-columns: minmax(0, 1fr); } }

/* budżety, FIRE */
.bud { padding: 10px 0; border-bottom: 1px solid var(--border); }
.bud:last-child { border-bottom: 0; }
.bud.compact { padding: 7px 0; }
.bud-h { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 5px; }
.bud-h .nm { font-weight: 550; }
.bud-track { position: relative; height: 8px; border-radius: 4px; background: var(--surface-2); overflow: visible; }
.bud-track.big { height: 12px; border-radius: 6px; }
.bud-fill { height: 100%; border-radius: inherit; background: var(--s1); }
.bud-fill.ok { background: var(--s1); }
.bud-fill.warn { background: var(--s4); }
.bud-fill.over { background: var(--bad); }
.bud-pace { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--ink); opacity: .55; border-radius: 1px; }
.bud-f { display: flex; align-items: center; gap: 10px; margin-top: 5px; font-size: 12.5px; }
.bud-f .muted:nth-child(2) { margin-left: auto; }
.budget-inp { width: 96px; height: 28px; text-align: right; }
.form-grid { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 10px 14px; align-items: center; margin-top: 12px; }
.form-grid > label { font-size: 13px; color: var(--ink-2); }
.form-grid .check { padding: 2px 0; }
.scen { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.scen-c { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; }
.scen-c.base { border-color: var(--accent); background: var(--accent-bg); }
.scen-v { font-size: 18px; font-weight: 650; margin: 2px 0; }
@media (max-width: 760px) {
  .form-grid { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .form-grid > label { margin-top: 8px; }
  .scen { grid-template-columns: minmax(0, 1fr); }
}

.seg.tabs button { height: 36px; padding: 0 16px; }
tr.sel-row td { background: var(--accent-bg); }
@media (max-width: 760px) { .seg.tabs { display: flex; width: 100%; } .seg.tabs button { flex: 1; padding: 0 6px; font-size: 12.5px; } }
.btn.xls { color: #1d6f42; }
.btn.xls:hover { background: rgba(29,111,66,.08); }
.row-btns { display: flex; gap: 8px; flex-wrap: wrap; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn.xls { color: #5cc38a; } }
:root[data-theme="dark"] .btn.xls { color: #5cc38a; }
.form-grid > * { min-width: 0; }
.form-grid select.inp, .form-grid input.inp:not([type="checkbox"]):not([type="range"]) { max-width: 100%; }
details summary { cursor: pointer; color: var(--ink-2); }
/* FIRE 2.0 – etapy */
.phases { display: grid; grid-template-columns: repeat(auto-fit, minmax(105px, 1fr)); gap: 6px; }
.ph-bar { display: flex; gap: 2px; height: 8px; margin: 4px 0 10px; }
.ph-bar i { display: block; border-radius: 3px; background: var(--accent); opacity: .55; min-width: 4px; }
.ph-bar i.acc { background: var(--muted); }
.ph { min-width: 0; padding: 8px 10px; border-radius: 8px; background: var(--accent-bg); font-size: 12.5px; line-height: 1.35; overflow-wrap: anywhere; }
.ph b { display: block; font-size: 13px; }
.ph.acc { background: var(--surface-2); }
.ph-h { font-size: 11px; color: var(--ink-2); font-variant-numeric: tabular-nums; margin-bottom: 2px; }

.fire-assets { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0 12px; }
.fire-assets .check { font-size: 12.5px; padding: 1px 0; }

/* ---------- serwer: logowanie, zakładanie, synchronizacja ---------- */
.lock { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px 16px calc(24px + env(safe-area-inset-bottom));
  background: radial-gradient(1200px 600px at 50% -10%, color-mix(in srgb, var(--side) 18%, transparent), transparent 70%), var(--page); }
.lock-card { width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow); padding: 26px 24px 22px; }
.lock-card.wide { max-width: 520px; }
.lock-card h2 { font-size: 19px; margin: 6px 0 8px; letter-spacing: -.2px; }
.lock-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.lock-brand .brand-mark { width: 38px; height: 38px; border-radius: 10px; font-size: 18px; background: var(--side); }
.lock-title { font-weight: 680; font-size: 17px; }
.lock-sub { font-size: 12px; color: var(--muted); }
.lock-foot { max-width: 520px; display: flex; gap: 8px; align-items: flex-start; color: var(--muted); font-size: 12px; margin: 16px 8px 0; text-align: left; }
.lock-foot svg { width: 15px; height: 15px; flex: none; margin-top: 1px; color: var(--gold); }
.lock-msg { background: color-mix(in srgb, var(--bad) 12%, transparent); color: var(--bad); border-radius: 8px; padding: 9px 12px; font-size: 13px; font-weight: 500; margin: 0 0 12px; }
.lock .field .inp, .modal .field .inp { height: 42px; font-size: 16px; }
.inp.code { font: 600 22px/1 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: 6px; text-align: center; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.sel { user-select: all; -webkit-user-select: all; }
.btn.wide { width: 100%; justify-content: center; height: auto; min-height: 42px; padding: 8px 12px; font-size: 15px; white-space: normal; text-align: center; }
.btn.ghost.wide { font-size: 13.5px; color: var(--accent); }
.mt8 { margin-top: 8px; }
.check { display: flex; gap: 8px; align-items: flex-start; margin: 4px 0 14px; font-size: 13px; cursor: pointer; }
.check input { margin-top: 3px; }
.warn-box { background: var(--warn-bg); color: var(--warn-ink); border-radius: 8px; padding: 9px 12px; }
.ok-box { display: flex; gap: 8px; align-items: flex-start; background: color-mix(in srgb, var(--good) 11%, transparent); color: var(--good); border-radius: 8px; padding: 10px 12px; margin-bottom: 12px; font-size: 13px; }
.ok-box svg { width: 16px; height: 16px; flex: none; margin-top: 2px; }
.rc-box { font-size: 19px; font-weight: 650; letter-spacing: 1.5px; text-align: center; padding: 16px 10px; border: 1.5px dashed var(--gold); border-radius: 10px; margin: 6px 0 12px; word-break: break-all; line-height: 1.6; }
.steps { list-style: none; display: flex; gap: 6px; padding: 0; margin: 0 0 14px; }
.steps li { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 11px; color: var(--muted); min-width: 0; }
.steps li i { font-style: normal; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; border: 1.5px solid var(--border-2); font-weight: 650; font-size: 12px; }
.steps li.on { color: var(--ink); font-weight: 600; } .steps li.on i { border-color: var(--accent); background: var(--accent); color: #fff; }
.steps li.done i { border-color: var(--good); color: var(--good); }
.steps li span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.totp-grid { display: grid; grid-template-columns: 168px minmax(0, 1fr); gap: 16px; align-items: center; margin: 8px 0 12px; }
.totp-grid .qr { background: #fff; border-radius: 10px; padding: 6px; border: 1px solid var(--border); }
.totp-grid .qr svg { display: block; width: 100%; height: auto; }
.totp-grid p { margin: 0 0 8px; }
.totp-grid code { font-size: 12px; word-break: break-all; }
@media (max-width: 520px) { .totp-grid { grid-template-columns: 1fr; } .totp-grid .qr { max-width: 190px; margin: 0 auto; } }
.pw-meter { margin: -6px 0 12px; }
.spin { width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; display: inline-block; animation: spin .7s linear infinite; margin-right: 6px; vertical-align: -2px; }
@keyframes spin { to { transform: rotate(360deg); } }
.cloud-chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--border); background: var(--surface); border-radius: 20px; height: 22px; padding: 0 9px; font-size: 11.5px; color: var(--ink-2); cursor: pointer; vertical-align: 1px; }
.cloud-chip i { width: 7px; height: 7px; border-radius: 50%; background: var(--good); }
.cloud-chip.sync i { background: var(--accent); animation: pulse 1s ease-in-out infinite; }
.cloud-chip.off i { background: var(--muted); }
.cloud-chip.err i { background: var(--bad); }
.cloud-chip.err { color: var(--bad); }
@keyframes pulse { 50% { opacity: .3; } }
.pill { display: inline-block; font-size: 11px; font-weight: 600; padding: 0 7px; border-radius: 10px; background: var(--accent-bg); color: var(--accent); }
.totp-in-modal .totp-grid { margin-top: 0; }
@media (prefers-reduced-motion: reduce) { .spin, .cloud-chip.sync i { animation: none; } }
@media (display-mode: standalone) { .main { padding-top: calc(env(safe-area-inset-top) + 14px); } .lock { padding-top: calc(env(safe-area-inset-top) + 24px); } }

/* ---------- układ na telefonie: tabele, przyciski, chipy ---------- */
/* tabele: łamanie tylko między słowami, a szerokie tabele przewijają się w poziomie (zamiast ściskać kolumny) */
table.t { overflow-wrap: normal; word-break: normal; }
table.t th { white-space: nowrap; vertical-align: bottom; }
table.t td.r, table.t th.r, table.t td.num, table.t td .amt { white-space: nowrap; }
.tscroll { overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }
.tscroll > table.t { min-width: 100%; }
@media (max-width: 760px) {
  table.t { font-size: 12.5px; }
  table.t th, table.t td { padding: 6px 7px; }
  table.t td:first-child { min-width: 118px; }

}
/* przełączniki: tekst się zawija zamiast ucinać */
.seg button { height: auto; min-height: 32px; padding: 5px 12px; line-height: 1.2; white-space: normal; }
.seg.tabs button { height: auto; min-height: 36px; }
@media (max-width: 760px) {
  .seg.tabs { display: flex; flex-wrap: nowrap; overflow-x: auto; width: 100%; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .seg.tabs::-webkit-scrollbar { display: none; }
  .seg.tabs button { flex: 0 0 auto; padding: 0 14px; white-space: nowrap; }
}
/* chipy z przyciskiem usuwania: zawsze w jednej linii */
.chip { display: inline-flex; align-items: center; gap: 4px; max-width: 100%; text-align: left; line-height: 1.3; }
.chip.on > .btn.icon { flex: none; margin-right: -6px; }
/* duże kwoty nigdy nie łamią się w środku */
.kpi .v, .big, .amt { overflow-wrap: normal; word-break: normal; }
/* podpowiedź, że tabelę można przesunąć w bok (cień przy krawędzi, znika na końcu) */
.tscroll { background:
  linear-gradient(to right, var(--surface) 30%, transparent) left / 32px 100% no-repeat local,
  linear-gradient(to left, var(--surface) 30%, transparent) right / 32px 100% no-repeat local,
  radial-gradient(farthest-side at 0 50%, rgba(0,0,0,.14), transparent) left / 12px 100% no-repeat scroll,
  radial-gradient(farthest-side at 100% 50%, rgba(0,0,0,.14), transparent) right / 12px 100% no-repeat scroll; }
@media (max-width: 760px) {
  /* pola formularzy: pełna szerokość i 16 px (iPhone nie powiększa wtedy strony przy wpisywaniu) */
  input.inp, select.inp, textarea.inp, .c-app input, .c-app select, .c-app textarea { font-size: 16px; }
  .form-grid input.inp:not([type="checkbox"]):not([type="radio"]):not([type="range"]), .form-grid select.inp, .form-grid textarea.inp { width: 100% !important; }
  .form-grid .row { flex-wrap: nowrap; }
  .form-grid .row > input.inp { flex: 1 1 auto; min-width: 0; }
  /* kafle: nieparzysty ostatni na całą szerokość, kwoty mieszczą się w kafelku */
  .kpis > .kpi:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .kpi .v { font-size: clamp(17px, 5.2vw, 20px); }
  /* okna: jednolity panel od dołu ekranu */
  .overlay, .c-modal-bg { align-items: flex-end; padding: 0; place-items: end stretch; }
  .modal, .c-modal { width: 100%; max-height: 92vh; max-height: 92dvh; overflow: auto; border-radius: 16px 16px 0 0; border-bottom: 0; }
  .modal footer { position: sticky; bottom: 0; background: var(--surface); padding-bottom: calc(12px + env(safe-area-inset-bottom)); flex-wrap: wrap; }
  .modal footer .btn { flex: 1 1 auto; justify-content: center; }
  .modal header { position: sticky; top: 0; background: var(--surface); z-index: 1; }
}

/* Rachunek auta w spółce – style kalkulatora (przeniesione, w barwach pulpitu) */
.c-app {
  --bg: var(--page); --surface-2: var(--surface-2); --line: var(--border); --line-2: var(--grid); --faint: var(--muted);
  --accent-ink: #fff; --accent-weak: var(--accent-bg);
  --good-weak: color-mix(in srgb, var(--good) 13%, transparent); --warn: var(--warn-ink); --warn-weak: var(--warn-bg);
  --bad-weak: color-mix(in srgb, var(--bad) 12%, transparent); --bar-muted: var(--axis); --focus: var(--accent);
  --f-ui: var(--font); --f-num: var(--font); --f-display: var(--font);
  --r: 8px; --r-lg: var(--r-card, 10px);
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 24px; --s-6: 32px;
  --t-xs: 12px; --t-s: 13px; --t-m: 14px; --t-l: 15px; --t-xl: 22px; --t-xxl: 26px;
  color: var(--ink); font-size: 14px; line-height: 1.45;
}
:root[data-theme="dark"] .c-app .c-btn.c-primary { color: #0b0b0b; }
@media (prefers-color-scheme: dark) { :root:where(:not([data-theme="light"])) .c-app .c-btn.c-primary { color: #0b0b0b; } }
/* Układ: pasek ofert u góry, formularz po lewej, wyniki po prawej, porównanie na dole.
   Ton: rachunek bankowy — chłodny papier, grafit, jeden akcent (petrol). */

.c-app { display: grid; gap: var(--s-4); }
.c-app * { box-sizing: border-box; }
.c-app :focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.c-num { font-family: var(--f-num); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }

/* nagłówek */
.c-top { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--s-3); }
.c-brand h2 { font-family: var(--f-display); font-weight: 500; font-size: var(--t-xl); margin: 0; letter-spacing: -0.01em; text-wrap: balance; }
.c-brand p { margin: 2px 0 0; color: var(--muted); font-size: var(--t-s); }
.c-actions { display: flex; flex-wrap: wrap; gap: var(--s-2); align-items: center; }
.c-save-state { font-size: var(--t-xs); color: var(--muted); display: inline-flex; align-items: center; gap: 6px; padding: 4px 8px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); }
.c-save-state i { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); display: inline-block; }
.c-save-state[data-s="ok"] i { background: var(--good); }
.c-save-state[data-s="local"] i { background: var(--warn); }
.c-save-state[data-s="busy"] i { background: var(--accent); }
.c-btn { border: 1px solid var(--line); background: var(--surface); padding: 7px 12px; border-radius: var(--r); cursor: pointer; font-size: var(--t-s); font-weight: 500; display: inline-flex; gap: 6px; align-items: center; white-space: nowrap; }
.c-btn:hover { border-color: var(--faint); }
.c-btn.c-primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.c-btn.c-primary:hover { filter: brightness(1.06); }
.c-btn.c-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.c-btn.c-ghost:hover { color: var(--ink); background: var(--surface); }
.c-btn.c-danger { color: var(--bad); }
.c-btn:disabled { opacity: .5; cursor: default; }

/* pasek ofert */
.c-offers { display: flex; gap: var(--s-2); overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.c-offer-tab { flex: 0 0 auto; text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: var(--r-lg); padding: 8px 12px; cursor: pointer; min-width: 9.5rem; max-width: 15rem; display: grid; gap: 2px; }
.c-offer-tab .c-t { font-weight: 600; font-size: var(--t-s); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.c-offer-tab .c-s { font-size: var(--t-xs); color: var(--muted); display: flex; justify-content: space-between; gap: 8px; }
.c-offer-tab[aria-selected="true"] { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); background: var(--accent-weak); }
.c-offer-tab .c-best { color: var(--good); font-weight: 600; }
.c-offer-add { border-style: dashed; color: var(--muted); place-content: center; text-align: center; min-width: 7rem; }

/* siatka główna */
.c-main { display: grid; grid-template-columns: minmax(0, 24rem) minmax(0, 1fr); gap: var(--s-4); align-items: start; }
@media (max-width: 980px) { .c-main { grid-template-columns: minmax(0, 1fr); } }
.c-panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); min-width: 0; }
.c-panel-h { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s-2); padding: var(--s-3) var(--s-4) 0; flex-wrap: wrap; }
.c-panel-h h2 { font-size: var(--t-m); font-weight: 600; margin: 0; }
.c-panel-h .c-sub { color: var(--muted); font-size: var(--t-xs); }
.c-panel-b { padding: var(--s-3) var(--s-4) var(--s-4); }

/* formularz */
.c-form { position: sticky; top: env(safe-area-inset-top, 0px); max-height: calc(100vh - 16px); overflow: auto; }
@media (max-width: 980px) { .c-form { position: static; max-height: none; } }
.c-form-head { padding: var(--s-3) var(--s-4); border-bottom: 1px solid var(--line-2); display: grid; gap: var(--s-2); }
.c-form-head .c-row-actions { display: flex; gap: var(--s-1); flex-wrap: wrap; }
.c-name-input { width: 100%; font-weight: 600; font-size: var(--t-l); border: 1px solid transparent; background: transparent; padding: 4px 6px; margin-left: -6px; border-radius: var(--r); }
.c-name-input:hover, .c-name-input:focus { border-color: var(--line); background: var(--surface-2); }
details.c-sec { border-bottom: 1px solid var(--line-2); }
details.c-sec > summary { list-style: none; cursor: pointer; padding: var(--s-3) var(--s-4); display: flex; justify-content: space-between; align-items: center; font-weight: 600; font-size: var(--t-s); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
details.c-sec > summary::-webkit-details-marker { display: none; }
details.c-sec > summary::after { content: "+"; font-family: var(--f-num); color: var(--faint); }
details.c-sec[open] > summary::after { content: "–"; }
details.c-sec > summary .c-sum { text-transform: none; letter-spacing: 0; font-weight: 500; color: var(--ink); font-size: var(--t-xs); margin-left: auto; margin-right: var(--s-2); }
.c-fields { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-3) var(--s-3); padding: 0 var(--s-4) var(--s-4); }
.c-f { display: grid; gap: 4px; min-width: 0; }
.c-f.c-w2 { grid-column: 1 / -1; }
.c-f > label, .c-f > .c-lbl { font-size: var(--t-xs); color: var(--muted); font-weight: 500; }
.c-f .c-hint { font-size: var(--t-xs); color: var(--faint); line-height: 1.35; }
.c-inp { display: flex; align-items: stretch; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface-2); min-width: 0; }
.c-inp:focus-within { border-color: var(--focus); }
.c-inp input, .c-inp select { border: 0; background: transparent; padding: 7px 8px; width: 100%; min-width: 0; font-family: var(--f-num); font-size: var(--t-s); }
.c-inp select { font-family: var(--f-ui); }
.c-inp input:focus, .c-inp select:focus { outline: none; }
.c-inp .c-u { padding: 7px 8px 7px 0; color: var(--faint); font-size: var(--t-xs); align-self: center; white-space: nowrap; }
.c-inp select.c-unit { width: auto; flex: 0 0 auto; border-left: 1px solid var(--line); font-size: var(--t-xs); color: var(--muted); padding-inline: 6px; }
.c-sel { border: 1px solid var(--line); border-radius: var(--r); background: var(--surface-2); padding: 7px 8px; width: 100%; font-size: var(--t-s); }
.c-seg { display: flex; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: var(--surface-2); }
.c-seg button { flex: 1 1 0; border: 0; background: transparent; padding: 7px 6px; font-size: var(--t-xs); font-weight: 500; cursor: pointer; color: var(--muted); border-right: 1px solid var(--line); white-space: normal; line-height: 1.25; min-width: 0; }
.c-seg button:last-child { border-right: 0; }
.c-seg button[aria-pressed="true"] { background: var(--ink); color: var(--surface); }
.c-chk { display: flex; gap: 8px; align-items: flex-start; font-size: var(--t-s); cursor: pointer; }
.c-chk input { margin-top: 3px; accent-color: var(--accent); }
.c-years { display: grid; grid-template-columns: repeat(auto-fill, minmax(4.6rem, 1fr)); gap: 6px; }
.c-years .c-inp input { padding: 6px; }
.c-years .c-yl { font-size: 0.65rem; color: var(--faint); padding: 0 0 2px 2px; }
.c-derived { grid-column: 1 / -1; font-size: var(--t-xs); color: var(--muted); background: var(--surface-2); border: 1px dashed var(--line); border-radius: var(--r); padding: 8px 10px; display: grid; gap: 2px; }
.c-derived b { color: var(--ink); font-weight: 600; font-family: var(--f-num); }
.c-form-foot { padding: var(--s-3) var(--s-4); font-size: var(--t-xs); color: var(--faint); }

/* wyniki */
.c-results { display: grid; gap: var(--s-4); min-width: 0; }
.c-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 11rem), 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.c-kpis { background: var(--surface); gap: 0; }
.c-kpi { box-shadow: inset -1px -1px 0 var(--line-2); }
.c-kpi { background: var(--surface); padding: var(--s-3) var(--s-4); display: grid; gap: 2px; align-content: start; }
.c-kpi .c-l { font-size: var(--t-xs); color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-weight: 500; }
.c-kpi .c-v { font-family: var(--f-display); font-size: var(--t-xxl); font-weight: 400; line-height: 1.1; font-variant-numeric: tabular-nums lining-nums; }
.c-kpi .c-v small { font-family: var(--f-ui); font-size: var(--t-s); color: var(--muted); margin-left: 4px; }
.c-kpi .c-d { font-size: var(--t-xs); color: var(--muted); }
.c-kpi.c-lead .c-v { color: var(--accent); }
.c-kpis.c-sm .c-kpi .c-v { font-size: var(--t-l); font-family: var(--f-num); }
.c-verdict { font-size: var(--t-m); line-height: 1.55; max-width: 62rem; }
.c-verdict b { font-weight: 600; }
.c-grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 26rem), 1fr)); gap: var(--s-4); }
.c-chart { position: relative; width: 100%; }
.c-chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.c-chart text { font-family: var(--f-ui); }
.c-tip { position: absolute; pointer-events: none; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); border-radius: var(--r); padding: 6px 8px; font-size: var(--t-xs); white-space: nowrap; z-index: 5; }
.c-tip .c-t1 { color: var(--muted); }
.c-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: var(--t-xs); color: var(--muted); margin-top: var(--s-2); }
.c-legend i { display: inline-block; width: 14px; height: 3px; border-radius: 2px; vertical-align: middle; margin-right: 6px; }

.c-tbl-wrap { overflow-x: auto; }
table.c-t { width: 100%; border-collapse: collapse; font-size: var(--t-s); }
table.c-t th { text-align: right; font-weight: 500; color: var(--muted); font-size: var(--t-xs); padding: 6px 8px; border-bottom: 1px solid var(--line); white-space: normal; vertical-align: bottom; line-height: 1.25; min-width: 4.5rem; }
table.c-t td { text-align: right; padding: 7px 8px; border-bottom: 1px solid var(--line-2); white-space: nowrap; font-family: var(--f-num); font-variant-numeric: tabular-nums; }
table.c-t th:first-child, table.c-t td:first-child { text-align: left; font-family: var(--f-ui); white-space: normal; min-width: 8rem; }
table.c-t tr.c-total td { font-weight: 600; border-top: 1px solid var(--line); border-bottom: 0; }
table.c-t tr.c-sub td { color: var(--muted); }
table.c-t tr.c-cur td { background: var(--accent-weak); }
table.c-t td.c-good { color: var(--good); }
table.c-t td.c-bad { color: var(--bad); }
.c-util { display: inline-flex; align-items: center; gap: 6px; }
.c-util .c-bar { width: 64px; height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; display: inline-block; }
.c-util .c-bar span { display: block; height: 100%; background: var(--accent); }
.c-foot { font-size: var(--t-xs); color: var(--faint); margin-top: var(--s-2); line-height: 1.5; }

.c-notes { display: grid; gap: var(--s-2); }
.c-note { display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; font-size: var(--t-s); padding: 8px 10px; border-radius: var(--r); background: var(--surface-2); border: 1px solid var(--line-2); }
.c-note .c-pill { font-size: 0.65rem; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; padding: 2px 6px; border-radius: 999px; align-self: start; margin-top: 2px; }
.c-note[data-l="bad"] .c-pill { background: var(--bad-weak); color: var(--bad); }
.c-note[data-l="warn"] .c-pill { background: var(--warn-weak); color: var(--warn); }
.c-note[data-l="info"] .c-pill { background: var(--accent-weak); color: var(--accent); }
.c-note .c-ref { grid-column: 2; font-size: var(--t-xs); color: var(--faint); }
details.c-more > summary { cursor: pointer; font-size: var(--t-s); color: var(--accent); font-weight: 500; padding: 4px 0; }
.c-sched { max-height: 26rem; overflow: auto; }
.c-sched table.c-t th { position: sticky; top: 0; background: var(--surface); }

/* stan pusty i ładowanie */
.c-empty { padding: var(--s-6) var(--s-5); text-align: center; display: grid; gap: var(--s-3); justify-items: center; }
.c-empty h2 { font-family: var(--f-display); font-weight: 500; margin: 0; font-size: var(--t-xl); }
.c-empty p { color: var(--muted); max-width: 38rem; margin: 0; }

/* okno importu */
.c-modal-bg { position: fixed; inset: 0; background: rgba(10, 16, 22, .45); display: grid; place-items: center; padding: 16px; z-index: 50; }
.c-modal { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); width: min(56rem, 100%); max-height: calc(100vh - 32px); overflow: auto; box-shadow: var(--shadow); }
.c-modal-h { display: flex; justify-content: space-between; align-items: center; padding: var(--s-3) var(--s-4); border-bottom: 1px solid var(--line-2); position: sticky; top: 0; background: var(--surface); z-index: 1; }
.c-modal-h h2 { margin: 0; font-size: var(--t-l); font-weight: 600; }
.c-modal-b { padding: var(--s-4); display: grid; gap: var(--s-3); }
.c-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.c-tabs button { border: 0; background: transparent; padding: 8px 12px; font-size: var(--t-s); cursor: pointer; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; }
.c-tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); font-weight: 600; }
textarea.c-big { width: 100%; min-height: 11rem; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface-2); padding: 10px; font-family: var(--f-num); font-size: var(--t-xs); resize: vertical; }
.c-drop { border: 1.5px dashed var(--line); border-radius: var(--r-lg); padding: var(--s-5); text-align: center; color: var(--muted); display: grid; gap: var(--s-2); justify-items: center; }
.c-drop.c-over { border-color: var(--accent); background: var(--accent-weak); }
.c-status { font-size: var(--t-s); color: var(--muted); min-height: 1.4em; }
.c-status.c-err { color: var(--bad); }
.c-extract table.c-t td:first-child { min-width: 7rem; }
.c-extract td.c-chg { color: var(--accent); font-weight: 600; }
.c-radio-row { display: flex; gap: var(--s-4); flex-wrap: wrap; font-size: var(--t-s); align-items: center; }
.c-radio-row label { display: inline-flex; gap: 6px; align-items: center; cursor: pointer; }
.c-toast { position: fixed; left: 50%; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--ink); color: var(--surface); padding: 8px 14px; border-radius: var(--r); font-size: var(--t-s); z-index: 60; box-shadow: var(--shadow); }
.c-confirm { display: inline-flex; gap: 6px; align-items: center; font-size: var(--t-xs); color: var(--bad); }
@media (max-width: 520px) { .c-fields { grid-template-columns: 1fr; } .c-kpi .c-v { font-size: var(--t-xl); } }
@media (prefers-reduced-motion: no-preference) { .c-offer-tab, .c-btn { transition: border-color .15s, background .15s, filter .15s; } }
@media (max-width: 520px) { .c-seg button { padding: 7px 3px; font-size: 11.5px; } }
