:root {
  --bg: #f5f6f2;
  --surface: #ffffff;
  --surface-soft: #eef2ec;
  --ink: #17231f;
  --muted: #6d7771;
  --line: #d9dfd8;
  --teal: #176e65;
  --teal-dark: #0e514b;
  --teal-soft: #e3f1ed;
  --coral: #d66b4f;
  --coral-soft: #f9e7df;
  --gold: #b77d22;
  --gold-soft: #fff1cf;
  --blue: #476d8c;
  --blue-soft: #e7eff7;
  --shadow: 0 14px 32px rgba(27, 45, 38, 0.09);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background: var(--bg);
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button,
a {
  font: inherit;
}

button {
  color: inherit;
}

button:focus-visible,
a:focus-visible,
.destination-card:focus-visible {
  outline: 3px solid rgba(23, 110, 101, 0.28);
  outline-offset: 2px;
}

.app-shell {
  width: min(100%, 1480px);
  margin: 0 auto;
  padding: 0 14px calc(22px + var(--safe-bottom));
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  padding: 14px 0 12px;
  background: rgba(245, 246, 242, 0.94);
  border-bottom: 1px solid rgba(217, 223, 216, 0.8);
  backdrop-filter: blur(16px);
}

.brand-row,
.focus-line,
.day-picker,
.day-tabs {
  min-width: 0;
}

.brand-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.eyebrow,
.section-label,
.day-number,
.stop-time,
.stop-type,
.route-kicker,
.detail-kicker {
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--teal);
  font-size: 0.68rem;
  font-weight: 850;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(1.65rem, 7vw, 2.3rem);
  line-height: 1;
  letter-spacing: 0;
}

.ghost-button,
.close-button,
.nav-button,
.outline-button,
.day-tab,
.transport-button {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.ghost-button {
  min-height: 38px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--teal-dark);
  background: var(--surface);
  font-size: 0.8rem;
  font-weight: 800;
  white-space: nowrap;
}

.day-tabs::-webkit-scrollbar,
.day-columns::-webkit-scrollbar {
  display: none;
}

.focus-line {
  min-height: 20px;
  margin: 10px 2px 0;
  color: var(--teal-dark);
  font-size: 0.78rem;
  font-weight: 750;
  line-height: 1.35;
}

.focus-line:empty {
  display: none;
}

.day-picker {
  display: grid;
  gap: 8px;
  padding: 13px 0 12px;
}

.section-label {
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 850;
}

.day-tabs {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  scrollbar-width: none;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
}

.day-tab {
  flex: 0 0 68px;
  display: grid;
  gap: 2px;
  min-height: 56px;
  padding: 8px 5px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--muted);
  background: var(--surface);
  text-align: center;
  scroll-snap-align: start;
}

.day-tab.is-selected {
  color: #ffffff;
  border-color: var(--teal);
  background: var(--teal);
  box-shadow: 0 6px 15px rgba(23, 110, 101, 0.18);
}

.day-tab.is-today:not(.is-selected) {
  border-color: var(--coral);
  color: var(--coral);
}

.day-tab .tab-weekday {
  font-size: 0.68rem;
  font-weight: 850;
}

.day-tab .tab-date {
  font-size: 1rem;
  font-weight: 900;
  line-height: 1;
}

.planner {
  width: 100%;
}

.day-columns {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
  padding: 1px 1px 12px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.day-column {
  flex: 0 0 min(88vw, 372px);
  min-width: 0;
  padding: 14px 12px 18px;
  border: 1px solid var(--line);
  border-top: 3px solid transparent;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.62);
  scroll-snap-align: start;
  transition: border-color 0.18s ease, background-color 0.18s ease, box-shadow 0.18s ease;
}

.day-column.is-selected {
  border-top-color: var(--teal);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.day-column.is-today {
  border-color: rgba(214, 107, 79, 0.42);
  border-top-color: var(--coral);
}

.day-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 0 2px 13px;
  border-bottom: 1px solid var(--line);
}

.day-number {
  margin-bottom: 4px;
  color: var(--teal);
  font-size: 0.66rem;
  font-weight: 900;
}

.day-header h2 {
  margin-bottom: 4px;
  font-size: 1.22rem;
  line-height: 1.15;
  letter-spacing: 0;
}

.day-subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.4;
}

.day-marker {
  flex: 0 0 auto;
  padding: 6px 8px;
  border-radius: 6px;
  color: var(--coral);
  background: var(--coral-soft);
  font-size: 0.68rem;
  font-weight: 850;
  white-space: nowrap;
}

.day-marker.is-empty {
  visibility: hidden;
}

.timeline {
  position: relative;
  display: grid;
  gap: 0;
  padding-top: 15px;
}

.timeline::before {
  position: absolute;
  top: 21px;
  bottom: 24px;
  left: 13px;
  width: 1px;
  background: var(--line);
  content: "";
}

.stop-row {
  position: relative;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  padding-bottom: 4px;
}

.step-dot {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  border: 5px solid var(--surface);
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 0 1px rgba(23, 110, 101, 0.24);
}

.stop-row.is-current .step-dot {
  background: var(--coral);
  box-shadow: 0 0 0 4px rgba(214, 107, 79, 0.16);
}

.stop-row.is-next .step-dot {
  background: var(--gold);
}

.destination-card {
  min-width: 0;
  margin-bottom: 8px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  cursor: pointer;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.destination-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(27, 45, 38, 0.08);
}

.stop-row.is-current .destination-card {
  border-color: var(--coral);
  box-shadow: 0 0 0 2px rgba(214, 107, 79, 0.12);
}

.stop-row.is-next .destination-card {
  border-color: var(--gold);
}

.stop-image-wrap {
  position: relative;
  height: 132px;
  background: var(--surface-soft);
}

.stop-image-wrap img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.stop-image-wrap.is-fallback {
  display: grid;
  place-items: center;
  color: var(--teal);
  background: var(--teal-soft);
}

.stop-image-wrap.is-fallback::after {
  content: "SINGAPORE";
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.16em;
}

.stop-image-wrap.is-fallback img {
  display: none;
}

.status-tag {
  position: absolute;
  top: 9px;
  left: 9px;
  padding: 5px 7px;
  border-radius: 5px;
  color: #ffffff;
  background: rgba(23, 110, 101, 0.9);
  font-size: 0.67rem;
  font-weight: 850;
}

.status-tag.is-current {
  background: var(--coral);
}

.status-tag.is-next {
  color: #fffaf0;
  background: var(--gold);
}

.stop-body {
  min-width: 0;
  padding: 11px 11px 10px;
}

.stop-meta-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 5px;
}

.stop-time {
  color: var(--coral);
  font-size: 0.69rem;
  font-weight: 900;
}

.stop-type {
  color: var(--muted);
  font-size: 0.6rem;
  font-weight: 800;
}

.stop-body h3 {
  margin-bottom: 4px;
  font-size: 1.02rem;
  line-height: 1.25;
  letter-spacing: 0;
}

.stop-subtitle {
  margin-bottom: 9px;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.45;
}

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

.stop-duration {
  color: var(--teal-dark);
  font-size: 0.69rem;
  font-weight: 800;
}

.text-action {
  padding: 0;
  border: 0;
  color: var(--teal);
  background: transparent;
  font-size: 0.73rem;
  font-weight: 900;
}

.transport-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  min-height: 66px;
}

.transport-line {
  position: relative;
  display: grid;
  place-items: center;
  width: 27px;
  height: 66px;
}

.transport-line::before {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 13px;
  width: 1px;
  background: var(--line);
  content: "";
}

.transport-symbol {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 23px;
  height: 23px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--blue);
  background: var(--surface);
  font-size: 0.62rem;
  font-weight: 900;
}

.transport-content {
  min-width: 0;
  padding: 8px 10px;
  border-left: 2px solid var(--blue);
  background: var(--blue-soft);
}

.route-kicker {
  display: block;
  margin-bottom: 2px;
  color: var(--blue);
  font-size: 0.58rem;
  font-weight: 900;
}

.transport-content strong {
  display: block;
  margin-bottom: 2px;
  font-size: 0.78rem;
  line-height: 1.25;
}

.transport-content p {
  margin: 0;
  color: #5d6d79;
  font-size: 0.69rem;
  line-height: 1.35;
}

.transport-button {
  margin-top: 5px;
  padding: 0;
  border: 0;
  color: var(--blue);
  background: transparent;
  font-size: 0.68rem;
  font-weight: 900;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 12px;
  background: rgba(14, 24, 21, 0.42);
}

.modal-backdrop[hidden] {
  display: none;
}

.detail-sheet {
  position: relative;
  width: min(100%, 560px);
  max-height: min(88dvh, 760px);
  overflow-y: auto;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: 0 24px 60px rgba(11, 27, 22, 0.24);
  animation: sheet-in 0.2s ease-out;
}

@keyframes sheet-in {
  from { transform: translateY(15px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.close-button {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 50%;
  color: #ffffff;
  background: rgba(23, 35, 31, 0.72);
  font-size: 1.4rem;
  line-height: 1;
}

.detail-image-wrap {
  height: 190px;
  background: var(--teal-soft);
}

.detail-image-wrap img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.detail-content {
  padding: 17px;
}

.detail-kicker {
  margin-bottom: 5px;
  color: var(--teal);
  font-size: 0.66rem;
  font-weight: 900;
}

.detail-content h2 {
  margin-bottom: 5px;
  font-size: 1.45rem;
  line-height: 1.15;
}

.detail-location {
  margin-bottom: 13px;
  color: var(--muted);
  font-size: 0.8rem;
}

.detail-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 14px;
}

.detail-facts span {
  padding: 6px 8px;
  border-radius: 5px;
  color: var(--teal-dark);
  background: var(--teal-soft);
  font-size: 0.73rem;
  font-weight: 850;
}

.detail-facts .reservation-fact {
  color: #7a4e00;
  background: var(--gold-soft);
}

.detail-description {
  margin-bottom: 13px;
  font-size: 0.9rem;
  line-height: 1.65;
}

.detail-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

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

.detail-actions.has-ticket .nav-button {
  grid-column: 1 / -1;
}

.nav-button,
.outline-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--teal);
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 900;
  text-decoration: none;
}

.nav-button {
  color: #ffffff;
  background: var(--teal);
}

.outline-button {
  color: var(--teal-dark);
  background: var(--surface);
}

.toast {
  position: fixed;
  right: 14px;
  bottom: calc(14px + var(--safe-bottom));
  z-index: 80;
  max-width: min(85vw, 360px);
  padding: 10px 12px;
  border-radius: 6px;
  color: #ffffff;
  background: rgba(23, 35, 31, 0.92);
  font-size: 0.8rem;
  font-weight: 750;
  opacity: 0;
  pointer-events: none;
  transform: translateY(7px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (min-width: 760px) {
  .app-shell {
    padding-right: 22px;
    padding-left: 22px;
  }

  .topbar {
    padding-top: 20px;
  }

  .day-column {
    flex-basis: 372px;
  }

  .modal-backdrop {
    align-items: center;
  }
}

@media (min-width: 1280px) {
  .app-shell {
    padding-right: 28px;
    padding-left: 28px;
  }

  .day-columns {
    gap: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
