/* Motyw jasny i ciemny według ustawień telefonu (prefers-color-scheme), kolory tylko ze zmiennych. */
:root {
  color-scheme: light dark;
  --red: #c62828; --red-press: #a51d1d; --on-red: #fff;
  --accent: #b71c1c;           /* czerwony tekst i obramowania na tle strony */
  --accent-soft: #fdecea;      /* tło zaznaczeń */
  --bg: #f3f3f5; --card: #fff; --field: #fff;
  --fg: #17171a; --muted: #5f5f66; --line: #d6d6dc; --line-strong: #8a8a94;
  --focus: #1565c0;
  --ok: #2e7d32; --warn: #b84300; --err: #c62828;
  --nav-h: 64px;
  --radius: 12px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --red: #d32f2f; --red-press: #b71c1c; --on-red: #fff;
    --accent: #ff6e6e;
    --accent-soft: #3a1c1c;
    --bg: #0f0f11; --card: #1b1b1f; --field: #232328;
    --fg: #ececf0; --muted: #a2a2ab; --line: #34343b; --line-strong: #6e6e79;
    --focus: #64b5f6;
    --ok: #66bb6a; --warn: #ffa726; --err: #ff6e6e;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }
body { margin: 0; font: 17px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--fg); overflow-x: hidden; }
svg.i { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* --- nagłówek --- */
header { background: var(--red); color: var(--on-red); padding: 10px 16px; padding-top: calc(10px + env(safe-area-inset-top)); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
header h1 { font-size: 18px; margin: 0; line-height: 1.25; }
header a, header .link { color: var(--on-red); }
header nav { display: flex; gap: 10px; align-items: center; font-size: 15px; }
.app-head { position: sticky; top: 0; z-index: 10; border-radius: 0 0 var(--radius) var(--radius); }
.app-head .brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.app-head .brand img { width: 40px; height: 40px; padding: 2px; border-radius: 50%; background: #fff; flex: none; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.15); }
.app-head h1 { font-size: 16px; }
.icon-btn { display: inline-grid; place-items: center; width: 44px; height: 44px; margin: 0 -6px 0 0; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--on-red); flex: none; }
.icon-btn:active { background: rgba(255, 255, 255, 0.18); }
.icon-btn svg.i { width: 26px; height: 26px; }

main a { color: var(--accent); }
main { max-width: 560px; margin: 0 auto; padding: 16px; }
body.has-nav main { padding-bottom: calc(var(--nav-h) + 24px + env(safe-area-inset-bottom)); }
h2 { font-size: 24px; margin: 4px 0 12px; }
h3 { font-size: 16px; margin: 22px 0 8px; color: var(--fg); }

/* --- pola formularza --- */
label { display: block; margin: 12px 0; color: var(--muted); font-size: 15px; }
.lbl { display: block; margin-bottom: 6px; color: var(--fg); font-size: 15px; font-weight: 600; }
input, select, textarea { display: block; width: 100%; min-height: 50px; margin-top: 4px; padding: 12px; font: inherit; font-size: 17px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--field); color: var(--fg); }
.lbl + input, .lbl + .field { margin-top: 0; }
input::placeholder { color: var(--muted); opacity: 0.8; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--focus); outline-offset: 1px; border-color: var(--focus); }
input:disabled { opacity: 0.55; }
input[aria-invalid=true] { border-color: var(--err); outline: 2px solid var(--err); outline-offset: 1px; }
.field { position: relative; }
.field svg.i { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.field input { margin: 0; padding-left: 46px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.row2 > label { margin-top: 0; margin-bottom: 0; min-width: 0; }
.row2 input { min-width: 0; }
@media (max-width: 339px) { .row2 { grid-template-columns: 1fr; } }
input[type=date], input[type=time] { appearance: none; -webkit-appearance: none; }
/* data i godzina obok siebie: mniej miejsca na ikony, żeby zmieścił się cały tekst */
.row2 .field input { padding-left: 40px; padding-right: 6px; font-size: 16px; }
.row2 .field svg.i { left: 11px; width: 20px; height: 20px; }
input::-webkit-calendar-picker-indicator { margin: 0; padding: 0; opacity: 0.6; }
input::-webkit-date-and-time-value { text-align: left; }
.hint { color: var(--muted); font-size: 14px; margin: 6px 0 8px; }
.form > label, .form > .row2 { margin: 14px 0; }

/* --- przyciski --- */
button { width: 100%; min-height: 48px; padding: 14px; margin-top: 16px; font: inherit; font-size: 18px; font-weight: 600; border: 0; border-radius: 10px; background: var(--red); color: var(--on-red); cursor: pointer; }
button:active { background: var(--red-press); }
@media (hover: hover) { button:hover { background: var(--red-press); } }
button:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
button:disabled { opacity: 0.55; cursor: default; }
button.link { width: auto; min-height: 0; background: none; padding: 4px; margin: 0; font-weight: 400; font-size: 15px; text-decoration: underline; color: inherit; }
button.sec { background: var(--card); color: var(--fg); border: 1px solid var(--line-strong); }
@media (hover: hover) { button.sec:hover { background: var(--field); } }
.btn-ico { display: flex; align-items: center; justify-content: center; gap: 10px; }
.btn-save { min-height: 56px; font-size: 19px; margin-top: 22px; }
.btn-save.busy svg.i { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .btn-save.busy svg.i { animation: none; } }

/* --- kafelki pojazdów --- */
.vehicles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.vtile { position: relative; display: flex; flex-direction: column; width: auto; min-height: 0; margin: 0; padding: 0; overflow: hidden; text-align: center; font-weight: 400; background: var(--card); color: var(--fg); border: 2px solid var(--line); border-radius: var(--radius); }
.vtile:hover, .vtile:active { background: var(--card); }
@media (hover: hover) { .vtile:hover { border-color: var(--line-strong); } }
.vtile img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; object-position: center 60%; background: var(--line); }
.vtile .vname { display: block; padding: 8px 6px 0; font-weight: 700; font-size: 16px; line-height: 1.2; }
.vtile .vtype { display: block; padding: 2px 6px 10px; font-size: 14px; color: var(--muted); }
.vtile .mark { position: absolute; right: 8px; top: 8px; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: rgba(0, 0, 0, 0.35); border: 2px solid #fff; color: #fff; }
.vtile .mark svg.i { width: 18px; height: 18px; stroke-width: 3; visibility: hidden; }
.vtile[aria-checked=true] { border: 3px solid var(--red); background: var(--accent-soft); }
.vtile[aria-checked=true] .mark { background: var(--red); }
.vtile[aria-checked=true] .mark svg.i { visibility: visible; }
.vtile[aria-checked=true] .vname { color: var(--accent); }

/* --- rola: dwa przyciski --- */
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; border: 0; padding: 0; margin: 0; min-width: 0; }
.seg legend { padding: 0; }
.seg label { position: relative; display: flex; align-items: center; justify-content: center; gap: 10px; margin: 0; min-height: 52px; padding: 10px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--card); color: var(--fg); font-size: 17px; font-weight: 600; cursor: pointer; }
.seg input { position: absolute; opacity: 0; width: 1px; height: 1px; min-height: 0; margin: 0; pointer-events: none; }
.seg label:has(input:checked) { background: var(--red); border-color: var(--red); color: var(--on-red); }
.seg label:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }

/* --- odczyt licznika ze zdjęcia --- */
.odo-row { display: flex; gap: 8px; }
.odo-row .field { flex: 1; min-width: 0; }
.photo-btn { flex: none; width: 54px; min-height: 50px; margin: 0; padding: 0; display: grid; place-items: center; background: var(--card); color: var(--accent); border: 1px solid var(--line-strong); }
@media (hover: hover) { .photo-btn:hover { background: var(--field); } }
.photo-btn svg.i { width: 26px; height: 26px; }
.ocr { display: flex; align-items: center; gap: 12px; margin: 8px 0; padding: 8px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); font-size: 15px; }
.ocr img { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; flex: none; }
.ocr.busy span::after { content: ""; display: inline-block; width: 14px; height: 14px; margin-left: 8px; vertical-align: -2px; border: 2px solid var(--line-strong); border-top-color: var(--red); border-radius: 50%; animation: spin 1s linear infinite; }
.ocr.warn { border-color: var(--warn); }
.ocr.err { border-color: var(--err); }
.ocr.ok { border-color: var(--ok); }
input.from-photo { border-color: var(--ok); outline: 2px solid var(--ok); outline-offset: 1px; }

/* --- podpowiedzi nazwisk --- */
.sugg { background: var(--card); border: 1px solid var(--line-strong); border-radius: 10px; margin: 4px 0 0; overflow: hidden; }
.sugg button { display: block; width: 100%; min-height: 46px; margin: 0; padding: 12px 14px; text-align: left; font-weight: 400; font-size: 17px; background: none; color: var(--fg); border-radius: 0; border-bottom: 1px solid var(--line); }
.sugg button:last-child { border-bottom: 0; }
.sugg button:hover, .sugg button:active { background: var(--field); }

/* --- karty, komunikaty --- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; }
.msg { padding: 12px 14px; border-radius: 10px; background: var(--card); border: 1px solid var(--line); border-left-width: 5px; margin: 0 0 12px; }
.msg.ok { border-color: var(--ok); }
.msg.err { border-color: var(--err); }
.msg.warn { border-color: var(--warn); }

/* --- ekran po zapisie --- */
.done-actions button { margin-top: 10px; }
.done-head { text-align: center; margin: 8px 0 16px; }
.done-head h2 { margin: 10px 0 4px; }
.done-ico { display: inline-grid; place-items: center; width: 72px; height: 72px; border-radius: 50%; border: 3px solid var(--ok); color: var(--ok); }
.done-ico svg.i { width: 38px; height: 38px; stroke-width: 2.5; }
.done-ico.wait { border-color: var(--warn); color: var(--warn); }
.d-vehicle { display: flex; align-items: center; gap: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.card > h3:first-child, .dlg h3 { margin-top: 0; }
.d-vehicle .hint { margin: 0; }
.d-vehicle img { width: 80px; height: 60px; object-fit: cover; border-radius: 8px; flex: none; }
.d-list { list-style: none; margin: 0; padding: 0; }
.d-list li { display: flex; align-items: flex-start; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.d-list li:last-child { border-bottom: 0; }
.d-list svg.i { color: var(--muted); margin-top: 1px; }

/* --- szczegóły wyjazdu, usuwanie --- */
button.danger-sec { background: var(--card); color: var(--err); border: 2px solid var(--err); }
@media (hover: hover) { button.danger-sec:hover { background: var(--accent-soft); } }
button.danger { background: var(--err); color: #fff; }
@media (prefers-color-scheme: dark) { button.danger { color: #1b1b1f; } }
.dlg { width: min(440px, calc(100vw - 32px)); padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); color: var(--fg); }
.dlg::backdrop { background: rgba(0, 0, 0, 0.55); }
.check { display: flex; gap: 10px; align-items: flex-start; color: var(--fg); font-size: 16px; }
.check input { width: 22px; height: 22px; min-height: 0; margin: 2px 0 0; flex: none; accent-color: var(--red); }
.trip.editable { cursor: pointer; }
.trip.editable:active { background: var(--field); }
.vehicles.locked .vtile { pointer-events: none; }
.vehicles.locked .vtile[aria-checked=false] { opacity: 0.45; }

/* --- sprzęt --- */
.seg.mode { margin-bottom: 14px; }
.seg.mode button { min-height: 46px; margin: 0; font-size: 16px; background: var(--card); color: var(--fg); border: 1px solid var(--line-strong); }
.seg.mode button[aria-pressed=true] { background: var(--red); border-color: var(--red); color: var(--on-red); }
.equip-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.etile { display: grid; justify-items: start; gap: 2px; width: auto; min-height: 76px; margin: 0; padding: 10px 12px; text-align: left; font-weight: 400;
  background: var(--card); color: var(--fg); border: 2px solid var(--line); border-radius: var(--radius); }
.etile svg.i { color: var(--accent); }
.equip-tiles:has(.etile.photo) { grid-template-columns: repeat(3, 1fr); }
.etile.photo { position: relative; display: block; min-height: 0; padding: 0; overflow: hidden; background: #fff; }
.etile.photo > img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; }
.etile.photo .etile-name { position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 6px 4px; font-size: 11px; font-weight: 700; line-height: 1.2; color: #fff;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.8)); text-shadow: 0 1px 2px #000; }
.etile.photo[aria-checked=true] { border: 3px solid var(--red); }
.equip-entry > img { width: 64px; height: 48px; object-fit: cover; border-radius: 8px; background: #fff; flex: none; }
.paper-photo { display: block; width: 140px; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 8px; margin: 0 auto 6px; }
.chip-photo { width: 28px; height: 21px; object-fit: cover; border-radius: 4px; margin-right: 6px; vertical-align: middle; }
.etile strong { font-size: 15px; line-height: 1.2; }
.etile span { font-size: 13px; color: var(--muted); }
.etile[aria-checked=true] { border: 3px solid var(--red); background: var(--accent-soft); }
.equip-icon { width: 64px; height: 64px; display: grid; place-items: center; border-radius: 8px; background: var(--accent-soft); color: var(--accent); }
.equip-icon svg.i { width: 32px; height: 32px; }

/* --- historia --- */
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 12px; }
.form > label[for] { margin-bottom: 8px; }
.purpose-chips { margin-bottom: 10px; }
.purpose-chips button { min-height: 44px; font-size: 16px; }
.chips button:hover, .chips button:active { background: var(--card); }
.chips button { width: auto; min-height: 40px; margin: 0; padding: 8px 16px; font-size: 15px; border-radius: 999px; background: var(--card); color: var(--fg); border: 1px solid var(--line-strong); }
.chips button[aria-pressed=true] { background: var(--red); border-color: var(--red); color: var(--on-red); }
.trip { display: grid; grid-template-columns: 64px 1fr; gap: 12px; margin-bottom: 10px; }
.trip img { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; }
.trip .top { display: flex; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 14px; }
.trip .what { font-weight: 700; margin: 2px 0; overflow-wrap: anywhere; }
.trip .sub { color: var(--muted); font-size: 14px; overflow-wrap: anywhere; }
.badge { flex: none; padding: 1px 8px; border-radius: 6px; font-size: 13px; font-weight: 600; background: var(--accent-soft); color: var(--accent); }
.badge.wait { background: transparent; border: 1px solid var(--warn); color: var(--warn); }
.empty { text-align: center; color: var(--muted); padding: 24px 0; }

/* --- profil --- */
.profile { display: flex; align-items: center; gap: 14px; }
.avatar { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; background: var(--red); color: var(--on-red); font-size: 22px; font-weight: 700; flex: none; }
.profile .meta { color: var(--muted); font-size: 15px; }
a.btn { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px; margin-top: 12px; padding: 12px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--card); color: var(--fg); text-decoration: none; font-weight: 600; }

/* --- menu dolne --- */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; display: grid; grid-template-columns: repeat(3, 1fr); background: var(--card); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.tabbar button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: var(--nav-h); margin: 0; padding: 6px 4px; border-radius: 0; background: none; color: var(--muted); font-size: 13px; font-weight: 500; border-top: 3px solid transparent; }
.tabbar button:hover, .tabbar button:active { background: none; }
.tabbar button[aria-current=page] { color: var(--accent); border-top-color: var(--red); font-weight: 700; }
/* przy otwartej klawiaturze menu znika, żeby nie zasłaniało pól */
body.typing .tabbar { display: none; }

/* --- panel administratora: zakładki --- */
.app-head.static { position: static; }
.tabs { position: sticky; top: env(safe-area-inset-top); z-index: 9; display: flex; gap: 6px; overflow-x: auto; padding: 10px 16px;
  background: var(--bg); border-bottom: 1px solid var(--line); scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { flex: none; padding: 9px 14px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--card); color: var(--fg);
  text-decoration: none; font-size: 15px; font-weight: 600; white-space: nowrap; }
.tabs a[aria-selected=true] { background: var(--red); border-color: var(--red); color: var(--on-red); }
.pane h2 { margin-top: 4px; }
.stack { display: grid; gap: 10px; margin: 12px 0; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.actions button, .actions a.btn { flex: 1 1 200px; margin: 0; }
.seg button.month-btn { min-height: 52px; margin: 0; padding: 10px; font-size: 16px; background: var(--card); color: var(--fg); border: 1px solid var(--line-strong); }
.seg button.month-btn[aria-pressed=true] { background: var(--red); border-color: var(--red); color: var(--on-red); }
.print-card { display: grid; gap: 8px; }
.print-card .row { display: flex; flex-wrap: wrap; gap: 8px; }
.print-card a.btn { flex: 1 1 140px; margin: 0; min-height: 44px; }
a.btn.sec-link { font-weight: 500; }
.pane > .lbl { margin-top: 14px; }

/* --- karta sprzętu (wirtualna, na wzór karty z gminy) --- */
.paper-card { display: grid; gap: 8px; }
.paper-small { font-size: 12px; color: var(--muted); }
.paper-title { margin: 4px 0 0; text-align: center; font-size: 16px; }
.paper-center { text-align: center; }
.paper-meta { display: grid; gap: 2px; font-size: 15px; }
.paper-scroll { overflow-x: auto; }
.paper-table { width: 100%; min-width: 520px; border-collapse: collapse; font-size: 14px; }
.paper-table th, .paper-table td { border: 1px solid var(--line-strong); padding: 6px; text-align: center; height: 30px; }
.paper-table th { font-weight: 600; font-size: 13px; background: var(--field); }
.paper-sum { font-weight: 600; }
.chips button[aria-pressed=true] { background: var(--red); border-color: var(--red); color: var(--on-red); }

/* --- panel administratora i druk kart --- */
h2.section { margin-top: 28px; }
.hint.gap { margin-top: 14px; }
.user { display: grid; gap: 6px; }
.user .row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.user .meta { color: var(--muted); font-size: 14px; }
.user button { width: auto; min-height: 40px; margin: 0; padding: 8px 12px; font-size: 15px; }
.off { opacity: 0.6; }
textarea { min-height: 120px; resize: vertical; }
.checks { display: flex; gap: 18px; margin: 8px 0; }
.sv-card { display: grid; gap: 6px; margin-top: 12px; }
.sv-date { display: flex; align-items: center; gap: 10px; margin: 0; }
.sv-date input { width: auto; margin: 0; }
.times { display: flex; gap: 6px; }
.times input { min-width: 0; }
.ro-plan { margin: 6px 0 0; padding-left: 18px; font-size: 15px; }
.err-text { color: var(--err); }
.db-months { margin: 6px 0 0; padding-left: 18px; color: var(--muted); font-size: 15px; columns: 2; }

[hidden] { display: none !important; }
/* wąski baner u góry: jedna linia tytułu, mniejszy znak i przycisk profilu */
.app-head { padding: 4px 12px; padding-top: calc(4px + env(safe-area-inset-top)); }
.app-head h1 { font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-head .brand img { width: 30px; height: 30px; padding: 1px; }
.app-head .icon-btn { width: 36px; height: 36px; min-height: 36px; padding: 0; }

/* --- Panel admina: układ pod przeglądarkę na komputerze (menu z boku, szeroka treść, zwykłe przyciski) --- */
body.admin { min-height: 100vh; }
body.admin main { max-width: 1180px; }
body.admin .form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0 16px; }
body.admin .form-grid > label { margin: 8px 0; }
body.admin .actions { display: flex; flex-wrap: wrap; gap: 10px; }
@media (min-width: 900px) {
  body.admin { display: grid; grid-template-columns: 230px 1fr; grid-template-rows: auto 1fr; }
  body.admin .app-head { grid-column: 1 / -1; padding: 8px 24px; }
  body.admin .app-head h1 { font-size: 18px; }
  body.admin .tabs { position: sticky; top: 0; align-self: start; flex-direction: column; gap: 2px; overflow: visible; padding: 18px 12px; border: 0; border-right: 1px solid var(--line); background: transparent; }
  body.admin .tabs a { padding: 9px 14px; border: 0; border-radius: 8px; background: transparent; font-size: 15px; }
  body.admin .tabs a:hover { background: var(--card); }
  body.admin .tabs a[aria-selected=true] { background: var(--red); color: var(--on-red); }
  body.admin main { width: 100%; margin: 0; padding: 20px 32px 40px; font-size: 15px; }
  body.admin h2 { margin-top: 4px; }
  body.admin .hint { max-width: 80ch; }
  body.admin label { font-size: 14px; }
  body.admin input, body.admin select { min-height: 38px; padding: 7px 10px; font-size: 15px; border-radius: 8px; }
  body.admin textarea { padding: 8px 10px; font-size: 15px; border-radius: 8px; }
  body.admin input[type=checkbox] { min-height: 0; }
  body.admin button { width: auto; min-height: 38px; padding: 8px 18px; margin-top: 12px; font-size: 15px; border-radius: 8px; }
  body.admin button:hover:not(:disabled) { filter: brightness(1.08); }
  body.admin button.sec:hover:not(:disabled) { background: var(--field); filter: none; }
  body.admin .actions button, body.admin .actions a.btn { flex: none; margin: 0; }
  body.admin .card .row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
  body.admin .card .row button { margin: 0; padding: 6px 12px; font-size: 14px; min-height: 34px; }
  body.admin .card button { margin-top: 8px; }
  body.admin #eq-starts .card > button, body.admin #sv-list .card > button { align-self: start; }
  body.admin #users { grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); }
  body.admin .sv-date input { max-width: 200px; }
  body.admin .sv-card button { width: auto; justify-self: start; min-height: 34px; padding: 6px 12px; font-size: 14px; margin-top: 4px; }
  body.admin button.link { padding: 2px 4px; margin: 0; }
  body.admin .chips button { min-height: 34px; padding: 6px 14px; font-size: 14px; margin: 0; }
  body.admin .form-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  body.admin .form-grid.two { grid-template-columns: 1fr 1fr; }
  body.admin .form-grid.two textarea { min-height: 360px; }
  body.admin #users, body.admin #sv-list, body.admin #eq-starts, body.admin #print-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 12px; align-items: start; }
  body.admin #users > *, body.admin #sv-list > *, body.admin #eq-starts > *, body.admin #print-list > * { margin: 0; }
  body.admin #users > .hint, body.admin #print-list > .hint { grid-column: 1 / -1; }
  body.admin .seg { max-width: 640px; }
  body.admin .period-nav { margin-bottom: 12px; }
  body.admin .period-nav button { margin-top: 0; flex: none; }
  body.admin #eq-card { max-width: 1000px; }
  body.admin .paper-card { padding: 20px 28px; }
  body.admin .paper-title { font-size: 18px; }
  body.admin .paper-meta { grid-template-columns: 1fr 1fr; gap: 4px 24px; }
  body.admin .paper-table { min-width: 0; }
  body.admin .paper-table td { height: 26px; padding: 4px 8px; }
  body.admin .msg { max-width: 900px; }
  body.admin #o-key { max-width: 480px; }
  body.admin .row2 { max-width: 560px; }
}

/* niższe przełączniki Pojazdy/Sprzęt i Kierowca/Dowódca */
.seg.mode button { min-height: 38px; padding: 6px 10px; font-size: 15px; }
#f-role .seg label { min-height: 40px; padding: 6px 10px; font-size: 16px; }
#f-role .seg label svg.i { width: 20px; height: 20px; }

/* --- formularze wyjazdu i sprzętu ściśnięte, żeby mieścił się na ekranie telefonu (Galaxy S22: 360 px) --- */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:is(#v-start, #v-equip) .seg.mode { margin-bottom: 8px; }
:is(#v-start, #v-equip) .seg.mode button { min-height: 34px; padding: 4px 10px; }
#v-start .vehicles { gap: 8px; }
/* zdjęcia wozów wyższe o tyle, o ile zmalał przycisk Zapisz (46 → 34 px) */
#v-start .vtile img { aspect-ratio: auto; height: calc((min(100vw, 560px) - 40px) / 4 + 12px); }
#v-start .vtile .vname, #v-start .vtile .vtype { position: absolute; left: 0; right: 0; color: #fff; text-shadow: 0 1px 2px #000; text-align: left; }
#v-start .vtile .vname { bottom: 0; padding: 16px 8px 4px; font-size: 16px; background: linear-gradient(transparent, rgba(0, 0, 0, 0.55)); }
#v-start .vtile .vtype { bottom: 0; padding: 0 8px 3px; font-size: 12px; background: rgba(0, 0, 0, 0.55); }
#v-start .vtile[aria-checked=true] .vname { color: #fff; }
#v-start .vtile .mark { width: 24px; height: 24px; right: 6px; top: 6px; }
#v-start #f-role { margin-top: 8px; }
#v-start #f-role .seg label { min-height: 34px; padding: 4px 10px; font-size: 15px; }
:is(#v-start, #v-equip) > label, :is(#v-start, #v-equip) > .row2 { margin: 8px 0; }
:is(#v-start, #v-equip) .lbl { margin-bottom: 2px; font-size: 13px; }
:is(#v-start, #v-equip) input { min-height: 40px; padding-top: 6px; padding-bottom: 6px; font-size: 16px; }
:is(#v-start, #v-equip) .field input { padding-left: 38px; }
:is(#v-start, #v-equip) .field svg.i { left: 10px; width: 20px; height: 20px; }
:is(#v-start, #v-equip) .row2 .field input { padding-left: 34px; padding-right: 4px; font-size: 15px; }
:is(#v-start, #v-equip) .row2 .field svg.i { left: 9px; width: 18px; height: 18px; }
#v-start .photo-btn { min-height: 40px; height: 40px; width: 40px; flex: none; }
#v-start .odo-row { gap: 6px; }
:is(#v-start, #v-equip) > label[for] { margin: 8px 0 3px; }
:is(#v-start, #v-equip) .purpose-chips { flex-wrap: nowrap; overflow-x: auto; margin: 0 -16px 6px; padding: 0 16px 2px; scrollbar-width: none; }
:is(#v-start, #v-equip) .purpose-chips::-webkit-scrollbar { display: none; }
:is(#v-start, #v-equip) .purpose-chips button { flex: none; min-height: 32px; padding: 4px 12px; font-size: 14px; }
:is(#v-start, #v-equip) .hint:empty { display: none; }
:is(#v-start, #v-equip) .hint { margin: 2px 0 4px; font-size: 13px; }
:is(#v-start, #v-equip) .btn-save { min-height: 34px; padding: 4px 10px; margin-top: 10px; font-size: 15px; }
:is(#v-start, #v-equip) .btn-save svg.i { width: 20px; height: 20px; }

.install-help { margin-top: 8px; }
.install-help p { margin: 6px 0 0; font-size: 15px; }
#v-equip .equip-tiles { gap: 8px; }
