/* Windstar Tahiti Price Tracker — premium glassmorphic theme */

@import url("https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@500;600;700&family=Outfit:wght@300;400;500;600;700&display=swap");

:root {
  --ocean-deep: #0a3d5c;
  --ocean-navy: #0f4c75;
  --ocean-mid: #1a6b9a;
  --turquoise: #2ec4b6;
  --turquoise-soft: #7fdbda;
  --lagoon: #48cae4;
  --sand: #f7f3ee;
  --slate: #1b2b3a;
  --slate-soft: #334155;
  --muted: #5a6d7e;
  --white-glass: rgba(255, 255, 255, 0.82);
  --white-glass-soft: rgba(255, 255, 255, 0.72);
  --white-border: rgba(255, 255, 255, 0.45);
  --shadow: 0 18px 50px rgba(10, 61, 92, 0.18);
  --radius: 16px;
  --radius-lg: 22px;
  --font: "Outfit", system-ui, -apple-system, sans-serif;
  --display: "Cormorant Garamond", Georgia, serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--slate);
  line-height: 1.55;
  background-color: #0a3d5c;
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  background-attachment: fixed;
}

/* Each trip gets its own backdrop; home, login and settings stay neutral */
body.theme-tahiti {
  background-image: url("/static/polynesia-bg.jpg");
}

/* Trunk Bay, St. John — photo by Navin75, CC BY-SA 2.0 (credited in the page footer) */
body.theme-caribbean {
  background-color: #0b5d6e;
  background-image: url("/static/caribbean-bg.jpg");
}

body.theme-neutral {
  background-color: #0a2540;
  background-image:
    radial-gradient(ellipse 80% 50% at 50% 0%, rgba(72, 202, 228, 0.18), transparent 70%),
    linear-gradient(165deg, #0a2540 0%, #0a3d5c 55%, #124d6e 100%);
}

/* Soft overlay so text stays readable over the lagoon */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.15);
  pointer-events: none;
  z-index: 0;
}

.topbar,
.container,
.footer {
  position: relative;
  z-index: 1;
}

/* —— Top bar —— */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 1.5rem;
  border-bottom: 1px solid var(--white-border);
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  position: sticky;
  top: 0;
  z-index: 20;
  box-shadow: 0 4px 24px rgba(10, 61, 92, 0.08);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--ocean-deep);
  text-decoration: none;
  font-weight: 600;
  letter-spacing: -0.01em;
  font-size: 1.05rem;
}

.brand-icon {
  font-size: 1.35rem;
  filter: drop-shadow(0 2px 4px rgba(10, 61, 92, 0.2));
}

.brand-sub {
  display: block;
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ocean-mid);
  margin-top: 0.05rem;
}

nav { display: flex; gap: 0.4rem; }

nav a {
  color: var(--slate-soft);
  text-decoration: none;
  padding: 0.45rem 0.95rem;
  border-radius: 999px;
  font-size: 0.92rem;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
}

nav a:hover,
nav a.active {
  color: var(--ocean-deep);
  background: rgba(46, 196, 182, 0.18);
}

.container {
  max-width: 1040px;
  margin: 0 auto;
  padding: 1.75rem 1.25rem 4rem;
}

.footer {
  text-align: center;
  color: rgba(255, 255, 255, 0.92);
  font-size: 0.88rem;
  padding: 1.75rem 1rem 2.25rem;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.35);
}

.footer .pill {
  vertical-align: middle;
}

/* —— Hero & trip banner —— */
.trip-banner {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

@media (max-width: 780px) {
  .trip-banner { grid-template-columns: 1fr; }
}

.countdown-card,
.highlights-card {
  padding: 1.35rem 1.5rem;
}

.countdown-card .eyebrow,
.highlights-card .eyebrow {
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--ocean-mid);
  margin: 0 0 0.45rem;
}

.countdown-card h2,
.highlights-card h2 {
  font-family: var(--display);
  font-size: 1.75rem;
  font-weight: 600;
  color: var(--ocean-deep);
  margin: 0 0 0.85rem;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.countdown-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.55rem;
}

.countdown-unit {
  text-align: center;
  background: linear-gradient(160deg, rgba(26, 107, 154, 0.12), rgba(46, 196, 182, 0.14));
  border: 1px solid rgba(26, 107, 154, 0.15);
  border-radius: 12px;
  padding: 0.65rem 0.35rem;
}

.countdown-unit .num {
  display: block;
  font-family: var(--display);
  font-size: 1.85rem;
  font-weight: 700;
  color: var(--ocean-deep);
  line-height: 1.1;
}

.countdown-unit .unit-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-weight: 600;
}

.countdown-meta {
  margin: 0.85rem 0 0;
  font-size: 0.9rem;
  color: var(--muted);
}

.highlights-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.highlights-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  color: var(--slate-soft);
  font-size: 0.95rem;
}

.highlights-list .dot {
  flex-shrink: 0;
  width: 0.55rem;
  height: 0.55rem;
  margin-top: 0.4rem;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--turquoise), var(--ocean-mid));
  box-shadow: 0 0 0 3px rgba(46, 196, 182, 0.2);
}

.highlights-tagline {
  margin: 1rem 0 0;
  font-family: var(--display);
  font-size: 1.2rem;
  font-style: italic;
  color: var(--ocean-navy);
}

/* —— Hero —— */
.hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.hero-title-block {
  flex: 1 1 16rem;
  min-width: 0;
  max-width: 40rem;
}

.hero h1,
.hero-title,
h1 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(1.85rem, 4.5vw, 2.65rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: #fff;
  text-shadow:
    0 1px 2px rgba(0, 0, 0, 0.45),
    0 4px 24px rgba(0, 0, 0, 0.4);
  line-height: 1.12;
}

.hero-subtitle {
  margin: 0.55rem 0 0;
  font-family: var(--font);
  font-size: clamp(0.95rem, 2.2vw, 1.15rem);
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.95);
  text-shadow:
    0 1px 2px rgba(0, 0, 0, 0.4),
    0 2px 14px rgba(0, 0, 0, 0.35);
  line-height: 1.4;
}

/* Decorative accent under family title */
.hero-subtitle::after {
  content: "";
  display: block;
  width: 3.5rem;
  height: 3px;
  margin-top: 0.85rem;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--turquoise), var(--lagoon), transparent);
  box-shadow: 0 0 12px rgba(46, 196, 182, 0.45);
}

.hero .lede {
  color: rgba(255, 255, 255, 0.92);
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.3);
  max-width: 36rem;
  margin: 0;
  font-size: 1.05rem;
  font-weight: 400;
}

h2 {
  margin: 0 0 0.85rem;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--ocean-deep);
}

.muted { color: var(--muted); }
.break-all { word-break: break-all; }

/* —— Glass cards —— */
.card {
  background: var(--white-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--white-border);
  border-radius: var(--radius);
  padding: 1.3rem 1.4rem;
  box-shadow: var(--shadow);
  margin-bottom: 1.25rem;
  color: var(--slate);
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin: 1.75rem 0 0.85rem;
}

.section-head h2 {
  margin: 0;
  color: #fff;
  font-family: var(--display);
  font-size: 1.65rem;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
}

.section-head .muted {
  color: rgba(255, 255, 255, 0.88);
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.25);
}

/* —— Forms —— */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  align-items: end;
}

.form-grid label {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--slate-soft);
  min-width: 0; /* allow equal columns */
}

.form-grid .span-2 { grid-column: span 2; }

.optional { opacity: 0.75; font-weight: 400; }

/* Shared field chrome — name, email, url all match */
input[type="text"],
input[type="email"],
input[type="url"],
.form-grid input {
  display: block;
  width: 100%;
  box-sizing: border-box;
  min-height: 3rem;
  height: 3rem;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(15, 76, 117, 0.2);
  color: var(--slate);
  border-radius: 12px;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  line-height: 1.25;
  font-family: var(--font);
  font-weight: 400;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
  appearance: none;
  -webkit-appearance: none;
}

.login-form label {
  display: block;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--slate-soft);
  margin-bottom: 0.4rem;
}

.login-form input[type="password"] {
  display: block;
  width: 100%;
  box-sizing: border-box;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(15, 76, 117, 0.2);
  color: var(--slate);
  border-radius: 10px;
  padding: 0.55rem 0.75rem;
  font-size: 0.95rem;
  font-family: var(--font);
  font-weight: 400;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
  appearance: none;
  -webkit-appearance: none;
}

.login-form input[type="password"]:hover {
  background: rgba(255, 255, 255, 0.88);
  border-color: rgba(15, 76, 117, 0.28);
}

.login-form input[type="password"]:focus {
  outline: none;
  background: rgba(255, 255, 255, 0.95);
  border-color: var(--turquoise);
  box-shadow: 0 0 0 3px rgba(46, 196, 182, 0.25);
}

input::placeholder {
  color: #8a9aab;
  opacity: 1;
}

input:hover {
  background: rgba(255, 255, 255, 0.88);
  border-color: rgba(15, 76, 117, 0.28);
}

input:focus {
  outline: none;
  background: rgba(255, 255, 255, 0.95);
  border-color: var(--turquoise);
  box-shadow: 0 0 0 3px rgba(46, 196, 182, 0.25);
}

.form-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

/* Invite form: name + email equal columns, polished footer row */
.family-intro-card .form-grid {
  grid-template-columns: 1fr 1fr;
  gap: 1rem 1.15rem;
}

.family-intro-card .form-grid > label:not(.span-2) {
  width: 100%;
}

.family-intro-card .form-grid input {
  width: 100%;
  min-height: 3rem;
  height: 3rem;
}

.family-intro-card .form-actions {
  margin-top: 0.25rem;
  padding-top: 0.35rem;
  align-items: center;
}

.family-intro-card .form-actions .btn {
  min-height: 3rem;
  padding: 0.75rem 1.35rem;
  white-space: nowrap;
  flex-shrink: 0;
}

.checkbox {
  display: flex !important;
  flex-direction: row !important;
  align-items: center;
  gap: 0.5rem !important;
  color: var(--muted);
  font-size: 0.9rem;
}

/* —— Buttons —— */
.btn {
  border: none;
  border-radius: 12px;
  padding: 0.7rem 1.2rem;
  font-weight: 600;
  cursor: pointer;
  font-size: 0.95rem;
  font-family: var(--font);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: transform 0.12s, box-shadow 0.12s, background 0.12s;
}

.btn:hover:not(:disabled) {
  transform: translateY(-1px);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn.primary {
  background: linear-gradient(135deg, var(--ocean-mid) 0%, var(--ocean-deep) 55%, #0d5c63 100%);
  color: #fff;
  box-shadow: 0 8px 22px rgba(10, 61, 92, 0.28);
}

.btn.primary:hover:not(:disabled) {
  box-shadow: 0 10px 28px rgba(10, 61, 92, 0.38);
}

.btn.secondary {
  background: rgba(255, 255, 255, 0.75);
  color: var(--ocean-deep);
  border: 1px solid rgba(15, 76, 117, 0.2);
  backdrop-filter: blur(8px);
}

.btn.danger {
  background: rgba(248, 113, 113, 0.15);
  color: #b91c1c;
  border: 1px solid rgba(248, 113, 113, 0.35);
}

.btn-row { display: flex; gap: 0.6rem; flex-wrap: wrap; }

/* —— Pills —— */
.pill {
  display: inline-flex;
  align-items: center;
  padding: 0.18rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.pill.ok {
  background: rgba(46, 196, 182, 0.2);
  color: #0d6b63;
  border: 1px solid rgba(46, 196, 182, 0.35);
}

.pill.warn {
  background: rgba(251, 191, 36, 0.2);
  color: #92400e;
  border: 1px solid rgba(251, 191, 36, 0.4);
}

.pill.muted-pill {
  background: rgba(100, 116, 139, 0.12);
  color: var(--muted);
  border: 1px solid rgba(100, 116, 139, 0.2);
}

/* —— Banners —— */
.banner {
  border-radius: 14px;
  padding: 0.9rem 1.1rem;
  margin-bottom: 1.25rem;
  font-size: 0.95rem;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.banner.warn {
  background: rgba(255, 248, 230, 0.88);
  border: 1px solid rgba(251, 191, 36, 0.45);
  color: #78350f;
}

.banner.ok {
  background: rgba(232, 255, 250, 0.9);
  border: 1px solid rgba(46, 196, 182, 0.4);
  color: #0d5c55;
}

.banner a { color: var(--ocean-mid); font-weight: 600; }

/* —— Cruise cards —— */
.cruise-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.1rem;
}

.cruise-card {
  display: flex;
  flex-direction: column;
  color: inherit;
  text-decoration: none;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s;
  margin-bottom: 0;
  background: var(--white-glass-soft);
}

.cruise-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 22px 50px rgba(10, 61, 92, 0.22);
  background: rgba(255, 255, 255, 0.92);
}

.cruise-card-cabin {
  background: linear-gradient(160deg, rgba(214, 247, 243, 0.96) 0%, rgba(224, 248, 250, 0.96) 100%);
  border: 1px solid rgba(46, 196, 182, 0.45);
}

/* —— Benchmark comparison line inside each source card —— */
.benchmark-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.85rem;
  padding: 0.5rem 0.65rem;
  border-radius: 10px;
  background: rgba(15, 76, 117, 0.05);
  border: 1px solid rgba(15, 76, 117, 0.09);
  font-size: 0.82rem;
}

a.benchmark-row {
  color: inherit;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease;
}

a.benchmark-row:hover,
a.benchmark-row:focus-visible {
  background: rgba(15, 76, 117, 0.1);
  border-color: rgba(15, 76, 117, 0.22);
}

.benchmark-low {
  color: #0d6b63;
  font-weight: 600;
  white-space: nowrap;
}

.benchmark-go {
  font-size: 1.1rem;
  line-height: 1;
  color: var(--ocean-mid);
  opacity: 0.6;
}

.chart-wrap-lg {
  height: 260px;
}

.price-history-card h2 {
  margin: 0;
}

.benchmark-tag {
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ocean-mid);
  background: rgba(46, 196, 182, 0.16);
  border-radius: 999px;
  padding: 0.15rem 0.45rem;
}

.benchmark-text {
  color: var(--muted);
}
.benchmark-text strong {
  color: var(--ocean-deep);
  font-variant-numeric: tabular-nums;
}

.benchmark-diff {
  margin-left: auto;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.benchmark-diff.over { color: #b85c38; }
.benchmark-diff.under { color: #0d6b63; }

.benchmark-mult {
  font-weight: 500;
  opacity: 0.75;
}

/* —— Cabin availability: full-width horizontal strip under the cruise cards —— */
.cabin-strip {
  width: 100%;
  margin-top: 1.1rem;
}

.cabin-strip-head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1.1rem;
}

.cabin-strip-head h3 {
  margin: 0;
  font-size: 1.05rem;
  color: var(--ocean-deep);
  font-weight: 600;
}

.cabin-strip-meta {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.cabin-strip-checked {
  font-size: 0.85rem;
  color: var(--muted);
}

/* One uniform row of tiles — total first, then each category. auto-fit keeps
   them evenly sized and wraps cleanly on narrow screens. */
.cabin-strip-body {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.7rem;
  align-items: stretch;
}

.cabin-tile {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  gap: 0.15rem;
  padding: 0.9rem 0.75rem;
  min-height: 104px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(46, 196, 182, 0.28);
  border-radius: 14px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.cabin-tile:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(10, 61, 92, 0.1);
}

.cabin-tile-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ocean-mid);
}

.cabin-tile-value {
  font-family: var(--display);
  font-size: 2rem;
  line-height: 1.1;
  font-weight: 600;
  color: var(--ocean-deep);
  font-variant-numeric: tabular-nums;
}

.cabin-tile-sub {
  font-size: 0.74rem;
  color: var(--muted);
  line-height: 1.3;
}

/* Total gets the accent treatment so it reads as the headline number */
.cabin-tile.total {
  background: linear-gradient(160deg, rgba(46, 196, 182, 0.22), rgba(72, 202, 228, 0.16));
  border-color: rgba(46, 196, 182, 0.5);
}

.cabin-tile.sold-out {
  background: rgba(255, 255, 255, 0.4);
  border-color: rgba(184, 92, 56, 0.3);
}
.cabin-tile.sold-out .cabin-tile-value,
.cabin-tile.sold-out .cabin-tile-label {
  color: #b85c38;
}

@media (max-width: 640px) {
  .cabin-strip-meta { margin-left: 0; width: 100%; justify-content: space-between; }
  .cabin-tile { min-height: 92px; }
  .cabin-tile-value { font-size: 1.7rem; }
}

.cruise-card-cabin:hover {
  background: linear-gradient(160deg, rgba(214, 247, 243, 0.99) 0%, rgba(224, 248, 250, 0.99) 100%);
}

.cruise-card-title {
  color: var(--ocean-deep);
  text-decoration: none;
}
.cruise-card-title:hover {
  color: var(--ocean-mid);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* —— Price history (chart + timeline) —— */
.price-history {
  margin-top: 1.1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(15, 76, 117, 0.12);
}

.price-history-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.65rem;
}

.price-history-title {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ocean-mid);
}

.price-history-count {
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 500;
}

.chart-wrap {
  position: relative;
  height: 140px;
  margin-bottom: 0.85rem;
  padding: 0.35rem 0.15rem;
  border-radius: 12px;
  background: linear-gradient(
    180deg,
    rgba(46, 196, 182, 0.06) 0%,
    rgba(255, 255, 255, 0.4) 100%
  );
  border: 1px solid rgba(46, 196, 182, 0.15);
}

.hist-chart {
  width: 100% !important;
  height: 100% !important;
}

.price-timeline {
  list-style: none;
  margin: 0;
  padding: 0 0 0 0.35rem;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.price-timeline-item {
  display: grid;
  grid-template-columns: 12px 1fr auto;
  gap: 0.55rem;
  align-items: center;
  padding: 0.45rem 0;
  position: relative;
  font-size: 0.88rem;
}

.price-timeline-item:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 5px;
  top: calc(50% + 6px);
  bottom: -50%;
  width: 2px;
  background: linear-gradient(180deg, rgba(46, 196, 182, 0.55), rgba(46, 196, 182, 0.08));
}

.tl-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2ec4b6, #48cae4);
  box-shadow: 0 0 0 3px rgba(46, 196, 182, 0.2);
  z-index: 1;
}

.tl-date {
  color: var(--slate-soft);
  font-weight: 500;
}

.tl-price {
  font-weight: 700;
  color: var(--ocean-deep);
  font-variant-numeric: tabular-nums;
}

.price-history-more {
  margin: 0.5rem 0 0;
  text-align: right;
  font-size: 0.85rem;
}

.price-history-more a {
  color: var(--ocean-mid);
  font-weight: 600;
  text-decoration: none;
}
.price-history-more a:hover { text-decoration: underline; }

.price-history-empty {
  margin: 0.25rem 0 0;
  font-size: 0.88rem;
  color: var(--muted);
  font-style: italic;
}

.cruise-card-footer {
  margin-top: auto;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(15, 76, 117, 0.08);
}

.btn-sm {
  padding: 0.45rem 0.85rem;
  font-size: 0.85rem;
}

.cruise-card-top {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.cruise-card h3 {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.35;
  color: var(--ocean-deep);
  font-weight: 600;
  /* Titles are short source names now, so one line is the norm. The clamp
     still caps a longer future name at two lines rather than letting it
     push that card's price row out of line with the others. */
  min-height: 1.35em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Placeholder keeps the delta row's height when a price hasn't moved */
.delta.flat {
  color: var(--muted);
  opacity: 0.7;
}

.price-row {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 0.5rem;
  margin-bottom: 0.6rem;
}

.label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 0.15rem;
  font-weight: 600;
}

.price {
  font-family: var(--display);
  font-size: 1.85rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ocean-deep);
  line-height: 1.1;
}

.price-sm {
  font-size: 1.1rem;
  font-weight: 650;
  color: var(--slate-soft);
}

.price-sm.low,
.low { color: #0d9488; }

.price-cabin {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ocean-mid);
  margin: -0.15rem 0 0.35rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

tr.row-current td {
  font-weight: 700;
  color: var(--ocean-mid);
}

.delta {
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
}

.delta.down,
.down { color: #0d9488; }
.delta.up { color: #c2410c; }

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

.error-text { color: #b45309; }

/* —— Stats —— */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.85rem;
  margin-bottom: 1.25rem;
}

.stat { margin-bottom: 0; }

.stat .price,
.stat .price-sm {
  color: var(--ocean-deep);
}

/* —— Tables —— */
.table-wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

th, td {
  text-align: left;
  padding: 0.7rem 0.55rem;
  border-bottom: 1px solid rgba(15, 76, 117, 0.1);
  color: var(--slate);
}

th {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

a { color: var(--ocean-mid); }

.breadcrumb { margin: 0 0 0.85rem; }
.breadcrumb a {
  color: rgba(255, 255, 255, 0.92);
  text-decoration: none;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.3);
  font-weight: 500;
}
.breadcrumb a:hover { color: #fff; }

/* —— Settings —— */
.kv {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 0.6rem 1rem;
  margin: 1rem 0 1.5rem;
}

.kv dt { color: var(--muted); font-weight: 500; }
.kv dd { margin: 0; color: var(--slate); }

.howto {
  background: rgba(240, 249, 255, 0.65);
  border-radius: 12px;
  padding: 1rem 1.15rem;
  border: 1px solid rgba(15, 76, 117, 0.12);
  margin-bottom: 1rem;
}

.howto h3 {
  margin-top: 0;
  font-size: 1rem;
  color: var(--ocean-deep);
}

.howto ol { padding-left: 1.2rem; color: var(--muted); }
.howto li { margin-bottom: 0.5rem; }

pre {
  background: rgba(10, 61, 92, 0.06);
  border-radius: 10px;
  padding: 0.75rem 0.9rem;
  overflow-x: auto;
  color: var(--ocean-navy);
  font-size: 0.85rem;
  border: 1px solid rgba(15, 76, 117, 0.12);
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.88em;
  background: rgba(15, 76, 117, 0.08);
  padding: 0.1em 0.35em;
  border-radius: 4px;
  color: var(--ocean-deep);
}

.bullets { color: var(--muted); padding-left: 1.2rem; }
.bullets li { margin-bottom: 0.45rem; }

.danger-zone {
  border-color: rgba(248, 113, 113, 0.35);
  background: rgba(255, 250, 250, 0.85);
}

.empty {
  text-align: center;
  color: var(--muted);
}

/* Chart container polish */
#priceChart {
  max-height: 280px;
}

@media (max-width: 720px) {
  .form-grid,
  .family-intro-card .form-grid {
    grid-template-columns: 1fr;
  }
  .form-grid .span-2 { grid-column: span 1; }
  .family-intro-card .form-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .family-intro-card .form-actions .btn {
    width: 100%;
    justify-content: center;
  }
  .stats { grid-template-columns: 1fr 1fr; }
  .kv { grid-template-columns: 1fr; gap: 0.2rem; }
  .kv dt { margin-top: 0.5rem; }
  .hero {
    flex-direction: column;
    align-items: stretch;
  }
  .hero-title-block {
    max-width: none;
  }
  .hero #check-all-form {
    align-self: flex-start;
  }
  .countdown-unit .num { font-size: 1.45rem; }
  body { background-attachment: scroll; } /* iOS friendly */
}

/* ——— Append to static/style.css AFTER the existing cabin block, i.e. after
   the `@media (max-width: 640px)` rule ending at line 788. Order matters:
   these re-declare `.cabin-strip-body`, `.cabin-tile` and `.cabin-tile.sold-out`
   at equal specificity and must come later to win — including inside the
   earlier media query, since media queries add no specificity.
   `.cabin-tile-value` becomes unused but is harmless to leave. ——— */

/* —— Cabin availability: two sailings, one strip —— */

/* Legend in the strip header — says which number is which sailing once,
   so the per-tile tags can stay tiny. */
.cabin-legend {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--muted);
}
.cabin-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.cabin-legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  display: inline-block;
  flex: none;
}
.cabin-legend-dot.primary { background: var(--turquoise); }
.cabin-legend-dot.compare {
  background: transparent;
  border: 1.5px solid rgba(15, 76, 117, 0.45);
}

/* Tiles hold two numbers now, so they need a little more room. The
   single-sailing fallback drops back to the original 140px. */
.cabin-strip-body {
  grid-template-columns: repeat(auto-fit, minmax(168px, 1fr));
}
.cabin-strip-body.no-compare {
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

/* Fixed three-row grid: label / numbers / caption. Every tile is exactly
   the same height regardless of content — this is what keeps the row from
   going ragged the way it did before. */
.cabin-tile {
  display: grid;
  grid-template-rows: auto 1fr auto;
  grid-template-columns: minmax(0, 1fr);
  justify-content: stretch;
  justify-items: center;
  align-items: center;
  gap: 0.45rem;
  min-height: 132px;
  padding: 0.85rem 0.7rem;
}
.cabin-strip-body.no-compare .cabin-tile { min-height: 116px; }

/* The two numbers, split by a hairline. Equal 1fr columns mean May and Nov
   land on the same x-offset in every tile across the row. */
.cabin-duo {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  width: 100%;
}
.cabin-strip-body.no-compare .cabin-duo { grid-template-columns: 1fr; }

.cabin-num {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1rem;
  padding: 0 0.3rem;
  min-width: 0;
}
.cabin-num.compare { border-left: 1px solid rgba(15, 76, 117, 0.14); }

.cabin-num-tag {
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ocean-mid);
  opacity: 0.75;
  white-space: nowrap;
}

.cabin-num-value {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.85rem;
  line-height: 1.05;
  color: var(--ocean-deep);
  font-variant-numeric: tabular-nums;
}

/* November is reference, not the booking — deliberately quieter. */
.cabin-num.compare .cabin-num-tag { color: var(--muted); }
.cabin-num.compare .cabin-num-value {
  font-size: 1.4rem;
  color: var(--ocean-navy);
  opacity: 0.72;
}

/* Sold out (0) reads rust on whichever side it occurs. */
.cabin-num.zero .cabin-num-value,
.cabin-num.zero .cabin-num-tag {
  color: #b85c38;
  opacity: 1;
}
.cabin-num.compare.zero .cabin-num-value { opacity: 0.85; }

/* Whole-tile wash stays reserved for the sailing we're actually booking. */
.cabin-tile.sold-out {
  background: rgba(255, 255, 255, 0.4);
  border-color: rgba(184, 92, 56, 0.3);
}
.cabin-tile.sold-out .cabin-tile-label { color: #b85c38; }

/* November never returned this category — an em dash in muted grey, so it
   can never be misread as a zero. */
.cabin-num.missing .cabin-num-value {
  font-size: 1.4rem;
  color: var(--muted);
  opacity: 0.45;
}

/* Two-line clamp: a long category name can no longer make one tile taller
   than its neighbours. */
.cabin-tile-sub {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 1.95em;
}

/* Signed gap on the total tile — same colour language as .benchmark-diff. */
.cabin-delta {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.cabin-delta.up { color: #0d6b63; }
.cabin-delta.down { color: #b85c38; }
.cabin-delta.flat { color: var(--muted); }

.cabin-strip-foot {
  margin: 0.85rem 0 0;
  font-size: 0.76rem;
  color: var(--muted);
}

@media (max-width: 640px) {
  .cabin-strip-body { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
  .cabin-strip-body.no-compare { grid-template-columns: repeat(auto-fit, minmax(132px, 1fr)); }
  .cabin-tile { min-height: 120px; }
  .cabin-num-value { font-size: 1.55rem; }
  .cabin-num.compare .cabin-num-value,
  .cabin-num.missing .cabin-num-value { font-size: 1.2rem; }
  .cabin-legend { order: 3; width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .cabin-tile { transition: none; }
  .cabin-tile:hover { transform: none; }
}

/* —— Cabin availability matrix: codes across the top, one row per sailing ——
   A single grid (not one grid per row) so the columns cannot drift out of
   alignment, which is the failure mode the earlier tile layouts kept hitting. */
.cabin-matrix-wrap {
  overflow-x: auto;           /* narrow screens scroll the matrix, not the page */
  margin: 0 -0.25rem;
  padding: 0 0.25rem;
}

.cabin-matrix {
  display: grid;
  grid-template-columns: auto repeat(var(--cabin-cols), minmax(46px, 1fr));
  align-items: stretch;
  gap: 0.4rem;
  min-width: max-content;
}

.cm-corner { content: ""; }

.cm-head,
.cm-label,
.cm-val {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  padding: 0.45rem 0.4rem;
  font-variant-numeric: tabular-nums;
}

.cm-head {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ocean-mid);
  padding-bottom: 0.15rem;
}
.cm-head.total { color: var(--ocean-deep); }

/* Row labels sit left, not centred, so the two sailing names read as a stack */
.cm-label {
  justify-content: flex-start;
  padding-right: 0.85rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ocean-deep);
  white-space: nowrap;
}
.cm-label.compare { color: var(--muted); font-weight: 500; }

.cm-val {
  font-family: var(--display);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--ocean-deep);
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(46, 196, 182, 0.28);
}

.cm-val.total {
  background: linear-gradient(160deg, rgba(46, 196, 182, 0.22), rgba(72, 202, 228, 0.16));
  border-color: rgba(46, 196, 182, 0.5);
}

/* November is reference, not the booking — quieter weight and scale */
.cm-val.compare {
  font-size: 1.2rem;
  color: var(--ocean-navy);
  opacity: 0.78;
  background: rgba(255, 255, 255, 0.5);
}

.cm-val.zero {
  color: #b85c38;
  border-color: rgba(184, 92, 56, 0.35);
  background: rgba(255, 255, 255, 0.4);
}
.cm-val.missing { color: var(--muted); opacity: 0.5; }

.cabin-strip-foot {
  margin: 0.85rem 0 0;
  font-size: 0.82rem;
  color: var(--muted);
}
.cabin-delta { font-weight: 700; font-variant-numeric: tabular-nums; }
.cabin-delta.down { color: #b85c38; }
.cabin-delta.up { color: #0d6b63; }
.cabin-delta.flat { color: var(--muted); }

@media (max-width: 640px) {
  .cm-val { font-size: 1.25rem; }
  .cm-val.compare { font-size: 1.05rem; }
  .cm-label { font-size: 0.72rem; }
}

/* ── Trips home: tropical sunset with swaying palms ────────────────────── */
body.theme-palms {
  background-color: #1d3557;
  background-image:
    radial-gradient(circle at 50% 70%, rgba(255, 226, 154, 0.95) 0, rgba(255, 196, 120, 0.55) 7%, transparent 18%),
    linear-gradient(180deg,
      #1f2b5b 0%, #5b3f8c 22%, #c8587a 42%, #ef8354 56%, #f6b36b 66%,
      #f9d49b 70%, #2a9d8f 70.5%, #1f7a80 84%, #155e69 100%);
}

.palm {
  position: fixed;
  bottom: -8px;
  z-index: 0;
  color: #13233a;
  opacity: 0.88;
  pointer-events: none;
  transform-origin: 54% 100%;
  animation: palm-sway 7s ease-in-out infinite alternate;
}

.palm-left {
  left: -40px;
  height: min(78vh, 720px);
}

.palm-right {
  right: -50px;
  height: min(58vh, 540px);
  animation-duration: 8.5s;
  animation-delay: -3s;
}

@keyframes palm-sway {
  from { transform: rotate(-1.6deg); }
  to   { transform: rotate(1.6deg); }
}

@media (prefers-reduced-motion: reduce) {
  .palm { animation: none; }
}

.home-hero { justify-content: center; text-align: center; }
.home-hero .hero-title-block { margin: 0 auto; flex: 0 1 auto; }
.home-hero .hero-subtitle::after { margin-left: auto; margin-right: auto; }

.trip-tiles {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.4rem;
  max-width: 820px;
  margin: 0.5rem auto 3rem;
}

.trip-tile {
  position: relative;
  display: flex;
  align-items: center;
  gap: 1.4rem;
  min-height: 168px;
  padding: 1.6rem 1.9rem;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  color: #fff;
  text-decoration: none;
  overflow: hidden;
  background-size: cover;
  background-position: center;
  box-shadow: 0 20px 44px rgba(8, 20, 40, 0.35);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* Darken the left side so the words stay readable over the art */
.trip-tile::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(6, 28, 46, 0.72) 0%, rgba(6, 28, 46, 0.35) 55%, rgba(6, 28, 46, 0.1) 100%);
  z-index: 0;
}

.trip-tile > * { position: relative; z-index: 1; }

.trip-tile:hover,
.trip-tile:focus-visible {
  transform: translateY(-4px) scale(1.01);
  box-shadow: 0 26px 56px rgba(8, 20, 40, 0.45);
}

.tile-tahiti { background-image: url("/static/polynesia-bg.jpg"); }

.tile-caribbean { background-image: url("/static/caribbean-bg.jpg"); }


.tile-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 86px;
  height: 86px;
  border-radius: 22px;
  font-size: 2.7rem;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.tile-body {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  min-width: 0;
}

.tile-kicker {
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #bff3ee;
}

.tile-title {
  font-family: var(--display);
  font-size: 2.1rem;
  font-weight: 600;
  line-height: 1.1;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
}

.tile-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.35rem;
}

.tile-chip {
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.35);
}

.tile-go {
  margin-left: auto;
  font-size: 2.6rem;
  line-height: 1;
  opacity: 0.85;
}

@media (max-width: 560px) {
  .trip-tile { gap: 1rem; padding: 1.3rem 1.2rem; min-height: 140px; }
  .tile-icon { width: 64px; height: 64px; font-size: 2rem; border-radius: 18px; }
  .tile-title { font-size: 1.6rem; }
  .palm-left { height: 52vh; left: -70px; }
  .palm-right { height: 40vh; right: -80px; }
}

/* ── Getaways ───────────────────────────────────────────────────────────── */
.getaway-rules {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.9rem 1.2rem;
}

.getaway-rules .rule {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.small { font-size: 0.8rem; }

td.num,
th.num { text-align: right; white-space: nowrap; }

.miss { color: #b45309; }

.card h2 .pill {
  vertical-align: middle;
  margin-left: 0.35rem;
}

/* Cheapest-by-resort grid on Caribbean Getaways: both sites are peers, so
   Koala's row isn't dimmed the way Tahiti's November comparison is */
.resort-matrix {
  grid-template-columns: auto repeat(var(--cabin-cols), minmax(52px, 1fr));
  /* Let long resort names wrap instead of widening every column past the card */
  min-width: min-content;
}

/* Two rental sites, so two equal columns rather than Tahiti's three */
.rental-grid {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.resort-matrix .cm-head {
  font-size: 0.66rem;
  letter-spacing: 0.04em;
  text-align: center;
  line-height: 1.2;
}

.resort-matrix .cm-val,
.resort-matrix .cm-val.compare {
  font-size: 1.15rem;
  opacity: 1;
  color: var(--ocean-deep);
  background: rgba(255, 255, 255, 0.72);
}

.resort-matrix .cm-val.deal {
  color: #0d6b63;
  background: rgba(46, 196, 182, 0.24);
  border-color: rgba(13, 107, 99, 0.5);
}

.resort-matrix .cm-val.missing {
  color: var(--muted);
  opacity: 0.55;
}

/* Four nav links no longer fit beside the brand on a phone */
@media (max-width: 640px) {
  .topbar { padding: 0.65rem 0.75rem; gap: 0.5rem; }
  .brand { white-space: nowrap; font-size: 0.95rem; }
  .brand-sub { display: none; }
  nav { gap: 0.1rem; }
  nav a { padding: 0.4rem 0.55rem; font-size: 0.84rem; }
}

@media (max-width: 400px) {
  .brand-icon { display: none; }
  nav a { padding: 0.35rem 0.45rem; font-size: 0.8rem; }
}

.photo-credit { color: inherit; opacity: 0.8; }
