/* ============================================================
   Zdrowy Fyrtel — główny arkusz stylów
   Paleta i typografia z prototypu, rozbudowana o nowe widoki
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=Inter:wght@400;450;500;600&family=Space+Mono:wght@400;700&display=swap');

/* ---- Tokeny ---- */
:root {
  --ink:        #172029;
  --ink-2:      #3a4754;
  --muted:      #6b7884;
  --line:       #d4dade;
  --line-soft:  #e4e9ed;
  --bg:         #eaeef1;
  --panel:      #ffffff;

  --accent:      #0e6b78;
  --accent-deep: #0a4d57;
  --accent-glow: rgba(14,107,120,.18);

  --alarm:    #d97a1e;
  --alarm-bg: #fbeede;
  --alarm-txt:#9c5610;

  --clear:    #4f8a6b;
  --clear-bg: #e7f1ea;
  --clear-txt:#356048;

  --neutral:    #7a8893;
  --neutral-bg: #eef1f3;

  --radius:  14px;
  --radius-s:  8px;
  --shadow:  0 1px 2px rgba(23,32,41,.06), 0 8px 24px rgba(23,32,41,.06);
  --shadow-lg:0 2px 4px rgba(23,32,41,.07),0 16px 48px rgba(23,32,41,.10);
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Inter', system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.leaflet-control a:hover { text-decoration: none; }
img { max-width: 100%; }

/* ---- Layout ---- */
.wrap      { max-width: 1200px; margin: 0 auto; padding: 20px 18px 60px; }
.wrap-narrow { max-width: 480px; margin: 0 auto; padding: 40px 18px 60px; }

/* ---- Header / Nav ---- */
.site-header {
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 100;
  box-shadow: 0 1px 0 var(--line), var(--shadow);
  /* needed for mobile dropdown positioning */
  isolation: isolate;
}
.nav {
  max-width: 1200px; margin: 0 auto;
  padding: 0 18px;
  display: flex; align-items: center; gap: 18px; height: 58px;
}
.nav-brand {
  display: flex; align-items: center; gap: 10px;
  font-family: 'Space Grotesk', sans-serif; font-weight: 600;
  font-size: 1.05rem; color: var(--ink); letter-spacing: -.01em;
  white-space: nowrap; flex-shrink: 0;
}
.nav-brand .mark {
  width: 34px; height: 34px; border-radius: 9px; flex: none;
  background: radial-gradient(120% 120% at 30% 20%, #15808f 0%, var(--accent-deep) 70%);
  display: grid; place-items: center;
}
.nav-brand .mark svg { width: 18px; height: 18px; }
.nav-links { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.nav-link {
  font-size: .86rem; font-weight: 500; padding: 7px 11px; border-radius: 7px;
  color: var(--ink-2); transition: background .13s, color .13s;
}
.nav-link:hover { background: var(--bg); text-decoration: none; color: var(--ink); }
.nav-link.active { color: var(--accent); background: var(--accent-glow); }
.nav-link.btn {
  background: var(--accent); color: #fff; padding: 7px 14px;
}
.nav-link.btn:hover { background: var(--accent-deep); }

/* ---- Cards ---- */
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card .hd { padding: 14px 16px 0; }
.card-body { padding: 16px; }

.eyebrow {
  font-family: 'Space Mono', monospace; font-size: .68rem;
  letter-spacing: .12em; text-transform: uppercase;
  color: var(--accent); margin: 0 0 3px;
}
.card .hd h2 {
  font-family: 'Space Grotesk', sans-serif; font-weight: 500;
  font-size: 1rem; margin: 0;
}

/* ---- Page titles ---- */
.page-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.6rem; font-weight: 700; letter-spacing: -.02em;
  margin: 0 0 4px; color: var(--ink);
}
.page-sub { color: var(--muted); font-size: .9rem; margin: 0 0 22px; }

/* ---- Stats bar ---- */
.stats-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 14px; margin-bottom: 22px;
}
@media (max-width: 600px) {
  .stat-card-full-mobile { grid-column: 1 / -1; }
}
.stat-card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 14px 16px;
  box-shadow: var(--shadow);
}
.stat-card .k { font-size: .7rem; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.stat-card .v {
  font-family: 'Space Mono', monospace; font-size: 1.7rem;
  font-weight: 700; color: var(--ink); margin: 4px 0 0; line-height: 1;
}
.stat-card .v small { font-size: .82rem; font-weight: 400; color: var(--muted); }
.stat-card.alarm .v { color: var(--alarm); }
.stat-card.clear .v { color: var(--clear); }
.stat-card.accent .v { color: var(--accent); }

/* ---- Map ---- */
#map, #incMap { height: 480px; width: 100%; border-radius: 0 0 var(--radius) var(--radius); z-index: 0; }
#forecast-map, #notif-map { z-index: 0; }
@media (max-width: 860px) { #map, #incMap { height: 300px; } }

.map-hint {
  padding: 10px 16px 12px; color: var(--muted); font-size: .8rem;
  display: flex; flex-wrap: wrap; gap: 12px; align-items: center;
}
.map-hint .dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }

/* Leaflet markers */
.pin-factory { display: grid; place-items: center; }
.pin-factory .body {
  width: 34px; height: 34px; border-radius: 9px; background: var(--ink); color: #fff;
  display: grid; place-items: center;
  box-shadow: 0 4px 12px rgba(23,32,41,.35); border: 2px solid #fff;
}
.pin-factory .body svg { width: 18px; height: 18px; }
.pin-factory .tag {
  margin-top: 3px; font: 600 .6rem/1 'Space Mono', monospace;
  color: #fff; background: var(--ink); padding: 3px 6px; border-radius: 5px; white-space: nowrap;
}
.pin-report { width: 22px; height: 22px; border-radius: 50% 50% 50% 2px; transform: rotate(45deg); border: 2.5px solid #fff; box-shadow: 0 3px 9px rgba(23,32,41,.3); }
.pin-past   { width: 15px; height: 15px; border-radius: 50%; opacity: .85; border: 2px solid #fff; box-shadow: 0 2px 6px rgba(23,32,41,.25); }

/* ---- Compass / readout ---- */
.readout { padding: 16px; }
.readout.empty .live { display: none; }
.placeholder {
  color: var(--muted); font-size: .86rem; padding: 22px 4px;
  text-align: center; border: 1px dashed var(--line); border-radius: 10px;
}
.placeholder svg { width: 26px; height: 26px; color: var(--accent); opacity: .7; margin-bottom: 6px; display: block; margin-inline: auto; }

.compass-row { display: flex; gap: 16px; align-items: center; }
@media (max-width: 380px) { .compass-row { flex-direction: column; align-items: stretch; text-align: center; } }
.compass { width: 152px; height: 152px; flex: none; margin: 0 auto; }
.compass svg { width: 100%; height: 100%; overflow: visible; }
.reduced .rot { transition: none !important; }
.rot { transition: transform .8s cubic-bezier(.22,.61,.36,1); }
.verdict { flex: 1; min-width: 0; }
.verdict .delta { font-family: 'Space Mono', monospace; font-size: 1.05rem; color: var(--ink-2); }

.badge {
  display: inline-flex; align-items: center; gap: 7px; font-weight: 600; font-size: .9rem;
  padding: 8px 12px; border-radius: 9px; margin: 6px 0 8px; line-height: 1.2;
}
.badge .led { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.badge.alarm  { background: var(--alarm-bg);   color: var(--alarm-txt); }
.badge.alarm  .led { background: var(--alarm); }
.badge.clear  { background: var(--clear-bg);   color: var(--clear-txt); }
.badge.clear  .led { background: var(--clear); }
.badge.neutral{ background: var(--neutral-bg); color: #56636e; }
.badge.neutral .led { background: var(--neutral); }
.verdict small { display: block; color: var(--muted); font-size: .78rem; line-height: 1.4; }

.metrics {
  display: grid; grid-template-columns: repeat(2,1fr); gap: 1px;
  background: var(--line-soft); border: 1px solid var(--line-soft);
  border-radius: 10px; overflow: hidden; margin-top: 14px;
}
.metric { background: #fff; padding: 10px 12px; }
.metric .k { font-size: .68rem; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.metric .v { font-family: 'Space Mono', monospace; font-size: 1.02rem; color: var(--ink); margin-top: 2px; }
.metric .v small { font-size: .72rem; color: var(--muted); font-weight: 400; }
.wx-note { margin-top: 10px; font-size: .76rem; color: var(--alarm); display: none; }
.wx-note.show { display: block; }

/* ---- Form elements ---- */
form { display: flex; flex-direction: column; gap: 15px; }
.field > label {
  display: block; font-weight: 600; font-size: .82rem; margin-bottom: 7px; color: var(--ink-2);
}
.field > label .req { color: var(--alarm); }

input[type="text"],
input[type="email"],
input[type="password"],
input[type="url"],
input[type="date"],
select,
textarea {
  width: 100%; font: 450 .9rem 'Inter', sans-serif; color: var(--ink);
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-s);
  padding: 10px 11px; appearance: none;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
textarea { resize: vertical; min-height: 80px; }
input[type="date"] { padding: 8px 11px; color: var(--ink); }
input[type="date"]::-webkit-datetime-edit { color: var(--muted); }
input[type="date"]:not(:placeholder-shown)::-webkit-datetime-edit,
input[type="date"][value]:not([value=""])::-webkit-datetime-edit { color: var(--ink); }

.seg { display: flex; flex-wrap: wrap; gap: 7px; }
.seg button, .scale button {
  font: 500 .82rem/1 'Inter', sans-serif; color: var(--ink-2);
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-s);
  padding: 9px 12px; cursor: pointer;
  transition: border-color .15s, background .15s, color .15s;
}
.seg button:hover, .scale button:hover { border-color: var(--accent); }
.seg button[aria-pressed="true"]   { background: var(--accent); border-color: var(--accent); color: #fff; }

.scale { display: grid; grid-template-columns: repeat(5,1fr); gap: 7px; }
.scale button { padding: 9px 0; font-family: 'Space Mono', monospace; font-weight: 700; text-align: center; }
.scale button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.scale-legend { display: flex; justify-content: space-between; font-size: .7rem; color: var(--muted); margin-top: 5px; }
.intensity-desc { margin: 10px 0 6px; padding-left: 0; list-style: none; display: flex; flex-direction: column; gap: 3px; font-size: .78rem; color: var(--muted); }
.intensity-desc li strong { color: var(--text); font-variant-numeric: tabular-nums; }
.intensity-note { font-size: .74rem; color: var(--muted); margin: 6px 0 0; line-height: 1.5; font-style: italic; }

.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 400px) { .row2 { grid-template-columns: 1fr; } }

.stamp {
  font-family: 'Space Mono', monospace; font-size: .8rem; color: var(--ink-2);
  background: var(--neutral-bg); border: 1px solid var(--line-soft); border-radius: var(--radius-s);
  padding: 9px 11px; display: flex; justify-content: space-between; align-items: center;
}
.stamp span:first-child { color: var(--muted); }

.err  { color: var(--alarm);  font-size: .8rem; font-weight: 500; min-height: 1em; }
.ok   { color: var(--clear);  font-size: .8rem; font-weight: 500; min-height: 1em; }
.info { color: var(--accent);  font-size: .8rem; min-height: 1em; }

/* ---- Buttons ---- */
.btn-primary {
  font: 600 .95rem 'Inter', sans-serif; color: #fff; background: var(--accent);
  border: none; border-radius: 10px; padding: 13px; cursor: pointer;
  transition: background .15s, box-shadow .15s; width: 100%;
}
.btn-primary:hover   { background: var(--accent-deep); box-shadow: 0 4px 18px var(--accent-glow); }
.btn-primary:disabled { background: #9fb3b7; cursor: not-allowed; box-shadow: none; }

.btn-sm {
  font: 500 .8rem 'Inter', sans-serif; padding: 6px 12px; border-radius: 7px;
  border: 1px solid var(--line); background: #fff; cursor: pointer; color: var(--ink-2);
  transition: border-color .13s, background .13s;
}
.btn-sm:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.btn-sm.approve { border-color: var(--clear);  color: var(--clear-txt); }
.btn-sm.approve:hover { background: var(--clear-bg); }
.btn-sm.reject  { border-color: var(--alarm);  color: var(--alarm-txt); }
.btn-sm.reject:hover  { background: var(--alarm-bg); }
.btn-sm.danger  { border-color: #e25f5f; color: #c03030; }
.btn-sm.danger:hover  { background: #fdf0f0; }

/* ---- Chips ---- */
.chip {
  font-size: .68rem; font-weight: 600; padding: 3px 8px; border-radius: 999px; white-space: nowrap;
}
.chip.alarm   { background: var(--alarm-bg);   color: var(--alarm-txt); }
.chip.clear   { background: var(--clear-bg);   color: var(--clear-txt); }
.chip.neutral { background: var(--neutral-bg); color: #56636e; }
.chip.pending { background: #fef9e7; color: #9c7a10; border: 1px solid #f0d97a; }

/* ---- Table ---- */
.tbl { width: 100%; border-collapse: collapse; font-size: .875rem; }
.tbl th {
  font-family: 'Space Mono', monospace; font-size: .68rem; letter-spacing: .06em;
  text-transform: uppercase; color: var(--muted); font-weight: 400;
  padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line);
  background: #f8fafb; position: sticky; top: 0;
}
.tbl td { padding: 10px 12px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: none; }
.tbl-row-link { cursor: pointer; transition: background .12s; }
.tbl-row-link:hover td { background: var(--bg); }
.tbl-row-link.active-row td { background: #e8f4f6; }
.tbl-row-link.new-row td { background: #e8f4f6; }

.btn-delete {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; padding: 0; border-radius: 7px;
  border: 1px solid transparent; background: none;
  color: var(--muted); cursor: pointer;
  transition: background .13s, color .13s, border-color .13s;
}
.btn-delete:hover {
  background: #fdf0f0; color: #c03030; border-color: #f0c0c0;
}
.tbl tr:hover td { background: #f5f9fa; }

/* ---- Log list ---- */
.log-list { list-style: none; margin: 0; padding: 0 8px 8px; }
.log-item { display: flex; align-items: center; gap: 11px; padding: 11px 8px; border-top: 1px solid var(--line-soft); transition: background .15s; }
.log-item-link:hover { background: var(--bg-soft, #f5f7fa); }
.log-item-link.active-row { background: #e8f4f6; }
.log-item .swatch { width: 11px; height: 11px; border-radius: 3px; flex: none; }
.log-item .meta { flex: 1; min-width: 0; }
.log-item .meta .t { font-weight: 600; font-size: .85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.log-item .meta .s { font-family: 'Space Mono', monospace; font-size: .72rem; color: var(--muted); }
.log-empty { color: var(--muted); font-size: .83rem; padding: 20px; text-align: center; }

/* ---- Auth pages ---- */
.auth-wrap {
  min-height: calc(100vh - 60px);
  display: flex; align-items: center; justify-content: center;
  padding: 30px 18px;
}
.auth-card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
  padding: 36px 32px; width: 100%; max-width: 420px;
}
.auth-card h1 {
  font-family: 'Space Grotesk', sans-serif; font-size: 1.4rem;
  font-weight: 700; letter-spacing: -.015em; margin: 0 0 4px;
}
.auth-card .sub { color: var(--muted); font-size: .86rem; margin: 0 0 26px; }
.auth-footer { margin-top: 18px; text-align: center; font-size: .83rem; color: var(--muted); }

/* ---- Alert boxes ---- */
.alert {
  padding: 12px 14px; border-radius: 9px; font-size: .86rem;
  display: flex; gap: 10px; align-items: flex-start; line-height: 1.45;
  margin-bottom: 16px;
}
.alert svg { flex: none; width: 18px; height: 18px; margin-top: 1px; }
.alert.error   { background: var(--alarm-bg);   color: var(--alarm-txt); border: 1px solid #f0c090; }
.alert.success { background: var(--clear-bg);   color: var(--clear-txt); border: 1px solid #b0d8c0; }
.alert.info    { background: #e8f4f6; color: var(--accent-deep); border: 1px solid #b0d8e0; }
.alert.warning { background: #fef9e7; color: #7a6010; border: 1px solid #f0d97a; }

/* ---- Dashboard grid ---- */
.dash-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 18px; align-items: start; }
@media (max-width: 900px) { .dash-grid { grid-template-columns: 1fr; } }

.stack { display: flex; flex-direction: column; gap: 18px; }

/* ---- Filter bar ---- */
.filter-bar {
  display: flex; flex-direction: row; flex-wrap: wrap;
  gap: 12px; align-items: flex-end; margin-bottom: 18px;
}
.filter-bar .ff {
  display: flex; flex-direction: column; gap: 5px;
  flex: 1; min-width: 130px;
}
.filter-bar .ff label {
  font-size: .78rem; font-weight: 600; color: var(--muted);
}
.filter-bar select,
.filter-bar input[type="date"] {
  height: 38px; padding: 0 10px; font-size: .85rem; width: 100%;
}

/* Date input: iOS-compatible, same look as selects */
.filter-bar input[type="date"] {
  -webkit-appearance: none;
  appearance: none;
  background: #fff !important;
  border: 1px solid var(--line) !important;
  border-radius: var(--radius-s) !important;
  box-shadow: none !important;
  outline: none !important;
  color: var(--ink);
  font: 450 .9rem 'Inter', sans-serif;
  /* prevent iOS from making it too wide */
  min-width: 0;
}
.filter-bar input[type="date"]::-webkit-datetime-edit-fields-wrapper { padding: 0; }
.filter-bar input[type="date"]::-webkit-datetime-edit-day-field:focus,
.filter-bar input[type="date"]::-webkit-datetime-edit-month-field:focus,
.filter-bar input[type="date"]::-webkit-datetime-edit-year-field:focus {
  background: var(--neutral-bg);
  color: var(--ink);
  border-radius: 3px;
}
.filter-bar input[type="date"]::-webkit-calendar-picker-indicator {
  opacity: .5; cursor: pointer;
}

@media (max-width: 680px) {
  .filter-bar .ff:has(input[type="date"]) {
    flex: 1 1 calc(50% - 6px); max-width: calc(50% - 6px);
  }
}
.btn-filter {
  height: 38px; padding: 0 16px; white-space: nowrap;
  font: 600 .85rem 'Inter', sans-serif; border: none; border-radius: 8px;
  cursor: pointer; transition: background .15s, box-shadow .15s; align-self: flex-end;
}
.btn-filter.submit {
  background: var(--accent); color: #fff;
}
.btn-filter.submit:hover { background: var(--accent-deep); box-shadow: 0 4px 12px var(--accent-glow); }
.btn-filter.clear {
  background: #6e1a2c; color: #fff; text-decoration: none;
  display: inline-flex; align-items: center;
}
.btn-filter.clear:hover { background: #55132199; }

/* ---- Pagination ---- */
.pagination { display: flex; gap: 6px; align-items: center; justify-content: center; padding: 16px 0; }
.page-btn {
  font-family: 'Space Mono', monospace; font-size: .8rem; padding: 6px 12px;
  border: 1px solid var(--line); border-radius: 7px; background: #fff; cursor: pointer;
  color: var(--ink-2); transition: border-color .13s;
}
.page-btn:hover { border-color: var(--accent); color: var(--accent); }
.page-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.page-btn:disabled { opacity: .4; cursor: not-allowed; }

/* ---- Footer ---- */
.site-footer {
  border-top: 1px solid var(--line); margin-top: 40px; padding: 20px 18px;
  color: var(--muted); font-size: .76rem; line-height: 1.6;
  max-width: 1200px; margin-inline: auto;
}
.site-footer b { color: var(--ink-2); }

/* ---- Utilities ---- */
.text-muted  { color: var(--muted); }
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.mb-4 { margin-bottom: 4px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.gap-8  { gap: 8px; }
.flex   { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.w-full { width: 100%; }

/* ---- Pending / waiting screen ---- */
.pending-wrap {
  min-height: calc(100vh - 60px);
  display: flex; align-items: center; justify-content: center; padding: 30px 18px;
}
.pending-card {
  text-align: center; max-width: 400px; padding: 40px 32px;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
}
.pending-card .icon {
  width: 56px; height: 56px; border-radius: 14px; background: #fef9e7;
  display: grid; place-items: center; margin: 0 auto 18px;
  border: 1px solid #f0d97a;
}
.pending-card h2 { font-family: 'Space Grotesk', sans-serif; font-size: 1.25rem; margin: 0 0 8px; }
.pending-card p  { color: var(--muted); font-size: .88rem; margin: 0; line-height: 1.55; }

/* ---- Spinner ---- */
.spinner {
  width: 18px; height: 18px; border: 2.5px solid rgba(255,255,255,.35);
  border-top-color: #fff; border-radius: 50%;
  animation: spin .7s linear infinite; display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- Hamburger button ---- */
.hamburger {
  display: none;
  flex-direction: column; justify-content: center; align-items: center;
  gap: 5px; width: 40px; height: 40px; padding: 0;
  background: none; border: none; cursor: pointer; margin-left: auto; flex-shrink: 0;
}
.hamburger span {
  display: block; width: 22px; height: 2px;
  background: var(--ink); border-radius: 2px;
  transition: transform .25s, opacity .25s;
  transform-origin: center;
}
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---- Responsive nav ---- */
@media (max-width: 680px) {
  .hamburger { display: flex; }
  .hamburger-cta {
    display: flex;
    padding: 0 12px; font-size: .82rem;
    height: 34px; margin-right: 6px;
  }

  .nav-links {
    display: none;
    position: absolute; top: 58px; left: 0; right: 0;
    background: var(--panel);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 8px 24px rgba(23,32,41,.10);
    flex-direction: column; align-items: stretch;
    padding: 8px 12px 14px; gap: 2px; z-index: 200;
  }
  .nav-links.open { display: flex; }

  .nav-link {
    padding: 11px 14px; border-radius: 9px;
    font-size: .95rem;
  }
  .nav-link.btn, .nav-link.nav-cta {
    margin-top: 6px; text-align: center; padding: 12px 14px;
  }
  .nav-cta { display: block; }
}

@media (min-width: 681px) {
  .hamburger      { display: none !important; }
  .hamburger-cta  { display: none !important; }
  .nav-links      { display: flex !important; }
}


/* ---- Pending account banner ---- */
.pending-banner {
  display: flex; align-items: center; gap: 8px;
  background: #fef9e7; color: #7a6010;
  border-bottom: 1px solid #f0d97a;
  font-size: .82rem; font-weight: 500;
  padding: 9px 18px;
}

/* ---- PWA install banner ---- */
#pwa-banner {
  position: fixed; bottom: 72px; left: 12px; right: 12px; z-index: 400;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(23,32,41,.18);
  overflow: hidden;
  animation: pwa-slide-up .3s ease;
}
@keyframes pwa-slide-up {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
.pwa-banner-inner {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px;
}
.pwa-banner-icon {
  width: 40px; height: 40px; border-radius: 10px; flex-shrink: 0;
  background: radial-gradient(120% 120% at 30% 20%, #15808f 0%, var(--accent-deep) 70%);
  display: grid; place-items: center;
}
.pwa-banner-icon svg { width: 20px; height: 20px; }
.pwa-banner-text {
  flex: 1; display: flex; flex-direction: column; gap: 1px; min-width: 0;
}
.pwa-banner-text strong { font-size: .88rem; color: var(--ink); }
.pwa-banner-text span   { font-size: .75rem; color: var(--muted); }
.pwa-btn-install {
  flex-shrink: 0;
  background: var(--accent); color: #fff;
  border: none; border-radius: 9px;
  padding: 8px 14px; font: 600 .82rem 'Inter', sans-serif;
  cursor: pointer; white-space: nowrap;
  transition: background .15s;
}
.pwa-btn-install:hover { background: var(--accent-deep); }
.pwa-btn-close {
  flex-shrink: 0; width: 30px; height: 30px;
  background: none; border: none; cursor: pointer;
  color: var(--muted); display: grid; place-items: center;
  border-radius: 50%; padding: 0;
}
.pwa-btn-close:hover { background: var(--bg); color: var(--ink); }
.pwa-btn-close svg { width: 16px; height: 16px; }
.pwa-ios-hint {
  font-size: .80rem; color: var(--ink-2); line-height: 1.5;
  padding: 10px 14px 14px;
  border-top: 1px solid var(--line-soft);
  background: var(--bg);
}

@media (min-width: 681px) {
  #pwa-banner { display: none !important; }
}

/* ---- Mobile bottom nav ---- */
.mobile-bottom-nav {
  display: none;
}

@media (max-width: 680px) {
  /* Push page content above bottom nav */
  body { padding-bottom: 68px; }

  .mobile-bottom-nav {
    display: flex;
    position: fixed; bottom: 0; left: 0; right: 0;
    height: 64px;
    background: var(--panel);
    border-top: 1px solid var(--line);
    box-shadow: 0 -4px 16px rgba(23,32,41,.08);
    z-index: 300;
    /* safe area for iPhone home bar */
    padding-bottom: env(safe-area-inset-bottom);
    height: calc(64px + env(safe-area-inset-bottom));
  }

  .mbn-item {
    flex: 1; display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    gap: 4px; text-decoration: none;
    color: var(--muted); font-size: .68rem; font-weight: 600;
    letter-spacing: .01em;
    transition: color .15s;
    -webkit-tap-highlight-color: transparent;
  }
  .mbn-item svg { width: 22px; height: 22px; flex-shrink: 0; }
  .mbn-item.active { color: var(--accent); }
  .mbn-item:hover  { color: var(--accent); }
.mbn-item.mbn-logout { color: #6e1a2c; }
.mbn-item.mbn-logout:hover { color: #4a0f1d; }

  /* Central CTA button */
  .mbn-cta { color: var(--accent); }
  .mbn-cta-icon {
    width: 46px; height: 46px; border-radius: 50%;
    background: var(--accent); color: #fff;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 14px rgba(30,110,124,.40);
    margin-top: -18px;
    transition: background .15s, transform .15s;
  }
  .mbn-cta-icon svg { width: 22px; height: 22px; stroke: #fff; }
  .mbn-cta:hover .mbn-cta-icon,
  .mbn-cta.active .mbn-cta-icon { background: var(--accent-deep); transform: scale(1.07); }

  .mbn-cta-disabled { opacity: .45; pointer-events: none; }
  .mbn-cta-disabled .mbn-cta-icon { background: var(--muted); box-shadow: none; }
}

/* Source info box */
.source-info-box summary::-webkit-details-marker { display: none; }
details.source-info-box[open] .details-chevron { transform: rotate(180deg); }




/* Remove focus outline on map and overlay buttons */
#map:focus, #incMap:focus,
#map button:focus, #incMap button:focus,
.leaflet-container:focus { outline: none; }

/* ---- Cookie consent banner ---- */
#cookie-banner {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 9999;
  background: var(--panel);
  border-top: 1px solid var(--line);
  box-shadow: 0 -2px 12px rgba(0,0,0,.10);
  padding: 14px 16px;
}
/* Unieś baner nad dolną nawigację mobilną */
@media (max-width: 640px) {
  #cookie-banner { bottom: 60px; }
}
.cookie-banner-inner {
  max-width: 860px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.cookie-banner-text {
  flex: 1;
  min-width: 220px;
  font-size: .85rem;
  color: var(--ink-2);
  margin: 0;
  line-height: 1.5;
}
.cookie-banner-link {
  color: var(--accent);
  text-decoration: underline;
  white-space: nowrap;
}
.cookie-banner-btns {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}
.cookie-btn {
  padding: 7px 18px;
  border-radius: 8px;
  border: 1px solid transparent;
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .13s, color .13s;
}
.cookie-btn-accept {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.cookie-btn-accept:hover { background: var(--accent-deep); border-color: var(--accent-deep); }
.cookie-btn-decline {
  background: transparent;
  color: var(--muted);
  border-color: var(--line);
}
.cookie-btn-decline:hover { background: var(--bg); color: var(--ink-2); }

/* ---- Archive ---- */
.archive-list { display: flex; flex-direction: column; gap: 14px; }
.archive-card {
  background: var(--panel);
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  padding: 18px 20px;
}
.archive-entry-header { margin-bottom: 8px; }
.archive-type-badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: .72rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: .06em; color: var(--accent);
  background: var(--accent-glow); border-radius: 5px;
  padding: 3px 8px;
}
.archive-verified-badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: .72rem; font-weight: 600; color: var(--clear);
  background: var(--clear-bg); border-radius: 5px;
  padding: 3px 8px;
}
.archive-date {
  font-size: .78rem; color: var(--muted); font-weight: 500;
}
.archive-source {
  font-size: .78rem; color: var(--ink-2); font-weight: 600;
  background: var(--bg); border-radius: 4px; padding: 2px 7px;
}
.archive-entry-title {
  font-size: 1rem; font-weight: 700; margin: 6px 0 8px; line-height: 1.4;
  color: var(--ink);
}
.archive-entry-desc {
  font-size: .88rem; color: var(--ink-2); line-height: 1.6; margin: 0 0 10px;
}
.archive-entry-meta {
  display: flex; align-items: center; gap: 5px;
  font-size: .78rem; color: var(--muted); margin-bottom: 8px;
}
.archive-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.archive-tag {
  font-size: .72rem; background: var(--bg); color: var(--ink-2);
  border: 1px solid var(--line); border-radius: 20px;
  padding: 2px 9px; text-decoration: none; transition: background .12s;
}
.archive-tag:hover { background: var(--accent-glow); color: var(--accent); border-color: var(--accent); }
.archive-source-btn {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: .82rem; font-weight: 600; padding: 7px 14px;
  border-radius: 8px; text-decoration: none;
  background: var(--accent); color: #fff;
  border: 1px solid var(--accent);
  transition: background .13s;
}
.archive-source-btn:hover { background: var(--accent-deep); }
.archive-source-btn-alt {
  background: transparent; color: var(--accent);
  border-color: var(--accent);
}
.archive-source-btn-alt:hover { background: var(--accent-glow); }
.filter-label {
  display: block; font-size: .72rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: .05em;
  color: var(--muted); margin-bottom: 4px;
}
.btn-sm-active {
  background: var(--accent); color: #fff !important;
  border-color: var(--accent) !important;
}

/* Timeline */
.archive-timeline { position: relative; padding-left: 40px; }
.archive-timeline::before {
  content: ''; position: absolute; left: 10px; top: 0; bottom: 0;
  width: 2px; background: var(--line);
}
.archive-timeline-year {
  font-size: 1.1rem; font-weight: 700; color: var(--accent);
  margin: 24px 0 14px 0;
}
.archive-timeline-item { position: relative; margin-bottom: 18px; }
.archive-timeline-dot {
  position: absolute; left: -35px; top: 4px;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--accent); border: 2px solid var(--bg);
  box-shadow: 0 0 0 2px var(--accent);
}
.archive-timeline-date {
  font-size: .75rem; color: var(--muted); font-weight: 600;
  margin-bottom: 6px; text-transform: uppercase; letter-spacing: .05em;
}
input[type="date"]::-webkit-datetime-edit-fields-wrapper { background: transparent; }
input[type="date"]::-webkit-datetime-edit-day-field:focus,
input[type="date"]::-webkit-datetime-edit-month-field:focus,
input[type="date"]::-webkit-datetime-edit-year-field:focus {
  background: var(--bg);
  color: var(--ink);
  outline: none;
}

/* Pale/desaturated OSM tiles so map icons stand out */
.leaflet-tile-pane {
  filter: grayscale(0.15) brightness(1.2) saturate(0.25) contrast(0.8);
}
