*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #F7F4EF;
  --surface: #ffffff;
  --border: #E3DDD4;
  --text: #2E2A24;
  --muted: #8B8178;
  --accent: #6B8F71;
  --accent-blue: #7A9E9F;
  --accent-light: #EBF2EC;
  --success: #5A8F6E;
  --success-light: #EBF2EC;
  --danger: #C0614A;
  --radius: 10px;
  --shadow: 0 2px 14px rgba(60,45,30,0.09);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
}

/* ── Nav ── */
nav {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 28px;
  height: 58px;
}

nav .brand {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--accent);
  text-decoration: none;
  letter-spacing: -0.3px;
}

nav a {
  text-decoration: none;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.15s;
}

nav a:hover { color: var(--text); }
nav a.active { color: var(--accent); }

/* ── Layout ── */
.container {
  max-width: 860px;
  margin: 0 auto;
  padding: 36px 24px;
}

/* ── Page header ── */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
}

.page-header h1 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.4px;
}

/* ── Cards ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px 24px;
  margin-bottom: 16px;
}

.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 14px;
}

.card-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
}

.card-sub {
  font-size: 0.82rem;
  color: var(--muted);
  margin-top: 2px;
}

/* ── Progress bar ── */
.progress-wrap {
  margin-top: 14px;
}

.progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 6px;
}

.progress-label .pct {
  font-weight: 700;
  color: var(--accent);
}

.progress-bar-bg {
  background: var(--accent-light);
  border-radius: 99px;
  height: 8px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--accent), #7eb3f7);
  transition: width 0.4s ease;
}

.progress-bar-fill.complete {
  background: linear-gradient(90deg, var(--success), #6cefb5);
}

/* ── Amount pill ── */
.amounts {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.pill {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 99px;
  padding: 4px 12px;
  font-size: 0.8rem;
  color: var(--muted);
}

.pill span {
  font-weight: 700;
  color: var(--text);
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: opacity 0.15s, transform 0.1s;
}

.btn:hover { opacity: 0.88; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-success {
  background: var(--success);
  color: #fff;
}

.btn-ghost {
  background: var(--bg);
  color: var(--muted);
  border: 1px solid var(--border);
}

.btn-danger {
  background: #fff0f0;
  color: var(--danger);
  border: 1px solid #f9d0d0;
}

.btn-sm {
  padding: 6px 13px;
  font-size: 0.82rem;
}

/* ── Forms ── */
.form-group {
  margin-bottom: 18px;
}

label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

input[type="text"],
input[type="number"] {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 0.9rem;
  background: var(--bg);
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
}

input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(107,143,113,0.14);
  background: #fff;
}

/* ── Narrative section ── */
.narrative-section {
  padding: 28px 32px;
}

.narrative-header {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 22px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.narrative-badge {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-light);
  padding: 4px 10px;
  border-radius: 20px;
  white-space: nowrap;
}

.narrative-subline {
  font-size: 0.82rem;
  color: var(--muted);
  margin: 0;
}

.narrative-body h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--accent);
  margin: 28px 0 10px;
}

.narrative-body h2:first-child {
  margin-top: 0;
}

.narrative-body h3 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  margin: 18px 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.narrative-body p {
  font-size: 0.9rem;
  line-height: 1.75;
  color: var(--text);
  margin: 0 0 12px;
}

.narrative-body ul {
  margin: 0 0 14px 0;
  padding-left: 20px;
}

.narrative-body li {
  font-size: 0.88rem;
  line-height: 1.7;
  color: var(--text);
  margin-bottom: 4px;
}

.narrative-body strong {
  font-weight: 700;
  color: var(--text);
}

.narrative-body hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 28px 0;
}

/* ── Destination mode toggle ── */
.dest-mode-toggle {
  display: flex;
  gap: 10px;
}

.dest-mode-option {
  display: flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  font-weight: 400;
  font-size: 0.88rem;
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--bg);
  color: var(--muted);
  transition: border-color 0.15s, background 0.15s, color 0.15s;
  user-select: none;
}

.dest-mode-option input[type="radio"] {
  accent-color: var(--accent);
  width: 14px;
  height: 14px;
  cursor: pointer;
}

.dest-mode-option:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-light);
  color: var(--text);
  font-weight: 600;
}

/* ── Multi-destination rows ── */
.destination-row {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
  align-items: center;
}

.destination-row input[type="text"] {
  flex: 3;
}

.destination-row input[type="number"] {
  flex: 1;
  min-width: 80px;
}

.error-msg {
  background: #fff0f0;
  border: 1px solid #f9d0d0;
  border-radius: 10px;
  color: var(--danger);
  padding: 10px 14px;
  font-size: 0.85rem;
  margin-bottom: 18px;
}

/* ── Inline form (add price / update savings) ── */
.inline-form {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  flex-wrap: wrap;
}

.inline-form .form-group {
  margin: 0;
  flex: 1;
  min-width: 140px;
}

/* ── Trip detail sections ── */
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}

@media (max-width: 540px) {
  .detail-grid { grid-template-columns: 1fr; }
}

.stat-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 18px;
}

.stat-label {
  font-size: 0.78rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
  margin-bottom: 4px;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.5px;
}

.stat-value.accent { color: var(--accent); }
.stat-value.success { color: var(--success); }

/* ── Trend ── */
.trend-box {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 18px;
  font-size: 0.88rem;
  color: var(--text);
  margin-bottom: 16px;
  word-break: break-word;
}

.trend-label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 6px;
}

.trend-value {
  font-weight: 600;
  color: var(--text);
}

.latest-badge {
  display: inline-block;
  background: var(--success-light);
  color: var(--success);
  border-radius: 99px;
  padding: 3px 10px;
  font-size: 0.8rem;
  font-weight: 700;
  margin-bottom: 8px;
}

/* ── Empty state ── */
.empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
}

.empty h2 {
  font-size: 1.1rem;
  margin-bottom: 8px;
  color: var(--text);
}

.empty p {
  font-size: 0.9rem;
  margin-bottom: 20px;
}

/* ── Back link ── */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 20px;
  transition: color 0.15s;
}

.back-link:hover { color: var(--text); }

/* ── Section title ── */
.section-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 12px;
  margin-top: 24px;
}

/* ── Delete form ── */
.delete-area {
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

/* ── Landing page hero ── */
.landing-hero {
  text-align: center;
  padding: 48px 24px 28px;
}

.landing-title {
  font-size: 1.65rem;
  font-weight: 800;
  letter-spacing: -0.4px;
  color: var(--text);
  margin-bottom: 10px;
}

.landing-tagline {
  font-size: 1rem;
  color: var(--accent);
  font-weight: 600;
  letter-spacing: 0.2px;
  margin-bottom: 16px;
}

.landing-intro {
  font-size: 0.92rem;
  color: var(--muted);
  line-height: 1.7;
  max-width: 600px;
  margin: 0 auto 24px;
}

.landing-divider {
  width: 48px;
  height: 3px;
  background: var(--accent);
  border-radius: 99px;
  margin: 0 auto 24px;
  opacity: 0.6;
}

.landing-form-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.3px;
  margin-bottom: 4px;
}

.landing-sub {
  font-size: 0.92rem;
  color: var(--muted);
  font-weight: 400;
  margin-bottom: 0;
}

/* ── Landing card: slightly wider, more generous padding ── */
.landing-card {
  max-width: 680px;
  margin-left: auto;
  margin-right: auto;
  padding: 32px 36px;
  border-radius: 12px;
  box-shadow: 0 4px 24px rgba(60,45,30,0.10);
}

/* ── Nav: warm brand styling ── */
nav .brand {
  color: var(--accent);
}

nav a.active {
  color: var(--accent);
}

/* ── Accent button: green ── */
.btn-primary {
  background: var(--accent);
  color: #fff;
}

/* ── Info hint card below planner form ── */
.hint-card {
  max-width: 680px;
  margin-left: auto;
  margin-right: auto;
}

/* ── Studio generation loading overlay ── */
.gvs-loading-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(247, 244, 239, 0.92);
  backdrop-filter: blur(4px);
  z-index: 9999;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
}
.gvs-loading-overlay.active {
  display: flex;
}
.gvs-spinner {
  width: 44px;
  height: 44px;
  border: 4px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: gvs-spin 0.8s linear infinite;
}
@keyframes gvs-spin {
  to { transform: rotate(360deg); }
}
.gvs-loading-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.2px;
}
.gvs-loading-sub {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: -12px;
}

/* ── Access Code Gate overlay ─────────────────────────────────────────────── */
.gvs-gate-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.gvs-gate-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: 0 8px 40px rgba(60,45,30,0.13);
  padding: 48px 44px 40px;
  max-width: 480px;
  width: 100%;
  text-align: center;
}

.gvs-gate-logo {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 24px;
}

.gvs-gate-title {
  font-size: 1.65rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.5px;
  margin-bottom: 12px;
  line-height: 1.2;
}

.gvs-gate-sub {
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 28px;
  line-height: 1.5;
}

.gvs-gate-input-row {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
}

.gvs-gate-input {
  flex: 1;
  padding: 11px 14px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-size: 0.9rem;
  font-family: inherit;
  background: var(--bg);
  color: var(--text);
  outline: none;
  transition: border-color 0.15s;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.gvs-gate-input:focus { border-color: var(--accent); }
.gvs-gate-input--error { border-color: var(--danger) !important; }

.gvs-gate-btn {
  white-space: nowrap;
  flex-shrink: 0;
}

.gvs-gate-error {
  font-size: 0.83rem;
  color: var(--danger);
  margin-bottom: 14px;
  min-height: 1.2em;
}

.gvs-gate-note {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 20px;
  line-height: 1.5;
  border-top: 1px solid var(--border);
  padding-top: 16px;
}
