/* ===== Trip Planner ===== */
.trip-page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 24px;
  min-height: calc(100vh - 64px);
}
.trip-page--narrow {
  max-width: 560px;
}

.trip-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}
.trip-header h1 {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 10px;
}
.trip-header h1 svg {
  width: 26px;
  height: 26px;
  color: var(--primary);
}
.trip-subtitle {
  font-size: 14px;
  color: var(--muted-fg);
  margin-top: 4px;
}
.trip-header-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}
.trip-header-cta {
  align-self: flex-start;
}

/* ===== Buttons ===== */
.trip-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition);
  font-family: var(--font-body);
  text-decoration: none;
  white-space: nowrap;
}
.trip-btn svg { width: 14px; height: 14px; }
.trip-btn--primary { background: var(--primary); color: var(--primary-fg); }
.trip-btn--primary:hover { opacity: 0.9; }
.trip-btn--ghost { background: var(--muted); color: var(--fg); border-color: var(--border); }
.trip-btn--ghost:hover { background: var(--card); }
.trip-btn--danger { background: hsl(0 84% 60% / 0.1); color: var(--destructive); border-color: hsl(0 84% 60% / 0.3); }
.trip-btn--danger:hover { background: hsl(0 84% 60% / 0.18); }

/* ===== Trip list ===== */
.trip-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.trip-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 140px;
  text-decoration: none;
  color: inherit;
  transition: box-shadow 250ms ease, transform 250ms ease;
}
.trip-card:hover {
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}
.trip-card-thumb {
  height: 130px;
  background: var(--muted);
  pointer-events: none;
}
.trip-card-thumb, .trip-card-thumb * { pointer-events: none; }
.trip-card-thumb--empty {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
}
.trip-card-body {
  padding: 14px 18px 0;
}
.trip-card-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  margin-bottom: 6px;
}
.trip-card-dates {
  font-size: 12px;
  color: var(--muted-fg);
  margin-bottom: 6px;
}
.trip-card-desc {
  font-size: 13px;
  color: var(--muted-fg);
}
.trip-card-footer {
  margin-top: 14px;
  padding: 10px 18px 16px;
  border-top: 1px solid var(--border);
}
.trip-card-count {
  font-size: 12px;
  font-weight: 600;
  color: var(--primary);
}

.trip-empty {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 70px 20px;
  text-align: center;
}
.trip-empty-icon {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: var(--muted);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 14px;
}
.trip-empty-icon svg { width: 30px; height: 30px; color: var(--muted-fg); }
.trip-empty h3 { font-family: var(--font-display); font-size: 17px; font-weight: 700; margin-bottom: 6px; }
.trip-empty p { font-size: 13px; color: var(--muted-fg); max-width: 320px; }

/* ===== Form ===== */
.trip-form-field { margin-bottom: 16px; }
.trip-form-row { display: flex; gap: 14px; }
.trip-form-row .trip-form-field { flex: 1; }
.trip-form-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted-fg);
  margin-bottom: 6px;
}
.trip-form input[type="text"],
.trip-form input[type="date"],
.trip-form textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  background: var(--card);
  color: var(--fg);
  font-size: 14px;
}
.trip-form-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 10px;
}

/* ===== Detail layout ===== */
.trip-layout {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 24px;
  align-items: start;
}

.trip-stops {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}
.trip-stop {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px;
  min-width: 0;
}
.trip-stop--dragging { opacity: 0.4; }
.trip-stop--highlight {
  border-color: var(--primary);
  border-width: 2px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.14);
  transition: box-shadow 0.3s ease, border-color 0.3s ease;
}
.trip-stop-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.trip-stop-handle {
  color: var(--muted-fg);
  flex-shrink: 0;
  cursor: grab;
  touch-action: none;
  padding: 4px;
}
.trip-stop-handle:active { cursor: grabbing; }
.trip-stop-handle svg { width: 18px; height: 18px; display: block; }
.trip-stop-number {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--primary-fg);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
  flex-shrink: 0;
}
.trip-stop-img {
  width: 52px; height: 52px;
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--muted);
}
.trip-stop-img img { width: 100%; height: 100%; object-fit: cover; }
.trip-stop-img-fallback {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
}
.trip-stop-body { flex: 1; min-width: 0; }
.trip-stop-title {
  font-weight: 700; font-size: 14px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.trip-stop-meta { font-size: 12px; color: var(--muted-fg); }
.trip-stop-link, .trip-stop-remove {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  border: none;
  background: var(--muted);
  color: var(--fg);
  cursor: pointer;
  transition: all var(--transition);
}
.trip-stop-link svg, .trip-stop-remove svg { width: 15px; height: 15px; }
.trip-stop-link:hover { background: var(--primary); color: var(--primary-fg); }
.trip-stop-remove:hover { background: var(--destructive); color: white; }

.trip-stop-notes-wrap {
  position: relative;
  padding-left: 46px;
}
.trip-stop-notes {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 34px 8px 10px;
  background: var(--muted);
  color: var(--fg);
  font-size: 12px;
  font-family: var(--font-body);
  line-height: 1.4;
  resize: vertical;
  min-height: 40px;
  transition: border-color var(--transition), background var(--transition);
}
.trip-stop-notes::placeholder { color: var(--muted-fg); }
.trip-stop-notes:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--card);
}
.trip-stop-notes-status {
  position: absolute;
  right: 10px;
  bottom: 10px;
  font-size: 11px;
  font-weight: 700;
  color: hsl(142 71% 35%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}
.trip-stop-notes-status.is-visible { opacity: 1; }

/* ===== Map ===== */
.trip-map-wrap { position: sticky; top: 16px; min-width: 0; max-width: 100%; }
.trip-map-wrap.is-fullscreen {
  position: fixed;
  inset: 0;
  z-index: 2000;
  top: 0;
}
.trip-fullscreen-body {
  display: contents;
}
.trip-map {
  height: 420px;
  width: 100%;
  max-width: 100%;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted-fg);
  font-size: 13px;
  text-align: center;
  padding: 20px;
  transition: none;
}
.trip-fullscreen-sidebar { display: none; }

.trip-map-wrap.is-fullscreen .trip-fullscreen-body {
  display: flex;
  height: 100vh;
  height: 100dvh;
}
.trip-map-wrap.is-fullscreen .trip-map {
  flex: 1;
  height: 100%;
  border-radius: 0;
  border: none;
}
.trip-map-wrap.is-fullscreen .trip-fullscreen-sidebar {
  display: flex;
  flex-direction: column;
  width: 340px;
  flex-shrink: 0;
  height: 100vh;
  height: 100dvh;
  background: var(--card);
  border-left: 1px solid var(--border);
  padding: 16px;
}
.trip-map-wrap.is-fullscreen .trip-map-controls {
  right: 352px;
}
.trip-fullscreen-sidebar-title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 12px;
  flex-shrink: 0;
}
.trip-fullscreen-sidebar-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
body.trip-map-fullscreen-lock { overflow: hidden; }

@media (max-width: 768px) {
  .trip-map-wrap.is-fullscreen .trip-fullscreen-body { flex-direction: column; }
  .trip-map-wrap.is-fullscreen .trip-map { flex: none; height: 52vh; }
  .trip-map-wrap.is-fullscreen .trip-map-controls { right: 12px; }
  .trip-map-wrap.is-fullscreen .trip-fullscreen-sidebar {
    width: 100%;
    height: 48vh;
    border-left: none;
    border-top: 1px solid var(--border);
  }
}
.trip-map-marker span {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--primary-fg);
  font-size: 12px; font-weight: 700;
  border: 2px solid white;
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
  cursor: pointer;
}
.trip-map-marker--event span { background: var(--secondary); color: var(--secondary-fg); }
.trip-map-marker--attraction span { background: var(--accent); color: white; }
.trip-map-marker--custom span { background: hsl(280 65% 55%); color: white; }
.trip-map-marker--start span { background: hsl(142 71% 40%); color: white; }
.trip-map-marker--end span { background: var(--destructive); color: white; }
.trip-map-marker--me span {
  width: 18px; height: 18px;
  background: #2563eb;
  border: 3px solid white;
  box-shadow: 0 0 0 4px hsl(217 91% 60% / 0.3), 0 2px 6px rgba(0,0,0,0.3);
  cursor: default;
}

/* ===== Custom stop placement popup ===== */
.trip-custom-stop-popup {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 2px;
}
.trip-custom-stop-input {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  background: var(--card);
  color: var(--fg);
  font-size: 13px;
  width: 100%;
}
.trip-custom-stop-input:focus {
  outline: none;
  border-color: var(--primary);
}
.trip-custom-stop-actions {
  display: flex;
  gap: 8px;
}
.trip-custom-stop-actions .trip-btn {
  padding: 6px 10px;
  font-size: 12px;
}

.trip-map-controls {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 501;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.trip-map-control-btn {
  width: 38px; height: 38px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--fg);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  transition: all var(--transition);
}
.trip-map-control-btn svg { width: 18px; height: 18px; }
.trip-map-control-btn:hover { background: var(--primary); color: var(--primary-fg); border-color: var(--primary); }
.trip-map-control-btn:disabled { opacity: 0.5; cursor: wait; }

/* ===== Add from saved ===== */
.trip-add-section { margin-top: 32px; }
.trip-section-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 14px;
}
.trip-add-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}
.trip-add-card {
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: box-shadow 250ms ease, transform 250ms ease;
}
.trip-add-card:hover {
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}
.trip-add-card-media {
  position: relative;
  height: 120px;
  background: var(--muted);
}
.trip-add-card-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.trip-add-card-media-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
}
.trip-add-card-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(9, 14, 23, 0.65);
  color: white;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 3px 8px;
  border-radius: 999px;
}
.trip-add-card-body {
  padding: 12px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.trip-add-card-title {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.trip-add-card-meta {
  font-size: 11px;
  color: var(--muted-fg);
  min-height: 14px;
}
.trip-add-card .trip-add-btn {
  margin-top: 8px;
  width: 100%;
}
.trip-add-card--event { border-top: 3px solid var(--secondary); }
.trip-add-card--attraction { border-top: 3px solid var(--accent); }
.trip-add-card-badge--event { background: rgba(37, 99, 235, 0.85); }
.trip-add-card-badge--attraction { background: rgba(139, 44, 158, 0.85); }

/* ===== Add-to-trip modal ===== */
.trip-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(9, 14, 23, 0.56);
  backdrop-filter: blur(6px);
}
.trip-modal.is-open { display: flex; }
.trip-modal-card {
  width: min(100%, 440px);
  max-height: 85vh;
  overflow-y: auto;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.24);
  padding: 22px;
}
.trip-modal-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 14px;
}
.trip-modal-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 260px;
  overflow-y: auto;
  margin-bottom: 16px;
}
.trip-modal-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
}
.trip-modal-item-added {
  font-size: 12px;
  font-weight: 700;
  color: hsl(142 71% 35%);
  background: hsl(142 71% 45% / 0.1);
  border: 1px solid hsl(142 71% 45% / 0.25);
  border-radius: 8px;
  padding: 6px 10px;
  white-space: nowrap;
}
.trip-modal-new-form {
  display: flex;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.trip-modal-input {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 9px 12px;
  background: var(--card);
  color: var(--fg);
  font-size: 14px;
}
.trip-modal-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 14px;
}
.trip-modal-item-title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ===== Responsive ===== */
@media (max-width: 1024px) {
  .trip-grid { grid-template-columns: repeat(2, 1fr); }
  .trip-layout { grid-template-columns: 1fr; }
  .trip-map-wrap { position: relative; }
}
@media (max-width: 640px) {
  .trip-page { padding: 20px 16px; max-width: 100%; overflow-x: hidden; }
  .trip-grid { grid-template-columns: 1fr; }
  .trip-header { flex-direction: column; align-items: stretch; }
  .trip-header h1 { font-size: 22px; }
  .trip-header-cta { align-self: stretch; width: 100%; }
  .trip-header-actions { width: 100%; flex-wrap: wrap; }
  .trip-header-actions .trip-btn,
  .trip-header-actions form { flex: 1 1 calc(50% - 4px); }
  .trip-header-actions form .trip-btn { width: 100%; }
  .trip-form-row { flex-direction: column; }
  .trip-modal-new-form { flex-direction: column; }
  .trip-modal-new-form .trip-btn { width: 100%; }
  .trip-map { height: 260px; }
  .trip-add-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .trip-add-card-media { height: 80px; }
  .trip-add-card-media-fallback { font-size: 24px; }
  .trip-add-card-badge { font-size: 9px; padding: 2px 6px; }
  .trip-add-card-body { padding: 8px 10px 10px; gap: 3px; }
  .trip-add-card-title { font-size: 12px; }
  .trip-add-card-meta { font-size: 10px; min-height: 12px; }
  .trip-add-card .trip-add-btn { font-size: 11px; padding: 7px 10px; margin-top: 6px; }
  .trip-add-card .trip-add-btn svg { width: 12px; height: 12px; }
}

@media (max-width: 480px) {
  .trip-stop { padding: 8px; }
  .trip-stop-row { gap: 6px; }
  .trip-stop-img { width: 40px; height: 40px; }
  .trip-stop-handle { padding: 2px; }
  .trip-stop-handle svg { width: 16px; height: 16px; }
  .trip-stop-number { width: 22px; height: 22px; font-size: 11px; }
  .trip-stop-link, .trip-stop-remove { width: 30px; height: 30px; }
  .trip-stop-notes-wrap { padding-left: 36px; }
}

/* ===== Udostępnianie podróży (share modal + strona publiczna) ===== */
.trip-share-toggle-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 16px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.trip-toggle {
  position: relative;
  display: inline-block;
  width: 42px;
  height: 24px;
  flex-shrink: 0;
}
.trip-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}
.trip-toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  cursor: pointer;
  transition: background var(--transition);
}
.trip-toggle-slider::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  left: 2px;
  top: 2px;
  background: white;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  transition: transform var(--transition);
}
.trip-toggle input:checked + .trip-toggle-slider {
  background: var(--primary);
  border-color: var(--primary);
}
.trip-toggle input:checked + .trip-toggle-slider::before {
  transform: translateX(18px);
}
.trip-share-toggle-label {
  font-size: 14px;
  font-weight: 700;
}
.trip-share-toggle-hint {
  font-size: 12px;
  color: var(--muted-fg);
}

.trip-share-slug-row {
  display: flex;
  align-items: center;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}
.trip-share-slug-prefix {
  padding: 9px 0 9px 12px;
  font-size: 13px;
  color: var(--muted-fg);
  white-space: nowrap;
  flex-shrink: 0;
}
.trip-share-slug-row .trip-modal-input {
  border: none;
  border-radius: 0;
  padding-left: 2px;
}

.trip-share-link-row {
  display: flex;
  gap: 8px;
}

.trip-share-social-row {
  display: flex;
  gap: 10px;
  margin: 16px 0;
}
.trip-share-social-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--muted);
  color: var(--fg);
  transition: all var(--transition);
}
.trip-share-social-btn svg { width: 18px; height: 18px; }
.trip-share-social-btn--facebook:hover { background: #1877f2; color: white; }
.trip-share-social-btn--whatsapp:hover { background: #25d366; color: white; }
.trip-share-social-btn--x:hover { background: #000; color: white; }
.trip-share-social-btn--linkedin:hover { background: #0a66c2; color: white; }

.trip-share-stats {
  display: flex;
  gap: 24px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.trip-share-stat {
  display: flex;
  flex-direction: column;
}
.trip-share-stat strong {
  font-family: var(--font-display);
  font-size: 20px;
}
.trip-share-stat span {
  font-size: 12px;
  color: var(--muted-fg);
}

/* ===== Strona publiczna podróży ===== */
.trip-public-hero { margin-bottom: 24px; }
.trip-public-hero-eyebrow {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--primary);
  margin-bottom: 6px;
}
.trip-public-hero h1 {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 800;
  margin-bottom: 8px;
}
.trip-public-hero-meta {
  font-size: 13px;
  color: var(--muted-fg);
  margin-bottom: 10px;
}
.trip-public-hero-dot { margin: 0 6px; }
.trip-public-rating {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  flex-wrap: wrap;
}
.trip-public-rating-stars { display: flex; gap: 2px; }
.trip-public-rating-stars svg { width: 16px; height: 16px; color: #f59e0b; }
.trip-public-rating-count { font-size: 13px; color: var(--muted-fg); }
.trip-public-rating-link { font-size: 13px; font-weight: 600; color: var(--primary); text-decoration: none; }
.trip-public-rating-link:hover { text-decoration: underline; }
.trip-public-hero .trip-btn { margin-top: 14px; }
.trip-public-hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.trip-stop-notes-readonly {
  padding-left: 46px;
  font-size: 12px;
  color: var(--muted-fg);
  line-height: 1.4;
}

.trip-public-actions {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  max-width: 480px;
}
.trip-public-cta { margin-top: 10px; }
.trip-public-stats { margin-top: 20px; max-width: 480px; }

@media (max-width: 640px) {
  .trip-public-hero h1 { font-size: 24px; }
}

/* ===== Galeria publicznych podróży (/planery/) ===== */
.trip-discover-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
}
.trip-discover-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  transition: box-shadow 250ms ease, transform 250ms ease;
}
.trip-discover-card:hover {
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}
.trip-discover-card-media {
  position: relative;
  height: 140px;
  background: var(--muted);
}
.trip-discover-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.trip-discover-card-media-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
}
.trip-discover-card-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(9, 14, 23, 0.65);
  color: white;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
}
.trip-discover-card-body {
  padding: 14px 16px 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.trip-discover-card-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  margin-bottom: 6px;
}
.trip-discover-card-desc {
  font-size: 12px;
  color: var(--muted-fg);
  flex: 1;
  margin-bottom: 10px;
}
.trip-discover-card-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}
.trip-discover-card-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--primary-fg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  overflow: hidden;
  flex-shrink: 0;
}
.trip-discover-card-avatar img { width: 100%; height: 100%; object-fit: cover; }
.trip-discover-card-author {
  font-size: 12px;
  color: var(--muted-fg);
}

.trip-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 32px;
}
.trip-pagination-current {
  font-size: 13px;
  color: var(--muted-fg);
}

/* ===== Motywy kolorystyczne publicznych podróży ===== */
.trip-page[data-trip-theme="ocean"], .trip-discover-card[data-trip-theme="ocean"] {
  --trip-primary: #0ea5e9;
  --trip-primary-fg: #ffffff;
  --trip-accent: #06b6d4;
  --trip-border: #7dd3fc;
}
.trip-page[data-trip-theme="las"], .trip-discover-card[data-trip-theme="las"] {
  --trip-primary: #16a34a;
  --trip-primary-fg: #ffffff;
  --trip-accent: #65a30d;
  --trip-border: #86efac;
}
.trip-page[data-trip-theme="zachod_slonca"], .trip-discover-card[data-trip-theme="zachod_slonca"] {
  --trip-primary: #f97316;
  --trip-primary-fg: #ffffff;
  --trip-accent: #ec4899;
  --trip-border: #fdba74;
}
.trip-page[data-trip-theme="festiwal"], .trip-discover-card[data-trip-theme="festiwal"] {
  --trip-primary: #a855f7;
  --trip-primary-fg: #ffffff;
  --trip-accent: #ec4899;
  --trip-border: #e9d5ff;
}
.trip-page[data-trip-theme="minimal"], .trip-discover-card[data-trip-theme="minimal"] {
  --trip-primary: #334155;
  --trip-primary-fg: #ffffff;
  --trip-accent: #64748b;
  --trip-border: #cbd5e1;
}
.trip-page[data-trip-theme="premium_dark"], .trip-discover-card[data-trip-theme="premium_dark"] {
  --trip-primary: #eab308;
  --trip-primary-fg: #1c1917;
  --trip-accent: #f59e0b;
  --trip-border: #eab308;
  --trip-bg: #0f172a;
  --trip-card: #1e293b;
  --trip-fg: #f1f5f9;
  --trip-muted-fg: #94a3b8;
}

/* Zastosowanie motywu na stronie publicznej i prywatnej stronie podróży */
.trip-page[data-trip-theme] .trip-public-hero-eyebrow { color: var(--trip-primary); }
.trip-page[data-trip-theme] .trip-public-actions .trip-btn--primary,
.trip-page[data-trip-theme] .trip-public-hero .trip-btn--primary,
.trip-page[data-trip-theme] .trip-header-actions .trip-btn--primary,
.trip-page[data-trip-theme] .trip-add-btn,
.trip-page[data-trip-theme] .trip-theme-swatch.is-selected {
  background: var(--trip-primary);
  color: var(--trip-primary-fg);
}
.trip-page[data-trip-theme] .trip-icon-swatch.is-selected { border-color: var(--trip-primary); }
.trip-page[data-trip-theme] .trip-segmented-btn.is-selected {
  background: var(--trip-primary);
  color: var(--trip-primary-fg);
}
.trip-page[data-trip-theme] .trip-stop-number {
  background: var(--trip-primary);
  color: var(--trip-primary-fg);
}
.trip-page[data-trip-theme] .trip-share-social-btn:hover { background: var(--trip-accent); color: #fff; }
.trip-page[data-trip-theme] .trip-map-wrap { border-color: var(--trip-border); }

.trip-page[data-trip-theme="premium_dark"] {
  background: var(--trip-bg);
  color: var(--trip-fg);
  border-radius: var(--radius-lg);
}
.trip-page[data-trip-theme="premium_dark"] .trip-subtitle,
.trip-page[data-trip-theme="premium_dark"] .trip-public-hero-meta,
.trip-page[data-trip-theme="premium_dark"] .trip-stop-meta,
.trip-page[data-trip-theme="premium_dark"] .trip-share-stat span {
  color: var(--trip-muted-fg);
}
.trip-page[data-trip-theme="premium_dark"] .trip-stop,
.trip-page[data-trip-theme="premium_dark"] .trip-modal-input,
.trip-page[data-trip-theme="premium_dark"] .trip-map {
  background: var(--trip-card);
  border-color: rgba(234, 179, 8, 0.25);
}

/* Akcent motywu na kartach w galerii /planery/ i na stronie głównej */
.trip-discover-card[data-trip-theme] { border-top: 3px solid var(--trip-primary); }
.trip-discover-card[data-trip-theme] .trip-discover-card-avatar { background: var(--trip-primary); color: var(--trip-primary-fg); }

/* ===== Wybór motywu w modalu udostępniania ===== */
.trip-theme-picker {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.trip-theme-swatch {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid transparent;
  padding: 3px;
  cursor: pointer;
  background: transparent;
  transition: all var(--transition);
}
.trip-theme-swatch span {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
}
.trip-theme-swatch.is-selected {
  border-color: var(--fg);
}
.trip-theme-swatch--ocean span { background: linear-gradient(135deg, #0ea5e9, #06b6d4); }
.trip-theme-swatch--las span { background: linear-gradient(135deg, #16a34a, #65a30d); }
.trip-theme-swatch--zachod_slonca span { background: linear-gradient(135deg, #f97316, #ec4899); }
.trip-theme-swatch--festiwal span { background: linear-gradient(135deg, #a855f7, #ec4899); }
.trip-theme-swatch--premium_dark span { background: linear-gradient(135deg, #0f172a, #eab308); }
.trip-theme-swatch--minimal span { background: linear-gradient(135deg, #334155, #94a3b8); }

/* ===== Personalizacja mapy (pinezki) w modalu udostępniania ===== */
.trip-pin-group { margin-bottom: 14px; }
.trip-personalize-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: start;
  margin-bottom: 14px;
}
.trip-personalize-2col .trip-pin-group,
.trip-personalize-2col .trip-form-field {
  margin-bottom: 0;
  min-width: 0;
}
.trip-pin-group-label {
  display: block;
  font-size: 12px;
  color: var(--muted-fg);
  margin-bottom: 6px;
}
.trip-icon-picker {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.trip-icon-swatch {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 2px solid var(--border);
  background: var(--muted);
  font-size: 17px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}
.trip-icon-swatch.is-selected {
  border-color: var(--primary);
  background: var(--card);
}

.trip-pin-colors {
  display: flex;
  gap: 16px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.trip-pin-color-field {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted-fg);
}
.trip-pin-color-field input[type="color"] {
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  background: none;
}

.trip-segmented {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  width: 100%;
}
.trip-segmented-btn {
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 600;
  background: var(--card);
  color: var(--muted-fg);
  border: none;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  text-align: left;
  transition: all var(--transition);
}
.trip-segmented-btn:last-child { border-bottom: none; }
.trip-segmented-btn.is-selected {
  background: var(--primary);
  color: var(--primary-fg);
}

/* Pinezka z numerem w trybie "klasyczna numeracja" — mała plakietka w rogu */
.trip-map-marker span em {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 16px;
  height: 16px;
  background: #fff;
  color: #111;
  border-radius: 50%;
  font-style: normal;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}

/* ===== Style kart podróży (Minimal / Travel / Premium / Dark) ===== */
/* Minimal (domyślny) = obecny bazowy wygląd .trip-discover-card / .trip-card, brak nadpisań */

/* Travel — styl inspirowany przewodnikami turystycznymi */
.trip-discover-card[data-card-style="travel"],
.trip-card[data-card-style="travel"] {
  border-style: dashed;
  border-width: 2px;
  border-radius: 6px;
  background: #fdf8ee;
}
.trip-discover-card[data-card-style="travel"] .trip-discover-card-title,
.trip-card[data-card-style="travel"] .trip-card-title {
  font-family: Georgia, 'Times New Roman', serif;
}
.trip-discover-card[data-card-style="travel"] .trip-discover-card-media,
.trip-card[data-card-style="travel"] .trip-card-thumb {
  position: relative;
}
.trip-discover-card[data-card-style="travel"] .trip-discover-card-media::after,
.trip-card[data-card-style="travel"] .trip-card-thumb::after {
  content: '✈';
  position: absolute;
  top: 8px;
  left: 8px;
  width: 26px;
  height: 26px;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}

/* Premium — większe zdjęcia i efektowne animacje */
.trip-discover-card[data-card-style="premium"] { box-shadow: 0 12px 40px rgba(0, 0, 0, 0.16); }
.trip-discover-card[data-card-style="premium"] .trip-discover-card-media,
.trip-card[data-card-style="premium"] .trip-card-thumb {
  height: 190px;
  overflow: hidden;
}
.trip-discover-card[data-card-style="premium"] .trip-discover-card-media img {
  transition: transform 400ms ease;
}
.trip-discover-card[data-card-style="premium"]:hover .trip-discover-card-media img { transform: scale(1.08); }
.trip-discover-card[data-card-style="premium"] .trip-discover-card-title,
.trip-card[data-card-style="premium"] .trip-card-title {
  font-size: 18px;
}

/* Dark — tryb ciemny karty, niezależnie od jasnego/ciemnego motywu strony */
.trip-discover-card[data-card-style="dark"],
.trip-card[data-card-style="dark"] {
  background: #171923;
  border-color: #2d3340;
  color: #e2e8f0;
}
.trip-discover-card[data-card-style="dark"] .trip-discover-card-desc,
.trip-discover-card[data-card-style="dark"] .trip-discover-card-author,
.trip-card[data-card-style="dark"] .trip-card-dates,
.trip-card[data-card-style="dark"] .trip-card-desc {
  color: #9aa5b8;
}
.trip-discover-card[data-card-style="dark"] .trip-discover-card-foot,
.trip-card[data-card-style="dark"] .trip-card-footer {
  border-color: #2d3340;
}

.trip-card-style-preview {
  margin-top: 12px;
  max-width: 100%;
  pointer-events: none;
}

/* ===== Rankingi podróży (/rankingi/) ===== */
.trip-ranking-section { margin-top: 36px; }
.trip-ranking-section:first-of-type { margin-top: 8px; }
.trip-ranking-card { position: relative; }
.trip-ranking-rank {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 1;
  background: rgba(9, 14, 23, 0.75);
  color: white;
  font-size: 12px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 999px;
}
.trip-ranking-metric {
  margin-top: 8px;
  font-size: 12px;
  font-weight: 700;
  color: var(--primary);
}
