/* Night temple — the Grahayan look.
 *
 * A night sky over a Tamil temple gopuram carries the page. The wallpapers
 * in img/ are drawn in code, not photographed: the stars, the Milky Way, the
 * gopuram's silhouette and its reflection in the temple tank. Temple brass is
 * the one accent, and sikku kolam line art is the only ornament.
 *
 * Two authentic forms still carry the information: the South Indian ராசி
 * கட்டம், a 4x4 grid whose twelve outer cells are fixed rasis around a hollow
 * centre, and the traditional graha colours -- lifted in lightness so they
 * read as text on the night ground, never changed in hue (GRAHA in app.js).
 *
 * Phone first: half the family opens this on a phone. Wider screens add
 * columns at 700px and the side-by-side reading at 1000px.
 */

:root {
  /* Tells the browser to draw its OWN native widgets -- date/time pickers,
   * the popups they open, select dropdown lists, scrollbars -- in a
   * dark-appropriate style. Without this they default to light-mode ink
   * (near-black icons/text) on top of this page's dark backgrounds. */
  color-scheme: dark;

  --ink:    #07080E;
  --ink-2:  #0D1019;
  --ink-3:  #141826;
  --ink-4:  #1C2133;
  --deep:   #0A0C14;

  --ivory:  #F3ECDF;
  --text:   #ECE6DA;
  --soft:   #D9D3E0;
  --mist:   #C9C3D3;
  --dim:    #A9A3B5;
  --faint:  #8F89A0;

  --line:   rgba(243,236,223,.12);
  --line-2: rgba(243,236,223,.18);
  --line-3: rgba(243,236,223,.32);

  --brass:  #E6BE6A;
  --brass-hi: #F3D48E;
  --brass-wash: rgba(230,190,106,.12);
  --brass-line: rgba(230,190,106,.45);
  --kumkum: #E0512F;

  /* Porutham grades: they differ in lightness as well as hue, and each has
   * its own icon, so colour is never the only signal. */
  --good: #7CC7D6;
  --match: #7FD49B;                 /* a porutham present, on the star list */
  --mid:  #E6BE6A;
  --bad:  #E9835C;

  --serif: 'Noto Serif Tamil', 'Noto Serif', Georgia, serif;
  --latin: 'Instrument Serif', Georgia, 'Times New Roman', serif;
  --sans:  'Anek Tamil', 'Noto Sans Tamil', system-ui, sans-serif;

  --top: 64px;
  --gutter: 16px;
  --ease: cubic-bezier(.2,.7,.2,1);
}
@media (min-width: 1000px) { :root { --top: 84px; --gutter: 56px; } }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; background: var(--ink); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0; min-height: 100vh; color: var(--ivory);
  font-family: var(--sans); font-size: 16px; line-height: 1.6;
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
img { display: block; max-width: 100%; }
svg { flex-shrink: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--brass); outline-offset: 3px; }
::selection { background: rgba(230,190,106,.35); }

.hidden { display: none !important; }
.sr-only {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}

h1, h2, h3 {
  margin: 0; font-family: var(--serif); font-weight: 700; line-height: 1.3;
  text-wrap: balance;
}
p { margin: 0; }
.eyebrow { font-size: 13px; letter-spacing: .04em; color: var(--brass); }
.en { font-family: var(--latin); font-style: italic; font-weight: 400; }
.en-note { display: block; margin-top: 4px; color: var(--dim); font-size: .92em; }
.muted { font-size: 13px; color: var(--dim); }
.note { font-size: 13px; color: var(--dim); line-height: 1.6; }
.note:empty { display: none; }
.err { color: var(--bad); font-size: 14px; line-height: 1.5; }
.hint { font-size: 13px; color: var(--dim); line-height: 1.5; min-height: 1em; }

/* ---------- Icons: one stroke style everywhere ---------- */
.btn svg, .iconbtn svg, .back svg, .mode-go svg, .promise svg, .privacy svg,
.about .chev, .prow .chev, #btnRestart svg, #btnAsk svg {
  width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round;
}

/* ---------- Buttons ---------- */
.btn {
  min-height: 56px; padding: 0 28px; border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  border: 1px solid transparent; background: transparent; color: var(--ivory);
  font-size: 17px; font-weight: 600; text-decoration: none; white-space: nowrap;
  transition: transform .2s var(--ease), background .2s, border-color .2s, box-shadow .2s, color .2s;
}
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--ivory); color: var(--ink); }
.btn.primary:hover:not(:disabled) { background: #fff; box-shadow: 0 12px 34px rgba(243,236,223,.18); }
.btn.glass {
  background: rgba(7,8,14,.40); border-color: rgba(243,236,223,.40);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.btn.glass:hover { border-color: var(--ivory); }
.btn.ghost { border-color: var(--line-3); }
.btn.ghost:hover { border-color: var(--brass); color: var(--brass-hi); }
.btn.small { min-height: 44px; padding: 0 18px; font-size: 15px; }
.btn.small svg { width: 16px; height: 16px; }
.btnrow { display: flex; flex-wrap: wrap; gap: 10px; }

.iconbtn {
  width: 44px; height: 44px; border-radius: 999px; flex-shrink: 0;
  display: inline-grid; place-items: center; padding: 0;
  background: rgba(243,236,223,.06); border: 1px solid var(--line-2); color: var(--ivory);
  transition: border-color .2s, color .2s, background .2s;
}
.iconbtn:hover { border-color: var(--brass); color: var(--brass-hi); }
.iconbtn.square { border-radius: 16px; width: 56px; height: 56px; color: var(--brass); }
.linkbtn {
  min-height: 44px; padding: 0 4px; border: 0; background: none;
  color: var(--dim); font-size: 15px;
}
.linkbtn:hover { color: var(--ivory); }

/* ---------- Top bar ---------- */
.topbar {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  height: calc(var(--top) + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) 16px 0 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  border-bottom: 1px solid transparent;
  transition: background .3s, border-color .3s;
}
.topbar.solid {
  background: rgba(7,8,14,.78); border-bottom-color: var(--line);
  -webkit-backdrop-filter: blur(16px) saturate(1.2); backdrop-filter: blur(16px) saturate(1.2);
}
.brand {
  display: flex; align-items: center; gap: 10px; min-height: 44px;
  color: var(--ivory); text-decoration: none;
}
.logo { width: 38px; height: 38px; flex-shrink: 0; }
/* கிரஹயான் over a small ஜோதிடம் on a phone; side by side on a wide screen.
 * Tamil letters are never letter-spaced: it breaks the conjuncts apart. */
.brand-name { display: flex; flex-direction: column; line-height: 1.12; }
.brand-ta { font-family: var(--serif); font-size: 20px; font-weight: 700; }
.brand-sub { font-size: 12px; font-weight: 500; color: var(--dim); }
.topnav { display: none; }
.aiPill {
  height: 44px; padding: 0 16px; border-radius: 999px;
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(7,8,14,.40); border: 1px solid rgba(243,236,223,.24); color: var(--ivory);
  font-size: 14px; -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  transition: border-color .2s;
}
.aiPill:hover { border-color: var(--brass); }
/* The gear: a plain symbol; its menu says which model is connected. */
.aiPill.gear { position: relative; width: 44px; padding: 0; justify-content: center; flex-shrink: 0; }
.aiPill.gear svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round; }
.aiPill.gear[aria-expanded="true"] { border-color: var(--brass); }
.gearMenu {
  position: fixed; z-index: 60; top: calc(var(--top) + env(safe-area-inset-top) - 4px); right: 12px;
  min-width: 230px; padding: 6px; border-radius: 18px; display: flex; flex-direction: column; gap: 2px;
  background: var(--ink-3); border: 1px solid var(--line-2); box-shadow: 0 24px 60px rgba(0,0,0,.55);
}
.gearMenu button {
  min-height: 48px; padding: 0 14px; border: 0; border-radius: 12px; background: none; color: var(--ivory);
  display: flex; align-items: center; gap: 12px; font-size: 16px; text-align: left; cursor: pointer;
}
.gearMenu button:hover, .gearMenu button:focus-visible { background: var(--brass-wash); outline: none; }
.gearMenu svg { width: 20px; height: 20px; flex-shrink: 0; fill: none; stroke: var(--brass); stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round; }
.gearMenu .en { display: block; font-size: 12.5px; color: var(--dim); max-width: 160px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

@media (max-width: 600px) {
  .brand-sub { display: none; }
  .brand { min-width: 0; }
  .topbar { gap: 8px; padding-right: 12px; }
}

@media (min-width: 1000px) {
  .topbar { padding-left: 56px; padding-right: 56px; }
  .logo { width: 42px; height: 42px; }
  .brand-name { flex-direction: row; align-items: baseline; gap: 12px; }
  .brand-ta { font-size: 22px; }
  .brand-sub { font-size: 14px; }
  .topnav { display: flex; gap: 2px; margin-left: auto; }
  .navlink {
    min-height: 44px; padding: 0 16px; border: 0; background: none; color: var(--ivory);
    font-size: 15px; border-radius: 999px; transition: color .2s;
  }
  .navlink:hover { color: var(--brass-hi); }
  .aiPill { margin-left: 12px; }
  .gearMenu { right: 56px; }
}

/* ---------- Screens ---------- */
.screen { position: relative; isolation: isolate; }

/* ============================ Home ============================ */
.hero { position: relative; min-height: max(620px, 100svh); overflow: hidden; isolation: isolate; }
.hero-sky, .hero-sky img { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-sky img { object-fit: cover; object-position: 50% 50%; }
.hero-shade {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(7,8,14,.78) 0%, rgba(7,8,14,.30) 30%,
              rgba(7,8,14,0) 46%, rgba(7,8,14,0) 70%, rgba(7,8,14,.78) 100%);
}
.hero-copy {
  position: relative; z-index: 1; min-height: max(620px, 100svh);
  padding: calc(var(--top) + env(safe-area-inset-top) + 36px) 20px calc(32px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; justify-content: space-between; gap: 32px;
}
.hero-top { display: flex; flex-direction: column; gap: 14px; max-width: 560px; }
.hero h1 { font-size: clamp(32px, 9.3vw, 44px); line-height: 1.32; }
.hero-en { font-family: var(--latin); font-style: italic; font-size: 19px; line-height: 1.35; color: #DCD6E2; }
.hero-cta { display: flex; flex-direction: column; gap: 10px; }

/* One orchestrated reveal on arrival rather than scattered effects. */
@media (prefers-reduced-motion: no-preference) {
  .rise { animation: rise 1s var(--ease) both; }
  .hero-cta.rise { animation-delay: .18s; }
  @keyframes rise { from { opacity: 0; transform: translateY(18px); } }
  /* The sky drifts a little slower than the page -- a quiet parallax where
   * the browser can drive it from the scroll itself, nothing where not. */
  @supports (animation-timeline: scroll()) {
    .hero-sky img {
      animation: sky linear both; animation-timeline: scroll(root);
      animation-range: 0 100vh;
    }
    @keyframes sky { to { transform: translateY(14vh) scale(1.05); } }
  }
}

@media (min-width: 1000px) {
  .hero-shade {
    background:
      linear-gradient(90deg, rgba(7,8,14,.66) 0%, rgba(7,8,14,.34) 38%, rgba(7,8,14,0) 58%),
      linear-gradient(180deg, rgba(7,8,14,0) 70%, rgba(7,8,14,.62) 100%);
  }
  .hero-copy {
    justify-content: flex-start; gap: 30px;
    padding: calc(var(--top) + 13vh) 120px 220px;
  }
  .hero-top { gap: 22px; max-width: 760px; }
  .hero h1 { font-size: clamp(56px, 5.4vw, 80px); line-height: 1.24; }
  .hero h1 .l { display: block; }
  .hero-en { font-size: 27px; max-width: 540px; }
  .hero-cta { flex-direction: row; gap: 12px; }
  .hero-cta .btn { min-height: 58px; padding: 0 32px; font-size: 18px; }
}

/* ---------- Drifting rows (the questions, the books) ---------- */
.drift {
  overflow: hidden; display: flex; flex-direction: column; gap: 10px;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent);
}
.drift-track { display: flex; width: max-content; animation: drift 64s linear infinite; }
.drift-track.rev { animation-direction: reverse; animation-duration: 78s; }
.drift:hover .drift-track, .drift:focus-within .drift-track { animation-play-state: paused; }
.drift-set { display: flex; align-items: center; gap: 8px; padding-right: 8px; }
@keyframes drift { to { transform: translate3d(-50%, 0, 0); } }
@media (prefers-reduced-motion: reduce) {
  .drift-track { animation: none; }
  .drift { overflow-x: auto; -webkit-mask-image: none; mask-image: none; }
}

.chip {
  flex-shrink: 0; min-height: 44px; padding: 8px 18px; border-radius: 999px;
  display: inline-flex; align-items: center; text-align: left;
  border: 1px solid rgba(243,236,223,.16); background: rgba(243,236,223,.04); color: var(--ivory);
  font-size: 15px; line-height: 1.35; transition: border-color .2s, background .2s;
}
.chip:hover { border-color: var(--brass); background: var(--brass-wash); }
.chip.warm { border-color: rgba(230,190,106,.30); background: rgba(230,190,106,.06); }
.drift .chip { white-space: nowrap; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips .chip { flex-shrink: 1; }
.chips:empty { display: none; }
.chiplabel { font-size: 13px; color: var(--brass); align-self: center; margin-right: 2px; flex-shrink: 0; }
/* Under the chart on a phone the next questions are one row to swipe,
 * not a stack that pushes the conversation down. */
@media (max-width: 999px) {
  .res-chat .chips {
    flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; overscroll-behavior-x: contain;
    margin: 0 calc(-1 * var(--gutter)); padding: 0 var(--gutter) 2px;
  }
  .res-chat .chips::-webkit-scrollbar { display: none; }
  .res-chat .chips .chip { flex-shrink: 0; white-space: nowrap; }
}

.asks { padding: 40px 0 44px; display: flex; flex-direction: column; gap: 18px; }
.asks .section-head, .asks .note { padding: 0 20px; }
@media (min-width: 1000px) {
  .asks { position: relative; z-index: 2; margin-top: -150px; padding: 0 0 40px; }
  .asks .section-head { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .asks .chip { background: rgba(7,8,14,.45); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); min-height: 46px; padding: 0 20px; }
  .asks .note { padding: 0 120px; }
}

/* ---------- Sections ---------- */
.section { padding: 56px 16px; }
.section-head { display: flex; flex-direction: column; gap: 8px; padding: 0 4px; }
.head-copy { display: flex; flex-direction: column; gap: 8px; }
.section-head h2, .how h2, .library h2 { font-size: 26px; line-height: 1.35; }
.lede { font-size: 15px; line-height: 1.6; color: var(--mist); }
@media (min-width: 1000px) {
  .section { padding: 120px 120px 110px; }
  .section-head.row { flex-direction: row; align-items: flex-end; justify-content: space-between; gap: 40px; }
  .head-copy { gap: 12px; }
  .section-head h2, .how h2, .library h2 { font-size: 48px; }
  .eyebrow { font-size: 15px; }
  .lede { max-width: 420px; font-size: 17px; }
}

/* Revealed once as they scroll in (initReveal); fully visible without JS. */
.reveal-on .reveal { opacity: 0; transform: translateY(26px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.reveal-on .reveal.in { opacity: 1; transform: none; }

/* ---------- The two ways in ---------- */
.mode-grid { display: grid; gap: 14px; margin-top: 24px; }
.mode-card {
  position: relative; min-height: 380px; padding: 24px; border-radius: 28px; overflow: hidden;
  display: flex; flex-direction: column; justify-content: flex-end; text-align: left;
  background: var(--ink-2); border: 1px solid var(--line); color: var(--ivory);
  transition: transform .45s var(--ease), border-color .45s, box-shadow .45s;
}
.mode-card:hover { transform: translateY(-4px); border-color: rgba(230,190,106,.45); box-shadow: 0 30px 80px rgba(0,0,0,.45); }
.mode-art { position: absolute; pointer-events: none; transition: transform 1.2s var(--ease); }
.mode-card:hover .mode-art { transform: scale(1.04) rotate(-2deg); }
.mode-art.sun { width: 320px; height: 320px; right: -86px; top: -76px; }
.mode-art.moon-a { width: 160px; height: 160px; right: 48px; top: -22px; }
.mode-art.moon-b { width: 112px; height: 112px; right: -16px; top: 58px; opacity: .9; }
.mode-text { position: relative; display: flex; flex-direction: column; gap: 8px; }
.mode-title { font-family: var(--serif); font-size: 32px; font-weight: 700; line-height: 1.3; }
.mode-desc { font-size: 15px; line-height: 1.55; color: var(--mist); }
.mode-go { margin-top: 6px; display: inline-flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 600; color: var(--brass); }
.mode-go svg { width: 16px; height: 16px; transition: transform .3s var(--ease); }
.mode-card:hover .mode-go svg { transform: translateX(4px); }
@media (min-width: 700px) {
  .mode-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1000px) {
  .mode-grid { gap: 24px; margin-top: 44px; }
  .mode-card { min-height: 480px; padding: 40px; border-radius: 32px; }
  .mode-art.sun { width: 460px; height: 460px; right: -110px; top: -120px; }
  .mode-art.moon-a { width: 230px; height: 230px; right: 110px; top: -10px; }
  .mode-art.moon-b { width: 160px; height: 160px; right: 16px; top: 110px; }
  .mode-text { gap: 10px; max-width: 460px; }
  .mode-title { font-size: 44px; }
  .mode-desc { font-size: 17px; line-height: 1.6; }
  .mode-go { margin-top: 10px; font-size: 16px; }
}

/* ---------- How an answer is made ---------- */
.how {
  position: relative; overflow: hidden; padding: 56px 16px 60px;
  background: var(--deep); border-block: 1px solid rgba(243,236,223,.06);
  display: grid; gap: 28px;
}
.how-kolam { position: absolute; right: -90px; top: -60px; width: 300px; opacity: .08; pointer-events: none; }
.how-copy { position: relative; display: flex; flex-direction: column; gap: 10px; padding: 0 4px; }
.how h2 { line-height: 1.4; }
.steps { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 20px; }
.steps li { display: flex; gap: 16px; align-items: flex-start; }
.steps .n {
  width: 40px; height: 40px; flex-shrink: 0; border-radius: 50%;
  display: grid; place-items: center; border: 1px solid rgba(230,190,106,.55);
  color: var(--brass); font-family: var(--latin); font-size: 20px;
}
.steps li > span:last-child { font-size: 15px; line-height: 1.55; color: var(--mist); }
.steps b { display: block; margin-bottom: 2px; font-size: 17px; font-weight: 600; color: var(--ivory); }
.steps.small { margin: 4px 0 6px; gap: 12px; }
.steps.small .n { width: 28px; height: 28px; font-family: var(--sans); font-size: 13px; }
.steps.small li > span:last-child { font-size: 14px; color: var(--soft); }
.sample {
  position: relative; margin: 0; padding: 20px; border-radius: 24px;
  background: var(--ink-2); border: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 12px;
}
.sample figcaption { font-size: 12px; letter-spacing: .03em; color: var(--dim); }
.sample .msg.bot p { font-size: 15px; }
@media (min-width: 1000px) {
  .how { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 80px; padding: 110px 120px; }
  .how-kolam { right: auto; left: -120px; top: auto; bottom: -140px; width: 520px; opacity: .06; }
  .how-copy { gap: 12px; padding: 0; }
  .how h2 { line-height: 1.35; }
  .steps { margin-top: 26px; gap: 26px; }
  .steps .n { width: 48px; height: 48px; font-size: 24px; }
  .steps b { font-size: 19px; }
  .steps li > span:last-child { font-size: 16px; }
  .sample { align-self: center; padding: 30px; border-radius: 28px; box-shadow: 0 40px 100px rgba(0,0,0,.45); }
  .sample .msg.bot p { font-size: 16px; }
}

/* ---------- The nine ---------- */
.grahas { padding-left: 0; padding-right: 0; }
.grahas .section-head { padding: 0 20px; }
.rail-nav { display: none; }
/* Scrolling sideways makes the rail clip up and down too, so its top
 * padding holds a hovered card's lift and the focus ring. */
.rail {
  display: flex; gap: 12px; margin-top: 12px; padding: 10px 16px 8px;
  overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding: 0 16px;
  overscroll-behavior-x: contain; scrollbar-width: none;
}
.rail::-webkit-scrollbar { display: none; }
.graha-card {
  flex-shrink: 0; width: 164px; min-height: 250px; padding: 16px; scroll-snap-align: start;
  border-radius: 22px; background: var(--ink-2); border: 1px solid var(--line);
  display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center;
  transition: transform .45s var(--ease), border-color .45s;
}
.graha-card:hover { transform: translateY(-6px); border-color: rgba(230,190,106,.40); }
.graha-card img { width: 118px; height: 118px; }
.g-short { margin-top: 4px; font-size: 26px; font-weight: 700; line-height: 1.3; }
.g-name { font-size: 15px; font-weight: 600; }
.g-deity { font-size: 12px; color: var(--dim); }
@media (min-width: 1000px) {
  .grahas .section-head { padding: 0 120px; }
  .rail-nav { display: flex; gap: 8px; }
  .rail { gap: 18px; margin-top: 30px; padding: 10px 120px 8px; scroll-padding: 0 120px; }
  .graha-card { width: 232px; min-height: 320px; padding: 22px; border-radius: 26px; gap: 6px; }
  .graha-card img { width: 168px; height: 168px; }
  .g-short { font-size: 30px; }
  .g-name { font-size: 17px; }
  .g-deity { font-size: 13px; }
}

/* ---------- A graha, opened ---------- */
/* The cards are buttons now: they open their graha's card. */
button.graha-card { font: inherit; color: inherit; cursor: pointer; appearance: none; -webkit-tap-highlight-color: transparent; }
button.graha-card:focus-visible { outline: 2px solid var(--brass); outline-offset: 3px; }
html.gs-open, html.gs-open body { overflow: hidden; }

.gsheet { position: fixed; inset: 0; z-index: 80; }
.gs-backdrop { position: absolute; inset: 0; background: rgba(4,5,10,.74); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
/* A phone: the card fills the screen, and everything in it scrolls. */
.gs-panel {
  position: absolute; inset: 0; display: flex; flex-direction: column; overflow: hidden;
  background: radial-gradient(120% 50% at 50% 0%, rgba(230,190,106,.10), transparent 62%), var(--ink-2);
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
}
.gs-x {
  position: absolute; z-index: 4; top: calc(10px + env(safe-area-inset-top)); right: 10px;
  width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; cursor: pointer;
  background: rgba(7,8,14,.78); border: 1px solid var(--line-2); color: var(--ivory);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.gs-x:hover { border-color: var(--brass-line); }
.gs-x:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; }
.gs-x svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.gs-body {
  flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
  padding-bottom: calc(84px + env(safe-area-inset-bottom));
}
.gs-side {
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 2px;
  padding: calc(26px + env(safe-area-inset-top)) 20px 14px;
}
.gs-img { width: 132px; height: 132px; margin-bottom: 4px; }
.gs-short { font-size: 30px; font-weight: 700; line-height: 1.25; }
.gs-name { margin: 0; font-family: var(--serif); font-size: 26px; font-weight: 700; color: var(--ivory); }
.gs-deity { margin: 0; font-size: 14px; color: var(--dim); }
.gs-quick { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 12px 0 0; padding: 0; list-style: none; }
.gs-quick li { font-size: 12.5px; padding: 5px 11px; border-radius: 999px; border: 1px solid var(--line-2); color: var(--soft); background: rgba(243,236,223,.03); }
/* The section chips stay under the top edge. The bar keeps its right end
 * clear, so the ✕ never sits over a chip however the row is scrolled. */
.gs-bar {
  position: sticky; top: 0; z-index: 3; padding-right: 62px;
  background: rgba(13,16,25,.94); border-bottom: 1px solid var(--line);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.gs-chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 10px 8px 10px 14px; }
.gs-chips::-webkit-scrollbar { display: none; }
.gs-chips a {
  flex-shrink: 0; min-height: 38px; display: inline-flex; align-items: center; padding: 0 12px;
  border-radius: 999px; border: 1px solid var(--line-2); color: var(--soft); font-size: 13.5px; text-decoration: none;
}
@media (min-width: 900px) { .gs-chips { gap: 8px; } .gs-chips a { padding: 0 14px; font-size: 14px; } }
.gs-chips a:hover, .gs-chips a:focus-visible { border-color: var(--brass-line); color: var(--brass-hi); outline: none; }
.gs-sec { padding: 20px 20px 4px; scroll-margin-top: 62px; }
.gs-sec h3 { margin: 0 0 10px; font-family: var(--serif); font-size: 20px; color: var(--brass); }
.gs-sec h4 { margin: 18px 0 8px; font-size: 14px; font-weight: 600; color: var(--mist); }
.gs-sec p { margin: 0 0 10px; line-height: 1.8; color: var(--text); }
.gs-facts { margin: 0; border-top: 1px solid var(--line); }
.gs-facts > div { display: grid; grid-template-columns: 7.4em minmax(0, 1fr); gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.gs-facts dt { font-size: 14px; color: var(--dim); }
.gs-facts dd { margin: 0; line-height: 1.65; color: var(--text); overflow-wrap: anywhere; }
.gs-note { font-size: 12.5px !important; line-height: 1.6 !important; color: var(--faint) !important; margin-top: 10px !important; }
.gs-temple-name { font-family: var(--serif); font-size: 19px; font-weight: 700; color: var(--ivory) !important; margin-bottom: 2px !important; }
.gs-place { font-size: 14px; color: var(--mist) !important; }
.gs-map { display: block; width: 100%; max-width: 420px; height: auto; margin: 6px 0 14px; border-radius: 16px; background: rgba(243,236,223,.03); border: 1px solid var(--line); }
.gs-map .dot { fill: rgba(243,236,223,.45); }
.gs-map .here { stroke: var(--ink-2); stroke-width: 2; filter: drop-shadow(0 0 6px rgba(243,212,142,.55)); }
.gs-map text { font-family: var(--sans); font-size: 11px; fill: var(--dim); }
.gs-map .here-label { fill: var(--ivory); font-weight: 700; font-size: 12.5px; }
.gs-map .kum { fill: none; stroke: var(--brass); stroke-width: 1.5; }
.gs-map .kum-label { fill: var(--brass); font-size: 10.5px; }
.gs-practice { margin: 0; padding-left: 1.2em; }
.gs-practice li { margin: 0 0 8px; line-height: 1.75; }
.gs-cites { margin: 0; padding: 4px 0 10px; list-style: none; display: grid; gap: 8px; }
.gs-cites .cite { display: block; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); font-size: 13.5px; line-height: 1.6; color: var(--soft); }
.gs-cites .cite b { display: inline-grid; place-items: center; min-width: 22px; height: 22px; margin-right: 8px; border-radius: 6px; background: var(--brass-wash); color: var(--brass-hi); font-size: 12px; }
.gs-cites .q { display: block; margin-top: 4px; color: var(--dim); font-size: 13px; }
.gs-error { padding: 80px 24px; text-align: center; color: var(--mist); }
.gs-steps {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 4; display: flex; justify-content: space-between;
  padding: 18px 14px calc(12px + env(safe-area-inset-bottom)); pointer-events: none;
  background: linear-gradient(rgba(13,16,25,0), rgba(13,16,25,.96) 45%);
}
.gs-step {
  pointer-events: auto; min-height: 44px; display: inline-flex; align-items: center; gap: 6px; padding: 0 14px;
  border-radius: 999px; border: 1px solid var(--line-2); background: rgba(7,8,14,.82); color: var(--text);
  font: inherit; font-size: 14px; cursor: pointer;
}
.gs-step:hover, .gs-step:focus-visible { border-color: var(--brass-line); outline: none; }
.gs-step svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; }
/* The card in flight between the rail and the centre. */
.gs-ghost { position: fixed; z-index: 81; margin: 0; pointer-events: none; transform-origin: 50% 50%; backface-visibility: hidden; }

/* A wide screen: a big card over the dimmed sky; the graha stands on the
 * left, its sections scroll on the right. */
@media (min-width: 900px) {
  .gs-panel {
    inset: 0; margin: auto; width: min(1100px, calc(100vw - 96px)); height: min(800px, calc(100dvh - 72px));
    border-radius: 28px; border: 1px solid var(--line-2); box-shadow: 0 50px 140px rgba(0,0,0,.6);
  }
  .gs-x { top: 16px; right: 16px; }
  .gs-body { overflow: hidden; padding-bottom: 0; }
  .gs-layout { display: grid; grid-template-columns: 330px minmax(0, 1fr); height: 100%; }
  .gs-side {
    justify-content: flex-start; padding: 46px 28px 100px; border-right: 1px solid var(--line);
    background: radial-gradient(90% 40% at 50% 12%, rgba(230,190,106,.08), transparent 70%), rgba(7,8,14,.35);
  }
  .gs-img { width: 196px; height: 196px; }
  .gs-short { font-size: 36px; }
  .gs-name { font-size: 30px; }
  .gs-main { height: 100%; overflow-y: auto; overscroll-behavior: contain; padding-bottom: 36px; }
  .gs-bar { padding-right: 74px; }
  .gs-chips { padding: 16px 8px 14px 28px; }
  .gs-sec { padding: 26px 32px 4px; scroll-margin-top: 70px; }
  .gs-sec h3 { font-size: 22px; }
  .gs-facts > div { grid-template-columns: 9em minmax(0, 1fr); }
  .gs-steps { right: auto; width: 330px; padding: 20px 22px; background: none; }
}

/* ---------- The library ---------- */
.library {
  padding: 52px 0 56px; background: var(--deep); border-top: 1px solid rgba(243,236,223,.06);
  display: flex; flex-direction: column; gap: 28px;
}
.library-head { padding: 0 20px; display: grid; gap: 24px; }
.library h2 { line-height: 1.4; }
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.stat { display: flex; flex-direction: column; gap: 2px; }
.stat .num { font-family: var(--latin); font-size: clamp(38px, 11vw, 58px); line-height: 1; }
.stat .label { font-size: 15px; font-weight: 600; }
.stat .sub { font-size: 13px; color: var(--dim); }
.books .drift-set { gap: 22px; padding-right: 22px; white-space: nowrap; }
.books .drift-set i { font-style: normal; color: var(--brass); }
.books .ta { font-family: var(--serif); font-size: 18px; font-weight: 600; color: #E9E3D6; }
.books .lat { font-family: var(--latin); font-style: italic; font-size: 20px; color: #B9B3C5; }
@media (min-width: 1000px) {
  .library { padding: 100px 0 110px; gap: 56px; }
  .library-head { padding: 0 120px; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 80px; align-items: end; }
  .stats { gap: 24px; }
  .stat .num { font-size: 96px; }
  .stat .label { font-size: 17px; }
  .stat .sub { font-size: 14px; }
  .books .drift-set { gap: 30px; padding-right: 30px; }
  .books .ta { font-size: 28px; }
  .books .lat { font-size: 30px; }
}

/* ---------- The one action again ---------- */
.closing { padding: 48px 20px calc(32px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 22px; }
.closing .band { width: 100%; max-width: 720px; opacity: .55; }
.closing h2 { margin-top: 6px; font-size: 28px; line-height: 1.4; }
.closing .btn { align-self: stretch; }
.promise { display: flex; gap: 12px; align-items: flex-start; font-size: 14px; line-height: 1.6; color: var(--mist); }
.promise svg { color: var(--good); margin-top: 2px; }
.site-foot {
  margin-top: 22px; padding-top: 22px; border-top: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 8px; font-size: 13px; color: var(--dim);
}
.foot-brand { display: inline-flex; align-items: center; gap: 10px; font-family: var(--serif); font-size: 16px; font-weight: 700; color: var(--ivory); }
.foot-brand .logo { width: 32px; height: 32px; }
@media (min-width: 1000px) {
  .closing { align-items: center; text-align: center; gap: 28px; padding: 110px 120px 44px; }
  .closing h2 { font-size: 52px; }
  .closing .btn { align-self: center; min-height: 60px; padding: 0 36px; font-size: 18px; }
  .promise { align-items: center; font-size: 15px; }
  .site-foot { width: 100%; max-width: 1200px; margin-top: 70px; flex-direction: row; justify-content: space-between; align-items: center; font-size: 14px; }
}

/* ============================ Forms ============================ */
label, .flabel { font-size: 14px; color: var(--dim); }
input:not([type="checkbox"]):not([type="radio"]), select, textarea {
  width: 100%; min-height: 56px; padding: 0 16px; border-radius: 16px;
  background: var(--ink-2); border: 1px solid rgba(243,236,223,.14); color: var(--ivory);
  font-size: 17px; transition: border-color .18s, box-shadow .18s;
}
input::placeholder, textarea::placeholder { color: var(--faint); }
input:not([type="checkbox"]):not([type="radio"]):focus, select:focus, textarea:focus {
  outline: none; border-color: var(--brass); box-shadow: 0 0 0 4px rgba(230,190,106,.16);
}
input[type="date"], input[type="time"] { color-scheme: dark; min-width: 0; }
/* Safari (especially iOS) draws its own native select chrome and ignores
 * most of the box above -- the text and system arrow end up jammed against
 * the edge instead of respecting our padding. Turning that off and drawing
 * our own arrow keeps the select's inset identical on every browser. */
select {
  appearance: none; -webkit-appearance: none; -moz-appearance: none; padding-right: 42px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23E6BE6A' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 16px center;
}
/* Chrome/password managers ignore the page's colours on autofill and paint
 * their own light background -- push it back to the theme with a huge inset
 * shadow (the only thing -webkit-autofill lets us override), and delay the
 * yellow flash Chrome does on first fill. */
input:-webkit-autofill, input:-webkit-autofill:hover,
input:-webkit-autofill:focus, input:-webkit-autofill:active {
  -webkit-text-fill-color: var(--ivory); caret-color: var(--ivory);
  -webkit-box-shadow: 0 0 0 1000px var(--ink-2) inset; box-shadow: 0 0 0 1000px var(--ink-2) inset;
  transition: background-color 9999s ease-in-out 0s;
}
.field { position: relative; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.grid2 { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
/* An address or a key is long: on a phone those fields take the full width. */
@media (max-width: 699px) { .grid2.stack { grid-template-columns: minmax(0, 1fr); } }

/* Segmented controls: buttons with aria-pressed, or radios in labels. Both
 * options must be readable at a glance -- a choice that changes the next
 * answer should not hide behind a dropdown. */
.seg {
  display: flex; gap: 4px; padding: 4px; border-radius: 999px;
  background: rgba(243,236,223,.05); border: 1px solid var(--line-2);
}
.seg > button, .seg > label { flex: 1 1 0; min-width: 0; display: flex; }
.seg > button, .seg > label > span {
  width: 100%; min-height: 44px; padding: 6px 12px; border: 0; border-radius: 999px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: transparent; color: var(--mist); font-size: 15px; font-weight: 600;
  line-height: 1.3; text-align: center; cursor: pointer; transition: background .2s, color .2s;
}
.seg > button:hover, .seg > label > span:hover { color: var(--ivory); }
.seg > button[aria-pressed="true"], .seg > button[aria-checked="true"], .seg > button.active,
.seg > label > input:checked + span { background: var(--ivory); color: var(--ink); }
.seg > label > input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.seg > label > input:focus-visible + span { outline: 2px solid var(--brass); outline-offset: 2px; }
.seg > button:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; }
/* ஆண் / பெண்: two short words, so the pair need not span the form. */
.genderseg { max-width: 320px; }
/* A man or a woman: each choice carries the family face, dimmed until chosen. */
.gsel > button { flex-direction: row; gap: 10px; min-height: 52px; padding: 6px 14px 6px 8px; }
.genderseg.gsel { max-width: 360px; }
.gface {
  width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0; object-fit: cover;
  border: 1.5px solid var(--line-2); opacity: .6; filter: grayscale(.7);
  transition: opacity .2s, filter .2s, border-color .2s, transform .2s var(--ease);
}
.gsel > button:hover .gface, .deepWho label:hover .gface { opacity: .9; filter: none; }
.gsel > button[aria-checked="true"] .gface, .gsel > button[aria-pressed="true"] .gface,
.deepWho input:checked ~ .gface { opacity: 1; filter: none; border-color: var(--brass); transform: scale(1.06); }
.dots.gsel > button { min-height: 44px; padding: 4px 12px 4px 6px; }
.dots .gface { width: 28px; height: 28px; }
@media (prefers-reduced-motion: reduce) { .gface { transition: none; } }

/* ---------- Place autocomplete ---------- */
.suggest {
  position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 6px);
  max-height: 260px; overflow-y: auto; border-radius: 16px;
  background: var(--ink-3); border: 1px solid var(--line-2); box-shadow: 0 24px 60px rgba(0,0,0,.55);
}
.suggest div {
  min-height: 48px; padding: 8px 16px; display: flex; align-items: center; gap: 10px;
  border-bottom: 1px solid rgba(243,236,223,.07); font-size: 16px; cursor: pointer;
}
.suggest div:last-child { border-bottom: 0; }
.suggest div:hover, .suggest div.active { background: var(--brass-wash); }
.suggest .en { font-family: var(--sans); font-style: normal; font-size: 13px; color: var(--dim); }

/* ---------- Family: the birth form's row of faces and save card ---------- */
.famPick { display: flex; flex-direction: column; }
.famToggle {
  align-self: flex-start; min-height: 48px; padding: 4px 14px 4px 4px; border-radius: 999px;
  display: inline-flex; align-items: center; gap: 10px; cursor: pointer;
  background: var(--brass-wash); border: 1px solid var(--brass-line); color: var(--brass-hi); font-size: 15px;
  transition: border-color .2s, background .2s;
}
.famToggle:hover, .famPick.open .famToggle { border-color: var(--brass); }
.famToggle:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; }
.famToggle-ico { width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0; display: grid; place-items: center;
  background: rgba(7,8,14,.55); border: 1px solid var(--brass-line); overflow: hidden; }
.famToggle-ico svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round; }
.famToggle-ico img { width: 100%; height: 100%; object-fit: cover; }
.famToggle-text b { color: var(--ivory); font-weight: 600; }
.famToggle .en, .saveSwitch .en { color: var(--dim); font-size: 13px; }
.famToggle .chev { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round; transition: transform .25s var(--ease); }
.famPick.open .chev { transform: rotate(180deg); }
.famToggle.chosen .famToggle-ico { border-color: var(--brass); box-shadow: 0 0 0 3px rgba(230,190,106,.18); }
/* The row slides open: 0fr to 1fr animates a height nothing has to measure. */
.famRowWrap { display: grid; grid-template-rows: 0fr; opacity: 0; transition: grid-template-rows .3s var(--ease), opacity .25s; }
.famPick.open .famRowWrap { grid-template-rows: 1fr; opacity: 1; }
.famRow { min-height: 0; overflow: hidden; display: flex; gap: 14px; padding: 0 2px; }
.famPick.open .famRow { overflow-x: auto; padding: 14px 2px 6px; scroll-snap-type: x proximity; scrollbar-width: none; }
.famRow::-webkit-scrollbar { display: none; }
.famChip {
  flex: 0 0 auto; width: 74px; padding: 0; border: 0; background: none; color: var(--mist); cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 7px; font-size: 13.5px; scroll-snap-align: start;
}
.famChip img, .famChip .plus {
  position: relative; width: 60px; height: 60px; border-radius: 50%; object-fit: cover;
  border: 2px solid var(--line-2); transition: transform .2s var(--ease), border-color .2s, box-shadow .2s;
}
.famChip > span:last-child { max-width: 74px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.famChip:hover img, .famChip:focus-visible img { transform: translateY(-3px) scale(1.04); border-color: var(--brass); }
.famChip:focus-visible { outline: none; color: var(--ivory); }
.famChip[aria-selected="true"] { color: var(--brass-hi); }
.famChip[aria-selected="true"] img { border-color: var(--brass); box-shadow: 0 0 0 4px rgba(230,190,106,.22), 0 0 22px rgba(230,190,106,.35); }
.famChip .plus { display: grid; place-items: center; border-style: dashed; border-color: var(--brass-line);
  color: var(--brass); font-size: 28px; font-weight: 300; line-height: 1; }
.famChip.add:hover .plus { border-color: var(--brass); transform: translateY(-3px); }
/* Fields a face just filled glow once, so the change is seen. */
input.filled { animation: filled 1.1s var(--ease); }
@keyframes filled { 0% { border-color: var(--brass); box-shadow: 0 0 0 5px rgba(230,190,106,.28); } }

.saveCard {
  display: flex; flex-wrap: wrap; align-items: center; gap: 14px; padding: 14px; border-radius: 20px;
  background: rgba(243,236,223,.03); border: 1px dashed var(--line-2); transition: border-color .25s, background .25s;
}
.saveCard.on { border-style: solid; border-color: var(--brass-line); background: var(--brass-wash); }
.saveFace { flex-shrink: 0; width: 60px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.saveFace img { width: 52px; height: 52px; border-radius: 50%; border: 2px solid var(--line-2); opacity: .55;
  filter: grayscale(.6); transition: opacity .25s, filter .25s, border-color .25s; }
.saveCard.on .saveFace img { opacity: 1; filter: none; border-color: var(--brass); }
.saveName { max-width: 60px; font-size: 12.5px; color: var(--brass-hi); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.saveMain { flex: 1; min-width: 0; }
.saveAlias { flex: 1 1 100%; }
.saveSwitch { min-height: 52px; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  color: var(--ivory); font-size: 15px; cursor: pointer; }
.saveSwitch > span:first-child { display: flex; flex-direction: column; gap: 2px; }
.saveFull { color: var(--bad); font-size: 12.5px; }
.saveSwitch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch { position: relative; flex-shrink: 0; width: 50px; height: 30px; border-radius: 999px;
  background: rgba(243,236,223,.14); border: 1px solid var(--line-2); transition: background .25s, border-color .25s; }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%;
  background: var(--ivory); transition: transform .25s var(--ease); }
.saveSwitch input:checked + .switch { background: var(--brass); border-color: var(--brass); }
.saveSwitch input:checked + .switch::after { transform: translateX(20px); background: var(--ink); }
.saveSwitch input:focus-visible + .switch { outline: 2px solid var(--brass); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  .famRowWrap, .famChip img, .switch, .switch::after, .famToggle .chev { transition: none; }
  input.filled { animation: none; }
}

/* ---------- Family: the sheet ---------- */
.fs-body {
  flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
  padding: calc(18px + env(safe-area-inset-top)) 18px calc(32px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 16px;
}
.fs-head { padding-right: 52px; display: flex; flex-direction: column; gap: 6px; }
.fs-head h2 { margin: 0; font-family: var(--serif); font-size: 26px; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.fs-head h2 .en { font-family: var(--sans); font-size: 16px; font-weight: 500; color: var(--dim); }
.fs-count { padding: 2px 10px; border-radius: 999px; border: 1px solid var(--line-2); font-family: var(--sans); font-size: 13px; font-weight: 500; color: var(--mist); }
.fs-head p { margin: 0; font-size: 14px; line-height: 1.6; }
.fs-head .en, .fs-full .en { display: block; color: var(--dim); font-size: 13px; }
.fs-full { padding: 12px 14px; border-radius: 16px; font-size: 14.5px; line-height: 1.6;
  background: rgba(233,131,92,.10); border: 1px solid rgba(233,131,92,.40); }
.fs-list { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.fs-list li { display: flex; align-items: center; gap: 8px; padding: 10px; border-radius: 16px;
  background: rgba(243,236,223,.03); border: 1px solid var(--line); }
.fs-face { width: 48px; height: 48px; flex-shrink: 0; margin-right: 4px; border-radius: 50%; object-fit: cover;
  border: 2px solid var(--brass-line); }
.fs-who { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.fs-who b { font-size: 16px; color: var(--ivory); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fs-who span { font-size: 13px; color: var(--dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.iconbtn.del:hover { border-color: var(--bad); color: var(--bad); }
.fs-list.choose .del { border-color: var(--bad); color: var(--bad); background: rgba(233,131,92,.12); }
#btnFamilyAdd { align-self: flex-start; }
.fs-form { padding: 16px; border-radius: 20px; display: flex; flex-direction: column; gap: 14px;
  background: rgba(7,8,14,.35); border: 1px solid var(--line-2); }
.fs-form h3 { margin: 0; font-size: 18px; }
.fs-actions { display: flex; gap: 10px; flex-wrap: wrap; }
@media (min-width: 900px) {
  .fs-panel { width: min(620px, calc(100vw - 96px)); height: fit-content; max-height: calc(100dvh - 64px); }
  .fs-body { padding: 28px 28px 32px; }
}

.toast {
  position: fixed; z-index: 95; left: 50%; transform: translateX(-50%);
  top: calc(var(--top) + env(safe-area-inset-top) + 12px); width: max-content; max-width: min(520px, calc(100vw - 32px));
  padding: 14px 18px; border-radius: 16px; font-size: 15px; line-height: 1.55; color: var(--ivory); cursor: pointer;
  background: var(--ink-3); border: 1px solid var(--brass-line); box-shadow: 0 24px 60px rgba(0,0,0,.55);
  animation: toastIn .25s var(--ease);
}
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, -8px); } }
@media (prefers-reduced-motion: reduce) { .toast { animation: none; } }

/* ============================ Setup ============================ */
.setup { min-height: 100svh; padding-top: calc(var(--top) + env(safe-area-inset-top) + 24px); }
.setup::before {
  content: ''; position: fixed; inset: -24px; z-index: -1;
  background: var(--ink) url(/static/img/sky-tall-1080.webp) center / cover no-repeat;
  filter: blur(4px) brightness(.5);
}
@media (min-aspect-ratio: 1/1) { .setup::before { background-image: url(/static/img/sky-1920.webp); } }
.dialog {
  min-height: calc(100svh - var(--top) - 24px); padding: 24px 20px calc(24px + env(safe-area-inset-bottom));
  border-radius: 28px 28px 0 0; background: var(--ink-2); border: 1px solid var(--line-2); border-bottom: 0;
  display: flex; flex-direction: column; gap: 18px;
}
.dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.dialog-head h2 { font-size: 26px; }
.dialog-head .en { margin-top: 4px; font-size: 17px; color: var(--dim); }
.privacy, .hint-note {
  display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 16px;
  font-size: 14px; line-height: 1.55; color: var(--soft);
}
.privacy { background: rgba(124,199,214,.08); border: 1px solid rgba(124,199,214,.22); }
.privacy svg { color: var(--good); margin-top: 2px; }
.hint-note { display: block; background: var(--brass-wash); border: 1px solid var(--brass-line); color: var(--ivory); }
.hint-note span { display: block; margin-top: 4px; color: var(--dim); font-size: 13px; }
.providers { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.provider { display: flex; }
.provider input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.provider > span {
  width: 100%; min-height: 76px; padding: 12px 16px; border-radius: 16px; cursor: pointer;
  display: flex; flex-direction: column; justify-content: center; gap: 2px;
  background: var(--ink-3); border: 1px solid rgba(243,236,223,.14); transition: border-color .2s, background .2s;
}
.provider b { font-size: 16px; color: var(--ivory); }
.provider small { font-size: 13px; color: var(--dim); }
.provider input:checked + span { border-color: var(--brass); background: var(--brass-wash); }
.provider input:focus-visible + span { outline: 2px solid var(--brass); outline-offset: 2px; }
.codex { display: flex; flex-direction: column; gap: 14px; }
.codex-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.codex code { font-size: 13px; color: var(--brass-hi); }
.inline-pair { display: flex; gap: 8px; }
.inline-pair input { flex: 1; min-width: 0; }
.modelpick { display: flex; gap: 8px; }
.modelpick select, .modelpick input { flex: 1; min-width: 0; }
.about { border-top: 1px solid var(--line); padding-top: 12px; }
.about summary {
  list-style: none; min-height: 44px; display: flex; align-items: center; justify-content: space-between;
  gap: 12px; cursor: pointer; color: var(--brass); font-size: 15px;
}
.about summary::-webkit-details-marker { display: none; }
.about[open] .chev { transform: rotate(180deg); }
.about .chev { transition: transform .2s; }
.about p { margin-top: 10px; font-size: 14px; line-height: 1.65; color: var(--mist); }
.about b { color: var(--ivory); font-weight: 600; }
.dialog-foot {
  margin-top: auto; padding-top: 16px; border-top: 1px solid rgba(243,236,223,.08);
  display: flex; flex-direction: column-reverse; align-items: stretch; gap: 8px;
}
@media (min-width: 700px) {
  .setup { display: grid; justify-items: center; padding: calc(var(--top) + 40px) 24px 60px; }
  .dialog {
    width: min(660px, 100%); min-height: 0; padding: 34px 40px 28px; border-radius: 32px;
    border-bottom: 1px solid var(--line-2); box-shadow: 0 40px 120px rgba(0,0,0,.6);
  }
  .dialog-head h2 { font-size: 30px; }
  .dialog-foot { flex-direction: row; align-items: center; justify-content: space-between; }
}

/* ============================ Birth ============================ */
.birth { min-height: 100svh; padding: calc(var(--top) + env(safe-area-inset-top) + 16px) var(--gutter) calc(48px + env(safe-area-inset-bottom)); }
.birth::before {
  content: ''; position: absolute; inset: 0 0 auto 0; height: 440px; z-index: -1;
  background:
    linear-gradient(180deg, rgba(7,8,14,.25) 0%, rgba(7,8,14,.55) 45%, var(--ink) 100%),
    var(--ink) url(/static/img/sky-tall-1080.webp) 50% 12% / cover no-repeat;
}
.birth-wrap { max-width: 560px; margin: 0 auto; display: flex; flex-direction: column; gap: 18px; }
.back {
  align-self: flex-start; min-height: 44px; padding: 0 16px 0 10px; border-radius: 999px;
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(7,8,14,.45); border: 1px solid var(--line-2); color: var(--ivory); font-size: 15px;
}
.back:hover { border-color: var(--brass); }
.birth-head { display: flex; flex-direction: column; gap: 8px; }
.birth h1 { font-size: 34px; }
.birth .sub { font-size: 16px; color: var(--mist); }
.form-card {
  padding: 20px; border-radius: 26px;
  background: rgba(13,16,25,.84); border: 1px solid var(--line);
  -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
  display: flex; flex-direction: column; gap: 20px;
}
.people { display: grid; gap: 18px; }
.person { margin: 0; padding: 0; border: 0; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.person + .person { padding-top: 18px; border-top: 1px solid var(--line); }
.person-label { padding: 0; margin-bottom: 4px; font-family: var(--serif); font-size: 19px; font-weight: 700; color: var(--ivory); display: flex; align-items: baseline; gap: 10px; }
.person-label .en { font-size: 16px; color: var(--dim); }
.form-foot { display: flex; flex-direction: column; align-items: stretch; gap: 10px; text-align: center; }
@media (min-width: 1000px) {
  .birth { padding-top: calc(var(--top) + 56px); padding-left: 120px; padding-right: 120px; }
  .birth::before {
    position: fixed; inset: 0; height: auto;
    background:
      linear-gradient(90deg, rgba(7,8,14,.88) 0%, rgba(7,8,14,.72) 38%, rgba(7,8,14,.12) 64%, rgba(7,8,14,0) 100%),
      var(--ink) url(/static/img/sky-1920.webp) 60% 50% / cover no-repeat;
  }
  .birth-wrap { margin: 0; gap: 22px; }
  .birth-wrap.pair { max-width: 1000px; }
  .birth h1 { font-size: 54px; line-height: 1.25; }
  .birth .sub { font-size: 18px; }
  .modeseg { max-width: 460px; }
  .form-card { padding: 28px; border-radius: 28px; }
  .pair .people { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px; }
  .pair .person + .person { padding-top: 0; border-top: 0; }
  .form-foot { flex-direction: row; align-items: center; text-align: left; gap: 18px; }
}

/* ============================ Result ============================ */
.result { padding-top: calc(var(--top) + env(safe-area-inset-top)); padding-bottom: calc(200px + env(safe-area-inset-bottom)); }
.res-banner { position: relative; padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 12px; }
.res-banner::before {
  content: ''; position: absolute; inset: calc(-1 * var(--top)) 0 0 0; z-index: -1;
  background:
    linear-gradient(180deg, rgba(7,8,14,.25) 0%, rgba(7,8,14,.55) 60%, var(--ink) 100%),
    var(--ink) url(/static/img/sky-tall-1080.webp) 50% 6% / cover no-repeat;
}
.b-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.b-one { display: flex; align-items: center; gap: 14px; }
.b-copy { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.b-copy h1 { font-size: 38px; line-height: 1.25; }
.b-rasi { font-size: 21px; font-weight: 600; color: var(--soft); }
.b-line { font-size: 14px; color: var(--mist); }
.b-lord { margin: 0; flex-shrink: 0; align-self: flex-start; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.b-lord figcaption { font-size: 12px; color: var(--mist); white-space: nowrap; }
.b-lord figcaption:empty { display: none; }
.b-moon { width: 84px; height: 84px; object-fit: contain; }
.b-facts { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.b-facts:empty { display: none; }
.b-facts li {
  min-height: 34px; padding: 4px 12px; border-radius: 999px; display: inline-flex; align-items: center;
  font-size: 13px; border: 1px solid var(--line-2); color: var(--ivory);
}
.b-facts li.now { background: rgba(230,190,106,.14); border-color: var(--brass-line); }
.b-pair { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 6px; padding-top: 4px; }
.who { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; min-width: 0; }
.who img { width: 64px; height: 64px; margin-bottom: 2px; object-fit: contain; }
.who .role { font-size: 12px; color: var(--dim); }
.who b { font-family: var(--serif); font-size: 18px; line-height: 1.3; }
.who .rp { font-size: 13px; color: var(--mist); }
.who .lord { font-size: 12px; color: var(--dim); }
.who .lord:empty { display: none; }
.ring { position: relative; width: 118px; height: 118px; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring .track { fill: none; stroke: rgba(243,236,223,.12); stroke-width: 6; }
.ring .arc { fill: none; stroke: var(--brass); stroke-width: 6; stroke-linecap: round; transition: stroke-dasharray 1s var(--ease); }
.ring-num { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
#pScore { font-family: var(--latin); font-size: 44px; line-height: 1; }
#pScore small { font-size: 24px; color: var(--dim); }
.ring .of { font-size: 12px; color: var(--mist); }
@media (min-width: 1000px) {
  .res-banner { padding: 34px 56px 30px; gap: 16px; }
  .res-banner::before { background: linear-gradient(180deg, rgba(7,8,14,.2) 0%, rgba(7,8,14,.55) 62%, var(--ink) 100%), var(--ink) url(/static/img/sky-1920.webp) 60% 22% / cover no-repeat; }
  .b-one { gap: 28px; }
  .b-lord { order: -1; align-self: center; }
  .b-lord figcaption { font-size: 13px; }
  .b-moon { width: 132px; height: 132px; }
  .b-copy h1 { font-size: 58px; line-height: 1.2; }
  .b-rasi { font-size: 30px; }
  .b-line { font-size: 16px; }
  .b-facts li { min-height: 36px; font-size: 14px; }
  .b-pair { max-width: 820px; margin: 0 auto; width: 100%; gap: 24px; }
  .who img { width: 92px; height: 92px; }
  .who b { font-size: 28px; }
  .who .rp { font-size: 15px; }
  .who .role { font-size: 13px; }
  .ring { width: 200px; height: 200px; }
  .ring .track, .ring .arc { stroke-width: 5; }
  #pScore { font-size: 76px; }
  #pScore small { font-size: 36px; }
  .ring .of { font-size: 14px; }
}

.res-body { padding: 8px var(--gutter) 0; display: flex; flex-direction: column; gap: 28px; }
.res-chart { display: flex; flex-direction: column; gap: 22px; min-width: 0; }
.panel { min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.panel h2 { font-size: 22px; }
.card { padding: 18px; border-radius: 22px; background: var(--ink-2); border: 1px solid var(--line); min-width: 0; }
.card h3 { margin-bottom: 10px; font-size: 18px; }
.tabs { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 calc(-1 * var(--gutter)); padding: 0 var(--gutter); }
.tabs::-webkit-scrollbar { display: none; }
.tabs button {
  flex-shrink: 0; min-height: 44px; padding: 0 18px; border-radius: 999px;
  border: 1px solid var(--line-2); background: transparent; color: var(--ivory); font-size: 15px;
  transition: background .2s, color .2s, border-color .2s;
}
.tabs button[aria-pressed="true"] { background: var(--ivory); border-color: var(--ivory); color: var(--ink); font-weight: 600; }
.cards {
  display: flex; gap: 12px; align-items: flex-start;
  overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; scroll-padding: 0 var(--gutter);
  margin: 0 calc(-1 * var(--gutter)); padding: 0 var(--gutter) 4px;
  overscroll-behavior-x: contain; scrollbar-width: none;
}
.cards::-webkit-scrollbar { display: none; }
.cards > .card { flex: 0 0 min(100%, 480px); scroll-snap-align: start; }
.card.kattam-card { padding: 0; overflow: hidden; border-color: rgba(230,190,106,.30); }
.kattam-card .sub { padding: 10px 14px 12px; font-size: 13px; color: var(--dim); border-top: 1px solid var(--line); }
@media (min-width: 1000px) {
  .res-body { padding: 16px 56px 56px; display: grid; grid-template-columns: minmax(0, 520px) minmax(0, 1fr); gap: 40px; align-items: start; }
  .tabs { display: none; }
  .cards { flex-direction: column; align-items: stretch; overflow: visible; margin: 0; padding: 0; gap: 20px; }
  .cards > .card { flex: none; }
  .card { padding: 22px; border-radius: 24px; }
}

/* ---------- South Indian ராசி கட்டம் ---------- */
/* Hairlines from the gap: the grid's own background shows between cells. */
.kattam {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-template-rows: repeat(4, minmax(0, 1fr));
  gap: 1px; aspect-ratio: 1; width: 100%; background: rgba(243,236,223,.10);
}
.cell { min-width: 0; min-height: 0; padding: 8px; background: var(--ink-2); display: flex; flex-direction: column; gap: 4px; overflow: hidden; }
.cell .rasi { font-size: 11px; line-height: 1.3; color: var(--dim); }
.cell .body { display: flex; flex-wrap: wrap; gap: 2px 7px; }
.cell .g { font-size: 16px; font-weight: 600; line-height: 1.3; }
.cell.lagna { background: #221F1B; box-shadow: inset 0 0 0 1.5px rgba(230,190,106,.65); }
.cell.lagna .rasi { color: var(--brass); }
.kattam .centre {
  grid-column: 2 / 4; grid-row: 2 / 4; background: var(--ink-2);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; text-align: center;
}
.centre img { width: 26%; opacity: .55; margin-bottom: 6px; }
.centre b { font-family: var(--serif); font-size: 20px; font-weight: 700; line-height: 1.3; }
.centre span { font-size: 13px; color: var(--mist); }
.centre .dasa { color: var(--brass); }
@media (min-width: 1000px) {
  .cell { padding: 12px; gap: 6px; }
  .cell .rasi { font-size: 12px; }
  .cell .g { font-size: 19px; }
  .centre b { font-size: 26px; }
  .centre span { font-size: 15px; }
}

/* ---------- Dasa ---------- */
.dasa-card { padding-top: 16px; }
.dasa-head { display: flex; flex-direction: column; gap: 10px; padding-bottom: 12px; border-bottom: 1px solid rgba(243,236,223,.08); background: var(--ink-2); }
.dasa-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 36px; }
.dasa-top h3 { margin: 0; }
.dasa-today {
  min-height: 36px; padding: 0 14px; border-radius: 999px; display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--brass-line); background: rgba(230,190,106,.10); color: var(--brass); font-size: 13px; font-weight: 600;
}
.dasa-today svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.dasa-bar { position: relative; display: flex; gap: 3px; height: 44px; }
.dasa-bar button {
  flex-basis: 0; min-width: 8px; height: 44px; padding: 0; border: 0; border-radius: 5px;
  display: flex; align-items: center; justify-content: center; overflow: hidden; white-space: nowrap;
  color: var(--ivory); font-size: 11px; font-weight: 700; transition: box-shadow .2s var(--ease);
}
.dasa-bar button:first-child { border-radius: 10px 5px 5px 10px; }
.dasa-bar button:nth-last-child(2) { border-radius: 5px 10px 10px 5px; }
.dasa-bar button.past { color: var(--dim); }
.dasa-bar button.now { color: var(--ink); }
.dasa-bar button.bare span { visibility: hidden; }
.dasa-bar button[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--ink-2), 0 0 0 4px var(--ivory); }
.dasa-bar .mark { position: absolute; top: -5px; width: 2px; height: 54px; margin-left: -1px; border-radius: 2px; background: var(--ivory); pointer-events: none; }
.dasa-years { position: relative; height: 16px; font-size: 12px; color: var(--dim); font-variant-numeric: tabular-nums; }
.dasa-years span { position: absolute; top: 0; }
.dasa-years span:first-child { left: 0; }
.dasa-years span:last-child { right: 0; }
.dasa-years .today { transform: translateX(-50%); color: var(--ivory); }

.dasa-list { display: flex; flex-direction: column; gap: 4px; margin: 8px -10px 0; }
.dasa { border-radius: 16px; border: 1px solid transparent; scroll-margin-top: calc(var(--top) + 12px); }
.dasa.open { background: rgba(243,236,223,.035); border-color: var(--line); }
.dasa.now.open { border-color: var(--brass-line); }
.dasa-row {
  width: 100%; min-height: 52px; padding: 0 12px; border: 0; border-radius: 16px; background: transparent;
  display: flex; align-items: center; gap: 10px; text-align: left; color: var(--text); font-size: 16px;
}
.dasa.past .dasa-row { color: var(--faint); }
.dasa.open .dasa-row, .dasa.now .dasa-row { font-weight: 700; }
.dasa-row .dot, .bh-list .dot { flex-shrink: 0; border-radius: 999px; }
.dasa-row .dot { width: 10px; height: 10px; }
.dasa-row em {
  padding: 2px 8px; border-radius: 999px; font-style: normal; font-size: 12px; font-weight: 600;
  background: var(--brass); color: var(--ink);
}
.dasa-row .yr { margin-left: auto; font-size: 15px; font-weight: 500; font-variant-numeric: tabular-nums; }
.dasa-row .chev { width: 18px; height: 18px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 2; opacity: .7; transition: transform .25s var(--ease); }
.dasa.open .dasa-row .chev { transform: rotate(180deg); }

.dasa-panel { padding: 0 12px 14px; display: flex; flex-direction: column; gap: 12px; }
.dasa-panel[hidden] { display: none; }
.dasa-meta { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; color: var(--mist); font-variant-numeric: tabular-nums; }
.dasa-panel .bar { height: 6px; border-radius: 999px; background: rgba(243,236,223,.12); overflow: hidden; }
.dasa-panel .bar i { display: block; height: 100%; border-radius: 999px; background: var(--brass); }
.dasa-panel .left { margin-top: -6px; font-size: 13px; color: var(--mist); }
.dasa-note {
  margin: 0; padding: 10px 12px; border-radius: 12px; border: 1px dashed rgba(243,236,223,.22);
  background: rgba(243,236,223,.04); font-size: 13px; line-height: 1.55; color: var(--mist);
}
.bh-strip { position: relative; display: flex; gap: 2px; height: 10px; }
.bh-strip i { flex-basis: 0; min-width: 3px; border-radius: 3px; }
.bh-strip .mark { position: absolute; top: -4px; width: 2px; height: 18px; margin-left: -1px; border-radius: 2px; background: var(--ivory); }

.bh-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.bh-list li {
  min-height: 50px; padding: 6px 10px; border-radius: 12px; border: 1px solid transparent;
  display: flex; flex-wrap: wrap; align-items: center; column-gap: 10px; row-gap: 6px; color: var(--text);
}
.bh-list li.past { color: var(--faint); }
.bh-list li.now { background: var(--brass-wash); border-color: var(--brass-line); }
.bh-list .dot { width: 8px; height: 8px; }
.bh-list .nm { display: flex; flex-direction: column; min-width: 0; font-size: 15px; }
.bh-list li.now .nm { font-weight: 700; }
.bh-list small { font-size: 12px; color: var(--dim); }
.bh-list li.past small { color: var(--faint); }
.bh-list .dt { margin-left: auto; font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.bh-now { flex-basis: 100%; display: flex; flex-direction: column; gap: 6px; padding: 2px 0 2px 18px; font-size: 12px; color: var(--mist); }
.bh-now .bar { height: 5px; }

/* Stacked on a wide screen, the window scrolls the card, so the bar can stay
 * in reach while the list moves under it. (In a phone's swipe row the row
 * itself is the scroller, and nothing can stick to the page from inside it.) */
@media (min-width: 1000px) {
  .dasa-head { position: sticky; top: var(--top); z-index: 2; margin: -22px -22px 0; padding: 22px 22px 12px; border-radius: 24px 24px 0 0; }
  .dasa { scroll-margin-top: calc(var(--top) + var(--dasa-head, 150px) + 8px); }
  .dasa-list { margin: 8px -12px 0; }
}

/* ---------- Planet states ---------- */
.facts { display: flex; flex-wrap: wrap; gap: 6px; }
.facts:empty { display: none; }
.fact {
  min-height: 30px; padding: 4px 11px; border-radius: 999px; display: inline-flex; align-items: center;
  font-size: 13px; line-height: 1.35; border: 1px solid var(--line-2); color: var(--ivory);
}
.fact.warn { border-color: var(--brass-line); color: var(--brass-hi); }
.gtable { width: 100%; margin-top: 12px; border-collapse: collapse; font-size: 14px; line-height: 1.4; }
.gtable th, .gtable td { padding: 8px 8px 8px 0; text-align: left; vertical-align: top; }
.gtable th:last-child, .gtable td:last-child { padding-right: 0; }
.gtable thead th { padding-top: 0; font-size: 12px; font-weight: 500; color: var(--dim); border-bottom: 1px solid var(--line); }
.gtable tbody tr + tr > * { border-top: 1px solid rgba(243,236,223,.06); }
.gtable .gn { font-weight: 600; white-space: nowrap; }
.gtable .gs { color: var(--mist); }
.gtable .gl { font-weight: 600; white-space: nowrap; }
.gtable .nl { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }
/* Each state has its own words and its own fill, so it reads without colour. */
.tag { padding: 1px 8px; border-radius: 999px; font-size: 12px; line-height: 20px; font-weight: 600; border: 1px solid transparent; white-space: nowrap; }
.tag.ucham, .tag.aatchi { background: rgba(124,199,214,.16); color: var(--good); }
.tag.natpu { border-color: rgba(124,199,214,.40); color: var(--good); }
.tag.pagai { border-color: rgba(233,131,92,.45); color: var(--bad); }
.tag.neecham { background: rgba(233,131,92,.16); color: var(--bad); }
.tag.vakram { border-color: var(--brass-line); color: var(--brass); }
@media (max-width: 420px) { .gtable { font-size: 13.5px; } .gtable th, .gtable td { padding-right: 6px; } }

/* ---------- Bride / groom charts ---------- */
.pair-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.dots { min-width: 240px; }
.slider { overflow: hidden; }
.slides { display: flex; transition: transform .45s var(--ease); }
.slide { flex: 0 0 100%; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.slide .kattam-card, .slide .graha-state { max-width: 480px; }

/* ---------- Porutham ---------- */
.plist { display: flex; flex-direction: column; }
.prow { border-bottom: 1px solid rgba(243,236,223,.08); }
.prow summary { list-style: none; min-height: 60px; display: flex; align-items: center; gap: 12px; cursor: pointer; }
.prow summary::-webkit-details-marker { display: none; }
.p-ico { width: 34px; height: 34px; flex-shrink: 0; border-radius: 50%; display: grid; place-items: center; }
.p-ico svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.p-name { flex: 1; min-width: 0; font-size: 16px; font-weight: 600; }
.p-grade { font-size: 13px; font-weight: 600; text-align: right; }
.prow .chev { width: 16px; height: 16px; color: var(--dim); transition: transform .2s; }
.prow[open] .chev { transform: rotate(180deg); }
/* What the porutham gives, in காலப்ரகாசிகை's word, then why it holds or not. */
.p-mean {
  margin: 0 0 10px 46px; padding: 10px 12px; border-radius: 12px; background: rgba(243,236,223,.04);
  border: 1px solid var(--line); font-size: 15px; line-height: 1.55; color: var(--text);
}
.p-mean .k { display: block; margin-bottom: 2px; font-size: 12px; letter-spacing: .03em; color: var(--brass); }
.p-mean b { font-weight: 700; color: var(--ivory); }
.p-mean cite { display: block; margin-top: 4px; font-size: 12px; font-style: normal; color: var(--dim); }
/* The modern books' reading, kept apart and quieter than the classic's. */
.p-modern { margin: 0 0 10px 46px; padding: 0 12px; font-size: 14px; line-height: 1.55; color: var(--mist); }
.p-modern .k { display: block; margin-bottom: 4px; font-size: 12px; letter-spacing: .03em; color: var(--dim); }
.p-modern ul { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; }
.p-modern cite { display: block; font-size: 12px; font-style: normal; color: var(--faint); }
.p-why { margin: 0 0 14px 46px; font-size: 14px; line-height: 1.6; color: var(--mist); }
.prow.good .p-ico { background: rgba(124,199,214,.14); color: var(--good); }
.prow.good .p-grade { color: var(--good); }
.prow.mid .p-ico { background: rgba(230,190,106,.14); color: var(--mid); }
.prow.mid .p-grade { color: var(--mid); }
.prow.bad .p-ico { background: rgba(233,131,92,.14); color: var(--bad); }
.prow.bad .p-grade { color: var(--bad); }
.cancel-note {
  padding: 14px 16px; border-radius: 18px; font-size: 15px; line-height: 1.55;
  background: rgba(230,190,106,.08); border: 1px solid rgba(230,190,106,.30);
}
.cancel-note:empty { display: none; }

/* Book findings: a pair the books leave out, and their notes. */
.findings { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.findings:empty { display: none; }
.find { border-radius: 14px; border: 1px solid var(--line); background: var(--ink-2); }
.find > summary { min-height: 44px; padding: 10px 14px; display: flex; align-items: center;
  gap: 8px; cursor: pointer; font-size: 14px; line-height: 1.5; list-style: none; }
.find > summary::-webkit-details-marker { display: none; }
.find.out { border-color: rgba(233,131,92,.45); }
.find.out > summary { color: var(--bad); font-weight: 600; }
.find.good > summary { color: var(--good); }
.find.warn > summary { color: var(--mid); }
.find .pd { color: var(--dim); font-weight: 400; }
.find blockquote { margin: 0; padding: 0 14px 12px; font-size: 13.5px; line-height: 1.6;
  color: var(--soft); }
.find cite { display: block; margin-top: 4px; font-style: normal; font-size: 12px; color: var(--dim); }
.pair-facts:empty { display: none; }
.porutham.analysis {
  width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px;
  border-radius: 20px; overflow: hidden; background: var(--ink-2); border: 1px solid var(--line);
}
.porutham.analysis th, .porutham.analysis td { padding: 10px 14px; text-align: left; vertical-align: top; }
.porutham.analysis th { font-size: 13px; font-weight: 600; color: var(--dim); border-bottom: 1px solid var(--line); }
.porutham.analysis th:first-child { font-family: var(--serif); font-size: 15px; color: var(--ivory); }
.porutham.analysis td:first-child { color: var(--dim); }
.porutham.analysis small { color: var(--dim); font-size: 12px; }
.deepMatch {
  position: relative; overflow: hidden; padding: 20px; border-radius: 22px;
  background: var(--ink-2); border: 1px solid rgba(230,190,106,.30);
  display: flex; flex-direction: column; gap: 14px;
}
.deep-kolam { position: absolute; right: -44px; top: -44px; width: 170px; opacity: .15; pointer-events: none; }
.deepMatch .note { position: relative; font-size: 14px; color: var(--mist); }
.deepWho { position: relative; display: flex; gap: 10px; }
.deepWho label {
  flex: 1 1 0; min-height: 48px; padding: 0 14px; border-radius: 14px;
  display: flex; align-items: center; gap: 10px; cursor: pointer;
  border: 1px solid var(--line-2); font-size: 15px; color: var(--ivory);
}
.deepWho input { width: 18px; height: 18px; margin: 0; accent-color: var(--brass); }
#btnDeep { position: relative; }
@media (min-width: 1000px) {
  .p-why, .p-mean, .p-modern { margin-left: 46px; }
}

/* ============================ Chat ============================ */
.res-chat { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.chat-head { display: flex; flex-direction: column; gap: 4px; }
.chat-head h2 { font-size: 24px; }
.chat-head .sub { font-size: 14px; color: var(--dim); }
.chat { display: flex; flex-direction: column; gap: 20px; }
.chat:empty { display: none; }
.msg { font-size: 16px; line-height: 1.75; overflow-wrap: anywhere; }
.msg.user {
  align-self: flex-end; max-width: 88%; padding: 12px 16px; border-radius: 20px 20px 6px 20px;
  background: var(--ink-4); border: 1px solid rgba(243,236,223,.10); line-height: 1.55;
}
.msg.bot { align-self: stretch; color: var(--text); }
/* The wheel beside each answer: still once written, its ring turning while
 * this answer is being written (app.js sets .writing). */
.chat .msg.bot::before {
  content: ''; display: block; width: 32px; height: 32px; margin-bottom: 10px;
  background: url("/static/img/logo-still.svg") center / contain no-repeat;
}
.chat .msg.bot.writing::before { background-image: url("/static/img/logo.svg"); }
.msg.bot h2, .msg.bot h3 { margin: 16px 0 6px; font-size: 18px; color: var(--brass); }
.msg.bot > h2:first-child, .msg.bot > h3:first-child { margin-top: 0; }
.msg.bot strong { color: var(--ivory); font-weight: 600; }
.msg.bot p { margin: 0 0 8px; }
.msg.bot p:last-child { margin-bottom: 0; }
.msg.bot .li { margin: 0 0 6px; padding-left: 4px; }
.msg.bot .li.sub { padding-left: 22px; }
.msg.bot .gap { height: 8px; }
.msg.bot h4 { margin: 12px 0 4px; font-size: 16px; font-weight: 600; color: var(--ivory); }
.msg.bot em { color: var(--soft); }
/* A rule quoted from its book: the reading shapes give each its own block,
 * the source in bold ahead of the words. */
.msg.bot blockquote {
  margin: 10px 0; padding: 10px 14px; border-left: 3px solid var(--brass-line);
  border-radius: 0 12px 12px 0; background: var(--brass-wash); color: var(--ivory);
}
.msg.bot blockquote > :last-child { margin-bottom: 0; }
/* The --- between a reading's sections. */
.msg.bot hr { margin: 16px 0; border: 0; border-top: 1px solid var(--line); }
.msg.bot code { font-size: .92em; color: var(--brass-hi); }
.cref {
  display: inline-block; padding: 0 7px; border-radius: 999px; vertical-align: 1px;
  background: rgba(230,190,106,.14); color: var(--brass); font-size: 12.5px; line-height: 21px; font-weight: 600;
}
.cites {
  margin-top: 14px; padding-top: 12px; border-top: 1px dashed rgba(243,236,223,.16);
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
}
.cites-label { margin-right: 2px; font-size: 13px; color: var(--dim); }
/* Text, not a flex row: a long title or search note wraps as a sentence
 * instead of splitting the number and the words into columns. */
.cite {
  display: inline-block; max-width: 100%; padding: 5px 12px; border-radius: 14px;
  border: 1px solid var(--line); font-size: 13px; line-height: 1.5; color: var(--soft);
}
.cite b { margin-right: 6px; color: var(--brass); font-weight: 600; }
.cite .more, .cite .tr { color: var(--dim); }
.cite .tr { font-style: italic; }
.msg .stopped { margin-top: 8px; font-size: 13px; font-style: italic; color: var(--dim); }

/* Tables inside an answer. The Do's and Don'ts table is part of every
 * reading, so it has to render as a table rather than as a row of pipes. */
.msg.bot table.md {
  width: 100%; margin: 10px 0; border-collapse: collapse; font-size: 14px;
  display: block; overflow-x: auto;
}
.msg.bot table.md th {
  padding: 8px 10px; text-align: left; font-size: 12.5px; font-weight: 600; white-space: nowrap;
  color: var(--brass); border-bottom: 1px solid var(--line-2);
}
.msg.bot table.md td { padding: 9px 10px; vertical-align: top; border-bottom: 1px solid rgba(243,236,223,.08); }
.msg.bot table.md tr:last-child td { border-bottom: 0; }

/* ---------- The sources, folded ---------- */
details.sources { margin-top: 14px; border-top: 1px dashed rgba(243,236,223,.16); }
details.sources summary {
  list-style: none; min-height: 48px; padding-top: 4px; display: flex; align-items: center; gap: 10px; cursor: pointer;
}
details.sources summary::-webkit-details-marker { display: none; }
.cites-count { font-size: 13px; color: var(--soft); }
details.sources .chev { width: 16px; height: 16px; margin-left: auto; flex-shrink: 0; fill: none; stroke: var(--dim); stroke-width: 2; transition: transform .2s; }
details.sources[open] .chev { transform: rotate(180deg); }
.cite-list { display: flex; flex-wrap: wrap; gap: 8px; padding: 2px 0 6px; }
.cite.flash { animation: flash 1.6s var(--ease); }
@keyframes flash { 0%, 40% { border-color: var(--brass); background: var(--brass-wash); } 100% { border-color: var(--line); background: transparent; } }
button.cref { border: 0; font-family: inherit; cursor: pointer; }

/* ---------- While the answer is written ---------- */
.wait {
  display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 16px; align-items: center;
  padding: 16px; border-radius: 20px; background: rgba(243,236,223,.035); border: 1px solid var(--line);
}
.wait-art svg { display: block; width: 96px; height: 96px; }
/* The kolam is one line: it is drawn round the pulli, held, then lifted. */
.wait-art path { stroke-dasharray: 1; stroke-dashoffset: 1; animation: kolam 9s ease-in-out infinite; }
@keyframes kolam { 0% { stroke-dashoffset: 1; } 62%, 80% { stroke-dashoffset: 0; } 100% { stroke-dashoffset: -1; } }
@media (prefers-reduced-motion: reduce) { .wait-art path { animation: none; stroke-dashoffset: 0; } }
.wait-side { min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.wait-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--faint); }
.wait-steps li { display: flex; align-items: center; gap: 8px; }
.wait-steps li::before { content: ''; width: 8px; height: 8px; flex-shrink: 0; border-radius: 50%; border: 1.5px solid currentColor; }
.wait-steps li.done { color: var(--mist); }
.wait-steps li.done::before { background: var(--good); border-color: var(--good); }
.wait-steps li.now { color: var(--ivory); font-weight: 600; }
.wait-steps li.now::before { background: var(--brass); border-color: var(--brass); animation: pulse 1.3s ease-in-out infinite; }
.wait-fact {
  min-height: 56px; padding: 8px 12px; border-radius: 14px; background: var(--ink-3);
  display: flex; align-items: center; gap: 10px; opacity: 0;
}
.wait-fact.in { animation: rise .6s var(--ease) forwards; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .wait-fact, .wait-fact.in { opacity: 1; animation: none; } }
.wait-fact img { width: 40px; height: 40px; flex-shrink: 0; object-fit: contain; }
.wait-fact > span { display: flex; flex-direction: column; min-width: 0; }
.wait-fact .k { font-size: 12px; color: var(--brass); }
.wait-fact .v { font-size: 15px; line-height: 1.45; color: var(--ivory); }
.wait-time { font-size: 12px; color: var(--faint); font-variant-numeric: tabular-nums; }
.msg.bot { scroll-margin-top: calc(var(--top) + 12px); }
@keyframes pulse { 0%, 100% { opacity: .25; transform: scale(.8); } 50% { opacity: 1; transform: scale(1); } }
@media (min-width: 1000px) {
  .wait { grid-template-columns: 120px minmax(0, 1fr); gap: 22px; padding: 20px 22px; }
  .wait-art svg { width: 120px; height: 120px; }
}

/* ---------- The composer dock ---------- */
.dock {
  position: fixed; inset: auto 0 0 0; z-index: 40;
  padding: 10px 16px calc(12px + env(safe-area-inset-bottom));
  background: rgba(10,12,20,.94); border-top: 1px solid rgba(243,236,223,.08);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  display: flex; flex-direction: column; gap: 10px;
}
.dock-row { display: flex; gap: 8px; }
.audience { flex: 1; min-width: 0; padding: 3px; }
.audience .aud { padding: 4px 8px; font-size: 14px; }
.aud span { display: none; font-size: 11.5px; font-weight: 400; opacity: .85; }
#lang {
  width: auto; flex-shrink: 0; max-width: 132px; min-height: 44px; padding: 0 34px 0 16px;
  border-radius: 999px; font-size: 14px; background-color: rgba(243,236,223,.05); border-color: var(--line-2);
  background-position: right 13px center;
}
/* Grows with the question. A one-line input made anything longer than a
 * sentence invisible as it was typed, which is the opposite of frictionless. */
.composer {
  display: flex; align-items: flex-end; gap: 8px; padding: 5px 5px 5px 18px; border-radius: 28px;
  background: var(--ink-3); border: 1px solid var(--line-2); transition: border-color .18s, box-shadow .18s;
}
.composer:focus-within { border-color: var(--brass); box-shadow: 0 0 0 4px rgba(230,190,106,.14); }
.composer textarea {
  flex: 1; min-height: 44px; max-height: 220px; padding: 10px 0; border: 0; border-radius: 0;
  background: transparent; resize: none; overflow-y: auto; font-size: 16px; line-height: 24px;
}
.composer textarea:focus { box-shadow: none; }
#btnAsk {
  width: 44px; height: 44px; flex-shrink: 0; padding: 0; border: 0; border-radius: 50%;
  display: inline-grid; place-items: center; background: var(--brass); color: var(--ink);
  transition: background .2s, transform .2s;
}
#btnAsk:hover { background: var(--brass-hi); }
#btnAsk svg { width: 20px; height: 20px; stroke-width: 2.3; grid-area: 1 / 1; }
#btnAsk .i-stop { display: none; fill: currentColor; stroke: none; }
#btnAsk .label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
/* The same button stops the answer it started. */
#btnAsk.stop { background: var(--bad); }
#btnAsk.stop .i-ask { display: none; }
#btnAsk.stop .i-stop { display: block; }

@media (min-width: 1000px) {
  .result { padding-bottom: 0; }
  .res-chat {
    position: sticky; top: calc(var(--top) + 16px); height: calc(100vh - var(--top) - 32px);
    gap: 0; border-radius: 26px; overflow: hidden; background: #0B0D16; border: 1px solid var(--line);
  }
  .chat-head {
    flex-direction: row; align-items: baseline; justify-content: space-between; gap: 16px;
    padding: 20px 28px 14px; border-bottom: 1px solid rgba(243,236,223,.08);
  }
  .chat, .chat:empty { display: flex; flex: 1; min-height: 0; overflow-y: auto; padding: 22px 28px 14px; }
  /* Before the first question the panel holds a quiet kolam, not a void. */
  .chat:empty::before {
    content: ''; margin: auto; width: 180px; height: 180px; opacity: .10;
    background: url(/static/img/kolam-7.svg) center / contain no-repeat;
  }
  .res-chat .chips { padding: 0 28px 14px; }
  .dock { position: static; padding: 14px 20px 18px; background: var(--deep); -webkit-backdrop-filter: none; backdrop-filter: none; }
  .audience { padding: 4px; }
  .aud span { display: block; }
  #lang { max-width: 180px; min-height: 52px; }
  #btnAsk { width: auto; height: 44px; padding: 0 22px; border-radius: 999px; font-size: 16px; font-weight: 600; }
  #btnAsk svg { display: none !important; }
  #btnAsk .label { position: static; width: auto; height: auto; overflow: visible; clip-path: none; }
}

/* ---------- நட்சத்திரப் பொருத்தம் ---------- */
.kindseg { margin-top: 10px; }
.star-pick { display: flex; flex-direction: column; gap: 22px; }
.star-pick .flabel { display: block; margin-bottom: 8px; }
.rasi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-template-rows: repeat(4, minmax(88px, auto)); gap: 4px; }
.rasi-cell { display: flex; flex-direction: column; align-items: flex-start; gap: 4px;
  padding: 8px 7px; border-radius: 14px; background: var(--ink-2); border: 1px solid var(--line);
  color: var(--ivory); text-align: left; cursor: pointer; overflow: hidden; font: inherit; }
.rasi-cell b { max-width: 100%; font-size: 14px; font-weight: 600; line-height: 1.25; }
.rasi-cell span { font-size: 10.5px; line-height: 1.35; color: var(--dim); }
.rasi-cell[aria-pressed="true"] { background: var(--brass-wash); border: 1.5px solid var(--brass); }
.rasi-cell:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; }
.rasi-centre { grid-row: 2 / span 2; grid-column: 2 / span 2; border-radius: 14px;
  border: 1px dashed var(--brass-line); display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 4px; text-align: center; }
.rasi-centre b { font-family: var(--serif); font-size: 20px; color: var(--brass); }
.rasi-centre span { font-size: 12px; color: var(--dim); }
.chip[aria-pressed="true"] { background: var(--brass); border-color: var(--brass); color: var(--ink); }
.chip small { margin-left: 6px; font-size: 12px; opacity: .75; }
.year-ctl { display: flex; flex-direction: column; gap: 10px; }
.year-head { display: flex; align-items: baseline; justify-content: space-between; }
.year-head b { color: var(--brass); font-weight: 600; }
.year-chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.year-chips::-webkit-scrollbar { display: none; }
.ychip { min-width: 60px; justify-content: center; }
.sc-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.pc { min-height: 28px; padding: 0 10px; border-radius: 999px; display: inline-flex;
  align-items: center; font-size: 13px; font-weight: 600; }
.pc.ok { background: rgba(127,212,155,.14); color: var(--match); }
.pc.bad { background: rgba(233,131,92,.14); color: var(--bad); }
.pc.mid { background: rgba(230,190,106,.14); color: var(--mid); }
.dasa-grid { display: grid; grid-template-columns: 44px repeat(var(--cols), minmax(0, 1fr));
  column-gap: 8px; }
.dasa-grid .dh { padding: 6px 0; font-size: 12px; color: var(--dim); }
.dasa-grid .dp { padding-top: 8px; border-top: 1px solid var(--line);
  font-family: 'Instrument Serif', Georgia, serif; font-size: 20px; }
.dz { display: flex; flex-direction: column; gap: 1px; padding: 8px 0 6px;
  border-top: 1px solid var(--line); min-width: 0; }
.dz b { font-size: 14px; font-weight: 600; }
.dz span { font-size: 12px; color: var(--mist); }
.dz .alt { font-size: 11px; color: var(--mid); }

/* The star chart: a ராசிக் கட்டம் of the partner stars, each a button. */
.star-chart { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-template-rows: repeat(4, minmax(118px, auto)); gap: 4px; }
.st-cell { display: flex; flex-direction: column; gap: 1px; padding: 7px 6px; min-width: 0; overflow: hidden;
  border-radius: 14px; background: var(--ink-2); border: 1px solid var(--line); }
.st-rasi, .st-star { border: 0; background: none; font: inherit; text-align: left; cursor: pointer;
  max-width: 100%; padding: 0; }
.st-rasi { min-height: 26px; padding-bottom: 3px; font-size: 14px; font-weight: 700; line-height: 1.25; color: var(--ivory); }
.st-star { min-height: 24px; padding: 2px 0; font-size: 11.5px; font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
.st-star.good { color: var(--match); }
.st-star.mid { color: var(--mid); }
.st-star.out { color: var(--bad); text-decoration: line-through; text-decoration-thickness: 1px; }
.st-rasi:hover, .st-star:not(.out):hover { text-decoration: underline; }
.st-rasi:focus-visible, .st-star:focus-visible { outline: 2px solid var(--brass); outline-offset: 1px; border-radius: 4px; }
.st-centre { grid-row: 2 / span 2; grid-column: 2 / span 2; border-radius: 14px; border: 1px dashed var(--brass-line);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 10px; text-align: center; }
.st-centre span { font-size: 12.5px; color: var(--mist); }
.st-centre b { font-family: var(--serif); font-size: 19px; line-height: 1.25; color: var(--brass); }
.st-centre small { font-size: 12px; color: var(--dim); }
.st-legend { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: 12.5px; color: var(--mist); }
.st-legend li { display: inline-flex; align-items: center; gap: 6px; }
.st-legend .dot, .ss-tab .dot { width: 10px; height: 10px; border-radius: 999px; flex-shrink: 0; }
.dot.good, .good > .dot { background: var(--match); }
.dot.mid, .mid > .dot { background: var(--mid); }
.dot.out, .out > .dot { background: var(--bad); }

/* The star card: a graha card's frame (.gsheet, .gs-panel, .gs-x, .gs-steps). */
.ss-head { flex-shrink: 0; display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center;
  padding: calc(14px + env(safe-area-inset-top)) 64px 10px; border-bottom: 1px solid var(--line); }
.ss-head h2 { margin: 0; font-family: var(--serif); font-size: 20px; color: var(--brass); }
.ss-head span { font-size: 12.5px; color: var(--dim); }
.ss-tabs { flex-shrink: 0; display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 10px 14px;
  border-bottom: 1px solid var(--line); }
.ss-tabs::-webkit-scrollbar { display: none; }
.ss-tab { flex-shrink: 0; min-height: 44px; padding: 0 14px; border-radius: 999px; display: inline-flex; align-items: center;
  gap: 7px; font: inherit; font-size: 14.5px; font-weight: 600; white-space: nowrap; cursor: pointer;
  background: rgba(243,236,223,.04); color: var(--ivory); border: 1px solid var(--line-2); }
.ss-tab.out { color: var(--bad); }
/* Centred while they fit; auto margins, unlike justify-content, never push
 * the first tab off the left edge once the row has to scroll. */
.ss-tab:first-child { margin-left: auto; }
.ss-tab:last-child { margin-right: auto; }
.ss-tab small { font-size: 12px; font-weight: 400; opacity: .75; }
.ss-tab[aria-pressed="true"] { background: var(--ivory); color: var(--ink); border-color: var(--ivory); }
.ss-tab:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; }
.ss-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column;
  gap: 18px; padding: 16px 16px calc(96px + env(safe-area-inset-bottom)); }
.ss-main { display: flex; flex-direction: column; gap: 22px; }
.ring.good .arc { stroke: var(--match); }
.ring-num .score { font-family: var(--latin); font-size: 44px; line-height: 1; }
.ring-num .score small { font-size: 24px; color: var(--dim); }
.ss-disc { width: 118px; height: 118px; box-sizing: border-box; border-radius: 50%; border: 6px solid rgba(233,131,92,.55);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
.ss-disc b { font-size: 22px; color: var(--bad); }
.ss-disc span { font-size: 12px; color: var(--mist); }
.nw { white-space: nowrap; }
.ss-panel .gs-step span { white-space: nowrap; }
.ss-sec { display: flex; flex-direction: column; gap: 10px; }
.ss-sec h3 { margin: 0; font-family: var(--sans); font-size: 14px; font-weight: 600; color: var(--dim); }
.ss-sub { margin: 0; font-size: 13.5px; line-height: 1.6; color: var(--mist); }
.ss-why { padding: 14px 16px; border-radius: 16px; background: rgba(233,131,92,.08); border: 1px solid rgba(233,131,92,.45);
  display: flex; flex-direction: column; gap: 8px; }
.ss-why b { font-size: 16px; line-height: 1.45; color: var(--bad); }
.ss-why p { margin: 0; font-size: 14px; line-height: 1.6; color: var(--soft); }
.ss-cite { padding: 12px 14px; border-radius: 14px; background: rgba(243,236,223,.03); border: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 6px; }
.ss-cite b { font-size: 14.5px; font-weight: 600; line-height: 1.5; color: var(--mid); }
.ss-cite.good b { color: var(--good); }
.ss-cite .pd { font-weight: 400; color: var(--dim); }
.ss-cite p { margin: 0; font-size: 13.5px; line-height: 1.6; color: var(--soft); }
.ss-cite cite { font-style: normal; font-size: 12px; color: var(--dim); }
@media (min-width: 900px) {
  .ss-panel { width: min(880px, calc(100vw - 96px)); height: min(940px, calc(100dvh - 64px)); }
  .ss-head { padding-top: 18px; }
  .ss-body { padding: 20px 32px 96px; }
  .ss-panel .gs-steps { right: 0; width: auto; padding: 18px 28px 20px;
    background: linear-gradient(rgba(13,16,25,0), rgba(13,16,25,.96) 45%); }
}
@media (min-width: 1000px) {
  /* Six years need the room the two-birth form gets; the backdrop deepens so
   * the headings that run over the temple still read. */
  .stars-wrap { max-width: 1000px; margin: 0 auto; }
  .star-chart { grid-template-rows: repeat(4, minmax(150px, auto)); gap: 8px; }
  .st-cell { padding: 12px 14px; gap: 3px; }
  .st-rasi { font-size: 17px; }
  .st-star { min-height: 30px; font-size: 14.5px; }
  .st-centre b { font-size: 28px; }
  .st-centre span { font-size: 15px; }
  .ring-num .score { font-size: 76px; }
  .ring-num .score small { font-size: 36px; }
  .ss-disc { width: 200px; height: 200px; border-width: 5px; }
  .ss-disc b { font-size: 34px; }
  .birth.stars::before {
    background:
      linear-gradient(90deg, rgba(7,8,14,.6) 0%, rgba(7,8,14,.9) 25%, rgba(7,8,14,.9) 75%, rgba(7,8,14,.6) 100%),
      var(--ink) url(/static/img/sky-1920.webp) 60% 50% / cover no-repeat;
  }
}
