:root {
  color-scheme: light;
  --ink: #142127;
  --muted: #62717a;
  --sea: #075064;
  --lagoon: #0f7d86;
  --foam: #e9fbf7;
  --sun: #f8c84d;
  --coral: #ed4f3f;
  --paper: #fffaf0;
  --white: #fffef8;
  --line: rgba(20, 33, 39, 0.12);
  --shadow: 0 14px 34px rgba(7, 80, 100, 0.16);
  --soft-shadow: 0 8px 20px rgba(7, 80, 100, 0.1);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--sea);
  scroll-behavior: smooth;
}

body {
  min-height: 100%;
  margin: 0;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
  background:
    linear-gradient(180deg, #075064 0 128px, #0c6d77 128px 226px, #f7e7aa 226px 360px, #fffaf0 560px);
  -webkit-font-smoothing: antialiased;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  font: inherit;
}

.app-shell {
  width: min(100%, 780px);
  min-height: 100vh;
  margin: 0 auto;
  padding: calc(14px + env(safe-area-inset-top)) 14px calc(28px + env(safe-area-inset-bottom));
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  padding: 6px 0;
  color: #fffdf5;
}

.day-kicker {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 850;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin: 0;
}

.trip-mark {
  display: grid;
  gap: 4px;
  min-width: 0;
  line-height: 1.05;
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.trip-mark h1 {
  font-size: 1.14rem;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
}

.trip-mark small {
  margin-top: 2px;
  color: rgba(255, 253, 245, 0.68);
  font-size: 0.68rem;
  font-weight: 850;
  text-transform: uppercase;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  min-width: 0;
}

.nav-pill,
.trip-status {
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 999px;
  color: #fffdf5;
  background: rgba(255, 255, 255, 0.11);
  font-size: 0.78rem;
  font-weight: 850;
  white-space: nowrap;
  backdrop-filter: blur(14px);
}

.nav-pill {
  text-decoration: none;
}

.countdown-badge {
  border: 1px solid rgba(248, 200, 77, 0.7);
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(248, 200, 77, 0.95), rgba(255, 253, 245, 0.9));
  box-shadow: 0 0 0 0 rgba(248, 200, 77, 0.28);
  color: var(--sea);
  font-size: 0.66rem;
  font-weight: 950;
  letter-spacing: 0;
  line-height: 1;
  padding: 6px 8px;
  white-space: nowrap;
  animation: badge-breathe 2.8s ease-in-out infinite;
}

.countdown-badge.is-hidden {
  display: none;
}

.icon-button {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 999px;
  color: #fff;
  background: rgba(255, 255, 255, 0.15);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
  font-size: 1.7rem;
  font-weight: 700;
}

.icon-button.is-visible {
  display: grid;
  place-items: center;
}

.timeline-view {
  padding-top: 10px;
}

.housing-view {
  display: grid;
  gap: 12px;
  padding-top: 10px;
}

.page-intro,
.housing-card {
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 8px;
  background: rgba(255, 254, 248, 0.96);
  box-shadow: var(--soft-shadow);
}

.page-intro {
  display: grid;
  gap: 8px;
  padding: 14px;
  box-shadow: var(--shadow);
}

.page-intro h2 {
  font-size: 1.22rem;
  line-height: 1.12;
}

.page-intro p {
  color: var(--muted);
  line-height: 1.38;
}

.housing-card {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.housing-card.is-current {
  border-color: rgba(7, 80, 100, 0.34);
  box-shadow: var(--shadow);
}

.housing-head {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.housing-dates {
  display: grid;
  place-items: center;
  min-height: 58px;
  border-radius: 8px;
  color: #fffaf0;
  background: var(--sea);
  font-weight: 900;
  line-height: 1.05;
  text-align: center;
}

.housing-dates span {
  display: block;
  font-size: 0.76rem;
}

.housing-dates small {
  display: block;
  margin-top: 3px;
  font-size: 0.58rem;
  text-transform: uppercase;
}

.housing-title {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.housing-title h2 {
  font-size: 1.08rem;
  line-height: 1.16;
}

.housing-title p {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.3;
}

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

.housing-tags span {
  padding: 6px 8px;
  border-radius: 8px;
  color: var(--sea);
  background: rgba(15, 125, 134, 0.09);
  font-size: 0.74rem;
  font-weight: 850;
}

.housing-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.housing-list li {
  display: grid;
  grid-template-columns: 94px minmax(0, 1fr);
  gap: 10px;
  color: var(--ink);
  line-height: 1.34;
}

.housing-list strong {
  color: var(--muted);
  font-size: 0.76rem;
  text-transform: uppercase;
}

.housing-note {
  padding-top: 10px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.36;
}

.cost-banner {
  border: 1px solid rgba(7, 80, 100, 0.18);
  border-radius: 8px;
  background: rgba(255, 254, 248, 0.96);
  box-shadow: var(--soft-shadow);
  display: grid;
  gap: 12px;
  margin: 0 0 14px;
  padding: 14px;
}

.cost-banner-head {
  align-items: end;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.cost-banner-head p {
  margin: 0;
}

.cost-banner-head p {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
  text-transform: uppercase;
}

.cost-banner-head strong {
  color: var(--ink);
  font-size: 1.76rem;
  line-height: 1;
  white-space: nowrap;
}

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

.cost-grid div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(232, 248, 244, 0.62);
  min-width: 0;
  padding: 10px;
}

.cost-grid span {
  color: var(--muted);
  display: block;
  font-size: 0.72rem;
  font-weight: 850;
  text-transform: uppercase;
}

.cost-grid strong {
  display: block;
  font-size: 1.08rem;
  line-height: 1.15;
  margin-top: 5px;
  white-space: nowrap;
}

.day-list {
  display: grid;
  gap: 10px;
}

.day-panel {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 254, 248, 0.97);
  box-shadow: var(--soft-shadow);
  animation: rise-in 360ms ease both;
  animation-delay: var(--stagger);
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease, opacity 180ms ease;
}

.day-panel:active {
  transform: scale(0.99);
}

.day-panel.is-next {
  border-color: rgba(7, 80, 100, 0.34);
  box-shadow: 0 14px 30px rgba(7, 80, 100, 0.14);
}

.day-head {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr) 32px;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 74px;
  padding: 12px;
  border: 0;
  color: var(--ink);
  background: transparent;
  text-align: left;
}

.day-date {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 1px;
  min-height: 56px;
  border-radius: 8px;
  color: #fffaf0;
  background: var(--sea);
  box-shadow: inset 0 -10px 22px rgba(4, 45, 56, 0.2);
  font-weight: 900;
  line-height: 1;
}

.day-number {
  font-size: 1.36rem;
  line-height: 0.9;
}

.day-panel.has-date-range .day-number {
  font-size: 1rem;
  line-height: 0.95;
}

.day-month {
  font-size: 0.61rem;
  line-height: 0.9;
  text-transform: uppercase;
}

.day-main {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.day-kicker {
  color: var(--lagoon);
}

.day-title {
  min-width: 0;
  font-size: 1rem;
  font-weight: 850;
  line-height: 1.18;
}

.day-toggle {
  position: relative;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: rgba(7, 80, 100, 0.1);
}

.day-toggle::before,
.day-toggle::after {
  position: absolute;
  width: 13px;
  height: 2px;
  border-radius: 99px;
  background: var(--sea);
  content: "";
  transition: transform 180ms ease;
}

.day-toggle::after {
  transform: rotate(90deg);
}

.day-panel.is-open .day-toggle {
  background: var(--sun);
}

.day-panel.is-open .day-toggle::after {
  transform: rotate(0);
}

.day-body {
  max-height: 0;
  overflow: hidden;
  padding: 0 12px;
  opacity: 0;
  transition: max-height 280ms ease, opacity 180ms ease, padding-bottom 220ms ease;
}

.day-panel.is-open .day-body {
  max-height: 760px;
  padding-bottom: 14px;
  opacity: 1;
}

.event-list {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.event {
  position: relative;
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 10px;
  padding: 12px 0;
}

.event::before {
  position: absolute;
  top: 18px;
  bottom: -18px;
  left: 38px;
  width: 2px;
  background: rgba(7, 80, 100, 0.12);
  content: "";
}

.event:last-child::before {
  display: none;
}

.event time {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  min-height: 30px;
  padding: 4px 6px;
  border-radius: 8px;
  color: var(--sea);
  background: var(--foam);
  font-size: 0.72rem;
  font-weight: 900;
  line-height: 1.08;
  text-align: center;
  overflow-wrap: anywhere;
}

.event p {
  color: var(--ink);
  line-height: 1.35;
  font-weight: 700;
}

.event small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-weight: 520;
  line-height: 1.35;
}

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

@keyframes badge-breathe {
  0%,
  100% {
    transform: translateY(0);
    box-shadow: 0 0 0 0 rgba(255, 253, 245, 0.18);
  }
  50% {
    transform: translateY(-1px);
    box-shadow: 0 0 0 5px rgba(255, 253, 245, 0);
  }
}

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

@media (max-width: 560px) {
  .app-shell {
    padding-inline: 12px;
    padding-bottom: calc(32px + env(safe-area-inset-bottom));
  }

  .topbar {
    align-items: flex-start;
  }

  .top-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 6px;
  }

  .nav-pill,
  .trip-status {
    padding: 7px 9px;
    font-size: 0.72rem;
  }

  .countdown-badge {
    font-size: 0.64rem;
    padding: 5px 7px;
  }

  .housing-head {
    grid-template-columns: 66px minmax(0, 1fr);
  }

  .housing-list li {
    grid-template-columns: 82px minmax(0, 1fr);
  }

  .day-head {
    grid-template-columns: 74px minmax(0, 1fr) 32px;
    gap: 10px;
    padding: 10px;
  }

  .day-date {
    min-height: 56px;
  }

  .event {
    grid-template-columns: 74px minmax(0, 1fr);
    gap: 10px;
  }

  .event::before {
    left: 37px;
  }

}

@media (max-width: 390px) {
  .housing-list li {
    grid-template-columns: 1fr;
    gap: 2px;
  }
}
