@import url('https://fonts.googleapis.com/css2?family=Baloo+2:wght@500;700;800&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,400;0,9..144,600;0,9..144,700;1,9..144,500&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Fraunces&family=Caveat:wght@600;700&family=Comfortaa:wght@600;700&family=Unbounded:wght@600;700&display=swap');

:root {
  --bg: #f4f1ea;
  --paper: #ffffff;
  --paper-glass: rgba(255,255,255,0.72);
  --border-glass: rgba(43,43,40,0.08);
  --ink: #2b2b28;
  --muted: #7a756a;
  --accent: #2f8f83;
  --accent-dark: #1c665c;
  --accent-text: #ffffff;
  --green: #5a7d5a;
  --border: #e3ddd0;
  --radius: 14px;
  --font-display: 'Comfortaa', -apple-system, BlinkMacSystemFont, sans-serif;
}

body.dark {
  --bg: #1c1b19;
  --paper: #26241f;
  --paper-glass: rgba(38,36,31,0.68);
  --border-glass: rgba(237,232,222,0.08);
  --ink: #ede8de;
  --muted: #9b9184;
  --accent: #4db3a5;
  --accent-dark: #6fcabd;
  --green: #7fa87f;
  --border: #3a3730;
}

/* ====== MOTYW "DZIENNIK PODRÓŻY" (eksperymentalny, przełączany w Ustawieniach) ======
   Nadpisuje TYLKO zmienne kolorów/typografii - reszta appki (HTML/JS) zostaje identyczna.
   Paleta: musztardowy ochre + szałwiowa zieleń zamiast pomarańczu bliskiego domyślnemu
   kolorowi generowanego designu. Fraunces zamiast Baloo 2 w nagłówkach. */
body.theme-journal {
  --bg: #ece0c4;
  --paper: #fbf5e6;
  --paper-glass: rgba(251,245,230,0.78);
  --border-glass: rgba(38,49,31,0.1);
  --ink: #26311f;
  --muted: #5c6650;
  --accent: #bd8324;
  --accent-dark: #8f611a;
  --green: #4c6b4f;
  --border: #d8c99a;
}
body.dark.theme-journal {
  --bg: #1b2118;
  --paper: #242b1f;
  --paper-glass: rgba(36,43,31,0.72);
  --border-glass: rgba(236,224,196,0.1);
  --ink: #ece0c4;
  --muted: #a8ad95;
  --accent: #d9a13f;
  --accent-dark: #e8b562;
  --green: #7a9a72;
  --border: #3a4530;
}
/* czcionka nagłówków - NIEZALEŻNA od wyboru tła, można łączyć dowolnie */
body.font-comfortaa { --font-display: 'Comfortaa', sans-serif; }
body.font-journal { --font-display: 'Fraunces', serif; }
body.font-quicksand { --font-display: 'Quicksand', sans-serif; }
body.font-abril { --font-display: 'DM Serif Display', serif; }
body.font-caveat { --font-display: 'Caveat', cursive; }
body.font-outfit { --font-display: 'Outfit', sans-serif; }
body.font-pacifico { --font-display: 'Satisfy', cursive; }
body.font-bebas { --font-display: 'Anton', sans-serif; }
body.font-josefin { --font-display: 'Josefin Sans', sans-serif; }
body.font-archivo { --font-display: 'Unbounded', sans-serif; }
/* akcenty sygnaturowe motywu dziennika - przerywana linia na górze kluczowych kart,
   żeby faktycznie było czuć różnicę, nie tylko w kolorach */
body.theme-journal .card {
  position: relative;
}
body.theme-journal #countdownCard::before,
body.theme-journal #tripHeroBox::before {
  content: '';
  position: absolute; top: 0; left: 14px; right: 14px; height: 4px;
  background: repeating-linear-gradient(90deg, var(--accent) 0 10px, transparent 10px 16px);
  border-radius: 0 0 4px 4px;
}
body.theme-journal .module-tile { border-width: 1px; position: relative; overflow: hidden; }
body.theme-journal .module-tile::before {
  content: '';
  position: absolute; top: 0; left: 10px; right: 10px; height: 3px;
  background: repeating-linear-gradient(90deg, var(--accent) 0 8px, transparent 8px 13px);
}
body.theme-journal h2, body.theme-journal h3 { letter-spacing: -0.01em; }
body.theme-journal .modal-box {
  position: relative;
  padding-top: 26px;
}
body.theme-journal .modal-box::before {
  content: '';
  position: absolute; top: 0; left: 20px; right: 20px; height: 4px;
  background: repeating-linear-gradient(90deg, var(--accent) 0 10px, transparent 10px 16px);
  border-radius: 0 0 4px 4px;
}
/* rozmyte tło z okładki wyprawy wyłączane osobno w motywie dziennika (przełącznik w
   Ustawieniach -> Styl appki) - domyślnie WYŁĄCZONE, bo płaskie tło lepiej pasuje do tego stylu */
body.flat-bg #bgBlurLayer { display: none; }
body.flat-bg { background: var(--bg); }
/* przyciski w stylu "pieczątki" - gruba obwódka + twardy, przesunięty cień, który wciska
   się przy kliknięciu - namacalny, fizyczny feel zamiast płaskiego przycisku */
body.theme-journal .btn.secondary, body.theme-journal button.secondary {
  border: 1.5px solid var(--border) !important;
  box-shadow: none !important;
  transition: transform 0.15s ease;
}
body.theme-journal .btn.secondary:hover, body.theme-journal button.secondary:hover { transform: translateY(-2px); }
body.theme-journal .btn:not(.secondary):not(.small):not(.btn-bare), body.theme-journal button:not(.secondary):not(.small):not(.del-btn):not(.btn-bare) {
  border: 2px solid var(--accent-dark) !important;
  box-shadow: 3px 3px 0 var(--accent-dark) !important;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
body.theme-journal .btn:not(.secondary):not(.small):not(.btn-bare):active, body.theme-journal button:not(.secondary):not(.small):not(.del-btn):not(.btn-bare):active {
  transform: translate(3px, 3px);
  box-shadow: 0 0 0 var(--accent-dark) !important;
}


#bgBlurLayer {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-size: cover;
  background-position: center;
  filter: blur(28px) brightness(0.9) saturate(1.1);
  transform: scale(1.15); /* ukryj rozmyte krawędzie po bokach */
  transition: background-image .4s ease;
}
body.dark #bgBlurLayer { filter: blur(28px) brightness(0.45) saturate(1.1); }

input, textarea, select {
  color: var(--ink);
  -webkit-text-fill-color: var(--ink);
}
#spotifyPlaylistUrlInput, #gamesTileSpotifyInput {
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg);
}
#headerSearchInput::placeholder { text-align: right; }
input::placeholder, textarea::placeholder {
  color: var(--muted);
  opacity: .55;
}
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--ink) !important;
  -webkit-box-shadow: 0 0 0px 1000px var(--bg) inset !important;
  transition: background-color 9999s ease-in-out 0s;
}

input[type=date], input[type=number], input[type=time], input[type=tel] {
  color-scheme: light;
}
body.dark input[type=date], body.dark input[type=number], body.dark input[type=time], body.dark input[type=tel] {
  color-scheme: dark;
}

body { transition: background .2s, color .2s; }
/* pod otwartym modalem strona w tle nie ma się dać przewijać - dotąd dało się scrollować
   zawartość pod spodem, co na dotykowych ekranach było mylące (nie było jasne, co się rusza) */
body.modal-open { overflow: hidden; }
.card, header.app-header, .day-card, .item-qty, .tab-btn { transition: background .2s, color .2s, border-color .2s; }

* { box-sizing: border-box; }

html { max-width: 100%; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--ink);
  padding-bottom: 8px;
  overflow-x: hidden;
  max-width: 100%;
}

.wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 16px 10px 8px;
}

header.app-header {
  background: var(--paper-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-glass);
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  position: sticky;
  top: 0;
  z-index: 20;
}
.app-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  position: relative;
}
header.app-header::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -2px;
  height: 2px;
  background: linear-gradient(90deg, var(--accent) 0%, transparent 60%);
  opacity: .6;
}

header.app-header h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 19px;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: -.01em;
}

.badge {
  font-size: 11px;
  color: var(--muted);
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 2px 8px;
  border-radius: 20px;
}

.card {
  background: var(--paper-glass);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 16px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.10), 0 1px 3px rgba(0,0,0,0.06);
}

.card h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  margin: 0 0 12px;
  color: var(--accent-dark);
  letter-spacing: -.01em;
}

.field-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.field {
  flex: 1;
  min-width: 130px;
}

.field label {
  display: block;
  font-size: 13.5px;
  color: var(--muted);
  margin-bottom: 4px;
}
/* nagłówki sekcji wyboru (Lodówka, Gaz, Jednostka wody) - wyraźnie większe i mocniejsze niż
   zwykłe etykiety pól, żeby lepiej oddzielić wizualnie kolejne "bloki" formularza pojazdu.
   Dodatkowy odstęp POD spodem, PRZED przyciskami - a przyciski same w sobie mają swój
   margin-bottom, więc odstęp do NASTĘPNEGO nagłówka też się robi zauważalny. */
.field label.section-heading-label {
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 8px;
}
/* kafle warunków specjalnych / krajów na trasie - to <label> owijające ukryty checkbox, ale
   wizualnie mają wyglądać jak przycisk (taki sam styl jak wybór Kamper/Hotel/Archiwalna), nie
   jak podpis pola formularza - .field label wyżej inaczej wygrywałoby kolorem/rozmiarem tekstu,
   bo te kafle też są zagnieżdżone wewnątrz .field jako kontenera układu */
.field label.condition-tile,
.field label.country-tile {
  color: white !important;
  font-size: 12px !important;
  margin-bottom: 0 !important;
}
.field label.condition-tile span,
.field label.country-tile span {
  color: inherit !important;
}
/* stan WYŁĄCZONY wyraźnie przygaszony - dotąd wyglądał tak samo jak każdy inny zwykły
   przycisk, więc nie było od razu widać, że to przełącznik i który stan jest aktualnie wybrany */
.field label.condition-tile:not(.active-toggle),
.field label.country-tile:not(.active-toggle) {
  opacity: .55;
}

.field input[type=number], .field input[type=text], .field input[type=tel], .field input[type=date], .field input[type=time], .field textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  font-size: 15px;
  background: var(--bg);
}
.field input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]) {
  background: var(--bg);
  color: var(--ink);
}
/* zabezpieczenie: każdy <select> bez własnego inline stylu ma poprawne tło zamiast
   domyślnego, białego (co w trybie ciemnym rzucało się w oczy jako "dziura" w interfejsie) */
select {
  background: var(--bg);
  color: var(--ink);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 9px 10px;
  font-size: 14px;
  font-family: inherit;
}

.checkbox-line {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  font-size: 14px;
  width: 100%;
  box-sizing: border-box;
  padding: 4px 0;
}

.checkbox-line input { width: 20px; height: 20px; }

button, .btn {
  border: none;
  cursor: pointer;
  border-radius: 12px;
  padding: 12px 18px;
  font-size: 15px;
  font-weight: 700;
  background: linear-gradient(90deg, var(--accent), var(--accent-dark));
  color: var(--accent-text, white);
  box-shadow: 0 3px 10px rgba(217,107,58,.22);
  transition: transform .12s ease, box-shadow .12s ease, background .15s;
}
button:hover { filter: brightness(1.04); }
button:focus { outline: none; }
button:active { transform: scale(0.97); box-shadow: 0 1px 4px rgba(217,107,58,.22); }
button.secondary {
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--border);
  box-shadow: none;
  font-weight: 600;
}
button.secondary:hover { background: var(--border); filter: none; }
button.secondary:active { transform: scale(0.97); box-shadow: none; }
/* to samo jako selektor KLASOWY (nie tylko element+klasa) - niektóre kafle na dashboardzie są
   teraz <div class="btn secondary"> zamiast <button>, żeby dało się zagnieździć w nich pola
   input/button (nieprawidłowy/niestabilny HTML wewnątrz <button>). Bez tego dublowania traciły
   całą stylizację "secondary" i spadały na bazowy, pomarańczowy gradient .btn. */
.btn.secondary:not(button) {
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--border);
  box-shadow: none;
  font-weight: 600;
}
.btn.secondary:not(button):hover { background: var(--border); filter: none; }
button.small { padding: 7px 12px; font-size: 13px; border-radius: 10px; }
button.danger { background: linear-gradient(90deg, #b34a3a, #8f3a2d); box-shadow: 0 3px 10px rgba(179,74,58,.25); }
button:disabled { opacity: 0.5; cursor: default; transform: none; }
button:disabled:hover { filter: none; }
button.secondary:disabled:hover { background: var(--paper); }

/* ====== PODZIAŁ GÓRNEJ SEKCJI WYPRAWY 50/50: zdjęcie po lewej, pogoda+trasa po prawej ====== */
@media (min-width: 980px) {
  #dziennikCollapseToggle { display: none !important; }
  /* na PC dolne menu mobilne jest ukryte (patrz niżej), więc nie potrzeba dużego zapasu
     miejsca pod treścią, który był zarezerwowany właśnie na nie. Wcześniej body+.wrap+#mainApp
     miały KAŻDY osobno po 20px, co się kumulowało do ~60px i dawało odrobinę zbędnego scrolla -
     teraz tylko jeden mały bufor na samym dole. */
  body { padding-bottom: 0; }
  .wrap { padding-bottom: 8px; }
  #tripCoverImage { height: 230px !important; }
  .modal-box { max-width: 560px; }
  .modal-box.modal-box-wide { max-width: 780px; }
  #tripTopSplitRow {
    display: flex;
    gap: 16px;
    align-items: stretch;
  }
  #tripTopSplitRow > #tripHeroBox,
  #tripTopSplitRow > #countdownCard {
    flex: 1 1 0;
    min-width: 0;
    margin-bottom: 0 !important;
  }
}

/* ====== KAFELKI MODUŁÓW (skrót informacji, klik otwiera pełną treść w modalu) - działa na wszystkich szerokościach ====== */
#moduleTilesGrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.module-tile {
  background: var(--paper-glass);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius);
  padding: 16px;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(0,0,0,0.10), 0 1px 3px rgba(0,0,0,0.05);
  transition: transform .18s ease, box-shadow .18s ease;
  min-height: 100px;
}
.module-tile:hover { transform: translateY(-3px); box-shadow: 0 14px 28px rgba(0,0,0,0.16), 0 2px 6px rgba(0,0,0,0.08); }
.module-tile-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.module-tile-title { font-family: var(--font-display); font-weight: 700; font-size: 17px; }
.card h2 i { color: var(--accent-dark); vertical-align: -2px; margin-right: 2px; }
#quickInfoBtnsRow { display: flex !important; }
#quickInfoBtnsRow:empty { display: none !important; }
.module-tile-title i { color: var(--accent-dark); vertical-align: -2px; margin-right: 2px; }
.module-tile-dots { color: var(--muted); font-weight: 700; }
.module-tile-line { font-size: 14.5px; color: var(--muted); padding: 3px 0; }
@media (max-width: 1199px) {
  #atAGlanceRow { flex-direction: column !important; }
  #showCrewBtn, #statsAndSavingsCol, #showItemsBtnWrap { flex: none !important; width: 100%; }
  #statsAndSavingsCol { flex-direction: row !important; gap: 10px !important; margin: 16px 0 !important; }
  #statsAndSavingsCol > #showStatsBtn, #statsAndSavingsCol > #savingsGoalCard { flex: 1 !important; min-width: 0 !important; max-width: 50% !important; }
  #dashboardCalWeatherRow { flex-direction: column !important; }
}
.countdown-weather-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: center;
}
.countdown-weather-grid > div { min-width: 0; overflow-x: auto; }
@media (max-width: 480px) {
  .countdown-weather-grid { grid-template-columns: 2fr 3fr !important; }
  .weather-hourly-row > div:nth-child(n+6) { display: none; }
}
@media (max-width: 979px) {
  #featuredTripInfoBlock { bottom: 52px !important; }
  #brandBannerSlogan { max-width: calc(100vw - 200px) !important; font-size: 13px !important; position: static !important; transform: none !important; text-align: left !important; }
  #headerSearchBar { flex: none !important; min-width: 0 !important; max-width: none !important; width: 38px !important; height: 38px !important; padding: 0 !important; justify-content: center; border-radius: 50% !important; }
  #headerSearchInput { display: none; }
  /* na telefonach kafel auta nie miał żadnej wymuszonej wysokości minimalnej (ta z reguły
     poniżej dotyczy tylko desktopu), więc kurczył się do naturalnej wielkości treści -
     za mało miejsca na sensowne pokazanie zdjęcia pojazdu */
  #carTrunkTileWrap { min-height: 190px; }
}
@media (min-width: 980px) {
  .module-tile { min-height: 130px; padding: 16px; display: flex; flex-direction: column; }
  .module-tile-title { font-size: 17px; }
  .module-tile-line { font-size: 14.5px; padding: 3px 0; }
}

.tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
  position: sticky;
  top: 58px;
  background: var(--bg);
  padding: 8px 0;
  z-index: 10;
}
.tab-btn {
  flex: 1;
  background: var(--paper);
  border: 1px solid var(--border);
  color: var(--muted);
  font-weight: 600;
  font-size: 13px;
  padding: 10px 6px;
  border-radius: 10px;
}
.tab-btn.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.tab-content { display: none; }
.tab-content.active { display: block; }
#tab-games.active { display: flex; flex-direction: column; min-height: 60vh; }
#spotifyPlaylistCard { margin-top: auto; }

.category {
  margin-bottom: 18px;
}
.category-title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  color: var(--green);
  letter-spacing: 0;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.cat-icon-badge {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.item-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 4px 9px 8px;
  border-bottom: 1px solid var(--border);
  border-left: 4px solid transparent;
  cursor: pointer;
  user-select: none;
  transition: background-color .35s ease, opacity .2s ease;
}
.item-row:last-child { border-bottom: none; }
.item-row:active { background: var(--bg); }
.item-row.just-moved { background: rgba(217,107,58,0.18); }
.day-card { transition: background-color .5s ease, box-shadow .5s ease; }
.day-card.just-moved { background: rgba(217,107,58,0.22); box-shadow: 0 0 0 2px var(--accent); }

/* ====== KAFELKI WYPRAW (Moje wyprawy) ====== */
.my-trips-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}
/* przy 0 wyprawach jest tylko kafelek "+dodaj", niech nie rozciąga się na całą szerokość */
.my-trips-grid[data-count="0"] { grid-template-columns: minmax(220px, 320px); }
/* przy dokładnie jednej wyprawie: 75/25 (wyprawa/dodaj) zamiast grid - łatwiej o dokładną proporcję */
.my-trips-grid[data-count="1"] { display: flex; gap: 14px; }
.my-trips-grid[data-count="1"] .trip-tile:not(.trip-tile-add) { flex: 3 1 0; min-width: 0; }
.my-trips-grid[data-count="1"] .trip-tile-add-narrow { flex: 1 1 0; max-width: none; min-width: 0; }

/* Moje wyprawy: karuzela z poziomym przewijaniem zamiast sztywnej siatki - eliminuje dziury
   w układzie zależne od reszty z dzielenia liczby wypraw przez liczbę kolumn, i przede wszystkim
   nie ma już kafelka "+dodaj" upychanego na 1/3 szerokości obok prawdziwych wypraw (ten przycisk
   przeniósł się do nagłówka karty, patrz #myTripsAddBtn) */
.trips-carousel {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  padding-bottom: 6px;
  -webkit-overflow-scrolling: touch;
}
.trips-carousel.single-trip { overflow-x: visible; }
.trips-carousel.single-trip .trip-tile { flex: 1 1 100%; }
.trips-carousel .trip-tile {
  flex: 0 0 240px;
  scroll-snap-align: start;
}
@media (min-width: 980px) {
  .trips-carousel .trip-tile { flex: 0 0 300px; }
}
.trips-carousel::-webkit-scrollbar { height: 6px; }
.trips-carousel::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
/* bąbelki klastra pinezek (Leaflet.markercluster) w kolorze aktualnego motywu, zamiast domyślnej
   żółto-pomarańczowej palety pluginu, która żyła własnym życiem niezależnie od theme'u appki */
.marker-cluster-small, .marker-cluster-medium, .marker-cluster-large { background-color: color-mix(in srgb, var(--accent) 35%, transparent); }
.translate-flag-btn:hover { opacity: 1 !important; transform: scale(1.15); background: var(--bg) !important; }
#budgetPieTile { padding-bottom: 20px !important; }
#dashboardTranslateFlagBtn:hover, .dashboard-translate-flag-option:hover { transform: scale(1.15); display: inline-block; }
.marker-cluster-small div, .marker-cluster-medium div, .marker-cluster-large div { background-color: var(--accent); color: #fff; font-weight: 700; }
.trip-tile {
  border: 1px solid var(--border-glass);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 0;
  background: var(--paper-glass);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 6px 18px rgba(0,0,0,0.10), 0 1px 3px rgba(0,0,0,0.05);
  transition: transform .18s ease, box-shadow .18s ease;
  display: flex;
  flex-direction: column;
  height: 100%;
}
.trip-tile:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 28px rgba(0,0,0,0.16), 0 2px 6px rgba(0,0,0,0.08);
}
.trip-tile-add {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  cursor: pointer;
  border: 1px solid var(--border-glass);
  background: var(--paper-glass);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 6px 18px rgba(0,0,0,0.10), 0 1px 3px rgba(0,0,0,0.05);
  position: relative;
  overflow: hidden;
  transition: transform .18s ease, box-shadow .18s ease;
}
.trip-tile-add:hover { transform: translateY(-3px); box-shadow: 0 14px 28px rgba(0,0,0,0.16), 0 2px 6px rgba(0,0,0,0.08); }
.trip-tile-add-narrow {
  max-width: 220px;
  min-height: 200px;
  justify-self: start;
}
.trip-tile-add-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-weight: 700;
  font-size: 14px;
}
.trip-tile-img {
  width: 100%;
  height: 130px;
  background-color: var(--bg);
  position: relative;
}
.trip-active-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(90,157,106,0.9);
  color: white;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 20px;
}
.at-a-glance-card { display: flex !important; flex-direction: column; }
#atAGlanceRow { display: flex !important; flex-direction: row; flex-wrap: nowrap; }
#atAGlanceRow.force-hidden { display: none !important; }
.glance-avatar {
  width: 116px;
  height: 116px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 40px;
  font-weight: 700;
  border: 2px solid var(--paper);
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  flex-shrink: 0;
}
.trip-tile-body {
  padding: 12px 14px;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.trip-tile-meta-wrap { flex: 1; }
.trip-tile-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 17px;
  margin-bottom: 3px;
  /* zawsze rezerwuj miejsce na DWIE linie, nawet gdy tytuł mieści się w jednej - inaczej dłuższy
     tytuł w jednej karcie ("Kuttenberg - Śladami Henryczka") łamał się na 2 linie i przesuwał w
     dół całą resztę TEJ karty (daty, statystyki, przycisk Otwórz) względem sąsiednich kart */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.25;
  min-height: calc(17px * 1.25 * 2);
}
.trip-tile-meta {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 10px;
}
.trip-tile-actions {
  display: flex;
  gap: 8px;
}
.trip-tile-actions .open-trip-btn { flex: 1; }
.trip-tile-actions .del-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--muted);
  font-size: 15px;
  padding: 6px 12px;
  cursor: pointer;
}
.trip-tile-actions .del-btn:hover { color: #b34a3a; border-color: #b34a3a; }

.item-row input[type=checkbox] {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  accent-color: var(--accent);
  pointer-events: none;
}

.item-row .item-name {
  flex: 1;
  font-size: 15px;
}
.item-row.checked .item-name {
  text-decoration: line-through;
  color: var(--muted);
}

.item-row .qty-control,
.item-row .reorder-controls,
.item-row .del-btn {
  cursor: default;
}

.item-qty {
  font-size: 12px;
  color: var(--muted);
  background: var(--bg);
  padding: 2px 8px;
  border-radius: 20px;
  min-width: 24px;
  text-align: center;
}

.qty-control {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.qty-btn {
  width: 24px;
  height: 24px;
  padding: 0;
  border-radius: 50%;
  background: var(--bg);
  color: var(--ink);
  border: 1px solid var(--border);
  font-size: 15px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.qty-btn:hover { background: var(--accent); color: white; }
.qty-value {
  min-width: 20px;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
}

.item-row .del-btn {
  background: none;
  color: var(--muted);
  font-size: 15px;
  padding: 6px 8px;
  margin-left: 6px;
  border-left: 1px solid var(--border);
  min-width: 32px;
  min-height: 32px;
}
.item-row .del-btn:hover { color: #b34a3a; }
/* Chowanie przycisków usuwania dotyczy tylko długich, auto-generowanych list (pakowanie,
   checklist auta), gdzie X-y wszędzie faktycznie zaśmiecają widok. Wszystko inne (dni,
   aktywności, bagażnik, schowki) to krótkie, ręcznie tworzone listy - usuwanie tam
   powinno być zawsze widoczne, bo to jedyny sposób na skasowanie własnego wpisu. */
body:not(.show-delete) #packingList .del-btn,
body:not(.show-delete) #carChecklist .del-btn,
body:not(.show-delete) .delete-trip-btn,
body:not(.show-delete) .trip-tile-actions .archive-trip-btn,
body:not(.show-delete) .day-delete-btn,
body:not(.show-delete) .activity-row .del-btn,
body:not(.show-delete) .activity-row .act-edit-btn,
body:not(.show-delete) #trunkBoxesList .del-btn,
body:not(.show-delete) .service-log-del-btn,
body:not(.show-delete) #homeStorageList .del-btn,
body:not(.show-delete) #quickTasksList .del-btn,
body:not(.show-delete) #expensesList .exp-edit-btn,
body:not(.show-delete) #addTripTemplatesBox .del-btn,
body:not(.show-delete) .vehicle-del-btn,
body:not(.show-delete) #crewTravelersList .del-btn,
body:not(.show-delete) #deleteTripBtn {
  display: none !important;
}
body:not(.show-delete) #trunkBoxesList .reorder-controls,
body:not(.show-delete) #homeStorageList .reorder-controls {
  display: none !important;
}

.add-item-row {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}
.add-item-row input {
  flex: 1;
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg);
}

.progress-wrap {
  height: 8px;
  background: var(--border);
  border-radius: 20px;
  overflow: hidden;
  margin: 10px 0 4px;
}
.progress-bar {
  height: 100%;
  background: var(--green);
  transition: width .3s;
}
.progress-label {
  font-size: 12px;
  color: var(--muted);
}

/* Kalendarz / dni wyprawy */
.day-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 12px;
  background: var(--bg);
}
.day-card .day-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.day-card .day-title-row input[type=text] {
  font-weight: 700;
  font-size: 15px;
  border: none;
  background: transparent;
  padding: 4px 0;
  width: 100%;
}
.day-city-badge {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 1px 8px;
  font-weight: 600;
  color: var(--muted);
}

.day-city-banner {
  width: 100%;
  height: 110px;
  border-radius: 12px;
  object-fit: cover;
  background: var(--paper);
  cursor: pointer;
  display: block;
  margin-bottom: 10px;
}

.bingo-cell {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 10px;
  font-weight: 600;
  padding: 6px;
  border-radius: 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  cursor: pointer;
  line-height: 1.2;
  color: var(--ink);
}
.bingo-cell.checked {
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: white;
  border-color: var(--accent);
}
.day-card textarea {
  width: 100%;
  min-height: 70px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
  background: var(--paper);
  color: var(--ink);
}

/* Aktywności w planie dnia */
.activities-list { display: flex; flex-direction: column; gap: 8px; }
.activity-row {
  display: flex;
  gap: 10px;
  background: var(--paper);
  border-radius: 12px;
  padding: 10px 12px;
  align-items: flex-start;
}
.activity-time-chip {
  flex-shrink: 0;
  color: white;
  font-size: 11px;
  font-weight: 700;
  padding: 5px 9px;
  border-radius: 20px;
  white-space: nowrap;
}
.activity-body { flex: 1; min-width: 0; }
.activity-title { font-size: 14px; font-weight: 700; margin-bottom: 2px; }
.activity-desc { font-size: 12px; color: var(--muted); line-height: 1.4; }
.activity-maps-btn {
  display: inline-block;
  margin-top: 6px;
  font-size: 11px;
  font-weight: 700;
  color: white;
  background: linear-gradient(90deg, var(--green), #4a6d4a);
  padding: 5px 10px;
  border-radius: 20px;
  text-decoration: none;
}
.activity-row .del-btn { flex-shrink: 0; border-left: none; margin-left: 0; }

.notes-textarea {
  width: 100%;
  min-height: 200px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  font-size: 15px;
  font-family: inherit;
  resize: vertical;
  background: var(--bg);
}

.sync-status {
  font-size: 12px;
  color: var(--muted);
  text-align: center;
  margin-top: 10px;
}
.sync-status.saving { color: var(--accent); }
.sync-status.saved { color: var(--green); }

.empty-hint {
  color: var(--muted);
  font-size: 14px;
  text-align: center;
  padding: 20px;
}

/* ====== MODALE (zamiast alert/confirm/prompt) ====== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 300;
  padding: 20px;
}
#moduleModalOverlay { z-index: 290; } /* pod #modalOverlay - potwierdzenia/mini-modale muszą się otwierać NAD widokiem modułu */
#noteModalOverlay { z-index: 295; }
body.dual-modal-active:not(.dual-note-left) #modalOverlay {
  padding-right: 50vw;
  pointer-events: none; /* dolny overlay w trybie dual - klik nie może "przebić się" do niego spod górnego */
}
body.dual-modal-active:not(.dual-note-left) #modalOverlay .modal-box {
  pointer-events: auto; /* ale sam box (treść modala) MUSI zostać klikalny */
}
body.dual-modal-active:not(.dual-note-left) #moduleModalOverlay {
  padding-left: 50vw;
  background: transparent;
  z-index: 301; /* nad #modalOverlay w tym trybie, żeby klik-poza-modalem działał na własnej połówce */
}
/* Notatnik jako jeden z aktywnej pary - zawsze po LEWEJ z pełnym przyciemnieniem, drugi
   (modalBox albo moduleModalBox, którykolwiek akurat jest otwarty) po PRAWEJ, transparentnie */
body.dual-note-left #noteModalOverlay {
  padding-right: 50vw;
  z-index: 302;
}
body.dual-note-left #modalOverlay, body.dual-note-left #moduleModalOverlay {
  padding-left: 50vw;
  padding-right: 0;
  background: transparent;
  z-index: 301;
  pointer-events: none;
}
body.dual-note-left #modalOverlay .modal-box, body.dual-note-left #moduleModalOverlay .modal-box {
  pointer-events: auto;
}
@media (max-width: 900px) {
  /* na wąskim ekranie dwa modale obok siebie nie mają sensu - wracamy do zwykłego, pełnoekranowego trybu jeden-na-raz */
  body.dual-modal-active #modalOverlay, body.dual-note-left #noteModalOverlay { padding-right: 20px; pointer-events: auto; }
  body.dual-modal-active #moduleModalOverlay, body.dual-note-left #modalOverlay, body.dual-note-left #moduleModalOverlay { padding-left: 20px; background: rgba(0,0,0,0.5); }
}
.modal-box {
  background: var(--paper);
  border-radius: var(--radius);
  padding: 24px;
  max-width: 440px;
  width: 100%;
  flex-shrink: 0;
  max-height: 88vh;
  overflow-y: auto;
  box-shadow: 0 8px 30px rgba(0,0,0,0.3);
}
.modal-box.modal-box-wide { max-width: 640px; }
.modal-box.modal-box-xwide { max-width: 68vw; }
@media (max-width: 900px) { .modal-box.modal-box-xwide { max-width: 96vw; } }
@media (min-width: 980px) {
  .modal-box { resize: both; overflow: auto; min-width: 320px; min-height: 200px; }
}
.modal-box h3 {
  margin: 0 0 10px;
  font-size: 16px;
  color: var(--ink);
}
@media (min-width: 700px) { .modal-box h3 { cursor: grab; user-select: none; } }
.modal-box h3 i { color: var(--accent-dark); vertical-align: -2px; margin-right: 2px; }
.modal-box p {
  margin: 0 0 16px;
  font-size: 14px;
  color: var(--ink);
  line-height: 1.4;
  white-space: pre-wrap;
}
.modal-box input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg);
  font-size: 15px;
  margin-bottom: 16px;
}
.modal-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  flex-wrap: wrap;
  margin: 14px -20px -18px;
  position: sticky;
  bottom: -4px;
  background: var(--paper);
  padding: 10px 20px 18px;
}
@media (max-width: 480px) {
  /* pasek "3 dni (2 noce) • km • ocena" nad kaflami - wyśrodkowany na wąskich ekranach zamiast
     space-between (które na mobile, z pustymi/małymi awatarami, wyglądało nierówno) */
  #desktopModuleNav {
    justify-content: center !important;
    text-align: center;
  }
  /* pasek ikon (edytuj/historia/pdf/udostępnij) na okładce wyprawy - za ciasno przy pełnym
     38px rozmiarze na wąskich ekranach, zmniejszamy i zawężamy odstęp, żeby zmieściły się
     ładnie po prawej stronie na wysokości awatarów, bez zawijania na nową linię */
  #tripHeroOverlay #editTripBtn, #tripHeroOverlay #tripHistoryBtn,
  #tripHeroOverlay #photoBookBtn, #tripHeroOverlay #exportPdfBtn, #tripHeroOverlay #shareBtn {
    width: 32px !important;
    height: 32px !important;
    font-size: 13px !important;
  }
  #tripHeroOverlay .trip-hero-icons-row { gap: 5px !important; }
  .modal-actions { justify-content: stretch; }
  .modal-actions button { flex: 1; min-width: 100px; padding: 12px 14px; }
  /* pola w modalach na telefonie - trochę większe, i font-size min 16px żeby iOS Safari nie
     dociągał zoomu przy focusowaniu (typowa mobilna irytacja) */
  .modal-box .field input[type=number], .modal-box .field input[type=text], .modal-box .field input[type=tel],
  .modal-box .field input[type=date], .modal-box .field input[type=time], .modal-box .field textarea,
  .modal-box select {
    font-size: 16px;
    padding: 12px 14px;
  }
}

/* ====== BANER OSTRZEGAWCZY (np. winiety) ====== */
.warning-banner {
  background: #a85a28;
  border: 1px solid #7a3410;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0,0,0,0.35);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13px;
  margin-bottom: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

/* ====== STRZAŁKI DO ZMIANY KOLEJNOŚCI ====== */
.reorder-controls {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin: 0 4px;
}
.reorder-btn {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 13px;
  line-height: 1;
  width: 30px;
  height: 26px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.reorder-btn:hover, .reorder-btn:active { color: white; background: var(--accent); border-color: var(--accent); }
.reorder-btn:disabled { opacity: 0.25; cursor: default; }
.reorder-btn:disabled:hover { color: var(--muted); background: var(--bg); border-color: var(--border); }

/* poziome menu modułów - między paskiem trasy a siatką sekcji, każda pozycja
   ma checkbox (widoczność) + klik w etykietę przewija do modułu. Uniwersalny styl (nie tylko
   desktop) - wcześniej cała stylistyka (tło/obwódka/padding) siedziała tylko w media query
   desktopowym, więc na mobile pasek był albo niewidoczny, albo gołym, niestylowanym rzędem */
#desktopModuleNav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
  margin-bottom: 16px;
  padding: 10px 14px;
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

/* ====== DELIKATNA ANIMACJA ZWIJANIA/ROZWIJANIA (karty, moduły, kategorie) ====== */
.collapsible-anim {
  display: grid;
  grid-template-rows: 1fr;
  transition: grid-template-rows .28s ease;
}
.collapsible-anim.collapsed { grid-template-rows: 0fr; }
.collapsible-anim-inner { overflow: hidden; min-height: 0; }
.module-header { display: none; }

.filter-pill {
  height: 30px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  font-size: 12px;
}

.category-tiles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}
.category-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 6px;
  border-radius: 14px;
  background: var(--paper);
  border: 1px solid var(--border);
  cursor: pointer;
  text-align: center;
  transition: transform .12s ease, box-shadow .12s ease;
}
.category-tile:hover { transform: translateY(-2px); box-shadow: 0 4px 10px rgba(0,0,0,0.08); }
.category-tile.expanded { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(217,107,58,0.15); }
.category-tile-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: white;
}
.category-tile-name { font-size: 11px; font-weight: 700; color: var(--ink); }
.category-tile-count { font-size: 10px; color: var(--muted); font-weight: 600; }

.btn.secondary.active-toggle {
  background: linear-gradient(90deg, var(--accent), var(--accent-dark));
  color: white;
  border-color: var(--accent);
  box-shadow: 0 3px 10px rgba(217,107,58,.22);
}

/* ====== MENU DOLNE (mobile bottom nav) ====== */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  gap: 10px;
  background: var(--paper);
  border-top: 1px solid var(--border);
  border-radius: 18px 18px 0 0;
  padding: 8px 6px calc(6px + env(safe-area-inset-bottom));
  z-index: 150;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.14);
}
.bottom-nav-group { display: flex; width: 100%; gap: 6px; }
@media (max-width: 979px) {
  body.has-bottom-nav-visible .wrap { padding-bottom: 54px; }
}
.bottom-nav-btn {
  flex: 1;
  background: none;
  border: none;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 7px 2px 6px;
  border-radius: 14px;
  cursor: pointer;
  box-shadow: none;
  font-weight: 600;
  position: relative;
  transition: color 0.15s, background 0.15s;
}
.bottom-nav-btn:hover { filter: none; }
.bottom-nav-btn:active { transform: scale(0.94); box-shadow: none; }
.bottom-nav-btn .bn-icon { font-size: 20px; line-height: 1; color: var(--muted); transition: color 0.15s; }
.bottom-nav-btn.active .bn-icon { color: var(--accent-dark); }
.bottom-nav-btn .bn-label { font-size: 9px; font-weight: 700; font-family: var(--font-display); letter-spacing: 0.01em; }
.bottom-nav-btn.active {
  color: var(--accent-dark);
}
.bottom-nav-btn.active::before {
  content: '';
  position: absolute;
  inset: 2px 6px;
  border-radius: 12px;
  background: var(--accent);
  opacity: 0.14;
  z-index: -1;
}
/* miejsce na tresc, zeby dolne menu nic nie zaslanialo */
#mainApp {
  padding-bottom: 78px;
}

/* ====== PODPOWIEDZI MIAST (autocomplete) ====== */
.autocomplete-list {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-top: 2px;
  max-height: 200px;
  overflow-y: auto;
  z-index: 30;
  display: none;
  box-shadow: 0 4px 14px rgba(0,0,0,0.15);
}
.autocomplete-list.show { display: block; }
.autocomplete-item {
  padding: 9px 12px;
  font-size: 14px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
}
.autocomplete-item:last-child { border-bottom: none; }
.autocomplete-item:hover { background: var(--bg); }

.top-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

/* ====== WYDRUK / PDF ====== */
#printArea { display: none; }

@media print {
  body * { visibility: hidden; }
  #printArea, #printArea * { visibility: visible; }
  #printArea {
    display: block;
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    color: #000;
    background: #fff;
  }
  #printArea h1 { font-size: 20px; margin-bottom: 2px; }
  #printArea .print-meta { font-size: 12px; color: #444; margin-bottom: 10px; }
  #printArea .print-columns {
    column-count: 2;
    column-gap: 28px;
  }
  #printArea .print-header-section {
    display: none; /* WYŁĄCZONE TESTOWO - podejrzenie, że to ta sekcja (column-span:all +
      break-after:avoid) powodowała dziwne łamanie stron przy niektórych skalach drukowania.
      Do przywrócenia (np. jako stopka) po potwierdzeniu, czy to naprawia problem. */
    column-span: all;
    break-after: avoid;
    margin-bottom: 6px;
  }
  #printArea .print-section {
    break-inside: avoid;
    margin-bottom: 10px;
  }
  #printArea h2 {
    font-size: 13px;
    text-transform: uppercase;
    border-bottom: 1px solid #999;
    padding-bottom: 3px;
    margin: 10px 0 6px;
    break-after: avoid;
  }
  #printArea .print-item {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    padding: 2px 0;
    border-bottom: 1px dotted #ccc;
  }
  #printArea .print-item .box { margin-right: 6px; }
  #printArea .print-day { margin-bottom: 6px; font-size: 12px; }
  #printArea .print-day strong { display: block; }
  #printArea a { color: #000; text-decoration: underline; }
}

/* ====== TRYB DESKTOPOWY: pełna szerokość + wszystkie sekcje jako moduły naraz ====== */
@media (min-width: 980px) {
  .wrap {
    max-width: none;
    padding: 28px 36px 40px;
  }
  header.app-header {
    padding: 0;
  }
  .app-header-inner {
    padding: 14px 36px;
  }

  .module-nav-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 20px;
    background: var(--bg);
    font-size: 13px;
    font-weight: 600;
    color: var(--ink);
  }
  .module-nav-item input[type=checkbox] { width: 14px; height: 14px; cursor: pointer; }
  .module-nav-item-label { cursor: pointer; }
  .module-nav-item-label:hover { color: var(--accent-dark); }
  .module-nav-item.module-hidden { opacity: .5; }
  .module-nav-cols-btn {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 4px 9px;
    font-size: 12px;
    font-weight: 700;
    color: var(--muted);
    cursor: pointer;
  }
  .module-nav-cols-btn.active-toggle { background: var(--accent); color: white; border-color: var(--accent); }

  /* imiona uczestników w rzędzie zamiast jeden pod drugim */
  #travelerNamesContainer {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }
  #travelerNamesContainer > div {
    flex: 1 1 220px;
    margin-bottom: 0 !important;
  }

  /* dolne menu niepotrzebne, gdy wszystko widać naraz - chowamy i dajemy miejsce z powrotem */
  #bottomNav { display: none !important; }
  /* miejsce po lewej na stałe menu boczne (fixed, position:left:16px) - bez tego przy
     wąskim .wrap (viewport bliski progowi 980-1600px) treść wyprawy nachodziła na menu,
     bo .wrap wtedy nie ma dużych marginesów bocznych i realnie zaczyna się blisko
     lewej krawędzi ekranu, tam gdzie stoi sidebar */
  #mainApp { padding-bottom: 0; }

  /* wszystkie sekcje wyprawy widoczne naraz jako moduły, w niezależnych kolumnach flex
     (celowo NIE grid — grid dzieli wiersze między kolumnami, więc zwinięcie modułu w jednej
     kolumnie zostawiałoby pustą lukę, jeśli sąsiad w tym samym "wierszu" siatki jest wyższy;
     flex daje każdej kolumnie niezależną wysokość, więc zwinięcie od razu podciąga resztę) */
  #desktopTabsGrid {
    display: flex;
    gap: 20px;
    align-items: flex-start;
  }
  .desktop-col {
    display: flex;
    flex-direction: column;
    gap: 20px;
    flex: 1;
    min-width: 0;
  }
  #desktopTabsGrid .tab-content {
    display: block !important;
    background: var(--paper);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
  }
  /* karty wewnątrz sekcji tracą własną ramkę, bo są już w ramce modułu */
  #desktopTabsGrid .tab-content > .card {
    border: none;
    box-shadow: none;
    padding: 0 0 18px;
    margin-bottom: 18px;
    border-bottom: 1px solid var(--border);
  }
  #desktopTabsGrid .tab-content > .card:last-child {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 0;
  }
  /* nagłówek modułu (wstawiany przez JS) - klikalny, zwija/rozwija całą sekcję */
  .module-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 600;
    color: var(--accent-dark);
    margin-bottom: 14px;
  }
  .module-chevron { transition: transform .2s; }
}

/* ====== KREATOR PODRÓŻY (wizard) ====== */
.wizard-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 200;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}
.wizard-card {
  max-width: 440px;
  margin: 0 auto;
  width: 100%;
  padding: 20px 20px 28px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100%;
  box-sizing: border-box;
}
@media (min-width: 980px) {
  .wizard-card { max-width: 780px; }
}
.wizard-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-shrink: 0;
}
.wizard-back, .wizard-close {
  background: var(--paper);
  border: 1px solid var(--border);
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 18px;
  color: var(--ink);
  flex-shrink: 0;
}
.wizard-dots { display: flex; gap: 6px; }
.wizard-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--border); transition: all .2s; }
.wizard-dot.active { background: var(--accent); width: 20px; border-radius: 4px; }
.wizard-dot.done { background: var(--accent-dark); }

.wizard-step-content { flex: 1; display: flex; flex-direction: column; animation: wizardFadeIn .25s ease; }
@keyframes wizardFadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.wizard-icon-circle {
  width: 76px; height: 76px; border-radius: 50%;
  background: var(--paper); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 34px; margin: 6px auto 16px;
  box-shadow: 0 4px 14px rgba(0,0,0,.06);
}
.wizard-title {
  font-family: var(--font-display);
  font-size: 25px; font-weight: 700; text-align: center;
  color: var(--accent-dark); margin-bottom: 6px;
}
.wizard-question { text-align: center; color: var(--muted); font-size: 14px; margin-bottom: 26px; }

.wizard-stepper-box {
  background: var(--paper); border: 1px solid var(--border); border-radius: 20px;
  padding: 28px 20px; text-align: center; box-shadow: 0 4px 16px rgba(0,0,0,.05); margin-bottom: 20px;
}
.wizard-stepper-value {
  font-family: var(--font-display); font-size: 52px; font-weight: 700; color: var(--accent);
  display: flex; align-items: baseline; justify-content: center; gap: 10px;
}
.wizard-stepper-value .unit { font-size: 17px; font-weight: 600; color: var(--ink); font-family: inherit; }
.wizard-stepper-btns { display: flex; justify-content: center; gap: 20px; margin-top: 20px; }
.wizard-round-btn {
  width: 52px; height: 52px; border-radius: 50%; border: none;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark)); color: white;
  font-size: 24px; display: flex; align-items: center; justify-content: center;
  cursor: pointer; box-shadow: 0 4px 10px rgba(217,107,58,.3);
}
.wizard-round-btn:active { transform: scale(0.94); }
.wizard-chips { display: flex; justify-content: center; gap: 10px; margin-top: 20px; flex-wrap: wrap; }
.wizard-chip {
  min-width: 44px; height: 44px; padding: 0 10px; border-radius: 22px;
  background: var(--bg); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px; cursor: pointer; color: var(--ink);
}
.wizard-chip.active { background: var(--accent); color: white; border-color: var(--accent); }

.wizard-input-box {
  background: var(--paper); border: 1px solid var(--border); border-radius: 16px;
  padding: 16px; margin-bottom: 20px;
}
.wizard-input-box input, .wizard-input-box select {
  width: 100%; border: none; background: transparent; font-size: 17px;
  text-align: center; color: var(--ink); font-family: inherit;
}
.wizard-input-box input:focus, .wizard-input-box select:focus { outline: none; }

.wizard-budget-options { display: flex; flex-direction: column; gap: 12px; margin-bottom: 20px; }
/* własny dymek zamiast natywnego, systemowego tooltipa przeglądarki (title=) - ten sam wygląda
   inaczej w każdym systemie/przeglądarce i nie da się go ostylować pod appkę */
.wizard-info-icon { position: relative; cursor: help; }
.wizard-info-icon::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  right: -8px;
  width: 220px;
  background: var(--ink);
  color: var(--paper);
  font-size: 11px;
  line-height: 1.4;
  font-weight: 400;
  padding: 8px 10px;
  border-radius: 8px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.3);
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px);
  transition: opacity .15s, transform .15s;
  z-index: 20;
  text-align: left;
}
.wizard-info-icon::before {
  content: '';
  position: absolute;
  bottom: 100%;
  right: 4px;
  border: 6px solid transparent;
  border-top-color: var(--ink);
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s;
  z-index: 20;
}
.wizard-info-icon:hover::after, .wizard-info-icon:hover::before { opacity: 1; transform: translateY(0); }

.wizard-budget-card {
  display: flex; align-items: center; gap: 14px; padding: 16px;
  border-radius: 16px; border: 2px solid var(--border); background: var(--paper); cursor: pointer;
}
.wizard-budget-card.active { border-color: var(--accent); background: rgba(217,107,58,0.07); }
.wizard-budget-icon { font-size: 28px; flex-shrink: 0; }
.wizard-budget-name { font-weight: 700; font-size: 15px; }
.wizard-budget-desc { font-size: 12px; color: var(--muted); }

.wizard-calendar { background: var(--paper); border: 1px solid var(--border); border-radius: 16px; padding: 16px; margin-bottom: 20px; }
.wizard-cal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; font-weight: 700; font-family: var(--font-display); }
.wizard-cal-nav {
  background: var(--bg); border: 1px solid var(--border); font-size: 16px; cursor: pointer;
  color: var(--ink); width: 30px; height: 30px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center; line-height: 1; padding: 0;
}
.wizard-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; text-align: center; }
.wizard-cal-dow { font-size: 11px; color: var(--muted); font-weight: 700; padding: 4px 0; }
.wizard-cal-day { padding: 9px 0; border-radius: 8px; cursor: pointer; font-size: 13px; }
.wizard-cal-day:hover { background: var(--bg); }
/* "dzisiaj" dostaje WŁASNY, odróżnialny kolor (nie ten sam co "wybrany dzień wyjazdu") -
   dotąd oba wyglądały bardzo podobnie (sama obwódka accent), łatwo je było pomylić */
.wizard-cal-day.today { border: 2px solid var(--green); font-weight: 700; color: var(--green); }
.wizard-cal-day.selected { background: var(--accent); color: white; font-weight: 700; border-color: var(--accent); }
/* kolejne dni wyjazdu (po pierwszym, który ma pełne wypełnienie) - sama obwódka, żeby zaznaczyć
   cały zakres bez robienia z tego jednej wielkiej plamy koloru */
.wizard-cal-day.in-range { border: 2px dashed var(--accent); font-weight: 700; }

.photo-picker-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.photo-picker-thumb {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  border-radius: 10px;
  cursor: pointer;
  border: 2px solid var(--border);
  background: var(--bg);
}
.photo-picker-thumb.selected { border-color: var(--accent); }
.photo-picker-thumb:hover { border-color: var(--accent); }
.wizard-cal-day.muted { color: var(--muted); opacity: .35; pointer-events: none; }
.wizard-skip-link { text-align: center; font-size: 12px; color: var(--muted); text-decoration: underline; cursor: pointer; margin-top: -8px; margin-bottom: 20px; }

.wizard-summary-row {
  display: flex; justify-content: space-between; padding: 10px 4px;
  border-bottom: 1px solid var(--border); font-size: 14px;
}
.wizard-summary-row:last-child { border-bottom: none; }
.wizard-summary-row span:first-child { color: var(--muted); }
.wizard-summary-row span:last-child { font-weight: 600; }

.wizard-cta {
  margin-top: auto;
  position: sticky;
  bottom: 8px;
  width: 100%; padding: 16px; border: none; border-radius: 16px;
  background: linear-gradient(90deg, var(--accent), var(--accent-dark)); color: white;
  font-size: 16px; font-weight: 700; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  box-shadow: 0 -4px 14px rgba(0,0,0,0.12), 0 3px 10px rgba(217,107,58,.22);
}
.wizard-cta:disabled { opacity: .5; cursor: default; }

/* ====== HERO BANNER WYPRAWY (tytuł + przyciski nałożone na zdjęcie okładki) ====== */
.trip-avatar-circle {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 13px;
  border: 2px solid var(--paper);
  flex-shrink: 0;
}
#tripHeroBox.has-cover .trip-avatar-circle { border-color: rgba(255,255,255,0.5); }
/* przyciski "Nowa wyprawa"/"Kreator"/"Mam kod" - ich funkcje przejął modal "Dodaj wyprawę" z siatki Moje wyprawy */
#showNewTripBtn, #showWizardBtn, #showJoinBtn { display: none !important; }

#tripHeroBox { background: var(--paper); border: 1px solid var(--border); }
#tripHeroOverlay { color: var(--ink); }
#tripHeroOverlay #tripMeta { color: var(--muted); }
#tripHeroBox.has-cover { border: none; }
#tripHeroBox.has-cover #tripHeroOverlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  background: linear-gradient(to top, rgba(0,0,0,0.75) 0%, rgba(0,0,0,0.15) 55%, rgba(0,0,0,0) 100%);
  padding: 14px 18px;
}
#tripHeroBox.has-cover #tripHeroOverlay > div { width: 100%; }
#tripHeroBox.has-cover #tripTitle { color: white; text-shadow: 0 1px 3px rgba(0,0,0,0.4); }
#tripHeroBox.has-cover #tripMeta { color: rgba(255,255,255,0.88); }
#tripHeroBox.has-cover .btn.secondary {
  background: rgba(255,255,255,0.18);
  border-color: rgba(255,255,255,0.35);
  color: white;
  backdrop-filter: blur(4px);
}
#tripHeroBox.has-cover .btn.secondary:hover { background: rgba(255,255,255,0.3); }

.card-optional {
  border: 2px dashed var(--border) !important;
  box-shadow: none !important;
}

.pct-slider { accent-color: var(--accent); height: 22px; width: 100%; }
.pct-slider-label { font-size: 11px; color: var(--muted); text-align: center; margin-top: 2px; }

/* ====== PASZPORT PODRÓŻY: stemple miast ====== */
.passport-stamp {
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 84px;
}
.passport-stamp-img {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background-color: var(--bg);
  background-size: cover;
  background-position: center;
  border: 3px dashed var(--accent);
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  transform: rotate(-4deg);
}
.passport-stamp:nth-child(even) .passport-stamp-img { transform: rotate(3deg); }
.passport-stamp-name {
  font-size: 11px;
  font-weight: 700;
  text-align: center;
  color: var(--ink);
  line-height: 1.2;
}

/* ====== SPLASH PRZY WEJŚCIU DO WYPRAWY ====== */
#tripSplash {
  transition: opacity .35s ease;
  opacity: 1;
}
#tripSplash.splash-hidden {
  opacity: 0;
  pointer-events: none;
}
#tripSplashLogo {
  animation: splashStinger .75s ease-out;
}
#tripSplashLogo.splash-reverse {
  animation-direction: reverse;
}
@keyframes splashStinger {
  0% { transform: scale(0.6); opacity: 0; }
  50% { transform: scale(1.08); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

/* ====== BOCZNE MENU EKRANU STARTOWEGO (tylko desktop, szeroki ekran) ====== */
#startScreenSidebar { display: none; }
@media (min-width: 1200px) {
  body { background: var(--bg); padding: 12px; position: relative; }
  body::before {
    content: '';
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 12px;
    background: var(--bg);
    z-index: 9999;
    pointer-events: none;
  }
  #startScreenSidebar.start-sidebar-visible {
    display: flex;
    flex-direction: column;
    gap: 2px;
    position: fixed;
    left: 12px;
    top: 12px;
    bottom: 12px;
    width: 220px;
    background: var(--accent-dark);
    border-right: none;
    border-radius: 20px 0 0 20px;
    padding: 16px 10px;
    box-shadow: 4px 0 20px rgba(0,0,0,0.15);
    z-index: 310;
    overflow-y: auto;
  }
  body.dark #startScreenSidebar.start-sidebar-visible { background: #1a1f14; }
  #startScreenSidebar button {
    background: none !important;
    border: none !important;
    box-shadow: none !important;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    border-radius: 10px;
    font-size: 18px;
    cursor: pointer;
    color: rgba(255,255,255,0.9);
    width: 100%;
    text-align: left;
  }
  #startScreenSidebar button:focus, #startScreenSidebar button:active { outline: none; box-shadow: none; }
  #startScreenSidebar button i { color: rgba(255,255,255,0.85); flex-shrink: 0; width: 22px; text-align: center; }
  #startScreenSidebar button { transition: background 0.15s ease, transform 0.15s ease, padding-left 0.15s ease; }
  #startScreenSidebar button:hover { background: rgba(255,255,255,0.1); transform: translateX(3px); }
  .sidebar-section-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.4);
    padding: 14px 14px 4px;
  }
  #startScreenSidebar button.active { background: var(--accent); }
  #startScreenSidebar button.active i { color: white; }
  #startScreenSidebar button.active span { color: white; }
  #startScreenSidebar button span { font-size: 14px; font-weight: 700; color: rgba(255,255,255,0.92); }
  body.has-start-sidebar .wrap { margin-left: 236px; }
  body.has-start-sidebar header.app-header { margin-left: 220px; border-radius: 0 16px 0 0; top: 12px; }
  body.has-start-sidebar #brandBannerImg { display: none; }
  body.has-start-sidebar #bgBlurLayer { display: none; }
  body.has-start-sidebar #showCrewBtn { display: none !important; }
  #showCrewBtn { display: none !important; }
}



/* ====== DWUKOLUMNOWY UKŁAD EKRANU STARTOWEGO (Moje wyprawy | Szybki start + At a glance + Auto) ====== */
#dashboardTopRow {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}
#dashboardColLeft, #dashboardColRight {
  flex: 1 1 0;
  min-width: 0;
}
#dashboardColLeft:empty, #dashboardColRight:empty { display: none; }
#dashboardCalWeatherRow:empty, #atAGlanceRow:empty { display: none !important; }
@media (max-width: 900px) {
  #dashboardTopRow { flex-direction: column; align-items: stretch; }
}

/* zwinięty notatnik na ekranie startowym ma tyle samo miejsca co baner Auto (150px) w prawej
   kolumnie, żeby obie kolumny kończyły się na tej samej wysokości */
#quickNoteCard { display: flex; flex-direction: column; }
#quickNoteCard.quick-note-collapsed { min-height: 150px; }

/* formularz "Nowa wyprawa" jako modal (dawniej sekcja na dole strony) - celowo BEZ zmiany
   mechanizmu pokazywania/ukrywania w JS (wciąż zwykłe display:block/none w wielu miejscach),
   tylko wizualnie podniesiony nad resztą strony jako wyśrodkowany, przesłonięty overlay */
#setupScreen[style*="display: block"] {
  position: fixed !important;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 250;
  width: 92%;
  max-width: 640px;
  max-height: 88vh;
  overflow-y: auto;
  box-shadow: 0 12px 40px rgba(0,0,0,0.5);
}
#setupScreenBackdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 249;
}
#setupScreenBackdrop.visible { display: block; }

/* wysuwane menu "Moje wyprawy" z lewej na PC (przycisk "Wyprawy" w bocznym menu) */
#tripsDrawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 400px;
  max-width: 90vw;
  background: var(--paper);
  z-index: 280;
  transform: translateX(-100%);
  transition: transform 0.25s ease;
  overflow-y: auto;
  padding: 20px;
  box-shadow: 4px 0 24px rgba(0,0,0,0.3);
}
#tripsDrawer.visible { transform: translateX(0); }
#tripsDrawerBackdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 270;
}
#tripsDrawerBackdrop.visible { display: block; }

/* magnesy z podróży jako prawdziwe pocztówki (biała "odbitka" + "znaczek" w rogu) - działa
   niezależnie od wybranego motywu/tła, biel jest zawsze biała, nie zmienna --paper (która
   w trybie ciemnym byłaby ciemna, psując cały efekt "pocztówki") */
.magnet-tile {
  box-shadow: 0 3px 8px rgba(0,0,0,0.25) !important;
  border: 4px solid #ffffff !important;
}
.magnet-tile:nth-child(3n) { transform: rotate(-2deg); }
.magnet-tile:nth-child(3n+1) { transform: rotate(1.5deg); }
.magnet-tile:nth-child(3n+2) { transform: rotate(-1deg); }
/* kółko w rogu magnesu - flaga kraju, skąd jest ta miejscowość (jeśli appka ją zna), inaczej
   po prostu puste, dekoracyjne kółko jak dawniej (patrz .magnet-flag-badge-empty) */
.magnet-flag-badge, .magnet-flag-badge-empty {
  position: absolute; top: 4px; right: 4px;
  width: 18px; height: 18px; border-radius: 50%;
  background: rgba(255,255,255,0.92);
  border: 1.5px dashed var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; line-height: 1;
}
.magnet-tooltip {
  position: fixed;
  z-index: 999;
  display: none;
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 12px;
  box-shadow: 0 8px 22px rgba(0,0,0,0.28);
  font-size: 12px;
  line-height: 1.4;
  pointer-events: none;
  max-width: 220px;
}
.cal-day-tooltip {
  position: fixed;
  z-index: 999;
  display: none;
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 7px 11px;
  box-shadow: 0 8px 22px rgba(0,0,0,0.28);
  font-size: 12px;
  line-height: 1.4;
  pointer-events: none;
  max-width: 260px;
}
.magnet-modal-img {
  border: 4px solid #ffffff;
  box-shadow: 0 4px 14px rgba(0,0,0,0.3);
}


/* ====== Style dawniej w osobnym pliku style-theme2.css - scalone tu, bo appka ma teraz
   tylko jedną wersję (index2.php zostało usunięte, to była testowa strona) ====== */
/* ====== TEST: głębsze wzmocnienie motywu "Dziennik podróży" na prawdziwych elementach
   appki (index2.php) - wyłącznie CSS, żadna logika JS się nie zmienia. Ładowane DODATKOWO
   po style.css, więc theme-journal (kolory/fonty) musi być już aktywny. ====== */

/* nowy układ strony wyprawy - jeden rząd pod okładką/odliczeniem, 4 kolumny: Dziennik | siatka
   4 modułów (Pakowanie/Plan dni/Gry/Notatnik+Podsumowanie, 2x2 - więcej miejsca niż przy 6) |
   Wydatki(donut)+Auto&Bagażnik | Mapa+Kalendarz - tylko na PC, na telefonie jedno pod drugim */
@media (min-width: 980px) {
  #moduleTilesRow { display: flex !important; gap: 16px; align-items: stretch; max-height: calc(100vh - 420px); min-height: 480px; }
  #dziennikTileWrap { flex: 1 1 24%; max-height: calc(100vh - 550px); min-height: 0; overflow-y: auto; }
  #dziennikList { min-height: 0; }
  #moduleTilesGrid {
    flex: 1 1 30%;
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    grid-template-rows: repeat(2, minmax(min-content, 1fr)) !important;
    gap: 12px;
    min-height: 0;
    align-self: stretch;
  }
  #moduleTilesGrid .module-tile { min-height: 0; height: 100%; }
  #dziennikTileWrap, #budgetNotesStack, #mapCalendarStack { align-self: stretch; }
  #budgetNotesStack, #mapCalendarStack { flex: 1 1 23%; display: flex !important; min-height: 0; }
  #budgetPieTile { min-height: 300px; }
  #tripMapSidebar, #tripCalendarWidget { min-height: 0 !important; }
}

/* kafle wypraw jako bilety - przerywana linia u dołu (zamiast zwykłego zaokrąglenia) */
.trip-tile {
  border-radius: 12px !important;
  overflow: visible !important;
}
.trip-tile-img { border-radius: 12px 12px 0 0 !important; }
.trip-tile-body {
  position: relative;
  border-top: 2px dashed var(--border);
}
.trip-tile-body::before, .trip-tile-body::after {
  content: '';
  position: absolute; top: -7px; width: 14px; height: 14px; border-radius: 50%;
  background: var(--bg);
}
.trip-tile-body::before { left: -7px; }
.trip-tile-body::after { right: -7px; }

/* kafle modułów wewnątrz wyprawy - przerywana linia na górze, jak na pozostałych kartach */
.module-tile { position: relative; overflow: hidden; }
.module-tile::before {
  content: '';
  position: absolute; top: 0; left: 10px; right: 10px; height: 3px;
  background: repeating-linear-gradient(90deg, var(--accent) 0 8px, transparent 8px 13px);
}

/* pasek trasy (miasta oddzielone strzałkami) - podkreślenie przerywaną linią, żeby
   wizualnie sugerowało trasę, nie tylko listę tekstową */
#routeCitiesRow {
  border-bottom: 2px dashed var(--border);
  padding-bottom: 10px;
}

/* ====== ODWAŻNIEJSZY PRZEJŚCIE - wygląd bliżej mockupu, nie tylko pojedyncze detale ====== */

/* wszystkie karty: grubsza, wyraźniejsza obwódka zamiast delikatnego cienia - bardziej
   "papierowy", rysowany charakter niż typowy miękki cień SaaS-owych kart */
.card, header.app-header, .day-card {
  box-shadow: none !important;
  border: 1.5px solid var(--border) !important;
}

/* nagłówek appki - większy, wyrazistszy tytuł w Fraunces */
.app-header .brand-name, #brandBannerImg + span, header.app-header h1 {
  font-family: var(--font-display);
  font-weight: 700;
}

/* przyciski drugorzędne (btn secondary) - bardziej "papierowe", grubsza obwódka,
   bez cienia, delikatny obrót przy najechaniu */
.btn.secondary, button.secondary {
  border: 1.5px solid var(--border) !important;
  box-shadow: none !important;
  transition: transform 0.15s ease;
}
.btn.secondary:hover, button.secondary:hover { transform: translateY(-2px); }

/* przycisk główny (akcja pierwszoplanowa) - grubsza, "pieczątkowa" obwódka */
.btn:not(.secondary):not(.small):not(#startScreenSidebar button), button:not(.secondary):not(.small):not(.del-btn):not(#startScreenSidebar button) {
  border: 2px solid var(--accent-dark) !important;
  box-shadow: 3px 3px 0 var(--accent-dark) !important;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.btn:not(.secondary):not(.small):active, button:not(.secondary):not(.small):not(.del-btn):active {
  transform: translate(3px, 3px);
  box-shadow: 0 0 0 var(--accent-dark) !important;
}

/* kafle pogody - zaokrąglone bardziej, żeby pasowały do reszty "miękkich" kształtów */
.weather-day-tile {
  border-radius: 12px !important;
  border-width: 1.5px !important;
}

/* liczby odliczania / duże liczby - Fraunces, większy kontrast */
#countdownDisplay, .countdown-num, .wizard-stepper-value {
  font-family: var(--font-display) !important;
}

/* avatary uczestników - grubsza biała obwódka jak na "przypiętych" znaczkach */
.avatar-circle, .traveler-avatar {
  border: 2.5px solid var(--paper) !important;
  box-shadow: 0 2px 6px rgba(38,49,31,0.2);
}

/* pola formularzy - grubsza obwódka, bez zaokrąglenia typowego dla SaaS-owych inputów */
input[type=text], input[type=number], input[type=date], input[type=time], textarea, select {
  border: 1.5px solid var(--border) !important;
}

/* pasek pogody jako jednolita, ciemna "wstążka" (jak w mockupie) - CAŁY kontener jako jedna
   karta, nie osobne pudełka na etykietę/dni/ostrzeżenia (to dawało puste, ciemne prostokąty
   tam gdzie nie było treści) */
#countdownWeather {
  background: var(--green) !important;
  border-radius: 14px !important;
  padding: 12px 14px !important;
}
#countdownWeather > div:first-child {
  font-size: 11px !important;
  color: rgba(255,255,255,0.8) !important;
  margin-bottom: 8px !important;
}
.weather-days-row { gap: 6px !important; }
#countdownWeather .weather-day-tile {
  background: rgba(255,255,255,0.1) !important;
  border: none !important;
  border-radius: 10px !important;
}
#countdownWeather .weather-day-tile div { color: white !important; }
#countdownWeather .weather-day-tile div:first-child { color: rgba(255,255,255,0.7) !important; font-size: 9.5px !important; }

.route-add-city-sep:hover { opacity: 1 !important; }
/* "+" między miastami na trasie NIE ma dostawać "pieczątkowego" stylu przycisków (gruba
   obwódka + cień) - łapał się w niego przypadkiem, bo to zwykły <button> bez klasy .small */
/* "gołe" przyciski (bez oprawy przycisku appki) - appearance:none jest KLUCZOWE, inaczej
   niektóre przeglądarki (np. Firefox mobilny) i tak pokazują natywną ramkę/tło przycisku
   mimo border:none/background:none */
.btn-bare {
  appearance: none !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
}
.route-add-city-btn {
  border: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  background: none !important;
  padding: 0 !important;
  appearance: none !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
}
#tripCalendarSidebarInner {
  background: var(--paper) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

/* kafle "Na szybko" (Waluty/Tłumacz/Notatnik/Dodaj wydatek) jako karteczki z małym "dziurkaczem"
   u góry - jak bilet/kupon, spójnie z resztą "papierowej" estetyki dziennika */
#dashboardMiniRow .btn.secondary {
  position: relative;
  overflow: visible;
}
#dashboardMiniRow .btn.secondary::before {
  content: '';
  position: absolute; top: -6px; left: 50%; transform: translateX(-50%);
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--bg);
  border: 1px solid var(--border);
}

/* okładka wyprawy: zdjęcie wypełnia CAŁĄ wysokość, nazwa/przyciski nałożone na wierzch
   z ciemnym gradientem TYLKO za tekstem. Appka ma już mechanizm .has-cover w produkcyjnym
   style.css robiący dokładnie to - ale z NIŻSZĄ specyficznością niż potrzeba tutaj, więc
   nadpisuję go jawnie i maksymalnie jednoznacznie, żeby nic nie zostawało do interpretacji */
#tripHeroBox {
  position: relative !important;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark)) !important;
  min-height: 190px !important;
  display: flex !important;
  flex-direction: column !important;
}
#tripCoverImage {
  position: relative !important;
  flex: 1 1 auto !important;
  height: auto !important;
  min-height: 190px !important;
  width: 100% !important;
}
#tripHeroOverlay {
  position: absolute !important;
  inset: auto 0 0 0 !important;
  display: block !important;
  background: linear-gradient(to top, rgba(20,25,15,0.82) 0%, rgba(20,25,15,0.4) 55%, transparent 100%) !important;
  padding: 50px 18px 14px !important;
  margin: 0 !important;
}
#tripHeroOverlay #tripTitle, #tripHeroOverlay #tripMeta {
  color: white !important;
  text-shadow: 0 1px 4px rgba(0,0,0,0.5);
}

@media (min-width: 900px) {
  /* kolejne działy statystyk podróży w dwóch kolumnach - modal jest teraz dość szeroki
     (.modal-box-xwide), żeby to miało sens; pierwsza karta (ogólne podsumowanie liczbowe)
     zostaje na pełną szerokość, bo to nagłówkowe liczby, nie "dział" do zestawiania w rzędzie */
  #statsResults { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; align-items: start; }
  #statsResults > .card:first-child { grid-column: 1 / -1; }
}

@media (max-width: 979px) {
  /* na mobilce #moduleTilesRow nie jest flexem (brak gap), więc kafle stykały się bez żadnego
     odstępu - na desktopie o to samo już dba gap flexboxa, stąd margines tylko tutaj */
  #dziennikTileWrap { margin-bottom: 16px; }
  #mapCalendarStack { margin-top: 16px; }
  /* ostatni kafel modułu (najczęściej Auto/Bagażnik) wewnątrz wyprawy nie powinien nieść
     własnego marginesu na dole - kumulował się z globalnym odstępem przed dolnym menu, dając
     większą lukę niż na dashboardzie, gdzie tego problemu nie było */
  #moduleTilesRow > *:last-child { margin-bottom: 0 !important; }
  #carTrunkTileWrap { min-height: 230px !important; }
  /* mapa + siatka 2x2 (Waluty/Tłumacz/Notatnik/Wydatek) obok siebie ma sens tylko na desktopie
     - na wąskim ekranie ściskały się w nieczytelną kolumnę. Na mobilce: mapa na całą szerokość,
     siatka pod spodem. */
  #dashboardMiniRow { flex-direction: column; }
  #miniTravelMapTile { aspect-ratio: 16/9 !important; }
  #dashboardQuickGrid { flex: none !important; height: 340px; margin-top: 10px; }
}


/* licznik km na kaflu pojazdu w stylu analogowego licznika samochodowego - ciemne okienko,
   jasne cyfry monospace z lekkim odstępem, wgłębiony cień jak prawdziwy drum-counter */
.odometer-display {
  display: inline-flex;
  align-items: center;
  background: #1a1a1a;
  color: #e8e2c8;
  font-family: 'Courier New', monospace;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 2px;
  padding: 3px 8px;
  border-radius: 4px;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.6), inset 0 -1px 0 rgba(255,255,255,0.05);
  border: 1px solid #000;
}

@media (max-width: 979px) {
  /* przycisk zwijania Dziennika - tylko na mobilce, gdzie dużo dni oznacza dużo scrollowania.
     Na desktopie kolumna i tak ma ograniczoną wysokość ze scrollem wewnętrznym. */
  #dziennikCollapseToggle { display: inline-block !important; }
}

.theme-switch-toggle {
  position: relative;
  width: 60px;
  height: 32px;
  border-radius: 16px;
  background: var(--accent-dark);
  border: none;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  box-shadow: none;
}
.theme-switch-toggle::before {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: white;
  transition: transform 0.2s ease;
  z-index: 1;
}
body.dark .theme-switch-toggle::before { transform: translateX(28px); }
.theme-switch-icon {
  position: relative;
  z-index: 2;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: rgba(255,255,255,0.6);
}
.theme-switch-sun { color: var(--accent-dark); }
body.dark .theme-switch-sun { color: rgba(255,255,255,0.5); }
body.dark .theme-switch-moon { color: white; }
@media (min-width: 980px) {
  .spotify-mobile-only, .spotify-mobile-hint { display: none; }
}
@media (max-width: 979px) {
  .spotify-desktop-hint { display: none; }
}
#sidebarSpotifyEmbed.sidebar-spotify-minimized { height: 0; overflow: hidden; margin-top: 0; }
