/* ============================================================
   GREAT ASTROLOGY — Design System v2
   Dual theme (dark default + dedicated light), bilingual-ready.
   Palette follows the house style already proven on
   invention.aniketbhardwaj.com: deep navy ground, muted gold
   accent, ivory light mode — with a soft violet secondary.

   Theme states:
     :root                          → dark (default)
     [data-theme="light"]           → explicit light
     [data-theme="dark"]            → explicit dark
     prefers-color-scheme + :not([data-theme]) → system
   ============================================================ */

/* ---------- DARK (default) ---------- */
:root {
  --bg: #070B14;
  --bg2: #0B1220;
  --panel: #101A2C;
  --panel2: #16223A;
  --field: #060A12;
  --hair: rgba(255, 255, 255, .07);
  --hair-strong: rgba(255, 255, 255, .13);
  --hair-gold: rgba(201, 169, 106, .25);

  --accent: #C9A96A;
  --accent-b: #E9D4A5;
  --accent-ink: #14100A;
  --violet: #A78BD0;
  --violet-soft: rgba(167, 139, 208, .16);

  --text: #EFEAE0;
  --text-strong: #FFFFFF;
  --muted: #9AA6BB;
  --faint: #7F8A9B;   /* 4.5:1 on --panel2 (was #6B7689 at 3.46:1) */

  --green: #34D399;
  --red: #F87171;
  --teal: #2DD4BF;
  --amber: #FFB870;

  --nav-bg: rgba(7, 11, 20, .9);
  --shadow: 0 24px 70px rgba(0, 0, 0, .55);
  --shadow-sm: 0 6px 22px rgba(0, 0, 0, .35);
  --hero-glow1: rgba(201, 169, 106, .16);
  --hero-glow2: rgba(167, 139, 208, .14);

  --radius: 18px;
  --radius-sm: 12px;
  --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-body: 'Inter', 'Segoe UI', system-ui, -apple-system, Arial, sans-serif;
}

/* ---------- LIGHT (explicit) ---------- */
[data-theme="light"] {
  --bg: #F7F4EC;
  --bg2: #EFEBDF;
  --panel: #FFFFFF;
  --panel2: #FAF7F0;
  --field: #FFFFFF;
  --hair: rgba(31, 44, 74, .12);
  --hair-strong: rgba(31, 44, 74, .2);
  --hair-gold: rgba(154, 117, 50, .35);

  --accent: #84652B;  /* 4.5:1 on --bg2 (was #9A7532 at 3.55:1) */
  --accent-b: #7A5A1E;
  --accent-ink: #FFFFFF;
  --violet: #6D4C9F;
  --violet-soft: rgba(109, 76, 159, .12);

  --text: #1E2740;
  --text-strong: #0E1526;
  --muted: #5D6880;
  --faint: #606B7F;   /* 4.5:1 on --bg2 (was #7C879C at 3.04:1) */

  --green: #0E8A5F;
  --red: #C2402F;
  --teal: #0B7E74;
  --amber: #B35C00;

  --nav-bg: rgba(247, 244, 236, .92);
  --shadow: 0 18px 50px rgba(30, 39, 64, .12);
  --shadow-sm: 0 4px 16px rgba(30, 39, 64, .08);
  --hero-glow1: rgba(154, 117, 50, .14);
  --hero-glow2: rgba(109, 76, 159, .10);
}

/* ---------- SYSTEM (no explicit choice) ---------- */
@media (prefers-color-scheme: light) {
  :root:not([data-theme]) {
    --bg: #F7F4EC; --bg2: #EFEBDF;
    --panel: #FFFFFF; --panel2: #FAF7F0; --field: #FFFFFF;
    --hair: rgba(31, 44, 74, .12); --hair-strong: rgba(31, 44, 74, .2);
    --hair-gold: rgba(154, 117, 50, .35);
    --accent: #84652B; --accent-b: #7A5A1E; --accent-ink: #FFFFFF;
    --violet: #6D4C9F; --violet-soft: rgba(109, 76, 159, .12);
    --text: #1E2740; --text-strong: #0E1526; --muted: #5D6880; --faint: #606B7F;
    --green: #0E8A5F; --red: #C2402F; --teal: #0B7E74; --amber: #B35C00;
    --nav-bg: rgba(247, 244, 236, .92);
    --shadow: 0 18px 50px rgba(30, 39, 64, .12);
    --shadow-sm: 0 4px 16px rgba(30, 39, 64, .08);
    --hero-glow1: rgba(154, 117, 50, .14); --hero-glow2: rgba(109, 76, 159, .10);
  }
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background:
    radial-gradient(1100px 560px at 82% -12%, var(--hero-glow2), transparent 62%),
    radial-gradient(900px 480px at -8% 26%, var(--hero-glow1), transparent 58%),
    var(--bg);
  color: var(--text);
  line-height: 1.65;
  font-size: 16px;
  min-height: 100vh;
  transition: background-color .25s ease, color .25s ease;
}
img, svg { max-width: 100%; }
a { color: var(--accent-b); text-decoration: none; }
[data-theme="light"] a { color: var(--accent-b); }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

.wrap { max-width: 1180px; margin: 0 auto; padding: 0 20px; }

h1, h2, h3, .brand-name { font-family: var(--font-display); font-weight: 600; letter-spacing: .01em; color: var(--text-strong); }
h1 { font-size: clamp(2rem, 5vw, 3.3rem); line-height: 1.14; }
h2 { font-size: clamp(1.5rem, 3.4vw, 2.1rem); line-height: 1.24; }
h3 { font-size: 1.16rem; }
:lang(hi) h1, :lang(hi) h2, :lang(hi) h3 { font-family: var(--font-body); font-weight: 700; line-height: 1.32; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 60;
  background: var(--nav-bg); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--hair);
}
.header-inner { display: flex; align-items: center; gap: 14px; height: 66px; }
.brand { display: flex; align-items: center; gap: 9px; white-space: nowrap; margin-right: auto; }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 50%; flex: 0 0 34px;
  display: grid; place-items: center; font-size: .82rem; font-weight: 700;
  background: linear-gradient(135deg, var(--accent-b), var(--accent));
  color: var(--accent-ink); border: 1px solid var(--hair-gold);
}
.brand-name { color: var(--text-strong); letter-spacing: .05em; font-size: 1.02rem; line-height: 1.15; }
.brand-name em { font-style: normal; color: var(--accent); }
.brand-sub { display: block; font-size: .64rem; color: var(--muted); letter-spacing: .09em; text-transform: uppercase; font-family: var(--font-body); }

/* nowrap + a hamburger from 1100px down: the nav must never wrap onto a second
   row and collide with the brand (the English labels are wider than the Hindi). */
.main-nav { display: flex; gap: 2px; flex-wrap: nowrap; }
.main-nav a {
  color: var(--muted); padding: 7px 10px; border-radius: 999px; white-space: nowrap;
  font-size: .87rem; font-weight: 500; transition: color .15s, background .15s;
}
.main-nav a:hover { color: var(--text-strong); text-decoration: none; background: var(--violet-soft); }
.main-nav a.active { color: var(--accent-ink); background: var(--accent); font-weight: 600; }

.header-tools { display: flex; align-items: center; gap: 6px; }
.icon-btn {
  background: transparent; border: 1px solid var(--hair); color: var(--text);
  border-radius: 999px; padding: 6px 12px; cursor: pointer; font-size: .82rem;
  font-family: var(--font-body); font-weight: 600; line-height: 1.5;
  display: inline-flex; align-items: center; gap: 6px; transition: border-color .15s, background .15s;
}
.icon-btn:hover { border-color: var(--hair-gold); background: var(--violet-soft); }
.icon-btn .ib-ic { font-size: .95rem; }
.nav-toggle { display: none; }
/* 44px minimum so the primary mobile control is comfortable to hit. */
@media (max-width: 1100px) {
  .nav-toggle { min-width: 44px; min-height: 44px; justify-content: center; font-size: 1.15rem; }
  #lang-btn, #theme-btn { min-height: 44px; }
}

/* ---------- Bottom nav (mobile) ---------- */
.bottom-nav { display: none; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 26px; border-radius: 999px; font-weight: 600; font-size: 1rem;
  border: 1px solid transparent; cursor: pointer; font-family: var(--font-body);
  transition: transform .15s, box-shadow .15s, background .15s, border-color .15s;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
/* Dark theme: light-gold fill needs dark ink. Light theme: the gold darkens,
   so the ink must flip to white or the label disappears into the button. */
.btn-gold {
  background: linear-gradient(135deg, var(--accent-b), var(--accent));
  color: #1A1305; box-shadow: 0 6px 24px rgba(201, 169, 106, .3);
}
[data-theme="light"] .btn-gold,
[data-theme="light"] .btn-gold:hover {
  background: linear-gradient(135deg, #9A7532, #7A5A1E);
  color: #FFFFFF; box-shadow: 0 6px 20px rgba(122, 90, 30, .28);
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme]) .btn-gold {
    background: linear-gradient(135deg, #9A7532, #7A5A1E); color: #FFFFFF;
    box-shadow: 0 6px 20px rgba(122, 90, 30, .28);
  }
}
.btn-ghost { background: transparent; color: var(--text); border-color: var(--hair-strong); }
.btn-ghost:hover { background: var(--violet-soft); border-color: var(--hair-gold); }
.btn-sm { padding: 8px 17px; font-size: .88rem; }
.btn[disabled] { opacity: .5; cursor: not-allowed; transform: none; }

/* ---------- Cards & layout ---------- */
.card {
  background: var(--panel); border: 1px solid var(--hair);
  border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow-sm);
}
.card h3 { margin-bottom: 10px; }
.card .muted, .muted { color: var(--muted); font-size: .95rem; }

.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.section { padding: 56px 0; }
.section-head { margin-bottom: 30px; max-width: 46em; }
.section-head p { color: var(--muted); margin-top: 10px; }
.kicker { font-size: .76rem; letter-spacing: .18em; text-transform: uppercase; color: var(--accent); font-weight: 700; }

.tile {
  display: flex; flex-direction: column; gap: 7px; padding: 22px;
  background: var(--panel); border: 1px solid var(--hair); border-radius: var(--radius);
  color: var(--text); transition: transform .18s, border-color .18s, box-shadow .18s;
}
.tile:hover { text-decoration: none; transform: translateY(-3px); border-color: var(--hair-gold); box-shadow: var(--shadow-sm); }
.tile .t-ic { font-size: 1.5rem; }
.tile .t-name { font-weight: 600; color: var(--text-strong); }
.tile .t-desc { color: var(--muted); font-size: .85rem; line-height: 1.45; }

/* ---------- Hero ---------- */
.hero { padding: 70px 0 54px; position: relative; overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: 1.12fr .88fr; gap: 48px; align-items: center; }
.hero .eyebrow {
  display: inline-block; font-size: .78rem; letter-spacing: .15em; text-transform: uppercase;
  color: var(--accent); border: 1px solid var(--hair-gold); padding: 6px 14px; border-radius: 999px; margin-bottom: 20px;
}
.hero p.lead { color: var(--muted); font-size: 1.1rem; max-width: 34em; margin: 18px 0 30px; }
.cta-row { display: flex; gap: 14px; flex-wrap: wrap; }

/* ---------- Forms ---------- */
.bf-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.bf-field { display: flex; flex-direction: column; gap: 7px; font-size: .9rem; color: var(--muted); }
.bf-field small { color: var(--faint); }
.bf-wide { grid-column: 1 / -1; }
.bf-field input, .bf-field select, textarea.ga-input, input.ga-input, select.ga-input {
  background: var(--field); color: var(--text); border: 1px solid var(--hair-strong);
  border-radius: var(--radius-sm); padding: 12px 14px; font-size: 1rem; font-family: var(--font-body); width: 100%;
}
.bf-field input:focus, .bf-field select:focus, .ga-input:focus { border-color: var(--accent); outline: none; }
.bf-city { position: relative; }
.bf-city-list {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 40;
  background: var(--panel2); border: 1px solid var(--hair-strong); border-radius: var(--radius-sm);
  overflow: hidden; box-shadow: var(--shadow);
}
.bf-city-list button {
  display: block; width: 100%; text-align: left; padding: 11px 14px; background: none;
  border: none; color: var(--text); cursor: pointer; font-size: .95rem; font-family: var(--font-body);
}
.bf-city-list button:hover { background: var(--violet-soft); }
.bf-city-none { padding: 11px 14px; color: var(--muted); font-size: .88rem; }
.bf-adv summary { cursor: pointer; color: var(--accent); font-size: .9rem; margin: 4px 0 12px; }
.form-error { color: var(--red); font-size: .92rem; margin-top: 10px; min-height: 1.4em; }

/* ---------- Charts ---------- */
.ga-chart { width: 100%; height: auto; display: block; }
.gc-frame { fill: var(--panel2); stroke: var(--accent); stroke-width: 2; }
.gc-house { fill: transparent; stroke: var(--hair-gold); stroke-width: 1.2; }
.gc-lagna { fill: var(--violet-soft); }
.gc-lagna-mark { stroke: var(--accent); stroke-width: 1.6; }
.gc-signnum { fill: var(--faint); font-size: 12px; font-family: var(--font-body); }
.gc-planet { fill: var(--accent-b); font-size: 13.5px; font-weight: 600; font-family: var(--font-body); }
[data-theme="light"] .gc-planet { fill: var(--accent-b); }
.gc-center { fill: var(--text); font-size: 15px; font-family: var(--font-display); }
.gc-center-sub { fill: var(--muted); font-size: 11.5px; font-family: var(--font-body); }

/* ---------- Tables ---------- */
.tbl-wrap { overflow-x: auto; border-radius: var(--radius-sm); border: 1px solid var(--hair); }
table.ga-tbl { width: 100%; border-collapse: collapse; font-size: .92rem; min-width: 560px; }
.ga-tbl th, .ga-tbl td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--hair); }
.ga-tbl th { background: var(--panel2); color: var(--accent); font-weight: 700; font-size: .78rem; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; }
.ga-tbl tr:last-child td { border-bottom: none; }
.ga-tbl td { color: var(--muted); }
.ga-tbl td:first-child { color: var(--text); font-weight: 500; }

/* ---------- Badges & meters ---------- */
.badge { display: inline-block; padding: 3px 11px; border-radius: 999px; font-size: .74rem; font-weight: 700; letter-spacing: .03em; }
.badge-gold { background: var(--hair-gold); color: var(--accent-b); }
[data-theme="light"] .badge-gold { color: var(--accent-b); }
.badge-teal { background: rgba(45, 212, 191, .16); color: var(--teal); }
.badge-rose { background: rgba(248, 113, 113, .16); color: var(--red); }
.badge-purple { background: var(--violet-soft); color: var(--violet); }
.badge-dim { background: var(--hair); color: var(--muted); }
.badge-soon {
  background: var(--violet-soft); color: var(--violet);
  border: 1px solid var(--hair-strong); letter-spacing: .05em;
}

.meter { height: 7px; background: var(--hair); border-radius: 99px; overflow: hidden; }
.meter > i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--accent), var(--accent-b)); }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 22px; }
.tabs button {
  background: transparent; border: 1px solid var(--hair); color: var(--muted);
  padding: 9px 17px; border-radius: 999px; cursor: pointer; font-size: .9rem; font-weight: 500; font-family: var(--font-body);
}
.tabs button:hover { border-color: var(--hair-gold); color: var(--text); }
.tabs button.active { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ---------- Category explorer (Services) ---------- */
.cat-layout { display: grid; grid-template-columns: 290px 1fr; gap: 24px; align-items: start; }
.cat-list {
  background: var(--panel); border: 1px solid var(--hair); border-radius: var(--radius);
  padding: 14px; position: sticky; top: 84px;
}
.cat-list h3 { font-size: .76rem; letter-spacing: .16em; text-transform: uppercase; color: var(--accent); margin: 6px 8px 12px; font-family: var(--font-body); font-weight: 700; }
.cat-item {
  display: flex; align-items: center; gap: 11px; width: 100%; text-align: left;
  padding: 12px 13px; border-radius: var(--radius-sm); border: 1px solid transparent;
  background: transparent; color: var(--text); cursor: pointer; font-family: var(--font-body);
  font-size: .95rem; transition: background .15s, border-color .15s;
}
.cat-item:hover { background: var(--violet-soft); }
.cat-item.active { background: var(--violet-soft); border-color: var(--hair-gold); font-weight: 600; }
.cat-item .ci-ic { font-size: 1.15rem; width: 24px; text-align: center; flex: 0 0 24px; }
.cat-item .ci-txt { flex: 1; min-width: 0; }
.cat-item .ci-hi { display: block; font-size: .74rem; color: var(--faint); }
.cat-item .ci-arrow { color: var(--faint); font-size: .8rem; }
.cat-item.active .ci-arrow { color: var(--accent); }

.cat-hero {
  background: var(--panel); border: 1px solid var(--hair); border-radius: var(--radius);
  padding: 30px; margin-bottom: 20px;
}
.cat-hero .ch-top { display: flex; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.cat-hero .ch-ic {
  width: 54px; height: 54px; border-radius: 15px; display: grid; place-items: center;
  font-size: 1.6rem; background: var(--violet-soft); border: 1px solid var(--hair-gold); flex: 0 0 54px;
}
.cat-hero h2 { font-size: 1.62rem; margin-bottom: 2px; }
.cat-hero .ch-hi { color: var(--accent); font-size: 1rem; font-weight: 600; }
.cat-hero .ch-desc { color: var(--muted); margin-top: 12px; max-width: 52em; }
.cat-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }

.svc-group { margin-bottom: 22px; }
.svc-group h4 {
  font-size: .8rem; letter-spacing: .12em; text-transform: uppercase; color: var(--accent);
  margin-bottom: 12px; font-family: var(--font-body); font-weight: 700;
}
.svc-group h4 span { color: var(--faint); text-transform: none; letter-spacing: 0; font-weight: 500; }
.svc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: 10px; }
.svc {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 13px 15px; border-radius: var(--radius-sm); border: 1px solid var(--hair);
  background: var(--panel2); color: var(--text); font-size: .92rem; transition: border-color .15s, transform .15s;
}
a.svc:hover { text-decoration: none; border-color: var(--accent); transform: translateY(-2px); }
.svc .sv-txt { min-width: 0; }
.svc .sv-name { display: block; font-weight: 500; }
.svc .sv-hi { display: block; font-size: .76rem; color: var(--faint); }
.svc .sv-dot { width: 7px; height: 7px; border-radius: 50%; flex: 0 0 7px; background: var(--green); }

/* Coming Soon reads as a small line ABOVE the name, so a long service title
   never has to share its row with a badge (which used to force ugly wrapping). */
.sv-soon {
  display: block; font-size: .6rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--violet); font-weight: 700; margin-bottom: 3px; line-height: 1.3;
}
.svc.is-soon { opacity: .9; border-style: dashed; }
.svc.is-soon .sv-name { color: var(--muted); font-weight: 500; }

/* Same treatment in the category sidebar. */
.cat-item .ci-soon {
  display: block; font-size: .58rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--violet); font-weight: 700; line-height: 1.3;
}

/* ---------- Panchang ---------- */
.pan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.pan-cell { background: var(--panel2); border: 1px solid var(--hair); border-radius: var(--radius-sm); padding: 14px 16px; }
.pan-cell .p-k { font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); }
.pan-cell .p-v { font-weight: 600; font-size: 1.02rem; margin-top: 3px; color: var(--text-strong); }
.pan-cell.warn .p-v { color: var(--amber); }
.pan-cell.good .p-v { color: var(--green); }

.cho-row { display: flex; gap: 6px; flex-wrap: wrap; }
.cho { flex: 1 1 100px; text-align: center; padding: 10px 6px; border-radius: var(--radius-sm); font-size: .82rem; border: 1px solid var(--hair); }
.cho.good { background: rgba(52, 211, 153, .1); }
[data-theme="light"] .cho.good { background: rgba(14, 138, 95, .1); }
.cho.bad { background: rgba(248, 113, 113, .09); opacity: .9; }
[data-theme="light"] .cho.bad { background: rgba(194, 64, 47, .08); }
.cho b { display: block; font-size: .9rem; color: var(--text-strong); }
.cho span { color: var(--faint); font-size: .75rem; }

/* ---------- Accordions ---------- */
.acc { border: 1px solid var(--hair); border-radius: var(--radius-sm); margin-bottom: 10px; overflow: hidden; }
.acc summary { cursor: pointer; padding: 14px 18px; background: var(--panel2); font-weight: 500; display: flex; justify-content: space-between; align-items: center; gap: 10px; list-style: none; color: var(--text); }
.acc summary::-webkit-details-marker { display: none; }
.acc[open] summary { border-bottom: 1px solid var(--hair); }
.acc .acc-body { padding: 16px 18px; color: var(--muted); font-size: .95rem; background: var(--panel); }

/* ---------- Dasha ---------- */
.dasha-bar { display: flex; border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--hair); min-height: 54px; }
.dasha-seg { position: relative; display: flex; align-items: center; justify-content: center; flex-direction: column; cursor: pointer; padding: 8px 2px; font-size: .78rem; color: var(--muted); border-right: 1px solid var(--bg); background: var(--panel2); transition: background .15s; }
.dasha-seg:hover { background: var(--violet-soft); }
.dasha-seg.current { background: var(--hair-gold); color: var(--accent-b); }
.dasha-seg.past { opacity: .55; }
.dasha-seg b { font-size: .86rem; color: inherit; }
.dasha-detail { margin-top: 18px; }

/* ---------- Chat ---------- */
.chat-box { display: flex; flex-direction: column; gap: 14px; min-height: 300px; max-height: 55vh; overflow-y: auto; padding: 4px; }
.msg { max-width: 85%; padding: 13px 18px; border-radius: 16px; font-size: .96rem; line-height: 1.6; }
.msg-user { align-self: flex-end; background: var(--hair-gold); border: 1px solid var(--hair-strong); border-bottom-right-radius: 4px; color: var(--text); }
.msg-ai { align-self: flex-start; background: var(--panel2); border: 1px solid var(--hair); border-bottom-left-radius: 4px; color: var(--muted); }
.chat-input-row { display: flex; gap: 10px; margin-top: 16px; }
.chat-input-row input { flex: 1; }

/* ---------- Notices ---------- */
.notice { border-left: 3px solid var(--accent); background: var(--violet-soft); padding: 14px 18px; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; color: var(--muted); font-size: .93rem; }
.notice b { color: var(--text-strong); }
.notice.soft { border-color: var(--violet); }
.notice.warn { border-color: var(--amber); }

/* ---------- Score dial ---------- */
.score-dial { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.score-dial .sd-num { font-family: var(--font-display); font-size: 3rem; color: var(--accent-b); line-height: 1; }
.score-dial .sd-max { color: var(--faint); font-size: .9rem; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--hair); margin-top: 70px; padding: 44px 0 0; background: var(--bg2); }
.footer-inner { display: grid; grid-template-columns: 1.2fr 1fr; gap: 40px; padding-bottom: 30px; }
.f-brand { font-size: 1.12rem; letter-spacing: .05em; }
.f-tag { color: var(--accent); font-size: .9rem; margin-top: 6px; }
.f-note { color: var(--faint); font-size: .8rem; margin-top: 14px; max-width: 44em; line-height: 1.6; }
.f-cols { display: flex; gap: 54px; flex-wrap: wrap; }
.f-cols h4 { color: var(--text-strong); font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; margin-bottom: 12px; font-family: var(--font-body); }
.f-cols a { display: block; color: var(--muted); font-size: .92rem; padding: 4px 0; }
.f-care { margin-top: 14px; font-size: .9rem; }
.f-care a { color: var(--accent-b); font-weight: 600; }

/* ---------- Credit bar (matches calculator.aniketbhardwaj.com) ----------
   Stacked on mobile, single row from tablet up. The version number is a
   plain natural number (V.21), never a decimal. */
.credit {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  text-align: center; border-top: 1px solid var(--hair);
  padding: 12px 14px calc(76px + env(safe-area-inset-bottom, 0px));
  margin-top: 10px; background: var(--bg2);
}
.credit .crL b {
  font-size: 15px; letter-spacing: .4px; line-height: 1.3; font-weight: 700;
  font-family: var(--font-display); color: var(--accent);
}
.credit .crL a { color: var(--accent); text-decoration: none; }
.credit .crL a:hover { color: var(--accent-b); }
.credit .crR {
  display: flex; flex-wrap: wrap; justify-content: center; align-items: center;
  gap: 7px; font-size: 12px; color: var(--muted);
}
.credit .crR em { font-style: normal; color: var(--faint); margin: 0; }
.credit .crR a { font-size: 13px; color: var(--accent); font-weight: 700; text-decoration: none; }
.credit .crR a:hover { color: var(--accent-b); }
@media (min-width: 761px) {
  .credit {
    flex-direction: row; justify-content: center; gap: 16px;
    padding: 13px 16px 22px; margin-top: 16px;
  }
  .credit .crL b { font-size: 16px; }
  .credit .crR { font-size: 13px; }
  .credit .crR a { font-size: 14px; }
}

/* ---------- Page head ---------- */
.page-head { padding: 46px 0 8px; }
.page-head p { color: var(--muted); margin-top: 10px; max-width: 46em; }
.page-head .title-hi { color: var(--accent); font-size: 1.05rem; font-weight: 600; margin-top: 4px; }

.zodiac-visual svg { filter: drop-shadow(0 0 40px var(--hero-glow1)); }

/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
  .cat-layout { grid-template-columns: 1fr; }
  .cat-list { position: static; display: flex; gap: 8px; overflow-x: auto; padding: 10px; }
  .cat-list h3 { display: none; }
  .cat-item { flex: 0 0 auto; white-space: nowrap; }
  .cat-item .ci-arrow { display: none; }
}
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; gap: 30px; }
  .grid-4, .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .footer-inner { grid-template-columns: 1fr; gap: 24px; }
}
/* Collapse to the drawer well before the labels can wrap. */
@media (max-width: 1100px) {
  .main-nav {
    display: none; position: absolute; top: 66px; left: 0; right: 0; flex-direction: column;
    background: var(--panel); border-bottom: 1px solid var(--hair); padding: 10px 16px 16px; box-shadow: var(--shadow);
  }
  .site-header.nav-open .main-nav { display: flex; }
  .main-nav a { padding: 11px 12px; font-size: .95rem; }
  .nav-toggle { display: inline-flex; }
}

@media (max-width: 760px) {
  body { padding-bottom: 76px; }  /* bottom nav is 71px tall — leave clearance */
  .bottom-nav {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 70;
    background: var(--nav-bg); backdrop-filter: blur(14px);
    border-top: 1px solid var(--hair); padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  }
  .bottom-nav a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; color: var(--faint); font-size: .66rem; padding: 4px 0; }
  .bottom-nav a.active { color: var(--accent); }
  .bottom-nav .bn-ic { font-size: 1.15rem; }
  .bottom-nav a:hover { text-decoration: none; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .bf-grid { grid-template-columns: 1fr; }
  .section { padding: 40px 0; }
  .hero { padding: 40px 0 34px; }
  .card, .cat-hero { padding: 20px; }
  .brand-sub { display: none; }
}
@media (max-width: 480px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .tile { padding: 16px; }
  .svc-grid { grid-template-columns: 1fr; }
}

/* ---------- Print / PDF report ----------
   A proper A4 consulting document: gold rule under the masthead, every
   section opened, nothing clipped, and a repeating page footer. */
@page { size: A4; margin: 14mm 12mm 16mm; }

@media print {
  body {
    background: #fff !important; color: #14171F; padding-bottom: 0;
    font-size: 10.5pt; line-height: 1.5;
  }
  .site-header, .bottom-nav, .site-footer, .credit, .nav-toggle, .btn, .tabs,
  .chat-input-row, #form-card, .cta-row, #suggestions, .header-tools,
  .bf-adv, .form-error, #saved-list { display: none !important; }

  /* Masthead printed once at the top of the report. */
  main::before {
    content: "GREAT ASTROLOGY";
    display: block; font-family: var(--font-display); font-size: 20pt; font-weight: 700;
    letter-spacing: .06em; color: #14171F; text-align: center; margin-bottom: 2mm;
  }
  main::after {
    content: "Astrology is traditional, interpretive guidance — not a guaranteed prediction, and not a substitute for qualified medical, legal or financial advice.";
    display: block; margin-top: 8mm; padding-top: 3mm; border-top: 1px solid #D8D2C2;
    font-size: 7.5pt; color: #6B6F7A; text-align: center; line-height: 1.5;
  }
  .page-head { border-bottom: 2px solid #A8873B; padding: 0 0 4mm; margin-bottom: 6mm; }
  .page-head h1 { font-size: 16pt; }
  .page-head .title-hi { color: #8a6d1f; }

  .card, .cat-hero {
    background: #fff; border: 1px solid #DCD6C6; box-shadow: none; color: #14171F;
    border-radius: 6px; padding: 5mm; margin-bottom: 4mm; page-break-inside: avoid;
  }
  .muted, .acc .acc-body, .ga-tbl td { color: #43474F; }
  .pan-grid { gap: 3mm; }
  .pan-cell { background: #FAF7EF; border: 1px solid #E4DECB; padding: 3mm; page-break-inside: avoid; }
  .pan-cell .p-k { color: #8a6d1f; font-size: 7pt; }
  .pan-cell .p-v { color: #14171F; font-size: 10pt; }
  h1, h2, h3 { color: #14171F; page-break-after: avoid; }
  h2 { font-size: 13pt; margin-top: 4mm; }
  h3 { font-size: 11pt; }
  .kicker { color: #8a6d1f; }

  /* Every tab and accordion is opened so the PDF is complete. */
  .tab-panel { display: block !important; page-break-inside: auto; margin-top: 5mm; }
  .acc { border-color: #DCD6C6; page-break-inside: avoid; }
  .acc summary { background: #FAF7EF; color: #14171F; border-color: #DCD6C6; }
  .acc .acc-body { display: block !important; background: #fff; }
  details:not([open]) > *:not(summary) { display: block !important; }

  .tbl-wrap { overflow: visible !important; border-color: #DCD6C6; }
  table.ga-tbl { min-width: 0 !important; font-size: 9pt; }
  .ga-tbl th { background: #F1EAD6; color: #5c4a13; }
  .ga-tbl th, .ga-tbl td { padding: 2mm 3mm; border-color: #E4DECB; }
  .ga-tbl tr { page-break-inside: avoid; }

  .notice { background: #FBF7EC; color: #43474F; border-left-color: #A8873B; page-break-inside: avoid; }
  .badge { border: 1px solid #DCD6C6; color: #5c4a13 !important; background: #F1EAD6 !important; }

  /* Charts keep their gold linework and never split across a page. */
  .ga-chart { max-width: 78mm; margin: 0 auto; page-break-inside: avoid; }
  .gc-frame { fill: #fff; stroke: #A8873B; }
  .gc-house { stroke: #C9B26A; }
  .gc-signnum { fill: #8A8F99; }
  .gc-planet { fill: #6B5410; }
  .gc-center, .gc-center-sub { fill: #14171F; }

  .dasha-bar { border-color: #DCD6C6; page-break-inside: avoid; }
  .dasha-seg { background: #F1EAD6; color: #43474F; }
  .dasha-seg.current { background: #E2D3A1; color: #5c4a13; }
  .meter { background: #EEE9DA; }
  .meter > i { background: #A8873B; }
  .score-dial .sd-num { color: #6B5410; }

  a { color: #14171F; text-decoration: none; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}

/* utility */
.mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; } .mt-4 { margin-top: 36px; }
.mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 24px; }
.center { text-align: center; }
.hidden { display: none !important; }
.flex-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.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; }

/* ============================================================
   V.22 — mobile refinements (from Aniket's review)
   ============================================================ */

/* Language button: full name on desktop, "Hin"/"Eng" on mobile.
   Theme button: label on desktop, icon alone on mobile. */
.lbl-short { display: none; }

@media (max-width: 768px) {
  .lbl-full { display: none !important; }
  .lbl-short { display: inline; }

  /* Theme toggle becomes a round icon button — no text. */
  #theme-btn {
    width: 40px; height: 40px; padding: 0; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
  }
  #theme-btn .ib-ic { margin: 0; font-size: 1.05rem; }

  /* Language keeps the globe + short code, kept compact. */
  #lang-btn { padding: 0 12px; height: 40px; border-radius: 999px; gap: 5px; }

  /* Justified body copy reads better on a narrow column.
     Devanagari is excluded from hyphenation — it breaks badly. */
  main p,
  .card p,
  .acc .acc-body p,
  .notice,
  .t-desc,
  .muted:not(.p-k):not(.p-v) {
    text-align: justify;
    text-justify: inter-word;
    hyphens: auto;
    -webkit-hyphens: auto;
  }
  /* Must mirror the justify selector list above, prefixed — otherwise
     .muted:not(.p-k):not(.p-v) at (0,3,0) outweighs a shorter override and
     Devanagari gets hyphenated, which mangles it. */
  html[lang="hi"] main p,
  html[lang="hi"] .card p,
  html[lang="hi"] .acc .acc-body p,
  html[lang="hi"] .notice,
  html[lang="hi"] .t-desc,
  html[lang="hi"] .muted:not(.p-k):not(.p-v),
  html[lang="hi"] .blessing-body p {
    hyphens: none !important;
    -webkit-hyphens: none !important;
  }
  /* Headings, numbers and buttons stay centred/ragged — justify would look wrong. */
  h1, h2, h3, h4,
  .sd-num, .sd-max, .p-k, .p-v, .btn, .badge, .kicker,
  .ga-tbl th, .ga-tbl td, .credit, .bottom-nav {
    text-align: inherit;
    hyphens: none;
    -webkit-hyphens: none;
  }
  .center, .center p { text-align: center; }
}

/* Personal blessing: warm, generously spaced, never justified. */
.blessing-body p { margin: 0 0 10px; line-height: 1.9; text-align: left !important; }
.blessing-body p:first-child { font-weight: 600; color: var(--text-strong); }
.blessing-body p:last-child { margin-bottom: 0; }


/* ---------- Expert avatar ----------
   A category icon stands in until a real photograph is supplied. It is
   deliberately an icon — this site never shows a stock face as if it were
   the practitioner. */
.expert-head { display: flex; align-items: center; gap: 12px; margin-bottom: 4px; }
.cat-avatar {
  flex: 0 0 auto; display: inline-grid; place-items: center; border-radius: 50%;
  background: linear-gradient(140deg, var(--violet-soft), rgba(201, 169, 106, .14));
  border: 1px solid var(--hair-gold); color: var(--accent);
}
.cat-avatar svg { width: 58%; height: 58%; display: block; }
.cat-avatar-img { object-fit: cover; padding: 0; border: 1px solid var(--hair-gold); }
[data-theme="light"] .cat-avatar { color: var(--accent-b); }


/* ---------- Services mega menu ---------- */
.mega-btn {
  display: inline-flex; align-items: center; gap: 5px;
  background: transparent; border: none; cursor: pointer;
  color: var(--muted); padding: 7px 10px; border-radius: 999px; white-space: nowrap;
  font-size: .87rem; font-weight: 500; font-family: var(--font-body);
  transition: color .15s, background .15s;
}
.mega-btn:hover { color: var(--text-strong); background: var(--violet-soft); }
.mega-btn.active { color: var(--accent-ink); background: var(--accent); font-weight: 600; }
.mega-caret { font-size: .7em; opacity: .8; }

/* The panel is centred UNDER ITS BUTTON, not on the viewport. It used to be
   left:50% + translateX(-50%) against the sticky header, which centres on the window —
   so on a wide screen the panel sat ~60px away from the "Services" button that opened it
   and lined up with nothing. positionMega() in app.js sets `left` each time it opens,
   clamped to the header's content box so it can never hang off either edge. */
.header-inner { position: relative; }
.mega-panel {
  position: absolute; top: 62px; left: 0; transform: none;
  width: min(920px, calc(100vw - 32px)); z-index: 80;
  background: var(--panel); border: 1px solid var(--hair);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 18px; animation: megaIn .14s ease-out;
}
@keyframes megaIn { from { opacity: 0; transform: translateY(-6px); } }
.mega-panel[hidden] { display: none; }

.mega-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
.mega-item {
  display: flex; align-items: flex-start; gap: 11px; padding: 11px 12px;
  border-radius: var(--radius-sm); color: var(--text); transition: background .14s;
}
.mega-item:hover { text-decoration: none; background: var(--panel2); }
/* Mega items are <a> inside .main-nav, which sets white-space: nowrap to keep the
   top nav on one row. That inherited here and made the descriptions overflow across
   neighbouring columns instead of wrapping. Reset it inside the panel. */
.mega-panel, .mega-panel * { white-space: normal; }
/* Same inheritance trap, second symptom: .main-nav a also sets border-radius:999px for the
   pill-shaped top-nav links. Its specificity (0,1,1) beats a bare .mega-item / .mega-all
   (0,1,0), so the hover highlight on a 291x90 card and the "view all" bar were both drawn
   as full pills with huge rounded ends instead of cards. Scoping by .mega-panel gives
   (0,2,0), which wins. Reset it here, next to the white-space reset, for the same reason. */
.mega-panel .mega-item, .mega-panel .mega-all { border-radius: var(--radius-sm); }
.mega-item { min-width: 0; align-items: flex-start; }
.mega-txt { min-width: 0; flex: 1 1 auto; }
.mega-name, .mega-alt, .mega-desc { min-width: 0; overflow-wrap: anywhere; }
.mega-name, .mega-desc { overflow-wrap: anywhere; }
.mega-item .cat-avatar { width: 38px; height: 38px; }
.mega-txt { min-width: 0; }
.mega-name { display: block; font-weight: 600; font-size: .92rem; line-height: 1.3; }
.mega-alt { display: block; font-weight: 400; font-size: .74rem; color: var(--faint); }
.mega-desc {
  display: block; margin-top: 3px; font-size: .78rem; line-height: 1.45; color: var(--muted);
}
.mega-all {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  margin-top: 12px; padding: 13px; border-radius: var(--radius-sm);
  background: var(--violet-soft); color: var(--accent-b); font-weight: 600; font-size: .92rem;
}
.mega-all:hover { text-decoration: none; background: rgba(201, 169, 106, .16); }
.mega-arrow { transition: transform .15s; }
.mega-all:hover .mega-arrow { transform: translateX(3px); }

/* Inside the mobile drawer the panel becomes a full-width card list. It keeps the
   icon, both names and the description — the same information as desktop, just
   stacked — with tap targets big enough to hit comfortably. */
@media (max-width: 1100px) {
  .mega-btn {
    width: 100%; justify-content: space-between; padding: 12px;
    font-size: .95rem; border: 1px solid var(--hair); margin: 2px 0;
  }
  .mega-btn[aria-expanded="true"] .mega-caret { transform: rotate(180deg); }
  .mega-caret { transition: transform .15s; }
  .mega-panel {
    position: static; transform: none; width: 100%; margin: 4px 0 8px;
    box-shadow: none; border-color: var(--hair); padding: 6px;
    animation: none; max-height: 60vh; overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .mega-grid { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .mega-item { padding: 12px 10px; min-height: 56px; align-items: center; }
  .mega-item .cat-avatar { width: 40px; height: 40px; }
  .mega-name { font-size: .96rem; }
  .mega-alt { font-size: .78rem; }
  /* Description stays, trimmed to two lines so the list does not become a wall. */
  .mega-desc {
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden; font-size: .76rem; margin-top: 2px;
  }
  .mega-all { margin-top: 8px; padding: 14px; }
}


/* ---------- Print / Save as PDF ---------- */
.print-bar { display: flex; justify-content: center; margin-top: 22px; }
.btn-print { gap: 8px; }
@media print { .print-bar { display: none !important; } }


/* The LIVE dot must not be the only signal — pair it with an accessible name
   (set via title/aria-label in the renderers) and a visible ring so it reads
   as a state marker rather than decoration. */
.sv-dot { box-shadow: 0 0 0 3px color-mix(in srgb, var(--green) 22%, transparent); }


/* Hint under a date/time field — tells the user the format expected and, on
   mobile, that tapping opens the native picker. */
.bf-hint { display: block; margin-top: 4px; font-size: .74rem; color: var(--faint); line-height: 1.4; }
.bf-field input[type="date"], .bf-field input[type="time"] {
  min-height: 46px;                  /* comfortable tap + room for the picker icon */
  -webkit-appearance: none; appearance: none;
}
/* Make the native picker icon visible on a dark ground. */
.bf-field input[type="date"]::-webkit-calendar-picker-indicator,
.bf-field input[type="time"]::-webkit-calendar-picker-indicator {
  filter: invert(72%) sepia(18%) saturate(600%) hue-rotate(5deg);
  cursor: pointer; opacity: .9; padding: 4px;
}
[data-theme="light"] .bf-field input[type="date"]::-webkit-calendar-picker-indicator,
[data-theme="light"] .bf-field input[type="time"]::-webkit-calendar-picker-indicator {
  filter: none; opacity: .75;
}


/* ---------- Footer on small screens ----------
   Nine categories in one tall column pushes everything else off the screen, so
   they run in two columns. Every link keeps a comfortable tap height. */
@media (max-width: 760px) {
  /* Footer categories: a real 2-column grid, every name on ONE line.
     This used to be inline-block halves that collapsed to one-per-line below 400px —
     and since most phones are under 400 CSS px, the two-column layout was effectively
     never seen. The names are the short labels (name_short_*), so they fit without
     wrapping; nowrap + ellipsis is the backstop if a longer one is ever added. */
  .f-cols { gap: 24px 20px; flex-direction: column; }
  .f-cols > div { width: 100%; }
  .f-cols > div:first-child {
    display: grid; grid-template-columns: 1fr 1fr; column-gap: 14px;
  }
  .f-cols > div:first-child h4 { grid-column: 1 / -1; }
  .f-cols > div:first-child a {
    display: block; width: auto; padding: 9px 0; min-height: 40px;
    line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .f-cols > div:not(:first-child) a { padding: 9px 0; min-height: 40px; }
  .f-cols h4 { margin-bottom: 8px; }
  .footer-inner { gap: 20px; padding-bottom: 20px; }
}
