/* Teren - aplikacja na telefon (2026-10-07)
 * Motyw: polskie tablice drogowe. Główne przyciski to niebieskie tablice
 * informacyjne z białym obrzeżem (START) / czerwona tablica (STOP), numer
 * drogi na żółtej tabliczce DW jak w Monitorze. Jasno i kontrastowo - do
 * czytania w słońcu; wszystkie cele dotyku >= 48 px. */
@font-face { font-family: "Barlow"; font-weight: 500; font-display: swap; src: url(fonts/barlow-latin-ext-500.woff2) format("woff2"); unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Barlow"; font-weight: 600; font-display: swap; src: url(fonts/barlow-latin-ext-600.woff2) format("woff2"); unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Barlow"; font-weight: 700; font-display: swap; src: url(fonts/barlow-latin-ext-700.woff2) format("woff2"); unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Barlow"; font-weight: 800; font-display: swap; src: url(fonts/barlow-latin-ext-800.woff2) format("woff2"); unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Barlow"; font-weight: 500; font-display: swap; src: url(fonts/barlow-latin-500.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Barlow"; font-weight: 600; font-display: swap; src: url(fonts/barlow-latin-600.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Barlow"; font-weight: 700; font-display: swap; src: url(fonts/barlow-latin-700.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Barlow"; font-weight: 800; font-display: swap; src: url(fonts/barlow-latin-800.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --blue: #0b5cad;        /* tablica informacyjna */
  --blue-deep: #073f78;
  --blue-tint: #e3eefa;
  --red: #c8102e;         /* STOP / nagrywanie */
  --yellow: #ffd200;      /* tabliczka numeru drogi */
  --ink: #10243b;
  --muted: #45576a;
  --line: #c6d1dd;
  --bg: #eef2f6;
  --surface: #ffffff;
  --ok: #156b39;
  --warn: #9a4d00;
  --warn-bg: #fff3dc;
  --err-bg: #fde8eb;
  --r-plate: 18px;
  --r: 12px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg); color: var(--ink);
  font: 500 17px/1.45 "Barlow", "Segoe UI", Roboto, system-ui, sans-serif;
  -webkit-tap-highlight-color: transparent; -webkit-text-size-adjust: 100%;
  overscroll-behavior-y: contain;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
[hidden] { display: none !important; }

.app { display: flex; flex-direction: column; min-height: 100dvh; max-width: 640px; margin: 0 auto; }

/* --- nagłówek */
.top {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(8px + var(--safe-t)) 16px 8px; background: var(--surface); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 8px; }
.brand-mark { width: 32px; height: 32px; }
.brand-name { font-weight: 800; font-size: 22px; letter-spacing: .01em; }
.who {
  display: flex; flex-direction: column; align-items: flex-end; gap: 1px; min-height: 48px; justify-content: center;
  border: 0; background: none; padding: 4px 0 4px 8px; text-align: right;
}
.who-name { font-weight: 700; font-size: 16px; color: var(--blue); text-decoration: underline; text-underline-offset: 3px; }
.net { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.net i { width: 9px; height: 9px; border-radius: 50%; background: #9aa7b4; }
.net.is-on i { background: var(--ok); }
.net.is-off i { background: var(--warn); }

/* --- pas nagrywania: czerwień + biało-czerwona krawędź jak zapora drogowa */
.recbar {
  position: relative; display: flex; align-items: center; gap: 10px;
  padding: 10px 16px 16px; background: var(--red); color: #fff;
}
.recbar::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 7px;
  background: repeating-linear-gradient(-45deg, #fff 0 10px, var(--red) 10px 20px);
}
.recbar-dot { width: 14px; height: 14px; border-radius: 50%; background: #fff; animation: pulse 1.2s ease-in-out infinite; }
.recbar-lbl { font-weight: 800; font-size: 18px; }
.recbar-stats { margin-left: auto; display: flex; gap: 14px; font-variant-numeric: tabular-nums; }
.recbar-stats b { font-size: 22px; font-weight: 800; }
@keyframes pulse { 50% { opacity: .25; } }

/* --- mapa */
.mapbox { position: relative; height: clamp(210px, 36vh, 360px); background: #dfe5ec; }
.map { position: absolute; inset: 0; background: #e6ebf0; }
.leaflet-container { font: inherit; background: #e6ebf0; }
.gps {
  position: absolute; left: 10px; bottom: 10px; z-index: 500; max-width: calc(100% - 80px);
  display: flex; align-items: center; gap: 8px; padding: 7px 12px; border-radius: 999px;
  background: rgba(255,255,255,.96); border: 1.5px solid var(--line); font-weight: 700; font-size: 15px;
  box-shadow: 0 2px 8px rgba(16,36,59,.18);
}
.gps-ico { width: 12px; height: 12px; border-radius: 50%; background: #9aa7b4; flex: none; }
.gps.is-good .gps-ico { background: var(--ok); }
.gps.is-weak { border-color: #e2a14a; } .gps.is-weak .gps-ico { background: #e08a00; }
.gps.is-bad { border-color: var(--red); color: var(--red); } .gps.is-bad .gps-ico { background: var(--red); }
.road-live {
  position: absolute; left: 10px; top: 10px; z-index: 500; display: flex; align-items: center; gap: 8px;
  padding: 6px 12px 6px 8px; border-radius: 999px; background: rgba(255,255,255,.96); border: 1.5px solid var(--line);
  font-weight: 700; font-size: 14px; box-shadow: 0 2px 8px rgba(16,36,59,.18);
}
.road-live.is-off { color: var(--muted); font-weight: 600; padding-left: 12px; }
#rec-road .plate-dw { border-color: #fff; }
.l-remember { display: flex; align-items: center; gap: 10px; min-height: 48px; font-weight: 600; }
.l-remember input { width: 22px; height: 22px; margin: 0; flex: none; accent-color: var(--blue); }
.recenter {
  position: absolute; right: 10px; bottom: 10px; z-index: 500; width: 48px; height: 48px; border-radius: 12px;
  border: 1.5px solid var(--line); background: #fff; color: var(--blue); display: grid; place-items: center;
  box-shadow: 0 2px 8px rgba(16,36,59,.18);
}
.recenter svg { width: 24px; height: 24px; }
.pickhint {
  position: absolute; left: 10px; right: 10px; top: 10px; z-index: 600; padding: 10px 12px; border-radius: 12px;
  background: var(--blue); color: #fff; font-weight: 700; display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.pickhint button { min-height: 40px; padding: 0 14px; border-radius: 9px; border: 2px solid #fff; background: none; color: #fff; font-weight: 700; }
.me-dot { width: 20px; height: 20px; border-radius: 50%; background: var(--blue); border: 3px solid #fff; box-shadow: 0 0 0 2px var(--blue), 0 2px 6px rgba(0,0,0,.3); }
.end-pin { width: 22px; height: 22px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 1px 5px rgba(0,0,0,.4); }
.end-pin.a { background: #fff; border-color: var(--ink); }
.end-pin.b { background: var(--red); }
.pt-pin { width: 26px; height: 26px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); background: var(--red); border: 3px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.35); }

/* --- sterowanie */
.controls { flex: 1; padding: 14px 16px calc(24px + var(--safe-b)); display: flex; flex-direction: column; gap: 12px; }
.warn { padding: 10px 12px; border-radius: var(--r); background: var(--warn-bg); color: #5c2e00; border-left: 5px solid #e08a00; font-weight: 600; font-size: 15px; }
.warn.is-bad { background: var(--err-bg); color: #6d0a1a; border-left-color: var(--red); }
.warn b { display: block; font-weight: 800; }

.plate {
  display: block; width: 100%; border: 0; padding: 6px; border-radius: var(--r-plate);
  background: var(--blue); color: #fff; box-shadow: 0 3px 0 var(--blue-deep), 0 6px 16px rgba(11,92,173,.25);
  transition: transform .08s ease, box-shadow .08s ease;
}
.plate:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--blue-deep); }
.plate-in {
  display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 104px;
  border: 3px solid #fff; border-radius: calc(var(--r-plate) - 5px);
}
.plate-big { font-size: 46px; font-weight: 800; line-height: 1; letter-spacing: .06em; }
.plate-sub { font-size: 18px; font-weight: 600; margin-top: 6px; }
.plate:disabled { background: #8ea6be; box-shadow: none; cursor: not-allowed; }
.plate-stop { background: var(--red); box-shadow: 0 3px 0 #82091d, 0 6px 16px rgba(200,16,46,.3); }
.plate-stop:active { box-shadow: 0 1px 0 #82091d; }
.hint { margin: -2px 2px 0; color: var(--muted); font-size: 15px; }

.btn-point {
  align-self: center; display: inline-flex; align-items: center; gap: 8px; min-height: 52px; padding: 0 22px;
  border-radius: 999px; border: 2px solid var(--blue); background: var(--surface); color: var(--blue); font-weight: 700; font-size: 18px;
}
.btn-point svg { width: 22px; height: 22px; }
.btn-point:disabled { opacity: .5; }

/* --- moje zgłoszenia */
.mine { margin-top: 6px; }
.mine-head { display: flex; align-items: baseline; justify-content: space-between; }
.mine h2 { margin: 6px 0 8px; font-size: 20px; font-weight: 800; }
.link { border: 0; background: none; color: var(--blue); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; min-height: 44px; padding: 0 4px; }
.mine-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.mine-empty { color: var(--muted); padding: 14px; border: 1.5px dashed var(--line); border-radius: var(--r); text-align: center; }
.item {
  display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; align-items: center; width: 100%; text-align: left;
  padding: 11px 12px; border-radius: var(--r); border: 1.5px solid var(--line); background: var(--surface);
}
.item-title { font-weight: 700; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.item-sub { grid-column: 1; color: var(--muted); font-size: 15px; }
.item-err { grid-column: 1 / -1; color: #6d0a1a; font-size: 14px; font-weight: 600; }
.item-actions { grid-column: 1 / -1; display: flex; gap: 8px; }
.item-actions button { min-height: 44px; padding: 0 14px; border-radius: 10px; border: 1.5px solid var(--blue); background: #fff; color: var(--blue); font-weight: 700; }
.chip { grid-row: 1; grid-column: 2; justify-self: end; font-size: 13px; font-weight: 800; padding: 4px 9px; border-radius: 999px; white-space: nowrap; }
.chip.saved { background: #e6ebf0; color: #33475b; }
.chip.pending { background: var(--warn-bg); color: var(--warn); }
.chip.sending { background: var(--blue-tint); color: var(--blue-deep); }
.chip.sent { background: #e2f3e8; color: var(--ok); }
.chip.error { background: var(--err-bg); color: var(--red); }
.srv { font-size: 13px; font-weight: 700; color: var(--muted); }
.plate-dw {
  display: inline-flex; align-items: center; padding: 1px 7px; border-radius: 5px; background: var(--yellow); color: #111;
  border: 2px solid #111; font-weight: 800; font-size: 14px; line-height: 1.2; letter-spacing: .02em; white-space: nowrap;
}
.plate-dw.lg { font-size: 22px; padding: 2px 10px; border-width: 2.5px; }

/* --- arkusze (formularz, logowanie, konto) */
.sheet {
  position: fixed; inset: 0; z-index: 2000; background: var(--bg); display: flex; flex-direction: column;
  max-width: 640px; margin: 0 auto;
}
.sheet-small { background: rgba(16,36,59,.45); justify-content: flex-end; max-width: none; }
.sheet-small > .sheet-scroll { background: var(--bg); border-radius: 18px 18px 0 0; max-width: 640px; width: 100%; margin: 0 auto; flex: none; padding-bottom: calc(20px + var(--safe-b)); }
.sheet-scroll { flex: 1; overflow-y: auto; padding: calc(14px + var(--safe-t)) 16px 18px; display: flex; flex-direction: column; gap: 10px; }
.f-title { margin: 2px 0 0; font-size: 26px; font-weight: 800; line-height: 1.15; }
.f-summary { margin: 0; font-size: 18px; }
.f-summary b { font-weight: 800; }
.f-gaps { padding: 10px 12px; border-radius: var(--r); background: var(--warn-bg); color: #5c2e00; border-left: 5px solid #e08a00; font-size: 15px; font-weight: 600; }
.f-map { height: 190px; border-radius: var(--r); border: 1.5px solid var(--line); overflow: hidden; flex: none; }
.f-road { padding: 12px; border-radius: var(--r); background: var(--surface); border: 1.5px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.f-road-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.f-road-why { color: var(--muted); font-size: 14px; }
.f-road-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.f-road-btns button, .f-road select {
  min-height: 48px; padding: 0 16px; border-radius: 10px; border: 2px solid var(--blue); background: #fff; color: var(--blue); font-weight: 700;
}
.f-road-btns .yes { background: var(--blue); color: #fff; }
.f-road.is-need { border-color: var(--red); box-shadow: 0 0 0 3px rgba(200,16,46,.15); }
.f-road select { width: 100%; color: var(--ink); border-color: var(--line); background: #fff; }
.ok-mark { color: var(--ok); font-weight: 800; }

.tiles { border: 0; margin: 4px 0 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tiles legend { font-weight: 800; font-size: 18px; margin-bottom: 8px; padding: 0; }
.tile {
  position: relative; display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; gap: 6px;
  min-height: 86px; padding: 10px 12px; border-radius: 14px; border: 2px solid var(--line); background: var(--surface);
  text-align: left; font-weight: 700; font-size: 17px; line-height: 1.15;
}
.tile svg { width: 34px; height: 34px; }
.tile { --tile-bg: var(--surface); }
.tile[aria-pressed="true"] { --tile-bg: var(--blue); border-color: var(--blue); background: var(--blue); color: #fff; box-shadow: 0 0 0 3px rgba(11,92,173,.25); }
.tile[aria-pressed="true"]::after {
  content: ""; position: absolute; right: 10px; top: 10px; width: 22px; height: 22px; border-radius: 50%;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 12.5l4 4 8-9' fill='none' stroke='%230b5cad' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/16px no-repeat;
}
.tiles.is-need .tile { border-color: #e7a0ab; }
.f-err { margin: 0; color: var(--red); font-weight: 700; }
.f-lbl { font-weight: 800; font-size: 17px; margin-top: 6px; }
.f-lbl span { font-weight: 500; color: var(--muted); }
textarea, .sheet input:not([type=file]):not([type=checkbox]) {
  width: 100%; min-height: 50px; padding: 11px 12px; border-radius: 10px; border: 1.5px solid var(--line); background: #fff; font-size: 17px;
}
textarea { resize: vertical; }
.f-photos { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.thumbs { display: contents; }
.thumb { position: relative; width: 76px; height: 76px; border-radius: 10px; overflow: hidden; border: 1.5px solid var(--line); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb button { position: absolute; right: 2px; top: 2px; width: 32px; height: 32px; border-radius: 50%; border: 0; background: rgba(16,36,59,.8); color: #fff; font-weight: 800; }
.btn-photo {
  display: inline-flex; align-items: center; gap: 8px; min-height: 52px; padding: 0 18px; border-radius: 12px;
  border: 2px solid var(--blue); background: #fff; color: var(--blue); font-weight: 700;
}
.btn-photo svg { width: 22px; height: 22px; }
.btn-photo input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.btn-photo:focus-within { outline: 3px solid var(--blue); outline-offset: 2px; }

.sheet-foot { padding: 10px 16px calc(12px + var(--safe-b)); background: var(--surface); border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; }
.btn-primary {
  width: 100%; min-height: 58px; border-radius: 14px; border: 0; background: var(--blue); color: #fff; font-weight: 800; font-size: 19px;
  box-shadow: 0 3px 0 var(--blue-deep);
}
.btn-primary:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--blue-deep); }
.btn-primary:disabled { opacity: .6; }
.f-secondary { display: flex; gap: 8px; }
.btn-ghost { flex: 1; min-height: 48px; font-size: 16px; line-height: 1.15; border-radius: 12px; border: 1.5px solid var(--line); background: #fff; font-weight: 700; color: var(--ink); }
.btn-ghost.danger { color: var(--red); border-color: #e7a0ab; }
.a-notes { margin: 0; padding-left: 20px; color: var(--muted); font-size: 15px; }

.toast {
  position: fixed; left: 16px; right: 16px; bottom: calc(18px + var(--safe-b)); z-index: 3000; max-width: 600px; margin: 0 auto;
  padding: 13px 16px; border-radius: 12px; background: var(--ink); color: #fff; font-weight: 700; box-shadow: 0 6px 20px rgba(0,0,0,.3);
}
.toast.ok { background: var(--ok); }
.toast.err { background: var(--red); }

@media (prefers-reduced-motion: reduce) {
  .recbar-dot { animation: none; }
  .plate, .btn-primary { transition: none; }
}

/* ===== Logowanie "Jezdnia" (2026-10-15, wybrany wariant B) =====
   Cały ekran to ciemny asfalt z żółtą linią środkową jadącą w dół, formularz
   wysuwa się od dołu jak arkusz (w zasięgu kciuka), przycisk czerwony jak STOP. */
.sheet.l-jezdnia { background: linear-gradient(180deg, #2b3138, #353c44); flex-direction: column; justify-content: flex-end; }
.l-road { position: relative; flex: 1 1 auto; min-height: 150px; display: grid; place-items: center; overflow: hidden; }
.l-road::before { content: ""; position: absolute; left: 50%; top: -70px; bottom: -70px; width: 8px; margin-left: -4px;
  background: repeating-linear-gradient(180deg, var(--yellow) 0 34px, transparent 34px 64px); animation: l-lane 1.6s linear infinite; }
.l-road::after { content: ""; position: absolute; inset: 0 14px;
  background: linear-gradient(90deg, rgba(255,255,255,.55) 0 4px, transparent 4px calc(100% - 4px), rgba(255,255,255,.55) calc(100% - 4px)); }
@keyframes l-lane { to { transform: translateY(64px); } }
.l-road-logo { position: relative; z-index: 2; display: grid; justify-items: center; gap: 10px; color: #fff;
  padding-top: var(--safe-t); }
.l-road-logo img { width: 84px; height: 84px; border-radius: 22px; box-shadow: 0 10px 24px rgba(0,0,0,.45); }
.l-road-logo b { font-size: 32px; font-weight: 800; text-shadow: 0 2px 10px rgba(0,0,0,.5); }
.sheet.l-jezdnia > .sheet-scroll { background: #fff; border-radius: 26px 26px 0 0; flex: none; max-height: 78dvh;
  box-shadow: 0 -10px 30px rgba(0,0,0,.25); }
.l-jezdnia .f-title { font-size: 24px; }
.l-jezdnia .f-summary { font-size: 15px; color: var(--muted); }
.l-jezdnia #l-go { background: var(--red); box-shadow: 0 3px 0 #82091d; }
.l-jezdnia #l-go:active { box-shadow: 0 1px 0 #82091d; }
@media (max-height: 560px) { .l-road { min-height: 90px; } .l-road-logo img { width: 56px; height: 56px; } .l-road-logo b { font-size: 24px; } }

/* biała ikona (2026-10-15) - cienka ramka w białym nagłówku */
.brand-mark { border-radius: 8px; box-shadow: 0 0 0 1px var(--line); }
