:root {
  --bg: #0f1226;
  --bg-2: #171a35;
  --card: #1c1f3d;
  --card-2: #262a4d;
  --ink: #eef0ff;
  --muted: #a3a7cc;
  --line: #313663;
  --accent: #ff7a9c;
  --accent-2: #ffd166;
  --good: #58d68d;
  --brand-grad: linear-gradient(120deg, #ff7a9c 0%, #ffd166 100%);
  --radius: 18px;
  --shadow: 0 12px 34px rgba(0, 0, 0, 0.4);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: radial-gradient(1200px 620px at 12% -10%, #2b2660 0%, transparent 60%),
    radial-gradient(1000px 520px at 100% 0%, #3d1f49 0%, transparent 55%), var(--bg);
  min-height: 100vh;
}

/* ---------- top progress bar ---------- */
.progress {
  position: fixed;
  inset: 0 0 auto 0;
  height: 4px;
  z-index: 100;
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}
.progress.active {
  opacity: 1;
}
.progress-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #ff7a9c, #ffd166);
  box-shadow: 0 0 12px rgba(255, 209, 102, 0.7);
  transition: width 0.4s ease;
}
.progress.indeterminate .progress-fill {
  width: 35% !important;
  animation: indet 1.1s ease-in-out infinite;
}
@keyframes indet {
  0% { margin-left: -35%; }
  100% { margin-left: 100%; }
}

/* ---------- top bar ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px clamp(16px, 4vw, 52px);
  gap: 16px;
  flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 16px; }
.heart { font-size: 42px; filter: drop-shadow(0 4px 12px rgba(255, 122, 156, 0.45)); }
.topbar h1 {
  margin: 0;
  font-size: clamp(21px, 3.5vw, 30px);
  background: var(--brand-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.tagline { margin: 3px 0 0; color: var(--muted); font-size: 13.5px; }
.mode-badge {
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 700;
  border: 1px solid var(--line);
  background: var(--card);
  white-space: nowrap;
}
.mode-badge.live { color: var(--good); border-color: rgba(88, 214, 141, 0.4); }
.mode-badge.mock { color: var(--accent-2); border-color: rgba(255, 209, 102, 0.4); }

/* ---------- layout / steps ---------- */
main {
  max-width: 1080px;
  margin: 0 auto;
  padding: 8px clamp(16px, 4vw, 52px) 60px;
}
.step { margin-top: 34px; }
.step-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.step-num {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 15px;
  color: #2a1020;
  background: var(--brand-grad);
  flex-shrink: 0;
}
.step-head h2 { margin: 0; font-size: 20px; }

/* ---------- scenario cards ---------- */
.scenario-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
}
.scenario-card {
  position: relative;
  text-align: left;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 16px;
  cursor: pointer;
  color: var(--ink);
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: transform 0.14s, border-color 0.14s, box-shadow 0.14s;
}
.scenario-card:hover { transform: translateY(-3px); border-color: rgba(255, 122, 156, 0.5); }
.scenario-card.selected {
  border-color: transparent;
  background: linear-gradient(var(--card), var(--card)) padding-box,
    var(--brand-grad) border-box;
  box-shadow: 0 0 0 1px rgba(255, 209, 102, 0.25), 0 14px 30px rgba(255, 122, 156, 0.18);
}
.scenario-card.selected::after {
  content: "✓";
  position: absolute;
  top: 12px;
  right: 14px;
  color: var(--accent-2);
  font-weight: 900;
}
.sc-emoji { font-size: 30px; }
.sc-title { font-weight: 800; font-size: 16px; }
.sc-desc { color: var(--muted); font-size: 12.8px; line-height: 1.4; }

/* ---------- form ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}
label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13.5px;
  color: var(--muted);
  font-weight: 600;
}
label[hidden] { display: none; }
input,
select {
  background: var(--bg-2);
  border: 1px solid var(--line);
  color: var(--ink);
  border-radius: 11px;
  padding: 12px;
  font-size: 15px;
  font-family: inherit;
  transition: 0.15s;
}
input:focus,
select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(255, 122, 156, 0.16);
}
.form-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

/* toggle switch */
.switch {
  flex-direction: row;
  align-items: center;
  gap: 11px;
  cursor: pointer;
  color: var(--ink);
  font-weight: 600;
  user-select: none;
}
.switch input { display: none; }
.switch-track {
  width: 44px;
  height: 25px;
  border-radius: 999px;
  background: var(--card-2);
  border: 1px solid var(--line);
  position: relative;
  transition: 0.18s;
  flex-shrink: 0;
}
.switch-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  background: var(--muted);
  transition: 0.18s;
}
.switch input:checked + .switch-track {
  background: linear-gradient(120deg, rgba(255, 122, 156, 0.9), rgba(255, 209, 102, 0.9));
  border-color: transparent;
}
.switch input:checked + .switch-track .switch-thumb {
  left: 22px;
  background: #2a1020;
}

.go {
  border: none;
  cursor: pointer;
  background: var(--brand-grad);
  color: #2a1020;
  font-weight: 800;
  font-size: 15.5px;
  padding: 14px 30px;
  border-radius: 12px;
  box-shadow: 0 8px 22px rgba(255, 122, 156, 0.32);
  transition: transform 0.12s, box-shadow 0.12s;
}
.go:hover { transform: translateY(-1px); box-shadow: 0 12px 28px rgba(255, 122, 156, 0.42); }
.go:disabled { opacity: 0.6; cursor: wait; }

/* ---------- results ---------- */
.result-area { min-height: 40px; }
.loading { color: var(--muted); padding: 22px; display: flex; align-items: center; gap: 12px; }
.spinner {
  width: 18px; height: 18px;
  border: 3px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.error {
  background: rgba(255, 90, 120, 0.12);
  border: 1px solid rgba(255, 90, 120, 0.4);
  color: #ffc2ce;
  padding: 15px 17px;
  border-radius: 12px;
}
.notice {
  background: rgba(255, 209, 102, 0.12);
  border: 1px solid rgba(255, 209, 102, 0.4);
  color: #ffe6a8;
  padding: 12px 15px;
  border-radius: 12px;
  margin-bottom: 14px;
  font-size: 13.5px;
}

/* price hero */
.hero {
  display: flex;
  align-items: baseline;
  gap: 14px;
  flex-wrap: wrap;
  background: linear-gradient(120deg, rgba(255, 122, 156, 0.1), rgba(255, 209, 102, 0.08));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 22px;
  margin-bottom: 16px;
}
.hero .price {
  font-size: 34px;
  font-weight: 900;
  background: var(--brand-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero .sub { color: var(--muted); font-size: 14px; }

/* flight cards */
.flight {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px 18px;
  margin-bottom: 12px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px 20px;
  align-items: center;
}
.flight.best { border-color: rgba(255, 209, 102, 0.55); box-shadow: 0 0 0 1px rgba(255, 209, 102, 0.28); }
.leg { display: flex; align-items: center; gap: 12px; padding: 6px 0; }
.leg + .leg { border-top: 1px dashed var(--line); }
.route { font-weight: 800; font-size: 15px; letter-spacing: 0.3px; }
.leg-meta { color: var(--muted); font-size: 13px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 5px; }
.chip {
  font-size: 11.5px;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--card-2);
  border: 1px solid var(--line);
  color: var(--muted);
}
.chip.direct { color: var(--good); border-color: rgba(88, 214, 141, 0.4); }
.chip.same-flight { color: #2a1020; background: var(--accent-2); border-color: transparent; font-weight: 800; }
.price-col { text-align: right; }
.price-col .amount { font-size: 22px; font-weight: 800; }
.price-col .airline { color: var(--muted); font-size: 12.5px; }
.book-link {
  display: inline-block;
  margin-top: 6px;
  font-size: 12px;
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px dotted var(--accent);
}

/* timeline */
.timeline { list-style: none; padding: 0; margin: 6px 0 0; }
.timeline li {
  display: flex;
  gap: 14px;
  padding: 12px 0;
  border-left: 2px solid var(--line);
  padding-left: 18px;
  position: relative;
}
.timeline li::before {
  content: "";
  position: absolute;
  left: -7px;
  top: 16px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
}
.timeline .when { color: var(--accent-2); font-weight: 700; min-width: 150px; }

/* breakdown + banners */
.together-banner {
  margin: 14px 0;
  background: linear-gradient(120deg, rgba(255, 209, 102, 0.16), rgba(255, 122, 156, 0.16));
  border: 1px solid rgba(255, 209, 102, 0.4);
  border-radius: 12px;
  padding: 14px 16px;
  font-weight: 600;
  line-height: 1.5;
}
.two-col {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
  margin-top: 16px;
}
.person-card h4 { margin: 0 0 10px; font-size: 15px; color: var(--accent); }
.breakdown { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 14px; }
.breakdown-row { display: flex; justify-content: space-between; gap: 16px; padding: 7px 0; color: var(--muted); }
.breakdown-row.total {
  color: var(--ink);
  font-weight: 800;
  font-size: 18px;
  border-top: 1px dashed var(--line);
  margin-top: 6px;
  padding-top: 12px;
}
.subhead { margin: 20px 0 8px; font-size: 14px; color: var(--muted); font-weight: 700; }

.foot { padding: 24px clamp(16px, 4vw, 52px) 90px; color: var(--muted); font-size: 12.5px; text-align: center; }

/* ---------- live activity console ---------- */
.activity {
  position: fixed;
  inset: auto 0 0 0;
  z-index: 50;
  background: #0b0d1c;
  border-top: 1px solid var(--line);
  box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.45);
  font-family: "Cascadia Code", "SF Mono", Consolas, "Liberation Mono", monospace;
}
.activity-bar { display: flex; align-items: stretch; }
.activity-bar-main {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  background: transparent;
  border: none;
  color: var(--ink);
  padding: 10px 18px;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
}
.activity-dot { width: 9px; height: 9px; border-radius: 50%; background: #4b5075; transition: 0.2s; }
.activity-dot.connected { background: var(--good); box-shadow: 0 0 8px rgba(88, 214, 141, 0.7); }
.activity-dot.busy { background: var(--accent-2); box-shadow: 0 0 8px rgba(255, 209, 102, 0.8); animation: pulse 0.8s infinite; }
@keyframes pulse { 50% { opacity: 0.4; } }
.activity-title { font-weight: 700; letter-spacing: 0.3px; }
.activity-count { background: var(--card-2); color: var(--muted); border-radius: 999px; padding: 1px 9px; font-size: 11.5px; }
.activity-chevron { margin-left: auto; transition: transform 0.2s; color: var(--muted); }
.activity:not(.collapsed) .activity-chevron { transform: rotate(180deg); }
.activity-clear {
  background: transparent;
  border: none;
  border-left: 1px solid var(--line);
  color: var(--muted);
  padding: 0 16px;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
}
.activity-clear:hover { color: var(--ink); }
.activity-log {
  max-height: 42vh;
  overflow-y: auto;
  padding: 8px 18px 14px;
  font-size: 12.5px;
  line-height: 1.7;
  border-top: 1px solid var(--line);
}
.activity.collapsed .activity-log { display: none; }
.activity-line { display: flex; gap: 12px; white-space: pre-wrap; word-break: break-word; }
.activity-line .ts { color: #5a5f85; flex-shrink: 0; }
.activity-line.call .msg { color: #7fb0ff; }
.activity-line.result .msg { color: var(--good); }
.activity-line.error .msg { color: #ff7a90; }
.activity-line.info .msg { color: var(--muted); }
.activity-line.progress .msg { color: var(--accent-2); }
.activity-line .meta { color: #4b5075; }

/* topbar right cluster + pink toggle button */
.topbar-right { display: flex; align-items: center; gap: 10px; }
.pink-btn,
.region-btn {
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  border-radius: 999px;
  padding: 9px 15px;
  font-weight: 800;
  font-size: 12.5px;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.14s, box-shadow 0.14s;
}
.pink-btn:hover,
.region-btn:hover { transform: translateY(-1px) scale(1.03); }
.region-btn { border-color: var(--accent); color: var(--accent); }

/* floating hearts layer (populated only in pink mode) */
#hearts { position: fixed; inset: 0; pointer-events: none; z-index: 40; overflow: hidden; }
.heart-float { position: absolute; bottom: -48px; will-change: transform, opacity; animation: floatup linear forwards; }
@keyframes floatup {
  0% { transform: translateY(0) rotate(0); opacity: 0; }
  10% { opacity: 1; }
  100% { transform: translateY(-112vh) rotate(360deg); opacity: 0; }
}

/* ================================================================= */
/* 🌸💖✨  P I N K   M O D E  ✨💖🌸  — press the button, regret nothing */
/* ================================================================= */
body.pink {
  --bg: #ff8fd0;
  --bg-2: #ffdff2;
  --card: #fff2fb;
  --card-2: #ffe3f5;
  --ink: #7a1152;
  --muted: #c65fa3;
  --line: #ffb3e0;
  --accent: #ff179c;
  --accent-2: #ff6ec7;
  --good: #ff4fa8;
  --brand-grad: linear-gradient(120deg, #ff179c, #ff6ec7, #c86bff, #7ec8ff, #ffd84f);
  background: linear-gradient(120deg, #ffd1ec, #ffc2e8, #ffdff5, #ecc9ff, #ffd1ec);
  background-size: 300% 300%;
  animation: pinkshift 13s ease infinite;
  font-family: "Comic Sans MS", "Segoe Print", "Segoe UI", cursive, sans-serif;
}
@keyframes pinkshift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* rainbow shimmer on the big text */
body.pink .topbar h1,
body.pink .hero .price {
  background-image: linear-gradient(120deg, #ff179c, #ff6ec7, #c86bff, #7ec8ff, #ffd84f, #ff179c);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: rainbow 6s linear infinite;
}
@keyframes rainbow { to { background-position: 200% center; } }

/* the heart mascot goes feral */
body.pink .heart { animation: wiggle 0.7s ease-in-out infinite; }
@keyframes wiggle {
  0%, 100% { transform: rotate(-12deg) scale(1.1); }
  50% { transform: rotate(12deg) scale(1.28); }
}

/* glowy pink cards + sparkly scenario tiles */
body.pink .card,
body.pink .flight,
body.pink .hero,
body.pink .together-banner { box-shadow: 0 12px 32px rgba(255, 23, 156, 0.22); }
body.pink .scenario-card { border-color: #ffb3e0; }
body.pink .scenario-card.selected { box-shadow: 0 0 0 2px #ff179c, 0 16px 34px rgba(255, 23, 156, 0.4); }
body.pink .scenario-card::before {
  content: "✨";
  position: absolute;
  top: 8px;
  left: 11px;
  font-size: 14px;
  animation: twinkle 1.6s ease-in-out infinite;
}
@keyframes twinkle {
  0%, 100% { opacity: 0.35; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1.25); }
}

/* bouncy rainbow buttons */
body.pink .go {
  background: linear-gradient(120deg, #ff179c, #ff6ec7, #c86bff);
  color: #fff;
  animation: bob 1.7s ease-in-out infinite;
}
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
body.pink .pink-btn,
body.pink .region-btn {
  background: linear-gradient(120deg, #ff179c, #ff6ec7);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 6px 18px rgba(255, 23, 156, 0.45);
}
body.pink .mode-badge { border-color: #ff179c; color: #b3106e; }
body.pink .step-num { box-shadow: 0 4px 14px rgba(255, 23, 156, 0.5); }

/* dark bits recoloured for pink mode */
body.pink .activity { background: #4a0f34; border-top-color: #ff6ec7; }
body.pink .activity-line.info .msg { color: #ffb8e2; }
body.pink .activity-line .ts { color: #a45b86; }
body.pink .progress-fill { background: linear-gradient(90deg, #ff179c, #ffd84f, #7ec8ff, #ff6ec7); }
body.pink input:focus,
body.pink select:focus { box-shadow: 0 0 0 3px rgba(255, 23, 156, 0.22); }
