/* Wspólny wygląd demo narzędzi (kalkulatory, asystent). Kolor marki: --acc w <style> każdej strony. */
:root {
  --bg: #f3f2ef; --surface: #fff; --surface-2: #f7f6f3; --ink: #1b1e21; --muted: #5a6168;
  --line: #e4e1db; --line-2: #cfcac1; --acc: #1f4f4a; --acc-h: #153a36; --acc-soft: #e6efec;
  --warn-bg: #fff2cc; --warn-ink: #5c4400; --err: #b42318; --ok: #1d6b45;
  --radius: 12px; --shadow: 0 1px 2px rgba(20,24,28,.06), 0 6px 20px rgba(20,24,28,.07);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
svg { flex: none; }
h1, h2, h3 { margin: 0; letter-spacing: -.015em; }
.muted { color: var(--muted); font-weight: 400; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
:focus-visible { outline: 3px solid var(--acc); outline-offset: 2px; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--acc); color: #fff; padding: 10px 14px; border-radius: 8px; text-decoration: none; font-weight: 600; }
.skip:focus { top: 10px; }

.topbar { min-height: 58px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 20px; background: var(--surface); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-mark { width: 30px; height: 30px; }
.brand-mark rect { fill: var(--acc); }
.brand-mark path, .brand-mark circle { fill: none; stroke: #fff; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.brand-name { font-weight: 750; font-size: 19px; letter-spacing: -.03em; }
.brand-sub { color: var(--muted); font-size: 13px; padding-left: 10px; border-left: 1px solid var(--line); }
.demo-badge { margin: 0; display: inline-flex; align-items: center; gap: 8px; background: var(--warn-bg); color: var(--warn-ink); font-size: 13px; font-weight: 600; padding: 6px 12px; border-radius: 999px; }
.demo-badge .dot { width: 7px; height: 7px; border-radius: 50%; background: #c58a00; }

.app { display: grid; grid-template-columns: minmax(0, 1fr) 440px; height: calc(100vh - 58px); height: calc(100dvh - 58px); }
.viewer { position: relative; min-height: 0; overflow: auto; padding: 28px; background: linear-gradient(160deg, var(--acc-soft), var(--bg) 60%); }
.side { display: flex; flex-direction: column; min-height: 0; background: var(--surface); border-left: 1px solid var(--line); }
.panel { flex: 1; min-height: 0; overflow-y: auto; padding: 26px 26px 12px; overscroll-behavior: contain; scrollbar-gutter: stable; }
.panel:focus { outline: none; }

.intro h1 { font-size: 23px; line-height: 1.2; font-weight: 700; }
.intro p { margin: 8px 0 4px; color: var(--muted); }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.step { padding: 22px 0; border-bottom: 1px solid var(--line); }
.step:last-child { border-bottom: 0; }
.step > legend, .step > h2 { display: flex; align-items: center; gap: 10px; padding: 0; margin-bottom: 14px; font-size: 16px; font-weight: 700; }
.step > legend { float: left; width: 100%; }
.step > legend + * { clear: both; }
.num { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--acc-soft); color: var(--acc); font-size: 13px; font-weight: 700; }

.tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 4px; background: var(--surface-2); border-radius: 12px; margin: 16px 0 4px; }
.tabs button { border: 0; background: transparent; padding: 9px 10px; border-radius: 9px; font-weight: 650; min-height: 40px; }
.tabs button[aria-selected="true"] { background: #fff; color: var(--acc); box-shadow: 0 1px 3px rgba(0,0,0,.12); }

.dim + .dim { margin-top: 14px; }
.dim-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.dim-head label { font-weight: 600; font-size: 14px; }
.num-in { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 14px; }
.num-in input { width: 92px; padding: 6px 8px; text-align: right; border: 1.5px solid var(--line-2); border-radius: 8px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; background: #fff; }
.lim { display: flex; justify-content: space-between; margin: 0; font-size: 12px; color: var(--muted); }
.info { margin: 12px 0 0; font-size: 13px; color: var(--muted); }
.info b { color: var(--ink); font-weight: 600; }
input[type="range"] { --p: 50%; -webkit-appearance: none; appearance: none; display: block; width: 100%; height: 28px; margin: 4px 0 2px; background: transparent; cursor: pointer; }
input[type="range"]::-webkit-slider-runnable-track { height: 6px; border-radius: 3px; background: linear-gradient(to right, var(--acc) var(--p), var(--line-2) var(--p)); }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; margin-top: -8px; border-radius: 50%; background: #fff; border: 2px solid var(--acc); box-shadow: 0 1px 4px rgba(0,0,0,.2); }
input[type="range"]::-moz-range-track { height: 6px; border-radius: 3px; background: var(--line-2); }
input[type="range"]::-moz-range-progress { height: 6px; border-radius: 3px; background: var(--acc); }
input[type="range"]::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 2px solid var(--acc); }

select, .inp { padding: 8px 10px; border: 1.5px solid var(--line-2); border-radius: 8px; background: #fff; min-height: 40px; }
select { padding-right: 32px; -webkit-appearance: none; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 9l6 6 6-6' fill='none' stroke='%235a6168' stroke-width='2'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 8px center; background-size: 16px; }

.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.card { position: relative; display: block; }
.card input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.card-in { display: flex; flex-direction: column; gap: 4px; height: 100%; padding: 11px 10px; border: 1.5px solid var(--line-2); border-radius: var(--radius); background: #fff; cursor: pointer; transition: border-color .15s, background-color .15s; }
.card-in b { font-size: 14px; line-height: 1.2; }
.card-in small { font-size: 12px; color: var(--muted); }
.card:hover .card-in { border-color: var(--acc); }
.card input:checked + .card-in { border-color: var(--acc); background: var(--acc-soft); box-shadow: inset 0 0 0 1px var(--acc); }
.card input:focus-visible + .card-in { outline: 3px solid var(--acc); outline-offset: 2px; }

.check { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; font-size: 14px; }
.check input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--acc); flex: none; cursor: pointer; }
.check b { font-weight: 600; }
.checks { display: grid; gap: 10px; }

.link-btn { display: inline-flex; align-items: center; gap: 6px; padding: 4px 2px; border: 0; background: none; color: var(--acc); font-weight: 600; font-size: 14px; text-decoration: underline; text-underline-offset: 3px; }
.link-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }

.breakdown { width: 100%; border-collapse: collapse; font-size: 14px; }
.breakdown th, .breakdown td { padding: 8px 0; vertical-align: top; border-bottom: 1px solid var(--line); }
.breakdown th { text-align: left; font-weight: 500; padding-right: 12px; }
.breakdown th small { display: block; color: var(--muted); font-size: 12px; font-weight: 400; }
.breakdown td { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; font-weight: 600; }
.breakdown tfoot th, .breakdown tfoot td { border-bottom: 0; padding: 6px 0; }
.breakdown tfoot tr:first-child th, .breakdown tfoot tr:first-child td { padding-top: 12px; }
.breakdown tfoot .total th, .breakdown tfoot .total td { font-size: 17px; font-weight: 750; border-top: 1.5px solid var(--ink); padding-top: 10px; }
.note { margin: 14px 0 10px; font-size: 13px; color: var(--muted); }
.rates { margin: 0 0 12px; font-size: 13px; }
.rates summary { cursor: pointer; color: var(--acc); font-weight: 600; width: fit-content; padding: 2px 0; }
.rates ul { margin: 10px 0 0; padding: 12px 14px 12px 30px; background: var(--surface-2); border-radius: 10px; }
.rates li + li { margin-top: 4px; }

.pricebar { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 22px 16px; background: var(--surface); border-top: 1px solid var(--line); box-shadow: 0 -8px 24px rgba(20,24,28,.05); }
.pb-price { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.pb-label { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.pb-netto { font-size: 24px; font-weight: 750; letter-spacing: -.02em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pb-netto small { font-size: 14px; font-weight: 600; color: var(--muted); letter-spacing: 0; }
.pb-brutto { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.btn-primary, .btn-ghost { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 11px 18px; border-radius: 10px; font-weight: 650; font-size: 15px; white-space: nowrap; }
.btn-primary { background: var(--acc); color: #fff; border: 1.5px solid var(--acc); }
.btn-primary:hover { background: var(--acc-h); border-color: var(--acc-h); }
.btn-primary svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.btn-primary[disabled] { opacity: .7; cursor: progress; }
.btn-ghost { background: #fff; color: var(--ink); border: 1.5px solid var(--line-2); }
.btn-ghost:hover { border-color: var(--ink); }

/* karty wyników w podglądzie */
.kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.kpi { background: rgba(255,255,255,.9); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; box-shadow: var(--shadow); }
.kpi span { display: block; font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.kpi b { display: block; font-size: 24px; font-weight: 750; letter-spacing: -.02em; font-variant-numeric: tabular-nums; margin-top: 2px; }
.kpi small { color: var(--muted); font-size: 12.5px; }
.stage { background: #fff; border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); padding: 18px; margin-bottom: 16px; }
.stage svg { display: block; width: 100%; height: auto; }
.stage-cap { margin: 10px 2px 0; font-size: 13px; color: var(--muted); }

dialog { width: min(640px, calc(100% - 24px)); max-height: calc(100dvh - 24px); padding: 0; border: 0; border-radius: 16px; box-shadow: 0 30px 80px rgba(10,14,18,.35); color: var(--ink); }
dialog::backdrop { background: rgba(18,21,24,.55); }
.dlg-in { position: relative; padding: 28px 28px 24px; }
.dlg-x { position: absolute; top: 14px; right: 14px; width: 40px; height: 40px; display: grid; place-items: center; border: 0; border-radius: 50%; background: var(--surface-2); }
.dlg-x svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
dialog h2 { font-size: 21px; padding-right: 48px; }
.dlg-lead { margin: 8px 0 14px; color: var(--muted); }
.dlg-sum { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 16px; padding: 11px 14px; margin-bottom: 18px; background: var(--acc-soft); border-radius: 10px; font-size: 14px; }
.f-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.f.full { grid-column: 1 / -1; }
.f label:not(.check) { display: block; font-weight: 600; font-size: 14px; margin-bottom: 5px; }
.f input:not([type="checkbox"]), .f textarea { width: 100%; padding: 10px 12px; border: 1.5px solid var(--line-2); border-radius: 10px; background: #fff; min-height: 44px; }
.f [aria-invalid="true"] { border-color: var(--err) !important; }
.req { color: var(--err); }
.err { margin: 5px 0 0; color: var(--err); font-size: 13px; font-weight: 600; }
.err[hidden] { display: none; }
.consent { margin-top: 16px; }
.consent .check { font-size: 13.5px; }
.demo-note { margin: 16px 0 0; padding: 10px 14px; background: var(--warn-bg); color: var(--warn-ink); border-radius: 10px; font-size: 13px; }
.dlg-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; flex-wrap: wrap; }
.ok-box { text-align: center; padding: 8px 4px 0; }
.ok-box:focus { outline: none; }
.ok-box h2 { padding: 0; }
.ok-box p { margin: 10px auto 0; max-width: 480px; }
.ok-box .dlg-actions { justify-content: center; }
.ok-ico { width: 60px; height: 60px; margin: 6px auto 14px; border-radius: 50%; background: var(--acc-soft); display: grid; place-items: center; }
.ok-ico svg { width: 30px; height: 30px; fill: none; stroke: var(--acc); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.toast { position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 16px); z-index: 50; background: var(--ink); color: #fff; padding: 11px 16px; border-radius: 10px; font-size: 14px; font-weight: 600; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; max-width: calc(100% - 32px); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 1100px) { .app { grid-template-columns: minmax(0, 1fr) 390px; } .panel { padding: 22px 20px 12px; } .kpis { grid-template-columns: 1fr 1fr; } }
@media (max-width: 899px) {
  .topbar { padding: 9px 16px; flex-wrap: wrap; row-gap: 6px; }
  .brand-sub { display: none; }
  .demo-badge { font-size: 12px; padding: 5px 10px; }
  .app { display: block; height: auto; }
  .viewer { padding: 16px; overflow: visible; }
  .side { border-left: 0; }
  .panel { overflow: visible; padding: 22px 16px 24px; scrollbar-gutter: auto; }
  .pricebar { position: sticky; bottom: 0; z-index: 6; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); box-shadow: 0 -6px 20px rgba(20,24,28,.1); }
  .pb-netto { font-size: 20px; }
  .btn-primary { padding: 10px 14px; }
  .toast { bottom: 96px; }
}
@media (max-width: 480px) {
  .kpis { grid-template-columns: 1fr 1fr; gap: 8px; }
  .kpi { padding: 10px 12px; }
  .kpi b { font-size: 19px; }
  .cards { gap: 6px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .f-grid { grid-template-columns: 1fr; }
  .dlg-in { padding: 22px 18px 18px; }
  .dlg-actions .btn-primary, .dlg-actions .btn-ghost { flex: 1; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }
