/* ═══════════════════════════════════════════
   Chart Cruises — One-Way Cruise Route Visualizer
   Dark theme with DM Sans + Cormorant Garamond fonts
   ═══════════════════════════════════════════ */

/* ─── Self-hosted Fonts ─── */
@font-face {
  font-family: 'DM Sans';
  font-style: normal;
  font-weight: 300 600;
  font-display: swap;
  src: url('/fonts/dm-sans-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'DM Sans';
  font-style: italic;
  font-weight: 300;
  font-display: swap;
  src: url('/fonts/dm-sans-italic-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Cormorant Garamond';
  font-style: normal;
  font-weight: 500 700;
  font-display: swap;
  src: url('/fonts/cormorant-garamond-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Cormorant Garamond';
  font-style: italic;
  font-weight: 500;
  font-display: swap;
  src: url('/fonts/cormorant-garamond-italic-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0B1A2E;
  --surface: #122240;
  --surface2: #1A2D4E;
  --border: #2A3D5C;
  --text: #E8DFD0;
  --text-dim: #A89C8C;
  --accent: #C9A96E;
  --accent-glow: rgba(201,169,110,0.25);
  --orange: #D4A055;
  --pink: #C48B6E;
  --blue: #7A9BB5;
  --purple: #8B7EAA;
  --category-transpacific-e: #C9A96E;
  --category-transpacific-w: #D4A055;
  --category-transatlantic-e: #7A9BB5;
  --category-transatlantic-w: #8B7EAA;
  --category-panama: #C48B6E;
  --category-south-america: #B87E6A;
  --category-coastal: #8AAA80;
  --font-body: 'DM Sans', sans-serif;
  --font-display: 'Cormorant Garamond', serif;
}

html, body { height: 100%; overflow: hidden; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
}

#app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100vw;
  position: relative;
}

/* ─── Site Header ─── */
.site-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  z-index: 100;
}
.header-logo-icon {
  width: 28px;
  height: 28px;
  color: var(--accent);
  flex-shrink: 0;
}

/* ─── Nav Menu (hamburger + dropdown) ─── */
.nav-menu {
  position: relative;
  margin-left: auto;
}
.nav-menu-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  background: transparent;
  border: 0;
  cursor: pointer;
  color: var(--accent);
}
.nav-menu-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}
.nav-menu-toggle .nav-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  transition: opacity 0.25s ease;
}
.nav-menu-toggle[aria-expanded="false"] .nav-icon-close { opacity: 0; }
.nav-menu-toggle[aria-expanded="true"] .nav-icon-menu { opacity: 0; }
.nav-menu-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 220px;
  padding: 6px 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  z-index: 200;
  font-family: var(--font-body);
}
.nav-menu-dropdown[hidden] {
  display: none;
}
.nav-menu-dropdown a {
  display: block;
  padding: 10px 16px;
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
}
.nav-menu-dropdown a:hover,
.nav-menu-dropdown a:focus-visible {
  background: rgba(201, 169, 110, 0.12);
  color: var(--accent);
  outline: none;
}
.nav-menu-version {
  padding: 8px 16px 4px;
  margin-top: 4px;
  border-top: 1px solid var(--border);
  font-size: 11px;
  color: var(--text);
  opacity: 0.45;
  text-align: right;
  letter-spacing: 0.04em;
}

/* ─── Map Canvas ─── */
#map-container {
  flex: 1;
  position: relative;
  overflow: hidden;
  margin-bottom: 56px;
}
#map-container canvas { display: block; }

/* ─── Top Bar (used by landing pages) ─── */
#top-bar {
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  background: linear-gradient(to bottom, rgba(11,26,46,0.95), rgba(11,26,46,0));
  pointer-events: none;
}
#top-bar > * { pointer-events: auto; }
#top-bar .logo {
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 21px;
}
#top-bar .logo svg { width: 63px; height: 63px; }

/* ─── Logo Text ─── */
.logo-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1;
}
.logo-chart {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 1.5px;
}
.logo-rule {
  display: block;
  width: 100%;
  height: 1px;
  background: var(--accent);
  opacity: 0.4;
  margin: 1px 0;
}
.logo-cruises {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: 3px;
  text-transform: uppercase;
}

/* ─── Search Box ─── */
.search-box {
  position: relative;
  width: 540px;
}
.search-box input {
  width: 100%;
  padding: 18px 24px 18px 63px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 15px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 22px;
  outline: none;
  transition: border-color 0.2s;
}
.search-box input::placeholder { color: var(--text-dim); }
.search-box input:focus { border-color: var(--accent); }
.search-box svg {
  position: absolute;
  left: 21px;
  top: 50%;
  transform: translateY(-50%);
  width: 27px;
  height: 27px;
  color: var(--text-dim);
}
.search-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 15px;
  overflow: hidden;
  display: none;
}
.search-results.active { display: block; }
.search-result-item {
  padding: 10px 14px;
  cursor: pointer;
  font-size: 13px;
  transition: background 0.15s;
  display: flex;
  align-items: center;
  gap: 8px;
}
.search-result-item:active,
.search-result-item.selected { background: var(--surface2); }
.search-result-item .port-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}
.search-result-item mark {
  background: none;
  color: inherit;
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-underline-offset: 2px;
}

/* ─── Port Filter ─── */
.port-filter-container {
  display: none;
  width: 100%;
  flex-direction: column;
  background: none;
  border: none;
  border-radius: 0;
  overflow: visible;
}
.drawer-content .port-filter-container {
  display: flex;
}
.port-filter-row-entry {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.port-filter-row-entry:last-child {
  border-bottom: none;
}
.row-role {
  text-transform: uppercase;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: var(--accent);
  background: rgba(201,169,110,0.12);
  padding: 2px 6px;
  border-radius: 4px;
  flex-shrink: 0;
  cursor: pointer;
  transition: background 0.15s;
}
.row-role:active {
  background: rgba(201,169,110,0.25);
}
.row-port-name {
  color: var(--text);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.row-remove {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  padding: 0 2px;
  flex-shrink: 0;
}
.row-remove:active { color: var(--text); }

.add-filter-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 8px 12px;
  background: none;
  border: none;
  color: var(--text-dim);
  font-family: var(--font-body);
  font-size: 12px;
  cursor: pointer;
  transition: color 0.15s;
}
.add-filter-btn:active { color: var(--accent); }
.add-filter-btn .plus { font-size: 14px; font-weight: 600; }

.port-filter-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 12px;
}
.role-toggle {
  display: flex;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.role-btn {
  flex: 1;
  text-align: center;
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-family: var(--font-body);
  font-size: 12px;
  padding: 8px 10px;
  min-height: 44px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}
.role-btn:not(:last-child) { border-right: 1px solid var(--border); }
.role-btn.active {
  background: var(--accent);
  color: var(--bg);
  font-weight: 600;
}
.role-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.port-search-wrap {
  position: relative;
  flex: 1;
}
.port-search-input {
  width: 100%;
  padding: 8px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}
.port-search-input::placeholder { color: var(--text-dim); }
.port-search-input:focus { border-color: var(--accent); }
.port-search-wrap .search-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow-y: auto;
  overflow-x: hidden;
  max-height: 300px;
  display: none;
  z-index: 110;
}
.port-search-wrap .search-results.active { display: block; }

/* ─── Filter Sections ─── */
.filter-section {
  padding: 8px 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.filter-row-group {
  flex-direction: row;
  gap: 12px;
}
.filter-number-control {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.filter-number-control label {
  font-size: 12px;
  color: var(--text-dim);
}
.filter-number-input {
  width: 100%;
  padding: 8px 12px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  min-height: 44px;
}
.filter-number-input::placeholder { color: var(--text-dim); }
.filter-toggles-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.filter-toggles-row .voyage-type-toggle {
  display: contents;
}
.filter-toggles-row .voyage-btn {
  border-radius: 0;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.filter-toggles-row .voyage-btn:nth-child(2n) {
  border-right: none;
}
.filter-toggles-row .voyage-type-toggle:last-child .voyage-btn {
  border-bottom: none;
}
.filter-clear-section {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

/* ─── Voyage Type Toggle ─── */
.voyage-type-toggle {
  display: flex;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.voyage-btn {
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-family: var(--font-body);
  font-size: 14px;
  padding: 10px 16px;
  min-height: 44px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}
.voyage-btn:not(:last-child) { border-right: 1px solid var(--border); }
.voyage-btn.active {
  background: var(--accent);
  color: var(--bg);
  font-weight: 600;
}
.voyage-btn:active:not(.active) {
  background: var(--surface2);
}

/* ─── Max Stops Slider ─── */
.max-stops-control {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text-dim);
}
.max-stops-control label {
  white-space: nowrap;
}
.max-stops-control input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100px;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  outline: none;
}
.max-stops-control input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg);
  cursor: pointer;
}
.max-stops-control input[type="range"]::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg);
  cursor: pointer;
}
#max-stops-label {
  min-width: 80px;
  color: var(--text);
  font-size: 12px;
  cursor: pointer;
}
#max-stops-label:active { color: var(--accent); }
.stops-inline-input {
  width: 50px;
  padding: 2px 6px;
  background: var(--surface);
  border: 1px solid var(--accent);
  border-radius: 6px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 12px;
  outline: none;
  text-align: center;
}

/* ─── Price Filter ─── */
.price-filter-control {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-dim);
}
.price-filter-control label { white-space: nowrap; }
.price-filter-control input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 80px;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  outline: none;
}
.price-filter-control input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg);
  cursor: pointer;
}
.price-filter-control input[type="range"]::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg);
  cursor: pointer;
}
#price-filter-label {
  min-width: 50px;
  color: var(--text);
  font-size: 12px;
}

/* ─── Cruise Line Filter ─── */
.cruise-line-filter {
  -webkit-appearance: none;
  appearance: none;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 24px 4px 8px;
  font-family: var(--font-body);
  font-size: 12px;
  cursor: pointer;
  outline: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6' fill='%239A8E7E'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
}
.cruise-line-filter:active { border-color: var(--accent); }
.cruise-line-filter:focus { border-color: var(--accent); }

/* ─── Bottom Controls ─── */
#controls {
  display: none;
  width: 100%;
  padding: 0 16px 10px;
  background: none;
}
.drawer-content #controls {
  display: block;
}

.slider-container {
  max-width: 1050px;
  margin: 0 auto;
}
.slider-date-labels {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--text);
  margin-bottom: 6px;
}
.date-input {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-family: var(--font-display);
  font-size: 16px;
  padding: 4px 8px;
  cursor: pointer;
  transition: border-color 0.2s;
}
.date-input:focus {
  border-color: var(--accent);
  outline: none;
}
/* Webkit date picker icon coloring */
.date-input::-webkit-calendar-picker-indicator {
  filter: invert(0.7) sepia(0.3);
  cursor: pointer;
}
.dual-slider {
  position: relative;
  height: 36px;
  display: flex;
  align-items: center;
}
.dual-slider input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  position: absolute;
  width: 100%;
  height: 36px;
  margin: 0;
  background: transparent;
  pointer-events: none;
  outline: none;
}
.dual-slider input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg);
  cursor: pointer;
  pointer-events: auto;
  position: relative;
  z-index: 2;
}
.dual-slider input[type="range"]::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg);
  cursor: pointer;
  pointer-events: auto;
}
.slider-track {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  left: 0;
  right: 0;
  height: 3px;
  border-radius: 1.5px;
  background: var(--border);
}
.slider-track-active {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  height: 3px;
  border-radius: 1.5px;
  background: var(--accent);
}

/* ─── Clear Filters Button ─── */
.clear-filters-btn {
  display: block;
  margin: 12px auto 0;
  padding: 8px 24px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-dim);
  font-family: var(--font-body);
  font-size: 14px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.clear-filters-btn:active {
  background: var(--border);
  color: var(--text);
}

/* ─── Stats bar ─── */
.stats-bar {
  display: flex;
  gap: 8px;
  padding: 4px 0;
}
.stat-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 10px 8px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-dim);
  font-family: var(--font-body);
  font-size: 13px;
  cursor: pointer;
  transition: border-color 0.15s;
  min-height: 44px;
}
.stat-btn:active {
  border-color: var(--accent);
}
.stat-btn strong {
  color: var(--text);
  font-size: 18px;
  font-weight: 600;
}

/* ─── Shared Modal Styles (used by nights picker, category picker) ─── */
.date-picker-modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px;
  min-width: 300px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}
.date-picker-header {
  font-family: var(--font-display);
  font-size: 18px;
  color: var(--text);
  margin-bottom: 16px;
  text-align: center;
}
.date-picker-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}
.date-picker-actions button {
  padding: 8px 20px;
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 14px;
  cursor: pointer;
  border: none;
  transition: background 0.2s;
}
.dp-cancel {
  background: var(--bg);
  color: var(--text-dim);
  border: 1px solid var(--border) !important;
}
.dp-cancel:active { background: var(--border); }
.dp-apply {
  background: var(--accent);
  color: var(--bg);
  font-weight: 600;
}
.dp-apply:active { opacity: 0.85; }

/* Nights picker (reuses date-picker-modal styles) */
.nights-picker-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  justify-content: center;
  align-items: center;
}
.nights-picker-overlay.active { display: flex; }
.nights-picker-inputs {
  display: flex;
  gap: 16px;
  margin-bottom: 20px;
}
.nights-picker-inputs label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-dim);
  font-size: 14px;
}
.nights-picker-inputs input {
  width: 80px;
  padding: 8px 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  outline: none;
}
.nights-picker-inputs input:focus { border-color: var(--accent); }

/* Category picker */
.category-picker-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  justify-content: center;
  align-items: center;
}
.category-picker-overlay.active { display: flex; }
.category-picker-modal { max-width: 400px; }
.category-picker-search {
  width: 100%;
  padding: 8px 10px;
  margin-bottom: 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 13px;
  box-sizing: border-box;
}
.category-picker-search:focus {
  outline: none;
  border-color: var(--accent);
}
.category-picker-actions-top {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}
.cp-toggle-all {
  padding: 4px 12px;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text-dim);
  transition: background 0.2s;
}
.cp-toggle-all:active { background: var(--border); }
.category-picker-list {
  max-height: 300px;
  overflow-y: auto;
  margin-bottom: 16px;
}
.category-picker-list label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 4px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
}
.category-picker-list label:active { background: rgba(255,255,255,0.03); }
.category-picker-list input[type="checkbox"] {
  accent-color: var(--accent);
}

/* ─── Cruise Panel ─── */
.cruise-panel {
  display: none;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
  flex: 1;
}
.drawer-content .cruise-panel {
  display: flex;
}

.panel-view {
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  min-height: 0;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.panel-title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
}
.panel-close {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 4px;
  font-size: 18px;
  line-height: 1;
}
.panel-close:active { color: var(--text); }
.panel-header-actions { display: flex; align-items: center; gap: 4px; }
.panel-share {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 4px;
  line-height: 1;
  display: flex;
  align-items: center;
}
.panel-share:active { color: var(--text); }
.share-toast {
  position: absolute;
  bottom: -28px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent);
  color: var(--bg);
  font-size: 11px;
  font-family: var(--font-body);
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 4px;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
}
.share-toast.visible { opacity: 1; }
.panel-back {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 13px;
  padding: 4px 0;
}
.panel-back:active { color: var(--text); }

.panel-items {
  overflow-y: auto;
  padding: 8px 12px;
  flex: 1;
  min-height: 0;
}
.panel-group-label {
  font-size: 10px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin: 8px 0 4px;
}
.panel-item {
  padding: 6px 8px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s;
}
.panel-item:active { background: var(--surface2); }
.panel-item .ship {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}
.panel-item .detail {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 1px;
}

/* Panel detail view */
.panel-detail-title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 500;
  line-height: 1.3;
  padding: 14px 16px 0;
}
.panel-detail-meta {
  font-size: 13px;
  color: var(--text-dim);
  padding: 6px 16px 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
}
.panel-detail-meta span::after {
  content: '\00b7';
  margin-left: 8px;
  color: var(--border);
}
.panel-detail-meta span:last-child::after {
  content: none;
}
.panel-detail-meta span { white-space: nowrap; }
.panel-detail-price {
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding: 0 16px 12px;
}
.panel-detail-price .price {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 600;
  color: var(--accent);
}
.panel-detail-price .per-day {
  font-size: 12px;
  color: var(--text-dim);
}
.panel-detail-link {
  display: block;
  text-align: center;
  padding: 10px;
  margin: 0 16px 16px;
  background: var(--accent);
  color: var(--bg);
  text-decoration: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  transition: opacity 0.2s;
}
.panel-detail-link:active { opacity: 0.85; }
.panel-detail-related {
  padding: 0 12px 12px;
}
.panel-detail-related:empty { display: none; }

/* ─── Itinerary Section ─── */
.panel-itinerary {
  list-style: none;
  padding: 0 12px 12px;
  font-size: 13px;
}
.panel-itinerary li {
  display: flex;
  align-items: baseline;
  gap: 12px;
  color: var(--text);
  padding: 6px 0;
  border-bottom: 1px solid rgba(42, 61, 92, 0.3);
}
.panel-itinerary li.sea-day {
  color: var(--text-dim);
  font-style: italic;
}
.itin-date {
  flex-shrink: 0;
  width: 52px;
  font-size: 12px;
  color: var(--text-dim);
}
.itin-name {
  flex: 1;
}

/* ─── FAQ Section ─── */
.panel-faq { padding: 0 12px 12px; }
.panel-faq dt {
  color: var(--accent);
  font-size: 13px;
  font-weight: 500;
  margin-top: 10px;
}
.panel-faq dd {
  color: var(--text-dim);
  font-size: 12px;
  margin: 4px 0 0;
  line-height: 1.5;
}

/* ─── Loading State ─── */
.loading-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  z-index: 500;
  transition: opacity 0.4s;
}
.loading-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}
.loading-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ─── SSR Content Overlay (details/summary) ─── */
/* SEO content: in DOM for crawlers, invisible to users */
.seo-details {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}
.seo-details > summary { display: none; }

/* ─── Drawer (edge-parameterized) ─── */
.drawer {
  position: fixed;
  z-index: 250;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  box-shadow: 0 -8px 32px rgba(0,0,0,0.4);
  will-change: transform;
  touch-action: none;
}
.drawer--bottom {
  bottom: 0;
  left: 0;
  right: 0;
  max-width: 480px;
  margin: 0 auto;
  border-top: 1px solid var(--border);
  border-radius: 14px 14px 0 0;
}
.drawer--top {
  top: 0;
  left: 0;
  right: 0;
  max-width: 480px;
  margin: 0 auto;
  border-bottom: 1px solid var(--border);
  border-radius: 0 0 14px 14px;
}
.drawer--left {
  top: 0;
  bottom: 0;
  left: 0;
  width: 300px;
  border-right: 1px solid var(--border);
  border-radius: 0 14px 14px 0;
  padding-left: env(safe-area-inset-left, 0px);
}
.drawer--right {
  top: 0;
  bottom: 0;
  right: 0;
  width: 360px;
  border-left: 1px solid var(--border);
  border-radius: 14px 0 0 14px;
  padding-right: env(safe-area-inset-right, 0px);
}
.drawer.transitioning {
  transition: transform 0.28s cubic-bezier(0.32, 0.72, 0, 1);
}
.drawer-handle {
  display: none;
}
.drawer-content {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  min-height: 0;
  flex: 1;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

/* Landscape: limit bottom drawer height to viewport */
@media (orientation: landscape) and (max-height: 500px) {
  .drawer--bottom {
    max-height: 85vh;
  }
}
.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 249;
  background: rgba(0,0,0,0.4);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}
.drawer-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

/* ─── Tab Bar ─── */
.tab-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 260;
  display: flex;
  align-items: center;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 0;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  max-width: 480px;
  margin: 0 auto;
}
.drawer .tab-bar {
  position: static;
  max-width: none;
  margin: 0;
  border-top: none;
  border-bottom: 1px solid var(--border);
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: 0;
  flex-shrink: 0;
}
.tab-bar-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 14px 0;
  background: none;
  border: none;
  color: var(--text-dim);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.15s;
  min-height: 44px;
}
.tab-bar-btn:active,
.tab-bar-btn.active {
  color: var(--accent);
}
.tab-bar-toggle {
  flex: 0 0 auto;
  padding: 14px 16px;
}
.tab-arrow {
  transition: transform 0.28s cubic-bezier(0.32, 0.72, 0, 1);
}
.tab-bar.open .tab-arrow {
  transform: rotate(180deg);
}

/* ─── Cruise Count Badge ─── */
.cruise-count-badge {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  margin-left: 4px;
}
.cruise-count-badge.pulse {
  animation: badge-pulse 0.3s ease-out;
}
@keyframes badge-pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.15); }
  100% { transform: scale(1); }
}

/* ─── Drawer Actions ─── */
.drawer-actions {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.drawer-apply-btn {
  width: 100%;
  padding: 12px;
  background: var(--accent);
  color: var(--bg);
  border: none;
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  min-height: 44px;
}

/* ─── Touch Target Minimums (44px Apple HIG) ─── */
button, select, [type="range"], a.panel-detail-link {
  min-height: 44px;
}
input[type="range"] {
  height: 44px;
}
input[type="range"]::-webkit-slider-thumb {
  width: 28px;
  height: 28px;
}
input[type="range"]::-moz-range-thumb {
  width: 28px;
  height: 28px;
}
.panel-item {
  min-height: 44px;
  padding: 10px 14px;
}
.search-result-item {
  min-height: 44px;
  padding: 12px 14px;
}
.port-filter-row-entry {
  min-height: 44px;
}
.clear-filters-btn {
  min-height: 44px;
  font-size: 14px;
}
.cruise-line-filter {
  min-height: 44px;
  font-size: 14px;
}
.panel-close, .panel-back, .panel-share {
  min-width: 44px;
  min-height: 44px;
}
.dp-cancel, .dp-apply, .cp-toggle-all {
  min-height: 44px;
  font-size: 14px;
}
/* Readable body text on mobile */
body {
  font-size: 16px;
}

/* ─── Adaptive Desktop Shell ─── */
/* Aspect-ratio gated: landscape viewports ≥600px wide get side-drawer layout
   (#280). Bottom-sheet remains authoritative on portrait and narrow widths.
   Layout: grid with CONSTANT column widths — 32px rails on each side, 1fr
   globe center. Drawer content slides in/out as an absolutely-positioned
   overlay via `transform: translateX` (GPU-accelerated, no reflow). This
   means `#map-container` keeps its size across drawer toggles, so the
   ResizeObserver wired in #277 doesn't fire, and the globe doesn't
   re-render on every frame of the drawer animation. */
@media (min-aspect-ratio: 1/1) and (min-width: 600px) {
  /* Tab-bar is a mobile pattern — hidden on desktop; each drawer has its
     own labeled handle users click to toggle. `!important` guards against
     future specificity creep (drawer context class, etc.). */
  .tab-bar { display: none !important; }

  #app.app--desktop {
    display: grid;
    /* Rails reserve 32px on each side permanently; globe gets everything
       else. Column widths never animate, so the map container's
       bounding-box is stable across drawer toggles. */
    grid-template-columns: 32px 1fr 32px;
    grid-template-rows: auto 1fr;
    grid-template-areas:
      "header header header"
      "left   center right";
  }
  #app.app--desktop .site-header { grid-area: header; }
  #app.app--desktop #map-container { grid-area: center; }

  /* Drawer outer is 32px rail, fixed width. Content is absolute-positioned
     relative to it and slides over the globe. Overflow: visible so the
     content can extend past the rail. Transform on the outer is forced
     off because #278's translateX math from the mobile path would hide
     the rail itself. */
  #app.app--desktop .drawer--left,
  #app.app--desktop .drawer--right {
    position: relative;
    width: 32px;
    height: 100%;
    max-height: 100%;
    container-type: inline-size;
    overflow: visible;
    transform: none !important;
    display: flex;
    align-items: stretch;
  }
  #app.app--desktop .drawer--left {
    grid-area: left;
    flex-direction: row-reverse;
  }
  #app.app--desktop .drawer--right {
    grid-area: right;
    flex-direction: row;
  }

  /* Handle strip — always visible, 32px wide, labelled. z-index above the
     sliding content so the rail stays on top of the content edge. */
  #app.app--desktop .drawer-handle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    flex: 0 0 32px;
    cursor: pointer;
    font-family: var(--font-body);
    font-size: 13px;
    letter-spacing: 0.08em;
    color: var(--text);
    opacity: 0.75;
    user-select: none;
    background: var(--surface);
    transition: opacity 0.15s, background 0.15s;
    position: relative;
    z-index: 2;
  }
  #app.app--desktop .drawer--left .drawer-handle {
    border-left: 1px solid var(--border);
  }
  #app.app--desktop .drawer--right .drawer-handle {
    border-right: 1px solid var(--border);
  }
  #app.app--desktop .drawer-handle:hover {
    opacity: 1;
    background: var(--border);
  }
  #app.app--desktop .drawer-handle-bar {
    display: none;
  }

  /* Handle label: vertical text when closed, collapse chevron when open */
  #app.app--desktop .drawer--left[data-state="closed"] .drawer-handle::after,
  #app.app--desktop .drawer--right[data-state="closed"] .drawer-handle::after {
    writing-mode: vertical-rl;
  }
  #app.app--desktop .drawer--left[data-state="closed"] .drawer-handle::after {
    content: 'Filters';
  }
  #app.app--desktop .drawer--right[data-state="closed"] .drawer-handle::after {
    content: 'Cruises';
  }
  #app.app--desktop .drawer--left:not([data-state="closed"]) .drawer-handle::after {
    content: '‹';
    font-size: 22px;
  }
  #app.app--desktop .drawer--right:not([data-state="closed"]) .drawer-handle::after {
    content: '›';
    font-size: 22px;
  }

  /* Content overlay — absolutely positioned, slides in/out via transform.
     Size stays fixed; only the translate value changes, so the browser
     never needs to reflow the grid or fire a resize on map-container.
     Result: globe doesn't re-render during drawer transitions. */
  #app.app--desktop .drawer--left .drawer-content,
  #app.app--desktop .drawer--right .drawer-content {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 300px;
    background: var(--surface);
    box-shadow: 0 0 32px rgba(0,0,0,0.4);
    border: 1px solid var(--border);
    transition: transform 0.28s cubic-bezier(0.32, 0.72, 0, 1);
    will-change: transform;
    z-index: 1;
    overflow-y: auto;
    flex: none;
    padding-bottom: 0;
  }
  #app.app--desktop .drawer--right .drawer-content {
    width: 360px;
  }
  /* Left drawer content: sits to the right of its 32px rail. Closed state
     slides it off-screen to the left. */
  #app.app--desktop .drawer--left .drawer-content {
    left: 32px;
    transform: translateX(-332px);
  }
  /* Right drawer content: sits to the left of its 32px rail. Closed state
     slides it off-screen to the right. */
  #app.app--desktop .drawer--right .drawer-content {
    right: 32px;
    transform: translateX(392px);
  }
  /* Open state — slide content to its natural position, overlaying the
     globe edge. */
  #app.app--desktop .drawer--left[data-state="full"] .drawer-content,
  #app.app--desktop .drawer--right[data-state="full"] .drawer-content {
    transform: translateX(0);
  }
}
