:root {
  --bg: #eef0ea;
  --surface: #fbf9f4;
  --surface-alt: #f2ede2;
  --ink: #1a2430;
  --muted: #5f6b76;
  --line: #e2dacb;
  --navy: #1e3a5f;
  --gold: #d99b16;
  --gold-soft: #fef6df;
  --green: #1d7a4c;
  --green-soft: #e6f5ec;
  --amber: #b45309;
  --amber-soft: #fef3c7;
  --red: #b91c1c;
  --red-soft: #fee2e2;
  --radius: 16px;
  --shadow: 0 8px 24px rgba(26, 36, 48, 0.08);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: radial-gradient(circle at top, #e7e4d8 0%, #dcd8ca 100%);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

.app-shell {
  max-width: 480px;
  min-height: 100vh;
  margin: 0 auto;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  position: relative;
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.12);
}

.topbar {
  background: var(--navy);
  color: #fff;
  padding: 16px 18px 14px;
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.12);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.brand h1,
.brand-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  display: block;
}

.brand p {
  margin: 1px 0 0;
  font-size: 0.74rem;
  color: rgba(255, 255, 255, 0.76);
}

.pill-btn {
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.pill-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

main {
  flex: 1;
  padding: 14px 14px 92px;
}

.tab-panel {
  display: none;
  flex-direction: column;
  gap: 12px;
}

.tab-panel.active {
  display: flex;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: 0 2px 10px rgba(26, 36, 48, 0.04);
}

.section-title {
  margin: 0 0 8px;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  font-weight: 700;
}

.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  background: var(--surface-alt);
  padding: 4px;
  border-radius: 12px;
  border: 1px solid var(--line);
}

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

.segmented.segmented-routes {
  grid-template-columns: repeat(3, 1fr);
}

.segmented.segmented-routes button {
  padding: 7px 6px;
  font-size: 0.76rem;
}

.segmented button {
  border: none;
  background: transparent;
  padding: 8px 10px;
  border-radius: 9px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
}

.segmented button.active {
  background: var(--surface);
  color: var(--navy);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.tuner-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 10px;
}

label.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--muted);
}

select,
input,
textarea {
  width: 100%;
  font: inherit;
  font-size: 0.88rem;
  padding: 9px 10px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}

textarea {
  resize: vertical;
  min-height: 70px;
}

.stage-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

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

.stage-day {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stage-route {
  margin: 2px 0 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--navy);
}

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

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
}

.badge-easy { background: var(--green-soft); color: var(--green); }
.badge-mod { background: var(--amber-soft); color: var(--amber); }
.badge-hard { background: var(--red-soft); color: var(--red); }
.badge-low { background: var(--green-soft); color: var(--green); }
.badge-medium { background: var(--amber-soft); color: var(--amber); }
.badge-high { background: var(--red-soft); color: var(--red); }
.badge-neutral { background: var(--surface-alt); color: var(--muted); }
.badge-sky { background: #e0f2fe; color: #0369a1; }

.stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  background: var(--surface-alt);
  padding: 9px 10px;
  border-radius: 12px;
}

.stat-item span {
  display: block;
  font-size: 0.7rem;
  color: var(--muted);
}

.stat-item strong {
  font-size: 0.88rem;
  color: var(--ink);
}

.bottleneck-box {
  background: var(--gold-soft);
  border-left: 3px solid var(--gold);
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 0.79rem;
  color: #5c4204;
}

.stage-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.btn {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-decoration: none;
}

.btn-primary {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
}

.btn-whatsapp {
  background: #16a34a;
  border-color: #16a34a;
  color: #fff;
}

.btn-gold {
  background: var(--gold);
  border-color: var(--gold);
  color: #fff;
}

.btn-sm {
  padding: 6px 10px;
  font-size: 0.76rem;
}

.stories-drawer {
  border-top: 1px dashed var(--line);
  padding-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.story-item {
  background: var(--surface-alt);
  border-radius: 12px;
  padding: 10px;
}

.story-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.story-top strong {
  font-size: 0.85rem;
  color: var(--navy);
}

.story-text {
  margin: 6px 0 0;
  font-size: 0.8rem;
  color: var(--muted);
}

.albergue-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  background: #fff;
}

.albergue-card.selected {
  border-color: var(--navy);
  background: #f6f9fd;
}

.albergue-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.albergue-name {
  margin: 0;
  font-size: 0.94rem;
  font-weight: 700;
}

.albergue-meta {
  font-size: 0.77rem;
  color: var(--muted);
}

.status-pills {
  display: flex;
  gap: 6px;
}

.status-pill {
  border: 1px solid var(--line);
  background: var(--surface-alt);
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
}

.status-pill.active-requested {
  background: var(--amber-soft);
  border-color: var(--amber);
  color: var(--amber);
}

.status-pill.active-confirmed {
  background: var(--green-soft);
  border-color: var(--green);
  color: var(--green);
}

.msg-preview {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 12px;
  padding: 10px;
  font-size: 0.8rem;
  white-space: pre-wrap;
  color: #14532d;
}

.family-strip {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.family-member {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--surface-alt);
  font-size: 0.82rem;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-top: 6px;
}

.photo-grid img {
  width: 100%;
  height: 76px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line);
}

.journal-entry {
  border-left: 3px solid var(--navy);
  padding-left: 10px;
  margin-top: 8px;
}

.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  background: rgba(251, 249, 244, 0.96);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: 8px 8px 10px;
  z-index: 30;
}

.nav-btn {
  border: none;
  background: transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 6px;
  border-radius: 10px;
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
}

.nav-btn.active {
  color: var(--navy);
  background: var(--surface-alt);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 50;
}

.modal-backdrop.open {
  display: flex;
}

.modal-card {
  width: 100%;
  max-width: 440px;
  max-height: 88vh;
  overflow-y: auto;
  background: var(--surface);
  border-radius: 18px;
  padding: 18px;
  box-shadow: var(--shadow);
}

.recap-hero {
  background: linear-gradient(135deg, var(--navy) 0%, #2b5485 100%);
  color: #fff;
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 12px;
}

.recap-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 12px;
}

.recap-stats div {
  background: rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  padding: 8px;
  text-align: center;
}

.recap-stats strong {
  display: block;
  font-size: 1.05rem;
}

.recap-stats span {
  font-size: 0.7rem;
  opacity: 0.85;
}

.toast {
  position: fixed;
  bottom: 82px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: #fff;
  padding: 9px 14px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 60;
}

.toast.show {
  opacity: 1;
}

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

.row-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

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

.badge-rating {
  background: #fef3c7;
  color: #92400e;
}

.star-row {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.star-btn {
  border: none;
  background: transparent;
  padding: 2px 4px;
  font-size: 1rem;
  line-height: 1;
  color: #cbd5e1;
  cursor: pointer;
}

.star-btn.filled {
  color: #eab308;
}

@media (min-width: 768px) {
  .app-shell,
  .bottom-nav {
    max-width: 980px;
  }

  .topbar {
    padding: 18px 24px 16px;
  }

  .brand h1,
  .brand-title {
    font-size: 1.2rem;
  }

  .brand p {
    font-size: 0.8rem;
  }

  main {
    padding: 18px 24px 98px;
  }

  .segmented.segmented-routes {
    grid-template-columns: repeat(6, 1fr);
  }

  .segmented.segmented-routes button {
    font-size: 0.8rem;
    padding: 9px 8px;
  }

  #stages-list,
  #albergues-list {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px !important;
    align-items: start;
  }

  .stage-route {
    font-size: 1.08rem;
  }

  .modal-card {
    max-width: 560px;
  }

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

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

.info-hero {
  background: linear-gradient(135deg, var(--navy) 0%, #2a5282 100%);
  color: #fff;
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}

.info-hero h1,
.info-hero h2 {
  margin: 6px 0 8px;
  font-size: 1.35rem;
  line-height: 1.25;
}

.info-hero p {
  margin: 0;
  font-size: 0.92rem;
  color: rgba(255, 255, 255, 0.9);
}

.info-cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.info-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.info-feature {
  background: var(--surface-alt);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
}

.info-feature h3 {
  margin: 0 0 4px;
  font-size: 0.92rem;
  color: var(--navy);
}

.info-feature p {
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted);
}

.route-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.route-jump-btn {
  text-align: left;
  text-decoration: none;
  color: inherit;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 12px;
  padding: 10px 12px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.route-jump-btn:hover {
  border-color: var(--navy);
  background: #f6f9fd;
}

.route-jump-btn strong {
  font-size: 0.88rem;
  color: var(--navy);
}

.route-jump-btn span {
  font-size: 0.74rem;
  color: var(--muted);
}

.promo-ad-card {
  background: linear-gradient(135deg, #fffdf4 0%, #fef5d4 100%);
  border: 1px solid #eab308;
  box-shadow: var(--shadow);
}

.promo-ad-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: flex-start;
}

.promo-ad-tag {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: #854d0e;
  background: #fde68a;
  padding: 2px 8px;
  border-radius: 999px;
}

.promo-ad-title {
  margin: 6px 0 0;
  font-size: 1.05rem;
  color: var(--navy);
}

.promo-ad-cta {
  text-decoration: none;
  white-space: nowrap;
}

.promo-ad-compact {
  margin-top: 12px;
}

@media (min-width: 680px) {
  .promo-ad-body {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.info-hero-photo {
  position: relative;
  overflow: hidden;
  padding: 22px 20px 18px;
  min-height: 290px;
}

.info-hero-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 45%;
  z-index: 0;
}

.info-hero-scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    145deg,
    rgba(16, 35, 62, 0.92) 0%,
    rgba(24, 51, 86, 0.84) 55%,
    rgba(18, 39, 64, 0.92) 100%
  );
  z-index: 1;
}

.info-hero-content {
  position: relative;
  z-index: 2;
}

.hero-eyebrow {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #fde047;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(253, 224, 71, 0.35);
  padding: 3px 10px;
  border-radius: 999px;
}

.hero-btn-glass {
  background: rgba(255, 255, 255, 0.94);
  color: var(--navy);
  border-color: transparent;
}

.hero-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 16px;
}

.hero-metric {
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  padding: 8px 11px;
}

.hero-metric strong {
  display: block;
  font-size: 0.98rem;
  color: #fff;
  line-height: 1.2;
}

.hero-metric span {
  display: block;
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.78);
}

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

.camino-shot {
  margin: 0;
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  aspect-ratio: 4 / 3;
  background: #1e293b;
}

.camino-shot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.35s ease;
}

.camino-shot:hover img {
  transform: scale(1.04);
}

.camino-shot figcaption {
  position: absolute;
  inset: auto 0 0 0;
  padding: 22px 10px 8px;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0) 0%, rgba(15, 23, 42, 0.86) 100%);
  color: #fff;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.camino-shot figcaption strong {
  font-size: 0.84rem;
  line-height: 1.2;
}

.camino-shot figcaption span {
  font-size: 0.69rem;
  color: rgba(255, 255, 255, 0.82);
}

.specs-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.spec-card {
  background: var(--surface-alt);
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 12px 13px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.spec-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.spec-code {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: var(--gold);
}

.spec-tag {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--navy);
  background: #e4ebf5;
  padding: 2px 7px;
  border-radius: 999px;
}

.spec-card h3 {
  margin: 0;
  font-size: 0.92rem;
  color: var(--navy);
}

.spec-card p {
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.48;
  color: var(--muted);
}

.spec-card code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.74rem;
  background: rgba(30, 58, 95, 0.08);
  color: var(--navy);
  padding: 1px 4px;
  border-radius: 4px;
}

.spec-bar {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
}

.spec-bar div {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
}

.spec-bar span {
  display: block;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  font-weight: 700;
}

.spec-bar strong {
  font-size: 0.82rem;
  color: var(--navy);
}

@media (min-width: 768px) {
  .info-hero-photo {
    padding: 28px 26px 22px;
  }

  .hero-metrics {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .camino-gallery {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

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

  .spec-bar {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.quick-start-box {
  margin-top: 14px;
  background: rgba(255, 255, 255, 0.13);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 14px;
  padding: 12px;
}

.quick-start-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.quick-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.quick-field span {
  font-size: 0.72rem;
  font-weight: 700;
  color: #fde047;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.quick-start-note {
  margin: 9px 0 0 !important;
  font-size: 0.78rem !important;
  color: rgba(255, 255, 255, 0.88) !important;
  line-height: 1.4;
}

.compare-table-wrap {
  overflow-x: auto;
  margin: 0 -4px;
}

.compare-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.compare-table th,
.compare-table td {
  text-align: left;
  padding: 9px 8px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.compare-table th {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.compare-actions {
  display: flex;
  gap: 6px;
}

.freshness-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--muted);
}

.freshness-list div {
  background: var(--surface-alt);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 11px;
}

.freshness-bar {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 9px 12px;
  font-size: 0.76rem;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.badge-live {
  outline: 1.5px solid currentColor;
}

.badge-estimate {
  border: 1px dashed rgba(26, 36, 48, 0.25);
}

.tech-summary {
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--navy);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.privacy-notice-card {
  background: #f6f9fd;
  border-color: #cbd5e1;
}

@media (min-width: 768px) {
  .quick-start-grid {
    grid-template-columns: 1.4fr 1fr auto;
    align-items: end;
  }

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