:root {
  --bg: #f6f6f3;
  --surface: #ffffff;
  --surface-2: #f0efea;
  --text: #1c1c1a;
  --muted: #6b6b66;
  --border: #e2e1db;
  --grid: #dcdbd3;
  --accent: #1f6b4f;
  --accent-soft: #e3f0ea;
  --accent-text: #ffffff;
  --ok: #2f7d4f;
  --warn: #9a6a00;
  --bad: #b3261e;
  --pos: #2f7d4f;
  --neg: #b3261e;
  --row-hover: #f3f6f4;
  --zero: #b0afa8;
  --head: #f3f2ee;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 4px 16px rgba(0,0,0,.04);
  /* gradient nagłówków: zieleń → morski → złoto */
  --grad-1: #1f6b4f; --grad-2: #138a7b; --grad-3: #d97706;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #101214; --surface: #181b1e; --surface-2: #22262a; --text: #f2f3f4; --muted: #949aa1;
    --border: #2d3237; --grid: #2a2e33; --accent: #4fd197; --accent-soft: #153326; --accent-text: #04140c;
    --ok: #4fd197; --warn: #f2b84b; --bad: #ff6b61; --pos: #4fd197; --neg: #ff6b61;
    --row-hover: #1f2327; --zero: #545a61; --head: #14171a; --shadow: none; color-scheme: dark;
    --grad-1: #4fd197; --grad-2: #3fc6c0; --grad-3: #f2c14e;
  }
}
:root[data-theme="dark"] {
  --bg: #101214; --surface: #181b1e; --surface-2: #22262a; --text: #f2f3f4; --muted: #949aa1;
  --border: #2d3237; --grid: #2a2e33; --accent: #4fd197; --accent-soft: #153326; --accent-text: #04140c;
  --ok: #4fd197; --warn: #f2b84b; --bad: #ff6b61; --pos: #4fd197; --neg: #ff6b61;
  --row-hover: #1f2327; --zero: #545a61; --head: #14171a; --shadow: none; color-scheme: dark;
  --grad-1: #4fd197; --grad-2: #3fc6c0; --grad-3: #f2c14e;
}

* { box-sizing: border-box; }

/* Płynna zmiana motywu jasny ↔ ciemny */
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .42s; animation-timing-function: ease; }
.theme-anim, .theme-anim *, .theme-anim *::before, .theme-anim *::after {
  transition: background-color .4s ease, color .4s ease, border-color .4s ease, box-shadow .4s ease, fill .4s ease !important;
}
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); line-height: 1.45; font-size: 15px; }
.muted { color: var(--muted); }
[hidden] { display: none !important; }
a { color: var(--accent); }

button, .button {
  font: inherit; font-size: 0.9rem; padding: 7px 14px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); cursor: pointer; text-decoration: none; display: inline-block;
}
button:hover, .button:hover { border-color: var(--muted); }
.primary { background: var(--accent); color: var(--accent-text); border-color: var(--accent); font-weight: 600; }
.primary:hover { filter: brightness(1.05); border-color: var(--accent); }
button.link { border: none; background: none; padding: 0; color: var(--muted); font-size: 0.8rem; text-decoration: underline; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- Pasek górny ---------- */
.topbar {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px;
  padding: 12px 20px; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 10;
}
.brand { font-weight: 700; font-size: 1.05rem; color: var(--text); text-decoration: none; letter-spacing: -0.01em; }
.brand::before { content: ""; display: inline-block; width: 12px; height: 12px; margin-right: 8px; border-radius: 3px; background: var(--accent); vertical-align: -1px; }
.views { display: flex; gap: 2px; background: var(--surface-2); padding: 3px; border-radius: 10px; }
.views a { padding: 6px 14px; border-radius: 8px; color: var(--muted); text-decoration: none; font-size: 0.9rem; white-space: nowrap; }
.views a[aria-current="page"] { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: var(--shadow); }
.soon { font-size: 0.68rem; padding: 1px 6px; border-radius: 99px; background: var(--accent-soft); color: var(--accent); vertical-align: 1px; }
.prefs { display: flex; gap: 8px; justify-content: flex-end; align-items: center; }
.icon-btn { padding: 6px 10px; font-size: 1rem; line-height: 1; }
.seg { display: inline-flex; background: var(--surface-2); border-radius: 8px; padding: 2px; gap: 2px; }
.seg button { border: none; background: none; padding: 5px 10px; border-radius: 6px; color: var(--muted); font-size: 0.85rem; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: var(--shadow); }

/* ---------- Konwerter: układ ---------- */
.view { padding: 20px; max-width: 1440px; margin: 0 auto; }
/* Konwerter zajmuje co najmniej cały ekran – stopka pojawia się dopiero po przewinięciu */
#view-converter { min-height: calc(100vh - 62px); min-height: calc(100dvh - 62px); }
/* Konwerter wypełnia cały ekran (bez pustego miejsca pod polami) */
.converter { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 20px; align-items: stretch; min-height: calc(100vh - 102px); min-height: calc(100dvh - 102px); }
.side { position: sticky; top: 76px; align-self: start; display: flex; flex-direction: column; gap: 12px; height: calc(100dvh - 102px); }
.has-files .side { height: auto; }
.main { min-width: 0; display: flex; flex-direction: column; }

/* Pole na pliki – duże, a po wgraniu kompaktowe */
.drop {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center;
  flex: 1; min-height: 300px; padding: 24px 16px; border: 2px dashed var(--border); border-radius: 14px;
  background: var(--surface); cursor: pointer; transition: border-color .15s, background .15s, min-height .2s;
}
.drop:hover, .drop.over { border-color: var(--accent); background: var(--accent-soft); }
.drop input { display: none; }
.drop-icon { font-size: 2rem; color: var(--accent); }
.drop-hint, .drop-formats { color: var(--muted); font-size: 0.85rem; }
.drop-more { display: none; font-weight: 600; color: var(--accent); }
.has-files .drop { flex: none; min-height: 0; padding: 14px; }
.has-files .drop > :not(.drop-more):not(input) { display: none; }
.has-files .drop-more { display: block; }

.file-list { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; }
.file-list-head { display: flex; justify-content: space-between; align-items: center; font-size: 0.8rem; color: var(--muted); margin-bottom: 6px; text-transform: uppercase; letter-spacing: .04em; }
.file-list ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; max-height: 360px; overflow-y: auto; }
.file-list li { display: grid; grid-template-columns: 14px minmax(0, 1fr) auto; gap: 8px; align-items: center; font-size: 0.85rem; padding: 4px 0; }
.file-list li .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }
.file-list li.warn .dot { background: var(--warn); }
.file-list li.bad .dot { background: var(--bad); }
.file-list li .fname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-list li small { display: block; color: var(--muted); font-size: 0.75rem; white-space: normal; }
.file-list li button { border: none; background: none; color: var(--muted); padding: 2px 6px; font-size: 1rem; line-height: 1; }
.privacy { margin: 0; font-size: 0.8rem; color: var(--muted); }

/* Nakładka przy przeciąganiu plików/folderów nad konwerter */
#view-converter { position: relative; }
.drop-overlay {
  display: none; position: fixed; inset: 0; z-index: 50; place-items: center; pointer-events: none;
  background: color-mix(in srgb, var(--accent) 12%, transparent); backdrop-filter: blur(2px);
}
.drop-overlay > div {
  display: grid; gap: 6px; text-align: center; padding: 28px 40px; border-radius: 18px;
  border: 2px dashed var(--accent); background: var(--surface); box-shadow: 0 10px 40px rgba(0,0,0,.15);
}
.drop-overlay strong { font-size: 1.2rem; color: var(--accent); }
.drop-overlay span { color: var(--muted); font-size: 0.9rem; }
#view-converter.dragging .drop-overlay { display: grid; }

/* Pole na pliki + przycisk folderu */
.drop-wrap { flex: 1; display: flex; flex-direction: column; gap: 8px; min-height: 0; }
.has-files .drop-wrap { flex: none; flex-direction: row; }
.has-files .drop-wrap .drop { flex: 1; }
.btn-folder { padding: 9px 12px; border-radius: 12px; border: 1px dashed var(--border); background: var(--surface); color: var(--accent); font-weight: 600; font-size: 0.85rem; }
.btn-folder:hover { border-color: var(--accent); background: var(--accent-soft); }
.has-files .btn-folder { flex: 1; }
.progress { margin: 0; font-size: 0.82rem; color: var(--accent); }

/* Przełącznik spółek */
.companies { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; }
.companies ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; max-height: 260px; overflow-y: auto; }
.companies li { display: flex; align-items: center; gap: 2px; }
.company-remove { flex: none; border: none; background: none; color: var(--muted); padding: 4px 8px; font-size: 1rem; line-height: 1; border-radius: 6px; }
.company-remove:hover { color: var(--bad); background: var(--surface-2); }
.company-item { flex: 1; min-width: 0; text-align: left; display: grid; gap: 1px; padding: 7px 10px; border-radius: 8px; border: 1px solid transparent; background: none; }
.company-item:hover { background: var(--surface-2); border-color: transparent; }
.company-item[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); }
.company-item .cname { font-weight: 600; font-size: 0.86rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.company-item small { color: var(--muted); font-size: 0.74rem; }

/* Pliki, które nie są sprawozdaniem */
.other-files { margin-top: 6px; border-top: 1px solid var(--border); padding-top: 6px; }
.other-files summary { cursor: pointer; font-size: 0.8rem; color: var(--muted); padding: 2px 0; }
.other-files ul { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 4px; max-height: 300px; overflow-y: auto; }
.file-list li small.not-sf { color: var(--warn); font-weight: 600; }

/* Chowanie panelu z plikami */
.side-hide { display: none; align-self: flex-start; padding: 5px 12px; border-radius: 99px; font-size: 0.82rem; color: var(--text); background: var(--surface); border: 1px solid var(--border); }
.side-hide:hover { border-color: var(--accent); color: var(--accent); }
.has-files .side-hide { display: block; }
.converter.side-collapsed { grid-template-columns: minmax(0, 1fr); }
.converter.side-collapsed .side { display: none; }
.side-show { margin-bottom: 8px; padding: 5px 12px; border-radius: 99px; font-size: 0.82rem; color: var(--text); background: var(--surface); border: 1px solid var(--border); }
.side-show:hover { border-color: var(--accent); color: var(--accent); }

/* Pusty stan */
.empty { flex: 1; display: grid; place-content: center; justify-items: center; text-align: center; min-height: 300px; padding: 32px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; }
.empty h2 { margin: 12px 0 4px; font-size: 1.15rem; }
.empty p { margin: 0; color: var(--muted); max-width: 46ch; }
.empty-sheet {
  width: 160px; height: 96px; border-radius: 8px; border: 1px solid var(--border);
  background:
    linear-gradient(var(--grid) 1px, transparent 1px) 0 0 / 100% 16px,
    linear-gradient(90deg, var(--grid) 1px, transparent 1px) 0 0 / 40px 100%,
    var(--surface-2);
}

/* Nagłówek spółki + podsumowanie */
.company { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px; align-items: flex-end; margin-bottom: 12px; }
.company h1 { margin: 0; font-size: 1.35rem; letter-spacing: -0.01em; }
.company p { margin: 2px 0 0; font-size: 0.88rem; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 14px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 12px 16px; min-width: 0; }
.kpi .v { font-size: 1.2rem; margin-top: 4px; }
.kpi .k { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; font-size: 0.72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.kpi-info { text-transform: none; color: var(--accent); cursor: help; }
.kpi[data-tip] { cursor: help; }
.kpi-year { flex: none; padding: 0 6px; border-radius: 99px; background: var(--surface-2); text-transform: none; letter-spacing: 0; font-variant-numeric: tabular-nums; }
.kpi .v { font-weight: 700; font-variant-numeric: tabular-nums; }
.kpi .c { font-size: 0.78rem; font-variant-numeric: tabular-nums; }
.kpi .c.pos { color: var(--pos); } .kpi .c.neg { color: var(--neg); }

/* Sterowanie */
.controls { display: grid; gap: 10px; margin-bottom: 10px; }
.control { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 0; }
.control-label { font-size: 0.8rem; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
.chips button { flex: none; white-space: nowrap; padding: 4px 12px; border-radius: 99px; font-size: 0.82rem; font-variant-numeric: tabular-nums; }
.chips button[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); font-weight: 600; }
.chips button.cmp { font-style: italic; }
.check { display: flex; align-items: center; gap: 6px; font-size: 0.85rem; color: var(--muted); cursor: pointer; }
/* Stały układ ustawień: rząd 1 – lata i układ, rząd 2 – przełączniki i pobieranie */
.controls-row { display: flex; flex-wrap: wrap; gap: 10px 20px; align-items: center; }
.controls-row.bottom { justify-content: space-between; flex-wrap: nowrap; }
.checks { display: flex; flex-direction: column; gap: 4px; }
.check-line { display: inline-flex; align-items: center; gap: 4px; }
.check:has(input:disabled) { opacity: .45; cursor: default; }
.info-star {
  width: 20px; height: 20px; padding: 0; border-radius: 50%; display: grid; place-items: center;
  font-weight: 800; font-size: 0.85rem; line-height: 1; color: var(--accent); background: var(--accent-soft); border: none; cursor: help;
}

/* Własne dymki podpowiedzi (zamiast systemowych) */
.tip {
  position: fixed; z-index: 200; max-width: 320px; padding: 10px 12px; border-radius: 10px;
  background: var(--text); color: var(--bg); font-size: 0.82rem; line-height: 1.45;
  box-shadow: 0 8px 24px rgba(0,0,0,.22); pointer-events: none; opacity: 0; transform: translateY(4px);
  transition: opacity .12s ease, transform .12s ease;
}
.tip:not(.show) { visibility: hidden; }
.tip.show { opacity: 1; transform: none; }
/* tylko widoczny dymek z linkiem przyjmuje kliknięcia – schowany nie może zasłaniać strony */
.tip.show.interactive { pointer-events: auto; }
.tip strong { display: block; margin-bottom: 4px; }
.tip a { color: inherit; text-decoration: underline; font-weight: 600; cursor: pointer; }
.tip::after {
  content: ""; position: absolute; left: var(--arrow-x, 50%); width: 10px; height: 10px; background: inherit;
  transform: translateX(-50%) rotate(45deg); bottom: -5px;
}
.tip.below::after { top: -5px; bottom: auto; }

/* Pobierz arkusz – menu z opcjami */
.export { position: relative; margin-left: auto; }
.export-menu {
  display: none; position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; width: 330px;
  padding: 14px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, .14);
}
.export.open .export-menu { display: grid; gap: 12px; }
/* mostek między przyciskiem a menu, żeby menu nie znikało przy przejeżdżaniu myszką */
.export.open::after { content: ""; position: absolute; right: 0; top: 100%; width: 100%; height: 8px; }
.export-menu fieldset { border: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.export-menu legend { font-size: 0.72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; padding: 0; }
.export-menu label { display: flex; align-items: center; gap: 8px; font-size: 0.88rem; cursor: pointer; }
.export-menu .delim { padding-left: 24px; gap: 4px 8px; color: var(--muted); font-size: 0.82rem; flex-wrap: wrap; min-width: 0; }
.export-menu select { font: inherit; font-size: 0.82rem; padding: 4px 6px; border-radius: 6px; border: 1px solid var(--border); background: var(--surface); color: var(--text); width: 100%; max-width: 100%; min-width: 0; }
.export-menu fieldset, .export-menu label { min-width: 0; }
.export-menu .primary { width: 100%; }
.export-menu .exp-per-year { margin-top: 4px; }
.exp-hint { margin: -4px 0 0; font-size: 0.78rem; color: var(--muted); }

/* Arkusz w stylu Excela */
.sheet { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.table-wrap { overflow: auto; height: max(320px, calc(100dvh - 430px)); }
.sheet-bar { display: flex; align-items: flex-end; background: var(--head); border-bottom: 1px solid var(--border); }
.sheet-bar .sheet-tabs { flex: 1; border-bottom: none; }
.sheet-full { flex: none; margin: 4px 8px; padding: 4px 10px; font-size: 0.8rem; color: var(--muted); }
.sheet-full:hover { color: var(--text); }
/* Uchwyt do rozciągania tabeli */
.resize-grip { height: 12px; cursor: ns-resize; background: var(--head); border-top: 1px solid var(--border); display: grid; place-items: center; touch-action: none; }
.resize-grip::before { content: ""; width: 44px; height: 4px; border-radius: 4px; background: var(--border); }
.resize-grip:hover::before { background: var(--muted); }
/* Pełny ekran: podsumowanie, ustawienia i tabela na całym ekranie */
#result.is-full { position: fixed; inset: 0; z-index: 100; overflow: auto; padding: 20px; background: var(--bg); display: flex; flex-direction: column; }
#result:fullscreen { overflow: auto; padding: 20px; background: var(--bg); display: flex; flex-direction: column; }
#result.is-full .sheet { flex: 1; min-height: 0; display: flex; flex-direction: column; }
#result.is-full .table-wrap { flex: 1; height: auto !important; min-height: 0; }
#result.is-full .resize-grip { display: none; }
#table { border-collapse: separate; border-spacing: 0; width: max-content; min-width: 100%; font-size: 13px; }
/* Wysokości wierszy (24 i 28 px) dają pełne piksele przy skalowaniu 100%, 125% i 150% – linie siatki są wtedy równe */
#table th, #table td { border-right: 1px solid var(--grid); border-bottom: 1px solid var(--grid); padding: 0 8px; line-height: 18px; white-space: nowrap; }
#table tbody tr, #table thead tr.names { height: 28px; }
#table thead th { position: sticky; background: var(--head); z-index: 2; font-weight: 600; }
#table thead tr.letters { height: 24px; }
#table thead tr.letters th { top: 0; font-weight: 400; color: var(--muted); text-align: center; font-size: 11px; }
#table thead tr.names th { top: 24px; text-align: right; }
#table thead tr.names th.rn { text-align: center; }
#table td.lbl { padding-top: 4px; padding-bottom: 4px; }
#table thead tr.names th.l { text-align: left; }
#table .rn { position: sticky; left: 0; z-index: 1; width: 40px; min-width: 40px; text-align: center; color: var(--muted); background: var(--head); font-size: 11px; font-weight: 400 !important; font-variant-numeric: tabular-nums; vertical-align: middle; }
#table td.sym, #table td.num { vertical-align: middle; }
#table thead .rn { z-index: 3; }
#table .sym { position: sticky; left: 40px; z-index: 1; width: 72px; min-width: 72px; color: var(--muted); background: var(--surface); }
#table .lbl { position: sticky; left: 112px; z-index: 1; width: 34vw; min-width: 240px; max-width: 460px; white-space: normal; background: var(--surface); box-shadow: 1px 0 0 var(--border); }
#table thead .sym, #table thead .lbl { background: var(--head); z-index: 3; }
#table td.num { text-align: right; font-variant-numeric: tabular-nums; min-width: 120px; }
#table td.zero { color: var(--zero); }
#table td.restated { color: var(--warn); font-weight: 600; cursor: help; box-shadow: inset 3px 0 0 var(--warn); }
#table td.cmp, #table th.cmp { color: var(--muted); font-style: italic; }
#table td.delta.pos, #table td.pct.pos { color: var(--pos); }
#table td.delta.neg, #table td.pct.neg { color: var(--neg); }
#table th.delta, #table th.pct, #table td.delta, #table td.pct { background: var(--surface-2); }
#table tbody tr:hover td { background: var(--row-hover); }
#table tr.d0 td { font-weight: 700; }
#table tr.d1 td { font-weight: 600; }
#table tr.custom td.lbl { font-style: italic; }
#table tr.unknown td.lbl::after { content: " ⚠"; color: var(--warn); }

.sheet-tabs { display: flex; gap: 2px; padding: 6px 8px 0; background: var(--head); border-bottom: 1px solid var(--border); overflow-x: auto; }
.sheet-tabs button { border: none; border-radius: 6px 6px 0 0; background: none; padding: 6px 14px; font-size: 0.85rem; color: var(--muted); white-space: nowrap; border-bottom: 2px solid transparent; }
.sheet-tabs button[aria-selected="true"] { background: var(--surface); color: var(--accent); font-weight: 600; border-bottom-color: var(--accent); }

/* ---------- Informacje dodatkowe ---------- */
.info { margin-top: 24px; }
.info h2 { font-size: 1.05rem; margin: 0 0 10px; }
.info-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; min-width: 0; overflow-wrap: anywhere; }
.card .notice, .card li, .card span { min-width: 0; overflow-wrap: anywhere; }
ul.plain li > span { flex: 1; min-width: 0; }
ul.plain li > button { flex: none; }
.card.wide { grid-column: 1 / -1; }
.card h3 { margin: 0 0 8px; font-size: 0.85rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }
.notice { font-size: 0.88rem; padding: 4px 0 4px 22px; position: relative; }
.notice::before { position: absolute; left: 0; font-weight: 700; }
.notice.ok::before { content: "✓"; color: var(--ok); }
.notice.warn::before { content: "!"; color: var(--warn); left: 4px; }
.notice.bad::before { content: "✗"; color: var(--bad); }
.notice details { color: var(--muted); font-size: 0.82rem; margin-top: 2px; }
.notice ul { margin: 4px 0; padding-left: 18px; }
ul.plain { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
ul.plain li { display: flex; gap: 10px; align-items: center; font-size: 0.88rem; }
.table-scroll { overflow-x: auto; }
.small-table { border-collapse: collapse; font-size: 0.82rem; width: 100%; }
.small-table th, .small-table td { text-align: left; padding: 4px 10px 4px 0; border-bottom: 1px solid var(--grid); white-space: nowrap; }
.small-table th { color: var(--muted); font-weight: 600; }

/* ---------- O stronie / Asystent ---------- */
.prose { max-width: 760px; padding-top: 40px; }
.prose h1 { font-size: 1.8rem; letter-spacing: -0.02em; margin: 0 0 10px; }
.prose .lead { font-size: 1.05rem; color: var(--muted); }
.ticks { list-style: none; padding: 0; display: grid; gap: 8px; }
.ticks li { padding-left: 26px; position: relative; }
.ticks li::before { content: "✓"; position: absolute; left: 0; color: var(--accent); font-weight: 700; }
.prose ol { padding-left: 20px; display: grid; gap: 6px; margin-bottom: 24px; }
.chat-mock { display: grid; gap: 10px; margin-top: 24px; padding: 18px; background: var(--surface); border: 1px dashed var(--border); border-radius: 14px; opacity: .75; }
.bubble { padding: 10px 14px; border-radius: 12px; max-width: 80%; font-size: 0.9rem; }
.bubble.user { justify-self: end; background: var(--accent-soft); }
.bubble.bot { background: var(--surface-2); }

/* ---------- O stronie: sekcje przewijane ---------- */
.about { position: relative; }
.about-sec { min-height: 88vh; display: flex; align-items: center; padding: 96px 24px 96px 140px; border-bottom: 1px solid var(--border); scroll-margin-top: 64px; }
.about-sec:last-child { border-bottom: none; }
.sec-inner { width: 100%; max-width: 1040px; margin: 0 auto; }
.kicker { margin: 0 0 12px; font-size: 0.78rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); }
.about h1, .about h2 { letter-spacing: -0.03em; line-height: 1.05; margin: 0 0 18px; }
.hero-title { font-size: clamp(2.4rem, 6vw, 4.6rem); font-weight: 800; }
.about h2 { font-size: clamp(1.9rem, 4vw, 3rem); font-weight: 800; max-width: 24ch; }
.about h3 { font-size: 1.05rem; margin: 0 0 8px; letter-spacing: -0.01em; }
.grad { background: linear-gradient(90deg, var(--grad-1), var(--grad-2) 50%, var(--grad-2) 62%, var(--grad-3)); background: linear-gradient(90deg in oklch, var(--grad-1), var(--grad-2) 50%, var(--grad-3)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-lead, .sec-lead { font-size: 1.15rem; color: var(--muted); max-width: 62ch; margin: 0 0 28px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 48px; }
.button.big { padding: 12px 22px; font-size: 1rem; border-radius: 999px; font-weight: 600; }
.button.ghost { background: var(--surface-2); border-color: transparent; }
.sec-intro .hero-title, .sec-intro .hero-lead, .sec-intro .kicker, .sec-summary { text-align: left; }

.letter { display: grid; grid-template-columns: 56px 1fr; gap: 18px; max-width: 760px; padding: 24px 26px; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow); }
.letter p { margin: 0 0 12px; }
.letter p:first-child { font-weight: 600; font-size: 1.05rem; }
.letter .sign { margin: 4px 0 0; color: var(--muted); }
.avatar { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 1.4rem; color: var(--accent-text); background: linear-gradient(135deg, var(--grad-1), var(--grad-2)); }

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 8px 0 40px; }
.stat { padding: 20px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; }
.stat-n { font-size: 2.6rem; font-weight: 800; letter-spacing: -0.03em; line-height: 1; margin-bottom: 10px; }
.stat p { margin: 0; color: var(--muted); font-size: 0.9rem; }
/* Lista problemów: numer, krótki tytuł i opis; punkt pokazywany przez animację obok się podświetla */
.issues { list-style: none; padding: 0; margin: 28px 0 0; display: grid; max-width: 760px; border-top: 1px solid var(--border); }
.issues li {
  position: relative; display: grid; grid-template-columns: 34px minmax(0, 1fr); column-gap: 10px; row-gap: 2px;
  padding: 12px 12px 12px 14px; border-bottom: 1px solid var(--border);
  transition: background-color .35s ease;
}
.issues li::before {
  content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 3px;
  background: var(--bad); transform: scaleY(0); transition: transform .35s ease;
}
.issue-n { grid-row: span 2; padding-top: 1px; font-size: 0.8rem; font-weight: 800; color: var(--muted); font-variant-numeric: tabular-nums; transition: color .35s ease; }
.issues strong { font-size: 0.98rem; }
.issue-text { color: var(--muted); font-size: 0.88rem; }
.issues li.live { background: color-mix(in srgb, var(--bad) 7%, transparent); }
.issues li.live::before { transform: scaleY(1); }
.issues li.live .issue-n { color: var(--bad); }

.steps { list-style: none; padding: 0; margin: 8px 0 48px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.step { padding: 22px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; }
.step-n { display: inline-block; font-weight: 800; color: var(--accent); margin-bottom: 14px; font-variant-numeric: tabular-nums; }
.step p { margin: 0; color: var(--muted); font-size: 0.92rem; }
.roadmap-title { font-size: 1.2rem !important; }
.roadmap { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 20px; }
.stage { padding: 20px; border-radius: 16px; border: 1px solid var(--border); background: var(--surface); }
.stage-0 { border-color: var(--accent); }
.stage-when { display: inline-block; font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; padding: 3px 10px; border-radius: 99px; background: var(--surface-2); color: var(--muted); margin-bottom: 12px; }
.stage-0 .stage-when { background: var(--accent-soft); color: var(--accent); }
.stage ul { margin: 0; padding-left: 18px; display: grid; gap: 6px; font-size: 0.92rem; }
.note { color: var(--muted); max-width: 70ch; font-size: 0.92rem; border-left: 3px solid var(--accent); padding-left: 14px; }

/* Układ: tekst po lewej, animacja po prawej */
.split { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 48px; align-items: center; }
.split .issues { max-width: none; }
/* przy problemach animacja przewija się razem z listą (jest przypięta, a nie wyśrodkowana) */
.split-problem { align-items: start; }
.split-problem > .mock { position: sticky; top: 96px; }

/* Animacja 1: typowy konwerter */
.mock { background: var(--surface); border: 1px solid var(--border); border-radius: 22px; padding: 26px; box-shadow: var(--shadow); }
.mock-label { margin: 0 0 6px; font-size: 0.72rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.mock-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 8px 12px; min-width: 0; }
.mock-head > div { min-width: 0; }
.mock-file { margin: 0; font-weight: 800; font-size: 1.25rem; letter-spacing: -0.02em; overflow-wrap: anywhere; }
.mock, .split > * { min-width: 0; }
.mock-meta { margin: 2px 0 0; color: var(--muted); font-size: 0.85rem; }
.badge-load, .badge-err { padding: 4px 12px; border-radius: 99px; font-size: 0.8rem; font-weight: 700; white-space: nowrap; display: inline-flex; gap: 6px; align-items: center; }
.badge-load { background: var(--surface-2); color: var(--muted); }
.badge-err { background: color-mix(in srgb, var(--bad) 15%, transparent); color: var(--bad); }
.spin { width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--muted); border-top-color: transparent; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.mock-head { margin-bottom: 18px; }
.err-box { display: grid; gap: 2px; padding: 12px 14px; border-radius: 12px; background: color-mix(in srgb, var(--bad) 10%, transparent); color: var(--bad); font-size: 0.88rem; }
.err-box span { opacity: .85; }
.mock-excel { width: 100%; margin: 14px 0 18px; padding: 12px; border-radius: 99px; border: none; background: var(--surface-2); color: var(--muted); font-weight: 700; cursor: default; }
.mock-excel small { margin-left: 8px; font-weight: 600; padding: 2px 8px; border-radius: 99px; background: var(--surface); }
.mock-manual { margin: 0 0 8px; font-size: 0.78rem; color: var(--muted); }
.blur-rows { display: grid; gap: 8px; filter: blur(3px); opacity: .55; }
.brow { display: flex; justify-content: space-between; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--border); font-variant-numeric: tabular-nums; }
/* fazy */
.fail .badge-err, .fail .err-box { display: none; }
.fail .err-box, .fail .mock-excel, .fail .mock-manual, .fail .blur-rows { transition: opacity .5s ease, transform .5s ease; }
.fail[data-phase="load"] .mock-excel, .fail[data-phase="load"] .mock-manual, .fail[data-phase="load"] .xl { opacity: .25; }
.fail[data-phase="error"] .badge-load { display: none; }
.fail[data-phase="error"] .badge-err { display: inline-flex; animation: pop .35s ease; }
.fail[data-phase="error"] .err-box { display: grid; animation: pop .35s ease; }
@keyframes pop { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* Animacja 2: strona odkrywa się krok po kroku */
.demo { display: grid; grid-template-columns: minmax(0, .68fr) minmax(0, 1.32fr); gap: 32px; align-items: center; margin: 12px 0 56px; }
.demo-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.demo-step { position: relative; overflow: hidden; width: 100%; text-align: left; display: grid; grid-template-columns: 36px 1fr; gap: 10px; padding: 16px 18px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); cursor: pointer; opacity: .6; transition: opacity .3s, border-color .3s; }
.demo-step:hover { opacity: .9; }
.demo-step.on, .demo-step.done { opacity: 1; }
.demo-step.on { border-color: var(--accent); }
.demo-step .step-n { margin: 0; font-weight: 800; color: var(--accent); }
.step-body { display: grid; gap: 4px; }
.step-body span { color: var(--muted); font-size: 0.88rem; }
.step-progress { position: absolute; left: 0; bottom: 0; right: 0; height: 3px; }
.step-progress span { display: block; height: 100%; width: 0; background: var(--accent); }
.demo-step.on .step-progress span { animation: fill 3s linear forwards; }
.demo-step.done .step-progress span { width: 100%; opacity: .25; }
@keyframes fill { to { width: 100%; } }

.demo-window { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow); overflow: hidden; font-size: 12px; }
.demo-bar { display: flex; align-items: center; gap: 6px; padding: 10px 14px; background: var(--head); border-bottom: 1px solid var(--border); }
.demo-bar > span { width: 9px; height: 9px; border-radius: 50%; background: var(--border); }
.demo-bar em { margin-left: 10px; font-style: normal; color: var(--muted); font-size: 11px; padding: 2px 10px; border-radius: 99px; background: var(--surface); }
.demo-body { display: grid; grid-template-columns: 28% minmax(0, 1fr); gap: 12px; padding: 12px 12px 22px; }
.d-main { display: grid; gap: 9px; align-content: start; min-width: 0; }
.zone { filter: blur(6px); opacity: .45; transition: filter .6s ease, opacity .6s ease; }
.demo-window[data-active="1"] [data-zone="1"],
.demo-window[data-active="2"] [data-zone="1"], .demo-window[data-active="2"] [data-zone="2"],
.demo-window[data-active="3"] .zone { filter: none; opacity: 1; }

/* lewy panel: spółki, dodawanie plików, wgrane pliki */
.d-side { display: grid; gap: 7px; align-content: start; min-width: 0; }
.d-box { display: grid; gap: 4px; padding: 7px; border: 1px solid var(--border); border-radius: 9px; min-width: 0; }
.d-cap { margin: 0 0 1px 2px; font-size: 9px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.d-item { display: flex; align-items: center; gap: 5px; min-width: 0; padding: 4px 5px; border-radius: 6px; border: 1px solid transparent; }
.d-item-text { display: grid; min-width: 0; flex: 1; }
.d-item b { font-size: 10.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.d-item small { font-size: 9px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.d-company.on { background: var(--accent-soft); border-color: var(--accent); }
.d-file i { flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--ok); }
.d-x { flex: none; color: var(--muted); }
.d-add { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; }
.d-add span { padding: 6px 4px; border: 1px dashed var(--border); border-radius: 8px; text-align: center; color: var(--accent); font-weight: 600; font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* nagłówek spółki i najważniejsze liczby */
.d-head strong { display: block; font-size: 13px; }
.d-head small { display: block; color: var(--muted); font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.d-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-top: 8px; }
.d-kpi { display: grid; gap: 1px; padding: 6px 8px; border: 1px solid var(--border); border-radius: 8px; min-width: 0; }
.d-kpi-k { display: flex; justify-content: space-between; gap: 4px; font-size: 8.5px; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
.d-kpi-k span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.d-kpi-k em { flex: none; font-style: normal; padding: 0 4px; border-radius: 99px; background: var(--surface-2); }
.d-kpi b { font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.d-kpi-c { font-size: 9.5px; color: var(--pos); font-variant-numeric: tabular-nums; }

/* lata, układ, pobieranie */
.d-controls { position: relative; z-index: 2; display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.d-chip { padding: 1px 8px; border-radius: 99px; border: 1px solid var(--accent); color: var(--accent); background: var(--accent-soft); font-weight: 600; }
.d-seg { display: inline-flex; gap: 2px; padding: 2px; border-radius: 7px; background: var(--surface-2); }
.d-seg span { padding: 1px 7px; border-radius: 5px; color: var(--muted); transition: background-color .3s, color .3s; }
.d-seg .d-asc, .demo-window[data-active="3"] .d-seg .d-cmp { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: var(--shadow); }
.demo-window[data-active="3"] .d-seg .d-asc { background: none; color: var(--muted); font-weight: 400; box-shadow: none; }
.d-excel { margin-left: auto; padding: 3px 10px; border-radius: 7px; background: var(--accent); color: var(--accent-text); font-weight: 700; white-space: nowrap; }
.d-menu {
  position: absolute; right: 0; top: calc(100% + 5px); display: grid; gap: 4px; width: 172px; padding: 8px 9px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.18);
  opacity: 0; transform: translateY(-4px); pointer-events: none;
}
.d-opt { display: flex; align-items: center; gap: 6px; font-size: 10px; white-space: nowrap; }
.d-opt::before { content: ""; flex: none; width: 8px; height: 8px; border: 1.5px solid var(--muted); border-radius: 50%; }
.d-check::before { border-radius: 2px; }
.d-opt.on::before { border-color: var(--accent); background: radial-gradient(circle, var(--accent) 45%, transparent 50%); }
.d-menu-btn { margin-top: 3px; padding: 3px; border-radius: 6px; text-align: center; background: var(--accent); color: var(--accent-text); font-weight: 700; font-size: 10px; }
/* krok 3: menu „Pobierz arkusz” otwiera się na chwilę */
.demo-window[data-active="3"] .d-menu { animation: d-menu 4.5s ease forwards; }
.demo-window[data-active="3"] .d-excel { animation: d-press 4.5s ease forwards; }
@keyframes d-menu { 0%, 38% { opacity: 0; transform: translateY(-4px); } 46%, 86% { opacity: 1; transform: none; } 100% { opacity: 0; transform: translateY(-4px); } }
@keyframes d-press { 0%, 30% { box-shadow: none; } 36%, 86% { box-shadow: 0 0 0 4px var(--accent-soft); } 100% { box-shadow: none; } }

/* arkusz w stylu Excela */
.d-sheet { border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.d-tabs { display: flex; gap: 2px; padding: 4px 6px 0; background: var(--head); border-bottom: 1px solid var(--border); overflow: hidden; }
.d-tabs span { padding: 3px 8px; border-radius: 5px 5px 0 0; color: var(--muted); font-size: 10px; white-space: nowrap; border-bottom: 2px solid transparent; }
.d-tabs span.on { background: var(--surface); color: var(--accent); font-weight: 600; border-bottom-color: var(--accent); }
.d-r { display: grid; grid-template-columns: 18px 46px minmax(0, 1fr) 80px 80px 0fr; font-variant-numeric: tabular-nums; transition: grid-template-columns .5s ease; }
.d-r > span { font-size: 10.5px; padding: 3px 5px; border-right: 1px solid var(--grid); border-bottom: 1px solid var(--grid); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: right; }
.d-r > span:nth-child(2), .d-r > span:nth-child(3) { text-align: left; }
.d-r:last-child > span { border-bottom: none; }
.d-r .rn, .d-r.d-letters > span { background: var(--head); color: var(--muted); font-size: 9px; text-align: center !important; }
.d-r.d-names > span { background: var(--head); font-weight: 600; font-size: 9.5px; }
.d-r .sym { color: var(--muted); }
.d-r.d0 > span { font-weight: 700; }
.d-r.d1 > span { font-weight: 600; }
.d-r.d1 .lbl { padding-left: 11px; }
.d-r.d2 .lbl { padding-left: 18px; }
.d-pct { padding-left: 0 !important; padding-right: 0 !important; opacity: 0; transition: opacity .4s ease .2s; }
.d-pct.pos { color: var(--pos); background: var(--surface-2); }
.demo-window[data-active="3"] .d-r { grid-template-columns: 18px 46px minmax(0, 1fr) 80px 80px 62px; }
.demo-window[data-active="3"] .d-pct { opacity: 1; padding: 3px 5px !important; }
.demo-note { position: absolute; right: 12px; bottom: 5px; margin: 0; font-size: 10px; color: var(--muted); }

@media (max-width: 560px) {
  /* na telefonie lewy panel to tylko przyciski i pliki, a tabela pokazuje mniej kolumn */
  .demo-body { grid-template-columns: minmax(0, 1fr); }
  .d-companies { display: none; }
  .d-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .d-kpi:nth-child(3) { display: none; }
  .d-r, .demo-window[data-active="3"] .d-r { grid-template-columns: 16px 0 minmax(0, 1fr) 68px 68px 0fr; }
  .d-r > span { font-size: 9.5px; padding: 3px; }
  .d-r > span:nth-child(2) { padding: 0; border: none; }
  .demo-window[data-active="3"] .d-r { grid-template-columns: 16px 0 minmax(0, 1fr) 68px 68px 44px; }
  .demo-window[data-active="3"] .d-pct { padding: 3px !important; }
}

/* Animacja 3: asystent AI */
.pill { display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px; border-radius: 99px; border: 1px solid var(--border); background: var(--surface); font-size: 0.82rem; font-weight: 600; margin-bottom: 18px; }
.pill-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--grad-3); }
.two-tone span { color: var(--muted); opacity: .7; }
.chat { display: flex; flex-direction: column; height: 480px; background: var(--surface); border: 1px solid var(--border); border-radius: 24px; padding: 20px 22px; box-shadow: var(--shadow); }
.chat-head { display: flex; align-items: center; gap: 12px; padding-bottom: 14px; border-bottom: 1px solid var(--border); }
.chat-ico { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); color: var(--grad-3); }
.chat-live { margin-left: auto; }
.chat-live i { display: block; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 0 var(--ok); animation: live 2s infinite; }
@keyframes live { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 60%, transparent); } 100% { box-shadow: 0 0 0 8px transparent; } }
.chat-body { flex: 1; min-height: 0; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end; gap: 12px; padding: 16px 0; transition: opacity .5s ease; }
.chat-body.fade { opacity: 0; }
.msg { flex: none; max-width: 84%; padding: 12px 16px; border-radius: 16px; font-size: 0.95rem; opacity: 0; transform: translateY(10px) scale(.98); transition: opacity .35s ease, transform .35s ease; }
.msg.in { opacity: 1; transform: none; }
.msg p { margin: 0; }
.msg.user { align-self: flex-end; background: var(--text); color: var(--bg); border-bottom-right-radius: 6px; }
.msg.bot { align-self: flex-start; background: var(--surface-2); border-bottom-left-radius: 6px; }
.chips-ok { display: flex; flex-wrap: wrap; gap: 6px; }
.chips-ok:not(:empty) { margin-top: 10px; }
.chips-ok span { padding: 3px 9px; border-radius: 99px; font-size: 0.78rem; font-weight: 700; color: var(--ok); background: color-mix(in srgb, var(--ok) 14%, transparent); opacity: 0; transform: scale(.85); transition: opacity .25s ease, transform .25s ease; }
.chips-ok span.in { opacity: 1; transform: none; }
.typing { display: flex; gap: 4px; padding: 14px 16px; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: blink 1s infinite; }
.typing i:nth-child(2) { animation-delay: .15s; } .typing i:nth-child(3) { animation-delay: .3s; }
@keyframes blink { 0%, 100% { opacity: .25; } 50% { opacity: 1; } }
.composer { display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 16px; margin-bottom: 12px; border: 1px solid var(--border); border-radius: 22px; background: var(--surface-2); min-height: 46px; }
.composer-ph { flex: 1; color: var(--muted); }
.composer-text { flex: 1; }
.composer-text:empty { display: none; }
.typing-caret::after { content: "|"; margin-left: 1px; color: var(--accent); animation: blink .8s infinite; }
.composer-send { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--accent-text); font-weight: 800; transition: transform .15s ease; }
.composer-send.press { transform: scale(.82); }
.chat-foot { margin: 0; padding-top: 12px; border-top: 1px solid var(--border); font-size: 0.78rem; color: var(--muted); }

.cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 8px 0 16px; }
.pcard { padding: 20px 22px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; }
.pcard:first-child { grid-column: 1 / -1; border-color: var(--accent); }
.pcard p { margin: 0; color: var(--muted); font-size: 0.92rem; }
.updated { color: var(--muted); font-size: 0.82rem; }

.sec-summary { min-height: 60vh; }
.summary-title { font-size: clamp(2.2rem, 5vw, 4rem) !important; max-width: none !important; }

/* Pojawianie się sekcji przy przewijaniu */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .6s ease, transform .6s ease; }
.reveal.shown { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } }

/* Pasek z kropkami po lewej */
.rail { position: fixed; left: 28px; top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; gap: 34px; z-index: 5; transition: opacity .25s ease; }
.rail.away { opacity: 0; pointer-events: none; }
.rail-line { position: absolute; left: 8px; top: 9px; bottom: 9px; width: 2px; background: var(--border); border-radius: 2px; }
.rail-dot { position: relative; display: flex; align-items: center; gap: 14px; text-decoration: none; color: var(--muted); height: 18px; }
.rail-dot .dot { width: 18px; height: 18px; display: grid; place-items: center; }
.rail-dot .dot::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--surface); border: 2px solid var(--muted); transition: all .25s ease; }
.rail-dot:hover .dot::before { border-color: var(--accent); }
.rail-dot[aria-current="true"] .dot::before { width: 18px; height: 18px; background: var(--accent); border-color: var(--accent); box-shadow: 0 0 0 5px var(--accent-soft); }
.rail-label { font-size: 0.82rem; white-space: nowrap; opacity: 0; transform: translateX(-6px); transition: all .2s ease; pointer-events: none; }
.rail-dot:hover .rail-label, .rail-dot[aria-current="true"] .rail-label { opacity: 1; transform: none; }
.rail-dot[aria-current="true"] .rail-label { color: var(--text); font-weight: 600; }

/* ---------- Stopka ---------- */
/* Stopka jako „zestawienie” w stylu sprawozdania finansowego */
.site-footer {
  border-top: 1px solid var(--border); padding: 28px 56px 16px;
  background:
    linear-gradient(var(--grid) 1px, transparent 1px) 0 0 / 100% 28px,
    var(--bg);
  background-attachment: local;
}
.foot-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.7fr); gap: 40px; align-items: center; max-width: 1200px; margin: 0 auto; }
.foot-brand .brand { font-size: 1.15rem; }
.foot-brand p { color: var(--muted); max-width: 42ch; margin: 10px 0 0; }
.foot-brand .foot-tag { color: var(--text); font-weight: 700; font-size: 1.05rem; }
.foot-brand .foot-full { margin: 4px 0 0; font-size: 0.72rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); }
.ledger { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 12px 20px 10px; font-variant-numeric: tabular-nums; box-shadow: var(--shadow); font-size: 0.92rem; }
.ledger-cap { display: flex; justify-content: space-between; font-size: 0.72rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); margin-bottom: 4px; }
.ledger-cap span:last-child { color: var(--muted); letter-spacing: .04em; }
.ledger-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 28px; }
.ledger-head, .ledger-row { display: grid; grid-template-columns: 44px auto 1fr auto; align-items: baseline; gap: 8px; padding: 4px 0; }
.ledger-head { font-size: 0.75rem; color: var(--muted); border-bottom: 1px solid var(--border); padding-top: 0; }
.ledger-row { border-bottom: 1px solid var(--grid); color: var(--text); text-decoration: none; }
.ledger-row .sym { color: var(--muted); }
.ledger-row.group { font-weight: 700; }
.ledger-row.item .lbl { padding-left: 14px; }
.ledger-row .dots { border-bottom: 2px dotted var(--border); transform: translateY(-4px); }
.ledger-row .go { color: var(--accent); font-size: 0.85rem; font-weight: 600; }
a.ledger-row:hover .lbl { color: var(--accent); }
a.ledger-row:hover .dots { border-color: var(--accent); }
.ledger-total { margin-top: 8px; padding-top: 6px; border-top: 3px double var(--text); }
.ledger-total p { margin: 0 0 2px; font-size: 0.75rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.ledger-total .ledger-row { grid-template-columns: auto 1fr auto; border-bottom: none; }
.ledger-total strong { color: var(--ok); }
.ledger-total .ledger-row[data-tip] { cursor: help; }
.foot-sign { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 12px; max-width: 1200px; margin: 14px auto 0; font-size: 0.85rem; color: var(--muted); }

/* Plan B: ręczne przepisywanie do Excela */
.xl { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; font-size: 12.5px; transition: opacity .5s ease; }
.xl-top { display: flex; justify-content: space-between; gap: 8px; padding: 8px 12px; background: var(--head); border-bottom: 1px solid var(--border); color: var(--muted); font-size: 0.78rem; }
.xl-timer { font-variant-numeric: tabular-nums; color: var(--warn); font-weight: 600; }
.xl-grid { display: grid; grid-template-columns: 26px minmax(0, 1.3fr) 1fr 1fr; font-variant-numeric: tabular-nums; }
.xl-grid > span { padding: 5px 8px; min-height: 27px; border-right: 1px solid var(--grid); border-bottom: 1px solid var(--grid); white-space: nowrap; overflow: hidden; }
.xl-rn, .xl-col { background: var(--head); color: var(--muted); text-align: center; font-size: 11px; padding: 5px 2px !important; }
.xl-c.n { text-align: right; }
.xl-head { font-weight: 700; }
.xl-c.cur { outline: 2px solid var(--ok); outline-offset: -2px; }
.xl-c.cur::after { content: "|"; color: var(--ok); animation: blink .8s infinite; margin-left: 1px; }
.xl-tabs { display: flex; gap: 2px; padding: 4px 8px 0; background: var(--head); border-top: 1px solid var(--border); }
.xl-tab { padding: 4px 10px; border-radius: 0 0 6px 6px; color: var(--muted); font-size: 11px; transition: background .15s, color .15s; }
.xl-tab.on { background: var(--surface); color: var(--ok); font-weight: 700; box-shadow: inset 0 2px 0 var(--ok); }

@media (max-width: 900px) {
  .rail { display: none; }
  .about-sec { padding: 64px 16px; min-height: auto; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .steps, .roadmap, .cards { grid-template-columns: 1fr; }
  .split, .demo { grid-template-columns: 1fr; gap: 24px; }
  .split-problem > .mock { position: static; }
  .demo-body { grid-template-columns: 1fr; }
  .chat { min-height: 0; }
  .letter { grid-template-columns: 1fr; }
  .site-footer { padding: 24px 16px 14px; }
  .foot-grid { grid-template-columns: 1fr; gap: 16px; }
  .ledger { padding: 12px 14px 10px; }
  .ledger-head, .ledger-row { grid-template-columns: 40px auto 1fr auto; }
}
@media (max-width: 560px) {
  .ledger-cols { grid-template-columns: 1fr; }
  .ledger-col + .ledger-col .ledger-head { display: none; }
}

/* ---------- Telefon / wąski ekran ---------- */
@media (max-width: 900px) {
  .topbar { grid-template-columns: 1fr auto; padding: 10px 16px; }
  .views { grid-column: 1 / -1; grid-row: 2; justify-self: stretch; overflow-x: auto; }
  .view { padding: 16px; }
  .converter { grid-template-columns: 1fr; }
  .side { position: static; height: auto; }
  .converter { min-height: 0; }
  .drop { min-height: 180px; }
  .info-grid { grid-template-columns: 1fr; }
  #table .lbl { width: auto; min-width: 180px; max-width: 220px; position: static; }
  #table .sym { position: static; }
  /* menu przypięte do prawej krawędzi całego wiersza – nie wychodzi poza ekran */
  .controls-row.bottom { position: relative; }
  .export { position: static; margin-left: 0; }
  .export-menu { left: auto; right: 0; width: min(330px, 100%); }
  .table-wrap { max-height: 70vh; }
}

/* Komunikat na dole ekranu */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 150; max-width: min(520px, calc(100vw - 32px));
  padding: 12px 18px; border-radius: 12px; background: var(--text); color: var(--bg); font-size: 0.9rem;
  box-shadow: 0 8px 28px rgba(0,0,0,.25);
}
/* Pusty stan z problemem (nic nie jest sprawozdaniem / błąd łączenia) */
.empty.problem { border-color: var(--warn); }
.empty.problem h2 { color: var(--warn); }
.not-found { padding-top: 80px; }
.not-found .button { margin-right: 8px; }