
/* ===================================================================== *
 *  Natal chart
 *  (appended; preserves all existing rules above)
 * ===================================================================== */

/* ---------------------------------------------------------------------
 * Per-planet color tokens — used by BOTH the glyph fill and the radial
 * degree-line stroke so each planet's leader is visually traceable back
 * to the ring tick at its exact degree.
 *
 * Palette designed for WCAG AA contrast on the amethyst-theme light
 * surface (#f3ecf6) — see audit report for per-hue rationale.
 *
 * Override per theme:
 *   :root[data-theme="myTheme"] { --planet-sun: #...; ... }
 * ------------------------------------------------------------------- */
:root {
  --planet-sun:     #8C6A1A;   /* desaturated traditional gold */
  --planet-moon:    #5C6B7A;   /* cool slate-silver */
  --planet-mercury: #1F7A5A;   /* hermetic forest green */
  --planet-venus:   #B23A6B;   /* rose-magenta */
  --planet-mars:    #B0231C;   /* classic Mars red */
  --planet-jupiter: #B25A12;   /* saffron / burnt orange */
  --planet-saturn:  #2C2A33;   /* lead with violet undertone */
  --planet-uranus:  #0E6FB5;   /* electric blue */
  --planet-neptune: #1F4FA8;   /* deep sea-blue */
  --planet-pluto:   #6A1530;   /* underworld maroon */
  --planet-rahu:    #4A2B7A;   /* dark indigo-purple */
  --planet-ketu:    #6B4423;   /* earth brown */
}

/* --- Interior-page header variant ---------------------------------- */
.site-header--interior .site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 0.75rem;
}
.site-header--interior .btn-back {
  font-size: 0.9rem;
  white-space: nowrap;
}

/* --- Page container ------------------------------------------------ */
.natal-page {
  padding-block: clamp(2rem, 5vw, 4rem);
  background: var(--surface);
  color: var(--ink);
}
.natal-page__inner {
  display: flex;
  flex-direction: column;
  gap: clamp(2rem, 4vw, 3rem);
}

/* The natal-chart page composes sections inside a flex column with `gap`
   for inter-section rhythm. The site-wide stylesheet adds 5-7.5rem of
   padding to every <section>, which would DOUBLE the rhythm here and
   make scroll feel like long pauses between cramped content.
   Override to zero on this page; the flex `gap` above handles spacing. */
.natal-page .natal-hero,
.natal-page .natal-results {
  padding: 0;
}

/* --- Hero ---------------------------------------------------------- */
.natal-hero {
  max-width: 56ch;
}
.natal-hero h1 {
  font-family: "Noto Serif", serif;
  font-size: clamp(1.875rem, 1rem + 3vw, 2.75rem);
  line-height: 1.15;
  margin: 0 0 0.75rem;
  color: var(--ink);
}
.natal-hero .lead {
  font-size: 1.125rem;
  line-height: 1.55;
  color: var(--ink-muted);
  margin: 0 0 0.75rem;
}
.natal-hero .natal-intro {
  font-size: 1rem;
  line-height: 1.6;
  color: var(--ink-muted);
  margin: 0;
}

/* --- Form ---------------------------------------------------------- */
.natal-form-section {
  background: var(--surface-2);
  border: 1px solid var(--outline);
  border-radius: 14px;
  /* Compactness pass: was clamp(1.25rem, 2.5vw, 2rem) — chamfer the
     outer padding while keeping breathing room on phones. */
  padding: clamp(1rem, 2vw, 1.5rem);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.natal-form {
  display: grid;
  grid-template-columns: 1fr;
  /* Was 1.25rem — tighter inter-field spacing keeps the form on one
     screen on a typical laptop without needing to scroll the form
     itself. */
  gap: 0.875rem;
}
@media (min-width: 640px) {
  .natal-form {
    grid-template-columns: 1fr 1fr;
    /* Row-gap stays tight; column-gap a hair wider for visual rhythm. */
    gap: 0.875rem 1.25rem;
  }
  .natal-field--combo,
  .natal-field.consent,
  .natal-field--submit,
  .natal-loc-detail {
    grid-column: 1 / -1;
  }
}

.natal-field {
  display: flex;
  flex-direction: column;
  gap: 0.3125rem;
}
.natal-field > label,
.natal-field > .label-text {
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--ink);
  letter-spacing: 0.01em;
}
.natal-field input[type="text"],
.natal-field input[type="date"],
.natal-field input[type="time"],
.natal-field input[type="number"],
.natal-field select {
  width: 100%;
  /* Was 0.625rem 0.75rem with min-height 44px — slimmer now but still
     hits the 40px touch threshold (Apple HIG 44px is for primary tap
     targets like buttons; form inputs can be 36–40px). */
  padding: 0.5rem 0.625rem;
  font: inherit;
  font-size: 0.9rem;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--outline);
  border-radius: 8px;
  transition: border-color 120ms ease, box-shadow 120ms ease;
  min-height: 40px;
}
.natal-field input:focus-visible,
.natal-field select:focus-visible {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-faint);
}
.natal-field input:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.natal-field .help {
  font-size: 0.8125rem;
  color: var(--ink-muted);
  line-height: 1.4;
}
.natal-field .help--empty {
  color: var(--gold-hover);
}

.inline-check {
  display: inline-flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.9rem;
  font-weight: 400;
  color: var(--ink);
  cursor: pointer;
  line-height: 1.45;
}
.inline-check input[type="checkbox"] {
  flex: 0 0 auto;
  width: 1.1rem;
  height: 1.1rem;
  margin-top: 0.15rem;
  accent-color: var(--primary);
}

/* Combo / autocomplete */
.natal-field--combo .combo {
  position: relative;
}
.combo-listbox {
  position: absolute;
  z-index: 20;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  margin: 0;
  padding: 0.25rem 0;
  list-style: none;
  background: var(--surface);
  border: 1px solid var(--outline);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  max-height: 18rem;
  overflow-y: auto;
}
.combo-option {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--ink);
  border-radius: 4px;
}
.combo-option:hover,
.combo-option.is-active {
  background: var(--primary-faint);
}
.combo-option__name {
  font-weight: 500;
}
.combo-option__country {
  font-size: 0.8rem;
  color: var(--ink-muted);
  white-space: nowrap;
}

/* Timezone row */
.tz-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.tz-display {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.9rem;
  padding: 0.375rem 0.5rem;
  background: var(--surface);
  border: 1px solid var(--outline);
  border-radius: 6px;
  color: var(--ink);
}
.link-btn {
  background: none;
  border: none;
  color: var(--primary);
  text-decoration: underline;
  font: inherit;
  font-size: 0.875rem;
  cursor: pointer;
  padding: 0.25rem 0.25rem;
}
.link-btn:hover,
.link-btn:focus-visible {
  color: var(--gold-hover);
  outline: none;
}
.link-btn:focus-visible {
  box-shadow: 0 0 0 3px var(--primary-faint);
  border-radius: 4px;
}

/* Consent row */
.natal-form .consent {
  padding: 0.875rem 1rem;
  background: var(--surface);
  border: 1px solid var(--outline);
  border-radius: 8px;
}
.natal-form .consent a {
  color: var(--primary);
  text-decoration: underline;
}
.natal-form .consent a:hover,
.natal-form .consent a:focus-visible {
  color: var(--gold-hover);
}

/* Submit row */
.natal-field--submit {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  align-items: flex-start;
}
.natal-field--submit .btn {
  min-width: 14rem;
}

.natal-error {
  margin: 0;
  padding: 0.625rem 0.875rem;
  font-size: 0.9rem;
  color: var(--gold-hover);
  background: rgba(180, 80, 60, 0.08);
  border: 1px solid var(--gold-hover);
  border-radius: 6px;
}

/* --- Results ------------------------------------------------------- */
.natal-results {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
/* The class rule above has higher specificity than the user-agent
   [hidden]{display:none} default, which would otherwise silently un-hide
   the results section before the form is submitted. Re-state hidden
   explicitly so <section ... hidden> actually hides. */
.natal-results[hidden] {
  display: none;
}
.natal-results h2 {
  font-family: "Noto Serif", serif;
  font-size: clamp(1.5rem, 0.75rem + 2vw, 2rem);
  margin: 0;
  color: var(--ink);
  outline: none;
}

.natal-wheel-wrap {
  max-width: 720px;
  margin: 0 auto;
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--outline);
  border-radius: 12px;
  padding: 0.75rem;
}
.natal-wheel-wrap svg {
  width: 100%;
  height: auto;
  display: block;
}

.natal-meta__line {
  font-size: 0.875rem;
  color: var(--ink-muted);
  margin: 0;
}

.natal-table-wrap {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
.natal-table-wrap h3 {
  font-family: "Noto Serif", serif;
  font-size: 1.25rem;
  margin: 0.25rem 0 0.5rem;
  color: var(--ink);
}
.natal-axes-summary {
  margin: 0;
  font-size: 0.95rem;
  color: var(--ink);
}
.natal-axes-summary strong {
  color: var(--ink);
}

.natal-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  color: var(--ink);
}
.natal-table th,
.natal-table td {
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid var(--outline);
  text-align: left;
}
.natal-table thead th {
  background: var(--surface-2);
  color: var(--ink-muted);
  font-weight: 600;
  font-size: 0.8125rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.natal-table tbody tr:hover {
  background: var(--primary-faint);
}
.natal-table tbody th[scope="row"] {
  font-weight: 600;
}

.natal-attribution {
  margin: 0;
  font-size: 0.8rem;
  color: var(--ink-muted);
}
.natal-attribution a {
  color: var(--ink-muted);
  text-decoration: underline;
}

/* Surfaced when a preset's source string carries an unreliable Rodden
   rating (DD = dirty data, C = uncertain, X = time unknown). Rendered
   by index.html's renderAttribText() as a leading badge before the
   citation. Inherits the small attribution-line font size; uses a
   warning-tone background to make it visually distinct from the rest
   of the source string. */
.natal-rating-warning {
  display: inline-block;
  padding: 0.1em 0.45em;
  border-radius: 0.25em;
  background: #fff3cd;          /* warm warning yellow */
  color: #856404;                /* high-contrast amber */
  border: 1px solid #ffeeba;
  font-weight: 600;
  margin-right: 0.35em;
}
/* X-rated (time unknown) is the strongest signal — use a red-toned
   palette so the user understands the Asc / houses are not valid. */
.natal-rating-warning--x {
  background: #f8d7da;
  color: #721c24;
  border-color: #f5c6cb;
}

/* Visually-hidden helper (re-declared locally in case .sr-only is not in the base sheet) */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ===================================================================== *
 *  Luna wheel, amethyst-tinted
 *  ---------------------------------------------------------------------
 *  All rules here mirror ast/src/styles.css `.luna-*` selectors. Only
 *  color literals change — geometry/scale is identical so the 0-100
 *  viewBox math from natal-chart-wheel.js drops in unchanged.
 *
 *  Stroke widths quoted in *user-space* units (the SVG viewBox is 0-100,
 *  so 0.18 ≈ 0.18% of the wheel diameter, matching Luna's source).
 * ===================================================================== */

.luna-wheel {
  overflow: visible;
  font-family: "Manrope", system-ui, sans-serif;
}

/* Concentric ring fills */
.luna-bg            { fill: var(--surface); }
.luna-zodiac-band   { fill: var(--surface-2); stroke: var(--outline); stroke-width: 0.2; }
.luna-field         { fill: var(--surface);   stroke: var(--outline); stroke-width: 0.25; }
.luna-inner-band    { fill: var(--surface-3); stroke: none; }
.luna-central-disc  { fill: var(--surface);   stroke: none; }

/* Tick marks around the zodiac rim */
.luna-tick          { stroke: var(--ink-muted); stroke-width: 0.12; opacity: 0.45; }
.luna-tick-five     { stroke: var(--ink-soft);  stroke-width: 0.18; opacity: 0.70; }
.luna-tick-boundary { stroke: var(--ink);       stroke-width: 0.28; opacity: 0.90; }

/* Sign + house dividers */
.luna-sign-boundary    { stroke: var(--outline-strong); stroke-width: 0.18; }
.luna-house-line       { stroke: var(--outline);        stroke-width: 0.18; }
.luna-house-line-axis  { stroke: var(--gold-hover);     stroke-width: 0.30; }

/* House numbers */
.luna-house-number {
  fill: var(--ink-muted);
  font-family: "Manrope", system-ui, sans-serif;
  font-size: 2.3px;
  font-weight: 600;
  opacity: 0.85;
}

/* Aspect chord line — color set inline per-aspect; widths kept from ast.
   ast value 0.0784 was a Luna-nested transform residue; on the 0-100
   viewBox we use 0.18 to match the brief's stated value. */
.luna-aspect-line {
  stroke-width: 0.18;
  stroke-linecap: round;
  opacity: 0.85;
}

/* Asc/Desc + MC/IC axis lines */
.luna-axis-line     { stroke: var(--gold-hover); stroke-width: 0.35; }
.luna-axis-line-mc  { stroke: var(--gold);       stroke-width: 0.35; stroke-dasharray: 0.6 0.4; }

/* Planet leader: outer radial → constant-R connecting arc → inner radial.
 * Stroke color is set inline per-planet by natal-chart-wheel.js using the
 * --planet-<name> token, so each leader matches its glyph hue. Stroke width
 * and opacity remain centralised here. Numeric value matches the JS
 * LEADER_STROKE_WIDTH constant (kept in parity for any future tier-N gated
 * stagger reintroduction). */
.luna-leader {
  stroke-width: 0.08;
  fill: none;
  opacity: 0.9;
  stroke-linecap: butt;
}
/* OOB modifier — declared AFTER .luna-leader so it wins the equal-specificity
   stroke cascade. Keep this order if you reorder rules. */
.luna-leader-oob {
  stroke: var(--gold);
  stroke-width: 0.08;
  fill: none;
}

/* Per-planet degree + minute text inside the wheel */
.luna-degree {
  fill: var(--ink);
  font-family: "Manrope", system-ui, sans-serif;
  font-weight: 500;
}
.luna-degree-deg    { font-size: 1.6px; }
.luna-degree-min    { font-size: 1.6px; }

/* AC/DC/MC/IC corner markers */
.luna-angle-marker {
  fill: var(--ink-muted);
  font-family: "Manrope", system-ui, sans-serif;
  font-size: 2.0px;
  font-weight: 700;
  letter-spacing: 0.04em;
  paint-order: stroke;
  stroke: var(--surface);
  stroke-width: 0.7px;
  stroke-linejoin: round;
}
.luna-angle-marker.angle-marker-mc,
.luna-angle-marker.angle-marker-ic {
  fill: var(--gold-hover);
}

/* =====================================================================
 * Location-detail fieldset (lat / lon / tz)
 *
 * Hidden until a city is picked from the autocomplete. When revealed,
 * shows the autocomplete-resolved lat / lon / tz values as user-editable
 * inputs in a 3-column row on tablet+, stacked on phones.
 * =================================================================== */

.natal-loc-detail {
  margin: 0;
  padding: 0.75rem 0.875rem;
  border: 1px solid var(--outline);
  border-radius: 10px;
  background: color-mix(in srgb, var(--surface) 70%, transparent);
}
.natal-loc-detail > legend {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--ink);
  padding: 0 0.375rem;
  letter-spacing: 0.01em;
}
.natal-loc-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.625rem;
}
@media (min-width: 560px) {
  .natal-loc-grid {
    grid-template-columns: 1fr 1fr 1.5fr; /* tz column gets more room for "Asia/Kolkata"-length labels */
    gap: 0.75rem;
  }
}
.natal-loc-detail .natal-field > label {
  font-size: 0.8125rem; /* slightly tighter labels inside the inset */
}
.natal-loc-detail .help {
  margin-top: 0.5rem;
}

/* =====================================================================
 * Tabs (Input Data | Natal Chart | Planet Positions | Major Aspects)
 *
 * Generic styles — works on the homepage embed and the dedicated page.
 * Visual style: pill-shaped buttons in a horizontal scroll on phones,
 * full row on tablet+. Active tab uses the theme primary as its
 * border-bottom (underline-style indicator, common in modern UI).
 * =================================================================== */

.natal-tabs {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.25rem;
  margin: 0 0 1.25rem;
  padding: 0 0 0.125rem;
  border-bottom: 1px solid var(--outline);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.natal-tabs::-webkit-scrollbar { display: none; }

.natal-tab {
  flex: 0 0 auto;
  padding: 0.625rem 1rem;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--ink-muted);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  cursor: pointer;
  white-space: nowrap;
  transition: color 120ms ease, border-color 120ms ease, background 120ms ease;
  margin-bottom: -1px; /* overlap the tablist's bottom border */
}
.natal-tab:hover {
  color: var(--ink);
  background: color-mix(in srgb, var(--primary) 8%, transparent);
}
.natal-tab:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--primary-faint);
  border-radius: 6px 6px 0 0;
}
.natal-tab.is-active,
.natal-tab[aria-selected="true"] {
  color: var(--primary);
  border-bottom-color: var(--primary);
  font-weight: 600;
}

.natal-tabpanel {
  display: block;
  padding-block: 0.5rem;
  outline: none;
}
.natal-tabpanel[hidden] { display: none; }

/* Default chart caption above the wheel — small attribution-style text */
.natal-default-caption {
  margin: 0 0 0.75rem;
  font-size: 0.8125rem;
  color: var(--ink-muted);
  text-align: center;
  font-style: italic;
}

/* Empty-state for the Aspects tab when none surface */
.natal-empty {
  padding: 2rem 1rem;
  font-size: 0.9375rem;
  color: var(--ink-muted);
  text-align: center;
  font-style: italic;
  background: color-mix(in srgb, var(--surface) 50%, transparent);
  border: 1px dashed var(--outline);
  border-radius: 10px;
}

/* =====================================================================
 * Compactness pass (CSS only — per user preference, no fields hidden).
 *
 * Applies progressively-tighter spacing/typography over the existing
 * rules. Defined LAST in the file so its declarations win the cascade
 * regardless of specificity. Goal: roughly -30% vertical footprint on
 * the form without making any control feel cramped at 14-inch laptop.
 * =================================================================== */

.natal-form-section {
  padding: clamp(0.875rem, 1.5vw, 1.25rem);
  border-radius: 12px;
}
.natal-form {
  gap: 0.75rem;
}
@media (min-width: 640px) {
  .natal-form {
    gap: 0.75rem 1rem;
  }
}
.natal-field {
  gap: 0.25rem;
}
.natal-field > label,
.natal-field > .label-text {
  font-size: 0.8125rem;
}
.natal-field input[type="text"],
.natal-field input[type="date"],
.natal-field input[type="time"],
.natal-field input[type="number"],
.natal-field select {
  padding: 0.4375rem 0.5625rem;
  font-size: 0.875rem;
  min-height: 36px;
}
.natal-field .help {
  font-size: 0.75rem;
}
.natal-loc-detail {
  padding: 0.625rem 0.75rem;
}
.natal-loc-detail > legend {
  font-size: 0.75rem;
}
.natal-loc-grid {
  gap: 0.5rem;
}
@media (min-width: 560px) {
  .natal-loc-grid {
    gap: 0.625rem;
  }
}
.natal-form .consent {
  padding: 0.625rem 0.75rem;
}
.inline-check {
  font-size: 0.8125rem;
}
.natal-field--submit .btn {
  min-width: 12rem;
  padding: 0.5rem 1rem;
}

/* =====================================================================
 * Custom UTC-offset override row
 * (lives inside .natal-loc-detail, sits below the lat/lon/tz grid)
 * =================================================================== */

.tz-offset-row {
  margin-top: 0.625rem;
  padding-top: 0.625rem;
  border-top: 1px dashed var(--outline);
}
.tz-offset-input-row {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  margin-top: 0.5rem;
  flex-wrap: wrap;
}
.tz-offset-input-row[hidden] { display: none; }
.tz-offset-sign-label {
  font-size: 0.8125rem;
  color: var(--ink-muted);
  font-weight: 500;
}
.tz-offset-input-row select,
.tz-offset-input-row input[type="number"] {
  width: auto;
  min-width: 3rem;
  max-width: 4rem;
  padding: 0.375rem 0.5rem;
  font-size: 0.875rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  min-height: 32px;
}
.tz-offset-input-row select#home-nf-tz-offset-sign,
.tz-offset-input-row select#nf-tz-offset-sign {
  min-width: 2.5rem;
  max-width: 3rem;
  text-align: center;
}
.tz-offset-colon {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 1rem;
  color: var(--ink);
  font-weight: 600;
}

/* Greyed-out IANA select when custom offset is active */
#home-nf-tz-select:disabled,
#nf-tz-select:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* Hide the legacy "loc-detail" `hidden` attribute behavior — the fieldset
   stays visible whenever the form is shown (pre-populated by default). */
.natal-loc-detail[hidden] { display: none; }

/* =====================================================================
 * Visual lift: distinguish the natal-chart section from neighboring
 * white sections by using the theme's secondary surface tone, matching
 * the rhythm of the Benefits section a few stops below it.
 * =================================================================== */

.natal-page--lifted {
  background: var(--surface-2);
  border-top: 1px solid var(--outline);
  border-bottom: 1px solid var(--outline);
}

/* =====================================================================
 * Equal-height tabpanels with internal scroll
 *
 * Without this, swapping tabs makes the page height jump:
 *   Input Data  ~ 720px (the form)
 *   Natal Chart ~ 620px (the SVG wheel)
 *   Planets     ~ 540px (12 rows + Asc/MC summary)
 *   Aspects     ~ 720px (20 aspect rows)
 *
 * Pin all four to the same min-height and let any overflow scroll
 * inside the panel. The Natal Chart panel's wheel sets the floor.
 * =================================================================== */

.natal-tabpanel {
  min-height: 620px;
  max-height: 80vh;
  overflow-y: auto;
  overflow-x: hidden;
  /* Tiny inner padding so the scrollbar doesn't touch the wheel/table. */
  padding-right: 0.25rem;
  /* Smooth scroll inside the panel. */
  scroll-behavior: smooth;
}
/* On phones the wheel is smaller and the form longer — drop the floor
   and let the natural content height drive. */
@media (max-width: 640px) {
  .natal-tabpanel {
    min-height: 480px;
    max-height: none; /* don't trap scroll on small viewports */
    overflow-y: visible;
  }
}

/* Subtler scrollbar in WebKit/Blink to match the theme palette. */
.natal-tabpanel::-webkit-scrollbar { width: 6px; }
.natal-tabpanel::-webkit-scrollbar-track { background: transparent; }
.natal-tabpanel::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--ink-muted) 30%, transparent);
  border-radius: 3px;
}
.natal-tabpanel::-webkit-scrollbar-thumb:hover {
  background: color-mix(in srgb, var(--ink-muted) 50%, transparent);
}

/* =====================================================================
 * New hero CTA: "Try Free Vedic Natal Chart"
 * Uses the existing btn-secondary token so it sits visually between
 * btn-primary (Explore Programs) and btn-ghost (Apply Now).
 * =================================================================== */

/* Fallback in case the project's styles.css doesn't define btn-secondary
   yet — give it an outlined-primary look that fits the theme. */
.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.875rem 1.5rem;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--primary);
  background: transparent;
  border: 1.5px solid var(--primary);
  border-radius: 9999px;
  text-decoration: none;
  transition: background 160ms ease, color 160ms ease, transform 80ms ease;
}
.btn-secondary:hover,
.btn-secondary:focus-visible {
  background: var(--primary);
  color: var(--surface);
  outline: none;
}
.btn-secondary:active {
  transform: translateY(1px);
}

/* =====================================================================
 * v=4 (June 2026) — Form redesign pass.
 *
 * Goals:
 *   1) Fix the offset-input row that was stacking vertically (the
 *      `.natal-field input[type="number"] { width: 100% }` rule earlier
 *      in this file was winning on equal specificity for the
 *      ±HH / MM inputs nested in `.natal-field.tz-offset-row`).
 *   2) Tighter, more professional form hierarchy on desktop/tablet/phone.
 *   3) Inline attention banner (Steve Jobs demo notice) styled subtly.
 *   4) Prominent chart title above the wheel that reads as the name
 *      of the person whose chart is shown.
 *   5) Two-column layout on tablet+ for date/time pairs so the form is
 *      shorter and reads as a single visual block.
 *
 * All rules appended here win the cascade over earlier sections; no
 * earlier rule was removed. The selectors are minimally narrowed
 * (mostly increased specificity via `.natal-form-section …` or
 * `:where()` to keep weight low when needed). Designed to be a
 * drop-in append-only patch.
 * =================================================================== */

/* ---- 1) Inline attention banner (Input Data tab) ---- */
.natal-banner {
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
  margin: 0 0 1rem;
  padding: 0.625rem 0.875rem;
  background: color-mix(in srgb, var(--primary) 7%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--primary) 22%, var(--outline));
  border-left: 3px solid var(--primary);
  border-radius: 8px;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--ink);
}
.natal-banner__icon {
  flex: 0 0 auto;
  margin-top: 0.0625rem;
  color: var(--primary);
}

/* ---- 2) Chart title above the wheel (name of the charted person) ---- */
.natal-chart-title {
  margin: 0 0 0.125rem;
  font-family: "Noto Serif", serif;
  font-size: clamp(1.25rem, 0.9rem + 1vw, 1.75rem);
  font-weight: 600;
  letter-spacing: 0.005em;
  color: var(--primary);
  text-align: center;
  line-height: 1.2;
}
.natal-chart-title:empty { display: none; }

/* Tighten the default-caption underneath the (now larger) title. */
.natal-default-caption {
  margin-top: 0;
  margin-bottom: 0.875rem;
}

/* ---- 3) Form section: cleaner outer shell + tighter rhythm ---- */
.natal-form-section {
  /* Use the page surface so the form sits cleanly on the lifted
     section background, instead of repeating surface-2 (which made
     it blend into the section bg and lose definition). */
  background: var(--surface);
  border: 1px solid var(--outline);
  border-radius: 12px;
  padding: clamp(0.875rem, 1.5vw, 1.25rem) clamp(1rem, 2vw, 1.5rem);
}

/* On desktop+, group the four short fields (name / date / time
   / place) into two columns to compress vertical height. The
   location fieldset, consent block and submit row already span both
   columns via the earlier `grid-column: 1 / -1` rules. */
@media (min-width: 720px) {
  .natal-form {
    grid-template-columns: 1fr 1fr;
    column-gap: 1.25rem;
    row-gap: 0.875rem;
  }
  /* Name + place stay full-width — they're the longest text inputs
     and need room. Date + time pair up as two narrow columns. */
  .natal-field--name,
  .natal-field--combo {
    grid-column: 1 / -1;
  }
}

/* Date/time inputs on desktop are narrower — the native picker UI
   only needs ~10ch of width. Allow the natural shrink without
   stretching across the column. */
@media (min-width: 720px) {
  #home-nf-date,
  #home-nf-time,
  #nf-date,
  #nf-time {
    max-width: 14rem;
  }
}

/* ---- 4) Fine-tune location fieldset ----
   Make it visually quieter (it's optional) and tighter inside. */
.natal-loc-detail {
  background: var(--surface-2);
  border: 1px solid var(--outline);
  border-radius: 10px;
  padding: 0.75rem 0.875rem 0.625rem;
}
.natal-loc-detail > legend {
  padding: 0 0.4375rem;
  margin-left: 0.25rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
}
.natal-loc-detail .help {
  margin-top: 0.5rem;
}

/* ---- 5) Custom UTC offset: visually fuse the checkbox + input row
   so they read as ONE control, not three stacked sub-sections. ---- */
.tz-offset-row {
  margin-top: 0.625rem;
  padding-top: 0.625rem;
  border-top: 1px dashed var(--outline);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.875rem;
}
.tz-offset-row > .inline-check {
  flex: 0 0 auto;
}

/* ---- 6) CRITICAL FIX for the offset-input row stacking vertically.
   The earlier rule `.natal-field input[type="number"] { width: 100% }`
   was matching the offset hours/minutes inputs because they sit inside
   a `.natal-field.tz-offset-row` wrapper. Higher-specificity selectors
   here force inline sizing. The `!important` on width is justified
   because the entire row's layout depends on it and overriding by
   selector specificity alone is fragile when third-party CSS lands
   in the cascade. ---- */
.tz-offset-input-row {
  display: inline-flex !important;
  flex: 0 0 auto;
  align-items: center;
  gap: 0.375rem;
  margin-top: 0;
  flex-wrap: nowrap;
}
.tz-offset-input-row[hidden] { display: none !important; }

.natal-field.tz-offset-row .tz-offset-input-row > select,
.natal-field.tz-offset-row .tz-offset-input-row > input[type="number"],
#home-nf-loc-detail .tz-offset-input-row > select,
#home-nf-loc-detail .tz-offset-input-row > input[type="number"],
#nf-loc-detail .tz-offset-input-row > select,
#nf-loc-detail .tz-offset-input-row > input[type="number"] {
  width: auto !important;
  flex: 0 0 auto;
  min-width: 0;
  padding: 0.3125rem 0.4375rem;
  font-size: 0.875rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  min-height: 32px;
  text-align: center;
}

/* Sign select: just `+` or `−`, 2.25rem is plenty. */
#home-nf-loc-detail .tz-offset-input-row > select#home-nf-tz-offset-sign,
#nf-loc-detail .tz-offset-input-row > select#nf-tz-offset-sign {
  width: 2.75rem !important;
}

/* Hours / minutes: ~3rem each fits two digits comfortably. */
#home-nf-loc-detail .tz-offset-input-row > input#home-nf-tz-offset-hours,
#home-nf-loc-detail .tz-offset-input-row > input#home-nf-tz-offset-minutes,
#nf-loc-detail .tz-offset-input-row > input#nf-tz-offset-hours,
#nf-loc-detail .tz-offset-input-row > input#nf-tz-offset-minutes {
  width: 3rem !important;
}

.tz-offset-sign-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--ink-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.tz-offset-colon {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink);
  padding: 0 0.0625rem;
}

/* Phone: allow the offset row to wrap below its checkbox label but
   each spinner stays on a single inline line. */
@media (max-width: 520px) {
  .tz-offset-row {
    gap: 0.5rem 0.625rem;
  }
  .tz-offset-input-row {
    width: 100%;
  }
}

/* ---- 7) Consent block — quieter so it feels procedural, not a wall. */
.natal-form .consent {
  padding: 0.625rem 0.75rem;
  background: var(--surface-2);
  border: 1px solid var(--outline);
  border-radius: 8px;
  font-size: 0.8125rem;
}
.natal-form .consent .inline-check {
  font-size: 0.8125rem;
}

/* ---- 8) Submit row — left-aligned button, comfortable click target. */
.natal-field--submit {
  align-items: flex-start;
}
.natal-field--submit .btn {
  min-width: 13rem;
  padding: 0.5625rem 1.25rem;
  font-size: 0.9375rem;
}
@media (max-width: 520px) {
  .natal-field--submit .btn {
    width: 100%;
    min-width: 0;
  }
}

/* ---- 9) Tabpanel padding nudge — the panel had a min-height of 620px
   with internal scroll which fights with the new compact form. Allow
   the Input Data panel to size to its (now smaller) content rather
   than scrolling. ---- */
/* DELETED: the prior block here removed the min-height pin on the Input
   Data panel, which caused tab swaps to jump by ~360px (form ≈ 540px vs
   wheel ≈ 900px). The user explicitly asked tabs to align to the wheel
   height, so we let the v=5 .natal-tabpanel min-height rule apply to
   ALL panels including Input Data. The form is shorter than the wheel,
   so the Input Data panel reserves the empty space on the
   --surface-2 background — that's the intentional alignment. */

/* ---- v=5 patch ----
   (a) Remove the white card around the wheel. The wheel SVG sits
       directly on the section's lifted --surface-2 background — no
       inner panel, no 1px outline, no inner gap. This overrides the
       earlier `.natal-wheel-wrap { background/border/padding }` block
       at lines 305-313.
   (b) Lock the wheel to a true 1:1 square (matching the SVG's
       0 0 100 100 viewBox) so its rendered height is predictable.
   (c) Pin every tabpanel to that same rendered wheel height so
       Input / Planets / Aspects don't reflow when the user swaps
       tabs. Replaces the hardcoded 620px floor from lines 761-770.
   ---- */
.natal-wheel-wrap {
  max-width: 720px;
  aspect-ratio: 1 / 1;
  background: transparent;
  border: 0;
  padding: 0;
  border-radius: 0;
}
.natal-wheel-wrap svg { height: 100%; }

.natal-tabpanel {
  /* Match the Natal Chart tab's actual rendered height so swapping
     tabs does not jump the page. Chart panel = wheel (square, capped
     at 720px) + chart-title + caption + meta + section padding ≈
     180px overhead. The wheel + 180 ≈ 900 on desktop; on phones the
     wheel is `100vw - 2rem` and overhead drops a hair (no extra
     attribution line in the panel itself), so ~ +120 is enough. */
  /* Wrap the viewport arithmetic in explicit calc() — older mobile
     browsers (Safari iOS <14, Samsung Internet) are stricter about
     mixing units inside min() without a calc(); without it the rule
     can be dropped entirely on those engines. */
  min-height: min(900px, calc(100vw - 2rem + 180px));
  max-height: none;
  overflow: visible;
}
@media (max-width: 640px) {
  .natal-tabpanel {
    /* Phone: square wheel = viewport minus the section's 1rem horizontal
       padding on each side, plus ~120px chart overhead. */
    min-height: calc(100vw - 2rem + 120px);
  }
}

/* ---- v=10 patch — famous-people picker ----
   The name input is now a <input list="..."> combobox backed by a
   <datalist>. Native <datalist> styling is locked-down per platform
   (browsers render the popup in OS chrome), so this patch only
   tweaks the INPUT field itself:
     • subtle dropdown caret to hint at the list affordance
     • spacing for the caret so it doesn't overlap typed text
   The popup itself (rendered by the browser) is intentionally not
   styled — keeping native look/feel for accessibility and to avoid
   the layout shifts that custom dropdowns cause on iOS keyboards.
   ---- */
.natal-field--name input[list] {
  /* Right padding leaves room for the chevron we paint with a
     background-image. Using SVG-in-data-URI avoids loading an
     extra HTTP asset on this critical page. */
  padding-right: 2rem;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none' stroke='%23717179' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='1 1 6 6 11 1'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.85rem center;
}
/* Firefox renders its own caret on <input list>; hide ours so we
   don't double-up. Detection via the Mozilla-only -moz-appearance
   selector is fragile, so we use @-moz-document instead. */
@-moz-document url-prefix() {
  .natal-field--name input[list] {
    background-image: none;
    padding-right: 1rem;
  }
}

/* =====================================================================
 * Astrocartography map (Relocation / Immigration / Soulmate tabs).
 * ---------------------------------------------------------------------
 * The astrocarto panels render a vector world map: ocean background,
 * graticule, heat-matrix cells, continent outlines, and planet lines.
 *
 * Heat palette: five RGB stops defined as CSS custom properties so they
 * can be overridden per theme (sanctuary / glacier / saffron / amethyst).
 * The default stops produce a temperature-style ramp:
 *   --heat-0   deep night blue   (low scores, neutral terrain)
 *   --heat-25  ocean indigo
 *   --heat-50  warm dusk olive   (~neutral / workable territory)
 *   --heat-75  burnt gold        (strong, favorable)
 *   --heat-100 deep ember red    (peak intensity)
 *
 * Stops match the palette designer's "iyogau-default" recommendation:
 * cool-to-warm with the gold midband acting as a smooth bridge to the
 * site's existing --gold / --primary tokens. Per-theme overrides at the
 * bottom of the file pull the cool/warm extremes toward each theme's
 * native hue family.
 * =================================================================== */

:root {
  --heat-0:   #1b2538;
  --heat-25:  #2c4b67;
  --heat-50:  #7a8a6b;
  --heat-75:  #d6a352;
  --heat-100: #c64c3d;
  --astrocarto-ocean: #e9eef2;
  --astrocarto-land:  #f5efe2;
  --astrocarto-graticule: #c5c8cf;
}

/* Sanctuary (default) — sage + gold theme. Already covered by :root. */

:root[data-theme="glacier"] {
  --heat-0:   #1a2235;
  --heat-25:  #20435a;
  --heat-50:  #5a8095;
  --heat-75:  #d3ae5f;
  --heat-100: #d05d2e;
  --astrocarto-ocean: #1f2d3a;
  --astrocarto-land:  #2c3a48;
  --astrocarto-graticule: #4d5b6a;
}

:root[data-theme="saffron"] {
  --heat-0:   #2a1e10;
  --heat-25:  #5e3a16;
  --heat-50:  #b07527;
  --heat-75:  #e3a346;
  --heat-100: #c1391e;
  --astrocarto-ocean: #f3e4cd;
  --astrocarto-land:  #fbf1d9;
  --astrocarto-graticule: #c8a972;
}

:root[data-theme="amethyst"] {
  --heat-0:   #1e1837;
  --heat-25:  #3b2e6e;
  --heat-50:  #7a6c9c;
  --heat-75:  #c89e6b;
  --heat-100: #c1453c;
  --astrocarto-ocean: #f0eaf8;
  --astrocarto-land:  #f8f2fb;
  --astrocarto-graticule: #c4b5d8;
}

/* ---------- Panel container ---------- */

.astrocarto-panel {
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
  padding-block: 0.25rem;
}
.astrocarto-panel__intro {
  margin: 0;
  font-size: 0.9375rem;
  color: var(--ink-muted);
  line-height: 1.5;
  max-width: 60ch;
}

/* ---------- Map wrap ---------- */

.astrocarto-map {
  position: relative;
  width: 100%;
  max-width: 1000px;
  aspect-ratio: 2 / 1;
  margin: 0 auto;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--outline);
  background: var(--astrocarto-ocean);
}
.astrocarto-svg {
  display: block;
  width: 100%;
  height: 100%;
}

.astrocarto-ocean {
  fill: var(--astrocarto-ocean);
}
.astrocarto-graticule line {
  stroke: var(--astrocarto-graticule);
  stroke-width: 0.5;
  stroke-opacity: 0.55;
}
.astrocarto-equator {
  stroke: var(--astrocarto-graticule) !important;
  stroke-width: 0.75 !important;
  stroke-opacity: 0.85 !important;
  stroke-dasharray: 3 3;
}
.astrocarto-land {
  /* Outline only; the heat-matrix beneath provides the color signal. A
     dark, mostly-opaque stroke keeps continent shapes legible without
     fighting the heat colors for attention. */
  fill: var(--astrocarto-land);
  fill-opacity: 0.0;
  stroke: var(--ink);
  stroke-width: 0.9;
  stroke-opacity: 0.6;
  pointer-events: none;
}
.astrocarto-heat {
  /* Heat-matrix layer — a grid of per-cell <rect>s clipped to land.
     Pointer-events disabled so the transparent .astrocarto-tip-surface
     above us still receives mousemove/click for the tooltip. */
  pointer-events: none;
}
.astrocarto-cell {
  /* One rect per (lat, lon) sample. Fill + fill-opacity set per-element
     in JS (see astrocarto.js → colorForValue + cellOpacity); we only
     need shape-rendering tweaks here. crispEdges suppresses the
     anti-aliasing seams that would otherwise show between adjacent
     cells of the same color in some browsers. */
  stroke: none;
  shape-rendering: crispEdges;
}
.astrocarto-line {
  pointer-events: none;
  mix-blend-mode: normal;
  opacity: 0.85;
}
.astrocarto-line--mc { stroke-opacity: 0.9; }
.astrocarto-line--ic { stroke-opacity: 0.75; }
.astrocarto-line--ac { stroke-opacity: 0.85; }
.astrocarto-line--dc { stroke-opacity: 0.85; }
.astrocarto-tip-surface {
  cursor: crosshair;
}

/* ---------- Tooltip ---------- */

.astrocarto-tooltip {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 5;
  pointer-events: none;
  min-width: 180px;
  max-width: 260px;
  padding: 0.5rem 0.625rem 0.6rem;
  font-size: 0.8125rem;
  line-height: 1.35;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--outline);
  border-radius: 8px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
}
.astrocarto-tooltip[hidden] { display: none; }
.astrocarto-tip__head { display: flex; justify-content: space-between; gap: 0.25rem; align-items: baseline; }
.astrocarto-tip__coords { font-size: 0.75rem; color: var(--ink-muted); }
.astrocarto-tip__listhead {
  margin-top: 0.375rem;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-muted);
}
.astrocarto-tip__list {
  list-style: none;
  margin: 0.25rem 0 0;
  padding: 0;
}
.astrocarto-tip__list li {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.125rem 0;
}
.astrocarto-tip__swatch {
  display: inline-block;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  flex: 0 0 0.5rem;
}
.astrocarto-tip__empty {
  margin-top: 0.375rem;
  font-style: italic;
  color: var(--ink-muted);
}

/* ---------- Legend ---------- */

.astrocarto-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem 1.75rem;
  padding: 0.5rem 0.25rem;
  font-size: 0.8125rem;
  color: var(--ink);
}
.astrocarto-legend__planets,
.astrocarto-legend__types,
.astrocarto-legend__heat {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}
.astrocarto-legend__title {
  font-weight: 600;
  margin-right: 0.25rem;
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.6875rem;
}
.astrocarto-legend__planet,
.astrocarto-legend__type {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}
.astrocarto-legend__swatch {
  display: inline-block;
  width: 0.625rem;
  height: 0.625rem;
  border-radius: 50%;
}
.astrocarto-legend__line {
  display: inline-block;
  width: 1.5rem;
  height: 0.125rem;
  background: var(--ink);
  vertical-align: middle;
}
.astrocarto-legend__line--mc { background: var(--ink); }
.astrocarto-legend__line--ic {
  background: linear-gradient(to right, var(--ink) 70%, transparent 70%);
  background-size: 0.75rem 100%;
}
.astrocarto-legend__line--ac {
  background: linear-gradient(to right, var(--ink) 60%, transparent 60%);
  background-size: 0.5rem 100%;
}
.astrocarto-legend__line--dc {
  background: radial-gradient(circle, var(--ink) 50%, transparent 50%);
  background-size: 0.25rem 100%;
  background-repeat: repeat-x;
  background-position: 0 50%;
  height: 0.18rem;
}
.astrocarto-legend__heatbar {
  display: inline-block;
  width: 8rem;
  height: 0.5rem;
  border-radius: 3px;
  background: linear-gradient(to right,
    var(--heat-0)   0%,
    var(--heat-25)  25%,
    var(--heat-50)  50%,
    var(--heat-75)  75%,
    var(--heat-100) 100%
  );
  border: 1px solid var(--outline);
}
.astrocarto-legend__heatlabels {
  font-size: 0.75rem;
  color: var(--ink-muted);
}

/* ---------- Loading + error states ---------- */

.astrocarto-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 6rem;
  gap: 0.5rem;
  padding: 1rem;
  text-align: center;
  font-size: 0.9375rem;
  color: var(--ink-muted);
}
.astrocarto-state[hidden] { display: none; }
.astrocarto-state__spinner {
  width: 1.25rem;
  height: 1.25rem;
  border: 2px solid var(--outline);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: astrocarto-spin 0.8s linear infinite;
}
@keyframes astrocarto-spin { to { transform: rotate(360deg); } }
.astrocarto-state--error {
  color: var(--ink);
  background: color-mix(in srgb, var(--gold-faint) 60%, transparent);
  border: 1px solid var(--outline);
  border-radius: 8px;
  font-style: italic;
}

/* Narrow viewports — let the map shrink gracefully. The aspect-ratio
   keeps the 2:1 shape, so width contracts proportionally. */
@media (max-width: 560px) {
  .astrocarto-legend { gap: 0.75rem 1rem; font-size: 0.75rem; }
  .astrocarto-legend__heatbar { width: 6rem; }
  .astrocarto-tooltip { font-size: 0.75rem; min-width: 150px; max-width: 220px; }
}
