:root {
  --bg: #f4f1ea;
  --bg-accent: #ebe4d8;
  --card: #ffffff;
  --text: #1a202c;
  --muted: #64748b;
  --primary: #1a365d;
  --primary-light: #2c5282;
  --accent: #c05621;
  --accent-soft: #fffaf0;
  --border: #e2e8f0;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 2px 8px rgba(26, 54, 93, 0.08);
  --nav-h: 2.85rem;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --confirmed: #276749;
  --confirmed-bg: #f0fff4;
  --imported: #2b6cb0;
  --imported-bg: #ebf8ff;
  --pending: #b7791f;
  --pending-bg: #fffaf0;
}

* { box-sizing: border-box; }

html {
  height: 100%;
  height: -webkit-fill-available;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

body.has-bottom-nav {
  padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px));
}

a { color: var(--primary-light); text-decoration: none; }
a:hover { text-decoration: underline; }

.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 1rem 1rem calc(var(--nav-h) + var(--safe-bottom) + 1.5rem);
  width: 100%;
}

.page-guest .container {
  padding-bottom: 2rem;
}

/* Top bar */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: .85rem 1rem;
  padding-top: calc(.85rem + env(safe-area-inset-top, 0px));
  background: var(--primary);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 20;
}

.topbar__brand { min-width: 0; }

.brand {
  display: block;
  font-weight: 700;
  font-size: 1.05rem;
  color: #fff;
  text-decoration: none;
}

.topbar__trip {
  display: block;
  font-size: .75rem;
  opacity: .85;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar__logout {
  flex-shrink: 0;
  color: rgba(255,255,255,.9);
  font-size: .85rem;
  text-decoration: none;
}

.topbar__actions {
  display: flex;
  align-items: center;
  gap: .65rem;
  flex-shrink: 0;
}

.topbar__search {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.15rem;
  height: 2.15rem;
  border-radius: 999px;
  color: rgba(255,255,255,.92);
  text-decoration: none;
  background: rgba(255,255,255,.12);
  -webkit-tap-highlight-color: transparent;
}

.topbar__search svg {
  width: 1.05rem;
  height: 1.05rem;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
}

.topbar__search:hover,
.topbar__search.is-active {
  background: rgba(255,255,255,.22);
  text-decoration: none;
  color: #fff;
}

/* Bottom nav */
.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  width: 100%;
  margin: 0;
  background: #fff;
  border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  box-shadow: 0 -1px 0 rgba(26, 54, 93, .04), 0 -8px 24px rgba(26, 54, 93, .06);
}

.bottom-nav__item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: var(--nav-h);
  padding: .35rem .15rem .3rem;
  color: var(--muted);
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  transition: color .15s ease;
}

.bottom-nav__item:hover,
.bottom-nav__item:focus-visible {
  color: var(--primary-light);
  text-decoration: none;
}

.bottom-nav__item.is-active {
  color: var(--primary);
}

.bottom-nav__item.is-active::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 1.1rem;
  height: 2px;
  border-radius: 1px;
  background: var(--primary);
}

.bottom-nav__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.35rem;
  height: 1.35rem;
}

.bottom-nav__svg {
  width: 100%;
  height: 100%;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.bottom-nav__item.is-active .bottom-nav__svg {
  stroke-width: 2;
}

/* Cards */
.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  margin-bottom: .85rem;
  box-shadow: var(--shadow);
  border: 1px solid rgba(226, 232, 240, .8);
}

.card--accent { border-left: 4px solid var(--accent); }
.card--muted { background: var(--bg-accent); border-style: dashed; }
.card--highlight { background: linear-gradient(135deg, #fff 0%, var(--accent-soft) 100%); }

.card__title {
  margin: 0 0 .75rem;
  font-size: 1rem;
}

.card__head-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .75rem;
  margin-bottom: .75rem;
}

.card__head-row .card__title { margin: 0; }

/* Hero */
.hero {
  margin-bottom: 1rem;
  padding: .25rem 0 .5rem;
}

.hero--compact h1 { font-size: 1.45rem; margin: .35rem 0; }
.hero--pre-trip h1 { font-size: 1.6rem; line-height: 1.25; }

.hero__top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
}

.hero h1 { margin: .35rem 0; font-size: 1.75rem; line-height: 1.2; }

.day-photo-hint {
  margin: -.5rem 0 1rem;
  font-size: .78rem;
}

.img--placeholder {
  object-fit: contain !important;
  background: #edf2f7;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: .07em;
  font-size: .72rem;
  color: var(--muted);
  margin: 0;
  font-weight: 600;
}

.lead { font-size: 1.05rem; margin: .45rem 0; }
.hero__summary, .section-intro { color: var(--muted); font-size: .95rem; margin: .5rem 0 0; }
.hero__dates { color: var(--muted); font-size: .9rem; margin: .35rem 0 0; }

.muted { color: var(--muted); }

/* Badges */
.badge {
  display: inline-block;
  padding: .2rem .55rem;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .02em;
  white-space: nowrap;
}

.status-confirmed { background: var(--confirmed-bg); color: var(--confirmed); }
.status-imported { background: var(--imported-bg); color: var(--imported); }
.status-pending { background: var(--pending-bg); color: var(--pending); }
.status-default { background: #edf2f7; color: var(--muted); }

/* Day cards */
.day-list {
  display: flex;
  flex-direction: column;
  gap: .65rem;
}

.day-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: inherit;
  transition: border-color .15s, box-shadow .15s;
  position: relative;
}

.day-card__banner {
  width: 100%;
  height: 110px;
  object-fit: cover;
  display: block;
}

.day-card__row {
  display: grid;
  grid-template-columns: 4.5rem 1fr;
  gap: .75rem;
  padding: .85rem;
}

.day-card:hover {
  text-decoration: none;
  border-color: var(--primary-light);
  box-shadow: var(--shadow);
}

.day-card--active {
  border-color: var(--primary);
  background: linear-gradient(135deg, #fff 0%, #ebf4ff 100%);
}

.day-card__date {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: .45rem .35rem;
  min-height: 3.5rem;
}

.day-card__dow {
  font-weight: 800;
  font-size: .85rem;
  color: var(--primary);
  line-height: 1.2;
}

.day-card__num {
  font-size: .68rem;
  color: var(--muted);
  margin-top: .15rem;
}

.day-card__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: .5rem;
}

.day-card__head strong {
  font-size: .95rem;
  line-height: 1.35;
}

.day-card__meta {
  margin: .25rem 0 0;
  font-size: .82rem;
  color: var(--muted);
}

.day-card__summary {
  margin: .35rem 0 0;
  font-size: .82rem;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Stats */
.stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .5rem;
  margin-bottom: 1rem;
}

.stat {
  background: #fff;
  border-radius: var(--radius-sm);
  padding: .65rem .5rem;
  text-align: center;
  border: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
  transition: border-color .15s, box-shadow .15s;
}

.stat:hover {
  border-color: var(--primary-light);
  box-shadow: 0 2px 8px rgba(26,54,93,.08);
}

.stat--active {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(26,54,93,.12);
}

.stat--confirmed.stat--active { border-color: var(--confirmed); }
.stat--imported.stat--active { border-color: var(--imported); }
.stat--pending.stat--active { border-color: var(--pending); }

.stat__n {
  display: block;
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--primary);
}

.stat__l {
  display: block;
  font-size: .68rem;
  color: var(--muted);
  margin-top: .15rem;
}

/* Timeline */
.timeline {
  list-style: none;
  padding: 0;
  margin: 0;
}

.timeline__item {
  padding: 0 0 .75rem;
}

.timeline__item:last-child { padding-bottom: 0; }

.timeline__card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.timeline__time {
  display: inline-block;
  margin: .65rem .75rem 0;
  padding: .22rem .62rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: .82rem;
  font-weight: 800;
  letter-spacing: .02em;
  line-height: 1.3;
}

.timeline__row {
  display: flex;
  align-items: flex-start;
  gap: .65rem;
  padding: .55rem .75rem .65rem;
}

.timeline__text {
  flex: 1;
  min-width: 0;
}

.timeline__title {
  margin: 0 0 .3rem;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.25;
  color: var(--text);
}

.timeline__desc {
  margin: 0;
  font-size: .92rem;
  line-height: 1.45;
  color: #475569;
}

.timeline__footer {
  padding: 0 .75rem .7rem;
}

.timeline__chips {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
}

.timeline__chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .35rem;
  min-height: 2.35rem;
  padding: .4rem .72rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  color: var(--primary);
  font-size: .8rem;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background .15s ease, border-color .15s ease;
}

.timeline__chip svg {
  width: 1rem;
  height: 1rem;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

.timeline__chip:hover,
.timeline__chip:focus-visible {
  border-color: var(--primary-light);
  background: rgba(26, 54, 93, .05);
  text-decoration: none;
  color: var(--primary);
}

.timeline__chip[aria-expanded="true"] {
  border-color: var(--primary-light);
  background: rgba(26, 54, 93, .08);
}

html.pwa-maps-click .timeline__text[data-maps-nav] {
  cursor: pointer;
}

html.pwa-maps-click .timeline__text[data-maps-nav] .timeline__title::after {
  content: ' · mapa';
  font-size: .72rem;
  font-weight: 600;
  color: var(--primary-light);
}

.timeline__row .media-thumb {
  margin: 0;
  align-self: flex-start;
  width: 4.5rem;
  height: 4.5rem;
  border-radius: .55rem;
}

.item-note--compact,
.item-gallery--compact {
  flex: 1 1 100%;
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  align-items: center;
  max-width: 100%;
}

.item-note--compact .item-note__toggle,
.item-gallery--compact .item-gallery__toggle {
  position: relative;
}

.item-note--compact .item-note__panel,
.item-gallery--compact .item-gallery__panel {
  flex: 0 0 100%;
  width: 100%;
  margin: .15rem 0 0;
  padding: .65rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
}

.item-note--compact .item-note__dot {
  position: absolute;
  top: -.15rem;
  right: -.1rem;
  width: .45rem;
  height: .45rem;
  margin: 0;
}

.item-gallery--compact .item-gallery__count {
  position: static;
  min-width: 1.15rem;
  height: 1.15rem;
  margin-left: .1rem;
  padding: 0 .28rem;
  font-size: .68rem;
  line-height: 1.15rem;
}

.media-thumb {
  position: relative;
  flex-shrink: 0;
  width: 3.5rem;
  height: 3.5rem;
  margin: 0;
  border-radius: .45rem;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, .08);
  background: var(--bg-accent);
}

.media-thumb__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.media-thumb__empty {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  background: linear-gradient(145deg, #edf2f7, #e2e8f0);
}

.media-thumb--droppable { cursor: pointer; }

.media-thumb__overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(26, 54, 93, .35);
  color: #fff;
  font-size: .85rem;
  opacity: 0;
  transition: opacity .15s;
  pointer-events: none;
}

.media-thumb--droppable:hover .media-thumb__overlay,
.media-thumb--drag .media-thumb__overlay,
.media-thumb--custom .media-thumb__overlay {
  opacity: 1;
}

.media-thumb__reset {
  position: absolute;
  top: 2px;
  right: 2px;
  z-index: 2;
  padding: 0 .25rem;
  font-size: .6rem;
  line-height: 1.3;
  border: none;
  border-radius: 3px;
  background: rgba(255, 255, 255, .92);
  color: var(--text-muted);
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .15);
}

.media-thumb__reset:hover { color: var(--primary); }

.item-note {
  margin-top: .4rem;
  padding-top: .35rem;
  border-top: 1px dashed rgba(0, 0, 0, .08);
}

.item-note__toggle {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .2rem 0;
  border: none;
  background: none;
  font-size: .78rem;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
}

.item-note--compact .item-note__toggle.timeline__chip {
  padding: .4rem .72rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  color: var(--primary);
  font-size: .8rem;
  min-height: 2.35rem;
}

.item-note__dot {
  width: .45rem;
  height: .45rem;
  border-radius: 50%;
  background: var(--primary-light);
}

.item-note__panel {
  margin-top: .35rem;
}

.item-note__input {
  width: 100%;
  padding: .45rem .55rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: .85rem;
  resize: vertical;
  min-height: 2.5rem;
}

.item-note__actions {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-top: .35rem;
}

.item-note__status { font-size: .75rem; }

/* Family photo gallery */
.item-gallery--page .item-gallery__heading { margin-bottom: .35rem; }

.item-gallery__hint {
  margin: 0 0 .75rem;
  font-size: .85rem;
}

.item-gallery--compact .item-gallery__toggle.timeline__chip {
  position: relative;
}

.item-gallery--compact .item-gallery__toggle:hover,
.item-gallery--compact .item-gallery__toggle:focus-visible {
  color: var(--primary);
  border-color: var(--primary-light);
  background: rgba(26, 54, 93, .05);
}

.item-gallery__icon {
  width: 1.1rem;
  height: 1.1rem;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.item-gallery__strip {
  display: flex;
  flex-wrap: nowrap;
  gap: .45rem;
  overflow-x: auto;
  padding: .15rem 0 .35rem;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.item-gallery__strip--page {
  min-height: 4.5rem;
}

.item-gallery__empty {
  margin: 0;
  font-size: .85rem;
}

.item-gallery__thumb {
  position: relative;
  flex: 0 0 auto;
  width: 4.25rem;
  height: 4.25rem;
  border-radius: .45rem;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, .08);
  background: var(--bg-accent);
}

.item-gallery__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  cursor: zoom-in;
}

.item-gallery__remove {
  position: absolute;
  top: .15rem;
  right: .15rem;
  width: 1.25rem;
  height: 1.25rem;
  border: none;
  border-radius: 999px;
  background: rgba(0, 0, 0, .55);
  color: #fff;
  font-size: .85rem;
  line-height: 1;
  cursor: pointer;
}

.item-gallery__remove:hover { background: rgba(0, 0, 0, .75); }

.item-gallery__actions {
  display: flex;
  align-items: center;
  gap: .65rem;
  flex-wrap: wrap;
}

.item-gallery__status { font-size: .75rem; }

.gallery-lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, .92);
  padding: 1rem;
}

.gallery-lightbox[hidden] {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

body.gallery-lightbox-open { overflow: hidden; }

.gallery-lightbox__img {
  max-width: min(100%, 720px);
  max-height: calc(100vh - 4rem);
  object-fit: contain;
  border-radius: .35rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, .35);
}

.gallery-lightbox__close,
.gallery-lightbox__prev,
.gallery-lightbox__next {
  position: absolute;
  border: none;
  background: rgba(255, 255, 255, .12);
  color: #fff;
  cursor: pointer;
  border-radius: 999px;
  backdrop-filter: blur(4px);
}

.gallery-lightbox__close {
  top: calc(.75rem + env(safe-area-inset-top, 0px));
  right: .75rem;
  width: 2.25rem;
  height: 2.25rem;
  font-size: 1.35rem;
  line-height: 1;
}

.gallery-lightbox__prev,
.gallery-lightbox__next {
  top: 50%;
  transform: translateY(-50%);
  width: 2.5rem;
  height: 2.5rem;
  font-size: 1.75rem;
  line-height: 1;
}

.gallery-lightbox__prev { left: .5rem; }
.gallery-lightbox__next { right: .5rem; }

.gallery-lightbox__counter {
  position: absolute;
  bottom: calc(.75rem + env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, .85);
  font-size: .85rem;
}

.pwa-options {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .35rem .65rem;
  margin: 0 0 1rem;
  padding: .4rem .65rem;
  background: #eef4ff;
  border: 1px solid #c3dafe;
  border-radius: var(--radius-sm);
  font-size: .78rem;
}

.pwa-options__label {
  font-size: .65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--primary);
}

.pwa-options__toggle {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  cursor: pointer;
  color: var(--text);
}

.pwa-options__toggle input {
  accent-color: var(--primary);
}

.quick-actions__btn--maps {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.quick-actions__btn--maps:hover {
  background: var(--primary-light);
  color: #fff;
}

.timeline__static { padding: .35rem .5rem; }

.timeline__icon { margin-right: .25rem; }

.timeline__cta {
  display: inline-block;
  margin-top: .35rem;
  font-size: .78rem;
  font-weight: 700;
  color: var(--primary-light);
}

/* Hero images (Wikimedia) */
.hero-image {
  margin: -1rem -1rem 1rem;
  border-radius: var(--radius) var(--radius) 0 0;
  overflow: hidden;
  position: relative;
}

.container > .hero-image:first-child,
.hero-image:first-child {
  margin: 0 0 1rem;
  border-radius: var(--radius);
}

.hero-image img {
  width: 100%;
  max-height: 220px;
  object-fit: cover;
  display: block;
}

.hero-image__credit {
  position: absolute;
  right: .5rem;
  bottom: .5rem;
  margin: 0;
  padding: .15rem .45rem;
  font-size: .65rem;
  background: rgba(0, 0, 0, .45);
  color: #fff;
  border-radius: 4px;
}

.hero-image--droppable { cursor: pointer; }
.hero-image__frame { position: relative; }
.hero-image__img--empty {
  min-height: 140px;
  background: linear-gradient(145deg, #edf2f7 0%, #dbeafe 100%);
}
.hero-image__overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .35rem;
  background: rgba(26, 54, 93, .45);
  color: #fff;
  font-size: .78rem;
  opacity: 0;
  transition: opacity .15s;
  padding: .5rem;
  text-align: center;
  pointer-events: none;
}
.hero-image--droppable:hover .hero-image__overlay,
.hero-image--drag .hero-image__overlay {
  opacity: 1;
}
.hero-image--custom .hero-image__overlay {
  opacity: 0;
}
.hero-image--custom:hover .hero-image__overlay,
.hero-image--custom.hero-image--drag .hero-image__overlay {
  opacity: 1;
}
.hero-image--custom .hero-image__hint::before {
  content: 'Zmień · ';
}
.hero-image__reset {
  position: absolute;
  right: .4rem;
  bottom: .4rem;
  z-index: 3;
  border: none;
  background: rgba(255, 255, 255, .78);
  color: #94a3b8;
  border-radius: .25rem;
  padding: .1rem .35rem;
  font-size: .6rem;
  font-weight: 500;
  letter-spacing: .01em;
  cursor: pointer;
  backdrop-filter: blur(4px);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .06);
  opacity: .92;
  transition: color .12s, background .12s;
}
.hero-image__reset:hover {
  color: #64748b;
  background: rgba(255, 255, 255, .92);
}
.hero-image--custom .hero-image__reset:not([hidden]) {
  display: block;
}

.place-info__tabs {
  display: flex;
  gap: .35rem;
  margin-bottom: .75rem;
}
.place-info__tab {
  flex: 1;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: var(--radius-sm);
  padding: .45rem .5rem;
  font-size: .78rem;
  font-weight: 600;
  cursor: pointer;
}
.place-info__tab.is-active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.place-info__body {
  font-size: .85rem;
  line-height: 1.55;
}
.place-info__source {
  margin: .65rem 0 0;
  font-size: .72rem;
}

.transit-links {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  margin-top: .4rem;
}
.btn-sm {
  font-size: .72rem;
  padding: .35rem .55rem;
  line-height: 1.2;
}

/* Entity links */
.entity-link {
  display: flex;
  gap: .75rem;
  align-items: center;
  text-decoration: none;
  color: inherit;
  margin-bottom: .75rem;
}

.entity-link:hover { text-decoration: none; }

.entity-link__thumb {
  width: 4rem;
  height: 4rem;
  object-fit: cover;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

.entity-link strong { display: block; }
.entity-link .muted { display: block; font-size: .85rem; }

/* Transport cards */
.transport-list {
  display: flex;
  flex-direction: column;
  gap: .65rem;
}

.transport-card {
  display: flex;
  gap: .75rem;
  align-items: center;
  padding: .65rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: inherit;
  transition: border-color .15s, box-shadow .15s;
}

.transport-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow);
  text-decoration: none;
}

.transport-card__img {
  width: 4.5rem;
  height: 3.5rem;
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;
}

.transport-card strong { display: block; font-size: .92rem; }

/* Detail list */
.detail-list { margin: 0; }

.detail-list div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: .5rem 0;
  border-bottom: 1px solid var(--border);
}

.detail-list div:last-child { border-bottom: 0; }

.detail-list dt {
  margin: 0;
  font-weight: 600;
  color: var(--muted);
  font-size: .88rem;
}

.detail-list dd { margin: 0; font-weight: 700; text-align: right; }

.linked-days {
  list-style: none;
  padding: 0;
  margin: 0;
}

.linked-days li { border-bottom: 1px solid var(--border); }
.linked-days li:last-child { border-bottom: 0; }

.linked-days a {
  display: block;
  padding: .65rem 0;
  text-decoration: none;
  font-size: .92rem;
}

.linked-days a:hover { color: var(--primary-light); }

/* Imagine */
.imagine-opening {
  font-style: italic;
  font-size: 1.02rem;
  line-height: 1.65;
  margin: .5rem 0;
}

.imagine-opening--large {
  font-size: 1.1rem;
  margin: 1rem 0;
  padding: 1rem;
  background: var(--accent-soft);
  border-radius: var(--radius-sm);
  border: none;
}

.imagine-preview + .imagine-preview {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.imagine-preview h3 {
  margin: 0 0 .35rem;
  font-size: .95rem;
}

.story-list, .hotel-list {
  display: flex;
  flex-direction: column;
  gap: .85rem;
}

.story-body p { margin-bottom: 1rem; }

.hooks {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.back-link {
  display: inline-block;
  margin-bottom: 1rem;
  font-weight: 600;
}

.link-more { font-weight: 700; font-size: .9rem; }

/* Hotels */
.hotel-card__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: .5rem;
}

.hotel-card__head h2 {
  margin: 0;
  font-size: 1.05rem;
}

.hotel-card__city {
  margin: .25rem 0;
  font-weight: 600;
  color: var(--primary);
}

.hotel-card__dates {
  margin: .35rem 0;
  font-size: .92rem;
}

.hotel-card__ref {
  font-size: .85rem;
  margin: .5rem 0;
}

.hotel-card__ref code {
  background: var(--bg);
  padding: .15rem .4rem;
  border-radius: 4px;
  font-size: .82rem;
}

.hotel-name {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0 0 .25rem;
}

.hotel-pill {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .25rem;
  background: var(--imported-bg);
  padding: .45rem .75rem;
  border-radius: 999px;
  font-size: .88rem;
  margin-top: .75rem;
}

.hotel-pill a { font-weight: 700; }

/* Hotel stay timeline (Noclegi) */
.hotel-card--full { padding: 0; overflow: hidden; }
.hotel-card__body { padding: 1rem 1.1rem; }
.hotel-card__hero-link { display: block; text-decoration: none; }
.hotel-card__title-link { color: var(--primary); text-decoration: none; font-size: 1.05rem; }
.hotel-card__title-link:hover { text-decoration: underline; }
.hotel-card__actions { display: flex; gap: .5rem; margin-top: 1rem; flex-wrap: wrap; }
.hotel-card__actions .btn { flex: 1; min-width: 140px; }

.hotel-stay-timeline { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.hotel-stay-timeline__title { margin: 0 0 .75rem; font-size: .9rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }

.stay-day-block { margin-bottom: .85rem; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.stay-day-block__head { display: flex; justify-content: space-between; align-items: center; gap: .5rem; padding: .55rem .75rem; background: var(--primary); color: #fff; text-decoration: none; font-size: .88rem; }
.stay-day-block__head:hover { background: var(--primary-light); text-decoration: none; color: #fff; }
.stay-day-block__date { font-weight: 800; }
.stay-day-block__theme { opacity: .9; text-align: right; }
.stay-day-block__events { list-style: none; margin: 0; padding: 0; }
.stay-day-block__event { border-bottom: 1px solid var(--border); }
.stay-day-block__event:last-child { border-bottom: 0; }

.stay-event { display: grid; grid-template-columns: 3rem 1.5rem 1fr; gap: .5rem; align-items: start; padding: .6rem .75rem; }
.stay-event--link { text-decoration: none; color: inherit; transition: background .15s; }
.stay-event--link:hover { background: var(--accent-soft); text-decoration: none; }
.stay-event__time { font-weight: 800; font-size: .78rem; color: var(--accent); }
.stay-event__icon { font-size: 1rem; line-height: 1.4; }
.stay-event__text strong { display: block; font-size: .9rem; }
.stay-event__desc { display: block; font-size: .82rem; color: var(--muted); margin-top: .15rem; }

.imagine-preview h3 a { color: var(--primary); text-decoration: none; }
.imagine-preview h3 a:hover { text-decoration: underline; }

/* Transport */
.transport-item {
  padding: .65rem 0;
  border-bottom: 1px solid var(--border);
}

.transport-item:last-child { border-bottom: 0; }

/* Day pager */
.day-pager {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: .5rem;
  align-items: center;
  margin-top: .5rem;
}

.day-pager__link {
  font-weight: 700;
  font-size: .88rem;
}

.day-pager__link:last-child { text-align: right; }

.day-pager__center {
  font-size: .82rem;
  color: var(--muted);
  font-weight: 600;
  text-align: center;
}

/* Quick actions */
.quick-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .65rem;
  margin-top: .25rem;
}

.quick-actions__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  padding: .75rem;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: .88rem;
  color: var(--text);
  text-decoration: none;
}

.quick-actions__btn:hover {
  text-decoration: none;
  border-color: var(--primary);
}

/* Buttons */
.btn {
  display: inline-block;
  padding: .85rem 1rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  border: none;
  font-size: .95rem;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
}

.btn-block { display: block; width: 100%; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-light); text-decoration: none; color: #fff; }
.btn-secondary { background: #edf2f7; color: var(--primary); }

/* Login */
.login-page {
  min-height: 70vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-card {
  width: 100%;
  max-width: 400px;
  text-align: center;
}

.login-card__eyebrow {
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: .72rem;
  color: var(--muted);
  margin: 0 0 .5rem;
}

.login-card h1 { margin: 0 0 .25rem; font-size: 2rem; }

.login-form {
  text-align: left;
  margin-top: 1.25rem;
}

.login-form label {
  display: block;
  font-size: .85rem;
  font-weight: 600;
  margin-bottom: .35rem;
}

.login-form input {
  width: 100%;
  padding: .85rem;
  margin-bottom: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 1rem;
}

.alert {
  color: #c53030;
  background: #fff5f5;
  padding: .75rem;
  border-radius: var(--radius-sm);
  font-size: .9rem;
}

/* Plan filters & tabs */
.filter-banner {
  font-size: .85rem;
  color: var(--muted);
  margin: 0 0 .75rem;
  padding: .5rem .65rem;
  background: #fff;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.filter-banner__clear {
  margin-left: .5rem;
  font-weight: 600;
}

.view-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .5rem;
  margin-bottom: 1rem;
}

.view-tabs__item {
  text-align: center;
  padding: .55rem;
  border-radius: var(--radius-sm);
  background: #fff;
  border: 1px solid var(--border);
  font-weight: 700;
  font-size: .85rem;
  color: var(--muted);
  text-decoration: none;
}

.view-tabs__item.is-active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.hero__links { margin: .5rem 0 0; }
.empty-state {
  text-align: center;
  color: var(--muted);
  padding: 2rem 1rem;
}

/* Calendar */
.calendar-wrap { display: flex; flex-direction: column; gap: 1.25rem; }
.calendar-month__title {
  font-size: 1rem;
  margin: 0 0 .5rem;
  color: var(--primary);
}

.calendar-grid {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.calendar-grid__head,
.calendar-grid__row {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
}

.calendar-grid__dow {
  text-align: center;
  font-size: .7rem;
  font-weight: 700;
  color: var(--muted);
  padding: .15rem 0 .35rem;
}

.calendar-cell {
  position: relative;
  min-height: 5.25rem;
  padding: .4rem .35rem;
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: .2rem;
  overflow: hidden;
  transition: box-shadow .12s, border-color .12s;
}

.calendar-cell:hover {
  text-decoration: none;
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .08);
}

.calendar-cell--empty {
  min-height: 5.25rem;
  background: transparent;
  border: none;
  padding: 0;
  pointer-events: none;
}

.calendar-cell--gap {
  min-height: 2rem;
  background: #f8fafc;
  border-style: dashed;
  border-color: #e2e8f0;
  pointer-events: none;
  opacity: .55;
}

.calendar-cell--gap .calendar-cell__num { color: #a0aec0; font-size: .75rem; }

.calendar-cell--confirmed { border-left: 3px solid var(--confirmed); }
.calendar-cell--imported { border-left: 3px solid var(--imported); }
.calendar-cell--pending { border-left: 3px solid var(--pending); }
.calendar-cell--dimmed { opacity: .22; pointer-events: none; }

.calendar-cell__top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: .25rem;
}

.calendar-cell__num {
  font-weight: 800;
  font-size: .95rem;
  line-height: 1;
  color: var(--primary);
}

.calendar-cell__d {
  font-size: .62rem;
  font-weight: 700;
  color: var(--accent);
  white-space: nowrap;
}

.calendar-cell__theme {
  font-size: .68rem;
  line-height: 1.25;
  font-weight: 600;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}

.calendar-cell__city {
  font-size: .62rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Day status picker */
.status-form__buttons {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-top: .65rem;
}

.status-pick {
  flex: 1;
  min-width: 6rem;
  padding: .55rem .65rem;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  font-size: .78rem;
  font-weight: 700;
  cursor: pointer;
}

.status-pick--active {
  box-shadow: 0 0 0 2px rgba(26,54,93,.15);
}

.status-pick.status-confirmed { color: var(--confirmed); border-color: var(--confirmed-bg); }
.status-pick.status-imported { color: var(--imported); border-color: var(--imported-bg); }
.status-pick.status-pending { color: var(--pending); border-color: var(--pending-bg); }

/* Logistics table */
.logistics-day { margin-bottom: 1rem; }
.logistics-day__link {
  color: inherit;
  text-decoration: none;
}

.logistics-day__link:hover { color: var(--primary); }

.logistics-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0 -.25rem;
}

.logistics-table {
  width: 100%;
  min-width: 640px;
  border-collapse: collapse;
  font-size: .78rem;
}

.logistics-table th,
.logistics-table td {
  padding: .5rem .4rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

.logistics-table th {
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .03em;
  color: var(--muted);
  background: #f7fafc;
  position: sticky;
  top: 0;
}

.logistics-mode { display: block; white-space: nowrap; }
.logistics-line-name {
  display: block;
  font-size: .68rem;
  color: var(--muted);
}

.logistics-res { text-align: center; font-size: 1rem; }

.hero__note { font-size: .78rem; margin-top: .35rem; }

/* Day guide (Ewa) */
.card--guide .guide-block {
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}
.card--guide .guide-block:last-child { border-bottom: 0; margin-bottom: 0; padding-bottom: 0; }
.card--guide h3 { font-size: .85rem; margin: 0 0 .35rem; color: var(--primary); }
.story-body--inline { font-size: .9rem; color: var(--muted); margin: .5rem 0; }
.source-note { font-size: .75rem; margin-top: 1.5rem; }

/* Useful phrases at attractions */
.phrases-card {
  margin: 1rem 0;
  padding: .85rem;
  background: #fff;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
.phrases-card__title { margin: 0 0 .65rem; font-size: .9rem; color: var(--primary); }
.phrases-list { list-style: none; padding: 0; margin: 0; }
.phrases-list__item {
  padding: .55rem 0;
  border-bottom: 1px solid var(--border);
}
.phrases-list__item:last-child { border-bottom: 0; }
.phrases-list__ja-row {
  display: flex;
  align-items: center;
  gap: .4rem;
  margin-bottom: .15rem;
}
.phrases-list__ja { font-size: 1.05rem; font-weight: 700; margin: 0; flex: 1; }
.phrases-list__romaji { font-size: .78rem; color: var(--accent); margin: 0 0 .15rem; }
.phrases-list__pl { font-size: .82rem; margin: 0; }
.phrases-list__when { font-size: .72rem; color: var(--muted); margin: .2rem 0 0; }

.speak-btn {
  flex-shrink: 0;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 999px;
  width: 2rem;
  height: 2rem;
  font-size: .95rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}
.speak-btn:hover { border-color: var(--primary); background: #ebf8ff; }
.speak-btn--active { background: var(--primary); border-color: var(--primary); }

.timeline__phrase-row {
  display: flex;
  align-items: center;
  gap: .45rem;
  margin-top: .55rem;
  padding: .45rem .55rem;
  border-radius: var(--radius-sm);
  background: var(--bg-accent);
  border: 1px solid var(--border);
}

.timeline__phrase {
  margin: 0;
  flex: 1;
  font-size: .88rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--text);
}

.timeline__phrase-flag { margin-right: .15rem; }

.speak-btn--sm {
  width: 1.85rem;
  height: 1.85rem;
  font-size: 0;
  padding: .35rem;
}

.speak-btn--sm svg {
  width: 100%;
  height: 100%;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Narrative hooks & feedback */
.imagine-preview__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem;
  margin-bottom: .35rem;
}
.imagine-preview__head h3 { margin: 0; }
.hooks-inline { list-style: none; padding: 0; margin: .5rem 0; font-size: .82rem; }
.hooks-inline li { margin-bottom: .25rem; }
.narrative-badge { margin: 0 0 1rem; display: inline-block; }
.hooks-missing { font-size: .85rem; margin: 0 0 1rem; }
.card--feedback { margin-top: 1rem; border: 1px dashed var(--pending); }
.feedback-input {
  width: 100%;
  padding: .65rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .85rem;
  margin: .5rem 0;
  font-family: inherit;
}
.approve-form { margin-top: .65rem; }
.feedback-status { font-size: .82rem; margin-top: .5rem; }
.hooks-preview { font-size: .82rem; margin: .35rem 0 .65rem; }

/* AI assistant — bez pełnoekranowego wrappera (iOS PWA blokuje dotyk przy inset:0) */
.assistant {
  position: static;
}

.assistant__fab {
  position: fixed;
  right: 1rem;
  bottom: calc(var(--nav-h) + var(--safe-bottom) + .75rem);
  z-index: 40;
  width: 3.25rem;
  height: 3.25rem;
  border-radius: 50%;
  border: 0;
  background: var(--primary);
  color: #fff;
  font-size: 1.35rem;
  box-shadow: 0 4px 16px rgba(26,54,93,.35);
  cursor: pointer;
}
.assistant__panel {
  position: fixed;
  right: max(.75rem, env(safe-area-inset-right, 0px));
  bottom: calc(var(--nav-h) + var(--safe-bottom) + 4.25rem);
  z-index: 41;
  width: min(22rem, calc(100dvw - 1.5rem - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px)));
  max-height: calc(100dvh - var(--nav-h) - var(--safe-bottom) - env(safe-area-inset-top, 0px) - 5rem);
  background: #fff;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: 0 8px 32px rgba(0,0,0,.15);
  display: flex;
  flex-direction: column;
}
.assistant__panel[hidden] {
  display: none !important;
}
.assistant__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: .65rem .75rem;
  border-bottom: 1px solid var(--border);
}
.assistant__close {
  border: 0;
  background: none;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  color: var(--muted);
  padding: .25rem .4rem;
  margin: -.25rem -.4rem;
  border-radius: var(--radius-sm);
}
.assistant__close:hover { color: var(--text); background: #edf2f7; }
.assistant__messages {
  flex: 1 1 auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: .65rem .75rem;
  display: flex;
  flex-direction: column;
  gap: .5rem;
  min-height: 5rem;
}
.assistant__hint { font-size: .78rem; color: var(--muted); margin: 0; }
.assistant__msg {
  padding: .5rem .65rem;
  border-radius: var(--radius-sm);
  font-size: .82rem;
  line-height: 1.45;
  max-width: 95%;
}
.assistant__msg--user {
  align-self: flex-end;
  background: var(--primary);
  color: #fff;
}
.assistant__msg--bot {
  align-self: flex-start;
  background: #edf2f7;
  color: var(--text);
}
.assistant__msg--pending { opacity: .6; }
.assistant__msg p { margin: 0 0 .45rem; }
.assistant__msg p:last-child { margin-bottom: 0; }
.assistant__msg ul,
.assistant__msg ol {
  margin: .25rem 0 .45rem;
  padding-left: 1.1rem;
}
.assistant__msg li { margin: .2rem 0; }
.assistant__msg strong { font-weight: 700; }
.assistant__msg code {
  font-size: .78em;
  background: rgba(0, 0, 0, .06);
  padding: .05rem .25rem;
  border-radius: 3px;
}
.assistant__badge {
  margin-top: .4rem;
  font-size: .65rem;
  color: var(--muted);
}
.assistant__search {
  display: flex;
  align-items: center;
  gap: .4rem;
  padding: 0 .75rem .5rem;
  font-size: .72rem;
  color: var(--muted);
  cursor: pointer;
}
.assistant__search input { margin: 0; }
.assistant__error { color: #c53030; }
.assistant__form {
  display: flex;
  gap: .35rem;
  padding: .5rem .75rem;
  border-top: 1px solid var(--border);
}
.assistant__form input {
  flex: 1;
  padding: .5rem .65rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 16px;
}
.assistant__form .btn { padding: .5rem .75rem; font-size: .78rem; }
.assistant__quick {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  padding: 0 .75rem .65rem;
}
.assistant__quick button {
  font-size: .68rem;
  padding: .3rem .5rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  cursor: pointer;
}

/* Translate modal */
.translate-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.translate-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.4);
}
.translate-modal__box {
  position: relative;
  width: 100%;
  max-width: 720px;
  max-height: 80vh;
  overflow-y: auto;
  background: #fff;
  border-radius: var(--radius) var(--radius) 0 0;
  padding: 1rem;
}
.translate-modal__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: .75rem;
}
.translate-modal__head h2 { margin: 0; font-size: 1.1rem; }
.translate-modal__source {
  font-size: .82rem;
  color: var(--muted);
  border-left: 3px solid var(--border);
  padding-left: .65rem;
  margin: 0 0 1rem;
  max-height: 6rem;
  overflow-y: auto;
}
.translate-modal__ja {
  font-size: 1.05rem;
  line-height: 1.6;
  white-space: pre-wrap;
}

/* Prep — checklist + packing */
.prep-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .5rem;
  margin-bottom: 1rem;
}

.prep-tabs__item {
  display: block;
  text-align: center;
  padding: .65rem .5rem;
  border-radius: var(--radius);
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--muted);
  text-decoration: none;
  font-size: .88rem;
  font-weight: 600;
}

.prep-tabs__item.is-active {
  color: var(--primary);
  border-color: var(--primary);
  background: rgba(26, 54, 93, .06);
}

.prep-must-open { color: var(--pending); }

.prep-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.prep-list__item {
  border-top: 1px solid var(--border);
}

.prep-list__item:first-child { border-top: none; }

.prep-item-form {
  display: flex;
  gap: .65rem;
  align-items: flex-start;
  padding: .65rem 0;
  width: 100%;
}

.prep-check {
  flex-shrink: 0;
  width: 1.65rem;
  height: 1.65rem;
  border-radius: .4rem;
  border: 2px solid var(--border);
  background: #fff;
  color: var(--confirmed);
  font-size: .95rem;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
  line-height: 1.4;
}

.prep-check.is-done {
  background: var(--confirmed-bg);
  border-color: var(--confirmed);
}

.prep-item__body { flex: 1; min-width: 0; }

.prep-item__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .35rem .5rem;
}

.prep-item__title { font-weight: 600; font-size: .92rem; line-height: 1.35; }

.prep-list__item--done .prep-item__title {
  text-decoration: line-through;
  color: var(--muted);
}

.prep-item__notes {
  margin: .25rem 0 0;
  font-size: .82rem;
  color: var(--muted);
  line-height: 1.45;
}

.prep-due {
  font-size: .72rem;
  color: var(--pending);
  font-weight: 600;
}

.prep-tbc {
  display: inline-block;
  margin-top: .2rem;
  font-size: .68rem;
  font-family: ui-monospace, monospace;
  color: var(--muted);
  background: var(--bg-accent);
  padding: .1rem .35rem;
  border-radius: .25rem;
}

.prep-badge--must { background: #fed7d7; color: #c53030; }
.prep-badge--nice { background: #e9d8fd; color: #553c9a; }

.prep-pack-variant { padding: 0; overflow: hidden; }
.prep-pack-variant__summary {
  list-style: none;
  cursor: pointer;
  padding: .85rem 1rem;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .35rem .65rem;
}

.prep-pack-variant__summary::-webkit-details-marker { display: none; }

.prep-pack-variant__title { font-weight: 700; font-size: .95rem; flex: 1 1 100%; }

.prep-pack-variant__sub {
  font-size: .82rem;
  color: var(--muted);
  flex: 1 1 100%;
}

.prep-pack-variant__count {
  font-size: .72rem;
  color: var(--muted);
  margin-left: auto;
}

.prep-pack-section {
  padding: 0 1rem .75rem;
  border-top: 1px solid var(--border);
}

.prep-pack-section__title {
  margin: .65rem 0 .35rem;
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--muted);
}

.prep-pack-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.prep-pack-list__item {
  font-size: .88rem;
  padding: .2rem 0;
  line-height: 1.4;
}

.prep-must { color: var(--confirmed); font-size: .65rem; vertical-align: middle; }
.prep-optional { color: var(--border); font-size: .65rem; vertical-align: middle; }
.prep-qty { color: var(--muted); font-size: .8rem; }

/* Leg schedule — stacje i odjazdy */
.card--accent .leg-schedule {
  border: 1px solid var(--border);
  box-shadow: none;
  margin-bottom: .65rem;
}

.card--accent .leg-schedule:last-child { margin-bottom: 0; }

.leg-schedule__head { margin-bottom: .65rem; }

.leg-schedule__title {
  margin: 0 0 .25rem;
  font-size: .95rem;
}

.leg-schedule__line { margin: 0 0 .35rem; font-size: .82rem; }

.leg-schedule__stations {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .25rem .4rem;
  margin: .35rem 0;
  font-size: .9rem;
}

.leg-schedule__station {
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
}

.leg-schedule__station:not([href]) { color: inherit; }

.leg-schedule__ja {
  font-weight: 400;
  font-size: .78rem;
  color: var(--muted);
}

.leg-schedule__arrow { color: var(--muted); }

.leg-schedule__target { margin: .35rem 0; font-size: .85rem; }

.leg-schedule__table-wrap {
  overflow-x: auto;
  margin: .5rem 0;
}

.leg-schedule__table {
  width: 100%;
  border-collapse: collapse;
  font-size: .82rem;
}

.leg-schedule__table th,
.leg-schedule__table td {
  padding: .35rem .45rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

.leg-schedule__table th {
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .03em;
  color: var(--muted);
}

.leg-schedule__row--rec {
  background: rgba(56, 161, 105, .08);
}

.leg-schedule__rec-badge {
  display: inline-block;
  font-size: .62rem;
  font-weight: 700;
  text-transform: uppercase;
  background: var(--confirmed-bg);
  color: var(--confirmed);
  padding: .05rem .3rem;
  border-radius: .2rem;
  margin-left: .15rem;
}

.leg-schedule__link {
  text-decoration: none;
  font-size: 1rem;
}

.leg-schedule__hint { font-size: .75rem; margin: .25rem 0 .5rem; }

.leg-schedule__notes {
  font-size: .82rem;
  color: var(--muted);
  margin: .35rem 0 .5rem;
  line-height: 1.45;
}

/* Search */
.search-page { padding-top: .25rem; }

.search-form__label {
  display: block;
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--muted);
  margin-bottom: .45rem;
}

.search-form__row {
  position: relative;
  display: flex;
  align-items: center;
}

.search-form__icon {
  position: absolute;
  left: .85rem;
  width: 1.1rem;
  height: 1.1rem;
  stroke: var(--muted);
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  pointer-events: none;
}

.search-form__input {
  width: 100%;
  padding: .75rem 2.5rem .75rem 2.45rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font: inherit;
  font-size: 1rem;
  background: #fff;
  box-shadow: var(--shadow);
}

.search-form__input:focus {
  outline: none;
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(44, 82, 130, .15);
}

.search-form__clear {
  position: absolute;
  right: .55rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 999px;
  color: var(--muted);
  text-decoration: none;
  font-size: 1.25rem;
  line-height: 1;
}

.search-results-wrap { margin-top: 1rem; }

.search-hint,
.search-empty {
  margin: .5rem 0;
  font-size: .9rem;
}

.search-group { margin-bottom: 1.15rem; }

.search-group__title {
  margin: 0 0 .45rem;
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--muted);
}

.search-results {
  list-style: none;
  margin: 0;
  padding: 0;
}

.search-hit {
  display: flex;
  gap: .65rem;
  align-items: flex-start;
  padding: .7rem .75rem;
  margin-bottom: .45rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow);
}

.search-hit:hover {
  border-color: var(--primary-light);
  text-decoration: none;
}

.search-hit__badge {
  flex-shrink: 0;
  min-width: 3.2rem;
  padding: .2rem .4rem;
  border-radius: .35rem;
  background: var(--bg-accent);
  color: var(--primary);
  font-size: .68rem;
  font-weight: 700;
  text-align: center;
  line-height: 1.25;
}

.search-hit__body {
  display: flex;
  flex-direction: column;
  gap: .12rem;
  min-width: 0;
}

.search-hit__title {
  font-size: .95rem;
  line-height: 1.25;
  color: var(--text);
}

.search-hit__subtitle {
  font-size: .78rem;
  line-height: 1.3;
}

.search-hit__excerpt {
  font-size: .82rem;
  line-height: 1.35;
  color: #475569;
}

@media (min-width: 640px) {
  .hero h1 { font-size: 2rem; }
  .hero-image img { max-height: 280px; }
  .day-card__row { grid-template-columns: 5rem 1fr; }
  .bottom-nav__icon { width: 1.45rem; height: 1.45rem; }
}
