/* ───────────────────────────────────────────────────────────────────────────
   Graha Darpan — design tokens
   Midnight observatory: indigo ink ground, brass instrument lines,
   parchment text, one vermillion bindu. Marcellus display, Schibsted body,
   Spline Sans Mono for data, Tiro Devanagari for Sanskrit.
   ─────────────────────────────────────────────────────────────────────────── */
:root {
  --ink:        #0B1026;
  --ink-2:      #0E1430;
  --surface:    #131A38;
  --surface-2:  #1A2244;
  --line:       #232C54;
  --brass:      #E8B54D;
  --brass-dim:  #9D8045;
  --parchment:  #F4EDDF;
  --slate:      #8D96C0;
  --vermillion: #C2451E;
  --shadow:     0 18px 50px -18px rgba(2, 4, 18, 0.85);

  --font-display: "Marcellus", "Tiro Devanagari Sanskrit", serif;
  --font-dev:     "Tiro Devanagari Sanskrit", serif;
  --font-body:    "Schibsted Grotesk", system-ui, sans-serif;
  --font-mono:    "Spline Sans Mono", ui-monospace, monospace;

  --r-card: 14px;
  --pad-card: clamp(18px, 2.4vw, 28px);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
[hidden] { display: none !important; }

body {
  margin: 0;
  background:
    radial-gradient(1200px 700px at 80% -10%, #18204366 0%, transparent 60%),
    radial-gradient(900px 600px at -10% 30%, #141B3A66 0%, transparent 55%),
    var(--ink);
  color: var(--parchment);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  min-height: 100vh;
}

::selection { background: var(--brass); color: var(--ink); }

:focus-visible {
  outline: 2px solid var(--brass);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ── header / footer ── */
.site-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px clamp(20px, 4vw, 48px);
}
.head-left { display: flex; align-items: center; gap: clamp(14px, 2.4vw, 30px); flex-wrap: wrap; }
.head-nav { display: flex; align-items: center; gap: 8px; }
.brand { display: flex; align-items: baseline; gap: 10px; }
.brand-mark { width: 26px; height: 26px; color: var(--brass); align-self: center; }
.brand-name { font-family: var(--font-display); font-size: 20px; letter-spacing: 0.04em; }
.brand-dev { font-family: var(--font-dev); color: var(--slate); font-size: 15px; }
.head-note { font-family: var(--font-mono); font-size: 11.5px; color: var(--slate); letter-spacing: 0.02em; }

.site-foot {
  padding: 28px clamp(20px, 4vw, 48px) 40px;
  color: var(--slate); font-size: 12.5px; max-width: 860px;
}

/* ── header user chip ── */
.head-right { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.lang-select {
  background: var(--ink); color: var(--parchment);
  border: 1px solid var(--line); border-radius: 8px;
  font-family: var(--font-body); font-size: 13px; padding: 6px 10px; cursor: pointer;
}
.lang-select:focus { border-color: var(--brass); outline: none; }
.user-chip { display: flex; align-items: center; gap: 10px; font-size: 13.5px; }
.user-chip span { color: var(--parchment); }

/* ── auth view ── */
.view-auth { display: grid; place-items: start center; padding: clamp(24px, 8vh, 90px) 20px 60px; }
.auth-panel { width: min(440px, 100%); }
.auth-tabs { display: flex; gap: 6px; margin-bottom: 20px; }
.auth-tabs button {
  flex: 1; background: var(--ink); color: var(--slate);
  border: 1px solid var(--line); border-radius: 8px;
  font-family: var(--font-body); font-size: 14px; padding: 9px 0; cursor: pointer;
}
.auth-tabs button[aria-selected="true"] { color: var(--ink); background: var(--brass); border-color: var(--brass); font-weight: 700; }
.auth-note { font-size: 14px; color: var(--slate); margin: 0 0 14px; }
.auth-note strong { color: var(--parchment); }
.btn-resend { width: 100%; margin-top: 10px; padding: 10px; border-radius: 8px; }
.link-button {
  display: block; width: 100%; margin-top: 12px; padding: 4px;
  background: none; border: none; cursor: pointer;
  color: var(--slate); font-family: var(--font-body); font-size: 13px;
  text-decoration: underline; text-underline-offset: 3px;
}
.link-button:hover { color: var(--brass); }

/* ── my charts ── */
.my-charts { grid-column: 2; }
.my-charts ul { list-style: none; margin: 0; padding: 0; }
.my-charts li { border: 1px solid var(--line); border-radius: 10px; margin-bottom: 10px; }
.my-charts button.chart-open {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  width: 100%; padding: 12px 14px; background: transparent; border: none;
  color: var(--parchment); font-family: var(--font-body); font-size: 14.5px;
  cursor: pointer; text-align: left; border-radius: 10px;
}
.my-charts button.chart-open:hover { background: rgba(232, 181, 77, 0.05); }
.my-charts .chart-sub { font-family: var(--font-mono); font-size: 12px; color: var(--slate); }

/* ── intake view ── */
.view-intake {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(340px, 0.85fr);
  gap: clamp(28px, 5vw, 72px);
  align-items: center;
  padding: clamp(24px, 5vh, 64px) clamp(20px, 4vw, 48px);
  max-width: 1240px; margin: 0 auto;
  min-height: calc(100vh - 180px);
}

.sky {
  position: absolute; inset: 0; overflow: hidden; pointer-events: none;
  color: var(--brass-dim);
}
#zodiac-ring {
  position: absolute; width: 880px; height: 880px;
  left: -260px; top: 50%; transform: translateY(-50%);
  opacity: 0.22;
  animation: ring-turn 240s linear infinite;
}
@keyframes ring-turn { to { rotate: 360deg; } }

.hero { position: relative; }
.eyebrow {
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--brass); margin: 0 0 18px;
}
.hero-title {
  font-family: var(--font-display); font-weight: 400;
  font-size: clamp(36px, 4.6vw, 58px); line-height: 1.08;
  margin: 0 0 10px; text-wrap: balance;
}
.hero-dev {
  font-family: var(--font-dev); color: var(--brass);
  font-size: clamp(18px, 2vw, 24px); margin: 0 0 22px;
}
.hero-sub { color: var(--slate); max-width: 46ch; font-size: 17px; margin: 0; }

/* intake panel = instrument card */
.intake-panel {
  position: relative;
  background: linear-gradient(165deg, var(--surface) 0%, var(--ink-2) 100%);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  box-shadow: var(--shadow);
  padding: var(--pad-card);
}
.intake-panel::before {
  /* brass corner ticks — instrument etching */
  content: ""; position: absolute; inset: 8px; pointer-events: none;
  border-radius: 10px;
  background:
    linear-gradient(var(--brass), var(--brass)) top left    / 14px 1px,
    linear-gradient(var(--brass), var(--brass)) top left    / 1px 14px,
    linear-gradient(var(--brass), var(--brass)) top right   / 14px 1px,
    linear-gradient(var(--brass), var(--brass)) top right   / 1px 14px,
    linear-gradient(var(--brass), var(--brass)) bottom left / 14px 1px,
    linear-gradient(var(--brass), var(--brass)) bottom left / 1px 14px,
    linear-gradient(var(--brass), var(--brass)) bottom right/ 14px 1px,
    linear-gradient(var(--brass), var(--brass)) bottom right/ 1px 14px;
  background-repeat: no-repeat;
  opacity: 0.7;
}

.panel-title {
  font-family: var(--font-display); font-weight: 400; font-size: 22px;
  margin: 0 0 18px; letter-spacing: 0.02em;
}
.panel-title-dev { font-family: var(--font-dev); color: var(--slate); font-size: 16px; margin-left: 6px; }

.field { margin-bottom: 16px; position: relative; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field label {
  display: block; font-size: 12.5px; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--slate); margin-bottom: 6px;
}
.field input {
  width: 100%; padding: 11px 13px;
  background: var(--ink); color: var(--parchment);
  border: 1px solid var(--line); border-radius: 8px;
  font-family: var(--font-body); font-size: 15px;
  transition: border-color 120ms ease;
}
.field input[type="date"], .field input[type="time"] { font-family: var(--font-mono); font-size: 14px; }
.field input::placeholder { color: #5A6390; }
.field input:focus { border-color: var(--brass); outline: none; }
.field input:focus-visible { outline: none; }
.field-hint { font-size: 12px; color: var(--slate); margin: 8px 0 0; }

#place-results {
  position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% - 6px);
  margin: 0; padding: 6px; list-style: none;
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 10px; box-shadow: var(--shadow);
  max-height: 264px; overflow-y: auto;
}
#place-results li {
  padding: 9px 10px; border-radius: 6px; cursor: pointer; font-size: 14.5px;
}
#place-results li .place-sub { display: block; font-size: 12px; color: var(--slate); font-family: var(--font-mono); }
#place-results li:hover, #place-results li[aria-selected="true"] { background: var(--ink); }
#place-results li[aria-selected="true"] { box-shadow: inset 2px 0 0 var(--brass); }

.form-error { color: #E58A6B; font-size: 13.5px; margin: 0 0 12px; }

.btn-primary {
  width: 100%; padding: 13px 18px;
  background: var(--brass); color: var(--ink);
  font-family: var(--font-body); font-weight: 700; font-size: 15.5px;
  border: none; border-radius: 8px; cursor: pointer;
  transition: transform 120ms ease, filter 120ms ease;
}
.btn-primary:hover { filter: brightness(1.07); }
.btn-primary:active { transform: translateY(1px); }
.btn-primary[disabled] { opacity: 0.65; cursor: progress; }

.intake-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.intake-actions .btn-primary { flex: 1 1 200px; width: auto; }
.btn-secondary {
  flex: 1 1 160px; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 16px; background: transparent; color: var(--brass);
  font-family: var(--font-body); font-weight: 500; font-size: 14.5px;
  border: 1px solid var(--brass-dim); border-radius: 8px; cursor: pointer;
  transition: border-color 120ms ease, background-color 120ms ease, opacity 120ms ease;
}
.btn-secondary:hover:not([disabled]) { border-color: var(--brass); background: rgba(232, 181, 77, 0.08); }
.btn-secondary[disabled] { opacity: 0.4; cursor: not-allowed; }

/* ── reading view ── */
.view-reading { padding: 8px clamp(20px, 4vw, 48px) 40px; max-width: 1380px; margin: 0 auto; }
.reading-grid {
  display: grid;
  grid-template-columns: minmax(380px, 1.05fr) minmax(300px, 0.75fr) minmax(360px, 1fr);
  gap: 20px; align-items: start;
}

.card {
  background: linear-gradient(170deg, var(--surface) 0%, var(--ink-2) 100%);
  border: 1px solid var(--line); border-radius: var(--r-card);
  box-shadow: var(--shadow); padding: var(--pad-card);
}
.card + .card { margin-top: 20px; }
.card-title {
  font-family: var(--font-display); font-weight: 400; font-size: 18px;
  margin: 0 0 14px; letter-spacing: 0.02em;
}

/* chart card */
.chart-head { display: flex; flex-direction: column; gap: 14px; margin-bottom: 12px; }
.chart-head-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 14px; }
.native-name { font-family: var(--font-display); font-weight: 400; font-size: 24px; margin: 0; }
.chart-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.btn-feature { border-color: var(--brass-dim); color: var(--brass); }
.btn-feature:hover { border-color: var(--brass); color: var(--brass); background: rgba(232, 181, 77, 0.08); }
.chart-tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.chart-tabs button {
  background: transparent; color: var(--slate); border: 1px solid var(--line);
  font-family: var(--font-mono); font-size: 11.5px; padding: 5px 10px;
  border-radius: 999px; cursor: pointer;
}
.chart-tabs button[aria-selected="true"] { color: var(--ink); background: var(--brass); border-color: var(--brass); }

#kundli-chart, #hero-chart { width: 100%; height: auto; display: block; }
#kundli-chart .frame, #hero-chart .frame { stroke: var(--brass); fill: none; stroke-width: 1.1; }
#kundli-chart .frame-soft, #hero-chart .frame-soft { stroke: var(--brass-dim); fill: none; stroke-width: 0.7; opacity: 0.8; }
#kundli-chart .house-region, #hero-chart .house-region { fill: transparent; transition: fill 150ms ease; }
#kundli-chart .house-region:hover, #hero-chart .house-region:hover { fill: rgba(232, 181, 77, 0.05); }
#kundli-chart .sign-num, #hero-chart .sign-num { fill: var(--slate); font-family: var(--font-mono); font-size: 11px; }
#kundli-chart .planet, #hero-chart .planet { fill: var(--parchment); font-family: var(--font-mono); font-size: 13.5px; }
#kundli-chart .planet .deg, #hero-chart .planet .deg { fill: var(--slate); font-size: 9.5px; }
#kundli-chart .planet.retro, #hero-chart .planet.retro { fill: var(--brass); }
#kundli-chart .bindu, #hero-chart .bindu { fill: var(--vermillion); }
#kundli-chart .lagna-tick { stroke: var(--vermillion); stroke-width: 2; }
.chart-caption { font-family: var(--font-mono); font-size: 11.5px; color: var(--slate); margin: 10px 0 0; }

/* draw-in animation */
@media (prefers-reduced-motion: no-preference) {
  #kundli-chart.drawn .frame, #kundli-chart.drawn .frame-soft,
  #hero-chart.drawn .frame, #hero-chart.drawn .frame-soft {
    stroke-dasharray: 1800; stroke-dashoffset: 1800;
    animation: draw 1.1s ease-out forwards;
  }
  #kundli-chart.drawn .planet, #kundli-chart.drawn .sign-num,
  #hero-chart.drawn .planet, #hero-chart.drawn .sign-num {
    opacity: 0; animation: settle 0.5s ease-out forwards;
    animation-delay: calc(0.75s + var(--i, 0) * 70ms);
  }
  @keyframes draw { to { stroke-dashoffset: 0; } }
  @keyframes settle { from { opacity: 0; translate: 0 4px; } to { opacity: 1; } }
}
@media (prefers-reduced-motion: reduce) {
  #zodiac-ring { animation: none; }
}

/* meta / panchang */
.meta-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 18px; margin: 0; }
.meta-grid > div { border-left: 2px solid var(--line); padding-left: 10px; }
.meta-grid dt { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--slate); }
.meta-grid dd { margin: 2px 0 0; font-size: 14.5px; font-family: var(--font-mono); }
.vara-note { display: block; font-family: var(--font-body); font-size: 11px; color: var(--slate); margin-top: 3px; }

/* dasha */
.dasha-now { font-size: 14.5px; margin: 0 0 14px; color: var(--parchment); }
.dasha-now strong { color: var(--brass); font-weight: 700; }
.dasha-strip { display: flex; height: 14px; border-radius: 7px; overflow: hidden; border: 1px solid var(--line); position: relative; }
.dasha-strip .seg { height: 100%; opacity: 0.85; }
.dasha-strip .now-pin { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--vermillion); }
.dasha-list { list-style: none; margin: 14px 0 0; padding: 0; font-family: var(--font-mono); font-size: 12.5px; }
.dasha-list li { display: flex; justify-content: space-between; padding: 5px 2px; border-bottom: 1px dashed var(--line); color: var(--slate); }
.dasha-list li.current { color: var(--parchment); }
.dasha-list li.current .dl-lord::before { content: "● "; color: var(--vermillion); }
.dasha-list .dl-lord { font-weight: 500; }

/* yogas */
.yoga-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.yoga-list li { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.yoga-list .y-name { font-weight: 700; font-size: 14px; }
.yoga-list .y-name .y-kind {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase;
  padding: 2px 7px; border-radius: 999px; margin-left: 8px; vertical-align: 1px;
}
.yoga-list .y-kind.yoga { color: var(--brass); border: 1px solid var(--brass-dim); }
.yoga-list .y-kind.dosha { color: #E58A6B; border: 1px solid #7A3A24; }
.yoga-list .y-kind.y-strength { color: var(--slate); border: 1px solid var(--line); }
.yoga-list .y-planets { color: var(--slate); font-weight: 400; font-size: 12.5px; }
.yoga-list .y-desc { color: var(--slate); font-size: 13px; margin-top: 4px; }

/* chat */
.card-chat { display: flex; flex-direction: column; min-height: 560px; max-height: calc(100vh - 120px); position: sticky; top: 16px; }
.chat-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.chat-actions { display: flex; gap: 8px; }
.btn-ghost {
  display: inline-flex; align-items: center; gap: 7px;
  background: transparent; border: 1px solid var(--line); color: var(--slate);
  font-family: var(--font-body); font-size: 12.5px; padding: 6px 12px;
  border-radius: 999px; cursor: pointer;
  transition: color 140ms ease, border-color 140ms ease, background-color 140ms ease;
}
.btn-ghost:hover { color: var(--parchment); border-color: var(--slate); }
.ic { flex: none; width: 15px; height: 15px; fill: none; stroke: currentColor;
      stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.lbl { white-space: nowrap; }

/* ── credits chip + paywall modal ── */
.credit-chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(232, 181, 77, 0.10); border: 1px solid var(--brass-dim);
  color: var(--brass); font-family: var(--font-body); font-size: 12.5px;
  padding: 6px 12px; border-radius: 999px; cursor: pointer;
  transition: background-color 140ms ease, border-color 140ms ease;
}
.credit-chip:hover { background: rgba(232, 181, 77, 0.18); border-color: var(--brass); }
.credit-chip #credit-count { font-weight: 500; }
.modal-overlay {
  position: fixed; inset: 0; z-index: 100; background: rgba(4, 6, 18, 0.72);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.modal-card {
  position: relative; width: 100%; max-width: 460px;
  max-height: calc(100vh - 40px); max-height: calc(100dvh - 40px);
  overflow-y: auto; overscroll-behavior: contain;     /* the card scrolls, page does not */
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-card); box-shadow: var(--shadow);
  padding: clamp(20px, 3vw, 32px);
}
body.modal-open { overflow: hidden; }                 /* lock the background while open */
.modal-close {
  position: sticky; top: 0; z-index: 2; display: block;
  margin-left: auto; width: max-content;
  background: transparent; border: 0; color: var(--slate);
  font-size: 24px; line-height: 1; cursor: pointer;
}
.modal-close:hover { color: var(--parchment); }
/* ── DPDP: consent field + danger button ── */
.field-consent { margin: 4px 0 14px; }
.consent-check { display: flex; align-items: flex-start; gap: 9px;
  font-size: 13px; line-height: 1.5; color: var(--slate); cursor: pointer; }
.consent-check input[type="checkbox"] { flex: none; margin-top: 2px; width: 16px; height: 16px;
  accent-color: var(--brass); cursor: pointer; }
.consent-check a { color: var(--brass); }
.btn-danger { background: #7f1d1d; border-color: #7f1d1d; }
.btn-danger:hover { filter: brightness(1.12); }
.credits-intro { color: var(--slate); font-size: 13.5px; margin: 6px 0 14px; }
.credit-balance-line { color: var(--parchment); font-size: 14px; margin: 0 0 14px; }
.credit-balance-line strong { color: var(--brass); font-size: 16px; }
.pack-list { display: grid; gap: 8px; margin-bottom: 16px; }
.pack-card {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--surface-2); border: 1px solid var(--line);
  color: var(--parchment); font-family: var(--font-body); font-size: 14px;
  padding: 12px 14px; border-radius: 10px; cursor: pointer; text-align: left;
  transition: border-color 140ms ease, background-color 140ms ease;
}
.pack-card:hover { border-color: var(--slate); }
.pack-card.selected { border-color: var(--brass); background: rgba(232, 181, 77, 0.08); }
.pack-card .pack-price { color: var(--brass); font-weight: 500; display: flex; flex-direction: column; align-items: flex-end; line-height: 1.25; }
.pack-card .pack-inr { color: var(--slate); font-size: 11px; font-weight: 400; }
.credits-note { color: var(--slate); font-size: 12px; margin: 12px 0 0; text-align: center; }

/* decoy anchor: the popular pack is visually lifted */
.pack-card.popular { border-color: var(--brass); background: rgba(232, 181, 77, 0.06); position: relative; }
.pack-badge {
  position: absolute; top: -9px; left: 14px; background: var(--brass); color: var(--ink);
  font-size: 10px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase;
  padding: 2px 8px; border-radius: 999px;
}
.first-recharge {
  margin: 0 0 14px; padding: 9px 12px; border-radius: 10px; text-align: center;
  font-size: 13px; font-weight: 600; color: var(--ink);
  background: linear-gradient(100deg, var(--brass), #f0c976);
}

/* per-question cost hints + the dossier action sit on a row under each composer */
.chat-meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 6px; flex-wrap: wrap; }
.chat-meta .chat-hint { margin: 0; }
.chat-meta-right { display: flex; align-items: center; gap: 10px; }
.cost-hint { font-family: var(--font-mono); font-size: 10.5px; color: var(--slate); white-space: nowrap; }
.btn-dossier {
  font-size: 12px; padding: 5px 11px; border-radius: 999px;
  border: 1px solid var(--brass); color: var(--brass); background: transparent;
}
.btn-dossier:hover { background: rgba(232, 181, 77, 0.12); }
/* low-balance state on the header chip draws the eye to top up */
.credit-chip.low { border-color: #d9534f; background: rgba(217, 83, 79, 0.14); }
.credit-chip.low #credit-count { color: #ff7b76; font-weight: 700; }

.chat-log { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; padding: 6px 2px; }
.msg { position: relative; max-width: 92%; padding: 10px 14px; border-radius: 12px; font-size: 14.5px; white-space: pre-wrap; }
.msg.user { align-self: flex-end; background: var(--surface-2); border: 1px solid var(--line); border-bottom-right-radius: 4px; }
.msg.assistant { align-self: flex-start; background: transparent; border: 1px solid var(--brass-dim); border-bottom-left-radius: 4px; }
.msg.assistant.thinking { color: var(--slate); font-style: italic; border-style: dashed; }
.msg.assistant.failed { border-color: #7A3A24; }
.retry-row { display: flex; align-items: center; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.btn-retry {
  background: var(--brass); color: var(--ink); border: none; border-radius: 999px;
  font-family: var(--font-body); font-weight: 700; font-size: 13px;
  padding: 7px 16px; cursor: pointer;
}
.btn-retry:hover { filter: brightness(1.07); }
.btn-retry:active { transform: translateY(1px); }
.err-detail { font-family: var(--font-mono); font-size: 11px; color: var(--slate); }
.msg .msg-role {
  display: block; font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--slate); margin-bottom: 4px;
}

/* transient confirmation (e.g. after branching a chat) */
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 16px); z-index: 200;
  max-width: min(460px, 92vw); background: var(--surface-2); color: var(--parchment);
  border: 1px solid var(--brass-dim); border-radius: 10px; padding: 12px 18px;
  font-size: 14px; line-height: 1.45; box-shadow: 0 14px 34px rgba(0, 0, 0, 0.45);
  opacity: 0; pointer-events: none; transition: opacity 240ms ease, transform 240ms ease;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* per-message branch controls: edit (your messages) / regenerate (answers) and
   a ‹ k/n › navigator wherever a message has more than one version */
.msg-actions { display: flex; align-items: center; gap: 8px; margin-top: 7px; min-height: 22px; }
.msg.user .msg-actions { justify-content: flex-end; }
.msg-act {
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; padding: 0;
  border: 1px solid var(--line); border-radius: 6px;
  background: var(--ink); color: var(--slate); cursor: pointer;
  opacity: 0; transition: opacity 130ms ease, color 130ms ease, border-color 130ms ease;
}
.msg:hover .msg-act, .msg-act:focus-visible { opacity: 1; }
.msg-act:hover { color: var(--brass); border-color: var(--brass-dim); }
.msg-act .ic { width: 14px; height: 14px; }
@media (hover: none) { .msg-act { opacity: 0.55; } }
.branch-nav { display: inline-flex; align-items: center; gap: 3px; }
.branch-arrow {
  border: none; background: none; color: var(--slate); cursor: pointer;
  font-size: 16px; line-height: 1; padding: 1px 5px; border-radius: 5px;
}
.branch-arrow:hover:not(:disabled) { color: var(--brass); background: var(--surface-2); }
.branch-arrow:disabled { opacity: 0.3; cursor: default; }
.branch-count { font-family: var(--font-mono); font-size: 11px; color: var(--slate); }

/* inline message editor (ChatGPT-style edit-and-resend) */
.msg-editor { display: flex; flex-direction: column; gap: 8px; }
.edit-area {
  width: 100%; min-height: 54px; resize: vertical; box-sizing: border-box;
  background: var(--ink); color: var(--parchment);
  border: 1px solid var(--brass-dim); border-radius: 8px; padding: 8px 10px;
  font-family: var(--font-body); font-size: 14px; line-height: 1.5;
}
.edit-area:focus { outline: none; border-color: var(--brass); }
.edit-bar { display: flex; gap: 8px; justify-content: flex-end; }
.btn-sm {
  font-family: var(--font-body); font-weight: 700; font-size: 12.5px;
  padding: 6px 14px; border-radius: 999px; cursor: pointer;
}
.btn-ghost.btn-sm { background: var(--ink); color: var(--slate); border: 1px solid var(--line); }
.btn-ghost.btn-sm:hover { color: var(--parchment); border-color: var(--brass-dim); }
.btn-primary.btn-sm { border: none; }

.chat-log { scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.chat-log::-webkit-scrollbar { width: 8px; }
.chat-log::-webkit-scrollbar-thumb { background: var(--line); border-radius: 4px; }
.chat-log::-webkit-scrollbar-track { background: transparent; }

.chat-suggest { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 0; }
.chat-suggest button {
  background: var(--ink); color: var(--slate); border: 1px solid var(--line);
  font-size: 12.5px; padding: 6px 12px; border-radius: 999px; cursor: pointer;
  transition: color 120ms ease, border-color 120ms ease;
}
.chat-suggest button:hover { color: var(--brass); border-color: var(--brass-dim); }

.chat-form { display: flex; gap: 10px; align-items: flex-end; }
.chat-form textarea {
  flex: 1; padding: 12px 14px; background: var(--ink); color: var(--parchment);
  border: 1px solid var(--line); border-radius: 10px; font-size: 14.5px;
  font-family: var(--font-body); line-height: 1.45;
  /* hidden at rest so the rows=1 composer never shows an inner scrollbar over
     the placeholder; the input-driven auto-grow JS resizes up to max-height. */
  resize: none; min-height: 46px; max-height: 168px; overflow-y: hidden;
}
.chat-form textarea:focus { border-color: var(--brass); outline: none; }
.btn-send { width: 48px; height: 46px; flex: none; display: grid; place-items: center; }
.chat-hint { font-family: var(--font-mono); font-size: 10.5px; color: var(--slate); margin: 6px 2px 0; text-align: right; }
.btn-attach { width: 44px; height: 46px; flex: none; display: grid; place-items: center; border-radius: 10px; padding: 0; }
.btn-attach:hover { color: var(--brass); border-color: var(--brass-dim); }
.attach-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.attach-chips:not(:empty) { padding-bottom: 8px; }
.attach-chip {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--ink); border: 1px solid var(--brass-dim); border-radius: 999px;
  font-family: var(--font-mono); font-size: 11.5px; color: var(--parchment);
  padding: 4px 6px 4px 12px;
}
.attach-chip button {
  background: none; border: none; color: var(--slate); cursor: pointer;
  font-size: 13px; line-height: 1; padding: 2px 5px;
}
.attach-chip button:hover { color: var(--vermillion); }
.attach-chip.uploading { opacity: 0.55; }

/* ── kundli milan ── */
.view-matching { padding: 8px clamp(20px, 4vw, 48px) 40px; max-width: 1240px; margin: 0 auto; }

/* ── public landing ── */
.view-landing { max-width: 1120px; margin: 0 auto; padding: clamp(28px, 6vw, 76px) clamp(20px, 4vw, 48px) 72px; }
.landing-hero {
  display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(300px, 0.95fr);
  gap: clamp(28px, 5vw, 64px); align-items: center; text-align: left;
  margin: 0 0 clamp(44px, 7vw, 92px);
}
.landing-hero .hero-title { margin: 10px 0 4px; }
.landing-hero .hero-sub { margin: 14px 0 0; max-width: 52ch; }
.landing-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.landing-cta .btn-primary, .landing-cta .btn-secondary, .landing-final-cta { width: auto; flex: 0 0 auto; }
.landing-cta .btn-secondary { padding: 12px 26px; }

/* the product IS the hero: a real computed chart, framed like an instrument */
.hero-figure { position: relative; margin: 0; padding: clamp(14px, 2vw, 24px); }
.hero-figure::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; border-radius: 12px;
  background:
    linear-gradient(var(--brass), var(--brass)) top left    / 16px 1px,
    linear-gradient(var(--brass), var(--brass)) top left    / 1px 16px,
    linear-gradient(var(--brass), var(--brass)) top right   / 16px 1px,
    linear-gradient(var(--brass), var(--brass)) top right   / 1px 16px,
    linear-gradient(var(--brass), var(--brass)) bottom left / 16px 1px,
    linear-gradient(var(--brass), var(--brass)) bottom left / 1px 16px,
    linear-gradient(var(--brass), var(--brass)) bottom right/ 16px 1px,
    linear-gradient(var(--brass), var(--brass)) bottom right/ 1px 16px;
  background-repeat: no-repeat; opacity: 0.65;
}
.hero-figure figcaption { text-align: center; }

@media (max-width: 880px) {
  .landing-hero { grid-template-columns: 1fr; text-align: center; }
  .landing-hero .hero-sub { margin-inline: auto; }
  .landing-cta { justify-content: center; }
  .hero-figure { max-width: 360px; margin: 0 auto; }
}
.landing-section-title { font-family: var(--font-display); font-weight: 400; font-size: clamp(22px, 3vw, 28px); text-align: center; margin: 0 0 28px; }
.landing-features { margin-bottom: clamp(52px, 8vw, 92px); }
.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.feature-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); padding: 24px; }
.feature-card h3 { font-family: var(--font-display); font-weight: 400; font-size: 18px; color: var(--brass); margin: 0 0 8px; }
.feature-card p { color: var(--slate); font-size: 14px; line-height: 1.6; margin: 0; }
.landing-pricing { margin-bottom: clamp(52px, 8vw, 92px); }
.pricing-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.pricing-card {
  position: relative; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-card); padding: 24px; text-align: center;
}
.pricing-card.featured { border-color: var(--brass); background: rgba(232, 181, 77, 0.06); }
.pricing-name { font-family: var(--font-display); font-weight: 400; font-size: 18px; color: var(--brass); margin: 0 0 12px; }
.pricing-credits { font-family: var(--font-display); color: var(--parchment); font-size: 26px; font-weight: 500; margin: 0 0 8px; }
.pricing-credits span { font-family: var(--font-body); font-size: 13px; font-weight: 400; color: var(--slate); }
.pricing-price { margin: 0; display: flex; align-items: baseline; justify-content: center; gap: 8px; }
.pricing-inr { color: var(--brass); font-size: 22px; font-weight: 600; }
.pricing-usd { color: var(--slate); font-size: 13px; }
.pricing-line { color: var(--parchment); font-size: 14px; text-align: center; margin: 20px auto 0; max-width: 640px; line-height: 1.6; }
.pricing-fine { color: var(--slate); font-size: 12px; text-align: center; margin: 12px auto 0; max-width: 640px; line-height: 1.5; }
.landing-steps { text-align: center; }
.step-list { list-style: none; padding: 0; margin: 0 auto 32px; max-width: 600px; text-align: left; display: grid; gap: 14px; }
.step-list li { display: flex; align-items: center; gap: 14px; color: var(--parchment); font-size: 15px; }
.step-n { flex: none; width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--brass-dim);
         color: var(--brass); font-family: var(--font-mono); font-size: 14px;
         display: inline-flex; align-items: center; justify-content: center; }
.milan-head { display: flex; align-items: center; gap: 18px; margin-bottom: 16px; }
.milan-head .panel-title { margin: 0; }

.milan-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.milan-tabs button {
  background: var(--ink); color: var(--slate); border: 1px solid var(--line);
  border-radius: 999px; padding: 8px 16px; cursor: pointer;
  font-family: var(--font-body); font-size: 13.5px;
  display: inline-flex; align-items: center; gap: 8px;
}
.milan-tabs button[aria-selected="true"] {
  /* brass fill already signals selection; the bold 700 weight made Schibsted
     Grotesk's small lowercase i/j rasterize like caps ("Vijay" -> "VIJay"), so
     names now render exactly as typed (matches .chart-tabs selected). */
  color: var(--ink); background: var(--brass); border-color: var(--brass);
}
.milan-tabs button .tab-score {
  font-family: var(--font-mono); font-size: 11px;
  border: 1px solid currentColor; border-radius: 999px; padding: 1px 7px;
}
.milan-tabs .tab-add { border-style: dashed; }

.milan-form { width: min(480px, 100%); }
.milan-form select {
  width: 100%; padding: 11px 13px; background: var(--ink); color: var(--parchment);
  border: 1px solid var(--line); border-radius: 8px;
  font-family: var(--font-body); font-size: 15px;
}

.milan-grid {
  display: grid; grid-template-columns: minmax(340px, 0.9fr) minmax(380px, 1.1fr);
  gap: 20px; align-items: start;
}
.card-mchat { min-height: 480px; max-height: calc(100vh - 200px);
  display: flex; flex-direction: column; position: sticky; top: 16px; }

.score-hero { display: flex; align-items: baseline; gap: 18px; margin-bottom: 6px; }
.score-big { font-family: var(--font-display); font-size: 54px; color: var(--brass); line-height: 1; }
.score-big .score-max { font-size: 22px; color: var(--slate); margin-left: 6px; }
.score-verdict {
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--parchment);
  border: 1px solid var(--brass-dim); border-radius: 999px; padding: 5px 13px;
}
.score-people { color: var(--slate); font-size: 13.5px; margin: 8px 0 16px; }

.koota-list { list-style: none; margin: 0 0 14px; padding: 0; }
.koota-list li { display: grid; grid-template-columns: 110px 1fr 64px; gap: 10px;
  align-items: center; padding: 6px 0; border-bottom: 1px dashed var(--line); }
.koota-list .k-name { font-size: 13.5px; }
.koota-list .k-bar { height: 7px; border-radius: 4px; background: var(--ink); overflow: hidden; }
.koota-list .k-bar span { display: block; height: 100%; background: var(--brass); border-radius: 4px; }
.koota-list .k-bar span.low { background: #7A3A24; }
.koota-list .k-pts { font-family: var(--font-mono); font-size: 12.5px; text-align: right; }

.manglik-line { font-size: 13.5px; color: var(--parchment); border-left: 2px solid var(--brass-dim);
  padding-left: 10px; margin: 0 0 16px; }
.milan-actions { display: flex; gap: 10px; }
.milan-actions button { flex: 1; }

/* ── matchmaker pandit ── */
/* the launcher row is a .card now, so it frames itself; the section just spaces
   it below the score panel and .card + .card spaces the thread card below it. */
.matchmaker-section { margin-top: 28px; }
.matchmaker-header { display: flex; align-items: center; gap: 16px; }
.matchmaker-header .card-title { margin: 0; }
.btn-matchmaker {
  font-size: 13px; padding: 6px 16px; border-radius: 999px;
  border: 1px solid var(--brass); color: var(--brass); background: transparent;
  cursor: pointer; font-family: var(--font-body);
}
.btn-matchmaker:hover { background: rgba(232, 181, 77, 0.12); }
.btn-matchmaker:disabled { opacity: 0.45; cursor: not-allowed; }
.card-mmchat { min-height: 400px; max-height: calc(100vh - 260px); display: flex; flex-direction: column; }
.mm-cost-quote { font-family: var(--font-mono); font-size: 10.5px; color: var(--slate); white-space: nowrap; }

@media (max-width: 980px) {
  .milan-grid { grid-template-columns: 1fr; }
  .card-mchat { position: static; }
}

/* ── responsive ── */
@media (max-width: 1180px) {
  .reading-grid { grid-template-columns: minmax(360px, 1fr) minmax(300px, 0.8fr); }
  .col-chat { grid-column: 1 / -1; }
  .card-chat { position: static; min-height: 480px; }
}
@media (max-width: 880px) {
  .view-intake { grid-template-columns: 1fr; min-height: unset; gap: 36px; }
  #zodiac-ring { left: 50%; translate: -50% 0; top: -200px; transform: none; }
  .reading-grid { grid-template-columns: 1fr; }
  /* compact wrapping header: brand+nav left, controls flow beside or below, no engine note */
  .site-head { flex-wrap: wrap; padding: 14px 20px; gap: 10px 14px; }
  .head-note { display: none; }
  .head-left { gap: 12px; }
}
@media (max-width: 480px) {
  .field-row { grid-template-columns: 1fr; }
  .msg { max-width: 100%; }
  .site-head { padding: 12px 16px; }
  .brand-name { font-size: 17px; }
  .brand-dev { font-size: 13px; }
  .head-right { gap: 8px; }
  .lang-select { padding: 5px 8px; font-size: 12.5px; }
}

/* ── footer legal nav (both site footers + legal pages) ── */
.foot-nav {
  display: flex; flex-wrap: wrap; gap: 8px 20px; margin: 0 0 14px;
}
.foot-nav a {
  color: var(--slate); text-decoration: none; font-size: 12.5px;
  letter-spacing: 0.01em;
}
.foot-nav a:hover, .foot-nav a:focus-visible { color: var(--brass); }

/* ── legal / trust pages (static, crawlable) ── */
.legal-top {
  display: flex; align-items: center;
  padding: 20px clamp(20px, 4vw, 48px);
  border-bottom: 1px solid var(--line);
}
.legal-top .brand { text-decoration: none; color: var(--parchment); }
.legal-page {
  max-width: 70ch; margin: 0 auto;
  padding: clamp(28px, 6vh, 56px) clamp(20px, 4vw, 40px) 56px;
}
.legal-page h1 {
  font-family: var(--font-display); font-weight: 400;
  font-size: clamp(28px, 4vw, 38px); color: var(--parchment); margin: 0 0 6px;
}
.legal-updated {
  font-family: var(--font-mono); font-size: 12px; color: var(--slate);
  letter-spacing: 0.02em; margin: 0 0 30px;
}
.legal-page h2 {
  font-family: var(--font-display); font-weight: 400;
  font-size: clamp(19px, 2.4vw, 23px); color: var(--brass); margin: 34px 0 10px;
}
.legal-page p, .legal-page li { color: var(--parchment); }
.legal-page a { color: var(--brass); text-underline-offset: 3px; }
.legal-page ul, .legal-page ol { padding-left: 22px; margin: 10px 0; }
.legal-page li { margin: 7px 0; }
.legal-page .legal-note {
  color: var(--slate); font-size: 14.5px;
  border-left: 2px solid var(--line); padding-left: 14px; margin: 22px 0;
}
.legal-page dl { margin: 12px 0; }
.legal-page dt { color: var(--slate); font-size: 13px; margin-top: 12px; }
.legal-page dd { margin: 2px 0 0; color: var(--parchment); }
