/* Trivili — styles */

:root {
  /* Brand palette */
  --hero-bg: #0d1b2a;
  --cta: #2ecf8f;
  --cta-ink: #06281c;
  --ivory: #f7f5f2;
  --surface: #ffffff;
  --text: #1a1a1a;
  --muted: #7a7a7a;
  --line: #ece8e2;

  /* Data / value colors */
  --excellent: #00c853;
  --good: #80d8ff;
  --average: #ffc107;
  --expensive: #ff5252;

  /* Cash-reliance reuses data colors */
  --cash-high: #ff5252;
  --cash-medium: #ffc107;
  --cash-low: #00c853;

  --shadow: 0 10px 30px rgba(13, 27, 42, 0.10);
  --radius: 16px;

  --font-head: 'Manrope', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
  --font-num: 'IBM Plex Sans', system-ui, sans-serif;

  font-family: var(--font-body);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--text);
  background: var(--ivory);
  line-height: 1.5;
}

h1, h2, h3, h4 { font-family: var(--font-head); }

/* ---------- Hero ---------- */
.hero {
  background:
    radial-gradient(900px 480px at 12% -10%, rgba(46, 207, 143, 0.18) 0%, transparent 60%),
    radial-gradient(800px 460px at 105% 5%, rgba(128, 216, 255, 0.14) 0%, transparent 55%),
    var(--hero-bg);
  color: #fff;
  padding-bottom: 3.5rem;
}

.nav-blog-link {
  margin-left: auto;
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
}

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem clamp(1rem, 4vw, 3rem);
  flex-wrap: wrap;
  background: var(--hero-bg);
  transition: padding 0.25s ease;
}
.nav.scrolled {
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}

.logo {
  height: 56px;
  width: auto;
  display: block;
  transition: height 0.25s ease;
}
.nav.scrolled .logo { height: 40px; }

.hero-inner {
  max-width: 820px;
  margin: 0 auto;
  padding: 1.5rem clamp(1rem, 4vw, 3rem) 0;
  text-align: center;
}

.hero h1 {
  font-weight: 800;
  font-size: clamp(2rem, 5vw, 3.2rem);
  line-height: 1.05;
  margin: 0.5rem 0 0.75rem;
}

.lede {
  color: #c4d2de;
  font-size: clamp(1rem, 2.5vw, 1.2rem);
  max-width: 60ch;
  margin: 0 auto 2rem;
}

/* ---------- Form ---------- */
.budget-form {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  align-items: stretch;
  max-width: 420px;
  margin: 0 auto;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 1.5rem;
  border-radius: var(--radius);
  backdrop-filter: blur(6px);
  text-align: left;
}

.field { text-align: left; }

.field-split { display: flex; gap: 1rem; }
.field-half { flex: 1; min-width: 0; }

.field label {
  display: block;
  font-family: var(--font-head);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: #9fb3c8;
  margin-bottom: 0.4rem;
}

.flight-field {
  margin: -0.15rem 0 0;
}
.flight-field .check-pill {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 0.6rem 0.85rem;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: none;
  letter-spacing: normal;
  color: #c4d2de;
  cursor: pointer;
  margin-bottom: 0;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.check-pill:hover { border-color: rgba(46, 207, 143, 0.5); color: #fff; }
.check-pill input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.check-box {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 5px;
  border: 1.5px solid rgba(255, 255, 255, 0.35);
  color: transparent;
  background: transparent;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.check-pill input:checked + .check-box {
  background: var(--cta);
  border-color: var(--cta);
  color: var(--cta-ink);
}
.check-pill input:focus-visible + .check-box {
  outline: 2px solid var(--cta);
  outline-offset: 2px;
}
.check-pill:has(input:checked) { color: #fff; }

.amount-wrap {
  display: flex;
  align-items: center;
  background: var(--surface);
  border-radius: 10px;
  padding: 0 0.85rem;
}

.currency-prefix {
  color: var(--muted);
  font-family: var(--font-num);
  font-weight: 600;
  margin-right: 0.25rem;
}

#budget {
  border: none;
  outline: none;
  padding: 0.75rem 0.25rem;
  font-size: 1.15rem;
  font-family: var(--font-num);
  width: 100%;
  color: var(--text);
  background: transparent;
}

#trip-vibe {
  border: none;
  outline: none;
  border-radius: 10px;
  padding: 0.8rem 0.85rem;
  font-size: 1rem;
  font-family: var(--font-body);
  color: var(--text);
  background: var(--surface);
  width: 100%;
}

.budget-form select {
  border: none;
  border-radius: 10px;
  padding: 0.8rem 0.85rem;
  font-size: 1rem;
  font-family: var(--font-body);
  background: var(--surface);
  color: var(--text);
  width: 100%;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%237A7A7A' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.9rem center;
  padding-right: 2.2rem;
}

/* ---------- Custom country picker ---------- */
.country-picker {
  position: relative;
}
.country-trigger {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  border: none;
  border-radius: 10px;
  padding: 0.8rem 0.85rem;
  font-size: 1rem;
  font-family: var(--font-body);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  text-align: left;
}
.country-trigger:hover { background: #f0f0f0; }
.country-trigger .chev { margin-left: auto; flex-shrink: 0; color: #7a7a7a; }
.country-picker[aria-expanded="true"] .chev { transform: rotate(180deg); }
.country-trigger-flag { width: 1.25em; height: 1em; border-radius: 2px; flex-shrink: 0; background-size: cover; }
.country-trigger-text { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.country-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.18);
  z-index: 100;
  overflow: hidden;
}
.country-search-wrap { padding: 0.5rem 0.5rem 0.25rem; }
.country-search {
  width: 100%;
  box-sizing: border-box;
  border: 1.5px solid #e0e0e0;
  border-radius: 6px;
  padding: 0.45rem 0.7rem;
  font-size: 0.9rem;
  font-family: var(--font-body);
  color: #1a1a1a;
  background: #fafafa;
  outline: none;
}
.country-search:focus { border-color: var(--accent); }
.country-list {
  list-style: none;
  margin: 0;
  padding: 0 0 0.35rem;
  max-height: 220px;
  overflow-y: auto;
}
.country-option {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.5rem 0.85rem;
  cursor: pointer;
  font-size: 0.95rem;
  color: #1a1a1a;
}
.country-option:hover, .country-option[aria-selected="true"] { background: #f5f5f5; }
.country-option[aria-selected="true"] { font-weight: 600; }
.country-option .fi { width: 1.25em; height: 1em; border-radius: 2px; flex-shrink: 0; }
.country-option-name { flex: 1; }
.country-option-currency { color: #888; font-size: 0.82rem; }

.date-range {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--surface);
  border-radius: 10px;
  padding: 0 0.5rem;
}
.date-range input[type="date"] {
  border: none;
  outline: none;
  padding: 0.75rem 0.25rem;
  font-size: 0.95rem;
  font-family: var(--font-body);
  color: var(--text);
  background: transparent;
  width: 100%;
  min-width: 0;
  cursor: pointer;
}
.date-range input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(0.6);
  cursor: pointer;
}
.date-sep {
  color: var(--muted);
  flex: 0 0 auto;
}
.trip-dates-help { margin: 0.4rem 0 0; font-size: 0.78rem; }

.mode-toggle {
  display: flex;
  gap: 0.5rem;
}
.mode-tab {
  flex: 1;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: #c4d2de;
  border-radius: 10px;
  padding: 0.7rem 0.85rem;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.mode-tab:hover { border-color: rgba(46, 207, 143, 0.5); color: #fff; }
.mode-tab.active {
  background: var(--cta);
  border-color: var(--cta);
  color: var(--cta-ink);
}
.mode-help { margin: 0.4rem 0 0; font-size: 0.78rem; }

.go-btn {
  border: none;
  background: var(--cta);
  color: var(--cta-ink);
  font-family: var(--font-head);
  font-size: 1.02rem;
  font-weight: 800;
  padding: 0.85rem 1.4rem;
  border-radius: 10px;
  cursor: pointer;
  margin-top: 0.35rem;
  transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.12s ease;
  box-shadow: 0 8px 22px rgba(46, 207, 143, 0.35);
}
.go-btn:hover { transform: translateY(-1px); filter: brightness(1.05); }
.go-btn:active { transform: translateY(0); }

/* ---------- Advanced spending-mix sliders ---------- */
.advanced {
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  margin-top: 0.25rem;
}
.advanced-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  list-style: none;
  cursor: pointer;
  font-family: var(--font-head);
  font-size: 0.85rem;
  font-weight: 700;
  color: #c4d2de;
  padding: 0.65rem 0.1rem;
}
.advanced-summary::-webkit-details-marker { display: none; }
.advanced-summary .chev { stroke: #c4d2de; transition: transform 0.15s ease; flex: 0 0 auto; }
.advanced[open] > .advanced-summary .chev { transform: rotate(180deg); }
.advanced-summary:hover { color: #fff; }
.advanced-summary:hover .chev { stroke: #fff; }

.alloc-sliders {
  display: grid;
  gap: 0.9rem;
  padding: 0.4rem 0.1rem 0.25rem;
}
.alloc-label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 0.82rem;
  color: #c4d2de;
  margin-bottom: 0.35rem;
}
.alloc-label label { font-weight: 600; }
.alloc-num-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  padding: 0.15rem 0.5rem;
}
.alloc-number {
  width: 2.6rem;
  border: none;
  background: transparent;
  color: var(--cta);
  font-family: var(--font-num);
  font-weight: 700;
  font-size: 0.9rem;
  text-align: right;
  padding: 0.15rem 0;
  appearance: textfield;
  -moz-appearance: textfield;
}
.alloc-number::-webkit-outer-spin-button,
.alloc-number::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.alloc-number:focus { outline: none; }
.alloc-num-wrap:focus-within { border-color: var(--cta); }
.alloc-pct-sign {
  font-family: var(--font-num);
  font-weight: 700;
  color: var(--cta);
  font-size: 0.9rem;
}
.alloc-range {
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  cursor: pointer;
  outline-offset: 4px;
}
.alloc-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--cta);
  border: 3px solid var(--hero-bg);
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}
.alloc-range::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--cta);
  border: 3px solid var(--hero-bg);
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}
.alloc-range::-moz-range-track { background: rgba(255, 255, 255, 0.18); height: 6px; border-radius: 999px; }
.alloc-help { color: #9fb3c8; font-size: 0.78rem; margin: 0.5rem 0 0; }

.form-help { color: #9fb3c8; font-size: 0.85rem; margin: 0.9rem 0 0; }
.trip-vibe-help { margin: 0.4rem 0 0; font-size: 0.78rem; }
.form-error {
  color: #ffd7d7;
  border-left: 3px solid rgba(255, 82, 82, 0.6);
  padding: 0 0 0 0.6rem;
  margin: 0.9rem 0 0;
  font-size: 0.85rem;
}

/* ---------- Top picks tab toggle ---------- */
.picks-toggle {
  grid-column: 1 / -1;
  display: flex;
  gap: 0.3rem;
  margin: 0 0 1rem;
  background: rgba(0, 0, 0, 0.05);
  border-radius: 12px;
  padding: 0.3rem;
}
.picks-tab {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--muted);
  border-radius: 9px;
  padding: 0.65rem 0.85rem;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.picks-tab:hover { color: var(--text); }
.picks-tab.active {
  background: var(--cta);
  color: var(--cta-ink);
}

/* ---------- Top picks loading / empty states ---------- */
@keyframes skel-shimmer {
  0%   { background-position: -400px 0; }
  100% { background-position:  400px 0; }
}

/* Trivili runway loading animation — plane takes off left→right through chevrons */
/*
  Animation timeline (5s loop):
  0–5%   : appear bottom-left (fade in)
  5–20%  : taxi right along runway
  20–38% : rotate nose up, begin climb
  38–60% : climb through chevrons top-right
  60–68% : exit frame (fade out)
  68–100%: invisible, reset to start
*/
@keyframes rwy-flight {
  0%   { transform: translate( -8px, 99px) rotate(0deg);   opacity: 0; }
  5%   { transform: translate(  8px, 99px) rotate(0deg);   opacity: 1; }
  20%  { transform: translate( 55px, 99px) rotate(0deg);   opacity: 1; }
  32%  { transform: translate( 80px, 80px) rotate(-12deg); opacity: 1; }
  45%  { transform: translate(115px, 42px) rotate(-20deg); opacity: 1; }
  58%  { transform: translate(155px,  4px) rotate(-26deg); opacity: 1; }
  66%  { opacity: 0; }
  100% { transform: translate( -8px, 99px) rotate(0deg);   opacity: 0; }
}
.picks-runway-loading {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2.5rem 1rem 3rem;
  gap: 1rem;
}
.rwy-scene { overflow: hidden; }
.rwy-svg { width: 200px; height: 145px; display: block; }
.rwy-mark {
  fill: var(--cta);
  opacity: 0.22;
}
.rwy-bar {
  fill: var(--cta);
  opacity: 0.45;
}
.rwy-plane {
  color: var(--cta);
  transform-origin: 16px 8px; /* rotate around fuselage center */
  animation: rwy-flight 5s cubic-bezier(0.4,0,0.6,1) infinite;
}
.rwy-label {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0;
  letter-spacing: 0.02em;
}

/* ---------- Results ---------- */
.results {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem clamp(1rem, 4vw, 3rem) 3rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.25rem;
}

.results-intro {
  grid-column: 1 / -1;
  background: transparent;
  text-align: center;
  color: var(--muted);
}
.results-intro h2 {
  color: var(--text);
  margin: 0 0 0.25rem;
  font-size: 1.35rem;
}
.results-intro .highlight { color: var(--cta-ink); background: var(--cta); padding: 0 0.3rem; border-radius: 6px; font-weight: 800; }
.results-intro .inline-flag { font-size: 1.35rem; vertical-align: -0.15em; }

.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--muted);
  padding: 3rem 1rem;
}

/* ---------- Card ---------- */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  border: 1px solid var(--line);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.card-image {
  margin: -1.25rem -1.25rem 0;
  border-radius: var(--radius) var(--radius) 0 0;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: rgba(13, 27, 42, 0.05);
}
.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.4s ease;
}
.card-image img.loaded { opacity: 1; }
.card-image-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: linear-gradient(135deg, rgba(13, 27, 42, 0.08), rgba(13, 27, 42, 0.03));
  color: var(--muted);
}
.card-image-fallback-flag { width: 36px; height: 27px; border-radius: 4px; box-shadow: 0 0 0 1px rgba(0,0,0,0.08); }
.card:hover .card-image img { transform: scale(1.05); }
@media (prefers-reduced-motion: reduce) {
  .card-image img { transition: none; opacity: 1; }
  .card:hover .card-image img { transform: none; }
}
.card:hover, .card:focus-within {
  transform: translateY(-3px);
  box-shadow: 0 16px 38px rgba(13, 27, 42, 0.16);
  border-color: rgba(46, 207, 143, 0.45);
  outline: none;
}
.card:active { transform: translateY(-1px) scale(0.995); }

.pick-blurb {
  margin: -0.25rem -0.25rem 0.75rem;
  padding: 0.5rem 0.75rem;
  background: rgba(46, 207, 143, 0.12);
  border: 1px solid rgba(46, 207, 143, 0.35);
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
}

.card.best { border-color: var(--cta); box-shadow: 0 16px 38px rgba(46, 207, 143, 0.25); }

.card-head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  column-gap: 0.75rem;
  row-gap: 0.3rem;
  align-items: center;
}
.flag {
  font-size: 2rem;
  line-height: 1;
  grid-column: 1;
  grid-row: 1 / span 2;
  align-self: center;
  border-radius: 4px;
  box-shadow: 0 0 0 1px var(--line);
  background-size: cover;
}
.card-title { grid-column: 2; grid-row: 1 / span 2; align-self: center; min-width: 0; }
.card-title h3 { margin: 0; font-size: 1.08rem; font-weight: 700; }
.region { color: var(--muted); font-size: 0.75rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.verdict-badge { grid-column: 3; align-self: end; }
.value-badge { grid-column: 3; align-self: start; }

.value-badge {
  font-family: var(--font-head);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  white-space: nowrap;
}
.value-badge.excellent { background: rgba(0, 200, 83, 0.15); color: #00853a; }
.value-badge.good { background: rgba(128, 216, 255, 0.25); color: #0a6f99; }
.value-badge.average { background: rgba(255, 193, 7, 0.2); color: #9a6b00; }
.value-badge.expensive { background: rgba(255, 82, 82, 0.15); color: #c0392b; }

.local-line, .trip-line, .runway-line { margin: 0; color: var(--muted); font-size: 0.85rem; }
.local-line strong, .trip-line strong, .runway-line strong { color: var(--text); font-family: var(--font-num); font-weight: 600; }
.trip-line.surplus strong.amount { color: #00853a; }
.trip-line.shortfall strong.amount { color: #c0392b; }

.verdict-badge {
  font-family: var(--font-head);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  white-space: nowrap;
}
.verdict-badge.affordable { background: rgba(0, 200, 83, 0.15); color: #00853a; }
.verdict-badge.over-budget { background: rgba(255, 82, 82, 0.15); color: #c0392b; }

/* Expand/collapse toggle */
.card-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  align-self: flex-start;
  background: none;
  border: none;
  padding: 0.15rem 0;
  margin: -0.3rem 0 -0.35rem;
  font-family: var(--font-head);
  font-size: 0.85rem;
  font-weight: 700;
  color: #0a6f99;
  cursor: pointer;
  transition: color 0.15s ease;
}
.card-toggle:hover, .card-toggle:focus-visible { color: var(--cta-ink); }
.card-toggle .chev { stroke: currentColor; transition: transform 0.25s ease; flex: 0 0 auto; }
.card.expanded .card-toggle .chev { transform: rotate(180deg); }

.card-details {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.35s ease, opacity 0.25s ease;
}
.card.expanded .card-details {
  opacity: 1;
}
@media (prefers-reduced-motion: reduce) {
  .card-details { transition: none; }
  .card-toggle .chev { transition: none; }
}

/* Key highlights (replaces scenario bars) */
.highlights { display: flex; flex-wrap: wrap; gap: 0.4rem; }

/* Two-group pill layout in expanded card */
.pill-groups { display: flex; flex-direction: column; gap: 0.75rem; margin-bottom: 0.5rem; }
.pill-group-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin: 0 0 0.35rem;
}
.pill-group-pills { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.highlight-tag {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: rgba(46, 207, 143, 0.12);
  color: #00853a;
  border: 1px solid rgba(46, 207, 143, 0.3);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.highlight-tag:hover { background: rgba(46, 207, 143, 0.25); }
.highlight-tag.selected {
  background: rgba(46, 207, 143, 0.85);
  color: #fff;
  border-color: #00853a;
}

/* Vibe pills on card face */
.vibe-tags { display: flex; flex-wrap: wrap; gap: 0.3rem; margin: 0.5rem 0 0.1rem; }
.vibe-pill {
  font-size: 0.65rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--muted);
  white-space: nowrap;
}
/* Selectable vibe pills in expanded section */
button.vibe-pill {
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
button.vibe-pill:hover { border-color: #aaa; color: #555; }
button.vibe-pill.selected {
  background: #555;
  color: #fff;
  border-color: #555;
}

/* Vibe filter bar */
.vibe-filter-bar {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0 0 0.75rem;
}
.vibe-filter-btn {
  font-family: var(--font-head);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  border: 1.5px solid var(--line);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.15s;
}
.vibe-filter-btn:hover { border-color: var(--cta); color: var(--cta); }
.vibe-filter-btn.active { background: var(--cta); border-color: var(--cta); color: #fff; }
.filter-empty { grid-column: 1 / -1; text-align: center; color: var(--muted); padding: 2rem 0; }

/* What it buys */
.buys h4, .cash strong { font-size: 0.8rem; font-family: var(--font-head); }
.buys h4 { margin: 0.25rem 0 0.15rem; }
.buys-note { font-size: 0.7rem; color: var(--muted); margin: 0 0 0.5rem; }
.buys ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.3rem;
}
.buys li {
  font-size: 0.88rem;
  display: flex;
  gap: 0.5rem;
  align-items: baseline;
}
.buys li .q { font-family: var(--font-num); font-weight: 700; color: #0a6f99; min-width: 2.5rem; }

/* Daily cost breakdown rows */
.buys-daily-row {
  display: grid;
  grid-template-columns: 1.4rem 1fr auto;
  align-items: center;
  gap: 0.4rem;
  padding: 0.18rem 0;
}
.buys-icon { font-size: 0.9rem; }
.buys-label { font-size: 0.83rem; color: var(--muted); }
.buys-val { font-family: var(--font-num); font-weight: 600; font-size: 0.83rem; text-align: right; }
.buys-daily-total {
  display: grid;
  grid-template-columns: 1.4rem 1fr auto;
  gap: 0.4rem;
  align-items: center;
  border-top: 1.5px solid #e8e8e8;
  margin-top: 0.3rem;
  padding-top: 0.35rem;
  font-weight: 700;
  font-size: 0.9rem;
}
.buys-daily-total .buys-val { font-size: 0.85rem; color: var(--accent); }
.buys-divider {
  display: block;
  margin: 0.75rem 0 0.35rem;
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border: none;
  padding: 0;
}
.buys-divider span { display: block; }

/* AI itinerary button */
.itinerary-btn {
  margin-top: 1.1rem;
  width: 100%;
  padding: 0.8rem 1rem;
  border: none;
  border-radius: 8px;
  background: var(--cta);
  color: #fff;
  box-shadow: 0 2px 10px rgba(0,0,0,0.18);
  font-size: 0.9rem;
  font-family: var(--font-body);
  white-space: normal;
  word-break: break-word;
  text-align: center;
  line-height: 1.4;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}
.itinerary-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(0,0,0,0.24); }
.itinerary-btn:active { transform: translateY(0); }

/* Itinerary modal */
.itin-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 200;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 2rem 1rem;
  overflow-y: auto;
}
.itin-overlay[hidden] { display: none; }
.itin-panel {
  background: #fff;
  border-radius: 14px;
  width: 100%;
  max-width: 680px;
  max-height: calc(100vh - 4rem);
  box-shadow: 0 16px 48px rgba(0,0,0,0.22);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.itin-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 1.5rem 1rem;
  border-bottom: 1px solid #eee;
}
.itin-title { font-size: 1.15rem; font-family: var(--font-head); margin: 0 0 0.2rem; color: #1a1a1a; }
.itin-meta { font-size: 0.8rem; color: var(--muted); margin: 0; }
.itin-close {
  flex-shrink: 0;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.25rem;
  color: var(--muted);
  border-radius: 6px;
}
.itin-close:hover { background: #f0f0f0; }
.itin-body { padding: 1.25rem 1.5rem 1.5rem; display: flex; flex-direction: column; gap: 0.85rem; overflow-y: auto; flex: 1 1 auto; }
.itin-book {
  flex-shrink: 0;
  padding: 0.75rem 1.5rem;
  border-top: 1px solid #eee;
  background: #fff;
}
.itin-loading { text-align: center; padding: 2.5rem 0; color: var(--muted); }
.itin-spinner {
  width: 32px; height: 32px;
  border: 3px solid #e0e0e0;
  border-top-color: var(--accent);
  border-radius: 50%;
  margin: 0 auto 0.75rem;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.itin-error { color: var(--muted); font-size: 0.9rem; text-align: center; padding: 1rem 0; }
.itin-travel-note {
  background: #fffbea;
  border: 1px solid #f0d060;
  border-radius: 8px;
  padding: 0.65rem 0.9rem;
  font-size: 0.85rem;
  color: #7a5c00;
  line-height: 1.5;
}
.itin-day {
  border: 1px solid #eee;
  border-radius: 10px;
  padding: 0.85rem 1rem;
}
.itin-day-head {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  margin-bottom: 0.6rem;
  flex-wrap: wrap;
}
.itin-day-title { color: var(--muted); font-size: 0.9rem; flex: 1; }
.itin-day-cost {
  font-family: var(--font-num);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent);
  background: rgba(30,190,150,0.1);
  border-radius: 20px;
  padding: 0.1rem 0.55rem;
  margin-left: auto;
}
.itin-slot { display: flex; gap: 0.6rem; font-size: 0.88rem; padding: 0.2rem 0; }
.itin-slot-label {
  min-width: 5.5rem;
  font-weight: 600;
  color: var(--muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding-top: 0.05rem;
}
.itin-slot-text { flex: 1; color: #333; line-height: 1.5; }

/* Cash advisory */
.cash {
  display: flex;
  gap: 0.5rem;
  background: var(--ivory);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.5rem 0.65rem;
  margin-top: auto;
  align-items: flex-start;
}
.cash-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  margin-top: 0.35rem;
  flex: 0 0 auto;
}
.cash-dot.high { background: var(--cash-high); }
.cash-dot.medium { background: var(--cash-medium); }
.cash-dot.low { background: var(--cash-low); }
.cash-body strong { display: block; margin-bottom: 0.1rem; font-size: 0.75rem; }
.cash-body p { margin: 0; font-size: 0.7rem; color: var(--muted); line-height: 1.4; }

/* Affiliate book links */
.book {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding-top: 0.25rem;
}
.book-label {
  font-family: var(--font-head);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.book-links { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.book-link {
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  color: #0a6f99;
  background: rgba(128, 216, 255, 0.18);
  border: 1px solid rgba(128, 216, 255, 0.4);
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  transition: background 0.12s ease, transform 0.12s ease;
}
.book-link:hover { background: var(--cta); color: var(--cta-ink); border-color: var(--cta); transform: translateY(-1px); }

/* ---------- Footer ---------- */
@media (max-width: 520px) {
  .budget-form { padding: 1.1rem; }

  .highlight-tag { font-size: 0.65rem; padding: 0.18rem 0.5rem; }
  .vibe-pill { font-size: 0.6rem; padding: 0.12rem 0.45rem; }
  .pill-group-label { font-size: 0.64rem; }
  .pill-group-pills, .vibe-tags { gap: 0.25rem; }

  /* ponytail: carousel via scroll-snap, no JS/library needed */
  .results {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding-left: 1rem;
    padding-right: 1rem;
  }
  .results-intro, .empty-state { flex: 0 0 100%; }
  .card {
    flex: 0 0 88vw;
    scroll-snap-align: center;
  }

  .carousel-dots {
    display: flex;
    justify-content: center;
    gap: 0.4rem;
    padding-bottom: 1.5rem;
  }
  .carousel-dots .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.25);
    transition: background 0.2s ease, transform 0.2s ease;
  }
  .carousel-dots .dot.active {
    background: var(--cta, #fff);
    transform: scale(1.3);
  }
}

@media (min-width: 521px) {
  .carousel-dots { display: none; }
}
