:root {
  --bg: #0c1017;
  --surface: #151b26;
  --surface-2: #1c2433;
  --border: #2a3548;
  --border-soft: #222b3a;
  --text: #eef2f8;
  --muted: #8d9cb3;
  --muted-2: #5c6b82;
  --accent: #4a9eed;
  --accent-dim: rgba(74, 158, 237, 0.12);
  --ok: #34c88a;
  --ok-dim: rgba(52, 200, 138, 0.12);
  --warn: #e8a838;
  --warn-dim: rgba(232, 168, 56, 0.12);
  --danger: #f07178;
  --danger-dim: rgba(240, 113, 120, 0.12);
  --night: #a78bfa;
  --night-dim: rgba(167, 139, 250, 0.12);
  --day: #fbbf24;
  --day-dim: rgba(251, 191, 36, 0.12);
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
  --sticky-top: 0.5rem;
}

* {
  box-sizing: border-box;
}

.seo-fallback {
  max-width: 720px;
  margin: 1.5rem auto;
  padding: 0 1rem 2rem;
  color: #eef2f8;
  font-family: system-ui, sans-serif;
  line-height: 1.6;
}

.seo-fallback h1 {
  font-size: 1.5rem;
  margin: 0 0 0.75rem;
}

.seo-fallback h2 {
  font-size: 1.1rem;
  margin: 1.25rem 0 0.5rem;
}

.seo-fallback p,
.seo-fallback ul {
  color: #8d9cb3;
}

.seo-fallback a {
  color: #4a9eed;
}

body {
  margin: 0;
  font-family: "DM Sans", system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(74, 158, 237, 0.15), transparent),
    var(--bg);
  min-height: 100vh;
}

.app {
  max-width: 720px;
  margin: 0 auto;
  padding: 1.25rem 1rem 3rem;
}

/* ── Hero ── */
.hero {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-bottom: 1rem;
}

.hero-bar {
  display: flex;
  justify-content: flex-end;
}

.hero-content {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
}

.hero-text {
  flex: 1 1 15rem;
  min-width: 0;
}

.hero-text h1 {
  margin: 0;
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.hero-text p {
  margin: 0.2rem 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.hero-tagline {
  font-size: 0.92rem !important;
  color: var(--text) !important;
  font-weight: 600;
}

.hero-routes {
  margin-top: 0.15rem !important;
  font-size: 0.82rem !important;
  color: var(--muted) !important;
}

.hero-disclaimer {
  margin-top: 0.35rem !important;
  font-size: 0.75rem !important;
  color: var(--muted-2) !important;
  font-style: italic;
}

.hero-contact {
  margin-top: 0.45rem !important;
  font-size: 0.82rem !important;
}

.hero-contact a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.hero-contact a:hover {
  text-decoration: underline;
}

.hero-contact-sep {
  margin: 0 0.25rem;
  opacity: 0.45;
}

.hero-side {
  flex: 1 1 15rem;
  max-width: 22rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.65rem;
  text-align: left;
}

.lang-switch {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.lang-switch-label {
  font-size: 0.72rem;
  color: var(--muted-2);
  margin-right: 0.15rem;
}

.lang-opt {
  padding: 0.2rem 0.55rem;
  border-radius: 99px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.lang-opt[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--accent-dim);
  color: var(--accent);
}

.lang-opt:hover {
  border-color: var(--accent);
  color: var(--text);
}

.hero-bmc {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.45;
}

.hero-bmc-prompt {
  display: block;
}

.hero-bmc a {
  display: inline-block;
  margin-top: 0;
  padding: 0.3rem 0.65rem;
  border-radius: 99px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  font-weight: 600;
  font-size: 0.78rem;
  text-decoration: none;
  transition: border-color 0.15s, background 0.15s;
}

.hero-bmc a:hover {
  border-color: #ffdd00;
  background: rgba(255, 221, 0, 0.08);
}

.hero-rules {
  width: 100%;
  font-size: 0.8rem;
  color: var(--muted);
}

.hero-rules-body {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.rule-note {
  margin: 0;
  line-height: 1.45;
  color: var(--muted);
}

.hero-rules summary {
  cursor: pointer;
  color: var(--muted-2);
  list-style: none;
  user-select: none;
}

.hero-rules summary::-webkit-details-marker {
  display: none;
}

.hero-rules summary::after {
  content: " ▾";
  font-size: 0.7rem;
}

.hero-rules[open] summary::after {
  content: " ▴";
}

.hero-rules[open] summary {
  margin-bottom: 0.4rem;
  color: var(--muted);
}

.rule {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  margin-top: 0;
  line-height: 1.45;
}

.rule .dot {
  margin-top: 0.35rem;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.dot.day {
  background: var(--day);
}

.dot.night {
  background: var(--night);
}

/* ── Sticky controls ── */
.controls {
  position: sticky;
  top: var(--sticky-top);
  z-index: 10;
  background: rgba(12, 16, 23, 0.92);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 0.85rem 1rem 0.75rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow);
}

.route-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.75rem;
}

.route-opt {
  flex: 1 1 auto;
  min-width: 4.5rem;
  padding: 0.45rem 0.65rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--muted);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  white-space: nowrap;
}

.route-opt:hover {
  border-color: var(--border);
  color: var(--text);
}

.route-opt[aria-checked="true"] {
  background: var(--accent-dim);
  border-color: rgba(74, 158, 237, 0.45);
  color: var(--accent);
}

.field-adults {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.75rem;
}

.field-label {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--muted-2);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  flex-shrink: 0;
}

.field-adults input {
  width: 3.5rem;
}

input,
select {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.65rem;
  font: inherit;
  font-size: 0.9rem;
  transition: border-color 0.15s;
}

input:focus {
  outline: none;
  border-color: var(--accent);
}

/* ── Week picker ── */
.week-picker {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.week-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
}

.week-btn:active:not(:disabled) {
  transform: scale(0.96);
}

.week-btn:hover:not(:disabled) {
  background: var(--surface-2);
  border-color: var(--accent);
  color: var(--accent);
}

.week-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.week-center {
  flex: 1;
  text-align: center;
  min-width: 0;
}

.week-label {
  display: block;
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: -0.01em;
}

.week-today {
  margin-top: 0.2rem;
  padding: 0.15rem 0.5rem;
  background: var(--accent-dim);
  border: none;
  border-radius: 99px;
  color: var(--accent);
  font: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  white-space: normal;
  line-height: 1.25;
  max-width: 100%;
}

.week-today:hover {
  background: rgba(74, 158, 237, 0.2);
}

/* ── Week strip ── */
.week-strip {
  display: grid;
  gap: 0.35rem;
  margin-top: 0.75rem;
}

.strip-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  padding: 0.45rem 0.2rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 0.7rem;
  cursor: default;
  transition: background 0.15s, border-color 0.15s;
}

.strip-day .dow {
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.62rem;
}

.strip-day .dom {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--muted-2);
  line-height: 1;
}

.strip-day.is-today .dom {
  color: var(--accent);
}

.strip-day.is-today .dow::after {
  content: "";
  display: block;
  width: 4px;
  height: 4px;
  margin: 0.1rem auto 0;
  border-radius: 50%;
  background: var(--accent);
}

.strip-day.has-sailings {
  cursor: pointer;
  color: var(--text);
}

.strip-day.has-sailings .dom {
  color: var(--text);
}

.strip-day.has-sailings:hover {
  background: var(--surface);
  border-color: var(--border);
}

.strip-day.active {
  background: var(--accent-dim);
  border-color: rgba(74, 158, 237, 0.35);
}

.strip-day.active .dom {
  color: var(--accent);
}

.strip-count {
  min-width: 1.15rem;
  height: 1.15rem;
  padding: 0 0.3rem;
  border-radius: 99px;
  background: var(--ok);
  color: #0a1a12;
  font-size: 0.62rem;
  font-weight: 700;
  line-height: 1.15rem;
  text-align: center;
}

.strip-count.zero {
  background: transparent;
  color: var(--muted-2);
  font-weight: 500;
}

/* ── Status ── */
.status {
  margin: 0.65rem 0 0;
  font-size: 0.8rem;
  color: var(--muted);
  min-height: 1.2em;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.status.error {
  color: var(--danger);
}

.status-hint {
  color: var(--muted-2);
  font-size: 0.75rem;
}

.btn-text {
  padding: 0;
  background: none;
  border: none;
  color: var(--accent);
  font: inherit;
  font-size: inherit;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.btn-text:hover {
  color: var(--text);
}

.status.loading .spinner {
  display: inline-block;
  width: 0.85rem;
  height: 0.85rem;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ── Results ── */
.results {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  transition: opacity 0.2s;
}

.results.is-loading {
  opacity: 0.55;
  pointer-events: none;
}

.results.is-refreshing {
  opacity: 0.85;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.day-group {
  scroll-margin-top: 10rem;
  animation: fadeUp 0.25s ease-out both;
}

.week-empty {
  text-align: center;
  padding: 2.5rem 1.5rem;
  color: var(--muted);
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  animation: fadeUp 0.25s ease-out;
}

.week-empty strong {
  display: block;
  color: var(--text);
  font-size: 1.05rem;
  margin-bottom: 0.4rem;
}

.week-empty p {
  margin: 0 0 1rem;
  font-size: 0.9rem;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.55rem 1rem;
  background: var(--accent);
  border: none;
  border-radius: var(--radius-sm);
  color: #fff;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: filter 0.15s, transform 0.1s;
}

.btn-primary:hover {
  filter: brightness(1.08);
}

.btn-primary:active {
  transform: scale(0.98);
}

.error-panel {
  text-align: center;
  padding: 2rem 1.5rem;
  background: var(--danger-dim);
  border: 1px solid rgba(240, 113, 120, 0.25);
  border-radius: var(--radius);
}

.error-panel p {
  margin: 0 0 1rem;
  color: var(--danger);
}

/* ── Day group ── */
.day-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 0.65rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-soft);
}

.day-name {
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.day-today {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent);
  background: var(--accent-dim);
  padding: 0.12rem 0.4rem;
  border-radius: 99px;
}

.day-count {
  margin-left: auto;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--ok);
  background: var(--ok-dim);
  padding: 0.1rem 0.45rem;
  border-radius: 99px;
}

/* ── Sailing card ── */
.sailing {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.85rem;
  padding: 0.85rem 1rem;
  margin-bottom: 0.5rem;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.sailing:last-child {
  margin-bottom: 0;
}

.sailing:hover {
  border-color: var(--border);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
}

.sailing-times {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
  padding-right: 0.85rem;
  border-right: 1px solid var(--border-soft);
  min-width: 3.5rem;
}

.sailing-dep {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.sailing-arr {
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.sailing-arr::before {
  content: "↓ ";
  opacity: 0.4;
  font-size: 0.65rem;
}

.sailing-body {
  min-width: 0;
}

.sailing-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.5rem;
}

.chip {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.5rem;
  border-radius: 99px;
  font-size: 0.72rem;
  font-weight: 600;
}

.chip-route {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
}

.chip-day {
  background: var(--day-dim);
  color: var(--day);
}

.chip-night {
  background: var(--night-dim);
  color: var(--night);
}

.chip-ship {
  color: var(--muted);
  font-weight: 500;
  padding: 0;
}

.sailing-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-left: auto;
}

.sailing-price {
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: -0.02em;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.book-link {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  white-space: nowrap;
  opacity: 0.85;
  font-variant-numeric: tabular-nums;
}

.book-link:hover {
  opacity: 1;
  text-decoration: underline;
}

.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.45rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0.55rem;
  border-radius: 99px;
  font-size: 0.72rem;
  font-weight: 500;
}

.badge.ok {
  background: var(--ok-dim);
  color: var(--ok);
}

.badge.warn {
  background: var(--warn-dim);
  color: var(--warn);
}

.badge.no {
  background: var(--danger-dim);
  color: var(--danger);
}

.badge-label {
  opacity: 0.75;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.6rem;
  letter-spacing: 0.04em;
}

.cabins {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.cabin {
  font-size: 0.75rem;
  padding: 0.25rem 0.55rem;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  color: var(--muted);
}

.cabin-note {
  font-size: 0.75rem;
  color: var(--muted-2);
  font-style: italic;
}

.cabin-total {
  color: var(--text);
  font-weight: 600;
}

.skeleton-card {
  height: 5.5rem;
  border-radius: var(--radius);
  background: linear-gradient(90deg, var(--surface) 25%, var(--surface-2) 50%, var(--surface) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
  margin-bottom: 0.5rem;
}

@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

@media (max-width: 480px) {
  .app {
    padding-top: 0.75rem;
  }

  .hero-text h1 {
    font-size: 1.25rem;
  }

  .hero-content {
    flex-direction: column;
  }

  .hero-side {
    max-width: none;
    width: 100%;
  }

  .route-opt {
    flex: 1 1 calc(50% - 0.2rem);
    min-width: 0;
    font-size: 0.72rem;
    padding: 0.5rem 0.4rem;
  }

  .sailing {
    grid-template-columns: 1fr;
    gap: 0.65rem;
  }

  .sailing-times {
    flex-direction: row;
    border-right: none;
    border-bottom: 1px solid var(--border-soft);
    padding: 0 0 0.65rem;
    min-width: 0;
    justify-content: flex-start;
    gap: 0.5rem;
  }

  .sailing-arr::before {
    content: "→ ";
  }

  .sailing-actions {
    margin-left: 0;
    width: 100%;
    justify-content: space-between;
  }

  .week-strip .dow {
    font-size: 0.58rem;
  }
}

.site-footer {
  margin-top: 2.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-soft);
  text-align: center;
}

.site-credit {
  margin: 0 0 0.35rem;
  font-size: 0.75rem;
  color: var(--muted-2);
  letter-spacing: 0.02em;
}

.site-credit a {
  color: var(--muted);
  text-decoration: none;
}

.site-credit a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.visitor-count {
  margin: 0;
  font-size: 0.75rem;
  color: var(--muted-2);
  letter-spacing: 0.02em;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
