@font-face {
  font-family: "Open Sans";
  font-style: normal;
  font-weight: 300 800;
  font-display: swap;
  src: url("../fonts/open-sans-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308,
    U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113,
    U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Open Sans";
  font-style: normal;
  font-weight: 300 800;
  font-display: swap;
  src: url("../fonts/open-sans-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304,
    U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --bg: #faf7f0;
  --surface: #fbf9f4;
  --card: #ffffff;
  --ink: #2f2e2b;
  --muted: #66635a;
  --line: #e5e2d6;
  --green: #4a6b57;
  --green-dark: #34503f;
  --green-soft: #e9efe4;
  --amber: #eea24f;
  --amber-soft: #fdf1dc;
  --amber-ink: #8a4b08;
  --red: #b83a31;
  --disabled: #c4c3b4;
  --radius: 14px;
  --shadow: 0 2px 12px rgba(47, 60, 50, 0.07);
  --shadow-card: 0 8px 22px rgba(47, 46, 43, 0.08);
  --focus: 0 0 0 3px #fff, 0 0 0 5px var(--green-dark);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: "Open Sans", Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.45;
}
button, input, select, textarea { font: inherit; }
img { max-width: 100%; }

:focus-visible {
  outline: none;
  box-shadow: var(--focus);
  border-radius: 6px;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  background: var(--green-dark);
  color: #fff;
  padding: 10px 14px;
  border-radius: 8px;
  z-index: 100;
}
.skip-link:focus { top: 12px; }

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* Nagłówek */
header.top {
  background: #fff;
  border-top: 3px solid var(--green);
  border-bottom: 1px solid var(--line);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.brand { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.logo-img { display: block; height: auto; }
.logo-top { width: 96px; }
.brand-sub {
  margin: 0;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.btn-logout {
  min-height: 44px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--green-dark);
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

main { padding: 20px 16px 60px; }

/* Przyciski */
button.primary {
  display: block;
  width: 100%;
  min-height: 48px;
  padding: 13px;
  background: var(--green);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 12px;
}
button.primary:disabled { background: var(--disabled); cursor: not-allowed; }
.link-small {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 44px;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
  margin-top: 8px;
}

/* Formularze */
.field-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-top: 12px;
}
input[type="text"], input[type="email"], input[type="search"], select {
  display: block;
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid #cfccbf;
  border-radius: 8px;
  font-size: 16px;
  margin-top: 4px;
  background: #fff;
  color: var(--ink);
}
input[aria-invalid="true"] { border-color: var(--red); }
.hint { font-size: 13px; color: var(--muted); margin: 6px 0 0; }
.field-error {
  margin: 6px 0 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--red);
}

/* Komunikaty (region aria-live w układzie strony) */
#komunikaty:empty { display: none; }
.komunikat {
  margin: 0 auto 16px;
  max-width: 640px;
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
}
.komunikat-blad { background: #fbe9e7; color: #7d2019; border: 1px solid #f1c4bf; }
.komunikat-ok { background: var(--green-soft); color: var(--green-dark); border: 1px solid #cfdcc6; }

/* Logowanie */
body.strona-logowania { background: #fff; }
body.strona-logowania main { padding-top: 40px; }
.login-card { max-width: 400px; margin: 0 auto; }
.logo-login { width: 150px; margin: 0 auto 4px; }
.login-caption {
  margin: 6px 0 18px;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.login-heading { margin: 0 0 12px; text-align: center; font-size: 20px; font-weight: 700; }
.login-note, .login-sent-body { text-align: center; }
.login-sent-body { margin: 0 0 10px; font-size: 15px; }
.login-sent-body strong { color: var(--green-dark); word-break: break-all; }

.code-lock {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 8px 0 10px;
}
.code-wheel {
  position: relative;
  width: 44px;
  height: 132px;
  overflow-y: scroll;
  scroll-snap-type: y mandatory;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fcfbf7;
  scrollbar-width: none;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 38%, #000 62%, transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0%, #000 38%, #000 62%, transparent 100%);
}
.code-wheel::-webkit-scrollbar { display: none; }
.wheel-track { padding: 46px 0; }
.wheel-num {
  height: 40px;
  scroll-snap-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 700;
  color: #bdbaae;
  user-select: none;
}
.wheel-num.picked { color: var(--green-dark); }
.code-wheel-highlight {
  position: absolute;
  top: 46px;
  left: 0;
  right: 0;
  height: 40px;
  border-top: 2px solid var(--green);
  border-bottom: 2px solid var(--green);
  pointer-events: none;
}
input.code-input {
  display: block;
  width: 100%;
  max-width: 220px;
  margin: 0 auto;
  text-align: center;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.25em;
  font-variant-numeric: tabular-nums;
}
.login-step-sent .hint { text-align: center; }

/* Wspólne elementy list i kart */
.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #e6eedd;
  color: var(--green-dark);
  font-size: 16px;
  font-weight: 800;
  line-height: 1;
}
.section-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 18px 0 8px;
}
.section-heading { font-size: 18px; margin: 4px 0 8px; color: var(--green-dark); }
.empty-note { color: var(--muted); font-size: 14px; padding: 20px 0; text-align: center; }
.status-pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}
.status-zgloszone { background: var(--amber-soft); color: #7a4c12; }
.status-wypuszczone { background: #e3edf3; color: #234a61; }
.status-odebrane { background: var(--green-soft); color: var(--green-dark); }
.demo-only {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  margin: 0 0 10px;
  padding: 8px 12px;
  border-radius: 10px;
  background: #fff8e4;
  color: #5c4610;
  font-size: 13px;
}
.demo-only input { width: 20px; height: 20px; }

/* Aplikacja rodzica (telefon) */
.parent-app { max-width: 480px; margin: 0 auto; }
.geo-status {
  margin: 0 0 12px;
  padding: 8px 12px;
  border-radius: 10px;
  background: #f1f0e8;
  color: var(--muted);
  font-size: 13px;
}
.geo-status.geo-ok { background: var(--green-soft); color: var(--green-dark); }
.child-list { list-style: none; margin: 0; padding: 0; }
.child-row, .child-card {
  background: var(--card);
  border-radius: 16px;
  box-shadow: var(--shadow-card);
}
.child-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  margin-top: 12px;
}
.child-card { padding: 18px 16px; margin-top: 14px; }
.who { display: flex; align-items: center; gap: 12px; min-width: 0; }
.who .avatar { width: 50px; height: 50px; font-size: 24px; }
.child-card .who .avatar { width: 64px; height: 64px; font-size: 30px; }
.who-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.imie { font-size: 17px; font-weight: 800; line-height: 1.15; }
.child-card .imie { font-size: 20px; }
.who-text .klasa { color: var(--muted); font-size: 13px; font-weight: 600; }
.right-col { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; flex-shrink: 0; }
.status-line { margin: 12px 0 0; }
.btn-only-this {
  min-height: 44px;
  padding: 8px 14px;
  background: #fff;
  border: 1.5px solid var(--green);
  border-radius: 10px;
  color: var(--green-dark);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}
.btn-only-this:disabled { border-color: var(--disabled); color: #8f8c80; cursor: not-allowed; }
.odbiera { margin: 4px 0 0; font-size: 12px; color: var(--muted); overflow-wrap: anywhere; text-align: right; }
.child-card .odbiera { text-align: left; }
.window-note { text-align: center; margin-top: 16px; }
.btn-received {
  min-height: 44px;
  margin-top: 6px;
  padding: 8px 18px;
  background: var(--green);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}
.btn-received-wide { display: block; width: 100%; min-height: 52px; margin-top: 14px; font-size: 17px; }
.cta-dock {
  position: sticky;
  bottom: 0;
  margin: 18px -16px 0;
  padding: 12px 16px calc(16px + env(safe-area-inset-bottom));
  background: linear-gradient(to bottom, rgba(250, 247, 240, 0), var(--bg) 30%);
}
button.btn-huge {
  display: block;
  width: 100%;
  min-height: 60px;
  padding: 18px 14px;
  background: var(--green);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(47, 60, 50, 0.22);
}
button.btn-huge:disabled { background: var(--disabled); box-shadow: none; cursor: not-allowed; }

/* Upoważnienia */
.link-upowaznij {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--green-dark);
  font-size: 14px;
  font-weight: 600;
  text-decoration: underline;
}
.card-footer { margin-top: 4px; }
.badge-upowaznienie {
  display: inline-block;
  margin: 6px 0 0;
  padding: 3px 10px;
  border-radius: 999px;
  background: #efe9f7;
  color: #4b3a6b;
  font-size: 12px;
  font-weight: 700;
}
.tag-upowazniony {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 999px;
  background: #efe9f7;
  color: #4b3a6b;
  font-size: 11px;
  font-weight: 700;
}
.back-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--green-dark);
  font-weight: 600;
  text-decoration: none;
}
.page-heading { font-size: 20px; margin: 6px 0 14px; }
.days-fieldset { border: none; padding: 0; margin: 16px 0 0; }
.days-fieldset legend { padding: 0; }
.days { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.day-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.day-chip:has(input:checked) { background: var(--green); border-color: var(--green); color: #fff; }
.day-chip:has(input:focus-visible) { box-shadow: var(--focus); }
.day-chip input { width: 18px; height: 18px; accent-color: var(--green-dark); }
.day-chip.day-off { opacity: 0.55; cursor: not-allowed; }
.auth-list { list-style: none; margin: 0; padding: 0; }
.auth-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 10px;
  padding: 12px 14px;
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--shadow-card);
}
.auth-who { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.auth-email { font-weight: 700; overflow-wrap: anywhere; }
.auth-days { font-size: 13px; color: var(--muted); }
.auth-actions { display: flex; gap: 6px; }
.auth-actions .btn-small { margin-left: 0; }
.muted-cell { color: var(--muted); font-size: 14px; }
.tag-usuniete {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 8px;
  border-radius: 999px;
  background: #eeeae0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}
.history-filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; margin-bottom: 12px; }
.history-filters input[type="date"] { width: auto; }
.history-search { flex: 1; min-width: 220px; max-width: 420px; }
.history-filters .field-label { margin-top: 0; }
.report-form { max-width: 320px; }
input[type="date"] {
  display: block;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid #cfccbf;
  border-radius: 8px;
  font-size: 16px;
  margin-top: 4px;
  background: #fff;
  color: var(--ink);
}

/* Aplikacja szkoły (komputer, tablet) */
body.strona-szkoly main { max-width: 1100px; margin: 0 auto; }
.school-shell {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.school-tabs { display: flex; border-bottom: 1px solid var(--line); overflow-x: auto; }
.school-tabs a {
  flex: 1;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 10px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
  border-bottom: 3px solid transparent;
}
.school-tabs a[aria-current="page"] { color: var(--green-dark); border-bottom-color: var(--green); }
.school-body { padding: 20px; background: var(--surface); }

.filter-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; padding: 0; border: none; }
.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 6px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.filter-chip:has(input:checked) { background: var(--green); border-color: var(--green); color: #fff; }
.filter-chip input { width: 18px; height: 18px; accent-color: var(--green-dark); }
.filter-chip:has(input:focus-visible) { box-shadow: var(--focus); }

table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.03em; }
.col-akcja { text-align: right; white-space: nowrap; }
.dziecko-cell { font-weight: 700; }
.dziecko-cell .avatar { margin-right: 10px; vertical-align: middle; }
.emails-cell span { display: block; font-size: 14px; }
tr.row-late td { background: #fff3df; }
tr.wiersz-odebrane td { color: var(--muted); }
.status-cell { white-space: nowrap; }
.przebieg { list-style: none; margin: 0; padding: 0; font-size: 13px; color: var(--muted); }
.przebieg li { margin: 1px 0; overflow-wrap: anywhere; }
.przebieg-czas { font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; margin-right: 4px; }
.filters .filter-row + .filter-row { margin-top: -4px; }
.filter-chip-status { font-size: 13px; }
.late-flag {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #f3d19a;
  color: #6e3c06;
  font-size: 11px;
  font-weight: 800;
}
.confirm-btn, .btn-small {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
}
.confirm-btn { background: var(--green); color: #fff; border: none; }
.btn-small { background: #fff; color: var(--green-dark); border: 1px solid var(--line); margin-left: 6px; }
.btn-danger { color: var(--red); }

/* Na telefonie tabela odbiorów zamienia się w karty */
@media (max-width: 640px) {
  .school-body { padding: 14px; }
  .pickup-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .pickup-table tr {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 4px 12px;
    padding: 12px;
    margin-bottom: 10px;
    background: #fff;
    border-radius: 12px;
    box-shadow: var(--shadow-card);
  }
  .pickup-table tr.row-late { background: #fff3df; }
  .pickup-table td { border: none; padding: 0; background: none !important; }
  .pickup-table td.dziecko-cell { grid-column: 1; grid-row: 1; font-size: 17px; }
  .pickup-table td[data-etykieta="Klasa"] { grid-column: 1; grid-row: 2; color: var(--muted); }
  .pickup-table td[data-etykieta="Klasa"]::before { content: "klasa "; }
  .pickup-table td.status-cell { grid-column: 2; grid-row: 1; text-align: right; }
  .pickup-table td.przebieg-cell { grid-column: 1 / span 2; grid-row: 3; }
  .pickup-table td.col-akcja { grid-column: 2; grid-row: 2; }
  .pickup-table td.col-akcja:empty { display: none; }
}

/* Przegląd: kafelki, słupki i mapa ciepła (jeden odcień zieleni, od jasnego do ciemnego) */
:root {
  --heat-1: #e6eee1;
  --heat-2: #c5d8bd;
  --heat-3: #93b58a;
  --heat-4: #4a6b57;
  --heat-5: #2f4a39;
}
.przeglad-h { font-size: 18px; margin: 8px 0 4px; color: var(--green-dark); }
.przeglad-h3 { font-size: 13px; margin: 20px 0 8px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.stat-cards { display: flex; flex-wrap: wrap; gap: 12px; margin: 10px 0; }
.stat-card {
  flex: 1;
  min-width: 150px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}
.stat-card-small { min-width: 110px; }
.stat-num { font-size: 28px; font-weight: 800; line-height: 1.1; color: var(--ink); }
.stat-label { margin-top: 4px; font-size: 13px; font-weight: 600; color: var(--muted); }
.bars {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  height: 170px;
  padding: 0 4px;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
}
.bar-col { flex: 1; min-width: 36px; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; }
.bar-fill { width: 24px; min-height: 2px; background: var(--heat-4); border-radius: 4px 4px 0 0; }
.bar-val { font-size: 13px; font-weight: 800; color: var(--ink); }
.bar-lab { font-size: 12px; font-weight: 700; color: var(--muted); padding-bottom: 4px; }
.heat-legend { display: flex; align-items: center; gap: 4px; margin-bottom: 8px; font-size: 12px; font-weight: 700; color: var(--muted); }
.heat-swatch { width: 22px; height: 12px; border-radius: 3px; }
.heat-wrap { overflow-x: auto; }
.heat-table { border-collapse: separate; border-spacing: 3px; width: auto; min-width: 320px; }
.heat-table th, .heat-table td { border: none; padding: 8px 6px; text-align: center; font-size: 13px; }
.heat-table th[scope="row"] { text-align: left; color: var(--green-dark); font-weight: 800; }
.heat-cell { min-width: 44px; border-radius: 6px; font-weight: 800; background: #f3f1ea; color: var(--muted); }
.heat-1, .heat-swatch.heat-1 { background: var(--heat-1); color: var(--ink); }
.heat-2, .heat-swatch.heat-2 { background: var(--heat-2); color: var(--ink); }
.heat-3, .heat-swatch.heat-3 { background: var(--heat-3); color: var(--ink); }
.heat-4, .heat-swatch.heat-4 { background: var(--heat-4); color: #fff; }
.heat-5, .heat-swatch.heat-5 { background: var(--heat-5); color: #fff; }
.heat-cell.heat-future { background: transparent; border: 1px dashed var(--line); }
.heat-total td, .heat-total th { font-weight: 800; color: var(--ink); border-top: 1px solid var(--line); }

/* Zgoda na pokazywanie odległości (aplikacja rodzica) */
.consent-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  font-size: 14px;
  font-weight: 600;
}
.consent-toggle input { width: 20px; height: 20px; accent-color: var(--green-dark); }
.consent-toggle + .hint { margin-top: 0; margin-bottom: 12px; }
.screen-link input { margin: 8px 0; font-size: 14px; }

/* Ekran w szkole (telewizor zawieszony pionowo, czytany z daleka) */
body.strona-ekranu { background: #fbf9f4; }
body.strona-ekranu main { padding: 0; }
body.strona-ekranu .skip-link { display: none; }
.tv { min-height: 100vh; display: flex; flex-direction: column; }
.tv-header { padding: 4vh 5vw 2vh; text-align: center; background: #fff; border-bottom: 1px solid var(--line); }
.tv-logo { width: min(40vw, 260px); margin: 0 auto 1vh; }
.tv-header h1 { margin: 0; font-size: clamp(28px, 5vw, 64px); font-weight: 800; color: var(--green-dark); }
.tv-body { flex: 1; padding: 3vh 5vw; }
.tv-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 1.5vh; }
.tv-row {
  display: flex;
  align-items: center;
  gap: 3vw;
  padding: 2vh 3vw;
  border-radius: 20px;
  background: #fff;
  box-shadow: var(--shadow-card);
}
.tv-avatar {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: clamp(48px, 9vw, 110px);
  height: clamp(48px, 9vw, 110px);
  border-radius: 50%;
  background: #e6eedd;
  color: var(--green-dark);
  font-size: clamp(22px, 4.5vw, 54px);
  font-weight: 800;
}
/* Stała szerokość kolumny z imieniem: paski wszystkich dzieci zaczynają się w tym samym miejscu,
   więc ich długości da się porównać. */
.tv-who { display: flex; flex-direction: column; flex: 0 0 30%; min-width: 0; }
.tv-who strong { font-size: clamp(22px, 4.5vw, 56px); line-height: 1.1; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tv-who span { font-size: clamp(14px, 2.4vw, 30px); font-weight: 600; color: var(--muted); }
.tv-track { flex: 1; min-width: 20px; display: flex; align-items: center; }
.tv-bar {
  height: clamp(10px, 1.6vw, 20px);
  min-width: 6px;
  border-radius: 999px;
  background-color: var(--amber);
  background-image: linear-gradient(to right, var(--amber) 0%, #c9a24f 25%, #8c9a58 55%, var(--green) 100%);
  background-repeat: no-repeat;
  transition: width 1.5s ease, background-size 1.5s ease;
}
@media (prefers-reduced-motion: reduce) {
  .tv-bar { transition: none; }
}
.tv-status {
  display: inline-block;
  padding: 0.3em 0.9em;
  border-radius: 999px;
  font-size: clamp(16px, 2.8vw, 34px);
  font-weight: 800;
  white-space: nowrap;
}
/* Kolory statusów jak w reszcie aplikacji: wyszło na niebiesko, odebrane na zielono. */
.tv-row-wypuszczone { background: #eef4f8; }
.tv-row-wypuszczone .tv-avatar { background: #d5e4ee; color: #234a61; }
.tv-row-wypuszczone .tv-status { background: #d5e4ee; color: #234a61; }
.tv-row-odebrane { background: var(--green-soft); box-shadow: none; }
.tv-row-odebrane .tv-avatar { background: #d4e2cb; }
.tv-row-odebrane .tv-who strong { color: var(--green-dark); }
.tv-row-odebrane .tv-status { background: #d4e2cb; color: var(--green-dark); }
.tv-distance { flex-shrink: 0; font-size: clamp(16px, 3vw, 38px); font-weight: 800; color: var(--green-dark); white-space: nowrap; }
.tv-distance-blisko { color: #8a4b08; }
.tv-empty { margin-top: 10vh; text-align: center; font-size: clamp(20px, 3.5vw, 44px); font-weight: 700; color: var(--muted); }
.tv-footer { padding: 2vh 5vw 3vh; text-align: center; font-size: clamp(14px, 2vw, 26px); color: var(--muted); border-top: 1px solid var(--line); }

/* Panel admina */
.admin-subnav { display: flex; gap: 8px; margin-bottom: 18px; flex-wrap: wrap; }
.admin-subnav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}
.admin-subnav a[aria-current="page"] { background: var(--green-dark); border-color: var(--green-dark); color: #fff; }
.search-input { max-width: 360px; margin-bottom: 12px; }
form.admin-form { max-width: 460px; }
.email-fieldset { border: none; padding: 0; margin: 14px 0 0; }
.email-fieldset legend { padding: 0; }
.email-row { display: flex; gap: 6px; margin-top: 6px; }
.email-row .btn-small { margin-left: 0; white-space: nowrap; }
.cf-turnstile { margin-top: 12px; }
.btn-remove {
  min-width: 44px;
  min-height: 44px;
  border: none;
  background: none;
  color: var(--red);
  font-size: 22px;
  font-weight: 700;
  cursor: pointer;
}
.btn-secondary {
  width: 100%;
  min-height: 44px;
  margin-top: 8px;
  padding: 10px;
  background: #fff;
  color: var(--green-dark);
  border: 1.5px solid var(--green);
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}
.note-box {
  max-width: 640px;
  margin-top: 18px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--green-soft);
  color: var(--green-dark);
  font-size: 14px;
}

/* Strona błędu */
.error-page {
  max-width: 440px;
  margin: 40px auto;
  text-align: center;
}
.error-page h1 { font-size: 20px; margin: 0 0 10px; }
.error-page a { color: var(--green-dark); font-weight: 700; }
