/* Padelnomics Planner — scoped under .planner-app */
/* Court Tech brand — Light theme */

.planner-app {
  --bg: #F8FAFC;
  --bg-2: #FFFFFF;
  --bg-3: #F1F5F9;
  --bg-4: #E2E8F0;
  --border: #E2E8F0;
  --border-2: #CBD5E1;
  --txt: #475569;
  --txt-2: #64748B;
  --txt-3: #94A3B8;
  --head: #0F172A;
  --wht: #0F172A;
  --rd: #1D4ED8;
  --rd-bg: rgba(29,78,216,0.06);
  --gn: #16A34A;
  --gn-bg: rgba(22,163,74,0.06);
  --bl: #1D4ED8;
  --bl-bg: rgba(29,78,216,0.06);
  --am: #D97706;
  --am-bg: rgba(217,119,6,0.06);
  --cta: #1D4ED8;
  --cta-hover: #1E40AF;
  --cta-shadow: rgba(29,78,216,0.25);
  --cta-bg: #EFF6FF;
  --cta-glow: rgba(29,78,216,0.10);

  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  color: var(--txt);
  background: var(--bg);
  min-height: 100vh;
  max-width: 72rem;
  margin: 0 auto;
}

/* Scrollbar */
.planner-app ::-webkit-scrollbar { width: 5px; }
.planner-app ::-webkit-scrollbar-track { background: transparent; }
.planner-app ::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.12); border-radius: 3px; }

/* ── Header ── */
.planner-header {
  position: relative;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-2);
  display: flex;
  align-items: center;
  gap: 1rem;
}
.planner-header h1 {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 1.125rem;
  font-weight: 800;
  color: var(--head);
  letter-spacing: -0.01em;
  margin: 0;
}
.brand-badge {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 12px;
  background: var(--rd-bg);
  color: var(--rd);
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.planner-summary {
  font-size: 11px;
  color: var(--txt-2);
  margin-left: auto;
  font-family: 'Commit Mono', ui-monospace, monospace;
}

/* ── Scenario controls ── */
.scenario-controls {
  display: flex;
  gap: 0.5rem;
  margin-left: 1rem;
}
.scenario-controls button {
  font-size: 11px;
  padding: 4px 12px;
  border-radius: 999px;
  border: 1px solid var(--border-2);
  background: transparent;
  color: var(--txt-2);
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  font-weight: 500;
  transition: all 0.15s;
}
.scenario-controls button:hover {
  background: var(--bg-3);
  color: var(--txt);
}

/* ── Tab Navigation ── */
.tab-nav {
  display: flex;
  border-bottom: 1px solid rgba(226,232,240,0.6);
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  overflow-x: auto;
  position: sticky;
  top: 0;
  z-index: 50;
}
.tab-btn {
  padding: 10px 16px;
  font-size: 12px;
  font-weight: 600;
  border: none;
  background: transparent;
  color: var(--txt-3);
  cursor: pointer;
  white-space: nowrap;
  font-family: 'DM Sans', sans-serif;
  border-bottom: 2px solid transparent;
  transition: all 0.15s;
}
.tab-btn:hover {
  color: var(--txt-2);
  background: rgba(0,0,0,0.02);
}
.tab-btn--active {
  color: var(--rd) !important;
  border-bottom-color: var(--rd) !important;
  background: var(--rd-bg) !important;
}

/* ── Main content ── */
.planner-main {
  flex: 1;
  padding: 1.5rem;
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
}

/* ── Tab visibility ── */
.tab { display: none; }
.tab.active { display: block; }

/* ── Grid layouts ── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.75rem; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.75rem; }

@media (max-width: 768px) {
  .grid-2 { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  .grid-3 { grid-template-columns: 1fr; }
}

/* ── Metric Cards ── */
.metric-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.metric-card__label {
  font-size: 10px;
  color: var(--txt-3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 2px;
}
.metric-card__value {
  font-size: 22px;
  font-weight: 700;
  font-family: 'Commit Mono', ui-monospace, monospace;
  line-height: 1.2;
}
.metric-card__sub {
  font-size: 10px;
  color: var(--txt-3);
  margin-top: 2px;
}
.metric-card-sm .metric-card__value {
  font-size: 17px;
}

/* Color classes */
.c-head { color: var(--head); }
.c-red { color: var(--rd); }
.c-green { color: var(--gn); }
.c-blue { color: var(--bl); }
.c-amber { color: var(--am); }

/* ── Section headers ── */
.section-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.section-header h3 {
  font-size: 14px;
  font-weight: 700;
  color: var(--head);
  margin: 0;
}
.section-header .hint {
  font-size: 11px;
  color: var(--txt-3);
  margin-left: auto;
  font-style: italic;
}

/* ── Slider group ── */
/* ─── City search ─────────────────────────────────────────────────── */
.city-search {
  position: relative;
}
.city-search input[type="text"] {
  width: 100%;
  padding: 8px 12px;
  font-size: 13px;
  font-family: 'DM Sans', sans-serif;
  border: 1px solid var(--border-2);
  border-radius: 8px;
  background: var(--bg-3);
  color: var(--txt);
  outline: none;
  box-sizing: border-box;
}
.city-search input[type="text"]:focus {
  border-color: var(--cta);
  box-shadow: 0 0 0 2px rgba(29,78,216,0.1);
}

.city-dropdown {
  position: absolute;
  z-index: 90;
  top: 100%;
  left: 0;
  right: 0;
  margin: 4px 0 0;
  padding: 4px 0;
  list-style: none;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  max-height: 280px;
  overflow-y: auto;
}
.city-dropdown__item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  cursor: pointer;
  font-size: 13px;
  transition: background 0.1s;
}
.city-dropdown__item:hover {
  background: var(--bg-3);
}
.city-dropdown__flag { font-size: 16px; flex-shrink: 0; }
.city-dropdown__name { flex: 1; font-weight: 500; color: var(--txt); }
.city-dropdown__country { font-size: 11px; color: var(--txt-2); }
.city-dropdown__score {
  font-size: 10px;
  font-weight: 500;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(29,78,216,0.1);
  color: var(--cta);
  white-space: nowrap;
}
.pn-wordmark {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.city-dropdown__empty {
  padding: 12px;
  font-size: 12px;
  color: var(--txt-2);
  text-align: center;
}

/* ─── Market context card ─────────────────────────────────────────── */
.market-context { margin-top: 10px; }
.market-context__card {
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
}
.market-context__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.market-context__header strong {
  font-size: 14px;
  color: var(--txt);
}
.market-context__score {
  font-size: 13px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
}
.market-context__score small { font-weight: 400; opacity: 0.7; }
.market-context__score--high { background: rgba(22,163,74,0.12); color: #16A34A; }
.market-context__score--mid  { background: rgba(217,119,6,0.12); color: #D97706; }
.market-context__score--low  { background: rgba(239,68,68,0.1);  color: #EF4444; }

.market-context__stats {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 12px;
  color: var(--txt-2);
}
.market-context__stats span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.market-context__stats svg { opacity: 0.5; }

.market-context__confidence {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  font-size: 11px;
  color: var(--txt-2);
}
.market-context__conf-dots {
  display: inline-flex;
  gap: 3px;
}
.market-context__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--border-2);
}
.market-context__dot.filled {
  background: var(--cta);
}

.market-context__source {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  font-size: 11px;
  color: var(--txt-2);
}
.market-context__src-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex: none;
}
.market-context__src-dot--live     { background: #16A34A; }
.market-context__src-dot--est      { background: #D97706; }
.market-context__src-dot--fallback { background: var(--border-2); }

.market-context__empty { display: none; }

.slider-group {
  margin-bottom: 14px;
}
.slider-group label {
  display: flex;
  align-items: center;
  margin-bottom: 4px;
}
.slider-group__label {
  font-size: 12px;
  color: var(--txt-2);
  letter-spacing: 0.01em;
}
.slider-combo {
  display: flex;
  align-items: center;
  gap: 12px;
}
.slider-combo input[type=range] {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 5px;
  border-radius: 3px;
  outline: none;
  cursor: pointer;
  background: #E2E8F0;
}
.slider-combo input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--rd);
  cursor: pointer;
  border: 2px solid var(--bg);
}
.slider-combo input[type=range]::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--rd);
  cursor: pointer;
  border: 2px solid var(--bg);
}
.slider-combo input[type=number] {
  width: 80px;
  background: var(--bg-3);
  border: 1px solid var(--border-2);
  border-radius: 4px;
  padding: 4px 8px;
  text-align: right;
  font-size: 12px;
  font-family: 'Commit Mono', ui-monospace, monospace;
  color: var(--head);
  outline: none;
}
.slider-combo input[type=number]:focus {
  border-color: rgba(29,78,216,0.5);
}
/* Hide number spinners */
.slider-combo input[type=number]::-webkit-outer-spin-button,
.slider-combo input[type=number]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.slider-combo input[type=number] {
  -moz-appearance: textfield;
}

/* ── Space reference facts ── */
.space-facts {
  margin-top: 10px;
  padding: 10px 12px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  font-size: 11px;
  color: var(--txt-3);
}
.space-facts__title {
  font-weight: 600;
  color: var(--txt-2);
  margin-bottom: 6px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.space-facts__item {
  display: flex;
  justify-content: space-between;
  padding: 2px 0;
}

/* ── Toggle buttons ── */
.toggle-group {
  display: flex;
  gap: 4px;
  margin-bottom: 14px;
}
.toggle-btn {
  flex: 1;
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--txt-3);
  border-radius: 999px;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  transition: all 0.15s;
}
.toggle-btn--active {
  background: var(--rd) !important;
  border-color: var(--rd) !important;
  color: #fff !important;
}

.btn-reset {
  padding: 5px 14px;
  font-size: 11px;
  font-weight: 600;
  color: var(--txt-2);
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s;
}
.btn-reset:hover { color: var(--head); border-color: var(--border-2); }
.btn-reset--confirm { color: #DC2626; border-color: #FCA5A5; background: #FEF2F2; }

/* ── Pill Select ── */
.pill-group {
  margin-bottom: 14px;
}
.pill-group label {
  display: flex;
  align-items: center;
  margin-bottom: 4px;
}
.pill-options {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.pill-btn {
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 600;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--txt-3);
  border-radius: 999px;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  transition: all 0.15s;
}
.pill-btn:hover {
  background: var(--bg-3);
  color: var(--txt-2);
}
.pill-btn--active {
  background: var(--rd) !important;
  border-color: var(--rd) !important;
  color: #fff !important;
}

/* ── Budget Indicator ── */
.budget-indicator {
  background: var(--bg-2);
  border: 2px solid;
  border-radius: 14px;
  padding: 14px 16px;
}
.budget-indicator--under {
  border-color: var(--gn);
  background: var(--gn-bg);
}
.budget-indicator--over {
  border-color: #EF4444;
  background: rgba(239,68,68,0.06);
}

/* ── Data Tables ── */
.data-table {
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  border-collapse: collapse;
  font-size: 12px;
}
.data-table th {
  padding: 8px;
  text-align: left;
  color: var(--txt-3);
  font-weight: 600;
  font-size: 11px;
  border-bottom: 2px solid var(--border-2);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.data-table th.right {
  text-align: right;
}
.data-table td {
  padding: 6px 8px;
  font-family: 'DM Sans', sans-serif;
  color: var(--txt);
}
.data-table td.mono {
  font-family: 'Commit Mono', ui-monospace, monospace;
  text-align: right;
}
.data-table tr:hover {
  background: rgba(0,0,0,0.02);
}
.data-table .total-row {
  border-top: 2px solid var(--rd);
}
.data-table .total-row td {
  font-weight: 700;
  color: var(--rd);
  padding-top: 10px;
}

/* ── Chart container ── */
.chart-container {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 1rem;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
  min-width: 0;
  overflow: hidden;
}
.chart-container__label {
  font-size: 11px;
  color: var(--txt-3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 10px;
}
.chart-container__canvas {
  position: relative;
}
/* Fixed heights for chart containers to prevent resize loops */
.chart-h-56 { height: 224px; }
.chart-h-48 { height: 192px; }
.chart-h-44 { height: 176px; }
.chart-h-40 { height: 160px; }

/* ── Tooltip ── */
.ti {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: rgba(0,0,0,0.04);
  color: var(--txt-3);
  font-size: 9px;
  cursor: help;
  margin-left: 4px;
  flex-shrink: 0;
  font-style: italic;
  font-family: 'DM Sans', sans-serif;
  vertical-align: middle;
}
.ti .tp {
  display: none;
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  width: 240px;
  padding: 8px 10px;
  border-radius: 6px;
  background: var(--bg-4);
  border: 1px solid var(--border-2);
  color: var(--txt);
  font-size: 10px;
  line-height: 1.5;
  font-style: normal;
  font-weight: 400;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  z-index: 200;
  pointer-events: none;
}
.ti .tp::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: var(--bg-4);
}
.ti:hover .tp { display: block; }
.ti .tp.tp-left {
  left: auto;
  right: -8px;
  transform: none;
}
.ti .tp.tp-left::after {
  left: auto;
  right: 12px;
  transform: none;
}

/* ── Spacing helpers ── */
/* No overflow here: it would clip the metric `.tp` tooltips that escape upward.
   Wide tables get their own scroll container (.table-scroll) instead. */
.mb-section { margin-bottom: 28px; max-width: 640px; margin-left: auto; margin-right: auto; }
.table-scroll { overflow-x: auto; }
.mb-4 { margin-bottom: 1rem; }
.mt-4 { margin-top: 1rem; }

/* ── Season section (outdoor only) ── */
.season-section { display: none; }
.season-section.visible { display: block; }

/* ── Lead CTA bar ── */
.lead-cta-bar {
  position: sticky;
  bottom: 0;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 12px 1.5rem;
  background: var(--bg-2);
  border-top: 1px solid var(--border);
  font-size: 13px;
  z-index: 40;
}
.lead-cta-bar span {
  color: var(--txt-2);
}
.lead-cta-bar a {
  font-size: 12px;
  font-weight: 600;
  padding: 6px 16px;
  border-radius: 10px;
  text-decoration: none;
  transition: all 0.15s;
}
.lead-cta-bar a:first-of-type {
  background: var(--rd);
  color: #fff;
}
.lead-cta-bar a:first-of-type:hover {
  background: #1E40AF;
}
.lead-cta-bar a:last-of-type {
  background: transparent;
  border: 1px solid var(--border-2);
  color: var(--txt-2);
}
.lead-cta-bar a:last-of-type:hover {
  background: var(--bg-3);
  color: var(--txt);
}

/* ── Inline lead CTA ── */
.lead-cta {
  background: var(--cta-bg);
  border: 2px solid var(--cta);
  border-radius: 20px;
  padding: 20px 24px;
  box-shadow: 0 4px 24px var(--cta-glow);
  margin-top: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.lead-cta__text {
  font-size: 13px;
  color: var(--txt-2);
}
.lead-cta__btn {
  font-size: 13px;
  font-weight: 600;
  padding: 13px 26px;
  border-radius: 10px;
  background: var(--cta);
  color: #fff;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s;
  box-shadow: 0 2px 10px var(--cta-shadow);
}
.lead-cta__btn:hover {
  background: var(--cta-hover);
}
.lead-cta__btn--secondary {
  background: transparent;
  border: 1px solid var(--border-2);
  color: var(--txt-2);
}
.lead-cta__btn--secondary:hover {
  background: var(--bg-3);
  color: var(--txt);
}

/* ── Quote Sidebar CTA (desktop fixed) ── */
.quote-sidebar {
  display: block;
  position: fixed;
  right: max(1rem, calc((100vw - 72rem) / 2 - 280px));
  top: calc(50px + 1.5rem);
  width: 240px;
  background: #EFF6FF;
  border: 2px solid #1D4ED8;
  border-radius: 20px;
  padding: 24px;
  box-shadow: 0 4px 24px rgba(29,78,216,0.1);
  z-index: 60;
}
.quote-sidebar__label {
  font-size: 11px;
  color: #1D4ED8;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}
.quote-sidebar__title {
  font-size: 16px;
  font-weight: 700;
  color: #0F172A;
  margin: 0 0 8px;
  line-height: 1.3;
}
.quote-sidebar__desc {
  font-size: 12px;
  color: #64748B;
  line-height: 1.5;
  margin: 0 0 14px;
}
.quote-sidebar__checks {
  list-style: none;
  padding: 0;
  margin: 0 0 16px;
}
.quote-sidebar__checks li {
  font-size: 12px;
  color: #64748B;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 2px 0;
}
.quote-sidebar__check {
  color: #16A34A;
  font-weight: 700;
}
.quote-sidebar__btn {
  display: block;
  width: 100%;
  background: #1D4ED8;
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 11px 16px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  box-shadow: 0 2px 10px rgba(29,78,216,0.25);
  transition: background 0.15s;
}
.quote-sidebar__btn:hover {
  background: #1E40AF;
}
.quote-sidebar__hint {
  display: block;
  text-align: center;
  font-size: 11px;
  color: #94A3B8;
  margin-top: 8px;
}
.quote-sidebar__export-link {
  display: block;
  text-align: center;
  font-size: 12px;
  color: #64748B;
  margin-top: 12px;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.quote-sidebar__export-link:hover {
  color: #0F172A;
}
@media (max-width: 1400px) {
  .quote-sidebar { display: none !important; }
}
/* ── Quote inline CTA (mobile/narrow — replaces sidebar) ── */
.quote-inline-cta {
  display: none;
  background: #EFF6FF;
  border: 2px solid #1D4ED8;
  border-radius: 20px;
  padding: 24px;
  margin-top: 1.5rem;
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
}
.quote-inline-cta__label {
  font-size: 11px;
  color: #1D4ED8;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}
.quote-inline-cta__title {
  font-size: 16px;
  font-weight: 700;
  color: #0F172A;
  margin: 0 0 8px;
  line-height: 1.3;
}
.quote-inline-cta__desc {
  font-size: 12px;
  color: #64748B;
  line-height: 1.5;
  margin: 0 0 14px;
}
.quote-inline-cta__checks {
  list-style: none;
  padding: 0;
  margin: 0 0 16px;
}
.quote-inline-cta__checks li {
  font-size: 12px;
  color: #64748B;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 2px 0;
}
.quote-inline-cta__check {
  color: #16A34A;
  font-weight: 700;
}
.quote-inline-cta__btn {
  display: block;
  width: 100%;
  background: #1D4ED8;
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 11px 16px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  box-shadow: 0 2px 10px rgba(29,78,216,0.25);
  transition: background 0.15s;
  text-align: center;
}
.quote-inline-cta__btn:hover { background: #1E40AF; }
.quote-inline-cta__hint {
  display: block;
  text-align: center;
  font-size: 11px;
  color: #94A3B8;
  margin-top: 8px;
}
@media (min-width: 1401px) {
  .quote-inline-cta { display: none !important; }
}

/* ── Exit waterfall ── */
.waterfall-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
}
.waterfall-row__label { color: var(--txt-2); }
.waterfall-row__value { font-family: 'Commit Mono', ui-monospace, monospace; font-weight: 600; }

/* ── Court summary cards ── */
.court-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin-top: 8px;
}

/* ── Planner footer ── */
.planner-footer {
  padding: 12px 1.5rem;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 10px;
  color: var(--txt-3);
}

/* ── Scenario drawer ── */
#scenario-drawer {
  position: fixed;
  top: 0;
  right: -360px;
  width: 360px;
  height: 100vh;
  background: var(--bg-2);
  border-left: 1px solid var(--border);
  z-index: 100;
  transition: right 0.25s ease;
  overflow-y: auto;
  padding: 1.5rem;
}
#scenario-drawer.open {
  right: 0;
}
.scenario-item {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: background 0.15s;
}
.scenario-item:hover {
  background: var(--bg-3);
}
.scenario-item__name {
  font-weight: 600;
  color: var(--head);
  font-size: 13px;
}
.scenario-item__meta {
  font-size: 11px;
  color: var(--txt-3);
  margin-top: 2px;
}

/* ── Save feedback ── */
#save-feedback {
  position: fixed;
  bottom: 60px;
  right: 1.5rem;
  z-index: 90;
}
.save-toast {
  background: var(--gn);
  color: #fff;
  padding: 8px 16px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
  animation: fadeInOut 2s ease forwards;
}
@keyframes fadeInOut {
  0% { opacity: 0; transform: translateY(10px); }
  15% { opacity: 1; transform: translateY(0); }
  85% { opacity: 1; }
  100% { opacity: 0; }
}

/* ── Wizard ── */
.wizard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  gap: 1rem;
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
}
.wizard-dots {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.wiz-dot {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--txt-3);
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  transition: all 0.15s;
  white-space: nowrap;
}
.wiz-dot:hover {
  background: var(--bg-3);
  color: var(--txt-2);
}
.wiz-dot--active {
  background: var(--rd) !important;
  border-color: var(--rd) !important;
  color: #fff !important;
}
.wiz-dot--done {
  background: var(--gn-bg);
  border-color: var(--gn);
  color: var(--gn);
}
.wiz-dot__num {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  background: rgba(0,0,0,0.06);
  color: inherit;
}
.wiz-dot--active .wiz-dot__num {
  background: rgba(255,255,255,0.25);
}
.wiz-dot--done .wiz-dot__num {
  background: var(--gn);
  color: #fff;
}

.wizard-step {
  display: none;
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
}
.wizard-step.active {
  display: block;
}
.wizard-step__title {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--head);
  margin: 0 0 4px;
}
.wizard-step__sub {
  font-size: 13px;
  color: var(--txt-2);
  margin: 0 0 1.5rem;
}

/* Wizard sticky footer (preview + nav) */
.wizard-footer {
  position: sticky;
  bottom: 0;
  z-index: 30;
  background: var(--bg);
  padding: 10px 0 0;
  margin-top: 1.5rem;
}
.wizard-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 0 1rem;
  padding: 8px 16px 12px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 16px 16px 0 0;
  box-shadow: 0 -2px 8px rgba(0,0,0,0.04);
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
}
.wiz-preview__caption {
  flex-basis: 100%;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--txt-3);
  font-weight: 600;
  margin-bottom: 4px;
}
.wiz-preview__item {
  flex: 1;
  text-align: center;
}
.wiz-preview__label {
  font-size: 10px;
  color: var(--txt-3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.wiz-preview__value {
  font-size: 16px;
  font-weight: 700;
  font-family: 'Commit Mono', ui-monospace, monospace;
  color: var(--head);
  line-height: 1.4;
}
.wiz-preview__value.c-green { color: var(--gn); }
.wiz-preview__value.c-red { color: #EF4444; }

/* Wizard navigation */
.wizard-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px 12px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 16px 16px;
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
  gap: 0.75rem;
}
.wiz-btn--back {
  padding: 8px 20px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid var(--border-2);
  background: transparent;
  color: var(--txt-2);
  border-radius: 10px;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  transition: all 0.15s;
}
.wiz-btn--back:hover {
  background: var(--bg-3);
  color: var(--txt);
}
.wiz-btn--next,
.wiz-btn--submit {
  padding: 10px 24px;
  font-size: 13px;
  font-weight: 700;
  border: none;
  background: var(--cta);
  color: #fff;
  border-radius: 10px;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  transition: all 0.15s;
  box-shadow: 0 2px 10px var(--cta-shadow);
}
.wiz-btn--next:hover,
.wiz-btn--submit:hover {
  background: var(--cta-hover);
}
.wiz-skip {
  font-size: 12px;
  color: var(--txt-3);
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: underline;
  font-family: 'DM Sans', sans-serif;
  padding: 4px;
}
.wiz-skip:hover {
  color: var(--txt-2);
}
.wizard-nav__right {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ── Guest signup bar (sticky on results) ── */
.signup-bar {
  position: sticky;
  bottom: 0;
  display: none;           /* shown by JS on results tabs */
  align-items: center;
  gap: 12px;
  padding: 10px 1.5rem;
  background: var(--cta-bg);
  border-top: none;
  box-shadow: 0 -2px 12px rgba(29,78,216,0.08);
  font-size: 12px;
  color: var(--txt-2);
  z-index: 20;
}
.signup-bar span { flex: 1; }
.signup-bar b { color: var(--head); }

/* CAPEX tab — narrower content on wide screens */
#tab-capex {
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

/* Mobile wizard */
@media (max-width: 768px) {
  .wizard-dots { gap: 4px; }
  .wiz-dot { padding: 5px 10px; font-size: 10px; }
  .wiz-dot__num { width: 16px; height: 16px; font-size: 9px; }
  .wizard-preview {
    flex-direction: column;
    gap: 8px;
    text-align: left;
  }
  .wiz-preview__item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-align: left;
  }
  .wizard-step { max-width: 100%; }
  .wizard-preview,
  .wizard-nav { max-width: 100%; }
  .wizard-step { padding-bottom: 140px; } /* space for fixed footer + bottom nav */
  .wizard-footer {
    position: fixed;
    bottom: 56px; /* sit directly above bottom nav */
    left: 0;
    right: 0;
    z-index: 55;
    margin-top: 0;
    padding: 0 1.5rem;
    background: #FFFFFF;
    border-top: 1px solid #E2E8F0;
  }
  .wizard-nav {
    max-width: 560px;
    margin: 0 auto;
    border-radius: 0;
    border: none;
    background: transparent;
  }
}

/* ── Export inline CTA (within Returns tab) ── */
.export-cta-inline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 1.5rem;
  padding: 14px 20px;
  background: var(--gn-bg);
  border: 1px solid rgba(22,163,74,0.2);
  border-radius: 12px;
  font-size: 13px;
  color: var(--txt-2);
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.export-cta-inline:hover {
  background: rgba(22,163,74,0.1);
  border-color: rgba(22,163,74,0.35);
}
.export-cta-inline__btn {
  color: var(--gn);
  font-weight: 700;
  white-space: nowrap;
}

/* ── Mobile Bottom Navigation ── */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 60;
  background: #FFFFFF;
  border-top: 1px solid #E2E8F0;
  padding: 4px 1.5rem;
  padding-bottom: max(4px, env(safe-area-inset-bottom));
}
.bottom-nav__btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 4px 4px;
  border: none;
  border-top: 2px solid transparent;
  background: transparent;
  color: #94A3B8;
  font-size: 10px;
  font-weight: 600;
  font-family: 'DM Sans', sans-serif;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.bottom-nav__btn svg { transition: color 0.15s; }
.bottom-nav__btn--active {
  color: #1D4ED8;
  border-top-color: #1D4ED8;
}
@media (max-width: 768px) {
  .bottom-nav { display: flex; }
  .tab-nav { display: none; }
  /* Reserve space for bottom nav so content isn't hidden behind it */
  .planner-app { padding-bottom: 64px; }
}

/* ── Collapsible Details (wizard sections + metrics) ── */
.wizard-details {
  margin-bottom: 28px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--bg-2);
}
.wizard-details__summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  font-size: 13px;
  font-weight: 700;
  color: var(--head);
  cursor: pointer;
  list-style: none;
  user-select: none;
  -webkit-user-select: none;
}
.wizard-details__summary::-webkit-details-marker { display: none; }
.wizard-details__summary::after {
  content: '';
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--txt-3);
  border-bottom: 2px solid var(--txt-3);
  transform: rotate(-45deg);
  transition: transform 0.2s;
  flex-shrink: 0;
}
.wizard-details[open] > .wizard-details__summary::after {
  transform: rotate(45deg);
}
.wizard-details__hint {
  font-size: 11px;
  font-weight: 500;
  color: var(--txt-3);
  margin-left: 8px;
}
.wizard-details__body {
  padding: 0 16px 16px;
}

/* ── Mobile CTA Bar (above bottom nav) ── */
.cta-bottom-bar {
  display: none;
  position: fixed;
  bottom: 56px; /* above bottom nav */
  left: 0;
  right: 0;
  z-index: 65;
  padding: 10px 16px;
  background: var(--cta-bg);
  border-top: 1px solid rgba(29,78,216,0.15);
  box-shadow: 0 -2px 12px rgba(29,78,216,0.08);
  align-items: center;
  gap: 10px;
  animation: slideUpCTA 0.3s ease;
}
.cta-bottom-bar__text {
  flex: 1;
  min-width: 0;
}
.cta-bottom-bar__value {
  font-size: 14px;
  font-weight: 700;
  font-family: 'Commit Mono', ui-monospace, monospace;
  color: var(--head);
}
.cta-bottom-bar__hint {
  font-size: 10px;
  color: var(--txt-3);
}
.cta-bottom-bar__btn {
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 700;
  border: none;
  border-radius: 10px;
  background: var(--cta);
  color: #fff;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  white-space: nowrap;
  box-shadow: 0 2px 10px var(--cta-shadow);
  transition: background 0.15s;
  flex-shrink: 0;
}
.cta-bottom-bar__btn:hover { background: var(--cta-hover); }
.cta-bottom-bar__dismiss {
  position: absolute;
  top: 4px;
  right: 8px;
  background: none;
  border: none;
  color: var(--txt-3);
  font-size: 14px;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
}
@keyframes slideUpCTA {
  from { transform: translateY(100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
@media (max-width: 768px) {
  .cta-bottom-bar.visible { display: flex; }
}

/* ── Computing indicator ── */
.planner-app--computing .planner-header h1::after {
  content: 'computing\2026';
  font-size: 10px;
  font-weight: 500;
  color: var(--txt-3);
  margin-left: 10px;
  letter-spacing: 0.03em;
}

/* ── Mobile polish ── */
@media (max-width: 768px) {
  /* Larger slider thumb for touch targets */
  .slider-combo input[type=range]::-webkit-slider-thumb { width: 20px; height: 20px; }
  .slider-combo input[type=range]::-moz-range-thumb { width: 20px; height: 20px; }
  .slider-combo input[type=range] { height: 6px; }

  /* Tighten metric card padding on mobile */
  .metric-card { padding: 14px; border-radius: 10px; }
  .metric-card__value { font-size: 19px; }
  .metric-card-sm .metric-card__value { font-size: 15px; }

  /* Add padding below content for bottom nav + CTA bar */
  .planner-app main { padding-bottom: 120px; }

  /* Hide feedback on planner mobile — too much competing for bottom space.
     planner.css only loads on planner pages so this won't affect other pages. */
  #feedback-wrap { display: none !important; }
  .feedback-label { display: none; }

  /* Hide live summary on mobile — wizard footer is just nav buttons */
  .wizard-preview { display: none !important; }
}
