/* iPDA 3 – style aplikacji. Jeden plik, bez kompilacji. Tokeny zgodne z zaakceptowanym projektem. */

@font-face { font-family: 'IBM Plex Sans'; src: url('../fonts/IBMPlexSans-Regular.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'IBM Plex Sans'; src: url('../fonts/IBMPlexSans-Medium.woff2') format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'IBM Plex Sans'; src: url('../fonts/IBMPlexSans-SemiBold.woff2') format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'IBM Plex Sans'; src: url('../fonts/IBMPlexSans-Bold.woff2') format('woff2'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'IBM Plex Mono'; src: url('../fonts/IBMPlexMono-Regular.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'IBM Plex Mono'; src: url('../fonts/IBMPlexMono-Medium.woff2') format('woff2'); font-weight: 500; font-display: swap; }

:root {
  --bg: #F3F5F4; --surface: #FFFFFF; --line: #DDE3E0; --line-soft: #EEF2F0; --input-line: #C9D2CD;
  --ink: #18211D; --ink-2: #33413A; --muted: #5B6B63; --faint: #8A9690;
  --accent: #00853F; --accent-ink: #004D24; --accent-link: #006B33; --accent-soft: #E8F5EE; --accent-ring: #CDEBDA; --accent-light: #9BD3B4;
  --red: #C4322A; --red-ink: #9F1D14; --red-soft: #FDF3F2; --red-chip: #FBE4E2; --red-light: #F0B4AE; --red-line: #F0C9C5;
  --amber-ink: #6B3A00; --amber: #B25E00; --amber-soft: #FFF4E5; --amber-band: #F9E3C2;
  --sans: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, 'SFMono-Regular', Consolas, monospace;
  --radius: 12px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 15px/1.45 var(--sans); }
a { color: var(--accent-link); }
a:hover { color: var(--accent-ink); }
h1, h2, h3 { margin: 0; text-wrap: balance; }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--accent-ring); outline-offset: 2px; }
.mono, .num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.sym { font-family: var(--mono); font-weight: 500; color: var(--ink); }
.muted { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

/* ---------- układ strony ---------- */
.wrap { max-width: 1280px; margin: 0 auto; padding-inline: max(16px, env(safe-area-inset-left, 0px)) max(16px, env(safe-area-inset-right, 0px)); }
.topbar { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.topbar .wrap { min-height: 64px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 28px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand-mark { width: 36px; height: 36px; border-radius: 8px; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text b { font-size: 18px; }
.brand-text span { font-size: 12px; color: var(--muted); }
.mainnav { display: flex; flex-wrap: wrap; gap: 4px; flex: 1 1 auto; }
.mainnav a, .mainnav span { padding: 10px 14px; border-radius: 8px; color: var(--ink-2); font-weight: 500; font-size: 14px; text-decoration: none; }
.mainnav a.on { background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }
.mainnav span { color: var(--faint); }
.mainnav span small { font-size: 11px; }
.userbox { display: flex; align-items: center; gap: 14px; }
.avatar { text-decoration: none; width: 36px; height: 36px; border-radius: 50%; background: var(--ink); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; }
.linkbtn { border: 0; background: none; padding: 0; color: var(--accent-link); font-weight: 500; font-size: 14px; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
main.page { padding-block: 28px 48px; display: flex; flex-direction: column; gap: 22px; }
.pagehead { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; }
.pagehead .crumb { font-size: 13px; color: var(--muted); }
.pagehead h1 { font-size: 30px; font-weight: 700; letter-spacing: -0.01em; }
.cols { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
.col-main { flex: 999 1 640px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.col-side { flex: 1 1 300px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.footer { border-top: 1px solid var(--line); background: var(--surface); }
.footer .wrap { padding-block: 16px; font-size: 12px; color: var(--muted); }

/* ---------- elementy ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.card h2 { font-size: 17px; font-weight: 600; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.grid-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 500; color: var(--ink-2); min-width: 0; }
.field.off { color: var(--faint); }
.field-label { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.box { display: flex; align-items: center; height: 44px; border: 1px solid var(--input-line); border-radius: 8px; background: var(--surface); overflow: hidden; }
.box:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.box input, .box select { border: 0; outline: 0; height: 42px; padding: 0 12px; font: 500 16px var(--mono); background: transparent; flex: 1; min-width: 0; width: 100%; }
.box .u { padding: 0 12px; font-size: 13px; color: var(--muted); border-left: 1px solid #E4E9E6; height: 100%; display: flex; align-items: center; background: #F7F9F8; white-space: nowrap; }
.box.off { background: var(--bg); border-color: #E1E6E3; }
.box.off input { color: var(--faint); }
.readout { height: 44px; display: flex; align-items: center; gap: 8px; padding: 0 14px; border-radius: 8px; background: var(--bg); font: 500 16px var(--mono); }
.readout small { font: 400 13px var(--sans); color: var(--muted); }
.seg { display: inline-flex; flex-wrap: wrap; background: var(--line-soft); border-radius: 9px; padding: 3px; gap: 3px; }
.seg button, .seg a, .seg label { border: 0; background: transparent; min-height: 38px; padding: 0 14px; border-radius: 7px; font: 500 14px var(--sans); color: var(--ink-2); cursor: pointer; display: inline-flex; align-items: center; gap: 4px; text-decoration: none; }
.seg .on, .seg input:checked + span { background: var(--surface); color: var(--accent-ink); box-shadow: 0 1px 2px rgba(16, 40, 28, .15); }
.seg label { padding: 0; }
.seg label span { min-height: 38px; padding: 0 14px; border-radius: 7px; display: inline-flex; align-items: center; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg .count { color: var(--muted); font-weight: 400; }
.toggle { display: inline-flex; align-items: center; gap: 10px; font-size: 14px; color: var(--ink-2); cursor: pointer; min-height: 44px; font-weight: 400; }
.toggle input { position: absolute; opacity: 0; }
.toggle .track { width: 40px; height: 24px; border-radius: 12px; background: var(--input-line); position: relative; flex: none; transition: background .15s; }
.toggle .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: left .15s; }
.toggle input:checked + .track { background: var(--accent); }
.toggle input:checked + .track::after { left: 19px; }
.toggle input:focus-visible + .track { outline: 3px solid var(--accent-ring); outline-offset: 2px; }
.help { width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--input-line); background: var(--surface); color: var(--muted); font: 600 13px var(--sans); cursor: help; display: inline-flex; align-items: center; justify-content: center; padding: 0; flex: none; }
.btn { min-height: 44px; padding: 0 18px; border-radius: 10px; border: 1px solid var(--input-line); background: var(--surface); color: var(--ink-2); font: 500 14px var(--sans); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; }
.btn-primary { border: 0; background: var(--accent); color: #fff; font-weight: 600; font-size: 16px; min-height: 48px; }
.btn-primary:hover { background: #00733A; color: #fff; }
.btn-dark { border: 0; background: var(--ink); color: #fff; font-weight: 600; }
.btn[disabled], .btn[aria-disabled="true"] { color: var(--faint); cursor: not-allowed; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; }
.chip span { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; border: 1px solid var(--input-line); background: var(--surface); border-radius: 10px; padding: 8px 12px; min-height: 44px; cursor: pointer; }
.chip b { font-size: 14px; font-weight: 600; color: var(--ink); }
.chip small { font-size: 11px; color: var(--muted); }
.chip input:checked + span { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.chip input:focus-visible + span { outline: 3px solid var(--accent-ring); outline-offset: 2px; }
.brand-label { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.note { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 8px; font-size: 13px; line-height: 1.5; }
.note svg { flex: none; margin-top: 1px; }
.note-ok { background: var(--accent-soft); color: var(--accent-ink); }
.note-warn { background: var(--amber-soft); color: var(--amber-ink); }
.note-err { background: var(--red-soft); color: var(--red-ink); border: 1px solid var(--red-line); }
.note ul { margin: 4px 0 0; padding-left: 18px; }
.kv { margin: 0; display: grid; grid-template-columns: 1fr auto; gap: 10px 12px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font: 500 15px var(--mono); text-align: right; white-space: nowrap; }
.steps { list-style: none; margin: 0; padding: 0; display: flex; gap: 8px; align-items: center; font-size: 14px; }
.steps li { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.steps .dot { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--input-line); display: flex; align-items: center; justify-content: center; font-size: 13px; }
.steps .on { color: var(--accent-ink); font-weight: 600; }
.steps .on .dot { background: var(--accent); border-color: var(--accent); color: #fff; }
.steps .sep { width: 28px; height: 2px; background: var(--input-line); }
.pill { display: inline-flex; align-items: baseline; gap: 6px; padding: 6px 10px; border-radius: 8px; background: var(--surface); border: 1px solid var(--line-soft); font-size: 13px; color: var(--muted); white-space: nowrap; }
.pill b { font: 500 14px var(--mono); color: var(--ink); }
.pills { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- tabele ---------- */
.table-scroll { overflow-x: auto; margin: 0 -22px; padding: 0 22px; }
table.data { border-collapse: collapse; width: 100%; font-size: 14px; }
table.data th { font-size: 12px; font-weight: 600; color: var(--muted); text-align: right; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.data td { padding: 12px; border-bottom: 1px solid var(--line-soft); text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
table.data th:first-child, table.data td:first-child, table.data .l { text-align: left; }
table.data td.l { font-family: var(--sans); }
table.data tr.failing { background: var(--red-soft); }
table.data tr.failing a { color: var(--red-ink); }
.tag { display: inline-block; padding: 2px 8px; border-radius: 6px; background: var(--accent-soft); color: var(--accent-ink); }
.failing .tag { background: var(--red-chip); color: var(--red-ink); }
.tag-solid { background: var(--accent); color: #fff; font-size: 12px; font-weight: 600; font-family: var(--sans); }
.tag-soft { font-size: 12px; font-weight: 600; font-family: var(--sans); }
.tag-mute { background: var(--bg); color: var(--muted); font-size: 12px; font-weight: 600; font-family: var(--sans); }
.flag { margin-left: 8px; font: 600 11px var(--sans); color: var(--red-ink); }
.late { color: var(--amber); }
.failing .late, .failing .num-red { color: var(--red-ink); }
tr.best { background: #F2FAF5; }

/* ---------- wykres czasu podtrzymania ---------- */
.tchart { display: flex; flex-direction: column; gap: 10px; margin: 0; padding-top: 18px; border-top: 1px solid var(--line-soft); }
.tchart figcaption { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13px; color: var(--ink-2); }
.legend-i { display: inline-flex; align-items: center; gap: 6px; }
.legend-i i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.tchart-body { position: relative; display: flex; flex-direction: column; gap: 12px; padding: 8px 0 22px; --label: 130px; --gap: 40px; }
.tchart-row { display: flex; align-items: center; gap: 10px; }
.tchart-row > span { width: 120px; flex: none; font-size: 13px; font-weight: 600; }
.tchart-bars { flex: 1; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.tchart-bars div { display: flex; align-items: center; gap: 8px; }
.tchart-bars i { display: block; border-radius: 3px; height: 14px; width: calc((100% - var(--gap)) * var(--v)); }
.tchart-bars div + div i { height: 10px; }
.tchart-bars em { font: 500 12px var(--mono); font-style: normal; }
.tchart-req { position: absolute; top: 0; bottom: 18px; left: calc(var(--label) + (100% - var(--label) - var(--gap)) * var(--r)); border-left: 2px dashed var(--ink); z-index: 1; }
.tchart-req-l { position: absolute; bottom: 0; left: calc(var(--label) + (100% - var(--label) - var(--gap)) * var(--r) - 22px); font: 500 12px var(--mono); }

/* ---------- karty modeli (telefon) ---------- */
.mcards { display: none; flex-direction: column; gap: 12px; }
.mcard { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.mcard.failing { background: var(--red-soft); border-color: var(--red-line); }
.mcard h3 { font-size: 18px; font-weight: 700; }
.mcard.failing h3 { color: var(--red-ink); }
.mcard-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.mcard-bar { position: relative; height: 34px; }
.mcard-bar i { position: absolute; left: 0; border-radius: 3px; display: block; }
.mcard-bar .b1 { top: 4px; height: 12px; }
.mcard-bar .b2 { top: 20px; height: 8px; }
.mcard-bar .req { top: 0; bottom: 0; border-left: 2px dashed var(--ink); }
.mcard-kv { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.mcard-kv span { display: flex; flex-direction: column; gap: 2px; font-size: 11px; color: var(--muted); }
.mcard-kv b { font: 500 16px var(--mono); color: var(--ink); }

/* ---------- sekcje rozwijane ---------- */
details.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
details.panel > summary { padding: 16px 22px; font-size: 16px; font-weight: 600; cursor: pointer; list-style-position: inside; }
details.panel > .panel-body { padding: 0 22px 22px; display: flex; flex-direction: column; gap: 18px; }
.fchart { position: relative; height: 220px; margin-left: 36px; border-left: 1px solid var(--input-line); border-bottom: 1px solid var(--input-line); }
.fchart .band { position: absolute; left: 0; right: 0; background: var(--amber-band); }
.fchart .lim { position: absolute; left: 0; right: 0; border-top: 1px dashed var(--amber); }
.fchart .lim-l { position: absolute; left: 4px; background: rgba(255,255,255,.85); padding: 0 3px; z-index: 2; font: 500 11px var(--mono); color: #8A4800; }
.fchart .ytick { position: absolute; left: -34px; font: 400 11px var(--mono); color: var(--muted); transform: translateY(50%); }
.fchart .bars { position: absolute; inset: 0; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); padding: 0 8px; }
.fchart .bars div { display: flex; align-items: flex-end; justify-content: center; gap: 4px; height: 100%; }
.fchart .bars i { width: 22px; border-radius: 3px 3px 0 0; display: block; }
.fchart-x { margin-left: 36px; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); padding: 0 8px; text-align: center; font: 500 11px var(--mono); color: var(--ink-2); }
.vgauge { position: relative; height: 64px; margin-top: 22px; }
.vgauge .track { position: absolute; left: 0; right: 0; top: 22px; height: 20px; border-radius: 4px; background: var(--line-soft); }
.vgauge .range { position: absolute; top: 22px; height: 20px; background: var(--accent); border-radius: 4px; }
.vgauge .mark { position: absolute; top: 14px; height: 36px; border-left: 2px solid var(--ink); }
.vgauge .mark.dash { border-left-style: dashed; }
.vgauge .lab { position: absolute; transform: translateX(-50%); font: 500 12px var(--mono); white-space: nowrap; }
.vscale { display: flex; justify-content: space-between; font: 400 11px var(--mono); color: var(--muted); margin-top: 12px; }

/* ---------- korekta ---------- */
.rng { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--ink-2); }
.rng > div { display: flex; justify-content: space-between; }
.rng output { font: 500 14px var(--mono); color: var(--ink); }
.rng input[type=range] { accent-color: var(--accent); width: 100%; height: 28px; margin: 0; }
.rng select { height: 44px; border: 1px solid var(--input-line); border-radius: 8px; padding: 0 10px; font: 500 15px var(--mono); background: var(--surface); }

/* ---------- logowanie ---------- */
.auth { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px max(16px, env(safe-area-inset-left, 0px)); }
.auth-card { width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: 28px; }
.auth-top { display: flex; justify-content: space-between; align-items: center; }
.auth h1 { font-size: 34px; font-weight: 700; letter-spacing: -0.02em; }
.auth .intro { margin: 8px 0 0; font-size: 16px; color: var(--ink-2); }
.auth form { display: flex; flex-direction: column; gap: 16px; }
.auth .field input { height: 50px; border: 1px solid var(--input-line); border-radius: 10px; padding: 0 14px; font-size: 16px; background: var(--surface); }
.auth .field input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); outline: 0; }
.auth .row { display: flex; justify-content: space-between; align-items: center; font-size: 14px; gap: 12px; flex-wrap: wrap; }
.auth .small { font-size: 13px; color: var(--muted); display: flex; flex-direction: column; gap: 6px; }
.check { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; color: var(--ink-2); }
.check input { width: 18px; height: 18px; accent-color: var(--accent); margin: 0; }

/* ---------- profil obciążenia ---------- */
[hidden] { display: none !important; }
.profile { display: flex; flex-direction: column; gap: 12px; }
.profile-grid { display: flex; flex-wrap: wrap; gap: 16px 24px; align-items: flex-start; }
.profile-table { border-collapse: collapse; flex: 1 1 300px; min-width: 0; }
.profile-table th { font-size: 12px; font-weight: 500; color: var(--muted); text-align: left; padding: 0 6px 6px; }
.profile-table th .u { color: var(--faint); }
.profile-table td { padding: 3px 6px; }
.profile-table td.idx { font: 500 13px var(--mono); color: var(--muted); width: 24px; text-align: center; }
.profile-table .box { height: 40px; }
.profile-table .box input { height: 38px; }
.iconbtn { width: 36px; height: 36px; border-radius: 8px; border: 1px solid var(--input-line); background: var(--surface); color: var(--muted); font-size: 18px; cursor: pointer; line-height: 1; }
.iconbtn:disabled { opacity: .4; cursor: not-allowed; }
.profile-chart { flex: 1 1 260px; margin: 0; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.profile-chart svg { width: 100%; height: 150px; background: var(--bg); border-radius: 8px; border-bottom: 1px solid var(--input-line); }
.profile-chart rect.seg { fill: var(--accent); }
.profile-chart rect.over { fill: var(--red); }
.profile-chart line.limit { stroke: var(--ink); stroke-width: 1.5; stroke-dasharray: 5 4; vector-effect: non-scaling-stroke; }
.profile-chart figcaption { font: 500 12px var(--mono); color: var(--ink-2); }
.pill-profile { display: inline-flex; gap: 2px; align-items: flex-end; height: 18px; }
.pill-profile i { display: block; background: var(--accent); border-radius: 1px; width: var(--w); height: var(--h); min-width: 3px; }
.cov-100 { position: absolute; top: 0; bottom: 18px; border-left: 2px dashed var(--ink); z-index: 1; }

/* ---------- rozładowanie ---------- */
.dis-result { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.dis-tile { background: var(--bg); border-radius: 10px; padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.dis-tile span { font-size: 12px; color: var(--muted); }
.dis-tile b { font: 500 20px var(--mono); }
.dis-tile.main { background: var(--accent-soft); }
.dis-tile.main b { color: var(--accent-ink); font-size: 22px; }
.grid-fields.bat3 { grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr) minmax(0, 1.3fr); }
main [id] { scroll-margin-top: 84px; }
.dis-tile small { font: 400 12px var(--sans); color: var(--muted); }
.dis-timeline { position: relative; height: 54px; margin-top: 8px; }
.dis-timeline .track { position: absolute; left: 0; right: 0; top: 18px; height: 16px; background: var(--line-soft); border-radius: 4px; }
.dis-timeline .new { position: absolute; left: 0; top: 18px; height: 16px; background: var(--accent); border-radius: 4px; }
.dis-timeline .old { position: absolute; left: 0; top: 22px; height: 8px; background: var(--accent-light); border-radius: 3px; }
.dis-timeline .lim { position: absolute; top: 10px; height: 32px; border-left: 2px solid var(--ink-2); }
.dis-timeline .lab { position: absolute; top: 40px; transform: translateX(-50%); font: 400 11px var(--mono); color: var(--muted); white-space: nowrap; }
.modelinfo { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 14px; }
.modelinfo dt { color: var(--muted); }
.modelinfo dd { margin: 0; font-weight: 500; }

/* ---------- karta akumulatora ---------- */
.model-link { font-weight: 600; color: inherit; text-decoration: underline; text-decoration-color: var(--input-line); text-underline-offset: 3px; }
.model-link:hover { color: var(--accent-ink); text-decoration-color: currentColor; }
.failing .model-link { color: var(--red-ink); }
.karta-top { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.karta-photo { flex: 0 0 220px; height: 170px; border-radius: 10px; background: var(--bg); display: flex; align-items: center; justify-content: center; position: relative; overflow: hidden; }
.karta-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #fff; opacity: 0; transition: opacity .2s; }
.karta-photo img.ok { opacity: 1; }
.karta-photo .ph { width: 96px; color: var(--faint); }
.karta-params { flex: 1 1 300px; }
.inquiry { width: 100%; border: 1px solid var(--input-line); border-radius: 8px; padding: 12px 14px; font: 400 14px/1.5 var(--mono); background: var(--bg); color: var(--ink); resize: vertical; }
.kv dt .help { width: 22px; height: 22px; font-size: 11px; vertical-align: middle; margin-left: 4px; }

/* ---------- wycena ---------- */
td.price { font-family: var(--mono); white-space: nowrap; }
.failing td.price { color: var(--red-ink); }
.mcard-price { display: flex; justify-content: space-between; align-items: baseline; border-top: 1px solid var(--line-soft); padding-top: 10px; font-size: 13px; color: var(--muted); }
.mcard-price b { font: 600 16px var(--mono); color: var(--ink); }
.quote-options { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; }
.quote-table td, .quote-table th { white-space: nowrap; }
.quote-table td.l { white-space: normal; min-width: 180px; }
.quote-table tfoot td { border-top: 1px solid var(--line); padding-top: 10px; font-family: var(--mono); text-align: right; }
.quote-table tfoot td.l { font-family: var(--sans); text-align: left; }
.quote-table tfoot tr.total td { font-size: 16px; color: var(--accent-ink); border-top: 2px solid var(--ink); }
.inquiry-form { display: flex; flex-direction: column; gap: 12px; }

/* ---------- wycena ---------- */
.m-only { display: none; }

/* ---------- panel administratora ---------- */
.admin-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.adminnav { display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--line); }
.adminnav a { padding: 10px 14px; font-size: 14px; font-weight: 500; color: var(--ink-2); text-decoration: none; border-bottom: 2px solid transparent; white-space: nowrap; }
.adminnav a.on { color: var(--accent-ink); border-bottom-color: var(--accent); font-weight: 600; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; display: flex; flex-direction: column; gap: 4px; text-decoration: none; color: var(--ink); }
a.tile:hover { border-color: var(--accent); }
.tile span { font-size: 13px; color: var(--muted); }
.tile b { font: 600 28px var(--mono); }
.tile small { font-size: 12px; color: var(--muted); }
.meter { height: 10px; border-radius: 5px; background: var(--line-soft); overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--accent); }
.filters { flex-direction: row; flex-wrap: wrap; align-items: flex-end; gap: 12px 16px; }
.filters .field { flex: 1 1 180px; }
.muted-row td { color: var(--faint); }
.tag-err { background: var(--red-chip); color: var(--red-ink); font-size: 12px; font-weight: 600; font-family: var(--sans); }
.btn-danger { border-color: var(--red-line); color: var(--red-ink); background: var(--surface); }
.btn-danger:hover { background: var(--red-soft); }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: 13px; }
.upload { display: flex; flex-direction: column; gap: 12px; }
.upload input[type=file] { font-size: 14px; padding: 10px; border: 1px dashed var(--input-line); border-radius: 8px; background: var(--bg); }
.version { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line-soft); font-size: 14px; }
.chiplist { margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.chiplist a { font-size: 12px; padding: 3px 8px; border-radius: 6px; background: var(--bg); color: var(--ink-2); text-decoration: none; }
.chiplist a:hover { background: var(--accent-soft); color: var(--accent-ink); }
.mailpreview { width: 100%; height: 620px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.legend-row { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12px; color: var(--ink-2); }
.daychart { height: 180px; display: flex; align-items: flex-end; gap: 2px; border-bottom: 1px solid var(--input-line); }
.daychart .day { flex: 1 1 0; min-width: 0; height: 100%; display: flex; flex-direction: column-reverse; }
.daychart .day i { display: block; width: 100%; }
.daychart .day:hover { background: var(--line-soft); }
.daychart-x { display: flex; justify-content: space-between; font: 400 11px var(--mono); color: var(--muted); }
.hbar { display: grid; grid-template-columns: 90px 1fr 48px; align-items: center; gap: 10px; font-size: 13px; }
.hbar div { height: 12px; background: var(--line-soft); border-radius: 3px; overflow: hidden; }
.hbar i { display: block; height: 100%; background: var(--accent); }
.hbar b { font: 500 13px var(--mono); text-align: right; }
.kvline { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; padding: 4px 0; border-bottom: 1px solid var(--line-soft); }
.kvline b { font: 500 14px var(--mono); }

/* ---------- pasek akcji na telefonie ---------- */
.mobilebar { display: none; }

/* ---------- telefon ---------- */
@media (max-width: 720px) {
  body { font-size: 14px; }
  .topbar .wrap { min-height: 56px; gap: 6px 12px; padding-block: 6px; }
  .brand-text span { display: none; }
  .mainnav { order: 3; flex-basis: 100%; overflow-x: auto; flex-wrap: nowrap; }
  .mainnav a, .mainnav span { white-space: nowrap; padding: 8px 12px; }
  .userbox { margin-left: auto; gap: 10px; }
  .userbox .avatar { width: 32px; height: 32px; }
  main.page { padding-block: 16px 120px; gap: 14px; }
  .pagehead h1 { font-size: 24px; }
  .steps .label { display: none; }
  .card { padding: 16px; border-radius: 14px; gap: 14px; }
  .grid-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .grid-fields.one { grid-template-columns: 1fr; }
  .profile-table td { padding: 3px 3px; }
  .grid-fields.bat3 { grid-template-columns: 1fr; }
  .seg a { padding: 0 6px; white-space: nowrap; }
  .karta-photo { flex-basis: 100%; height: 150px; }
  .karta-ctx { order: -1; }
  .admin .tile b { font-size: 22px; }
  .mailpreview { height: 480px; }
  .admin main.page, main.admin { padding-bottom: 32px; }
  .quote-table th:nth-child(3), .quote-table td:nth-child(3), .quote-table th:nth-child(4), .quote-table td:nth-child(4),
  .quote-table th:nth-child(5), .quote-table td:nth-child(5) { display: none; }
  .quote-table .m-only { display: block; margin-top: 2px; }
  .quote-table tfoot { display: none; }
  .quote-table th, .quote-table td { padding-left: 4px; padding-right: 4px; }
  .quote-table td.l { min-width: 0; }
  .quote-table td { font-size: 13px; }
  .quote-sum.m-only { display: grid; padding-top: 4px; }
  .quote-sum dd b { color: var(--accent-ink); }
  .box { height: 48px; border-radius: 10px; }
  .box input, .box select { height: 46px; font-size: 17px; padding: 0 10px; }
  .box .u { padding: 0 10px; }
  .seg { display: flex; width: 100%; }
  .seg > * { flex: 1; justify-content: center; }
  .seg label span { width: 100%; justify-content: center; }
  .col-side .card.live { display: none; }
  .desktop-only { display: none !important; }
  .mobilebar { display: flex; flex-direction: column; gap: 10px; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: var(--surface); border-top: 1px solid var(--line); padding: 12px max(16px, env(safe-area-inset-right, 0px)) calc(14px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); box-shadow: 0 -4px 16px rgba(16, 40, 28, .06); }
  .mobilebar .sum { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); }
  .mobilebar .sum b { font: 500 15px var(--mono); color: var(--ink); }
  .mobilebar .two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .results-table, .tchart { display: none; }
  .mcards { display: flex; }
  .pills .pill.opt { display: none; }
  .table-scroll { margin: 0 -16px; padding: 0 16px; }
  details.panel > summary { padding: 14px 16px; }
  details.panel > .panel-body { padding: 0 16px 16px; }
}
.mcard-kv em { font-style: normal; }
@media (max-width: 720px) {
  .userbox .seg a { min-height: 32px; padding: 0 10px; }
}

/* raporty */
.radios { display: flex; flex-direction: column; gap: 8px; }
.chip input:disabled + span { opacity: .45; cursor: not-allowed; }
.upload { display: flex; flex-direction: column; gap: 10px; }
.upload input[type=file] { font-size: 14px; }
[data-report-form] [data-discount][hidden] { display: none; }

/* panel: serie */
.data tr.off td { color: var(--muted); }
.data tr.off td b { font-weight: 500; }
.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.switch input { width: 18px; height: 18px; accent-color: var(--accent); }
.savebar { position: sticky; bottom: 0; padding: 12px 0; background: linear-gradient(transparent, var(--bg) 35%); display: flex; justify-content: flex-end; }

/* wyniki: przeliczanie na bieżąco */
.live-status { margin: 0; font-size: 12px; color: var(--muted); }
.live-status.err { color: var(--danger, #9F1D14); }
[data-live-region="main"] { transition: opacity .15s; }
[data-live-region="main"].is-updating { opacity: .55; }

/* wyniki: model z marką/technologią w jednej komórce */
table.data td.model-cell { white-space: normal; line-height: 1.3; }
table.data td.model-cell .model-link { white-space: nowrap; }
table.data td.model-cell .sub { display: block; margin-top: 2px; font-size: 12px; color: var(--muted); white-space: nowrap; }
table.data .th-sub { display: block; font-weight: 500; font-size: 11px; }
.results-table table.data th, .results-table table.data td { padding-left: 10px; padding-right: 10px; }

/* górne menu: dłuższa nazwa „Panel Administracyjny” – na średnich ekranach ciaśniej, żeby menu mieściło się w jednym wierszu */
@media (min-width: 761px) and (max-width: 1240px) {
  .topbar .wrap { gap: 8px 16px; }
  .mainnav a, .mainnav span { padding-inline: 9px; }
  .mainnav span small { display: none; }
}
