:root {
  --ink-900: #2d2420;
  --ink-700: #5a4a40;
  --ink-500: #7a6d63;
  --paper-100: #f5efe5;
  --paper-200: #efe6d8;
  --paper-300: #e5d7c3;
  --accent-500: #ea741f;
  --accent-600: #cf6217;
  --accent-100: #ffe8d4;
  --sky-500: #607f92;
  --sky-700: #3f5f73;
  --success-500: #2e8259;
  --error-500: #a9402a;
  --radius-xl: 26px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --shadow-soft: 0 14px 32px rgba(60, 47, 35, 0.12);
  --shadow-card: 0 10px 24px rgba(62, 50, 36, 0.11);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "Avenir Next", "Trebuchet MS", "Segoe UI", sans-serif;
  color: var(--ink-900);
  background: radial-gradient(
      120% 95% at 88% -8%,
      rgba(234, 116, 31, 0.21) 0%,
      rgba(234, 116, 31, 0) 58%
    ),
    radial-gradient(
      140% 92% at -10% 20%,
      rgba(96, 127, 146, 0.14) 0%,
      rgba(96, 127, 146, 0) 65%
    ),
    linear-gradient(165deg, #f7f2e8 0%, #f2e9db 52%, #f6efe2 100%);
}

.bg-map {
  position: fixed;
  inset: 0;
  background: url("./assets/travel-decor.svg") center/cover no-repeat;
  opacity: 0.42;
  pointer-events: none;
  z-index: 0;
}

.app-shell {
  position: relative;
  z-index: 1;
  width: min(100%, 980px);
  margin: 0 auto;
  padding: 1.1rem 0.95rem 3.2rem;
}

.topbar {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 1rem;
}

.brand-logo {
  width: min(82vw, 380px);
  height: auto;
  filter: drop-shadow(0 10px 18px rgba(58, 45, 33, 0.2));
}

.view {
  display: none;
}

.view.is-active {
  display: block;
}

.panel {
  background: rgba(255, 252, 248, 0.8);
  border: 1px solid rgba(97, 75, 52, 0.2);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(5px);
  padding: 1rem;
}

.hero-card {
  padding: 1.4rem 1.05rem 1.15rem;
}

.kicker {
  margin: 0;
  text-align: center;
  color: var(--ink-500);
  letter-spacing: 0.07em;
  font-size: 0.78rem;
  text-transform: uppercase;
}

h1 {
  margin: 0.7rem 0 0;
  text-align: center;
  font-family: "Cochin", "Baskerville", "Palatino Linotype", serif;
  font-size: clamp(2.35rem, 12vw, 4rem);
  line-height: 0.95;
  letter-spacing: 0.01em;
}

h1 span {
  color: var(--accent-500);
  text-shadow: 0 7px 13px rgba(208, 98, 26, 0.2);
}

.lead {
  margin: 1rem auto 0;
  text-align: center;
  font-size: 1.03rem;
  color: var(--ink-700);
  max-width: 30ch;
  line-height: 1.4;
}

.trust {
  margin: 0.78rem 0 0;
  text-align: center;
  font-size: 0.92rem;
  color: var(--ink-500);
}

.cta-group {
  display: grid;
  gap: 0.62rem;
  margin-top: 1rem;
}

button,
a.cta-primary,
a.cta-secondary {
  appearance: none;
  border: 0;
  border-radius: 999px;
  min-height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.84rem 1rem;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.cta-primary {
  color: #fff;
  background: linear-gradient(125deg, var(--accent-600), var(--accent-500));
  box-shadow: 0 10px 24px rgba(197, 97, 27, 0.31);
}

.cta-secondary {
  color: var(--ink-900);
  background: rgba(255, 252, 248, 0.88);
  border: 1px solid rgba(98, 75, 54, 0.22);
}

.hero-points {
  margin-top: 1rem;
  display: grid;
  gap: 0.7rem;
}

.hero-points article {
  border-radius: var(--radius-md);
  border: 1px solid rgba(98, 76, 54, 0.18);
  background: rgba(255, 255, 255, 0.55);
  padding: 0.75rem 0.82rem;
}

.hero-points h3 {
  margin: 0;
  font-family: "Cochin", "Baskerville", serif;
  font-size: 1.25rem;
}

.hero-points p {
  margin: 0.24rem 0 0;
  color: var(--ink-700);
}

.view-header {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.7rem;
  align-items: center;
  margin: 0.35rem 0 0.95rem;
}

.view-header h2 {
  margin: 0;
  font-family: "Cochin", "Baskerville", serif;
  font-size: clamp(2rem, 10vw, 3rem);
  line-height: 1;
}

.view-header p {
  margin: 0.16rem 0 0;
  color: var(--ink-700);
  font-size: 1.02rem;
}

.text-btn {
  border: 0;
  background: transparent;
  color: var(--ink-900);
  font-weight: 700;
  width: auto;
  min-height: auto;
  padding: 0.25rem;
}

.panel + .panel {
  margin-top: 0.95rem;
}

h3 {
  margin: 0;
  font-family: "Cochin", "Baskerville", serif;
  font-size: clamp(1.45rem, 5.6vw, 1.9rem);
}

.subtle {
  margin: 0.34rem 0 0;
  color: var(--ink-500);
}

.style-picker {
  margin-top: 0.75rem;
  display: grid;
  gap: 0.65rem;
}

.style-option {
  display: flex;
  gap: 0.72rem;
  align-items: flex-start;
  padding: 0.85rem 0.9rem;
  border-radius: var(--radius-md);
  border: 2px solid rgba(117, 98, 80, 0.23);
  background: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: transform 120ms ease, border-color 120ms ease, background 120ms ease;
}

.style-option:hover {
  transform: translateY(-1px);
}

.style-option input {
  accent-color: var(--accent-600);
  margin-top: 0.2rem;
}

.style-option input:checked + span strong {
  color: var(--accent-600);
}

.style-option.selected {
  border-color: var(--accent-500);
  background: rgba(255, 243, 229, 0.78);
  box-shadow: 0 8px 18px rgba(201, 98, 24, 0.14);
}

.style-option strong {
  display: block;
  font-size: 1.12rem;
  margin-bottom: 0.16rem;
}

.style-option em {
  display: block;
  color: var(--ink-700);
  font-style: normal;
  font-size: 0.93rem;
}

.segmented {
  background: rgba(245, 239, 229, 0.9);
  border: 1px solid rgba(111, 89, 66, 0.21);
  border-radius: 16px;
  padding: 0.28rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.32rem;
}

.seg-btn {
  border-radius: 12px;
  border: 0;
  min-height: 46px;
  background: transparent;
  color: var(--ink-700);
  font-weight: 700;
}

.seg-btn.active {
  background: #fff;
  color: var(--ink-900);
  box-shadow: var(--shadow-card);
}

.input-pane {
  margin-top: 0.82rem;
}

.image-dropzone {
  border: 1.5px dashed rgba(111, 88, 63, 0.38);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.55);
  padding: 0.7rem;
  transition: border-color 140ms ease, background 140ms ease, box-shadow 140ms ease;
}

.image-dropzone input {
  cursor: pointer;
}

.image-dropzone.is-dragover {
  border-color: var(--accent-500);
  background: rgba(255, 237, 219, 0.82);
  box-shadow: 0 10px 22px rgba(207, 98, 23, 0.18);
}

.drop-hint {
  margin: 0 0 0.5rem;
  color: var(--ink-700);
  font-size: 0.9rem;
}

.desktop-only {
  display: none;
}

.hidden {
  display: none !important;
}

.field-label {
  display: block;
  margin: 0 0 0.35rem;
  color: var(--ink-700);
  font-size: 0.94rem;
}

textarea,
input,
select {
  width: 100%;
  background: rgba(255, 255, 255, 0.86);
  color: var(--ink-900);
  border: 1px solid rgba(110, 87, 63, 0.28);
  border-radius: 14px;
  padding: 0.78rem 0.9rem;
  font: inherit;
}

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

.control-grid {
  display: grid;
  gap: 0.62rem;
  margin-top: 0.72rem;
}

.estimate-box {
  margin-top: 0.72rem;
  border: 1px solid rgba(93, 73, 51, 0.24);
  border-radius: 12px;
  background: rgba(255, 249, 240, 0.8);
  padding: 0.72rem;
  color: var(--ink-700);
  font-size: 0.93rem;
  line-height: 1.4;
}

.actions {
  margin-top: 0.88rem;
  display: grid;
  gap: 0.62rem;
}

.actions button {
  color: #fff;
  background: linear-gradient(125deg, var(--accent-600), var(--accent-500));
  box-shadow: 0 10px 20px rgba(186, 92, 27, 0.26);
}

.actions button:last-child {
  background: linear-gradient(125deg, var(--sky-700), var(--sky-500));
  box-shadow: 0 10px 20px rgba(74, 103, 121, 0.25);
}

#activateTierBtn {
  color: #fff;
  background: linear-gradient(125deg, var(--accent-600), var(--accent-500));
  box-shadow: 0 10px 20px rgba(186, 92, 27, 0.26);
}

button:disabled {
  opacity: 0.52;
  cursor: not-allowed;
}

.status {
  min-height: 1.4rem;
  margin: 0.5rem 0 0;
  color: var(--ink-700);
}

.status.success {
  color: var(--success-500);
}

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

.paywall {
  border-color: rgba(201, 100, 29, 0.48);
  background: linear-gradient(180deg, rgba(255, 241, 227, 0.9) 0%, rgba(255, 247, 238, 0.84) 100%);
}

.plan-grid {
  margin: 0.75rem 0;
  display: grid;
  gap: 0.6rem;
}

.plan-grid article {
  border: 1px solid rgba(105, 80, 56, 0.22);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.58);
  padding: 0.68rem;
}

.plan-grid h4 {
  margin: 0;
  font-size: 1rem;
}

.plan-grid p {
  margin: 0.25rem 0 0;
  color: var(--ink-700);
}

#upgradeLink {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0.7rem 1rem;
  border-radius: 999px;
  background: linear-gradient(125deg, var(--accent-600), var(--accent-500));
  color: #fff;
  font-weight: 700;
  text-decoration: none;
}

.stops-editor.empty {
  color: var(--ink-500);
  font-style: italic;
}

.stop-row {
  border: 1px solid rgba(98, 76, 55, 0.18);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.55);
  padding: 0.55rem;
  margin-bottom: 0.55rem;
  display: grid;
  gap: 0.44rem;
}

.stop-grid {
  display: grid;
  gap: 0.42rem;
}

.summary-text {
  margin: 0;
  color: var(--ink-700);
  font-size: 1.05rem;
}

.timeline-track {
  margin-top: 0.85rem;
  display: flex;
  gap: 0.45rem;
  overflow-x: auto;
  padding-bottom: 0.35rem;
}

.timeline-track.empty {
  color: var(--ink-500);
}

.timeline-item {
  min-width: 78px;
  text-align: center;
  position: relative;
}

.timeline-item::before {
  content: "";
  position: absolute;
  top: 20px;
  left: -39px;
  width: 39px;
  height: 2px;
  background: rgba(117, 94, 70, 0.3);
}

.timeline-item:first-child::before {
  display: none;
}

.timeline-dot {
  width: 38px;
  height: 38px;
  margin: 0 auto;
  border-radius: 50%;
  border: 2px solid rgba(116, 94, 72, 0.3);
  background: #f5efe5;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--ink-700);
}

.timeline-item.visited .timeline-dot {
  background: var(--accent-500);
  border-color: var(--accent-500);
  color: #fff;
}

.timeline-code {
  margin-top: 0.35rem;
  font-size: 0.84rem;
  color: var(--ink-700);
}

.journey-grid {
  margin-top: 0.95rem;
  display: grid;
  gap: 0.9rem;
}

.journey-grid.empty {
  color: var(--ink-500);
  font-style: italic;
}

.journey-card {
  border: 1px solid rgba(97, 76, 53, 0.22);
  background: rgba(255, 252, 247, 0.82);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.journey-image {
  display: block;
  width: 100%;
}

.journey-meta {
  padding: 0.65rem 0.8rem;
}

.journey-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

.journey-top h4 {
  margin: 0;
  font-family: "Cochin", "Baskerville", serif;
  font-size: 1.34rem;
}

.badge {
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.3rem 0.56rem;
}

.badge.visited {
  color: #145f3e;
  background: rgba(107, 176, 142, 0.2);
}

.badge.upcoming {
  color: #715b47;
  background: rgba(148, 127, 104, 0.16);
}

.journey-code {
  margin: 0.24rem 0 0;
  color: var(--ink-700);
}

.journey-actions {
  margin-top: 0.55rem;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.42rem;
}

.journey-actions button,
.journey-actions a {
  min-height: 40px;
  border-radius: 10px;
  border: 1px solid rgba(101, 79, 57, 0.21);
  background: #fff;
  color: var(--ink-900);
  font-size: 0.86rem;
  text-decoration: none;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.4rem;
}

.journey-actions button:first-child {
  background: linear-gradient(125deg, var(--accent-600), var(--accent-500));
  color: #fff;
  border: 0;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(24, 20, 18, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.8rem;
}

.modal-card {
  width: min(100%, 740px);
  max-height: 92vh;
  overflow: auto;
  border-radius: var(--radius-xl);
  background: #fffaf2;
  border: 1px solid rgba(97, 74, 50, 0.25);
  box-shadow: 0 20px 45px rgba(27, 21, 15, 0.38);
  padding: 0.82rem;
}

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.6rem;
}

.modal-head h3 {
  margin: 0;
}

#modalImage {
  display: block;
  width: 100%;
  border-radius: 14px;
  margin-top: 0.55rem;
}

#modalMessage {
  min-height: 92px;
}

.modal-actions {
  margin-top: 0.62rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem;
}

.modal-actions a,
.modal-actions button {
  min-height: 46px;
  border-radius: 12px;
  font-weight: 700;
  text-decoration: none;
}

.modal-actions a {
  background: linear-gradient(125deg, var(--accent-600), var(--accent-500));
  color: #fff;
  border: 0;
}

.modal-actions button {
  border: 1px solid rgba(103, 79, 56, 0.24);
  background: #fff;
  color: var(--ink-900);
}

@media (min-width: 700px) {
  .app-shell {
    padding: 1.4rem 1.2rem 4rem;
  }

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

  .cta-group {
    grid-template-columns: 1fr 1fr;
  }

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

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

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

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

@media (min-width: 980px) {
  .app-shell {
    padding-top: 1.6rem;
  }

  .brand-logo {
    width: 360px;
  }

  .hero-card {
    padding: 1.8rem 1.5rem 1.25rem;
  }

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

  .desktop-only {
    display: block;
  }

  .image-dropzone {
    padding: 0.95rem;
  }
}
