:root {
  --blue: #0b66c3;
  --green: #16955f;
  --ink: #0e4194;
  --line: #d8e7ed;
  --soft: #eef8f5;
  --bg: #f6fbfd;
  --footer: #adc9f6;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding-bottom: 74px;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body.day-overlay-open {
  overflow: hidden;
}

.hidden {
  display: none !important;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 1300;
  display: grid;
  grid-template-columns: minmax(110px, 1fr) auto minmax(110px, 1fr);
  align-items: center;
  gap: 18px;
  min-height: 150px;
  padding: 22px clamp(18px, 4vw, 44px);
  background:
    linear-gradient(rgba(8, 28, 42, 0.28), rgba(8, 28, 42, 0.28)),
    url("/assets/Berneraniedrig2.jpg") center / 100% 100% no-repeat;
  border-bottom: 1px solid var(--line);
  text-align: center;
}

.brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 8px 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.62);
  box-shadow: 0 10px 26px rgba(8, 28, 42, 0.16);
}

.brand h1,
.brand p {
  margin: 0;
  color: var(--ink);
}

.brand img {
  width: 58px;
  height: 58px;
  border-radius: 8px;
  object-fit: cover;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-actions-left {
  justify-content: flex-start;
}

.header-actions-right {
  justify-content: flex-end;
}

main {
  padding: 24px clamp(16px, 4vw, 44px);
}

button {
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  padding: 0 16px;
  background: var(--blue);
  color: white;
  font: inherit;
  font-weight: 750;
  cursor: pointer;
}

button:hover {
  filter: brightness(0.96);
}

.ghost {
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid rgba(255, 255, 255, 0.48);
  color: var(--ink);
  box-shadow: 0 10px 26px rgba(8, 28, 42, 0.16);
}

input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  color: var(--ink);
  font: inherit;
}

label {
  display: grid;
  gap: 7px;
  font-weight: 700;
}

.muted {
  margin: 4px 0 0;
  color: var(--ink);
  opacity: 0.78;
}

.login-panel,
.view-section,
.story-band {
  width: min(1120px, 100%);
  margin: 0 auto 18px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  box-shadow: 0 10px 26px rgba(14, 34, 51, 0.06);
}

.login-panel {
  max-width: none;
}

.login-panel h2,
.view-section h2,
.story-band h2 {
  margin: 0;
}

.follow-note {
  margin: 8px 0 0;
  color: var(--ink);
  font-weight: 650;
}

.follow-note a {
  color: var(--blue);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.login-grid {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) minmax(160px, 1fr) auto;
  align-items: end;
  gap: 12px;
  margin-top: 12px;
}

.password-field {
  position: relative;
  display: block;
}

.password-field input {
  padding-right: 54px;
}

.icon-button {
  appearance: none;
  position: absolute;
  top: 50%;
  right: 6px;
  width: 38px;
  height: 38px;
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: translateY(-50%);
  padding: 0;
  border: 0;
  border-radius: 999px;
  color: var(--ink);
  background: transparent;
  line-height: 0;
  box-shadow: none;
}

.eye-icon {
  width: 21px;
  height: 21px;
  display: block;
  flex: 0 0 21px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
  pointer-events: none;
}

.eye-icon circle {
  fill: currentColor;
  stroke: none;
}

.eye-closed,
.showing-password .eye-open {
  display: none;
}

.showing-password .eye-closed {
  display: block;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.section-hint {
  margin: 6px 0 0;
  color: var(--ink);
  font-weight: 750;
  opacity: 0.78;
}

.album-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 18px;
}

.album-card {
  display: grid;
  gap: 10px;
  align-content: start;
  color: var(--ink);
  text-decoration: none;
}

.album-cover {
  position: relative;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border-radius: 8px;
  border: 1px solid #c9dfe8;
  background: #eaf5ff;
  box-shadow: 0 12px 30px rgba(14, 34, 51, 0.14);
}

.album-cover img,
.album-cover svg {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.album-cover::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 36%;
  background: linear-gradient(transparent, rgba(8, 28, 42, 0.42));
  pointer-events: none;
}

.album-card strong {
  font-size: 1.08rem;
}

.album-card span {
  font-weight: 650;
  opacity: 0.82;
}

.story-hero {
  position: relative;
  width: min(1120px, 100%);
  min-height: clamp(260px, 42vh, 520px);
  margin: 0 auto 18px;
  overflow: hidden;
  border-radius: 8px;
  border: 1px solid var(--line);
  background:
    linear-gradient(135deg, rgba(173, 201, 246, 0.82), rgba(238, 248, 245, 0.86)),
    url("/assets/Berneraniedrig2.jpg") center / cover no-repeat;
}

.story-hero-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.story-hero-image {
  object-fit: cover;
  z-index: 2;
}

.story-hero-copy {
  position: absolute;
  inset: auto 18px 18px;
  z-index: 3;
  width: min(680px, calc(100% - 36px));
  padding: 14px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 16px 38px rgba(8, 28, 42, 0.18);
}

.story-hero-copy h2 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 4.4rem);
  line-height: 0.95;
}

.story-hero-copy p {
  margin: 8px 0 0;
  font-weight: 750;
}

.story-map-band {
  width: min(1120px, 100%);
  margin: 0 auto 18px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  box-shadow: 0 10px 26px rgba(14, 34, 51, 0.06);
  overflow: hidden;
}

.story-route-map {
  position: relative;
  width: 100%;
  height: clamp(260px, 42vh, 440px);
  background: #dff0f8;
}

.station-pin-marker-wrap {
  background: transparent;
  border: 0;
}

.station-pin-marker {
  position: relative;
  display: block;
  width: 46px;
  height: 74px;
  filter: drop-shadow(0 4px 9px rgba(14, 65, 148, 0.28));
}

.station-pin-marker img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.station-pin-number {
  position: absolute;
  top: 31%;
  left: 50%;
  width: 25px;
  transform: translate(-50%, -50%);
  color: white;
  text-align: center;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
  font: 800 10px/1 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.summary-layout {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.summary-total,
.elevation-card {
  padding: 14px;
  border-radius: 8px;
  border: 1px solid #cfe9df;
  background: #eef9f4;
}

.summary-total {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  align-items: center;
  justify-content: space-between;
  font-weight: 750;
}

.elevation-card {
  display: grid;
  gap: 8px;
  background: #f5fbff;
}

.elevation-chart {
  display: block;
  width: 100%;
  height: 120px;
}

.elevation-area {
  fill: rgba(173, 201, 246, 0.48);
}

.elevation-reference-line {
  stroke: rgba(14, 65, 148, 0.24);
  stroke-width: 1.2;
}

.elevation-reference-label {
  fill: #0e4194;
  font: 700 12px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.elevation-line {
  fill: none;
  stroke: var(--green);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.elevation-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.82rem;
  font-weight: 650;
}

.timeline {
  display: grid;
  gap: 18px;
  margin-top: 12px;
}

.day-card {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--footer);
  overflow: hidden;
  cursor: pointer;
}

.day-open {
  display: grid;
  width: 100%;
  min-height: 0;
  justify-items: center;
  gap: 8px;
  padding: 14px;
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  text-align: center;
  box-shadow: none;
}

.day-card > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px;
  font-weight: 800;
  cursor: pointer;
}

.day-card > summary::-webkit-details-marker {
  display: none;
}

.day-card > summary::after {
  content: "▾";
  transition: transform 0.18s ease;
}

.day-card:not([open]) > summary::after {
  transform: rotate(-90deg);
}

.day-card small {
  text-align: right;
  font-weight: 650;
  opacity: 0.82;
}

.day-open small {
  text-align: center;
  font-weight: 650;
  opacity: 0.82;
}

.day-open > span {
  font-size: 1.32rem;
  font-weight: 900;
}

.day-main-map {
  margin: 0 14px 18px;
  padding: 0;
  width: auto;
  display: block;
  height: 190px;
  min-height: 190px;
}

.day-main-map .leaflet-container,
.day-main-map .empty-state {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 190px;
}

.day-main-map {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  background: #dff0f8;
}

.day-main-map .empty-state {
  display: grid;
}

.story-route-map::after,
.day-main-map::after,
.day-overview-map::after {
  content: "Karte gesperrt · Doppelklick zum Bewegen";
  position: absolute;
  left: 10px;
  bottom: 10px;
  z-index: 900;
  max-width: calc(100% - 20px);
  padding: 6px 9px;
  border-radius: 8px;
  color: white;
  background: rgba(11, 102, 195, 0.88);
  font-size: 0.76rem;
  font-weight: 800;
  pointer-events: none;
}

.story-route-map.map-unlocked::after,
.day-main-map.map-unlocked::after,
.day-overview-map.map-unlocked::after {
  content: "Karte beweglich";
  background: rgba(22, 149, 95, 0.9);
}

.day-map-empty-label {
  position: absolute;
  inset: auto 10px 10px;
  z-index: 450;
  display: grid;
  place-items: center;
  min-height: 42px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  font-weight: 800;
}

.day-media-strip {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 74px;
  gap: 8px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  padding: 0 14px 14px;
  scrollbar-width: thin;
  scrollbar-color: rgba(14, 65, 148, 0.35) transparent;
  -webkit-overflow-scrolling: touch;
}

.day-media-strip .media-tile {
  margin: 0;
  min-width: 0;
}

.day-media-strip .media-tile figcaption {
  display: none;
}

.day-media-strip .media-thumb {
  aspect-ratio: 1;
  min-height: 0;
  border-color: rgba(14, 65, 148, 0.18);
}

.day-overlay {
  display: none;
}

.day-card.open .day-overlay {
  position: fixed;
  top: calc(50dvh + 38px);
  left: 50%;
  z-index: 4200;
  display: block;
  width: min(560px, calc(100vw - 52px));
  height: calc(100dvh - 164px);
  aspect-ratio: 9 / 16;
  max-height: calc(100dvh - 164px);
  transform: translate(-50%, -50%);
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 8px;
  background: #07131e;
  box-shadow: 0 22px 60px rgba(7, 19, 30, 0.34);
  overflow: hidden;
}

.day-content {
  display: grid;
  gap: 14px;
  padding: 0 14px 14px;
}

.day-close {
  display: none;
}

.day-swipe-hint {
  display: none;
}

.day-overview {
  display: grid;
  grid-template-rows: 32% auto auto minmax(0, 1fr);
  gap: 12px;
  height: 100%;
  padding: 12px 12px calc(176px + env(safe-area-inset-bottom));
  scroll-padding-bottom: calc(176px + env(safe-area-inset-bottom));
  overflow: auto;
  background: #adc9f6;
  color: var(--ink);
}

.day-overview::after {
  content: "";
  display: block;
  min-height: 96px;
}

.day-overview-map {
  position: relative;
  min-height: 180px;
  overflow: hidden;
  border: 1px solid rgba(14, 65, 148, 0.18);
  border-radius: 8px;
  background: #dff0f8;
}

.day-overview-profile .elevation-card {
  gap: 8px;
  padding: 10px;
}

.day-overview-profile .elevation-card > strong {
  display: none;
}

.day-overview-head {
  display: grid;
  justify-items: center;
  gap: 4px;
  text-align: center;
}

.day-overview-head strong {
  font-size: 1.2rem;
}

.day-overview-head span {
  font-weight: 750;
  line-height: 1.35;
}

.day-station-list {
  display: grid;
  align-content: start;
  gap: 10px;
  margin-bottom: 124px;
}

.day-station-choice {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid rgba(14, 65, 148, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.76);
  box-shadow: 0 10px 22px rgba(14, 34, 51, 0.12);
}

.day-station-open {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  width: 100%;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.day-station-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.day-station-copy strong,
.day-station-copy em {
  overflow-wrap: anywhere;
}

.day-station-copy small {
  font-weight: 800;
}

.day-station-copy em {
  font-style: normal;
  line-height: 1.35;
}

.station-reactions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.reaction-button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 34px;
  padding: 4px 8px;
  border: 1px solid rgba(14, 65, 148, 0.18);
  border-radius: 8px;
  background: #2581c4;
  color: white;
  font-size: 1rem;
  font-weight: 850;
  cursor: pointer;
}

.reaction-button:disabled {
  opacity: 0.62;
  cursor: wait;
}

.reaction-button strong {
  min-width: 1ch;
  color: white;
  font-size: 0.86rem;
}

.day-station-empty {
  margin: 0;
  padding: 18px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  font-weight: 800;
}

.day-station-media-strip {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(58px, 1fr));
  gap: 7px;
}

.day-station-media-strip .media-tile {
  min-width: 0;
}

.day-station-media-strip .media-thumb {
  aspect-ratio: 1;
  border-color: rgba(14, 65, 148, 0.18);
}

.day-station-media-strip .media-tile figcaption,
.day-station-muted {
  display: none;
}

.day-card.open .day-swipe-hint {
  position: absolute;
  right: 24px;
  bottom: calc(78px + env(safe-area-inset-bottom));
  z-index: 4300;
  display: inline-grid;
  place-items: center;
  width: 50px;
  min-height: 50px;
  padding: 0;
  border: 0;
  height: 50px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.58);
  color: var(--ink);
  font-size: 2.2rem;
  font-weight: 900;
  line-height: 1;
  box-shadow: 0 10px 24px rgba(7, 19, 30, 0.22);
  cursor: pointer;
  backdrop-filter: blur(10px);
}

.day-card.open .day-close {
  position: absolute;
  right: 14px;
  bottom: calc(14px + env(safe-area-inset-bottom));
  z-index: 4300;
  display: inline-grid;
  place-items: center;
  width: 54px;
  min-height: 54px;
  padding: 0;
  border: 3px solid white;
  border-radius: 999px;
  background: #cd472e;
  color: white;
  box-shadow: 0 16px 34px rgba(14, 34, 51, 0.26);
  font-size: 0;
  line-height: 0;
}

.day-card.open .day-close::before {
  content: "×";
  display: block;
  color: white;
  font-size: 2.7rem;
  font-weight: 700;
  line-height: 0.8;
  transform: translateY(-0.03em);
}

.day-album-track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 100%;
  width: 100%;
  height: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.day-album-track::-webkit-scrollbar {
  display: none;
}

.day-slide {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  overflow: hidden;
  scroll-snap-align: start;
  background: #07131e;
}

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

.day-slide video.day-slide-media {
  object-fit: contain;
  background: #07131e;
}

.day-slide-poster-source {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.day-slide-poster {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: none;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

.day-slide.poster-ready:not(.video-playing) .day-slide-poster {
  display: block;
}

.day-slide-play {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 2;
  display: none;
  width: 68px;
  height: 68px;
  align-items: center;
  justify-content: center;
  transform: translate(-50%, -50%);
  border-radius: 999px;
  background: rgba(11, 102, 195, 0.84);
  color: white;
  font-size: 1.8rem;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.26);
  pointer-events: none;
}

.day-slide.poster-ready:not(.video-playing) .day-slide-play {
  display: flex;
}

.day-slide-placeholder {
  display: grid;
  place-items: center;
  color: white;
  font-size: 1.4rem;
  font-weight: 800;
}

.day-slide-caption {
  position: absolute;
  right: 104px;
  bottom: calc(18px + env(safe-area-inset-bottom));
  left: 14px;
  z-index: 2;
  display: grid;
  gap: 6px;
  max-height: 34dvh;
  overflow: auto;
  padding: 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.68);
  color: var(--ink);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(10px);
  overflow-wrap: anywhere;
}

.day-slide-caption-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.day-slide-caption-line strong {
  min-width: 0;
  overflow-wrap: anywhere;
  line-height: 1.2;
}

.day-slide-caption-line > span {
  flex: 0 0 auto;
}

.day-slide-caption p {
  margin: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.day-slide-caption small {
  font-weight: 750;
  opacity: 0.82;
}

.station-carousel {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(280px, 78%);
  gap: 16px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  padding: 6px 6px 18px;
  scroll-snap-type: x mandatory;
  scrollbar-color: var(--footer) transparent;
  perspective: 1100px;
  -webkit-overflow-scrolling: touch;
}

.station-entry {
  position: relative;
  display: grid;
  grid-template-columns: minmax(92px, 130px) minmax(0, 1fr);
  gap: 14px;
  min-height: 260px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(173, 201, 246, 0.16)),
    white;
  box-shadow: 10px 12px 24px rgba(14, 34, 51, 0.09);
  scroll-snap-align: start;
  transform-origin: left center;
}

.station-entry::after {
  content: "";
  position: absolute;
  inset: 10px 8px 10px auto;
  width: 14px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(14, 65, 148, 0), rgba(14, 65, 148, 0.14));
  pointer-events: none;
}

.station-time {
  display: grid;
  align-content: start;
  gap: 6px;
  font-weight: 750;
}

.station-number {
  display: inline-flex;
  width: fit-content;
  min-width: 38px;
  justify-content: center;
  padding: 4px 7px;
  border-radius: 8px;
  color: white;
  background: #1677b8;
  font-size: 0.78rem;
}

.station-copy {
  display: grid;
  gap: 8px;
}

.station-copy h3,
.station-copy p {
  margin: 0;
}

.media-wall {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}

.media-tile {
  display: grid;
  gap: 4px;
  margin: 0;
}

.media-thumb {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 0;
  aspect-ratio: 4 / 5;
  padding: 0;
  overflow: hidden;
  border-radius: 8px;
  border: 1px solid #c9dfe8;
  background: linear-gradient(145deg, #0e2233, #1677b8);
  cursor: zoom-in;
}

.media-thumb img,
.media-thumb video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.media-video-source {
  opacity: 0.75;
}

.media-video-canvas {
  position: absolute;
  inset: 0;
  display: none;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.media-thumb.video-ready .media-video-canvas {
  display: block;
}

.media-play {
  position: absolute;
  inset: auto auto 8px 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  color: white;
  background: rgba(11, 102, 195, 0.92);
  font-size: 0.85rem;
}

.media-tile figcaption {
  font-size: 0.78rem;
  font-weight: 650;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 5000;
  display: grid;
  grid-template-columns: minmax(46px, 80px) minmax(0, 1fr) minmax(46px, 80px);
  align-items: center;
  gap: 10px;
  padding: 22px;
  background: rgba(5, 18, 28, 0.88);
}

.lightbox-stage {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 10px;
  margin: 0;
  min-width: 0;
}

.lightbox-stage img,
.lightbox-stage video {
  display: block;
  max-width: 100%;
  max-height: 82vh;
  width: auto;
  height: auto;
  border-radius: 8px;
  background: black;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.35);
}

.lightbox-stage figcaption,
.lightbox-close,
.lightbox-nav {
  color: white;
}

.lightbox-stage figcaption {
  display: grid;
  gap: 8px;
  width: min(100%, 820px);
}

.lightbox-caption-text {
  display: grid;
  gap: 5px;
  line-height: 1.28;
}

.lightbox-caption-text strong {
  display: flex;
  align-items: center;
  gap: 7px;
  overflow-wrap: anywhere;
}

.lightbox-caption-text p {
  margin: 0;
  overflow-wrap: anywhere;
}

.lightbox-reactions {
  gap: 7px;
}

.lightbox-close,
.lightbox-nav {
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(11, 102, 195, 0.88);
}

.lightbox-close {
  position: fixed;
  top: 16px;
  right: 16px;
  width: 44px;
  min-height: 44px;
  padding: 0;
  border-radius: 999px;
  font-size: 1.8rem;
  line-height: 1;
}

.lightbox-nav {
  width: 52px;
  min-height: 72px;
  padding: 0;
  justify-self: center;
  border-radius: 8px;
  font-size: 2.4rem;
  line-height: 1;
}

.trip-preview-bg {
  fill: #dff0f8;
}

.trip-preview-grid {
  fill: none;
  stroke: rgba(11, 102, 195, 0.12);
  stroke-width: 1;
}

.trip-preview-route-shadow,
.trip-preview-route {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.trip-preview-route-shadow {
  stroke: rgba(14, 34, 51, 0.18);
  stroke-width: 8;
}

.trip-preview-route {
  stroke: var(--green);
  stroke-width: 4;
}

.trip-preview-start {
  fill: white;
  stroke: var(--green);
  stroke-width: 3;
}

.trip-preview-end {
  fill: var(--blue);
  stroke: white;
  stroke-width: 3;
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 170px;
  border: 1px solid #c9dfe8;
  border-radius: 8px;
  background: #eef8f5;
  font-weight: 750;
}

.site-footer {
  position: fixed;
  inset: auto 0 0;
  z-index: 1200;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 58px;
  padding: 10px 16px;
  background: var(--footer);
  border-top: 1px solid rgba(255, 255, 255, 0.26);
  box-shadow: 0 -8px 24px rgba(14, 34, 51, 0.08);
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 650;
}

.footer-brand,
.footer-links-left {
  display: inline-flex;
  align-items: center;
}

.footer-brand {
  justify-content: center;
  gap: 10px;
}

.footer-links-left {
  gap: 14px;
  justify-self: start;
}

.footer-link {
  justify-self: end;
  color: var(--ink);
  font-weight: 750;
  text-decoration: none;
}

.footer-link:hover {
  text-decoration: underline;
}

.site-footer img {
  display: block;
  width: min(210px, 54vw);
  height: auto;
  max-height: 36px;
  object-fit: contain;
}

@media (max-width: 850px) {
  .topbar,
  .site-footer {
    grid-template-columns: 1fr;
  }

  .header-actions-left,
  .header-actions-right,
  .footer-links-left,
  .footer-link {
    justify-content: center;
    justify-self: center;
  }

  .login-grid,
  .station-entry {
    grid-template-columns: 1fr;
  }

  .station-carousel {
    grid-auto-columns: minmax(calc(100vw - 38px), calc(100vw - 38px));
  }

  .day-card.open .day-overlay {
    position: fixed;
    inset: 0;
    z-index: 4200;
    display: block;
    width: 100vw;
    height: 100dvh;
    max-height: none;
    transform: none;
    border: 0;
    border-radius: 0;
    background: #07131e;
    overflow: hidden;
  }

  .day-card.open .day-close {
    position: absolute;
    right: 18px;
    bottom: calc(18px + env(safe-area-inset-bottom));
    z-index: 4300;
    display: inline-grid;
    place-items: center;
    width: 54px;
    min-height: 54px;
    padding: 0;
    border: 3px solid white;
    border-radius: 999px;
    background: #cd472e;
    color: white;
    box-shadow: 0 16px 34px rgba(14, 34, 51, 0.26);
    font-size: 0;
    line-height: 0;
  }

  .lightbox {
    grid-template-columns: 1fr;
    gap: 0;
    padding: 0;
    background: #07131e;
  }

  .lightbox-stage {
    width: 100vw;
    height: 100dvh;
    gap: 0;
    align-items: stretch;
    justify-items: stretch;
  }

  .lightbox-stage img,
  .lightbox-stage video {
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    border-radius: 0;
    object-fit: cover;
    box-shadow: none;
  }

  .lightbox-stage figcaption {
    position: absolute;
    right: 82px;
    bottom: calc(18px + env(safe-area-inset-bottom));
    left: 14px;
    z-index: 2;
    width: auto;
    max-height: 42dvh;
    overflow: auto;
    padding: 12px;
    border-radius: 8px;
    background: rgba(7, 19, 30, 0.58);
    color: white;
    backdrop-filter: blur(10px);
  }

  .lightbox-close {
    top: auto;
    right: 18px;
    bottom: calc(18px + env(safe-area-inset-bottom));
    z-index: 3;
    width: 44px;
    min-height: 44px;
    border: 3px solid white;
    background: #cd472e;
  }

  .lightbox-nav {
    position: fixed;
    top: 50%;
    z-index: 3;
    width: 42px;
    min-height: 64px;
    transform: translateY(-50%);
    background: rgba(37, 129, 196, 0.78);
  }

  .lightbox-nav[data-lightbox-prev] {
    left: 8px;
  }

  .lightbox-nav[data-lightbox-next] {
    right: 8px;
  }

  body.day-overlay-open {
    overflow: hidden;
  }

  .section-title,
  .day-card > summary,
  .day-open,
  .summary-total,
  .elevation-meta {
    align-items: flex-start;
    flex-direction: column;
  }

  .day-card small,
  .day-open small {
    text-align: left;
  }

  .day-open {
    align-items: center;
    justify-items: center;
  }

  .day-open small {
    text-align: center;
  }
}
