:root {
  color-scheme: light;
  --bg-top: #fcf5ea;
  --bg-bottom: #dcebf1;
  --panel: rgba(255, 252, 247, 0.82);
  --panel-strong: rgba(255, 255, 255, 0.94);
  --ink: #142432;
  --muted: #62737d;
  --line: rgba(20, 36, 50, 0.12);
  --line-strong: rgba(20, 36, 50, 0.18);
  --accent: #0b8b77;
  --accent-deep: #085b4f;
  --accent-soft: rgba(11, 139, 119, 0.12);
  --sun: #e68f2f;
  --warn: #955100;
  --shadow: 0 24px 70px rgba(31, 54, 68, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Space Grotesk", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(255, 207, 135, 0.52), transparent 33%),
    radial-gradient(circle at 87% 10%, rgba(114, 188, 205, 0.42), transparent 28%),
    linear-gradient(180deg, var(--bg-top) 0%, var(--bg-bottom) 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.14) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.14) 1px, transparent 1px);
  background-size: 38px 38px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.4), transparent 78%);
}

.page-shell {
  width: min(1380px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 40px 0 56px;
}

.hero {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: end;
  margin-bottom: 28px;
}

.hero-copy-block {
  max-width: 820px;
}

.eyebrow {
  margin: 0 0 10px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.75rem;
  color: var(--accent-deep);
}

.hero h1,
.panel-form h2,
.panel-results h2,
.subpanel h3,
.map-empty h3,
.map-sidecard h3,
.empty-state h3 {
  font-family: "Instrument Serif", serif;
  font-weight: 400;
}

.hero h1 {
  margin: 0;
  font-size: clamp(2.9rem, 6vw, 5.4rem);
  line-height: 0.94;
}

.hero-copy {
  max-width: 700px;
  margin: 18px 0 0;
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--muted);
}

.hero-callout {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  max-width: 340px;
}

.hero-pill {
  display: inline-flex;
  align-items: center;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(20, 36, 50, 0.08);
  box-shadow: 0 12px 24px rgba(20, 36, 50, 0.06);
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 500;
}

.layout {
  display: grid;
  grid-template-columns: 380px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.panel {
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 30px;
  background: var(--panel);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow);
}

.panel-form {
  position: sticky;
  top: 18px;
  padding: 24px;
}

.panel-intro h2,
.panel-results h2,
.section-heading h3,
.map-sidecard h3 {
  margin: 0;
}

.panel-intro p:last-child {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.trip-form {
  display: grid;
  gap: 18px;
  margin-top: 20px;
}

.field,
.field-row {
  display: grid;
  gap: 10px;
}

.autocomplete-field {
  position: relative;
}

.autocomplete-field.is-open {
  z-index: 30;
}

.field-row {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

#departureTime,
#profile {
  min-width: 0;
}

.field-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.field label,
.field-head label {
  font-size: 0.92rem;
  font-weight: 700;
}

.field-tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(20, 36, 50, 0.08);
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

input,
select,
button {
  font: inherit;
}

input,
select {
  width: 100%;
  padding: 15px 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--ink);
  transition: transform 140ms ease, border-color 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

input:focus,
select:focus {
  outline: none;
  transform: translateY(-1px);
  border-color: rgba(11, 139, 119, 0.5);
  box-shadow: 0 12px 26px rgba(11, 139, 119, 0.1);
  background: rgba(255, 255, 255, 0.98);
}

.input-stack {
  position: relative;
}

.swap-button {
  display: inline-flex;
  justify-self: center;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border: 1px solid rgba(20, 36, 50, 0.1);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  color: var(--ink);
  cursor: pointer;
  transition: transform 150ms ease, background 150ms ease, border-color 150ms ease;
}

.swap-button:hover,
.swap-button:focus-visible {
  outline: none;
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.94);
  border-color: rgba(11, 139, 119, 0.24);
}

.suggestions {
  position: absolute;
  inset: calc(100% + 8px) 0 auto;
  z-index: 24;
  display: grid;
  gap: 8px;
  max-height: 280px;
  padding: 10px;
  overflow-y: auto;
  border: 1px solid rgba(20, 36, 50, 0.12);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 26px 56px rgba(20, 36, 50, 0.14);
}

.suggestions[hidden] {
  display: none;
}

.suggestion-item,
.suggestion-state {
  border-radius: 16px;
}

.suggestion-item {
  display: grid;
  gap: 5px;
  width: 100%;
  padding: 12px 13px;
  border: 0;
  background: rgba(244, 248, 249, 0.96);
  text-align: left;
  color: var(--ink);
  cursor: pointer;
  transition: background 140ms ease, transform 140ms ease;
}

.suggestion-item:hover,
.suggestion-item:focus-visible,
.suggestion-item.is-active {
  outline: none;
  background: rgba(219, 244, 238, 0.98);
  transform: translateY(-1px);
}

.suggestion-main {
  font-weight: 700;
}

.suggestion-meta {
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.45;
}

.suggestion-state {
  padding: 12px 13px;
  background: rgba(244, 248, 249, 0.96);
  color: var(--muted);
  font-size: 0.9rem;
}

.quick-times {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.quick-time,
.chip-button {
  border: 1px solid rgba(20, 36, 50, 0.1);
  border-radius: 999px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  cursor: pointer;
  transition: transform 150ms ease, background 150ms ease, border-color 150ms ease;
}

.quick-time:hover,
.quick-time:focus-visible,
.chip-button:hover,
.chip-button:focus-visible {
  outline: none;
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.96);
  border-color: rgba(11, 139, 119, 0.24);
}

.toggle-card {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 16px;
  border: 1px solid rgba(20, 36, 50, 0.08);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.72);
  cursor: pointer;
}

.toggle-card input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--accent);
}

.toggle-copy {
  display: grid;
  gap: 4px;
}

.toggle-copy strong {
  font-size: 0.96rem;
}

.toggle-copy small {
  color: var(--muted);
  line-height: 1.5;
}

.planner-note {
  padding: 15px 16px;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(255, 245, 228, 0.92), rgba(227, 243, 245, 0.92));
  border: 1px solid rgba(20, 36, 50, 0.08);
  color: var(--ink);
  line-height: 1.55;
}

.submit-button {
  border: 0;
  border-radius: 999px;
  padding: 16px 20px;
  background: linear-gradient(135deg, var(--accent), #0f6d80);
  color: white;
  font-weight: 700;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, filter 160ms ease;
  box-shadow: 0 16px 34px rgba(15, 109, 128, 0.28);
}

.submit-button:hover,
.submit-button:focus-visible {
  outline: none;
  transform: translateY(-2px);
  filter: saturate(1.06);
}

.submit-button:disabled {
  cursor: wait;
  opacity: 0.82;
}

.panel-results {
  padding: 28px;
}

.results-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
}

.panel-results h2 {
  font-size: clamp(2.15rem, 4vw, 3.3rem);
  line-height: 1;
}

.status-badge {
  min-width: 88px;
  padding: 10px 14px;
  border-radius: 999px;
  text-align: center;
  font-size: 0.88rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
}

.status-badge.idle {
  color: var(--muted);
}

.status-badge.loading {
  color: #0e608f;
  background: rgba(220, 239, 255, 0.95);
}

.status-badge.success {
  color: #0d5b4d;
  background: rgba(213, 246, 239, 0.95);
}

.status-badge.error {
  color: #7d2f19;
  background: rgba(255, 228, 221, 0.95);
}

.summary {
  display: grid;
  gap: 14px;
  margin-top: 22px;
  padding: 22px;
  border-radius: 24px;
  background: var(--panel-strong);
  border: 1px solid rgba(20, 36, 50, 0.08);
}

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

.summary-route,
.summary-subcopy {
  margin: 0;
  line-height: 1.6;
}

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

.summary-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.summary-stat {
  padding: 16px;
  border-radius: 18px;
  background: rgba(243, 247, 248, 0.96);
}

.summary-stat .label {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.summary-stat .value {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.4;
}

.map-stage {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 18px;
  margin-top: 20px;
}

.map-shell,
.map-sidecard,
.subpanel {
  border: 1px solid rgba(20, 36, 50, 0.08);
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.76);
}

.map-shell {
  position: relative;
  overflow: hidden;
}

.map-toolbar {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 500;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

#map {
  width: 100%;
  height: 520px;
}

.map-empty {
  position: absolute;
  inset: 0;
  z-index: 450;
  display: grid;
  place-items: center;
  padding: 26px;
  background:
    linear-gradient(180deg, rgba(252, 245, 234, 0.84), rgba(220, 235, 241, 0.88)),
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.24) 0 14px, transparent 14px 28px);
  text-align: center;
  transition: opacity 180ms ease;
}

.map-empty.is-hidden {
  opacity: 0;
  pointer-events: none;
}

.map-empty h3 {
  margin: 0 0 8px;
  font-size: 2.15rem;
}

.map-empty p {
  max-width: 380px;
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.map-legend {
  position: absolute;
  right: 14px;
  bottom: 14px;
  z-index: 500;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  max-width: min(75%, 620px);
}

.map-legend.empty {
  color: var(--muted);
}

.legend-chip {
  display: inline-flex;
  align-items: center;
  padding: 9px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(20, 36, 50, 0.1);
  box-shadow: 0 10px 24px rgba(20, 36, 50, 0.08);
  font-size: 0.85rem;
}

.map-sidecard {
  padding: 22px;
}

.map-sidecard h3 {
  margin-top: 4px;
  font-size: 2rem;
}

.feature-list {
  display: grid;
  gap: 12px;
  padding: 0;
  margin: 18px 0 0;
  list-style: none;
}

.feature-list li {
  padding: 13px 14px;
  border-radius: 18px;
  background: rgba(245, 248, 249, 0.92);
  color: var(--muted);
  line-height: 1.55;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.92fr);
  gap: 18px;
  margin-top: 20px;
}

.subpanel {
  padding: 20px;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: end;
}

.section-heading h3 {
  font-size: 1.95rem;
}

.section-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.timeline,
.directions-list {
  margin-top: 18px;
  display: grid;
  gap: 14px;
  position: relative;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 17px;
  top: 10px;
  bottom: 10px;
  width: 2px;
  background: linear-gradient(180deg, rgba(11, 139, 119, 0.65), rgba(11, 139, 119, 0.08));
}

.timeline.empty::before {
  display: none;
}

.timeline-card,
.direction-step {
  border: 0;
  text-align: left;
  cursor: pointer;
}

.timeline-card {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 16px;
  align-items: start;
  padding: 0;
  background: transparent;
}

.timeline-marker {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  padding-top: 4px;
}

.timeline-marker span {
  display: block;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--sun), var(--accent));
  box-shadow: 0 0 0 6px rgba(255, 255, 255, 0.82);
}

.timeline-content,
.direction-step {
  transition: transform 150ms ease, box-shadow 150ms ease, border-color 150ms ease;
}

.timeline-content {
  display: grid;
  gap: 10px;
  padding: 18px;
  border-radius: 22px;
  border: 1px solid rgba(20, 36, 50, 0.08);
  background: rgba(255, 255, 255, 0.94);
}

.timeline-card:hover .timeline-content,
.timeline-card:focus-visible .timeline-content,
.timeline-card.is-active .timeline-content,
.direction-step:hover,
.direction-step:focus-visible,
.direction-step.is-active {
  transform: translateY(-1px);
  border-color: rgba(11, 139, 119, 0.24);
  box-shadow: 0 16px 34px rgba(11, 139, 119, 0.1);
}

.timeline-card:focus-visible,
.direction-step:focus-visible {
  outline: none;
}

.timeline-topline,
.timeline-weather {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: baseline;
  flex-wrap: wrap;
}

.checkpoint-label,
.eta-text,
.weather-main,
.weather-meta {
  margin: 0;
}

.checkpoint-label {
  font-size: 1.02rem;
  font-weight: 700;
}

.eta-text,
.weather-meta {
  color: var(--muted);
  font-size: 0.92rem;
}

.weather-main {
  font-size: 1rem;
}

.direction-step {
  display: grid;
  grid-template-columns: 46px 1fr;
  gap: 14px;
  width: 100%;
  padding: 15px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(20, 36, 50, 0.08);
}

.direction-index {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 15px;
  background: linear-gradient(135deg, rgba(230, 143, 47, 0.14), rgba(11, 139, 119, 0.16));
  color: var(--accent-deep);
  font-weight: 700;
}

.direction-copy {
  display: grid;
  gap: 6px;
}

.direction-main {
  font-weight: 700;
  line-height: 1.5;
}

.direction-meta {
  color: var(--muted);
  font-size: 0.9rem;
}

.directions-section.is-hidden {
  display: none;
}

.notice {
  min-height: 24px;
  margin-top: 18px;
  color: var(--warn);
  font-weight: 500;
}

.empty-state {
  padding: 28px 22px;
  border-radius: 22px;
  border: 1px dashed rgba(20, 36, 50, 0.16);
  background: rgba(255, 255, 255, 0.72);
}

.empty-state h3 {
  margin: 0 0 8px;
  font-size: 1.9rem;
}

.empty-state p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.compact h3 {
  font-size: 1.7rem;
}

.map-pin {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 3px solid white;
  box-shadow: 0 10px 20px rgba(20, 36, 50, 0.18);
  color: white;
  font-size: 0.88rem;
  font-weight: 700;
}

.pin-start {
  background: linear-gradient(135deg, #0f6d80, var(--accent));
}

.pin-end {
  background: linear-gradient(135deg, #c76135, #e68f2f);
}

.pin-checkpoint {
  background: linear-gradient(135deg, #4f7398, #6ea4bc);
}

.pin-synagogue {
  background: linear-gradient(135deg, #2f4f8d, #557cc1);
  font-size: 0.78rem;
}

.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
  background: rgba(255, 255, 255, 0.97);
}

.popup-card {
  display: grid;
  gap: 8px;
  min-width: 180px;
}

.popup-card strong {
  font-size: 0.98rem;
}

.popup-card span {
  color: var(--muted);
  line-height: 1.4;
}

@media (max-width: 1200px) {
  .hero {
    flex-direction: column;
    align-items: start;
  }

  .hero-callout {
    justify-content: flex-start;
    max-width: none;
  }

  .layout {
    grid-template-columns: 1fr;
  }

  .panel-form {
    position: static;
  }

  .map-stage,
  .content-grid {
    grid-template-columns: 1fr;
  }

  .summary-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .page-shell {
    width: min(100vw - 20px, 100%);
    padding-top: 26px;
    padding-bottom: 32px;
  }

  .panel-form,
  .panel-results,
  .subpanel,
  .map-sidecard {
    padding: 18px;
    border-radius: 24px;
  }

  .field-row,
  .summary-grid,
  .results-header,
  .section-heading {
    grid-template-columns: 1fr;
    flex-direction: column;
    align-items: start;
  }

  .quick-times,
  .map-toolbar,
  .map-legend {
    flex-direction: column;
    align-items: stretch;
  }

  .map-toolbar,
  .map-legend {
    position: static;
    padding: 12px;
  }

  #map {
    height: 400px;
  }

  .summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 960px) {
  .panel-form .field-row {
    grid-template-columns: 1fr;
  }
}
