/* Tripplaner27: jasno, lekko, spokojnie. Ciepłe neutralne tła, cienkie linie, jeden akcent (szałwia).
   Mobile first: dolna nawigacja na telefonie, zakładki u góry od 760 px. Wszystkie kolory to tokeny poniżej. */

:root {
  --bg: #F0EDE7;
  --card: #FFFFFF;
  --btn-bg: #F3F0EA;
  --btn-border: rgba(70, 55, 40, .30);
  --card-shadow: 0 1px 2px rgba(60, 45, 30, .08), 0 2px 8px rgba(60, 45, 30, .05);
  --surface: #FFFFFF;
  --panel: #F2EFEA;          /* miękkie wypełnienia, hover */
  --ink: #2E2A26;
  --ink-soft: #4A443D;
  --muted: #716A61;          /* 5:1 na białym */
  --line: rgba(70, 55, 40, .10);
  --line-strong: rgba(70, 55, 40, .18);
  --divider: rgba(70, 55, 40, .22);     /* pionowa linia między kolumnami osób */
  --accent: #3F7A68;         /* jedyny akcent */
  --accent-ink: #FFFFFF;
  --accent-bg: #E7F1ED;
  --accent-text: #2C5E4F;
  --accent-strong: #24503F;
  --go: var(--accent-text);
  --no: #B4513E;
  --no-bg: #FBEDE9;
  --must: #A2622A;
  --warn-bg: #FBF1E4;        /* "sprawdź": zgadnięta lokalizacja oferty */
  --route: #D0342C;          /* linie trasy: czerwone dla widoczności */
  --route-strong: #8E1F19;   /* wybrany odcinek */
  --me: #2F76D2;             /* kropka "Moja lokalizacja" */
  --ph-bg: #EEEAE4;
  --ph-ink: #9A9288;
  --overlay: rgba(40, 32, 24, .32);
  --shadow: 0 1px 2px rgba(60, 45, 30, .04), 0 2px 10px rgba(60, 45, 30, .05);
  --shadow-lg: 0 12px 36px rgba(50, 38, 25, .16);
  --p1: #C8664B; --p2: #4C7DBA; --p3: #B08632; --p4: #8A6BC2;
  --p5: #C2558F; --p6: #2A8BA6; --p7: #6E8228; --p8: #5F6B7A; /* róż, cyjan, oliwka, łupek: z dala od szałwii i czerwieni trasy */
  --tile-filter: saturate(.85);

  --f: "Nunito Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --r: 14px;
  --r-sm: 10px;
  --tap: 44px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #1D1C1A; --surface: #262421; --panel: #2F2C28; --card: #34312C; --route: #F2675C; --route-strong: #FFA59C; --me: #6FA8F0; --btn-bg: #423E37; --btn-border: rgba(255, 240, 220, .26); --card-shadow: 0 1px 3px rgba(0, 0, 0, .35); --ink: #EAE5DD; --ink-soft: #D3CCC2; --muted: #A9A196;
    --line: rgba(255, 240, 220, .08); --line-strong: rgba(255, 240, 220, .15); --divider: rgba(255, 240, 220, .2);
    --accent: #86C2AE; --accent-ink: #13201B; --accent-bg: #22342D; --accent-text: #A9D9C8; --accent-strong: #C4E8DB;
    --no: #EB8C78; --no-bg: #3A2621; --must: #E0A866; --warn-bg: #3A2E1F;
    --ph-bg: #302D29; --ph-ink: #8C8479;
    --overlay: rgba(0, 0, 0, .5);
    --shadow: 0 1px 2px rgba(0, 0, 0, .25); --shadow-lg: 0 12px 36px rgba(0, 0, 0, .45);
    --p1: #E58A72; --p2: #86AADF; --p3: #D6B062; --p4: #B49CE4;
    --p5: #E88BBE; --p6: #6CC3D9; --p7: #B3C566; --p8: #A6B2C2;
    --tile-filter: brightness(.72) contrast(.95) saturate(.55);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #1D1C1A; --surface: #262421; --panel: #2F2C28; --card: #34312C; --route: #F2675C; --route-strong: #FFA59C; --me: #6FA8F0; --btn-bg: #423E37; --btn-border: rgba(255, 240, 220, .26); --card-shadow: 0 1px 3px rgba(0, 0, 0, .35); --ink: #EAE5DD; --ink-soft: #D3CCC2; --muted: #A9A196;
  --line: rgba(255, 240, 220, .08); --line-strong: rgba(255, 240, 220, .15); --divider: rgba(255, 240, 220, .2);
  --accent: #86C2AE; --accent-ink: #13201B; --accent-bg: #22342D; --accent-text: #A9D9C8; --accent-strong: #C4E8DB;
  --no: #EB8C78; --no-bg: #3A2621; --must: #E0A866; --warn-bg: #3A2E1F;
  --ph-bg: #302D29; --ph-ink: #8C8479;
  --overlay: rgba(0, 0, 0, .5);
  --shadow: 0 1px 2px rgba(0, 0, 0, .25); --shadow-lg: 0 12px 36px rgba(0, 0, 0, .45);
  --p1: #E58A72; --p2: #86AADF; --p3: #D6B062; --p4: #B49CE4;
  --p5: #E88BBE; --p6: #6CC3D9; --p7: #B3C566; --p8: #A6B2C2;
  --tile-filter: brightness(.72) contrast(.95) saturate(.55);
}

/* ---------- podstawy ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
html { overflow: hidden; } /* przewijają się widoki, nie strona: brak poziomego przesuwania całości i "gumki" na iOS */
body { background: var(--bg); color: var(--ink); font: 400 16.5px/1.6 var(--f); -webkit-text-size-adjust: 100%; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; line-height: 1.3; }
button { cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
button:disabled { cursor: default; opacity: .6; }
a { color: inherit; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { font-weight: 700; line-height: 1.3; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 14.5px; }
.opt { font-weight: 400; color: var(--muted); }
svg.i { width: 20px; height: 20px; flex: none; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; flex: none; background: var(--pc, var(--muted)); }
.grow { flex: 1; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 3000; background: var(--surface); padding: 8px 12px; border-radius: var(--r-sm); }
.skip:focus { left: 8px; }

/* ---------- przyciski i pola ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--tap); padding: 0 18px; border-radius: var(--r-sm);
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink);
  font-weight: 600; font-size: 15.5px; text-decoration: none; white-space: nowrap;
}
.btn:hover { background: var(--panel); }
.btn.primary { background: var(--accent); border-color: transparent; color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.danger { background: var(--no); border-color: transparent; color: #fff; }
.btn.big { min-height: 52px; font-size: 16.5px; width: 100%; }
.icon-btn {
  display: inline-grid; place-items: center; width: var(--tap); height: var(--tap); flex: none;
  border: 0; border-radius: var(--r-sm); background: none; color: var(--muted);
}
.icon-btn:hover { background: var(--panel); color: var(--ink); }
.linklike { border: 0; background: none; padding: 8px 4px; min-height: 40px; color: var(--muted); font-weight: 600; text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 4px; }
.linklike:hover { color: var(--ink); text-decoration-color: currentColor; }

.field { display: flex; flex-direction: column; gap: 6px; font-size: 14.5px; font-weight: 600; color: var(--ink-soft); }
.field input, .field select, .field textarea, .big-input, .inline-form input {
  width: 100%; min-height: var(--tap); padding: 10px 14px;
  border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: var(--surface); color: var(--ink);
  font-size: 16.5px; font-weight: 400;
}
.field textarea { resize: vertical; line-height: 1.5; }
.field input:focus, .field select:focus, .field textarea:focus, .big-input:focus, .inline-form input:focus { outline: 0; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-bg); }
.big-input { min-height: 54px; font-size: 17.5px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-error { color: var(--no); font-size: 15px; font-weight: 600; }
.hint { color: var(--muted); font-size: 14.5px; }
.field-l { font-size: 14.5px; font-weight: 600; color: var(--ink-soft); margin-bottom: -10px; }
.row-btns { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

.seg { display: inline-flex; gap: 2px; padding: 3px; border-radius: 999px; background: var(--panel); flex-wrap: nowrap; }
.seg.wrap { flex-wrap: wrap; border-radius: var(--r-sm); }
.seg button {
  min-height: 40px; padding: 0 16px; border: 0; border-radius: 999px; background: none; color: var(--ink-soft);
  font-size: 15px; font-weight: 600; white-space: nowrap;
}
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--accent-text); box-shadow: var(--shadow); }
.chip {
  min-height: 40px; padding: 0 15px; border-radius: 999px;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink-soft);
  font-size: 15px; font-weight: 600; display: inline-flex; align-items: center; gap: 8px; white-space: nowrap;
}
.chip:hover { background: var(--panel); }
.chip[aria-pressed="true"] { background: var(--accent-bg); border-color: transparent; color: var(--accent-text); }
.chip.ghost { border-style: dashed; color: var(--muted); background: none; }

/* ---------- szkielet ---------- */
/* 100dvh: wysokość widocznego obszaru (paski Safari / Chrome), dolna nawigacja zawsze w kadrze */
#app { height: 100%; height: 100dvh; display: grid; grid-template-rows: auto 1fr auto; }
.top {
  display: flex; align-items: center; gap: 8px; padding: 10px 16px; background: var(--surface); border-bottom: 1px solid var(--line);
  padding-top: max(10px, env(safe-area-inset-top)); padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right));
}
/* lewy górny róg: ikona podróży (max 40×160, proporcje zachowane) + nazwa; otwiera przełącznik podróży */
.trip-btn {
  display: inline-flex; align-items: center; gap: 10px; min-height: var(--tap); min-width: 0; max-width: 60%; flex: 0 1 auto;
  padding: 2px 8px 2px 4px; margin-left: -4px; border: 0; border-radius: var(--r-sm); background: none; color: var(--ink); text-align: left;
}
.trip-btn:hover { background: var(--panel); }
.trip-ico { display: block; flex: none; width: auto; height: auto; max-height: 40px; max-width: 160px; object-fit: contain; }
.trip-name { font-size: 17px; font-weight: 700; line-height: 1.25; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trip-btn svg { width: 18px; height: 18px; color: var(--muted); }
@media (max-width: 419px) { .trip-ico { max-width: 96px; max-height: 34px; } .trip-name { font-size: 16px; } }
.tabs { display: none; }
.who { margin-left: auto; display: flex; align-items: center; gap: 10px; font-size: 14.5px; color: var(--muted); min-width: 0; }
/* przycisk profilu: pigułka z kropką, imieniem i zębatką */
.me-btn {
  display: inline-flex; align-items: center; gap: 8px; min-height: var(--tap); max-width: 100%; padding: 0 12px 0 14px;
  border: 1px solid var(--btn-border); border-radius: 999px; background: var(--btn-bg); color: var(--ink);
  font-size: 15px; font-weight: 700; white-space: nowrap;
}
.me-btn .dot { width: 12px; height: 12px; }
.me-btn .me-name { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.me-btn svg { width: 18px; height: 18px; color: var(--muted); }
.me-btn:hover { border-color: var(--ink-soft); }
.me-btn:hover svg { color: var(--ink); }
.me-btn:empty { display: none; }
.net { background: var(--no-bg); color: var(--no); padding: 4px 12px; border-radius: 999px; font-size: 13.5px; font-weight: 600; white-space: nowrap; }

.bottom { display: flex; background: var(--surface); border-top: 1px solid var(--line); padding: 0 env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }
.tab { border: 0; background: none; color: var(--muted); font-weight: 600; display: flex; align-items: center; justify-content: center; gap: 6px; }
.bottom .tab { flex: 1 1 0; min-width: 0; flex-direction: column; gap: 3px; min-height: 60px; font-size: 12.5px; padding: 6px 1px; }
.bottom .tab span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* 8 zakładek (7 z podpisem + ikona ustawień). Pełne nazwy ("Propozycje", "Restauracje") mieszczą się dopiero od
   ~560 px; węziej krótkie etykiety (Pomysły, Jedzenie, Plan) i mniejsza czcionka, nigdy ucięty podpis */
.bottom .tab svg { width: 23px; height: 23px; }
/* Ustawienia na dolnym pasku: sama ikona w wąskim polu, reszta dzieli się miejscem */
.bottom .tab.tab-ico { flex: 0 0 48px; }
.bottom .tab.tab-ico svg { width: 24px; height: 24px; }
.tab[aria-current="page"] { color: var(--accent-text); }
/* krótsza etykieta na węższym telefonie; czytnik ekranu dostaje pełną z .l-full */
.bottom .tab .l-short { display: none; }
@media (max-width: 559px) {
  .bottom .tab { position: relative; font-size: 11px; letter-spacing: -.01em; }
  .bottom .tab svg { width: 22px; height: 22px; }
  .bottom .tab .l-short { display: inline; }
  .bottom .tab .l-full { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}
/* 360-399 px: 7 podpisów po ~45 px ("Jedzenie" ~40 px przy 10 px), pole ustawień 44 px */
@media (max-width: 399px) {
  .bottom .tab { font-size: 10px; letter-spacing: -.02em; padding: 6px 0; }
  .bottom .tab.tab-ico { flex-basis: var(--tap); }
}
/* bez podróży (ekran powitalny): bez zakładek */
body.no-trip .tabs, body.no-trip .bottom { display: none; }

main { position: relative; min-height: 0; outline: none; }
.view { position: absolute; inset: 0; overflow: auto; }
.view-fixed, .view.board { display: flex; flex-direction: column; overflow: hidden; }

@media (min-width: 760px) {
  .top { padding-top: env(safe-area-inset-top); padding-bottom: 0; padding-left: max(24px, env(safe-area-inset-left)); padding-right: max(24px, env(safe-area-inset-right)); min-height: 64px; gap: 20px; }
  .trip-btn { max-width: 340px; flex: 0 1 auto; }
  .tabs { display: flex; align-self: stretch; gap: 2px; min-width: 0; overflow-x: auto; scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs .tab { padding: 0 11px; font-size: 15.5px; white-space: nowrap; border-bottom: 2px solid transparent; border-top: 2px solid transparent; }
  .tabs .tab:hover { color: var(--ink); }
  .tabs .tab[aria-current="page"] { border-bottom-color: var(--accent); }
  .bottom { display: none; }
}
@media (min-width: 760px) and (max-width: 1179px) { .trip-btn { max-width: 220px; } .trip-ico { max-width: 96px; } }
/* 8 zakładek w górnym pasku: na wąskim komputerze / tablecie ciaśniej (reszta i tak przewija się w bok) */
@media (min-width: 760px) and (max-width: 1023px) { .tabs .tab { padding: 0 7px; font-size: 14.5px; } }
@media (min-width: 1180px) { .top { gap: 28px; } .tabs { gap: 6px; } .tabs .tab { padding: 0 14px; } }

/* ---------- pasek filtrów ---------- */
.fbar { flex: none; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 22px; padding: 12px 20px; background: var(--bg); border-bottom: 1px solid var(--line); }
.fgroup { display: flex; gap: 6px; align-items: center; }
.flabel { display: none; }
/* telefon: wszystkie filtry w jednym przewijanym w bok rzędzie, żeby nie zjadały ekranu */
@media (max-width: 759px) {
  .fbar {
    flex-wrap: nowrap; gap: 8px; padding: 8px max(16px, env(safe-area-inset-right)) 8px max(16px, env(safe-area-inset-left));
    overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none;
  }
  .fbar::-webkit-scrollbar { display: none; }
  .fgroup, .fbar > .seg, .fbar > * { flex: none; }
  .fbar > * + * { padding-left: 8px; border-left: 1px solid var(--line-strong); }
  .fbar > .seg + * { margin-left: 0; }
}
.inline-form, .inline-confirm { display: inline-flex; gap: 6px; align-items: center; white-space: nowrap; }
.inline-form input { width: 190px; min-height: 40px; padding: 6px 12px; }
.inline-form .btn, .inline-confirm .btn { min-height: 40px; padding: 0 14px; }

/* ---------- tablice (Propozycje, Noclegi, Podróże) ---------- */
/* Telefon i tablet: filtry i zwijany pasek mapy nad kolumnami. Od 1024 px: boczna kolumna (filtry, pod nimi mapa). */
.board-body { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.side { flex: none; display: flex; flex-direction: column; }
/* pasek mapy na telefonie: ok. 1/5 ekranu, żeby karty były widać od razu */
.mini { position: relative; flex: none; height: clamp(110px, 19svh, 190px); background: var(--ph-bg); border-bottom: 1px solid var(--line); }
.mini-map { position: absolute; inset: 0; }
.mini-hint {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 500; pointer-events: none;
  max-width: calc(100% - 32px); padding: 8px 14px; border-radius: 999px; background: var(--surface); box-shadow: var(--shadow);
  font-size: 14.5px; color: var(--ink-soft); text-align: center;
}
/* pod mapą: "Dodaj …" (wygląd aktywnego "Robimy") + na telefonie zwijanie mapy; zostaje widoczne po zwinięciu */
.side-acts {
  flex: none; display: flex; gap: 8px; background: var(--bg); border-bottom: 1px solid var(--line);
  padding: 8px max(16px, env(safe-area-inset-right)) 8px max(16px, env(safe-area-inset-left));
}
.add-side {
  flex: 1; min-width: 0; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 16px; border: 1px solid var(--accent); border-radius: var(--r-sm);
  background: var(--accent-bg); color: var(--accent-text); font-size: 16px; font-weight: 700; white-space: nowrap;
}
.add-side svg { width: 20px; height: 20px; flex: none; }
@media (max-width: 399px) { .add-side { gap: 6px; padding: 0 8px; font-size: 15px; } .side-acts { gap: 6px; } }
.add-side span { overflow: hidden; text-overflow: ellipsis; }
.add-side:hover { background: color-mix(in srgb, var(--accent) 12%, var(--accent-bg)); }
body.auth-mode .add-side { display: none; }
.mini-toggle {
  flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 48px; padding: 0 14px;
  border: 1px solid var(--btn-border); border-radius: var(--r-sm); background: var(--btn-bg); color: var(--ink-soft); font-size: 15px; font-weight: 600; white-space: nowrap;
}
.mini-toggle[aria-expanded="false"] svg { transform: rotate(180deg); }
.mini-all {
  position: absolute; left: 10px; bottom: 10px; z-index: 600; /* lewy dół: nie zasłania przycisków zoomu ani atrybucji */
  min-height: 40px; padding: 0 16px; border: 0; border-radius: 999px;
  background: var(--surface); color: var(--accent-text); box-shadow: var(--shadow); font-size: 14.5px; font-weight: 700; white-space: nowrap;
}
.mini-all:hover { background: var(--panel); }
.mini.collapsed { display: none; }
@media (min-width: 1024px) {
  .board-body { flex-direction: row; }
  .side {
    order: 2; width: var(--side-w, 496px); gap: 16px; padding: 18px 20px 24px; overflow-y: auto;
    border-left: 1px solid var(--line); background: var(--bg);
  }
  .side .fbar { flex-direction: column; align-items: flex-start; gap: 10px; padding: 0; border: 0; background: none; }
  .side .fgroup { flex-wrap: wrap; }
  .side .flabel { display: block; width: 100%; font-size: 13.5px; font-weight: 700; color: var(--muted); }
  .mini, .mini.collapsed {
    width: 100%; height: auto; aspect-ratio: 4 / 3; max-height: 62vh; padding: 0; display: block;
    border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: var(--ph-bg);
  }
  .side-acts { padding: 0; border: 0; background: none; }
  .mini-toggle { display: none; }
}
@media (min-width: 1400px) { .side { width: var(--side-w, 600px); } }
/* uchwyt do zmiany szerokości bocznej kolumny (js/views/sideresize.js): linia na lewej krawędzi, szerszy obszar chwytania */
.side-resize { display: none; }
@media (min-width: 1024px) {
  .side-resize { display: block; order: 1; flex: none; position: relative; width: 0; z-index: 5; cursor: col-resize; touch-action: none; outline: none; }
  .side-resize::before { content: ""; position: absolute; top: 0; bottom: 0; left: -7px; width: 14px; }
  .side-resize::after {
    content: ""; position: absolute; top: 0; bottom: 0; left: -2px; width: 4px; border-radius: 2px;
    background: transparent; transition: background .15s;
  }
  .side-resize:hover::after, body.resizing .side-resize::after { background: var(--accent); }
  .side-resize:focus-visible::after { background: var(--accent); box-shadow: 0 0 0 3px var(--accent-bg); }
  body.resizing { cursor: col-resize; user-select: none; -webkit-user-select: none; }
  body.resizing .leaflet-container { pointer-events: none; }
}

.cols {
  flex: 1; min-height: 0; min-width: 0; overflow: auto; overscroll-behavior-x: contain;
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(300px, 1fr); align-items: stretch;
  gap: 0; padding: 0 8px 32px;
  scroll-snap-type: x mandatory; scroll-padding: 0 8px;
}
/* telefon: jedna osoba na ekran, z prawej wystaje kawałek następnej kolumny (widać, że jest więcej) */
@media (max-width: 759px) {
  .cols {
    grid-auto-columns: calc(100% - 36px); padding: 0 4px 24px; scroll-padding: 0 4px;
    padding-left: max(4px, env(safe-area-inset-left)); padding-right: max(4px, env(safe-area-inset-right));
  }
  .col { padding: 0 10px; }
  .col-h { margin-top: 10px; }
}
/* kolumny osób: wyraźna pionowa linia między nimi, nagłówek w kolorze osoby (--pc ustawiane na .col) */
.col { scroll-snap-align: start; min-width: 0; padding: 0 12px; }
.col + .col { border-left: 1px solid var(--divider); }
.col-h {
  position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 10px;
  margin: 14px 0 12px; padding: 10px 12px; border-top: 4px solid var(--pc, var(--muted)); border-radius: 0 0 var(--r-sm) var(--r-sm);
  background: color-mix(in srgb, var(--pc, var(--muted)) 17%, var(--bg));
}
.col-h h2 { font-size: 19px; }
.col-h .muted { font-weight: 400; }
.col-n { margin-left: auto; color: var(--ink-soft); font-size: 14.5px; white-space: nowrap; }
.col-list { display: flex; flex-direction: column; gap: 12px; }
.col-empty { color: var(--muted); padding: 0 4px 12px; display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }

.card { background: var(--card); box-shadow: var(--card-shadow); border: 1px solid var(--line-strong); border-radius: var(--r); container-type: inline-size; transition: border-color .15s, box-shadow .15s; }
.card.selected { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-bg); }
.card-main {
  display: grid; grid-template-columns: var(--thumb-w) 1fr; gap: 14px; align-items: start; width: 100%;
  padding: 14px 14px 10px; border: 0; background: none; text-align: left; border-radius: var(--r) var(--r) 0 0;
}
.card-main:hover .card-t { color: var(--accent-text); }
.ph { position: relative; display: block; overflow: hidden; background: var(--ph-bg); }
.ph img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.ph-fallback { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 12px; padding: 0 16px; color: var(--ph-ink); }
.ph-fallback b { font-size: 26px; font-weight: 700; line-height: 1; }
.ph-fallback span { font-size: 14.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* miniatura zdjęcia 4:3 (bliżej naturalnych proporcji zdjęć niż kwadrat); w wąskiej karcie trochę mniejsza */
.card-main { --thumb-w: 96px; }
@container (max-width: 340px) { .card-main { --thumb-w: 80px; } }
.thumb { width: var(--thumb-w); aspect-ratio: 4 / 3; height: auto; border-radius: var(--r-sm); }
.thumb img { object-fit: cover; object-position: center; }
.thumb .ph-fallback { padding: 0; }
.thumb .ph-fallback span { display: none; }
.card-b { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.card-t { font-size: 17px; font-weight: 700; line-height: 1.35; color: var(--ink); transition: color .15s; }
.card-place { color: var(--muted); font-size: 15px; line-height: 1.4; }
.card-meta, .pop-meta { font-size: 14.5px; color: var(--muted); line-height: 1.45; margin-top: 2px; }
.st-doing { color: var(--go); font-weight: 700; }
.st-must { color: var(--must); font-weight: 600; }
.st-arch { color: var(--ink-soft); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; font-size: 13px; }
/* archiwum: wyciszona karta (przerywana ramka, szara miniatura) */
.card.archived { background: var(--surface); border-style: dashed; box-shadow: none; }
.card.archived .thumb { filter: grayscale(1); opacity: .7; }
.card.archived .card-t { color: var(--ink-soft); }

/* Przyciski akcji: 3 w rzędzie, a ikona NAD podpisem, bo na typowej karcie (kolumna 300 px, telefon) komórka ma
   ok. 80-110 px, a "ⓘ Szczegóły" w jednej linii potrzebuje ~116 px. Ikona obok podpisu dopiero, gdy komórka
   ma >= ~120 px: karta >= 400 px (3 w rzędzie) albo >= 780 px (6 w rzędzie). Tekst nigdy nie wychodzi poza
   przycisk: w ostateczności jest ucinany wielokropkiem (pełna nazwa jest w title/aria-label). */
.acts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; padding: 4px 12px 12px; }
.act {
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-width: 0;
  min-height: 52px; padding: 5px 4px; border: 1px solid var(--btn-border); border-radius: var(--r-sm); overflow: hidden;
  background: var(--btn-bg); color: var(--ink); font-size: 13.5px; font-weight: 600; line-height: 1.2; text-decoration: none; white-space: nowrap;
}
.act > span { min-width: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.act svg.i { width: 19px; height: 19px; flex: none; }
@container (min-width: 400px) {
  .act { flex-direction: row; gap: 7px; min-height: 46px; padding: 0 8px; font-size: 15px; }
}
@container (max-width: 399px) { .act { padding-left: 1px; padding-right: 1px; font-size: 13px; } }
@container (min-width: 780px) { .acts { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
/* okno szczegółów: bez "Szczegóły", przyciski mieszczą się z ikoną obok podpisu (od 360 px ekranu) */
.sheet .act { flex-direction: row; gap: 7px; min-height: 46px; padding: 0 8px; font-size: 15px; }
.act:hover { border-color: var(--ink-soft); }
.act.on-go { background: var(--accent-bg); color: var(--accent-text); border-color: var(--accent); }
.act.on-no { background: var(--no-bg); color: var(--no); border-color: var(--no); }
.acts.confirm { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 0 12px 12px; padding: 10px 12px; border-radius: var(--r-sm); background: var(--no-bg); color: var(--no); font-weight: 700; }
.acts.confirm span { flex: 1; }

.empty-state { margin: 56px auto; max-width: 440px; padding: 0 16px; text-align: center; display: flex; flex-direction: column; gap: 12px; align-items: center; grid-column: 1 / -1; }
.empty-state h2 { font-size: 22px; }
.empty-state p { color: var(--muted); }
.empty-note { padding: 16px 20px; display: flex; flex-direction: column; gap: 6px; }
.empty-note p:first-child { font-weight: 700; }

/* ---------- okno (arkusz) ---------- */
.overlay { position: fixed; inset: 0; z-index: 1500; background: var(--overlay); display: flex; align-items: flex-end; justify-content: center; }
/* wysokość nakładki = widoczny obszar (ui.js ustawia ją z visualViewport, gdy iOS pokazuje klawiaturę) */
.sheet {
  background: var(--surface); width: 100%; max-width: 560px; max-height: 92%; overflow: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
  border: 2px solid var(--accent); border-bottom: 0; border-radius: 20px 20px 0 0; box-shadow: var(--shadow-lg);
  padding: 4px 22px calc(22px + env(safe-area-inset-bottom));
}
@media (min-width: 760px) { .overlay { align-items: center; padding: 24px; } .sheet { border-bottom: 2px solid var(--accent); border-radius: 20px; max-height: 88vh; } }
.sheet-h { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 8px; padding: 14px 0 8px; background: var(--surface); }
.sheet-h h2 { flex: 1; font-size: 20px; }
.sheet-b { display: flex; flex-direction: column; gap: 18px; padding-top: 4px; }
.lead { font-size: 17.5px; font-weight: 700; }
.detail-ph { aspect-ratio: 16 / 8; border-radius: var(--r); }
.detail-meta { font-size: 16.5px; line-height: 1.55; }
.detail-meta .muted { font-size: 14.5px; }
.sheet .acts { padding: 0; }
.sheet .acts.confirm { margin: 0; }
/* dół okna szczegółów: archiwum i usuwanie, oddzielone od reszty */
.manage { border-top: 1px solid var(--line-strong); padding-top: 14px; display: flex; flex-direction: column; gap: 8px; }
.manage-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; }
.manage .hint { font-size: 14px; }
.btn.quiet-danger { background: none; border-color: transparent; color: var(--no); }
.btn.quiet-danger:hover { background: var(--no-bg); }
.detail-when { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 14px; border-radius: var(--r-sm); background: var(--panel); }
.picked { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: var(--r-sm); background: var(--accent-bg); color: var(--ink); }
.picked > span { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.picked small { color: var(--muted); font-size: 13.5px; }
.picked svg { color: var(--accent-text); }
.picked .linklike { min-height: 40px; }
.sheet .empty-note { padding: 0; }

/* ---------- kraj, luźny pomysł, oferta noclegu ---------- */
/* znacznik kraju: mały, cichy, bez ramki (flaga + nazwa) */
.ctags { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; margin-top: 3px; max-width: 100%; }
.ctag { display: inline-flex; align-items: center; gap: 5px; min-width: 0; padding: 1px 9px 1px 7px; border-radius: 999px; background: var(--panel); color: var(--ink-soft); font-size: 13.5px; font-weight: 600; line-height: 1.5; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ctag-f { font-size: 14px; line-height: 1; }
.ctag-arrow { color: var(--muted); font-size: 13px; }
.chip .ctag-f { font-size: 16px; }
.detail-meta .ctags { vertical-align: middle; margin-top: 0; }
.card-place.none { font-style: italic; }
/* restauracja: rodzaj + ceny ("Grill bar · $$ Średnio") i komentarz ucięty do 3 linii (pełny w szczegółach) */
.card-food { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 4px; min-width: 0; font-size: 14.5px; line-height: 1.45; color: var(--ink-soft); font-weight: 600; }
.card-food .sep { color: var(--muted); font-weight: 400; }
.food-type { min-width: 0; overflow-wrap: anywhere; }
.price { display: inline-flex; align-items: baseline; gap: 5px; white-space: nowrap; }
/* 1-3 znaczki ceny: pełne + wyszarzone (bez nowego koloru: ten sam odcień, mniejsza krycie) */
.price-m { letter-spacing: .02em; font-weight: 800; }
.price-m b { font-weight: 800; }
.price-m i { font-style: normal; opacity: .3; }
.card-note {
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden;
  margin-top: 3px; font-size: 14.5px; line-height: 1.45; color: var(--ink-soft); font-style: italic; white-space: pre-line; overflow-wrap: anywhere;
}
.food-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.price-seg button { display: inline-flex; align-items: baseline; gap: 6px; }
.pp-add-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.pp-add-btns .btn { flex: 1 1 160px; }
.pp-note { font-style: italic; color: var(--ink-soft); white-space: pre-line; overflow-wrap: anywhere; }
/* placeholder bez zdjęcia: ikonka zamiast inicjału */
.ph-fallback svg.i { width: 26px; height: 26px; opacity: .8; }
.ph-fallback.loose { flex-direction: column; gap: 4px; }
.ph-fallback.loose span { font-size: 13px; }
.thumb .ph-fallback.loose svg.i { width: 22px; height: 22px; }
.res-loose { border: 1px dashed var(--line-strong); margin-bottom: 4px; }
.res-loose svg { color: var(--accent-text); }
.res-loose .res-t b { overflow-wrap: anywhere; }
.picked.loose { background: var(--panel); }
.picked .linklike + .linklike { margin-left: -4px; }
.badge.warn-b { background: var(--warn-bg); color: var(--must); font-size: 12.5px; padding: 0 8px; margin-left: 4px; vertical-align: 1px; }
.picked.guess { background: var(--warn-bg); }

/* oferta na karcie: cena łącznie + za noc, pokój, daty, ocena i źródło */
.offer-l { display: flex; flex-direction: column; gap: 1px; margin-top: 4px; min-width: 0; }
.offer-price { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; color: var(--ink); font-size: 16px; line-height: 1.35; }
.offer-price b { font-weight: 700; }
.offer-pn { color: var(--muted); font-size: 14px; font-weight: 600; }
.offer-price.big { font-size: 21px; }
.offer-room { color: var(--ink-soft); font-size: 14.5px; line-height: 1.4; overflow-wrap: anywhere; }
.offer-facts { color: var(--muted); font-size: 14px; line-height: 1.45; }
.pp-offer { margin: 0; }

/* okno: zdjęcie z oferty, sekcja oferty, formularz */
.detail-ph-wrap { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.detail-ph-wrap .detail-ph { width: 100%; }
.ph-del { font-size: 14px; }
.offer-img { aspect-ratio: 16 / 8; border-radius: var(--r); width: 100%; }
#asImg { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.offer-src { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; color: var(--ink-soft); }
.offer-src svg { color: var(--accent-text); }
.offer-src > span { flex: 1; min-width: 0; }
.offer-note { display: flex; gap: 10px; align-items: flex-start; padding: 10px 14px; border-radius: var(--r-sm); background: var(--panel); color: var(--ink-soft); font-size: 14.5px; }
.offer-note svg { flex: none; margin-top: 2px; color: var(--muted); }
.offer-loading { display: flex; align-items: center; gap: 14px; padding: 18px 4px; }
.offer-loading p { overflow-wrap: anywhere; }
.spinner { flex: none; width: 26px; height: 26px; border-radius: 50%; border: 3px solid var(--line-strong); border-top-color: var(--accent); animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.offer-fs { border: 1px solid var(--line-strong); border-radius: var(--r); padding: 6px 16px 16px; margin: 0; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.offer-fs legend { padding: 0 6px; font-weight: 700; color: var(--ink-soft); font-size: 14.5px; }
.offer-more { border: 1px solid var(--line-strong); border-radius: var(--r); }
.offer-more summary { cursor: pointer; padding: 12px 16px; min-height: var(--tap); font-weight: 600; color: var(--ink-soft); font-size: 15px; }
.offer-more[open] summary { border-bottom: 1px solid var(--line); }
.offer-more-b { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 14px; }
.price-row { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.offer-sum:empty { display: none; }
.offer-sec { display: flex; flex-direction: column; gap: 12px; }
.offer-sec[hidden] { display: none; }
.sec-h { font-size: 14.5px; font-weight: 600; color: var(--ink-soft); }
.offer-box { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; border-radius: var(--r-sm); background: var(--panel); }
.offer-box .row-btns { margin-top: 10px; }
.offer-form, .offer-add { display: flex; flex-direction: column; gap: 14px; }

/* profil: sekcje ustawień (kolejne ustawienia = kolejne .set) */
.set { display: flex; flex-direction: column; gap: 12px; padding-bottom: 18px; }
.set + .set { padding-top: 18px; border-top: 1px solid var(--line); }
.set-h { display: flex; flex-direction: column; gap: 2px; }
.set-h h3 { font-size: 17px; }
.set .btn { align-self: flex-start; }
.swatches { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.sw {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; min-height: 76px;
  padding: 10px 4px 8px; border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: var(--surface); cursor: pointer;
}
.sw input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: inherit; }
.sw i { width: 36px; height: 36px; border-radius: 50%; background: var(--pc); box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--ink) 10%, transparent); }
.sw span { max-width: 100%; font-size: 13.5px; font-weight: 600; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sw:hover { border-color: var(--ink-soft); }
.sw:has(input:checked) { border: 2px solid var(--pc); padding: 9px 3px 7px; background: color-mix(in srgb, var(--pc) 12%, var(--surface)); }
.sw:has(input:checked) span { color: var(--ink); }
.sw:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.sw.taken { cursor: not-allowed; border-style: dashed; background: none; }
.sw.taken i { opacity: .4; }
.sw.taken:hover { border-color: var(--line-strong); }

/* wybierak miejsca */
.picker { display: flex; flex-direction: column; gap: 8px; }
.picker-status { font-size: 14.5px; color: var(--muted); }
.picker-status:empty { display: none; }
.picker-status.error { color: var(--no); }
.results { display: flex; flex-direction: column; }
.results:empty { display: none; }
.results-h { font-size: 13.5px; font-weight: 700; color: var(--muted); padding: 10px 4px 4px; }
.res { display: flex; align-items: center; gap: 12px; min-height: 54px; padding: 8px 10px; border: 0; border-radius: var(--r-sm); background: none; text-align: left; }
.res:hover, .res:focus-visible { background: var(--panel); }
.res svg { color: var(--muted); }
.res-t { display: flex; flex-direction: column; min-width: 0; }
.res-t b { font-weight: 600; }
.res-t small { color: var(--muted); font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- przełącznik podróży ---------- */
.trip-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.trip-row {
  display: flex; align-items: center; gap: 14px; width: 100%; min-height: 64px; padding: 10px 12px;
  border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: var(--surface); text-align: left;
}
.trip-row:hover { background: var(--panel); }
.trip-row[aria-current="true"] { border-color: var(--accent); background: var(--accent-bg); }
.trip-row-ico { flex: none; display: grid; place-items: center; width: 56px; height: 40px; border-radius: 8px; background: var(--ph-bg); color: var(--ph-ink); overflow: hidden; }
.trip-row-ico img { max-width: 100%; max-height: 100%; object-fit: contain; }
.trip-row-ico b { font-size: 19px; }
.trip-row-t { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.trip-row-t b { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trip-row-t small { color: var(--muted); font-size: 14px; }
.trip-row > svg { color: var(--muted); }
.badge { flex: none; display: inline-flex; align-items: center; padding: 2px 10px; border-radius: 999px; background: var(--panel); color: var(--ink-soft); font-size: 13.5px; font-weight: 600; white-space: nowrap; }
.badge.accent { background: var(--accent-bg); color: var(--accent-text); }
.badge.muted-b { color: var(--muted); }

/* ---------- formularze podróży, ikona ---------- */
.trip-form, .stack { display: flex; flex-direction: column; gap: 14px; }
fieldset.plain { border: 0; margin: 0; padding: 0; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
fieldset.plain legend { padding: 0; margin-bottom: 12px; }
.vh { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); border: 0; white-space: nowrap; }
.file-btn { position: relative; }
.file-btn:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.icon-pick { display: flex; flex-direction: column; gap: 8px; }
.icon-pick .field-l { margin-bottom: 0; }
.icon-pick-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.icon-prev {
  flex: none; display: grid; place-items: center; width: 168px; height: 56px; padding: 4px;
  border: 1px dashed var(--line-strong); border-radius: var(--r-sm); background: var(--bg);
}
.icon-prev img { display: block; max-width: 160px; max-height: 40px; width: auto; height: auto; object-fit: contain; }
.trip-form .btn.big { margin-top: 4px; }

/* ---------- Ustawienia podróży, ekran powitalny ---------- */
.settings, .welcome {
  max-width: 720px; margin: 0 auto; display: flex; flex-direction: column; gap: 18px;
  padding: 24px max(16px, env(safe-area-inset-right)) 40px max(16px, env(safe-area-inset-left));
}
.settings-h { display: flex; flex-direction: column; gap: 4px; }
.settings-h h2 { font-size: 23px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.panel h2 { font-size: 20px; }
.panel h3 { font-size: 17px; }
.panel > .btn, .panel .row-btns { align-self: flex-start; }
.mem-list { list-style: none; margin: 0; padding: 0; }
.mem { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; min-height: 52px; padding: 6px 0; }
.mem + .mem { border-top: 1px solid var(--line); }
.mem .dot { width: 12px; height: 12px; }
.mem-n { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mem-n b { font-weight: 700; }
.mem .inline-confirm { flex-wrap: wrap; white-space: normal; color: var(--no); font-weight: 700; }
.confirm-box { display: flex; flex-direction: column; gap: 12px; padding: 14px; border-radius: var(--r-sm); background: var(--no-bg); color: var(--ink); }
.confirm-box b { color: var(--no); }
.btn.danger-outline { border-color: var(--no); color: var(--no); background: var(--surface); }
.btn.danger-outline:hover { background: var(--no-bg); }
.welcome { gap: 22px; padding-top: 32px; }
.welcome-h { display: flex; flex-direction: column; gap: 8px; }
.welcome-h h1 { font-size: 28px; }
.steps { margin: 0; padding: 0; list-style: none; counter-reset: st; display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.steps li { counter-increment: st; display: flex; flex-direction: column; gap: 2px; padding: 12px 14px 12px 52px; position: relative; border-radius: var(--r); background: var(--panel); }
.steps li::before {
  content: counter(st); position: absolute; left: 14px; top: 12px; display: grid; place-items: center; width: 26px; height: 26px;
  border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-weight: 700; font-size: 14px;
}
.steps span { color: var(--muted); font-size: 14.5px; }
.welcome .hint .linklike { padding: 0 2px; min-height: 0; font-size: inherit; }

/* ---------- zaproszenia ---------- */
.invite-link { display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: var(--r-sm); background: var(--accent-bg); }
.invite-link .field input { font-size: 16px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.radios { display: flex; flex-direction: column; gap: 4px; }
.radio { display: flex; align-items: center; gap: 10px; min-height: var(--tap); cursor: pointer; }
.radio input { width: 20px; height: 20px; margin: 0; accent-color: var(--accent); flex: none; }
.days-field { max-width: 200px; }
.sub-h { margin: 8px 0 0; font-size: 15px; color: var(--muted); }
.inv-list { list-style: none; margin: 0; padding: 0; }
.inv { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; min-height: 52px; padding: 8px 0; }
.inv + .inv { border-top: 1px solid var(--line); }
.inv-t { flex: 1 1 180px; min-width: 0; display: flex; flex-direction: column; }
.inv-t b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inv-t small { color: var(--muted); font-size: 13.5px; }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(84px + env(safe-area-inset-bottom)); z-index: 2500;
  max-width: calc(100% - 32px); padding: 12px 20px; border-radius: 999px;
  background: var(--ink); color: var(--surface); font-size: 15px; font-weight: 600; box-shadow: var(--shadow-lg);
}
.toast.error { background: var(--no); color: #fff; border-radius: var(--r-sm); }
.toast.has-act { display: flex; align-items: center; gap: 10px; padding: 2px 6px 2px 20px; }
.toast-act { min-height: 44px; padding: 0 12px; border: 0; border-radius: 999px; background: none; color: inherit; font: inherit; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.toast-act:hover, .toast-act:focus-visible { background: color-mix(in srgb, var(--surface) 18%, transparent); }
@media (min-width: 760px) { .toast { bottom: 32px; } }

/* ---------- logowanie ---------- */
.auth { position: fixed; inset: 0; z-index: 2000; background: var(--bg); display: grid; place-items: center; padding: 16px; overflow: auto; }
.auth-card { width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); padding: 32px 26px; display: flex; flex-direction: column; gap: 18px; }
.auth-card h1 { font-size: 26px; }
.auth-brand { font-size: 14.5px; font-weight: 700; color: var(--accent-text); }
.auth-info { color: var(--muted); }
.auth-card.loading { align-items: center; text-align: center; }

/* ---------- kalendarz ---------- */
.tray { flex: none; display: flex; gap: 8px; align-items: center; overflow-x: auto; padding: 12px 20px; border-bottom: 1px solid var(--line); background: var(--bg); }
.tray-h { font-size: 14.5px; font-weight: 700; color: var(--muted); white-space: nowrap; }
.tray-h:not(:first-child) { margin-left: 12px; }
.tray-empty { font-size: 14.5px; color: var(--muted); white-space: nowrap; }
.tchip {
  flex: none; min-height: 40px; padding: 0 15px; border-radius: 999px; white-space: nowrap;
  border: 1px dashed var(--line-strong); background: var(--surface); font-size: 15px; font-weight: 600; color: var(--ink-soft); cursor: grab;
}
.tchip::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--pc); margin-right: 8px; vertical-align: 1px; }
.cal-scroll { flex: 1; min-height: 0; overflow: auto; background: var(--surface); }
.cal-grid { display: grid; position: relative; width: max-content; min-width: 100%; }
.cal-corner, .dayh { position: sticky; top: 0; z-index: 3; height: 54px; background: var(--surface); border-bottom: 1px solid var(--line); }
.cal-corner { left: 0; z-index: 4; }
.dayh { display: flex; align-items: baseline; gap: 6px; padding: 12px 10px 0; border-left: 1px solid var(--line); }
.dayh b { font-size: 21px; font-weight: 700; line-height: 1; }
.dayh span { font-size: 14px; color: var(--muted); }
.dayh.we span { color: var(--accent-text); font-weight: 600; }
.times { position: sticky; left: 0; z-index: 2; background: var(--surface); }
.times div { height: var(--hh); font-size: 12.5px; color: var(--muted); text-align: right; padding-right: 8px; transform: translateY(-9px); }
/* pasek noclegów pod nagłówkami dni: wiersz siatki, przyklejony pod nimi; tory po --sl px, kolumny jak dni */
.cal-grid { --sl: 26px; }
.cal-stays-h, .cal-stays { grid-row: 2; position: sticky; top: 54px; z-index: 3; background: var(--surface); border-bottom: 1px solid var(--line); }
.cal-stays-h { left: 0; z-index: 4; display: flex; align-items: center; justify-content: flex-end; padding-right: 8px; color: var(--muted); }
.cal-stays-h svg { width: 18px; height: 18px; }
.cal-stays { grid-column: 2 / -1; display: grid; row-gap: 2px; padding: 3px 0; min-width: 0; }
.cstay {
  display: flex; align-items: center; gap: 5px; min-width: 0; margin: 0 2px; padding: 0 8px; overflow: hidden;
  border: 0; border-left: 3px solid var(--pc); border-radius: 6px; text-align: left; cursor: pointer;
  background: color-mix(in srgb, var(--pc) 10%, var(--surface)); color: var(--ink); font-size: 13px; line-height: 1;
}
.cstay span { flex: none; font-size: 12px; }
.cstay b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.cstay:hover { background: color-mix(in srgb, var(--pc) 18%, var(--surface)); }
.cstay:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
/* dotyk: tor 44 px jako cel kliknięcia, widoczny pasek nadal ~26 px (::before), wyrównany do kolumn dni */
@media (pointer: coarse) {
  .cal-grid { --sl: var(--tap); }
  .cal-stays { row-gap: 0; padding: 0; }
  .cstay { position: relative; isolation: isolate; border-left: 0; background: none; padding-left: 11px; }
  .cstay::before {
    content: ""; position: absolute; inset: 9px 0; z-index: -1; border-left: 3px solid var(--pc); border-radius: 6px;
    background: color-mix(in srgb, var(--pc) 10%, var(--surface));
  }
  .cstay:hover { background: none; }
  .cstay:hover::before { background: color-mix(in srgb, var(--pc) 18%, var(--surface)); }
}
.daycol {
  position: relative; height: calc(24 * var(--hh)); border-left: 1px solid var(--line); cursor: copy;
  background-image: repeating-linear-gradient(to bottom, transparent 0, transparent calc(var(--hh) - 1px), var(--line) calc(var(--hh) - 1px), var(--line) var(--hh));
}
.daycol.drop { background-color: var(--accent-bg); }
.ev {
  position: absolute; display: flex; flex-direction: column; align-items: flex-start; gap: 1px; overflow: hidden;
  padding: 5px 9px; border: 0; border-left: 3px solid var(--pc); border-radius: 8px; text-align: left;
  background: color-mix(in srgb, var(--pc) 13%, var(--surface)); color: var(--ink); font-size: 14px; line-height: 1.3;
}
.ev b { font-weight: 700; }
.ev span { font-size: 12.5px; color: var(--muted); }
.ev.travel { background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--pc) 15%, var(--surface)) 0 6px, color-mix(in srgb, var(--pc) 7%, var(--surface)) 6px 12px); }
.ev.cont { opacity: .85; }
.ev:hover { filter: brightness(.98); }

/* ---------- mapy ---------- */
.lmap { position: relative; flex: 1; min-height: 0; background: var(--ph-bg); z-index: 0; }
.map-error { position: absolute; left: 12px; bottom: 28px; z-index: 900; max-width: min(360px, 80%); padding: 8px 14px; border-radius: var(--r-sm); background: var(--surface); color: var(--muted); font-size: 14.5px; box-shadow: var(--shadow); }
.leaflet-container { font-family: var(--f); background: var(--ph-bg); }
.leaflet-tile-pane { filter: var(--tile-filter); }
.leaflet-bar { border: 0 !important; box-shadow: var(--shadow) !important; border-radius: var(--r-sm) !important; overflow: hidden; }
.leaflet-bar a, .leaflet-bar a:hover { width: 40px !important; height: 40px !important; line-height: 40px !important; background: var(--surface); color: var(--ink-soft); border-bottom-color: var(--line); }
.leaflet-control-attribution { background: color-mix(in srgb, var(--surface) 85%, transparent) !important; color: var(--muted); }
.leaflet-control-attribution a { color: var(--ink); }
.leaflet-popup.map-popup .leaflet-popup-content-wrapper, .leaflet-popup.map-popup .leaflet-popup-tip { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-lg); }
.map-popup .leaflet-popup-content-wrapper { border-radius: var(--r); }
.map-popup .leaflet-popup-content { margin: 16px 18px; font-size: 15px; line-height: 1.45; }
.map-popup a.leaflet-popup-close-button { width: 36px; height: 36px; font-size: 22px; line-height: 36px; color: var(--muted); }
.pop { display: flex; flex-direction: column; gap: 8px; min-width: 200px; }
.pop h3 { font-size: 17px; line-height: 1.3; padding-right: 22px; }
.pop-who { display: flex; align-items: center; gap: 6px; font-size: 13.5px; color: var(--muted); }
.pop-place { color: var(--muted); }
.pop .btn { width: 100%; }
/* dymek mini-mapy: duże zdjęcie nad nazwą, fakty z Google pod nią */
.pop-rich .pop-photo { width: 100%; aspect-ratio: 16 / 10; border-radius: var(--r-sm); margin-bottom: 2px; }
.pop-rich .pop-photo + h3 { margin-top: 2px; padding-right: 0; }
/* ✕ leży na rogu zdjęcia: tło, żeby był widoczny na jasnym i ciemnym zdjęciu */
.map-popup:has(.pop-photo) a.leaflet-popup-close-button { top: 6px; right: 6px; background: var(--surface); border-radius: 50%; box-shadow: var(--shadow); }
.pop-facts { display: flex; flex-direction: column; gap: 4px; font-size: 14.5px; }
.pop-facts:empty { display: none; }
.pop-facts p { margin: 0; }
.leaflet-container .pop a.btn.primary { color: var(--accent-ink); }
.map-pin { background: none; border: 0; }
.map-pin svg { display: block; filter: drop-shadow(0 1px 1.5px rgba(0, 0, 0, .25)); }
.map-num span { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; color: #fff; font-weight: 700; font-size: 14px; border: 2px solid var(--surface); box-shadow: var(--shadow); }
.map-arrow div { width: 0; height: 0; margin: 2px 0 0 2px; border-left: 14px solid var(--route); border-top: 7px solid transparent; border-bottom: 7px solid transparent; transform-origin: 50% 50%; }
.map-stop span { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; font-size: 13.5px; font-weight: 700; color: var(--ink); text-shadow: 0 0 3px var(--surface), 0 0 3px var(--surface), 0 0 3px var(--surface); }
.map-stop i { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--route); background: var(--surface); }
.map-leg { cursor: pointer; stroke: var(--route); }
.map-leg.sel { stroke: var(--route-strong); }

/* ---------- Mapa: tryb Trasa ---------- */
.map-body { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.route-mode .map-body .map-stage { flex: none; height: 50%; }
.legs { flex: 1; min-height: 0; overflow: auto; background: var(--surface); padding-bottom: calc(24px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
@media (min-width: 900px) {
  .map-body { flex-direction: row; }
  .route-mode .map-body .map-stage { height: auto; flex: 1; }
  .legs { flex: none; width: 400px; border-top: 0; border-left: 1px solid var(--line); }
}
.legs-h { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; padding: 18px 20px 10px; }
.legs-h h2 { font-size: 20px; }
.legs-h .muted { font-size: 14.5px; }
.legs-list { list-style: none; margin: 0; padding: 0; }
.leg { display: flex; align-items: center; gap: 4px; padding: 0 10px 0 0; border-top: 1px solid var(--line); }
.leg.sel { background: var(--accent-bg); }
.leg-main { flex: 1; display: flex; align-items: center; gap: 14px; min-height: 68px; padding: 10px 8px 10px 20px; border: 0; background: none; text-align: left; min-width: 0; }
.leg-n { flex: none; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--route); color: #fff; font-weight: 700; font-size: 14px; }
.leg-t { display: flex; flex-direction: column; min-width: 0; }
.leg-t b { font-weight: 700; }
.leg-t small { color: var(--muted); font-size: 14.5px; }
.legs-undated { padding: 18px 20px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 8px; }
.legs-undated h3 { width: 100%; font-size: 15px; color: var(--muted); }

/* ---------- Mapa: obszar mapy z wyszukiwarką i panelem miejsca ---------- */
.map-stage { position: relative; flex: 1; min-height: 0; display: flex; overflow: hidden; }
.map-stage .lmap { flex: 1; }
/* pinezka z otwartym panelem, wyniki wyszukiwania, "tu jesteś" */
.map-pin.sel svg { transform: scale(1.25); transform-origin: 50% 100%; filter: drop-shadow(0 2px 4px rgba(0, 0, 0, .35)); }
.map-res { background: none; border: 0; }
.map-res span {
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%;
  background: var(--ink); color: var(--surface); border: 2px solid var(--surface); box-shadow: var(--shadow-lg); font-weight: 700; font-size: 14px;
}
.map-res.sel span { background: var(--accent); color: var(--accent-ink); transform: scale(1.18); }
.map-me { background: none; border: 0; }
.map-me span { display: block; width: 18px; height: 18px; margin: 2px; border-radius: 50%; background: var(--me); border: 3px solid #fff; box-shadow: 0 0 0 1px rgba(0, 0, 0, .2), 0 1px 4px rgba(0, 0, 0, .35); }
.map-me-acc { fill: var(--me); fill-opacity: .12; stroke: var(--me); stroke-opacity: .35; }
.map-locate button { display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 0; background: var(--surface); color: var(--ink-soft); }
.map-locate button:hover { background: var(--panel); color: var(--ink); }
.map-locate button.busy svg { animation: locate-pulse 1s ease-in-out infinite alternate; }
@keyframes locate-pulse { from { opacity: 1; } to { opacity: .35; } }
/* dymek "w pobliżu" */
.pop-h { font-size: 13.5px; font-weight: 700; color: var(--ink-soft); }
.near-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.near-list li { display: flex; align-items: center; gap: 4px; }
.pop .near-add { width: auto; flex: 1; min-width: 0; justify-content: flex-start; text-align: left; white-space: normal; padding: 6px 12px; line-height: 1.3; }
.near-add span { overflow-wrap: anywhere; }

/* wyszukiwarka: na telefonie przez całą szerokość u góry, od 760 px w lewym górnym rogu */
.map-search { position: absolute; z-index: 2; top: 10px; left: 10px; right: 10px; display: flex; flex-direction: column; gap: 6px; pointer-events: none; }
.map-search > * { pointer-events: auto; }
@media (min-width: 760px) { .map-search { top: 12px; left: 12px; right: auto; width: min(380px, calc(52% - 24px)); } }
.ms-form {
  display: flex; align-items: center; gap: 2px; min-height: 48px; padding: 0 4px 0 14px;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: 999px; box-shadow: var(--shadow-lg);
}
.ms-form:focus-within { border-color: var(--accent); }
.ms-ico { display: flex; color: var(--muted); }
.ms-input { flex: 1; min-width: 0; min-height: 46px; padding: 0 8px; border: 0; background: none; color: var(--ink); font-size: 16.5px; outline: none; }
.ms-input::placeholder { color: var(--muted); }
.ms-clear { width: 40px; height: 40px; }
.ms-go { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: 50%; background: var(--accent); color: var(--accent-ink); }
.ms-box { display: flex; flex-direction: column; padding: 4px 6px 6px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-lg); }
.ms-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 6px; }
.ms-h:has(.ms-status:empty):has(.ms-toggle[hidden]) { display: none; }
.ms-status { font-size: 14.5px; color: var(--muted); padding: 6px 0; }
.ms-status.error { color: var(--no); }
.ms-list { list-style: none; margin: 0; padding: 0; overflow: auto; overscroll-behavior: contain; max-height: 38svh; }
.ms-list .res { width: 100%; }
.ms-list .res.sel { background: var(--accent-bg); }
.ms-n { flex: none; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--ink); color: var(--surface); font-size: 13px; font-weight: 700; }
.ms-list .res.sel .ms-n { background: var(--accent); color: var(--accent-ink); }

/* panel miejsca: telefon = arkusz od dołu obszaru mapy (rozwijany); od 760 px = panel nad prawą częścią mapy */
.ppanel {
  position: absolute; z-index: 3; left: 0; right: 0; bottom: 0; height: 56%;
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--surface); color: var(--ink); border-top: 1px solid var(--line-strong); border-radius: 18px 18px 0 0; box-shadow: var(--shadow-lg);
  transition: height .2s ease;
}
.ppanel.expanded { height: calc(100% - 8px); }
/* kontrolki Leaflet (zoom, lokalizacja, atrybucja) nie chowają się pod panelem */
.map-stage.has-panel .leaflet-bottom { bottom: 56%; }
.map-stage.has-panel.panel-expanded .leaflet-bottom { display: none; }
.pp-top { flex: none; display: flex; align-items: center; gap: 4px; padding: 2px 6px 0 8px; border-bottom: 1px solid var(--line); }
.pp-grip { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 8px; border: 0; background: none; color: var(--muted); font-size: 14.5px; font-weight: 600; text-align: left; }
.pp-grip i { flex: none; width: 36px; height: 5px; border-radius: 3px; background: var(--line-strong); }
.pp-grip:hover { color: var(--ink); }
.pp-body { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding-bottom: 18px; }
@media (min-width: 760px) {
  .ppanel { left: auto; top: 12px; right: 12px; bottom: 12px; height: auto; width: min(400px, calc(48% - 12px)); border: 1px solid var(--line); border-radius: var(--r); transition: none; }
  .ppanel.expanded { height: auto; }
  .map-stage.has-panel .leaflet-bottom { bottom: 0; }
  .map-stage.has-panel .leaflet-right { right: calc(min(400px, 48% - 12px) + 12px); }
  .pp-top { position: absolute; z-index: 3; top: 8px; right: 8px; padding: 0; border: 0; }
  .pp-grip { display: none; }
  .pp-close { background: var(--surface); color: var(--ink); border-radius: 50%; box-shadow: var(--shadow); }
  .pp-close:hover { background: var(--panel); }
}
.pp-photo { width: 100%; aspect-ratio: 16 / 10; max-height: 280px; }
.pp-photo.empty { aspect-ratio: auto; height: 96px; }
.pp-nav {
  position: absolute; top: 50%; z-index: 2; transform: translateY(-50%); display: grid; place-items: center; width: 44px; height: 44px;
  border: 0; border-radius: 50%; background: color-mix(in srgb, var(--surface) 88%, transparent); color: var(--ink); box-shadow: var(--shadow);
}
.pp-nav:hover { background: var(--surface); }
.pp-nav.prev { left: 8px; }
.pp-nav.next { right: 8px; }
.pp-count { position: absolute; right: 10px; bottom: 8px; z-index: 2; padding: 2px 10px; border-radius: 999px; background: rgba(0, 0, 0, .55); color: #fff; font-size: 13px; font-weight: 600; }
.pp-credit, .pp-src { padding: 4px 16px 0; font-size: 12.5px; color: var(--muted); }
.pp-credit a, .pp-src a, .pp-rev-h a { color: var(--ink-soft); }
.pp-sec { display: flex; flex-direction: column; gap: 6px; padding: 12px 16px; }
.pp-sec .pp-src { padding: 0; }
.pp-hours, .pp-reviews, .pp-card { border-top: 1px solid var(--line); }
.pp-sec h3 { font-size: 16.5px; }
.pp-head h2 { font-size: 21px; line-height: 1.25; overflow-wrap: anywhere; }
.pp-head h2:focus { outline: none; }
.pp-type { color: var(--muted); font-size: 15px; }
.pp-line { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 15px; }
.pp-line .sep { color: var(--muted); }
.pp-rating { display: inline-flex; align-items: center; gap: 4px; }
.pp-star { color: var(--must); }
.pp-open.on { color: var(--go); font-weight: 700; }
.pp-open.off { color: var(--no); font-weight: 700; }
.pp-warn { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: var(--r-sm); background: var(--no-bg); color: var(--no); font-weight: 700; }
.pp-warn.soft { background: var(--panel); color: var(--must); }
.pp-addr { display: flex; align-items: flex-start; gap: 8px; color: var(--ink-soft); font-size: 15px; }
.pp-addr svg { color: var(--muted); margin-top: 2px; }
.pp-load { font-size: 14.5px; }
.pp-load .linklike { padding: 0 2px; }
.pp-acts { list-style: none; margin: 0; padding: 2px 8px 12px; display: flex; gap: 2px; border-bottom: 1px solid var(--line); }
.pp-acts li { flex: 1 1 0; min-width: 0; display: flex; }
.pp-act {
  flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 4px; min-height: 66px; padding: 4px 2px;
  border: 0; border-radius: var(--r-sm); background: none; color: var(--accent-text); text-decoration: none; text-align: center; font-size: 12.5px; font-weight: 700;
}
.pp-act > span:last-child { line-height: 1.2; color: var(--ink-soft); }
.pp-act-i { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--line-strong); background: var(--accent-bg); }
.pp-act:hover .pp-act-i { border-color: var(--accent); }
.pp-add .btn { align-self: stretch; }
.pp-add .hint { display: flex; flex-wrap: wrap; align-items: center; gap: 0 4px; }
.pp-today { display: flex; flex-wrap: wrap; gap: 4px 8px; font-size: 15px; }
.pp-today span { color: var(--muted); }
.pp-week summary { padding: 9px 0; min-height: 40px; cursor: pointer; color: var(--accent-text); font-weight: 600; font-size: 15px; }
.pp-week ul { list-style: none; margin: 0; padding: 0; }
.pp-week li { display: flex; justify-content: space-between; gap: 12px; padding: 4px 8px; border-radius: 8px; font-size: 15px; }
.pp-week li span:last-child { text-align: right; }
.pp-week li.today { background: var(--accent-bg); color: var(--accent-text); font-weight: 700; }
.pp-visit { display: flex; flex-direction: column; gap: 2px; padding: 8px 12px; border-radius: var(--r-sm); background: var(--panel); font-size: 15px; }
.pp-visit-l { font-size: 13.5px; font-weight: 600; color: var(--muted); }
.pp-visit.ok b { color: var(--go); }
.pp-visit.no { background: var(--no-bg); }
.pp-visit.no b { color: var(--no); }
.pp-visit.warn > span:last-child { color: var(--must); font-weight: 600; }
.pp-reviews .btn { align-self: flex-start; }
.pp-summary { font-size: 15px; }
.pp-feat { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.pp-feat li { padding: 2px 10px; border-radius: 999px; background: var(--panel); color: var(--ink-soft); font-size: 13.5px; }
.pp-revs { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.pp-rev + .pp-rev { border-top: 1px solid var(--line); padding-top: 12px; }
.pp-rev-h { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; font-size: 14.5px; }
.pp-rev-stars { color: var(--must); letter-spacing: 1px; }
.pp-rev-stars .off { color: var(--line-strong); }
.pp-rev-t { font-size: 15px; white-space: pre-line; overflow-wrap: anywhere; }
.pp-card-t { font-size: 17px; font-weight: 700; line-height: 1.35; }
.pp-who { display: flex; align-items: center; gap: 6px; font-size: 14.5px; color: var(--muted); }
.pp-votes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-top: 4px; }
.pp-card-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.pp-card-btns .btn { flex: 1 1 140px; }

/* ---------- papiery ---------- */
.prep { max-width: 860px; margin: 0 auto; padding: 24px max(16px, env(safe-area-inset-right)) 40px max(16px, env(safe-area-inset-left)); display: flex; flex-direction: column; gap: 22px; }
.prep-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.prep-h h2 { font-size: 23px; }
.progs { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; }
.progs:empty { display: none; }
.prog { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 16px; display: flex; flex-direction: column; gap: 8px; }
.prog-h { display: flex; align-items: center; gap: 8px; font-size: 15.5px; }
.prog-h b { font-weight: 700; }
.prog-h span { margin-left: auto; color: var(--muted); font-size: 14.5px; }
.bar { height: 6px; border-radius: 3px; background: var(--panel); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--pc); border-radius: 3px; }
.ck-group h3 { font-size: 15px; color: var(--muted); padding: 0 4px 8px; }
.ck-group ul { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.ck-row { display: flex; align-items: center; gap: 14px; padding: 12px 14px; }
.ck-row + .ck-row { border-top: 1px solid var(--line); }
.tick { flex: none; display: grid; place-items: center; width: var(--tap); height: var(--tap); border-radius: 12px; border: 1.5px solid var(--line-strong); background: var(--surface); color: transparent; }
.tick:hover { border-color: var(--accent); }
.tick svg { width: 24px; height: 24px; }
.tick[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.ck-t { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ck-t b { font-weight: 600; }
.ck-row.done .ck-t b { color: var(--muted); }
.ck-t small { color: var(--muted); font-size: 14.5px; }
.ck-others { display: flex; gap: 4px; flex: none; }
.ini { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; font-size: 12px; font-weight: 700; border: 1.5px solid var(--line-strong); color: var(--muted); }
.ini.on { background: var(--pc); border-color: transparent; color: #fff; }
.ck-form { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.ck-form h3 { font-size: 16.5px; }
.ck-form .btn { align-self: flex-start; }
.disclaim { font-size: 14.5px; color: var(--muted); }
@media (max-width: 520px) {
  .two { grid-template-columns: 1fr; }
  .two.price-row { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
  .ck-row { flex-wrap: wrap; }
  .ck-others { margin-left: 58px; }
}
/* ---------- telefon / dotyk: cele min. 44 px ---------- */
@media (max-width: 759px), (pointer: coarse) {
  .chip, .seg button, .tchip, .mini-all, .linklike, .picked .linklike,
  .inline-form input, .inline-form .btn, .inline-confirm .btn { min-height: var(--tap); }
  .card-more { min-height: var(--tap); display: flex; align-items: center; }
  .picked .linklike { min-width: var(--tap); }
  .picked .linklike + .linklike { margin-left: 0; }
  .leaflet-touch .leaflet-bar a, .leaflet-bar a, .leaflet-bar a:hover { width: 44px !important; height: 44px !important; line-height: 44px !important; }
  .map-popup a.leaflet-popup-close-button { width: 44px; height: 44px; line-height: 44px; }
  .map-locate button, .ms-clear, .ms-go { width: 44px; height: 44px; }
  .pp-week summary { min-height: var(--tap); }
  .cal-scroll, .cols, .legs, .view { -webkit-overflow-scrolling: touch; }
}
/* telefon w poziomie (mało wysokości): boczna kolumna z filtrami, mapą i "Dodaj" po prawej, karty po lewej */
@media (min-width: 600px) and (max-width: 1023px) and (max-height: 560px) {
  .board-body { flex-direction: row; }
  .side { order: 2; width: 340px; overflow-y: auto; border-left: 1px solid var(--line); background: var(--bg); }
  .side .fbar { flex-wrap: wrap; overflow: visible; }
  .side .fbar > * + * { border-left: 0; padding-left: 0; }
  .mini { height: 170px; }
  .top { min-height: 52px; }
  .route-mode .map-body .map-stage { height: auto; flex: 1; }
  .route-mode .map-body { flex-direction: row; }
  .legs { flex: none; width: 340px; border-top: 0; border-left: 1px solid var(--line); }
  .toast { bottom: calc(16px + env(safe-area-inset-bottom)); }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; } .spinner { animation-duration: 2.4s; } }

/* ---------- telefon: zwarte paski nad kartami, więcej miejsca dla mini-mapy (komputer bez zmian) ---------- */
/* górny pasek ~44 px: mniejsza nazwa podróży i pigułka profilu (na bardzo wąskim ekranie sama kropka i zębatka) */
@media (max-width: 759px) {
  .top { min-height: 44px; padding-top: max(3px, env(safe-area-inset-top)); padding-bottom: 3px; padding-left: max(12px, env(safe-area-inset-left)); padding-right: max(12px, env(safe-area-inset-right)); }
  .trip-btn { min-height: 38px; gap: 8px; }
  .trip-ico { max-height: 28px; max-width: 88px; }
  .trip-name { font-size: 15.5px; }
  .me-btn { position: relative; min-height: 32px; gap: 6px; padding: 0 9px 0 10px; font-size: 13.5px; }
  .me-btn::before { content: ""; position: absolute; inset: -6px -4px; } /* cel dotyku ~44 px */
  .me-btn .dot { width: 10px; height: 10px; }
  .me-btn svg { width: 15px; height: 15px; }
}
@media (max-width: 359px) { .me-btn .me-name { display: none; } }

/* filtry: niższe chipy (~32 px), cel dotyku dalej 44 px (pseudo-element w pionowym paddingu paska); przewijanie w bok zostaje */
@media (max-width: 759px) {
  .fbar { padding-top: 6px; padding-bottom: 6px; gap: 6px; }
  .fbar .fgroup { gap: 5px; }
  .fbar > * + * { padding-left: 6px; }
  .fbar .chip, .fbar .seg button { position: relative; min-height: 32px; padding: 0 11px; gap: 6px; font-size: 13.5px; }
  .fbar .chip::after, .fbar .seg button::after { content: ""; position: absolute; left: 0; right: 0; top: -6px; bottom: -6px; }
  .fbar .chip .dot { width: 8px; height: 8px; }
  .fbar .chip .ctag-f { font-size: 14px; }
  .fbar .seg { padding: 2px; }
}

/* tablice poniżej 1024 px: mini-mapa wyżej (~40 % ekranu), bez osobnego rzędu "Dodaj / Zwiń mapę":
   "Zwiń mapę" to mały uchwyt na dolnej krawędzi mapy, "Dodaj …" to pływający przycisk nad dolną nawigacją */
@media (max-width: 1023px) {
  .mini { height: clamp(180px, 40svh, 440px); }
  .side-acts { position: relative; z-index: 650; height: 0; padding: 0; border: 0; background: none; }
  .mini-toggle {
    position: absolute; left: 50%; bottom: 0; transform: translateX(-50%);
    min-height: 30px; gap: 4px; padding: 0 12px; border-radius: 999px 999px 0 0; border-bottom: 0;
    background: var(--surface); box-shadow: var(--shadow); font-size: 13px;
  }
  .mini-toggle svg { width: 16px; height: 16px; }
  .mini-toggle::before { content: ""; position: absolute; left: -6px; right: -6px; top: -14px; bottom: 0; } /* cel dotyku 44 px */
  /* mapa zwinięta: uchwyt wisi pod paskiem filtrów (zaokrąglony od dołu) */
  .mini.collapsed + .side-acts .mini-toggle { bottom: auto; top: 0; border-radius: 0 0 999px 999px; border-top: 0; border-bottom: 1px solid var(--btn-border); }
  .mini.collapsed + .side-acts .mini-toggle::before { top: 0; bottom: -14px; }
  /* "Pokaż wszystkie" w prawym górnym rogu: dół środka zajmuje uchwyt, lewy górny zoom */
  .mini-all { left: auto; right: 10px; bottom: auto; top: 10px; min-height: 34px; padding: 0 12px; font-size: 13.5px; }
  .add-side {
    position: fixed; z-index: 1100; right: max(16px, env(safe-area-inset-right)); bottom: calc(16px + env(safe-area-inset-bottom));
    flex: none; min-height: 52px; padding: 0 18px 0 14px; border-radius: 999px; gap: 6px;
    background: var(--accent); color: var(--accent-ink); border-color: var(--accent); box-shadow: var(--shadow-lg); font-size: 15px;
  }
  .add-side:hover { background: var(--accent-strong); }
  /* ostatnia karta nie chowa się pod pływającym przyciskiem */
  .board .cols { padding-bottom: 84px; }
}
/* nad dolną nawigacją telefonu (60 px) */
@media (max-width: 759px) { .add-side { bottom: calc(60px + 14px + env(safe-area-inset-bottom)); } }
@media (max-width: 399px) { .add-side { min-height: 48px; padding: 0 14px 0 12px; font-size: 14.5px; } }
/* telefon w poziomie: boczna kolumna jak wcześniej (uchwyt pod mapą w kolumnie, mapa 170 px) */
@media (min-width: 600px) and (max-width: 1023px) and (max-height: 560px) {
  .mini { height: 170px; }
}

/* nagłówek kolumny osoby na telefonie: cienka linia ~28 px, kolor osoby tylko jako akcent z lewej */
@media (max-width: 759px) {
  .col-h {
    min-height: 28px; gap: 7px; margin: 6px 0 8px; padding: 3px 10px; border-top: 0; border-left: 3px solid var(--pc, var(--muted));
    border-radius: 0 var(--r-sm) var(--r-sm) 0; background: color-mix(in srgb, var(--pc, var(--muted)) 9%, var(--bg));
  }
  .col-h .dot { display: none; }
  .col-h h2 { font-size: 14.5px; line-height: 1.3; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .col-n { font-size: 13px; }
}

/* dymki map: treść nigdy wyższa niż mapa (--pop-max ustawia js/map.js), przewijana w środku; krzyżyk zawsze widoczny */
.map-popup .leaflet-popup-content { max-height: var(--pop-max, 60vh); overflow-y: auto; overscroll-behavior: contain; }
.map-popup a.leaflet-popup-close-button { z-index: 2; }
/* mini-mapa: mniejsze zdjęcie w dymku */
.mini .pop-rich .pop-photo { aspect-ratio: 21 / 9; }
@media (max-width: 759px) {
  .mini .map-popup .leaflet-popup-content { margin: 12px 14px; font-size: 14.5px; }
  .mini .pop { gap: 6px; min-width: 0; }
  .mini .pop h3 { font-size: 15.5px; }
}
