/* ==========================================================================
   ORION ASTROLOGY — DESIGN SYSTEM
   Direction: Dawn Vedic
   This file is the single source of truth for color, type, spacing, and
   core components. Every redesigned page loads this file first, then only
   adds page-specific layout — never redefines these tokens.
   ========================================================================== */

:root {
  /* ---- Color: surfaces ---- */
  --bg-page: #F6F1E7;          /* warm cream canvas */
  --bg-card: #FFFDF8;          /* slightly lifted card surface */
  --bg-card-alt: #FBF6EC;      /* secondary card / stripe */
  --bg-sunken: #EFE7D6;        /* wells, input backgrounds */
  --border-soft: #E6DCC6;      /* default hairline */
  --border-strong: #D8C9A8;    /* emphasized divider */

  /* ---- Color: text ---- */
  --text-primary: #2A2117;     /* ink */
  --text-secondary: #6B5A44;   /* muted brown-gray */
  --text-muted: #9C8D75;       /* placeholders, captions */
  --text-on-accent: #FBEEE8;   /* text on maroon fill */
  --text-on-gold: #3A2A12;     /* text on saffron fill */

  /* ---- Color: brand accents ---- */
  --accent-maroon: #8C2A3A;
  --accent-maroon-hover: #7A2230;
  --accent-saffron: #E8A33D;
  --accent-saffron-hover: #D6922E;
  --accent-teal: #3E7C74;      /* secondary accent: links, info */

  /* ---- Color: semantic ---- */
  --success: #4B7B4E;
  --success-bg: #E7F0E1;
  --warning: #C97A2B;
  --warning-bg: #FBEEDB;
  --danger: #A33B3B;
  --danger-bg: #F7E7E3;

  /* ---- Typography ---- */
  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'Work Sans', -apple-system, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, monospace;

  --fs-caption: 0.8125rem;   /* 13px */
  --fs-body: 0.9375rem;      /* 15px */
  --fs-body-lg: 1.0625rem;   /* 17px */
  --fs-h3: 1.375rem;         /* 22px */
  --fs-h2: 1.75rem;          /* 28px */
  --fs-h1: 2.5rem;           /* 40px */
  --fs-display: 3.25rem;     /* 52px */

  --lh-body: 1.65;
  --lh-heading: 1.2;

  /* ---- Spacing (rem, 8px base) ---- */
  --space-1: 0.5rem;
  --space-2: 0.75rem;
  --space-3: 1rem;
  --space-4: 1.5rem;
  --space-5: 2rem;
  --space-6: 3rem;
  --space-7: 4.5rem;
  --space-8: 6rem;

  /* ---- Radius ---- */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-pill: 999px;

  /* ---- Shadow (soft, warm-tinted — never cool gray) ---- */
  --shadow-sm: 0 1px 2px rgba(58, 42, 18, 0.06);
  --shadow-md: 0 4px 16px rgba(58, 42, 18, 0.08);
  --shadow-lg: 0 12px 32px rgba(58, 42, 18, 0.12);

  /* ---- Motion ---- */
  --dur-fast: 120ms;
  --dur-base: 200ms;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ==========================================================================
   RESET / BASE
   ========================================================================== */

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

body {
  background: var(--bg-page);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  margin: 0;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: var(--lh-heading);
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 var(--space-3);
}
h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }

p { margin: 0 0 var(--space-3); color: var(--text-secondary); }

a { color: var(--accent-teal); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Numeric/data display — degrees, times, dates, chart coordinates */
.data, .num, time {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
}

/* ==========================================================================
   SIGNATURE ELEMENT — hairline compass motif
   Use above section headings on report/chart pages. One color, one weight,
   never decorative beyond this.
   ========================================================================== */

.compass-mark {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
}
.compass-mark::before {
  content: '';
  width: 20px;
  height: 20px;
  border: 1px solid var(--accent-saffron);
  border-radius: 50%;
  background:
    linear-gradient(var(--accent-saffron), var(--accent-saffron)) center / 1px 8px no-repeat,
    linear-gradient(90deg, var(--accent-saffron), var(--accent-saffron)) center / 8px 1px no-repeat;
}
.compass-mark span {
  font-family: var(--font-body);
  font-size: var(--fs-caption);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-maroon);
  font-weight: 600;
}

/* ==========================================================================
   BUTTONS
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  font-weight: 600;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}
.btn:active { transform: scale(0.98); }

.btn-primary {
  background: var(--accent-maroon);
  color: var(--text-on-accent);
}
.btn-primary:hover { background: var(--accent-maroon-hover); }

.btn-secondary {
  background: transparent;
  color: var(--accent-maroon);
  border-color: var(--accent-maroon);
}
.btn-secondary:hover { background: var(--danger-bg); }

.btn-gold {
  background: var(--accent-saffron);
  color: var(--text-on-gold);
}
.btn-gold:hover { background: var(--accent-saffron-hover); }

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: var(--border-strong);
}
.btn-ghost:hover { background: var(--bg-sunken); }

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ==========================================================================
   CARDS
   ========================================================================== */

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  box-shadow: var(--shadow-sm);
}

.card-elevated {
  box-shadow: var(--shadow-md);
}

.card-title { font-size: var(--fs-h3); margin-bottom: var(--space-1); }
.card-subtitle { color: var(--text-muted); font-size: var(--fs-caption); margin-bottom: var(--space-3); }

/* ==========================================================================
   FORMS
   ========================================================================== */

label {
  display: block;
  font-size: var(--fs-caption);
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: var(--space-1);
}

input, select, textarea {
  width: 100%;
  font-family: var(--font-body);
  font-size: var(--fs-body);
  color: var(--text-primary);
  background: var(--bg-sunken);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  padding: 0.7rem 0.9rem;
  transition: border-color var(--dur-fast) var(--ease-out);
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent-maroon);
  box-shadow: 0 0 0 3px rgba(140, 42, 58, 0.12);
}
input::placeholder { color: var(--text-muted); }

.field { margin-bottom: var(--space-4); }
.field-hint { font-size: var(--fs-caption); color: var(--text-muted); margin-top: var(--space-1); }

/* ==========================================================================
   BADGES / TAGS
   ========================================================================== */

.badge {
  display: inline-flex;
  align-items: center;
  font-size: var(--fs-caption);
  font-weight: 600;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-pill);
}
.badge-gold { background: rgba(232, 163, 61, 0.18); color: #8A5A16; }
.badge-maroon { background: var(--danger-bg); color: var(--accent-maroon); }
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }

/* ==========================================================================
   ALERTS / STATUS BLOCKS
   ========================================================================== */

.alert {
  display: flex;
  gap: var(--space-2);
  padding: var(--space-3);
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  font-size: var(--fs-body);
}
.alert-success { background: var(--success-bg); border-color: var(--success); color: #2F5731; }
.alert-warning { background: var(--warning-bg); border-color: var(--warning); color: #7A4A17; }
.alert-danger  { background: var(--danger-bg);  border-color: var(--danger);  color: #6E2323; }

/* ==========================================================================
   NAVIGATION
   ========================================================================== */

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--space-5);
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-soft);
}
.nav-brand {
  font-family: var(--font-display);
  font-size: var(--fs-h3);
  font-weight: 600;
  color: var(--accent-maroon);
}
.nav-links { display: flex; gap: var(--space-4); list-style: none; padding: 0; margin: 0; }
.nav-links a {
  color: var(--text-secondary);
  font-size: var(--fs-body);
  font-weight: 500;
}
.nav-links a:hover { color: var(--accent-maroon); text-decoration: none; }
.nav-links a.active { color: var(--accent-maroon); }

/* ==========================================================================
   DIVIDERS
   ========================================================================== */

.divider {
  border: none;
  border-top: 1px solid var(--border-soft);
  margin: var(--space-5) 0;
}

.divider-ornamental {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin: var(--space-6) 0;
  color: var(--accent-saffron);
}
.divider-ornamental::before,
.divider-ornamental::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-strong);
}

/* ==========================================================================
   UTILITY
   ========================================================================== */

.container { max-width: 1160px; margin: 0 auto; padding: 0 var(--space-4); }
.text-muted { color: var(--text-muted); }
.text-center { text-align: center; }
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; }

/* ==========================================================================
   SITE CHROME — header, nav, footer, chat button
   Shared across every page. Built dynamically into [data-shared-header] by
   theme.js — these classes are generated at runtime, not written by hand
   into each page's HTML.
   ========================================================================== */

body.has-shared-header { padding-top: 0; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--bg-page);
  border-bottom: 1px solid var(--border-soft);
}
.site-header__inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-4);
}

.site-brand { display: flex; align-items: center; gap: 10px; }
/* Sunrise mark. Was a solid maroon disc with an inset saffron ring; both are
   dropped so the disc can't show through behind the transparent SVG. */
.site-brand__mark {
  width: 34px; height: 34px;
  background: url("assets/logo/orion-sunrise-icon.svg") center / contain no-repeat;
  position: relative;
  flex-shrink: 0;
}
.site-brand__mark::after { content: none; }
.site-brand__text { display: flex; flex-direction: column; line-height: 1.1; }
.site-brand__text strong { font-family: var(--font-display); font-size: 17px; color: var(--text-primary); }
.site-brand__text span { font-size: 12px; letter-spacing: 0.14em; color: var(--text-muted); }

.site-nav { display: flex; align-items: center; gap: var(--space-3); flex: 1; justify-content: center; flex-wrap: nowrap; }
.site-nav > a, .site-nav__parent {
  font-family: var(--font-body);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-secondary);
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px 2px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}
.site-nav > a:hover, .site-nav__parent:hover, .site-nav > a.is-current, .site-nav__parent[aria-expanded="true"] {
  color: var(--accent-maroon);
  text-decoration: none;
}
.site-nav__chevron { font-size: 12px; }
.site-nav__badge {
  font-size: 12px;
  background: var(--accent-saffron);
  color: var(--text-on-gold);
  padding: 1px 6px;
  border-radius: var(--radius-pill);
  font-weight: 700;
}
.site-nav__group { position: relative; }
.site-nav__submenu {
  display: none;
  position: absolute;
  top: 100%; left: 0;
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  padding: var(--space-1);
  min-width: 200px;
  z-index: 10;
}
.site-nav__group:hover .site-nav__submenu,
.site-nav__group.is-open .site-nav__submenu { display: block; }
.site-nav__submenu a {
  display: block;
  padding: 8px 12px;
  font-size: 13.5px;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
}
.site-nav__submenu a:hover { background: var(--bg-sunken); color: var(--accent-maroon); text-decoration: none; }
.site-nav__overview { font-weight: 600; color: var(--text-primary) !important; }

.site-header__actions { display: flex; align-items: center; gap: var(--space-2); }

/* ---- Chart selector — "Viewing chart" dropdown for logged-in users ----
   mountChartSelector() always creates two copies: one for the desktop
   header (.chart-selector), one for the mobile nav drawer
   (.chart-selector--mobile). Exactly one must be visible at a time. */
.chart-selector {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-right: var(--space-1);
}
.chart-selector span {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  white-space: nowrap;
}
.chart-selector select {
  width: auto;
  max-width: 150px;
  font-size: 12.5px;
  padding: 6px 10px;
  border-radius: var(--radius-pill);
  background: var(--bg-sunken);
  border: 1px solid var(--border-soft);
}
.chart-selector--mobile { display: none; }
.header-chat-button, .header-auth-button {
  font-size: 13.5px;
  font-weight: 600;
  /* Pinned so Chat, Profile and the credits chip all land on the same 40px
     control height — the chip's inner elements set their own line box and
     otherwise leave it 2px taller than its siblings. */
  line-height: 1.65;
  padding: 8px 16px;
  border-radius: var(--radius-pill);
}
.header-chat-button { background: var(--accent-maroon); color: var(--text-on-accent); }
.header-chat-button:hover { background: var(--accent-maroon-hover); text-decoration: none; }
.header-chat-button.is-current { outline: 2px solid var(--accent-saffron); outline-offset: 2px; }
.header-auth-button { color: var(--text-secondary); border: 1px solid var(--border-strong); }
.header-auth-button:hover { background: var(--bg-sunken); text-decoration: none; }

/* Credits chip — a wallet readout, not a call to action, so it takes an amber
   wash rather than a third solid pill beside Chat and Profile. Was styled only
   in the legacy layers, which left it as bare 15px text on the pages that load
   the design system alone. */
.header-credits-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.65;
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(186, 117, 23, 0.32);
  background: rgba(232, 163, 61, 0.16);
  color: #854F0B;
}
.header-credits-chip:hover { background: rgba(232, 163, 61, 0.24); text-decoration: none; }
.header-credits-chip__balance { color: #4A1B0C; }

/* Just above the drawer breakpoint the brand, the nine inline nav links and a
   logged-in action row (chart picker + credits + Chat + Profile) only barely
   fit. Tighten the elastic parts so the header compresses instead of pushing
   the whole page into a horizontal scroll: closer nav gaps, slimmer buttons,
   and the chart picker down to its select alone — the select carries its own
   aria-label, so dropping the visible caption costs nothing but width. Pages
   that also load theme.css style the picker at a higher specificity and keep
   their own treatment. */
@media (min-width: 1180.02px) and (max-width: 1320px) {
  .site-nav { gap: 8px; }
  .site-header__actions > .chart-selector { margin-right: 0; }
  .site-header__actions > .chart-selector span { display: none; }
  .site-header__actions > .chart-selector select { max-width: 128px; }
  .header-chat-button, .header-auth-button { padding-inline: 12px; }
}

.mobile-menu-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}
.mobile-menu-toggle span { width: 20px; height: 2px; background: var(--text-primary); border-radius: 2px; }

.site-nav-backdrop {
  display: none;
  position: fixed;
  top: 0; right: 0; bottom: 0; left: 0;
  width: 100vw; height: 100vh;
  margin: 0; padding: 0;
  background: rgba(42, 33, 23, 0.35);
  border: none;
  z-index: 39;
}
.site-header:has(.site-nav.is-open) .site-nav-backdrop { display: block; }

/* Drawer breakpoint. theme.js switches the header to drawer behaviour at
   1180px (see its resize/pointerleave handlers) and theme.css hides the inline
   nav there too, so the panel styling has to start at the same width — at 860
   the 861-1180px band opened as an unstyled, transparent full-bleed sheet. */
@media (max-width: 1180px) {
  /* Dawn Vedic mobile drawer — cream paper panel, maroon accents (home theme) */
  .site-nav {
    position: fixed;
    top: 0;
    right: 0;
    left: auto;
    width: min(18.5rem, 82vw);
    max-width: 18.5rem;
    height: 100vh;
    height: 100dvh;
    background: #FFFDF8;
    background-image: linear-gradient(180deg, #FFFDF8 0%, #FBF6EC 100%);
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 0;
    padding:
      calc(1.15rem + var(--orion-safe-top, env(safe-area-inset-top, 0px)))
      1.15rem
      calc(1.5rem + var(--orion-safe-bottom, env(safe-area-inset-bottom, 0px)));
    border-left: 1px solid #E6DCC6;
    box-shadow: -12px 0 40px rgba(58, 42, 18, 0.14);
    transform: translateX(105%);
    transition: transform var(--dur-base) var(--ease-out);
    z-index: 1200;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    visibility: hidden;
    pointer-events: none;
  }
  .site-nav.is-open {
    transform: translateX(0);
    visibility: visible;
    pointer-events: auto;
  }

  .site-nav > a,
  .site-nav__parent {
    width: 100%;
    justify-content: space-between;
    padding: 0.9rem 0.35rem;
    margin: 0;
    border: 0;
    border-bottom: 1px solid #EFE2CE;
    border-radius: 0;
    color: #2A2117;
    font-size: 0.98rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    background: transparent;
    box-shadow: none;
    text-align: left;
  }

  .site-nav > a:hover,
  .site-nav > a:focus-visible,
  .site-nav > a.is-current,
  .site-nav > a[aria-current="page"],
  .site-nav__parent:hover,
  .site-nav__parent:focus-visible,
  .site-nav__parent[aria-expanded="true"],
  .site-nav__group.is-open > .site-nav__parent,
  .site-nav__group.is-current > .site-nav__parent {
    color: #8C2A3A;
    background: transparent;
    text-decoration: none;
  }

  .site-nav > a[aria-current="page"]::after,
  .site-nav > a.is-current::after {
    display: none;
  }

  .site-nav__chevron {
    color: #9C8D75;
    transition: transform var(--dur-fast) var(--ease-out);
  }
  .site-nav__parent[aria-expanded="true"] .site-nav__chevron,
  .site-nav__group.is-open > .site-nav__parent .site-nav__chevron {
    color: #8C2A3A;
    transform: rotate(180deg);
  }

  .site-nav__group { width: 100%; }
  .site-nav__submenu {
    position: static;
    display: none;
    min-width: 0;
    width: 100%;
    margin: 0 0 0.25rem;
    padding: 0.15rem 0 0.45rem 0.85rem;
    border: 0;
    border-left: 2px solid #E8C77E;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }
  .site-nav__group.is-open .site-nav__submenu { display: grid; gap: 0; }

  .site-nav__submenu a {
    display: block;
    width: 100%;
    padding: 0.65rem 0.4rem;
    border: 0;
    border-bottom: 1px solid rgba(230, 220, 198, 0.7);
    border-radius: 0;
    color: #6B5A44;
    font-size: 0.9rem;
    font-weight: 500;
    background: transparent;
    box-shadow: none;
  }
  .site-nav__submenu a:last-child { border-bottom: 0; }
  .site-nav__submenu a:hover,
  .site-nav__submenu a:focus-visible,
  .site-nav__submenu a[aria-current="page"],
  .site-nav__submenu a.is-current {
    color: #8C2A3A;
    background: transparent;
    text-decoration: none;
  }
  .site-nav__overview {
    color: #3C1219 !important;
    font-weight: 700 !important;
  }

  .site-nav__badge {
    background: #E8A33D;
    color: #3A2A12;
    border: 0;
    box-shadow: none;
  }

  .mobile-menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    min-height: 44px;
    padding: 0;
    border: 1px solid #E6DCC6;
    border-radius: 999px;
    background: #FFFDF8;
    box-shadow: none;
  }
  .mobile-menu-toggle span {
    width: 1.1rem;
    height: 2px;
    background: #2A2117;
    border-radius: 2px;
  }
  .mobile-menu-toggle[aria-expanded="true"] {
    border-color: rgba(140, 42, 58, 0.35);
    background: #FFF8EC;
  }

  .site-nav-backdrop {
    background: rgba(42, 33, 23, 0.42);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
  }

  .site-header__actions > .chart-selector { display: none; }
  .chart-selector--mobile {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
    margin: 0 0 0.85rem;
    padding: 0 0 0.95rem;
    border-bottom: 1px solid #E6DCC6;
    gap: 0.35rem;
  }
  /* Matches the desktop caption and the value site-header-dawn.css pins for
     the other 46 pages, so the drawer picker is the same lockup everywhere. */
  .chart-selector--mobile span {
    color: #9C8D75;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.4;
    letter-spacing: 0.06em;
    text-transform: uppercase;
  }
  .chart-selector--mobile select {
    width: 100%;
    max-width: none;
    margin-top: 0;
    border: 1px solid #E6DCC6;
    border-radius: 999px;
    background: #FFF8EC;
    color: #2A2117;
  }
}

/* Phone action row. The pages that stack the legacy layers resolve the same
   squeeze a different way — monochrome-theme.css drops Chat below 420px and
   keeps Login/Profile, and mobile.css lets the wordmark ellipsise from 767px
   down — so the bar fits there while these two pages ran ~34px over once the
   credits chip gained its pill. Matched here rather than left to diverge. */
@media (max-width: 767px) {
  .site-brand, .site-brand__text { min-width: 0; }
  .site-brand__text strong,
  .site-brand__text > span { overflow: hidden; text-overflow: ellipsis; }
}

@media (max-width: 420px) {
  .site-header__actions .header-chat-button { display: none; }
}

/* ---- Footer ---- */
.site-footer {
  background: var(--bg-card-alt);
  border-top: 1px solid var(--border-soft);
  padding: var(--space-6) 0 var(--space-4);
  margin-top: var(--space-7);
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: var(--space-5);
}
@media (max-width: 800px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
.footer-grid h3 { font-size: var(--fs-h3); margin-bottom: var(--space-2); }
.footer-brand-lockup {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: var(--space-2);
}
.footer-brand-lockup > span {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--accent-maroon); color: var(--text-on-accent);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 600; font-size: 15px;
  flex-shrink: 0;
}
.footer-brand-lockup strong { display: block; font-family: var(--font-display); font-size: 17px; color: var(--text-primary); }
.footer-brand-lockup small { display: block; font-size: 12px; letter-spacing: 0.12em; color: var(--text-muted); }
.footer-grid h4 { font-family: var(--font-body); font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); margin-bottom: var(--space-2); }
.footer-grid a { display: block; color: var(--text-secondary); font-size: 14px; padding: 4px 0; }
.footer-grid a:hover { color: var(--accent-maroon); text-decoration: none; }
.social-row { display: flex; gap: var(--space-2); margin-top: var(--space-3); }
.social-row span {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--bg-sunken); color: var(--text-secondary);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
}
.footer-bottom { border-top: 1px solid var(--border-soft); margin-top: var(--space-5); padding-top: var(--space-3); text-align: center; }
.footer-bottom p { color: var(--text-muted); font-size: 13px; margin: 0; }

/* ---- Floating chat button ---- */
.chat-floating-button {
  position: fixed;
  bottom: 24px; right: 24px;
  z-index: 30;
  display: flex; align-items: center; gap: 10px;
  background: var(--accent-maroon);
  color: var(--text-on-accent);
  padding: 12px 18px;
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-lg);
  transition: transform var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out);
}
.chat-floating-button:hover { background: var(--accent-maroon-hover); text-decoration: none; transform: translateY(-2px); }
.chat-floating-icon { display: flex; }
.chat-floating-copy { display: flex; flex-direction: column; line-height: 1.15; }
.chat-floating-copy strong { font-size: 13px; }
.chat-floating-copy small { font-size: 12px; opacity: 0.85; }
@media (max-width: 640px) {
  .chat-floating-copy { display: none; }
  .chat-floating-button { padding: 14px; }
}

.button { display: inline-flex; align-items: center; justify-content: center; padding: 0.85rem 1.75rem; border-radius: var(--radius-pill); font-weight: 600; }
.button-primary { background: var(--accent-maroon); color: var(--text-on-accent); }
.button-primary:hover { background: var(--accent-maroon-hover); text-decoration: none; }
.button-secondary { background: transparent; border: 1px solid var(--border-strong); color: var(--text-primary); }
.button-secondary:hover { background: var(--bg-sunken); text-decoration: none; }
.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;
}

/* ==========================================================================
   ASTROLOGY CONTENT COMPONENTS
   Shared result/prediction vocabulary used across nearly every content page
   (kundali, horoscope, match, life-report, forecasts, dasha, etc). Defined
   by lib/simple-astrology-presentation.js — do not rename these classes
   without updating that file.
   ========================================================================== */

.eyebrow {
  display: block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-maroon);
  margin-bottom: var(--space-1);
}

.card-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  margin-bottom: var(--space-4);
}

/* ---- Prediction section: Conclusion / Meaning / Phase / Guidance ---- */
.orion-prediction {
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  margin-bottom: var(--space-4);
}
.orion-prediction.is-lead {
  background: var(--bg-card-alt);
  border-color: var(--border-strong);
}
.orion-prediction__title { font-size: var(--fs-h3); margin-bottom: var(--space-3); }
.orion-prediction__block { margin-bottom: var(--space-3); }
.orion-prediction__block:last-child { margin-bottom: 0; }
.orion-prediction__label {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.orion-prediction__text { margin: 0; color: var(--text-primary); }
.orion-prediction__guidance .orion-prediction__text { color: var(--accent-maroon); font-weight: 500; }

/* ---- Result badge — Excellent/Strong/Good (favourable), Mixed, Sensitive/Challenging ---- */
.orion-result-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
}
.orion-result-badge.is-group-favourable { background: var(--success-bg); color: var(--success); }
.orion-result-badge.is-group-mixed { background: var(--warning-bg); color: var(--warning); }
.orion-result-badge.is-group-sensitive { background: var(--danger-bg); color: var(--danger); }
.orion-result-badge__mark { font-size: 12px; }

/* ---- Guidance box ---- */
.orion-guidance-box {
  border-left: 3px solid var(--accent-saffron);
  background: var(--bg-card-alt);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: var(--space-3);
  margin: var(--space-3) 0;
}
.orion-guidance-box.is-sensitive, .orion-guidance-box.is-challenging { border-left-color: var(--danger); }
.orion-guidance-box.is-group-favourable, .orion-guidance-box.is-excellent, .orion-guidance-box.is-strong, .orion-guidance-box.is-good { border-left-color: var(--success); }
.orion-guidance-box__title {
  font-size: 12px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase;
  color: var(--text-secondary); margin-bottom: 4px;
}
.orion-guidance-box__text { margin: 0; color: var(--text-primary); }

/* ---- Confidence indicator ---- */
.orion-confidence { display: flex; align-items: center; gap: var(--space-2); margin: var(--space-2) 0; }
.orion-confidence__label { font-size: 13px; color: var(--text-secondary); }

/* ---- Insight card + grid ---- */
.orion-insight-grid { margin-bottom: var(--space-5); }
.orion-insight-grid__title { font-size: var(--fs-h2); margin-bottom: var(--space-4); }
.orion-insight-grid__cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--space-3);
}
.orion-insight-card {
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
}
.orion-insight-card__head { display: flex; align-items: center; gap: var(--space-2); margin-bottom: var(--space-2); }
.orion-insight-card__icon { font-size: 20px; }
.orion-insight-card__title { font-size: 16px; flex: 1; margin: 0; }
.orion-insight-card__result { font-weight: 600; margin-bottom: 6px; }
.orion-insight-card__explanation { font-size: 14px; margin-bottom: var(--space-2); }
.orion-insight-card__guidance-block { border-top: 1px solid var(--border-soft); padding-top: var(--space-2); margin-top: var(--space-2); }
.orion-insight-card__guidance-label {
  font-size: 12px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase;
  color: var(--text-muted); margin-bottom: 3px;
}
.orion-insight-card__guidance { margin: 0; font-size: 14px; color: var(--accent-maroon); }

/* ---- Astro details (collapsible technical accordion) ---- */
.orion-astro-details, .orion-method-details {
  margin-top: var(--space-3);
  border-top: 1px solid var(--border-soft);
  padding-top: var(--space-2);
}
.orion-astro-details__summary, .orion-method-details > summary {
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent-teal);
  list-style: none;
}
.orion-astro-details__summary::-webkit-details-marker { display: none; }
.orion-astro-details__body, .orion-method-details__body { padding-top: var(--space-2); font-size: 14px; }
.orion-astro-details__rows { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; margin: var(--space-2) 0; }
.orion-astro-details__row { display: contents; }
.orion-astro-details__row dt { color: var(--text-secondary); }
.orion-astro-details__row dd { margin: 0; font-family: var(--font-mono); font-size: 13px; }
.orion-astro-details__lines { margin: var(--space-2) 0; padding-left: 1.2em; }
.orion-astro-details__note { color: var(--text-muted); font-size: 13px; }
.orion-astro-details__heading { font-size: 13px; margin: var(--space-2) 0 4px; }

.admin-message-state.is-error { color: var(--danger); }
.is-retrograde { color: var(--danger); font-weight: 600; }
.is-current { background: var(--bg-card-alt); font-weight: 600; }

/* ---- Access limit modal (access-control.js) — used across ~8 pages ----
   Shown when a guest/free user hits a usage limit (chart count, weekly
   report cap, daily chat minutes) and is prompted to upgrade. */
.orion-access-modal-open { overflow: hidden; }
.orion-access-modal {
  position: fixed; inset: 0; z-index: 10000;
  display: grid; place-items: center; padding: var(--space-3);
}
.orion-access-modal[hidden] { display: none; }
.orion-access-modal__backdrop {
  position: absolute; inset: 0;
  background: rgba(42, 33, 23, 0.45);
}
.orion-access-modal__dialog {
  position: relative;
  width: min(100%, 33rem);
  padding: var(--space-5);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  color: var(--text-primary);
  box-shadow: var(--shadow-lg);
}
.orion-access-modal__feature { max-width: calc(100% - 3rem); margin: 0; color: var(--text-primary); overflow-wrap: anywhere; }
.orion-access-modal__dialog h2 { margin: 0.3rem 2rem 0.75rem 0; color: var(--text-primary); }
.orion-access-modal__message { margin: 0; line-height: 1.65; white-space: pre-line; color: var(--text-secondary); }
.orion-access-modal__current-plan {
  width: fit-content;
  margin: var(--space-3) 0 0;
  padding: 0.36rem 0.75rem;
  border-radius: var(--radius-pill);
  color: var(--warning);
  background: var(--warning-bg);
  font-size: 12.5px;
  font-weight: 700;
}
.orion-access-modal__close {
  position: absolute; top: 0.8rem; right: 0.8rem;
  width: 2.2rem; height: 2.2rem;
  border: 0; border-radius: 50%;
  background: var(--bg-sunken); color: var(--text-primary);
  font-size: 1.5rem; cursor: pointer;
}
.orion-access-modal__close:hover { background: var(--border-soft); }
.orion-access-modal__actions { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-4); }
.orion-access-modal__actions .button { min-height: 2.85rem; justify-content: center; }
.orion-access-modal__cancel { color: var(--text-primary); background: transparent; }
@media (max-width: 520px) {
  .orion-access-modal { padding: 0.75rem; }
  .orion-access-modal__dialog { max-height: calc(100vh - 1.5rem); overflow-y: auto; padding: var(--space-4); }
  .orion-access-modal__actions { display: grid; }
  .orion-access-modal__actions .button { width: 100%; text-align: center; }
}

/* ---- North Indian birth chart SVG (lib/north-indian-chart.js) ----
   The chart frame itself (background/border/diagonals) is hardcoded in the
   generated SVG markup as plain hex, not CSS variables, since that markup
   can be cached/serialized outside the live page. Only the text labels are
   styled here. */
.kundali-chart-svg {
  max-width: 420px;
  margin: 0 auto;
  cursor: pointer;
}
.kundali-chart-svg svg { width: 100%; height: auto; display: block; }
.ni-rashi-num { fill: var(--text-secondary); font-size: 12px; font-family: var(--font-mono); }
.ni-planet { fill: var(--accent-maroon); font-weight: 700; font-family: var(--font-body); }
.ni-lagna-hint { fill: var(--text-muted); font-size: 12px; opacity: 0.55; }

/* ── Astrology Credits: price + balance on feature triggers ── */
.orion-credit-cost {
  display: inline-block;
  margin-left: 0.5rem;
  padding: 0.12em 0.55em;
  border-radius: 999px;
  background: rgba(232, 163, 61, 0.22);
  color: #7A4A0B;
  font-size: 0.78em;
  font-weight: 700;
  letter-spacing: 0.02em;
  vertical-align: middle;
}

.button-primary .orion-credit-cost,
.button.button-primary .orion-credit-cost {
  background: rgba(255, 253, 248, 0.22);
  color: #FFFDF8;
}

.orion-credit-balance {
  margin: 0.5rem 0 0;
  color: #6B5A44;
  font-size: 0.85rem;
}

.orion-credit-balance.is-short { color: #993C1D; }

.orion-credit-balance a {
  color: #712B13;
  font-weight: 700;
  text-decoration: underline;
}

/* ------------------------------------------------- account row in the menu --
   Lives here, not in site-header-dawn.css: index.html does not load that
   sheet, so the homepage header would have missed these rules entirely.
   Under 560px theme.js moves the credits chip and the login/profile button out
   of the bar and into the drawer, because the two of them took 136px of a
   375px header and left the brand name 38px to sit in. Same elements, moved
   rather than copied, so they keep their live credit balance and signed-in
   state. */

.site-header[data-shared-header] .site-nav__account {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  width: 100%;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border-soft, #E6DCC6);
}

/* In the bar these are compact chips; in the drawer there is room to make them
   proper tap targets. */
.site-header[data-shared-header] .site-nav__account .header-credits-chip,
.site-header[data-shared-header] .site-nav__account .header-auth-button {
  flex: 1 1 auto;
  min-height: 44px;
  justify-content: center;
  text-align: center;
}

/* ------------------------------------------- mobile drawer: clear the bar --
   The drawer is fixed at top 0 and the menu toggle floats over it at z-index
   1210, so its first item — the chart picker — opened underneath the close
   button. --orion-header-h is written by theme.js from the bar's measured
   height, because the header is 69px in this layout and 82px where theme.css
   pins it, so no single constant clears both. */

.site-header[data-shared-header] .site-nav.is-open,
body.menu-open .site-header[data-shared-header] .site-nav {
  padding-top: calc(var(--orion-header-h, 69px) + 14px) !important;
}

/* The account button is the one action in the drawer, so it reads as the
   primary control: solid maroon with white text rather than the bar's quiet
   outline treatment, which was brown-on-cream and easy to miss. */
.site-header[data-shared-header] .site-nav__account .header-auth-button {
  background: var(--accent-maroon, #8C2A3A) !important;
  border-color: transparent !important;
  color: #FFFFFF !important;
}

.site-header[data-shared-header] .site-nav__account .header-auth-button:hover,
.site-header[data-shared-header] .site-nav__account .header-auth-button:focus-visible {
  background: var(--accent-maroon-hover, #7A2230) !important;
  color: #FFFFFF !important;
}

/* ------------------------------------------- one gutter, not two nested --
   A section that wraps a container must not add its own horizontal padding.
   The container owns the gutter and the max-width; padding on both nests one
   gutter inside another and the content column loses the outer one twice over.

   On my-life and kundali-hub that was life-menu-glass.css putting 28px on a
   .section whose .container already pads 36px — 128px of the page gone before
   any content. ashtakvarga.html did the same with a 72px hero around a 48px
   container.

   mobile.css has carried this rule under max-width 768px for some time, which
   is why the problem only ever showed on desktop. Same rule, no media query.

   body[class] is there for specificity, not selection. The competing rule is
   body.life-menu-page .orion-hub-hero at (0,2,1) and is itself !important, so
   !important alone does not settle it; the attribute selector brings this to
   (0,2,2) and wins on element count.

   Guarded by :has() rather than fixed at source because that same declaration
   also pads premium-hero, premium-catalog-section, premium-chart-section and
   bcd-hero — none of which wrap a container, and all of which need the gutter
   it gives them. */

body[class] main section[class]:has(> .container),
body[class] main section[class]:has(> .site-container),
body[class] main section[class]:has(> .page-container),
body[class] main section[class]:has(> .section-container),
body[class] main section[class]:has(> .content-wrapper),
body[class] main section[class]:has(> .subscription-shell),
body[class] main section[class]:has(> .premium-shell) {
  padding-left: 0 !important;
  padding-right: 0 !important;
}

/* ==========================================================================
   APP STARTUP SPLASH
   Shown once per app session inside the Capacitor shell, never on the web.

   The mark is a sunrise — three rays over a sun sitting on a horizon — so the
   animation is the thing the logo depicts: the horizon draws, the sun rises
   from behind it, the rays reach out. A spin or a pulse would animate the file
   rather than the drawing.
   ========================================================================== */

.orion-splash {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 22px;
  /* Matches --bg-page. Hard-coded because the splash paints before any theme
     layer has had a chance to redefine the token. */
  background: #F6F1E7;
  opacity: 1;
  transition: opacity 380ms ease;
}

.orion-splash.is-leaving { opacity: 0; }

.orion-splash__mark { width: 116px; height: 116px; overflow: visible; }

/* The sun starts below the horizon and is clipped to it, so it genuinely
   emerges rather than sliding over the top. */
.orion-splash__sun {
  transform: translateY(22px);
  animation: orion-sun-rise 720ms cubic-bezier(0.22, 1, 0.36, 1) 160ms forwards;
}

/* 8 covers the longest ray (6 units) with room for the round cap. */
.orion-splash__rays path {
  stroke-dasharray: 8;
  stroke-dashoffset: 8;
  animation: orion-ray-reach 420ms ease-out forwards;
}

.orion-splash__rays path:nth-child(1) { animation-delay: 560ms; }
.orion-splash__rays path:nth-child(2) { animation-delay: 640ms; }
.orion-splash__rays path:nth-child(3) { animation-delay: 720ms; }

.orion-splash__horizon {
  stroke-dasharray: 44;
  stroke-dashoffset: 44;
  animation: orion-horizon-draw 360ms ease-out forwards;
}

.orion-splash__word {
  display: grid;
  justify-items: center;
  gap: 3px;
  opacity: 0;
  transform: translateY(8px);
  animation: orion-word-in 460ms ease-out 700ms forwards;
}

.orion-splash__word strong {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 27px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: #2A2117;
}

.orion-splash__word span {
  font-family: 'Work Sans', -apple-system, sans-serif;
  font-size: 12px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: #9C8D75;
}

@keyframes orion-sun-rise { to { transform: translateY(0); } }
@keyframes orion-ray-reach { to { stroke-dashoffset: 0; } }
@keyframes orion-horizon-draw { to { stroke-dashoffset: 0; } }
@keyframes orion-word-in { to { opacity: 1; transform: translateY(0); } }

/* Someone who has asked for less motion still gets the brand, just still. */
@media (prefers-reduced-motion: reduce) {
  .orion-splash__sun,
  .orion-splash__rays path,
  .orion-splash__horizon,
  .orion-splash__word {
    animation: none;
    opacity: 1;
    transform: none;
    stroke-dashoffset: 0;
  }
}
