/* Spedo – motyw w duchu Apple: ciemny (czerń, warstwowe szarości) albo jasny (biel na szarym tle), jeden kolor akcji
   i gradient "magii" tylko przy AI. Motyw ustawia theme.js (atrybut data-theme), domyślnie jak w systemie. */
@property --spin { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
:root {
  --bg: #000;
  --surface: #1c1c1e;
  --surface2: #2c2c2e;
  --surface3: #3a3a3c;
  --line: rgba(255,255,255,.08);
  --ink: #f5f5f7;
  --mut: #a1a1a6;
  --dim: #6e6e73;
  --ac: #0a84ff;
  --ac-hover: #409cff;
  --sel: rgba(10,132,255,.14);
  --ok: #30d158;
  --err: #ff6961;
  --err-hover: #ff8580;
  --warn-bg: rgba(255,214,10,.1);
  --warn-ink: #ffe27a;
  --ok-bg: rgba(48,209,88,.12);
  --ok-ink: #7ee29a;
  --err-bg: rgba(255,105,97,.12);
  --err-ink: #ffa39e;
  --demo-bg: rgba(191,90,242,.12);
  --demo-ink: #d9a8f7;
  --hover: rgba(255,255,255,.06);
  --row-hover: rgba(255,255,255,.025);
  --btn-hover: #48484a;
  --field-focus: #303033;
  --prompt-focus: #1f1f22;
  --ring-rest: .6; --glow-rest: .4; --ring-focus: .9; --glow-focus: .55;
  --line-strong: rgba(255,255,255,.22);
  --bar: rgba(0,0,0,.72);
  --glow: rgba(94,92,230,.22);
  --shadow: rgba(0,0,0,.8);
  --shadow-sm: rgba(0,0,0,.4);
  --picker: invert(.8);
  --magic: #64d2ff, #5e5ce6, #bf5af2, #ff375f, #ff9f0a, #64d2ff;
  --r-lg: 28px;
  --r-md: 18px;
  --r-sm: 12px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", "Segoe UI", system-ui, sans-serif;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #f5f5f7;
  --surface: #fff;
  --surface2: #f2f2f7;
  --surface3: #e5e5ea;
  --line: rgba(0,0,0,.1);
  --ink: #1d1d1f;
  --mut: #6e6e73;
  --dim: #7c7c80;
  --ac: #0071e3;
  --ac-hover: #0077ed;
  --sel: rgba(0,113,227,.1);
  --ok: #248a3d;
  --err: #d70015;
  --err-hover: #e3192b;
  --warn-bg: rgba(255,204,0,.18);
  --warn-ink: #7a5300;
  --ok-bg: rgba(52,199,89,.14);
  --ok-ink: #1b6b30;
  --err-bg: rgba(255,59,48,.1);
  --err-ink: #b3000f;
  --demo-bg: rgba(175,82,222,.12);
  --demo-ink: #7d2fae;
  --hover: rgba(0,0,0,.05);
  --row-hover: rgba(0,0,0,.025);
  --btn-hover: #d8d8de;
  --field-focus: #fff;
  --prompt-focus: #fff;
  --ring-rest: .55; --glow-rest: .32; --ring-focus: .85; --glow-focus: .45;
  --line-strong: rgba(0,0,0,.22);
  --bar: rgba(245,245,247,.8);
  --glow: rgba(94,92,230,.12);
  --shadow: rgba(0,0,0,.14);
  --shadow-sm: rgba(0,0,0,.12);
  --picker: none;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { background: var(--bg); }
/* Miejsce na pasek przewijania zawsze zarezerwowane: przy zmianie zakładki (krótka lista → długie raporty) układ nie przeskakuje w bok. */
html { scrollbar-gutter: stable; }
body {
  margin: 0; color: var(--ink); font: 17px/1.47 var(--font); letter-spacing: -.01em;
  -webkit-font-smoothing: antialiased;
  background: radial-gradient(1100px 520px at 50% -160px, var(--glow), transparent 70%), var(--bg);
  background-repeat: no-repeat;
  min-height: 100vh;
}
::selection { background: rgba(10,132,255,.45); }

/* ---------- nagłówek ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: var(--bar); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--line);
  padding-top: env(safe-area-inset-top, 0px);
}
.topbar .in {
  max-width: 1120px; margin: 0 auto; min-height: 56px;
  padding: 8px max(20px, env(safe-area-inset-right)) 8px max(20px, env(safe-area-inset-left));
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 20px; letter-spacing: -.02em; }
.tabs { display: flex; gap: 2px; background: var(--surface); border-radius: 999px; padding: 3px; margin: 0 auto; flex-wrap: wrap; }
.tabs button, .tabs a {
  background: transparent; text-decoration: none; border: 0; color: var(--mut); padding: 7px 16px; border-radius: 999px;
  font: 500 14px var(--font); letter-spacing: -.01em; cursor: pointer; transition: color .2s, background .2s;
}
.tabs button:hover, .tabs a:hover { color: var(--ink); background: var(--hover); }
.tabs { scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button.on, .tabs button.on:hover, .tabs a.on, .tabs a.on:hover { background: var(--surface3); color: var(--ink); }
.langpick { position: relative; margin: 0; }
.langpick select { margin: 0; width: auto; padding: 6px 28px 6px 12px; border-radius: 999px; background: var(--surface); border: 0; font-size: 13px; color: var(--ink); appearance: none; -webkit-appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--mut) 50%), linear-gradient(135deg, var(--mut) 50%, transparent 50%);
  background-position: calc(100% - 15px) 52%, calc(100% - 10px) 52%; background-size: 5px 5px; background-repeat: no-repeat; cursor: pointer; }
/* Przełącznik motywu: księżyc w jasnym (przejdź do ciemnego), słońce w ciemnym. */
.themebtn { flex: none; display: inline-grid; place-items: center; width: 32px; height: 32px; padding: 0; margin: 0; border-radius: 50%; background: var(--surface); color: var(--mut); }
.brand + .themebtn { margin-left: auto; }
.themebtn:hover { background: var(--surface3); color: var(--ink); }
.themebtn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.themebtn .sun, :root[data-theme="light"] .themebtn .moon { display: block; }
.themebtn .moon, :root[data-theme="light"] .themebtn .sun { display: none; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.who { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--mut); min-width: 0; }
.who span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 24ch; }
@media (min-width: 821px) { .topbar .in { flex-wrap: nowrap; } .tabs { flex-wrap: nowrap; } .tabs button, .tabs a { white-space: nowrap; } }
@media (min-width: 821px) and (max-width: 1100px) { .who span { display: none; } }
.tabs[hidden] + .langpick, .tabs[hidden] ~ .pill[hidden] + .langpick { margin-left: auto; }

/* ---------- układ ---------- */
main { max-width: 1120px; margin: 0 auto; padding: 28px max(20px, env(safe-area-inset-right)) 80px max(20px, env(safe-area-inset-left)); }
.narrow { max-width: 440px; margin: 0 auto; }
h1, h2, h3 { letter-spacing: -.022em; text-wrap: balance; }
h2 { font-size: 22px; font-weight: 600; margin: 0 0 6px; }
h3 { font-size: 17px; font-weight: 600; margin: 22px 0 8px; }
.pan { background: var(--surface); border-radius: var(--r-md); padding: 24px; margin-bottom: 20px; }
.note { font-size: 13px; color: var(--mut); margin: 6px 0 0; }
/* Nota ma tylko górny margines; pole, przełącznik albo formularz zaraz pod nią dostaje odstęp, żeby się nie kleiły. */
.note + label, .note + .seg, .note + form { margin-top: 14px; }
/* Tytuł na początku panelu bez górnego marginesu (wystarcza padding panelu). */
.pan > h3:first-child { margin-top: 0; }
#accInfo:empty { display: none; }
.note.dim, .dim { color: var(--dim); }
.gate .note { margin: 0 0 18px; }
/* Czynności nieodwracalne: usunięcie konta i firmy, przekazanie firmy */
.danger-zone { margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line); }
.danger-zone h3 { margin-top: 0; }
button.danger { background: var(--err); color: #fff; font-weight: 600; }
button.danger:hover { background: var(--err-hover); }
.note.sep { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
.center { text-align: center; }
.lead2 { margin: 0 0 8px; }
/* Przewoźnicy: wyszukiwanie i dwa filtry w jednym rzędzie; na telefonie pod sobą. */
.carfilters { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr); gap: 0 12px; align-items: end; margin-top: 14px; }
.carfilters label { min-width: 0; }
/* Paginacja listy przewoźników: zakres, numery stron, liczba na stronie; na telefonie „3 / 47” zamiast numerów. */
.pager { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 16px; margin: 16px 0 8px; }
.pager .note { margin: 0; }
.pgnums { display: flex; align-items: center; gap: 4px; margin: 0 auto; }
.pgset { display: flex; align-items: center; gap: 4px; }
.pg { min-width: 36px; height: 36px; padding: 0 10px; border-radius: 10px; background: transparent; color: var(--ink); font-variant-numeric: tabular-nums; }
.pg:hover:not(:disabled) { background: var(--hover); }
.pg.on { background: var(--surface3); font-weight: 600; }
.pg:disabled { opacity: .35; cursor: default; }
.pgdots { color: var(--dim); padding: 0 2px; }
.pgmob { display: none; color: var(--mut); font-variant-numeric: tabular-nums; padding: 0 6px; }
.pgper { display: flex; align-items: center; gap: 8px; margin: 0; white-space: nowrap; }
.pgper select { width: auto; padding-block: 6px; }
@media (max-width: 600px) {
  .pgset, .pgside span { display: none; }
  .pgmob { display: inline; }
  .pgside { min-width: 44px; height: 40px; background: var(--surface2); font-size: 18px; }
  .pgnums { margin: 0; order: -1; }
  .pager { justify-content: space-between; }
}
#carFilterSt { margin: -4px 0 8px; display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; }
@media (max-width: 700px) { .carfilters { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .carfilters .grow { grid-column: 1 / -1; } }
@media (max-width: 420px) { .carfilters { grid-template-columns: minmax(0, 1fr); } }
/* Zwijany panel (Przewoźnicy: własny plik, baza Spedo): w nagłówku tytuł, jedna linia stanu i strzałka. */
.pan.fold { padding-block: 0; }
.fold > summary { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 14px; padding: 20px 0; cursor: pointer; list-style: none; border-radius: var(--r-md); }
.fold > summary::-webkit-details-marker { display: none; }
.fold > summary::before { content: ""; align-self: center; width: 7px; height: 7px; border: solid var(--mut); border-width: 0 2px 2px 0; transform: rotate(-45deg); transition: transform .2s; margin: 0 4px 0 2px; }
.fold[open] > summary::before { transform: rotate(45deg); }
.fold > summary h2 { margin: 0; font-size: 18px; }
.fold > summary:hover h2 { color: var(--ac); }
.foldst { font-size: 13px; color: var(--mut); min-width: 0; }
.pan.fold[open] { padding-bottom: 24px; }
.fold[open] > summary { padding-bottom: 12px; }
.fold + .fold { margin-top: -8px; }
@media (max-width: 520px) {
  .fold > summary { padding: 15px 0; gap: 2px 10px; }
  .fold > summary h2 { font-size: 16px; }
  .fold > summary .foldst { flex-basis: 100%; padding-left: 21px; font-size: 12px; }
  .pan.fold[open] { padding-bottom: 18px; }
}
.err { color: var(--err); font-size: 14px; margin: 6px 0 0; min-height: 1.2em; }

/* ---------- powitanie i okno zapytania ---------- */
.welcome { max-width: 760px; margin: 5vh auto 56px; text-align: center; display: flex; flex-direction: column; align-items: center; }
.welcome h1 { font-size: clamp(36px, 6vw, 56px); line-height: 1.05; font-weight: 700; letter-spacing: -.035em; margin: 0 0 12px; }
.welcome .sub { font-size: 19px; color: var(--mut); margin: 0 0 32px; }
.prompt { position: relative; width: 100%; border-radius: var(--r-lg); isolation: isolate; }
.prompt textarea {
  display: block; width: 100%; min-height: 220px; resize: vertical; margin: 0;
  background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 26px 28px; font: 400 19px/1.5 var(--font); letter-spacing: -.01em;
  box-shadow: 0 30px 80px -30px var(--shadow);
  transition: border-color .25s, background .25s;
}
.prompt textarea::placeholder { color: var(--dim); }
.prompt textarea:focus { outline: none; border-color: var(--line-strong); background: var(--prompt-focus); }
/* Tęczowa krawędź: spokojna i nieruchoma na co dzień, wyraźniejsza przy pisaniu, obracająca się, gdy AI czyta zapytanie. */
.prompt::before, .prompt::after {
  content: ""; position: absolute; inset: -2px; border-radius: calc(var(--r-lg) + 2px); z-index: -1;
  background: conic-gradient(from var(--spin), var(--magic)); opacity: var(--ring-rest); transition: opacity .4s;
}
.prompt::after { inset: -10px; filter: blur(28px); opacity: var(--glow-rest); }
.prompt:focus-within::before { opacity: var(--ring-focus); }
.prompt:focus-within::after { opacity: var(--glow-focus); }
.prompt.thinking::before { opacity: 1; animation: spin 2.4s linear infinite; }
.prompt.thinking::after { opacity: .55; animation: spin 2.4s linear infinite; }
.prompt textarea, .prompt textarea:focus { border-color: transparent; }

/* Przycisk z "magią": obracający się gradient na obrysie i miękka poświata. */
.magic {
  position: relative; isolation: isolate; margin-top: 28px;
  display: inline-flex; align-items: center; gap: 10px;
  padding: 17px 34px; border: 0; border-radius: 999px; cursor: pointer;
  font: 600 18px var(--font); letter-spacing: -.01em; color: #fff; background: transparent;
  transition: transform .2s cubic-bezier(.2,.8,.2,1);
}
.magic::before { content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1.5px; z-index: -1;
  background: conic-gradient(from var(--spin), var(--magic)); animation: spin 6s linear infinite;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; }
.magic::after { content: ""; position: absolute; inset: 1.5px; border-radius: inherit; z-index: -2;
  background: radial-gradient(120% 140% at 50% 0%, #2a2a33, #111114 70%);
  box-shadow: 0 0 40px -6px rgba(124,108,255,.55), 0 0 90px -20px rgba(255,55,95,.35); transition: box-shadow .3s; }
.magic .spark { width: 20px; height: 20px; fill: #fff; filter: drop-shadow(0 0 6px rgba(160,140,255,.9)); }
.magic:hover { transform: translateY(-1px) scale(1.02); }
.magic:hover::after { box-shadow: 0 0 56px -4px rgba(124,108,255,.8), 0 0 120px -16px rgba(255,55,95,.5); }
.magic:active { transform: scale(.98); }
.magic.busy::before { animation-duration: 1.2s; }
.magic.busy .spark { animation: pulse 1s ease-in-out infinite; }
.magic:disabled { cursor: progress; opacity: 1; }
@keyframes spin { to { --spin: 360deg; } }
@keyframes pulse { 50% { transform: scale(.8) rotate(20deg); opacity: .7; } }

/* ---------- formularze ---------- */
label { display: block; font-size: 13px; color: var(--mut); margin-bottom: 12px; }
input, select, textarea {
  width: 100%; margin-top: 6px; padding: 12px 14px; border: 1px solid transparent; border-radius: var(--r-sm);
  background: var(--surface2); color: var(--ink); font: 400 16px var(--font); letter-spacing: -.01em;
  transition: border-color .2s, background .2s;
}
textarea { min-height: 260px; line-height: 1.5; }
textarea.short { min-height: 90px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--ac); background-color: var(--field-focus); }
/* Lista wyboru z własną strzałką w odstępie od prawej krawędzi (strzałka przeglądarki dotykała brzegu pola). */
select {
  appearance: none; -webkit-appearance: none; padding-right: 44px; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--mut) 50%), linear-gradient(135deg, var(--mut) 50%, transparent 50%);
  background-position: calc(100% - 23px) 52%, calc(100% - 18px) 52%; background-size: 5px 5px; background-repeat: no-repeat;
}
input[readonly] { background: transparent; border-color: var(--line); color: var(--mut); }
input:disabled, select:disabled, textarea:disabled { opacity: .6; }
input[type=date]::-webkit-calendar-picker-indicator { filter: var(--picker); }
.fg { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0 14px; margin: 14px 0; }
.fg .wide { grid-column: 1 / -1; }
.tr { display: flex; gap: 10px; align-items: stretch; flex-wrap: wrap; }
.tr input { flex: 1 1 200px; margin-top: 6px; }
.tr button { margin-top: 6px; }
#subj { font-weight: 600; }

/* ---------- przyciski ---------- */
button, .btnlink {
  padding: 11px 20px; border: 0; border-radius: 999px; background: var(--surface3); color: var(--ink);
  font: 500 15px var(--font); letter-spacing: -.01em; cursor: pointer; text-decoration: none; display: inline-block;
  transition: background .2s, transform .15s;
}
button:hover, .btnlink:hover { background: var(--btn-hover); }
button.primary { background: var(--ac); color: #fff; font-weight: 600; }
button.primary:hover { background: var(--ac-hover); }
button.s, .btnlink.s { background: transparent; color: var(--ac); padding-left: 12px; padding-right: 12px; }
button.s:hover, .btnlink.s:hover { background: var(--sel); }
button.sm { padding: 5px 12px; font-size: 13px; margin: 4px 4px 0 0; }
/* Akcje w wierszu zlecenia: dwa równe rzędy zamiast łamania co przycisk. */
.acts { display: grid; grid-template-columns: repeat(2, max-content); justify-items: start; gap: 2px 4px; margin: -4px 0 0 -12px; }
.acts button.sm { margin: 0; white-space: nowrap; }
button.link { background: none; padding: 0; color: var(--ac); font-weight: 500; border-radius: 0; }
button.link:hover { text-decoration: underline; background: none; }
button.ghost { background: var(--surface); color: var(--ink); padding: 6px 14px; font-size: 13px; }
button:disabled { opacity: .5; cursor: progress; }
.wide-btn { width: 100%; padding: 13px; }
:focus-visible { outline: 2px solid var(--ac); outline-offset: 3px; }
.bar { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; align-items: center; }
/* Pasek, w którym nic nie widać (np. ukryty przycisk i pusty komunikat), nie zostawia pustego miejsca. */
.bar:not(:has(> :not([hidden]):not(:empty))) { display: none; }
/* Pierwszy przycisk-link w rzędzie równo z krawędzią tekstu nad nim; tło po najechaniu wystaje na padding. */
.bar > .s:first-child { margin-left: -12px; }
.push { margin-left: auto; }
.filebtn { display: inline-block; margin: 0; padding: 11px 20px; border-radius: 999px; background: var(--ac); color: #fff; font: 600 15px var(--font); cursor: pointer; }
.filebtn:hover { background: var(--ac-hover); }
.filebtn input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.filebtn:focus-within { outline: 2px solid var(--ac); outline-offset: 3px; }

/* ---------- logowanie ---------- */
.intro { text-align: center; margin: 6vh 0 28px; }
.intro img { border-radius: 16px; box-shadow: 0 20px 60px -10px rgba(94,92,230,.55); }
.intro h1 { font-size: 44px; font-weight: 700; letter-spacing: -.04em; margin: 18px 0 6px; }
.intro p { color: var(--mut); font-size: 17px; margin: 0 auto; max-width: 34ch; }
.seg { display: flex; background: var(--surface2); border-radius: 10px; padding: 3px; margin-bottom: 20px; }
.seg button { flex: 1; background: transparent; border-radius: 8px; color: var(--mut); padding: 8px 10px; font-weight: 500; font-size: 14px; }
.seg button:hover { background: transparent; color: var(--ink); }
.seg button.on { background: var(--surface3); color: var(--ink); box-shadow: 0 2px 8px var(--shadow-sm); }
.seg a { flex: 1; text-align: center; text-decoration: none; border-radius: 8px; color: var(--mut); padding: 8px 10px; font-weight: 500; font-size: 14px; }
.seg a:hover { color: var(--ink); }
.seg a.on { background: var(--surface3); color: var(--ink); box-shadow: 0 2px 8px var(--shadow-sm); }
.seg.small { max-width: 480px; }
.oauth { display: grid; gap: 10px; }
.obtn { display: block; text-align: center; padding: 13px 16px; border-radius: 999px; background: var(--ink); color: var(--bg); font-weight: 600; font-size: 15px; text-decoration: none; transition: opacity .2s; }
.obtn:hover { opacity: .88; }
.obtn.apple { background: var(--surface3); color: var(--ink); }
.or { display: flex; align-items: center; gap: 12px; color: var(--dim); font-size: 13px; margin: 20px 0; }
.or::before, .or::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.invite-info { background: var(--sel); border-radius: var(--r-sm); padding: 12px 14px; margin-bottom: 16px; font-size: 15px; }

/* ---------- komunikaty ---------- */
.warn, .notice { border-radius: var(--r-sm); padding: 12px 16px; margin: 0 0 20px; font-size: 15px; }
.warn { background: var(--warn-bg); color: var(--warn-ink); }
.notice { background: var(--ok-bg); color: var(--ok-ink); }
.notice.bad { background: var(--err-bg); color: var(--err-ink); }
#demoBar { text-align: center; font-size: 13px; padding: 8px 14px; background: var(--demo-bg); color: var(--demo-ink); }

/* ---------- tabele (listy w stylu iOS) ---------- */
.w { overflow-x: auto; margin: 0 -8px; padding: 0 8px; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 12px; color: var(--dim); font-weight: 500; padding: 10px 12px; white-space: nowrap; text-transform: uppercase; letter-spacing: .04em; }
/* Sortowanie po kliknięciu nagłówka: przycisk wygląda jak nagłówek, strzałka pokazuje kolejność. */
th:has(> .sorth) { padding: 0; }
.sorth { all: unset; box-sizing: border-box; display: flex; align-items: center; gap: 6px; width: 100%; padding: 10px 12px; cursor: pointer; font: inherit; color: inherit; letter-spacing: inherit; text-transform: inherit; border-radius: 6px; }
.sorth:hover { color: var(--ink); }
.sorth::after { content: "↕"; opacity: .35; font-size: 11px; }
[aria-sort="ascending"] > .sorth, [aria-sort="descending"] > .sorth { color: var(--ink); }
[aria-sort="ascending"] > .sorth::after { content: "▲"; opacity: 1; font-size: 9px; }
[aria-sort="descending"] > .sorth::after { content: "▼"; opacity: 1; font-size: 9px; }
.sorth:focus-visible { outline: 2px solid var(--ac); outline-offset: -2px; }
td { padding: 14px 12px; vertical-align: top; text-align: left; border-top: 1px solid var(--line); font-variant-numeric: tabular-nums; }
tbody tr { transition: background .15s; }
tbody tr:hover td { background: var(--row-hover); }
table.rank tbody { counter-reset: r; }
table.rank tbody tr { counter-increment: r; }
table.rank td:first-child { width: 36px; }
table.rank tr:has(input:checked) td { background: var(--sel); }
table.rank td:nth-child(2) b::before { content: counter(r); display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--surface3); color: var(--ink); font-size: 12px; font-weight: 600; margin-right: 10px; }
td input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--ac); margin-top: 1px; }
.why { font-size: 13px; color: var(--mut); }
.sc { display: block; height: 6px; border-radius: 99px; margin: 6px 0 4px; width: 8px; background: linear-gradient(90deg, #5e5ce6, #0a84ff); }
.kpis { display: flex; gap: 12px; flex-wrap: wrap; margin: 12px 0 16px; }
/* W panelu planu liczniki są na końcu (pasek z przyciskiem pojawia się tylko z płatnościami i ma własny odstęp). */
#planMeters { margin-bottom: 0; }
/* Zlecenia: liczniki w jednej niskiej linii nad filtrami, żeby nie zabierały miejsca tabeli. */
#kpi { gap: 8px; margin: 4px 0 18px; }
#kpi .kpi { display: flex; align-items: baseline; flex-wrap: wrap; gap: 2px 8px; padding: 7px 14px; }
#kpi .kpi b { display: inline; font-size: 16px; }
.kpi { background: var(--surface2); border-radius: var(--r-sm); padding: 12px 18px; }
.kpi b { display: block; font-size: 24px; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.kpi span { font-size: 13px; color: var(--mut); }
.results { list-style: none; padding: 0; margin: 14px 0 0; display: grid; gap: 6px; }
.results li { background: var(--surface2); border-radius: 10px; padding: 9px 14px; font-size: 14px; display: flex; gap: 10px; align-items: baseline; }
.results li::before { content: ""; width: 8px; height: 8px; border-radius: 50%; flex: none; transform: translateY(-1px); }
.results li.ok::before { background: var(--ok); }
.results li.bad::before { background: var(--err); }
.plain { list-style: none; padding: 0; margin: 10px 0 0; }
.plain li { padding: 8px 0; border-top: 1px solid var(--line); display: flex; gap: 10px; justify-content: space-between; align-items: center; flex-wrap: wrap; }

[hidden] { display: none !important; }

/* ---------- wczytywanie ---------- */
/* Panel pobiera nowe dane (app.js: loading): treść przygasa, u góry panelu biegnie cienki pasek. */
.pan { position: relative; }
.loading::before {
  content: ""; position: absolute; top: 0; left: var(--r-md); right: var(--r-md); height: 2px; border-radius: 2px; pointer-events: none;
  background: linear-gradient(90deg, transparent, var(--ac), transparent) no-repeat; background-size: 40% 100%;
  animation: loadbar 1.1s ease-in-out infinite;
}
.loading :is(.w, .kpis, #carMeta, .pager) { opacity: .45; transition: opacity .2s; }
@keyframes loadbar { from { background-position: -70% 0; } to { background-position: 170% 0; } }
/* Wiersze i liczniki zastępcze przy pierwszym wczytaniu: szare paski z przesuwającym się połyskiem. */
.bone {
  display: block; height: 12px; max-width: 100%; margin: 5px 0; border-radius: 6px;
  background: linear-gradient(90deg, var(--surface2) 30%, var(--surface3) 50%, var(--surface2) 70%); background-size: 300% 100%;
  animation: shimmer 1.4s linear infinite;
}
.skel td:nth-child(1) .bone { width: 70%; }
.skel td:nth-child(2) .bone { width: 85%; }
.skel td:nth-child(3n) .bone { width: 55%; }
.skel:nth-child(2) .bone { width: 60%; }
tbody tr.skel:hover td { background: none; }
.kpi.skel { width: 220px; padding-block: 9px; }
.kpi.skel .bone { width: 70%; background-image: linear-gradient(90deg, var(--surface3) 30%, var(--btn-hover) 50%, var(--surface3) 70%); }
#carMeta .bone { width: min(420px, 80%); height: 14px; margin: 5px 0 6px; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: 0 0; } }
/* Kręcący się wskaźnik: przy starcie aplikacji i obok stanu przycisku (np. „Zapisuję…”). */
.spin {
  display: inline-block; width: 14px; height: 14px; margin-right: 8px; vertical-align: -2px; border-radius: 50%;
  border: 2px solid var(--surface3); border-top-color: var(--ac); animation: spin2 .8s linear infinite;
}
@keyframes spin2 { to { transform: rotate(360deg); } }
/* Start: wskaźnik dopiero po chwili, żeby przy szybkim połączeniu nie mignął. */
.bootload { display: flex; justify-content: center; padding: 18vh 0; animation: fadein .3s .3s both; }
.bootload .spin { width: 28px; height: 28px; margin: 0; border-width: 3px; }
@keyframes fadein { from { opacity: 0; } }
.loaderr { color: var(--err-ink); }
.filebtn:has(input:disabled) { opacity: .5; cursor: progress; }

@media (max-width: 820px) {
  .topbar .in { gap: 10px; }
  .langpick { margin-left: auto; }
  .tabs { order: 3; width: 100%; justify-content: space-between; margin: 0; overflow-x: auto; flex-wrap: nowrap; }
  .tabs button, .tabs a { padding: 7px 10px; font-size: 13px; flex: 1 0 auto; text-align: center; }
  .who span { max-width: 18ch; }
  /* Gdy zakładki nie mieszczą się na szerokość, brzeg zanika: widać, że pasek da się przesunąć w bok. */
  .tabs.fade-r { -webkit-mask-image: linear-gradient(90deg, #000 82%, transparent); mask-image: linear-gradient(90deg, #000 82%, transparent); }
  .tabs.fade-l { -webkit-mask-image: linear-gradient(90deg, transparent, #000 18%); mask-image: linear-gradient(90deg, transparent, #000 18%); }
  .tabs.fade-l.fade-r { -webkit-mask-image: linear-gradient(90deg, transparent, #000 18%, #000 82%, transparent); mask-image: linear-gradient(90deg, transparent, #000 18%, #000 82%, transparent); }
}
@media (max-width: 430px) {
  .tabs button, .tabs a { padding: 7px 8px; font-size: 12.5px; }
}
@media (max-width: 520px) {
  .topbar .in { gap: 8px; }
  .langpick select { padding-left: 10px; padding-right: 24px; }
  .welcome { margin-top: 28px; }
  .welcome .sub { font-size: 17px; margin-bottom: 22px; }
  .prompt textarea { padding: 20px; font-size: 17px; min-height: 180px; }
  .pan { padding: 18px; }
  .who span { display: none; }
}
/* ---------- regulamin, polityka prywatności, zgoda przy rejestracji ---------- */
a.brand { color: inherit; text-decoration: none; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; margin: 4px 0 8px; cursor: pointer; }
.check input { width: 20px; height: 20px; flex: none; margin: 1px 0 0; padding: 0; accent-color: var(--ac); }
.check a, .doclist a, .foot a, .legal a { color: var(--ac); text-decoration: none; }
.check a:hover, .doclist a:hover, .foot a:hover, .legal a:hover { text-decoration: underline; }
.foot { max-width: 1120px; margin: -40px auto 0; padding: 0 20px 40px; display: flex; flex-wrap: wrap; gap: 8px 20px; justify-content: center; font-size: 13px; }
.foot a { color: var(--dim); }
/* Instalacja aplikacji (PWA): przycisk wygląda jak link w stopce, pod nim podpowiedź dla Safari. */
.foot button { padding: 0; border-radius: 0; background: none; color: var(--dim); font: inherit; letter-spacing: inherit; }
.foot button:hover { background: none; color: var(--ink); }
.foot p { flex-basis: 100%; margin: 0; text-align: center; color: var(--mut); }
.offline h1 { font-size: 22px; font-weight: 600; margin: 0 0 6px; }
.offline .note { margin: 0 0 18px; }
.doclinks { display: flex; gap: 2px; background: var(--surface); border-radius: 999px; padding: 3px; }
.doclinks:first-of-type { margin-left: auto; }
.doclinks.langsw a { padding: 4px 11px; font-size: 13px; }
.legal .docnav { margin: 0 0 22px; }
.legal .docnav a { color: var(--mut); }
.legal .docnav a.on, .legal .docnav a:hover { color: var(--ink); text-decoration: none; }
.doclinks a { color: var(--mut); text-decoration: none; padding: 6px 14px; border-radius: 999px; font-size: 14px; white-space: nowrap; }
.doclinks a:hover { color: var(--ink); }
.doclinks a.on { background: var(--surface3); color: var(--ink); }
.legal { max-width: 760px; margin: 0 auto; font-size: 16px; }
.legal h1 { font-size: 34px; margin: 8px 0 4px; }
.legal h2 { font-size: 20px; margin: 34px 0 10px; }
.legal h3 { font-size: 16px; margin: 20px 0 6px; }
.legal .meta { color: var(--mut); font-size: 14px; margin: 0 0 18px; }
.legal ol, .legal ul { padding-left: 22px; margin: 0; }
.legal li { margin: 0 0 8px; }
.legal li ul { margin-top: 8px; }
.legal table { font-size: 14px; }
.legal td { padding: 10px 12px; }
.legal mark { background: var(--warn-bg); color: var(--warn-ink); padding: 0 3px; border-radius: 4px; }
/* Wąski telefon po zalogowaniu: sam znak zamiast nazwy, żeby język, motyw i „Wyloguj” zmieściły się w jednej linii. */
@media (max-width: 480px) {
  .topbar .in:has(#who:not([hidden])) #appName { display: none; }
}
@media (max-width: 520px) {
  .legal h1 { font-size: 28px; }
  .doclinks.langsw a { padding: 4px 9px; }
}
@media (prefers-reduced-motion: reduce) {
  .magic::before, .prompt.thinking::before, .prompt.thinking::after, .magic.busy .spark, .loading::before, .bone { animation: none; }
  .loading::before { background-position: 50% 0; background-size: 100% 100%; }
  .spin { animation-duration: 2.4s; }
  .magic, .magic:hover { transform: none; }
}

/* ---------- plan i płatności ---------- */
.pill { background: var(--surface); color: var(--mut); border-radius: 999px; padding: 6px 12px; font: 500 13px var(--font); white-space: nowrap; }
.pill:hover, .pill.on { background: var(--surface3); color: var(--ink); }
.pill.hot { color: var(--warn-ink); background: var(--warn-bg); }
.tabs[hidden] ~ .pill { margin-left: auto; }
.pricehead { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 32px 0 16px; }
.pricehead h2 { margin: 0; }
.pricehead .seg { margin: 0; min-width: 340px; }
.pricehead .seg button { white-space: nowrap; }
.founder { border-radius: var(--r-md); padding: 14px 18px; margin-bottom: 16px; font-size: 15px;
  background: linear-gradient(90deg, rgba(94,92,230,.22), rgba(191,90,242,.16)); border: 1px solid rgba(191,90,242,.35); }
.plans { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.plans + .note { margin: 0 0 36px; }
.plancard { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 24px 20px; display: flex; flex-direction: column; }
.plancard h3 { margin: 0 0 8px; font-size: 20px; }
.plancard.best { border-color: rgba(10,132,255,.6); box-shadow: 0 0 0 1px rgba(10,132,255,.35), 0 12px 40px rgba(10,132,255,.12); }
.plancard.cur { background: var(--surface2); }
.plancard .badge { position: absolute; top: -11px; left: 20px; background: var(--ac); color: #fff; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; }
.price { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.price b { font-size: 32px; font-weight: 600; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.price span, .price small { color: var(--mut); font-size: 13px; }
.plancard .yearly { min-height: 1.4em; margin: 4px 0 12px; }
.plancard ul { list-style: none; padding: 0; margin: 0 0 20px; flex: 1; font-size: 14px; }
.plancard li { padding: 6px 0 6px 24px; position: relative; color: var(--ink); border-top: 1px solid var(--line); }
.plancard li::before { content: ''; position: absolute; left: 4px; top: 12px; width: 9px; height: 5px; border-left: 2px solid var(--ok); border-bottom: 2px solid var(--ok); transform: rotate(-45deg); }
.plancard .btnlink { display: block; text-align: center; }
@media (max-width: 1000px) { .plans { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .plans { grid-template-columns: 1fr; } .pricehead .seg { min-width: 0; width: 100%; } }
@media (max-width: 820px) { .pill { margin-left: auto; } .pill:not([hidden]) + .langpick { margin-left: 0; } }
.pill .short { display: none; }
/* Telefon: nagłówek nie mieści licznika planu obok języka, motywu i wylogowania, więc licznik stoi w rzędzie zakładek,
   na jego prawym końcu, w krótkiej wersji (np. „21 dni”). Zakładki zaczynają od 60% szerokości, więc nie wejdą do górnego
   rzędu, i zajmują resztę miejsca obok licznika; przewijają się w bok jak dotąd. */
@media (max-width: 520px) {
  .tabs { width: auto; flex: 1 1 60%; min-width: 0; }
  .pill { order: 3; flex: none; margin: 0; padding: 7px 11px; font-size: 13px; }
  .pill .full { display: none; }
  .pill .short { display: inline; }
  .pill:not([hidden]) + .langpick { margin-left: auto; }
}

/* ---------- rejestracja przewoźnika (/przewoznik) ---------- */
main.carrier { max-width: 860px; }
.carrier-intro { margin: 24px 0 28px; }
.topbar .brand + .langpick { margin-left: auto; }
.carrier-intro h1 { font-size: clamp(30px, 5vw, 44px); }
.perks { display: inline-block; text-align: left; margin: 14px 0 0; padding: 0; list-style: none; color: var(--mut); }
.perks li { padding: 6px 0 6px 26px; position: relative; }
.perks li::before { content: ''; position: absolute; left: 4px; top: 12px; width: 9px; height: 5px; border-left: 2px solid var(--ok); border-bottom: 2px solid var(--ok); transform: rotate(-45deg); }
#regForm h3 { margin: 26px 0 4px; }
.vchecks { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 0 14px; margin: 10px 0 0; }
.lane { display: grid; grid-template-columns: 1fr 1fr auto 1fr 1fr auto; gap: 10px; align-items: end; padding: 10px 0; border-bottom: 1px solid var(--line); }
.lane label { margin: 0; }
.lane .arrow { padding-bottom: 12px; color: var(--mut); }
.lane [data-rm] { margin-bottom: 4px; }
#lanes + button { margin-top: 12px; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; opacity: 0; }
.btnlink.ghost { background: var(--surface); color: var(--ink); padding: 6px 14px; font-size: 13px; white-space: nowrap; text-decoration: none; }
.src { display: inline-block; font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: 999px; background: var(--sel); color: var(--ac); margin-left: 6px; vertical-align: 1px; white-space: nowrap; }
@media (max-width: 700px) {
  .lane { grid-template-columns: 1fr 1fr; }
  .lane .arrow { display: none; }
  .lane [data-rm] { grid-column: 1 / -1; justify-self: end; }
}

/* Panel administratora (/admin) */
.admin .scroll { overflow-x: auto; padding: 8px 12px; }
.admin-table td, .admin-table th { padding: 9px 10px; font-size: 14px; }
.admin-table td a { color: var(--ac); text-decoration: none; white-space: nowrap; }
.admin-table .num, .admin-table .nw { text-align: right; white-space: nowrap; }
.admin-table .nw { text-align: left; }
.admin-table .sum, .admin-table tfoot td { font-weight: 600; }
.admin-table tfoot td { border-top: 2px solid var(--line-strong); }
.presets { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 4px; }
.presets .s { font-size: 13px; padding: 7px 12px; }
.filter { gap: 10px; align-items: flex-start; margin-bottom: 10px; }
.filter select[multiple] { min-width: 220px; flex: 1; }
/* /admin: strony z serwera bez skryptów (lib/admin-page.js) */
.adm .topbar .brand { color: var(--ink); text-decoration: none; }
@media (max-width: 820px) { .adm .themebtn { margin-left: auto; } }
@media (max-width: 520px) { .adm-sub { display: none; } }
.adm-out { margin: 0; }
.adm .pan > h2:first-child { margin-top: 0; }
.adm .pan .seg { margin: 14px 0 0; }
.adm .pan .seg + .note { margin-top: 12px; }
.adm td .note { margin: 2px 0 0; font-size: 12px; }
.adm td a .adm-tag { margin-top: 6px; }
.adm-tag { display: inline-block; white-space: nowrap; background: var(--surface3); color: var(--mut); border-radius: 999px; padding: 2px 10px; font-size: 12px; font-weight: 600; }
.adm-tag.ok { background: var(--ok-bg); color: var(--ok-ink); }
.adm-tag.warn { background: var(--warn-bg); color: var(--warn-ink); }
.adm-acts { min-width: 190px; }
.adm-act { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 0; }
.adm-act + .adm-act, .adm-act + .adm-more { margin-top: 8px; }
.adm-act button.sm { margin: 0; white-space: nowrap; }
.adm-act > .note { flex-basis: 100%; margin: 0; }
.adm-sure { display: inline-flex; align-items: center; gap: 6px; margin: 0; white-space: nowrap; }
.adm-sure input { width: 18px; height: 18px; margin: 0; padding: 0; accent-color: var(--err); }
.adm-more > summary { cursor: pointer; color: var(--ac); font-size: 13px; font-weight: 500; padding: 4px 0; }
.adm-more[open] { min-width: 240px; }
.adm-more[open] > summary { margin-bottom: 6px; }
.adm-more .adm-act { padding: 12px 0; border-top: 1px solid var(--line); margin: 0; }
.adm-more .adm-act label:not(.adm-sure) { flex-basis: 100%; margin: 0; }
.adm-more input:not([type=checkbox]), .adm-more select { padding: 9px 12px; font-size: 14px; }
/* Ankiety w panelu: rozkłady odpowiedzi w siatce, paski jako <progress>. */
.adm-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 16px; margin-bottom: 16px; }
.adm-grid .pan { margin: 0; }
.adm-dist h3 { margin: 0 0 8px; font-size: 15px; font-weight: 600; }
.adm-dist .admin-table td { padding: 5px 8px; font-size: 13px; }
.adm-dist .admin-table td:last-child { width: 30%; }
.adm progress { appearance: none; width: 100%; min-width: 60px; height: 8px; border: 0; border-radius: 999px; background: var(--surface3); overflow: hidden; vertical-align: middle; }
.adm progress::-webkit-progress-bar { background: var(--surface3); border-radius: 999px; }
.adm progress::-webkit-progress-value { background: var(--ac); border-radius: 999px; }
.adm progress::-moz-progress-bar { background: var(--ac); border-radius: 999px; }
.adm .kpis { margin: 14px 0 12px; }
/* Karta jednej ankiety: nawigacja, pytania jedno pod drugim, odpowiedź opisowa w ramce. */
.adm-pager { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; }
.adm-pager > .note { margin: 0; }
.adm-card .adm-q { padding: 14px 0; border-top: 1px solid var(--line); }
.adm-card .adm-q:first-child { border-top: 0; padding-top: 0; }
.adm-q h3 { display: flex; gap: 10px; align-items: flex-start; margin: 0 0 10px; font-size: 15px; font-weight: 600; }
.adm-q .qn { flex: none; display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--sel); color: var(--ac); font-size: 12px; }
.adm-q .adm-tag { margin: 0 4px 6px 0; white-space: normal; }
.adm-q .admin-table td:first-child { width: 60%; }
.adm-q progress { max-width: 320px; }
.adm-nps { margin: 0 0 8px; }
.adm-nps b { font-size: 22px; }
.adm-quote { margin: 0; padding: 12px 16px; border-left: 3px solid var(--ac); background: var(--surface2); border-radius: var(--r-sm); white-space: pre-wrap; }
.adm-contact { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0 0 12px; font-size: 14px; }
.adm-contact dt { color: var(--mut); margin: 0; }
.adm-contact dd { margin: 0; overflow-wrap: anywhere; }
.adm-open { display: inline-block; margin: 0 0 8px -12px; padding: 6px 12px; }
.adm-back { margin-left: -12px; }
.adm-notes { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 14px; }
.adm-notes .note { display: block; margin: 0 0 6px; }
.adm-notes .note a { color: var(--ac); text-decoration: none; }
.adm-notes .adm-quote { font-size: 15px; }
.adm-contact a { color: var(--ac); text-decoration: none; }
.adm-search { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; margin: 14px 0 0; }
.adm-search label { flex: 1 1 260px; margin: 0; }
.adm-search button { flex: none; padding-block: 13px; }
.adm main > .notice { margin-bottom: 20px; }
/* ---------- metry ładowne ---------- */
.ldm { border: 1px solid var(--line); border-radius: var(--r-sm); padding: 12px 16px; margin: 14px 0 0; font-size: 14px; }
.ldmHead { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.ldmHead span:first-child { color: var(--mut); }
.ldmHead b { font-size: 20px; }
.ldm .tag:empty { display: none; }
.ldm .tag { background: var(--err-bg); color: var(--err-ink); border-radius: 999px; padding: 2px 10px; font-size: 12px; font-weight: 600; letter-spacing: .03em; }
.ldm ul { margin: 8px 0 0; padding-left: 18px; }
.ldm ul:empty { display: none; }
.ldmWarn li { color: var(--warn-ink); }

/* ---------- zrzut ekranu w polu zapytania ---------- */
.shot-bar { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; margin: 10px 0 0; }
.shot-btn { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; font-size: 14px; }
.shot-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linejoin: round; }
.shot-prev { position: absolute; right: 12px; bottom: 12px; max-width: 120px; max-height: 80px; border-radius: 8px; border: 1px solid var(--line); opacity: .9; z-index: 2; }
.prompt.drop textarea { border-style: dashed; border-color: var(--line-strong); }

/* ---------- zapytanie: potwierdzenie danych i pasek wysyłki ---------- */
.send-dock { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: saturate(1.6) blur(18px); -webkit-backdrop-filter: saturate(1.6) blur(18px);
  border-top: 1px solid var(--line); }
.send-dock-in { max-width: 1100px; margin: 0 auto; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.send-dock-info { display: flex; flex-direction: column; gap: 2px; margin-right: auto; min-width: 0; }
.send-dock-info b { font-size: 15px; }
.send-dock-info .note { margin: 0; }
.send-big { margin-top: 0; padding: 15px 30px; font-size: 17px; min-width: 260px; justify-content: center; }
.send-big.undo::before { animation: none; background: var(--warn-ink); }
.send-big:disabled { opacity: .55; cursor: not-allowed; }
#v-inq:has(#sendDock:not([hidden])) { padding-bottom: 110px; }
@media (max-width: 640px) {
  .send-dock-in { gap: 8px; }
  .send-big { width: 100%; min-width: 0; }
  #dockPreview { display: none; }
  #v-inq:has(#sendDock:not([hidden])) { padding-bottom: 150px; }
}
.fg.filt { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
#partsBox, #rankBox, #mailBox { scroll-margin-top: 76px; }

/* ---------- Zlecenia: nagłówek z kafelkiem „Dodaj zlecenie” ---------- */
.pan-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.pan-head h2 { margin: 0; }
.magic.tile { margin-top: 0; padding: 13px 24px; font-size: 16px; border-radius: 16px; }
.magic.tile .spark { width: 18px; height: 18px; }
@media (max-width: 640px) { .magic.tile { width: 100%; justify-content: center; } }
#tt .acts { grid-template-columns: max-content; }
#tth .sorth { white-space: normal; text-align: left; }

/* ---------- rejestracja firmy ---------- */
.step-h { display: flex; align-items: center; gap: 8px; margin: 6px 0 10px; font-weight: 600; font-size: 15px; }
.step-h > span:first-child { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--ac); color: #fff; font-size: 12px; }
#personStep:not([hidden]) .step-h { margin-top: 18px; }
.firm-card { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; margin: 4px 0 6px; border-radius: var(--r-sm); background: var(--sel); font-size: 14px; }
.firm-card b { font-size: 15px; }

/* ---------- Przewoźnicy: baza Spedo i okno planu ---------- */
.reg-cta { display: flex; justify-content: flex-start; margin: 6px 0 4px; }
#carAddSeg { margin: 4px 0 14px; }
.modal { border: 0; border-radius: var(--r-lg); padding: 24px 26px; max-width: 460px; width: calc(100% - 32px); background: var(--surface); color: var(--ink);
  box-shadow: 0 30px 80px -20px rgba(0,0,0,.45); }
.modal::backdrop { background: rgba(0,0,0,.45); backdrop-filter: blur(4px); }
.modal h3 { margin: 0 0 8px; font-size: 19px; }
.modal p { margin: 0 0 10px; color: var(--mut); }
.up-list { margin: 0 0 16px; padding-left: 18px; }
.up-list li { margin: 4px 0; }

/* ---------- raport graficzny: slajdy 16:9 rysowane w SVG (ten sam układ co w PowerPoincie) ---------- */
.rep-actions { margin: 0; }
.rep-deck { display: grid; gap: 18px; }
.rep-slide { aspect-ratio: 16 / 9; overflow: hidden; border-radius: 16px; background: #0a0e1c; box-shadow: 0 18px 50px -24px rgba(10, 14, 40, .6); }
.rep-svg { display: block; width: 100%; height: 100%; }

/* Druk raportu (PDF): tylko slajdy, każdy na osobnej stronie 16:9. */
@media print {
  @page { size: 338.7mm 190.5mm; margin: 0; }
  body.print-report > *:not(main), body.print-report main > :not(#v-rep), body.print-report #v-rep > :not(#repOut),
  body.print-report #repOut > .pan-head, body.print-report .notice, body.print-report #demoBar { display: none !important; }
  body.print-report, body.print-report main, body.print-report #v-rep, body.print-report #repOut { background: #fff !important; margin: 0 !important; padding: 0 !important; border: 0 !important; box-shadow: none !important; max-width: none !important; width: auto !important; }
  body.print-report .rep-deck { display: block; }
  body.print-report .rep-slide { width: 338.7mm; height: 190.5mm; aspect-ratio: auto; border: 0; border-radius: 0; box-shadow: none; break-after: page; page-break-after: always; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  body.print-report .rep-slide:last-child { break-after: auto; page-break-after: auto; }
}

/* ---------- /demo: film z prezentacją ---------- */
.demo-page { max-width: 1100px; margin: 0 auto; padding: 0 16px 64px; }
.demo-intro { margin-bottom: 28px; }
.grad-text { background: linear-gradient(100deg, #64d2ff, #5e5ce6 40%, #bf5af2 70%, #ff375f); -webkit-background-clip: text; background-clip: text; color: transparent; }
.demo-video { border-radius: 20px; overflow: hidden; background: #000; border: 1px solid var(--line); box-shadow: 0 40px 120px -40px rgba(94, 92, 230, .55); }
.demo-video video { display: block; width: 100%; aspect-ratio: 16 / 9; background: #000; }
.demo-cta { display: flex; flex-direction: column; align-items: center; gap: 6px; margin-top: 32px; text-align: center; }
.btnlink.primary { background: var(--ac); color: #fff; font-weight: 600; text-decoration: none; }
.btnlink.primary:hover { background: var(--ac-hover); }
.demo-try { padding: 15px 30px; font-size: 17px; border-radius: 999px; }
.demo-lang { text-align: center; margin-top: 12px; }

/* ---------- jeden układ nagłówka: logo, a po prawej język, motyw i przycisk (/przewoznik, /demo, /regulamin, /prywatnosc,
   strona główna przed zalogowaniem, gdy zakładki są ukryte) ---------- */
/* Przycisk po prawej ma stałą szerokość (mieści „Dla przewoźników”), żeby język i motyw nie przeskakiwały między stronami. */
.navlink { flex: none; min-width: 150px; text-align: center; }
@media (max-width: 520px) {
  .navlink { flex: 0 1 139px; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
  .pubbar .in, .topbar:has(#tabs[hidden]) .in { flex-wrap: nowrap; gap: 6px; }
  .pubbar .brand span, .topbar:has(#tabs[hidden]) .brand span { display: none; }
  /* Lista języków i przełącznik PL/EN (regulamin, polityka) tej samej szerokości: motyw stoi w tym samym miejscu. */
  .pubbar .langpick select, .topbar:has(#tabs[hidden]) .langpick select { width: 102px; font-size: 12px; padding-right: 22px; }
  .pubbar .doclinks.langsw { flex: none; width: 102px; justify-content: center; }
  .pubbar .navlink, .topbar:has(#tabs[hidden]) .navlink { padding: 6px 12px; }
}

/* ---------- /ankieta: ankieta dla spedytorów ---------- */
.survey { max-width: 760px; margin: 0 auto; padding: 0 16px 64px; }
.survey-intro { margin-bottom: 20px; }
.survey-progress { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; height: 4px; border-radius: 999px; background: var(--line); margin: 0 0 18px; overflow: hidden; }
.survey-progress span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #64d2ff, #5e5ce6 45%, #bf5af2 75%, #ff375f); transition: width .3s ease; }
.survey form { display: grid; gap: 14px; }
.survey #qs { display: grid; gap: 14px; }
.survey fieldset.q { border: 1px solid var(--line); margin: 0; min-width: 0; }
.survey fieldset.q.missing { border-color: var(--err-ink); }
.survey legend { display: flex; gap: 10px; align-items: baseline; font-weight: 600; font-size: 16px; line-height: 1.4; padding: 0; margin-bottom: 12px; float: left; width: 100%; }
.survey legend + * { clear: both; }
.survey .qn { flex: none; display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--sel); color: var(--ac); font-size: 12px; font-variant-numeric: tabular-nums; }
.survey .req { color: var(--err-ink); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; cursor: pointer; }
.chip input, .dot input { position: absolute; opacity: 0; pointer-events: none; }
.chip span { display: inline-block; padding: 9px 14px; border-radius: 999px; border: 1px solid var(--line-strong); font-size: 14px; line-height: 1.3; transition: background .15s, border-color .15s; }
.chip input:checked + span { background: var(--ac); border-color: var(--ac); color: #fff; }
.chip input:focus-visible + span, .dot input:focus-visible + span { outline: 2px solid var(--ac); outline-offset: 2px; }
.scale { display: grid; gap: 10px; }
.scale-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 8px 0; border-top: 1px solid var(--line); }
.scale-row:first-child { border-top: 0; }
.scale-label { flex: 1 1 260px; min-width: 0; font-size: 14px; }
.scale-btns, .nps { display: flex; gap: 6px; flex-wrap: wrap; }
.dot { cursor: pointer; position: relative; }
.dot span { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--line-strong); font-size: 14px; font-variant-numeric: tabular-nums; }
.dot input:checked + span { background: var(--ac); border-color: var(--ac); color: #fff; }
.nps-ends { display: flex; justify-content: space-between; font-size: 12px; color: var(--mut); margin-top: 6px; max-width: 460px; }
.survey textarea { width: 100%; }
.contact-grid { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.survey-submit { display: flex; justify-content: center; }
.survey-submit .wide-btn { max-width: 360px; }
.survey-done { text-align: center; }
.survey-done .demo-cta { margin-top: 18px; }
@media (max-width: 480px) { .dot span { width: 32px; height: 32px; } }

/* Ankieta: ostatnie pytanie to zapis na okres testowy, wyróżnione jak oferta. */
.survey fieldset.q-trial { border: 1.5px solid transparent; background: linear-gradient(var(--surface), var(--surface)) padding-box, linear-gradient(100deg, #64d2ff, #5e5ce6 45%, #bf5af2 75%, #ff375f) border-box; }
.survey .trial-lead { margin: 0 0 12px; }
.survey .trial-want { margin-bottom: 14px; font-size: 16px; }

/* Ankieta po filmie: krok 1 film, krok 2 pytania. */
.survey-film { margin-bottom: 26px; }
.survey-film .demo-video { margin-top: 6px; }
.survey .step-h small { font-weight: 400; margin-left: 6px; }
.survey .survey-step { margin: 0 0 12px; scroll-margin-top: 16px; }
.survey .film-skip { margin: 12px 0 0; }
.survey .film-done { text-align: center; }

/* /demo: zaproszenie do ankiety pod filmem; po końcu filmu krótko podświetlone. */
.demo-survey { margin-top: 28px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.demo-survey h2 { margin: 0; }
.demo-survey .note { margin: 0 0 8px; max-width: 560px; }
.demo-survey.pulse { animation: survey-pulse 1.6s ease 2; }
@keyframes survey-pulse { 50% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--ac) 45%, transparent); } }

/* Ankieta: większe pola wyboru, odhaczone pytania i krótkie podziękowanie po każdej odpowiedzi. */
.survey-progress { height: 6px; }
.survey fieldset.q { padding: 20px 20px 22px; transition: border-color .25s, box-shadow .25s; }
.survey fieldset.q.done { border-color: color-mix(in srgb, var(--ac) 40%, var(--line)); }
.survey legend { position: relative; font-size: 17px; align-items: center; padding-right: 0; }
.survey .qt { flex: 1; }
.survey .qn { width: 28px; height: 28px; font-size: 13px; transition: background .25s, color .25s, transform .25s; }
.survey fieldset.done .qn { background: var(--ac); color: #fff; animation: survey-pop .35s ease; }
.survey .chips { gap: 10px; }
.survey .chip span { display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 12px 20px; font-size: 16px; border-width: 1.5px;
  transition: background .18s, border-color .18s, color .18s, transform .18s, box-shadow .18s; }
.survey .chip span::before { content: '✓'; display: none; font-weight: 700; }
.survey .chip:hover span { border-color: var(--ac); transform: translateY(-1px); }
.survey .chip input:checked + span { box-shadow: 0 6px 18px -8px color-mix(in srgb, var(--ac) 80%, transparent); animation: survey-pop .3s ease; }
.survey .chip input:checked + span::before { display: inline; }
.survey .chip:active span { transform: scale(.97); }
.survey .dot span { width: 46px; height: 46px; border-radius: 12px; font-size: 16px; border-width: 1.5px; transition: background .18s, border-color .18s, color .18s, transform .18s; }
.survey .dot:hover span { border-color: var(--ac); transform: translateY(-1px); }
.survey .dot input:checked + span { animation: survey-pop .3s ease; }
.survey .scale-label { font-size: 15px; }
.survey .scale-btns, .survey .nps { gap: 8px; }
.survey .check { font-size: 15px; }
.survey .check input { width: 22px; height: 22px; }
.survey .contact-grid input { min-height: 48px; font-size: 16px; }
.survey textarea { font-size: 16px; }
.survey-submit .wide-btn { padding: 16px 28px; font-size: 17px; }
@keyframes survey-pop { 0% { transform: scale(1); } 45% { transform: scale(1.08); } 100% { transform: scale(1); } }
@media (max-width: 480px) {
  .survey .dot span { width: 42px; height: 42px; }
  .survey .nps { gap: 6px; }
  .survey .chip span { padding: 11px 16px; font-size: 15px; }
}
@media (prefers-reduced-motion: reduce) {
  .survey .chip input:checked + span, .survey .dot input:checked + span, .survey fieldset.done .qn { animation: none; }
}
.survey .nps-ends { max-width: 586px; }
@media (max-width: 480px) { .survey .nps-ends { max-width: 100%; } }

/* Ankieta: mikro rozbłysk po każdej odpowiedzi (iskierki z public/ankieta.js) i przełącznik dźwięku. */
.survey-step-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.survey .sound-btn { font-size: 13px; color: var(--mut); }
.spark-burst { position: fixed; left: var(--x); top: var(--y); width: 0; height: 0; pointer-events: none; z-index: 50; }
.spark { position: absolute; left: -4px; top: -4px; width: 8px; height: 8px; border-radius: 50%; opacity: 0;
  background: #bf5af2; box-shadow: 0 0 10px 3px rgba(191, 90, 242, .55);
  animation: spark-fly .6s cubic-bezier(.2, .7, .3, 1) var(--d) forwards; }
.spark:nth-child(3n) { background: #64d2ff; box-shadow: 0 0 10px 3px rgba(100, 210, 255, .55); }
.spark:nth-child(3n+1) { background: #ff9f0a; box-shadow: 0 0 10px 3px rgba(255, 159, 10, .5); }
.spark-ring { position: absolute; left: -10px; top: -10px; width: 20px; height: 20px; border-radius: 50%; border: 2px solid #5e5ce6; opacity: 0; animation: spark-ring .5s ease-out forwards; }
@keyframes spark-ring { 0% { opacity: .8; transform: scale(.4); } 100% { opacity: 0; transform: scale(4.5); } }
@keyframes spark-fly { 0% { opacity: 1; transform: translate(0, 0) scale(1); } 100% { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(.3); } }
