:root {
  --forest: #163f33;
  --moss: #7f9858;
  --lake: #1f78a4;
  --cream: #fff7e6;
  --paper: #fffdf7;
  --ink: #14201a;
  --muted: #66736d;
  --line: rgba(20, 32, 26, 0.12);
  --alert: #bd5a36;
  --shadow: 0 22px 60px rgba(20, 32, 26, 0.14);
  --glass: rgba(255, 253, 247, 0.76);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(127, 152, 88, 0.22), transparent 34%),
    radial-gradient(circle at top right, rgba(31, 120, 164, 0.20), transparent 32%),
    linear-gradient(180deg, #f8f2e5 0%, #f7f7ef 45%, #e8f2f4 100%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
select,
textarea {
  font: inherit;
}

button,
select {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fffdf7;
  color: var(--ink);
}

button {
  min-height: 42px;
  padding: 0 14px;
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

button:hover {
  border-color: rgba(31, 79, 58, 0.45);
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(20, 32, 26, 0.10);
}

.splash-screen {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(320px, 1.1fr);
  min-height: 100vh;
  background:
    radial-gradient(circle at 72% 18%, rgba(242, 193, 78, 0.34), transparent 18%),
    linear-gradient(135deg, #12392f 0%, #1d6d93 55%, #f8f1df 55.2%, #fffaf0 100%);
  overflow: auto;
}

.splash-screen.is-hidden {
  display: none;
}

.splash-visual {
  position: relative;
  min-height: 360px;
}

.splash-visual .sun {
  position: absolute;
  top: 12%;
  left: 14%;
  width: 108px;
  height: 108px;
  border-radius: 50%;
  background: #f2c14e;
  box-shadow: 0 0 70px rgba(242, 193, 78, 0.55);
}

.splash-visual .road {
  position: absolute;
  left: 16%;
  right: 0;
  bottom: 10%;
  height: 38%;
  background: linear-gradient(110deg, transparent 8%, rgba(255, 250, 240, 0.86) 8% 15%, transparent 15% 100%);
  clip-path: polygon(12% 100%, 44% 0, 56% 0, 82% 100%);
  opacity: 0.92;
}

.splash-visual .lake-shape {
  position: absolute;
  right: -14%;
  bottom: 0;
  width: 72%;
  height: 32%;
  border-radius: 52% 48% 0 0;
  background: rgba(182, 222, 231, 0.58);
}

.splash-content {
  align-self: center;
  padding: 32px clamp(20px, 5vw, 56px);
}

.splash-content h1 {
  margin: 0;
  max-width: 680px;
  font-size: clamp(2.6rem, 7vw, 6rem);
  line-height: 0.95;
}

.splash-copy {
  max-width: 620px;
  color: #46544d;
  font-size: 1.08rem;
}

.splash-profiles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 24px;
  max-width: 760px;
}

.splash-profile {
  position: relative;
  min-height: 132px;
  padding: 18px;
  text-align: left;
  background: rgba(255, 253, 247, 0.88);
  border: 1px solid rgba(20, 32, 26, 0.12);
  box-shadow: 0 18px 44px rgba(20, 32, 26, 0.12);
  overflow: hidden;
}

.splash-profile::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 7px;
  background: var(--profile-accent, var(--lake));
}

.splash-profile::after {
  content: "Enter";
  position: absolute;
  right: 14px;
  top: 14px;
  color: var(--profile-accent, var(--lake));
  font-size: 0.75rem;
  font-weight: 900;
  text-transform: uppercase;
}

.splash-profile strong {
  display: block;
  font-size: 1.42rem;
  line-height: 1.05;
}

.splash-profile em {
  display: inline-block;
  margin-top: 4px;
  color: var(--profile-accent, var(--lake));
  font-size: 0.76rem;
  font-style: normal;
  font-weight: 900;
  text-transform: uppercase;
}

.splash-profile span {
  display: block;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.35;
  margin-top: 6px;
  padding-right: 42px;
}

.app-shell {
  min-height: 100vh;
  padding: 16px 16px 88px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 1180px;
  margin: 0 auto 16px;
  position: sticky;
  top: 0;
  z-index: 20;
  padding: 10px 0;
  backdrop-filter: blur(18px);
}

.topbar h1,
.hero-copy h2,
.section-head h2 {
  margin: 0;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--lake);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.primary-action {
  background: var(--forest);
  color: white;
  border-color: var(--forest);
  font-weight: 800;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.traveler-chip {
  background: rgba(255, 253, 247, 0.88);
  font-weight: 900;
}

.hero-band {
  max-width: 1180px;
  margin: 0 auto 16px;
  min-height: 270px;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.75fr);
  gap: 24px;
  align-items: end;
  padding: 28px;
  border-radius: 24px;
  background:
    linear-gradient(120deg, rgba(22, 63, 51, 0.96), rgba(31, 120, 164, 0.72)),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1200' height='500' viewBox='0 0 1200 500'%3E%3Cpath d='M0 320 Q160 220 300 285 T610 230 T900 265 T1200 180 V500 H0Z' fill='%236c8a4b' opacity='.55'/%3E%3Cpath d='M0 360 Q220 290 430 350 T820 315 T1200 280 V500 H0Z' fill='%23fbf4df' opacity='.34'/%3E%3Ccircle cx='980' cy='90' r='52' fill='%23f6d483' opacity='.7'/%3E%3C/svg%3E");
  background-size: cover;
  color: white;
  box-shadow: var(--shadow);
}

.hero-copy h2 {
  font-size: clamp(2rem, 6vw, 4.6rem);
  line-height: 1;
}

.hero-copy p:last-child {
  max-width: 620px;
  font-size: 1.05rem;
}

.countdown-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.countdown-grid article,
.status-panel,
.tool-card,
.profile-view,
.map-panel {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--glass);
  box-shadow: 0 10px 28px rgba(24, 35, 29, 0.08);
  backdrop-filter: blur(18px);
}

.countdown-grid article {
  padding: 14px;
  min-height: 94px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.countdown-grid span {
  display: block;
  color: var(--forest);
  font-size: clamp(1.7rem, 5vw, 2.8rem);
  font-weight: 900;
}

.countdown-grid small {
  color: var(--muted);
  font-weight: 700;
}

.progress-band,
.profile-section,
.grid-section,
.map-and-panel {
  max-width: 1180px;
  margin: 0 auto 16px;
}

.progress-band {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.progress-band article {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--glass);
  box-shadow: 0 10px 28px rgba(24, 35, 29, 0.08);
  padding: 14px;
}

.progress-band article > div:first-child {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.progress-band span {
  color: var(--muted);
  font-weight: 800;
}

.progress-track {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(20, 32, 26, 0.12);
}

.progress-track span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--forest), var(--lake));
  transition: width 260ms ease;
}

.map-and-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(300px, 0.5fr);
  gap: 16px;
}

.map-panel {
  overflow: hidden;
}

.map-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.map-toolbar span {
  color: var(--muted);
  font-size: 0.92rem;
}

.route-map {
  position: relative;
  min-height: 280px;
  background: #dfe9e5;
}

.route-map.using-fallback {
  background:
    radial-gradient(circle at 76% 24%, rgba(31, 120, 164, 0.20), transparent 28%),
    linear-gradient(180deg, #e8f3f1 0%, #e6ead6 100%);
}

.route-map > svg {
  display: none;
  width: 100%;
  height: 100%;
  min-height: 280px;
}

.leaflet-map {
  height: 390px;
  min-height: 390px;
  width: 100%;
  z-index: 1;
}

.leaflet-container {
  background: #dfe9e5;
  font: inherit;
}

.leaflet-map .leaflet-overlay-pane svg {
  display: block;
  min-height: 0;
}

.route-map.using-fallback > svg {
  display: block;
}

.route-map.using-fallback .leaflet-map {
  display: none;
}

.route-shadow {
  fill: none;
  stroke: rgba(24, 35, 29, 0.16);
  stroke-linecap: round;
  stroke-width: 22;
}

.route-line {
  fill: none;
  stroke: var(--lake);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 7;
}

.stop-dot {
  fill: var(--paper);
  stroke: var(--forest);
  stroke-width: 5;
}

.stop-dot.ferry {
  stroke: var(--alert);
}

.progress-dot {
  fill: #f2c14e;
  stroke: white;
  stroke-width: 5;
}

.route-map text {
  fill: var(--ink);
  font-size: 19px;
  font-weight: 800;
}

.map-caption {
  color: var(--muted);
  fill: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.status-panel {
  padding: 16px;
}

.route-quest {
  border-top: 1px solid var(--line);
  background: rgba(255, 253, 247, 0.9);
  padding: 14px 16px;
}

.status-panel h3,
.tool-card h3 {
  margin-top: 0;
}

dl {
  display: grid;
  gap: 10px;
  margin: 16px 0;
}

dl div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

dt {
  color: var(--muted);
}

dd {
  margin: 0;
  font-weight: 800;
  text-align: right;
}

.quick-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.need-results {
  margin-top: 12px;
}

.trip-controls {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 14px;
}

.trip-controls button,
.quick-actions button {
  min-height: 38px;
  padding: 0 10px;
  font-size: 0.88rem;
  font-weight: 900;
}

.kid-travel-update {
  border: 1px solid rgba(242, 193, 78, 0.42);
  border-radius: 16px;
  background: #fff6d9;
  margin: 12px 0;
  padding: 12px;
}

.kid-travel-update strong {
  display: block;
  color: #6d4b00;
}

.kid-travel-update p {
  margin: 6px 0 0;
}

.action-status {
  border: 1px solid rgba(31, 120, 164, 0.24);
  border-radius: 16px;
  background: #edf7fa;
  color: #16465c;
  font-weight: 800;
  margin: 12px 0;
  padding: 12px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 16px;
  margin-bottom: 12px;
}

#daySelect {
  min-height: 42px;
  padding: 0 12px;
  max-width: 340px;
}

.profile-tabs {
  display: none;
  overflow-x: auto;
  gap: 8px;
  padding: 0 0 10px;
}

.profile-tabs button {
  white-space: nowrap;
  font-weight: 800;
}

.profile-tabs button[aria-selected="true"] {
  background: var(--forest);
  color: white;
}

.profile-view {
  padding: 22px;
  border-top: 5px solid var(--profile-accent, var(--lake));
}

.profile-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.72fr);
  gap: 16px;
}

.profile-view h3 {
  margin: 0 0 10px;
  font-size: clamp(1.4rem, 3vw, 2.1rem);
}

.tag-list,
.mini-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0;
  list-style: none;
}

.tag-list li,
.mini-list li {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fffdf7;
  padding: 7px 10px;
  font-size: 0.9rem;
  font-weight: 700;
}

.grid-section {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.tool-card {
  min-height: 240px;
  padding: 18px;
}

.tool-card ul {
  margin: 12px 0 0;
  padding-left: 20px;
}

.tool-card li {
  margin-bottom: 8px;
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.action-row button[data-active="true"] {
  background: var(--forest);
  color: white;
  border-color: var(--forest);
}

.choice-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fffdf7;
  margin-top: 10px;
  padding: 12px;
}

.place-preview {
  display: grid;
  grid-template-columns: 128px minmax(0, 1fr);
  gap: 12px;
  align-items: stretch;
}

.place-preview img,
.summary-photo {
  width: 100%;
  height: 100%;
  min-height: 92px;
  object-fit: cover;
  border-radius: 12px;
  background: #dfe9e5;
}

.external-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border: 1px solid rgba(31, 120, 164, 0.34);
  border-radius: 12px;
  background: #eef8fb;
  color: #16465c;
  font-weight: 900;
  padding: 0 12px;
  text-decoration: none;
}

.activity-board {
  display: grid;
  gap: 10px;
}

.activity-item {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fffdf7;
  padding: 12px;
}

.activity-item header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: start;
}

.activity-item h4 {
  margin: 0;
  font-size: 1rem;
}

.activity-meta {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.completed-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.summary-tile {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fffdf7;
  overflow: hidden;
}

.summary-tile span {
  display: block;
  padding: 8px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
}

.choice-card strong {
  display: block;
  color: var(--forest);
}

.parent-callout {
  background: #f4f8f1;
  border-color: rgba(22, 63, 51, 0.22);
}

.parent-callout strong {
  color: #12392f;
}

.saved-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.saved-pill {
  border: 1px solid rgba(20, 32, 26, 0.12);
  border-radius: 999px;
  background: #fffdf7;
  padding: 7px 10px;
  font-size: 0.88rem;
  font-weight: 800;
}

.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  background: rgba(255, 250, 240, 0.97);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.bottom-nav a {
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 900;
  padding: 12px 4px calc(12px + env(safe-area-inset-bottom));
  text-align: center;
  text-decoration: none;
}

@media (max-width: 840px) {
  .splash-screen {
    grid-template-columns: 1fr;
    background: linear-gradient(180deg, #12392f 0%, #1d6d93 34%, #fffaf0 34.2%, #fffaf0 100%);
  }

  .splash-visual {
    min-height: 190px;
  }

  .splash-profiles {
    grid-template-columns: 1fr;
  }

  .topbar,
  .section-head {
    align-items: stretch;
    flex-direction: column;
  }

  .hero-band,
  .progress-band,
  .map-and-panel,
  .profile-grid,
  .grid-section {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 520px) {
  .app-shell {
    padding: 12px 12px 82px;
  }

  .hero-band {
    padding: 20px;
  }

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

  .splash-content {
    padding: 24px 14px 34px;
  }

  .quick-actions,
  .trip-controls,
  .place-preview,
  .summary-grid {
    grid-template-columns: 1fr;
  }
}
