/* ==========================================================================
   Light, calm, and built to be trusted. Warm paper ground, deep ink, a
   single indigo accent with gold reserved for the chart itself.
   ========================================================================== */

:root {
  --paper:      #fbf9f6;
  --card:       #ffffff;
  --card-soft:  #f6f3ef;
  --line:       #e7e1d8;
  --line-soft:  #f0ece5;

  --ink:        #1e1b17;
  --ink-mid:    #57514a;
  --ink-soft:   #8a8279;

  --accent:     #4a3f8f;
  --accent-ink: #362d6e;
  --accent-bg:  #eeecf8;

  --gold:       #a8791f;
  --gold-bg:    #fcf4e3;

  --good:       #2f7a52;
  --good-bg:    #e8f4ed;
  --warn:       #a8691f;
  --warn-bg:    #fcf1e2;
  --bad:        #a8394a;
  --bad-bg:     #fbecee;

  --shadow-sm: 0 1px 2px rgba(30, 27, 23, .04), 0 1px 3px rgba(30, 27, 23, .04);
  --shadow:    0 2px 4px rgba(30, 27, 23, .04), 0 8px 24px rgba(30, 27, 23, .06);
  --shadow-lg: 0 4px 8px rgba(30, 27, 23, .05), 0 20px 48px rgba(30, 27, 23, .10);

  --serif: "Fraunces", Georgia, serif;
  --sans:  "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono:  ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;

  --radius: 16px;
}

* { box-sizing: border-box; }

/* Any element given an explicit display would otherwise ignore [hidden]. */
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 16px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
/* A flex item defaults to min-width:auto, so it refuses to shrink below its
   widest descendant - which is how one wide table drags the whole page past
   the viewport and stops overflow-x from ever engaging. */
main { flex: 1; min-width: 0; }
.wrap, .card, .details-card, .grid, .two-col, .pair, .bar-row { min-width: 0; }
.scroll { max-width: 100%; }
h1, h2, h3, p, li, td, th, div, span { overflow-wrap: break-word; }

.wrap { max-width: 1240px; margin: 0 auto; padding: 0 32px; }
/* A grid track with a hard pixel minimum cannot shrink below it, so every
   auto-fit track below uses min(Npx, 100%) rather than a bare Npx. */
/* Prose stays narrow for readability even though the page is wide. */
.intro, .reasoning, .headline, .bottom-line-card p, .period-now { max-width: 68ch; }

/* ---------- header ---------- */

.site-head { border-bottom: 1px solid var(--line-soft); background: rgba(251,249,246,.85);
             backdrop-filter: blur(8px); position: sticky; top: 0; z-index: 20; }
.site-head .wrap { display: flex; align-items: center; gap: 24px; height: 66px; }

/* ---------- brand mark (shared with the site) ---------- */

.vd-lockup { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.vd-word { font: 600 21px/1 var(--serif); letter-spacing: -.015em; }
.vd-mark { display: block; overflow: visible; }
.vd-mark-sm { width: 34px; height: 34px; }
.vd-hair { fill: none; stroke: var(--gold); stroke-width: 1.4; opacity: .85; }
.vd-spokes line { stroke: var(--gold); stroke-width: 1; opacity: .7; }
.vd-glyphs text { fill: #6b5a2e; font-family: "Segoe UI Symbol", "Apple Symbols", "Noto Sans Symbols", "DejaVu Sans", var(--sans); font-weight: 400; }
.vd-star { fill: var(--gold); }
.vd-dot, .vd-moon, .vd-sparkle { fill: var(--gold); }
.vd-orbit, .vd-ring { transform-origin: 100px 100px; }
.vd-orbit.spin { animation: vd-spin 60s linear infinite; }
.vd-ring.spin-slow { animation: vd-spin 240s linear infinite reverse; }
@keyframes vd-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .vd-orbit.spin, .vd-ring.spin-slow { animation: none; }
}

.tagline { font: 500 13px var(--sans); color: var(--gold); text-transform: uppercase;
           letter-spacing: .16em; margin: 0 0 14px; }

.modes { display: flex; gap: 2px; margin-left: auto;
         background: var(--card-soft); padding: 3px; border-radius: 999px; }
.modes button {
  border: 0; background: transparent; color: var(--ink-mid); cursor: pointer;
  font: 500 14px var(--sans); padding: 8px 18px; border-radius: 999px;
  transition: background .18s, color .18s;
}
.modes button:hover { color: var(--ink); }
.modes button.on { background: var(--card); color: var(--accent-ink);
                   box-shadow: var(--shadow-sm); }

/* ---------- intro ---------- */

.intro { padding: 56px 0 30px; max-width: 620px; }
.intro h1 { font: 400 40px/1.15 var(--serif); margin: 0 0 12px; letter-spacing: -.02em; }
.intro p { margin: 0; color: var(--ink-mid); font-size: 17px; }

/* ---------- cards ---------- */

/* The header is sticky, so anything scrolled to needs room above it. */
#results, #match-results, .answer-card, .score-card { scroll-margin-top: 86px; }

.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 26px; margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}
.card-title { font: 600 15px/1.3 var(--sans); margin: 0; letter-spacing: -.005em; }
.card-note { color: var(--ink-soft); font-size: 13px; margin: 6px 0 18px; }
.card-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.card-head .card-title { margin-right: auto; }
.controls { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; min-width: 0; }

.two-col { display: grid; gap: 20px; grid-template-columns: 1fr; }
@media (min-width: 900px) { .two-col { grid-template-columns: 1fr 1fr; } }
.stack { display: flex; flex-direction: column; gap: 12px; }
.stack-lg { display: flex; flex-direction: column; gap: 20px; }

/* ---------- form ---------- */

.form-card { padding: 24px 26px; box-shadow: var(--shadow); }

/* One row across the full width, so the whole form sits on one screen. */
.form-row { display: grid; gap: 14px; align-items: end;
            grid-template-columns: repeat(auto-fit, minmax(min(150px, 100%), 1fr)); }
@media (min-width: 1000px) {
  .form-row { grid-template-columns: 1.1fr 1fr 0.85fr 1.2fr auto; }
}
.check--inline { margin-top: 0; padding-bottom: 11px; white-space: nowrap; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(180px, 100%), 1fr)); }
.field { display: flex; flex-direction: column; gap: 7px; }
.field > span { font-size: 13px; font-weight: 500; color: var(--ink-mid); }
.field em { font-style: normal; color: var(--ink-soft); font-weight: 400; }
.field.ask { margin-top: 20px; }

input[type=text], input:not([type]), input[type=date], input[type=time],
textarea, select {
  font: inherit; width: 100%; color: var(--ink);
  background: var(--paper); border: 1px solid var(--line);
  border-radius: 10px; padding: 12px 14px;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
input::placeholder, textarea::placeholder { color: var(--ink-soft); }
input:focus, textarea:focus, select:focus {
  outline: none; background: var(--card); border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-bg);
}
textarea { resize: vertical; line-height: 1.5; }

.check { display: flex; align-items: center; gap: 10px; margin-top: 16px;
         font-size: 14px; color: var(--ink-mid); cursor: pointer; }
.check input { width: 17px; height: 17px; accent-color: var(--accent); cursor: pointer; }

.actions { display: flex; align-items: center; gap: 18px; margin-top: 24px; flex-wrap: wrap; }
button[type=submit] {
  background: var(--accent); color: #fff; border: 0; border-radius: 10px;
  padding: 13px 28px; font: 600 15px var(--sans); cursor: pointer;
  box-shadow: 0 1px 2px rgba(74,63,143,.3), 0 4px 14px rgba(74,63,143,.22);
  transition: transform .12s, box-shadow .18s, background .18s;
}
button[type=submit]:hover:not(:disabled) {
  background: var(--accent-ink); transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(74,63,143,.3), 0 8px 22px rgba(74,63,143,.26);
}
button[type=submit]:disabled { opacity: .55; cursor: progress; box-shadow: none; }

#status, #match-status { font-size: 14px; color: var(--ink-soft); }
#status.err, #match-status.err { color: var(--bad); }
#status.busy::before, #match-status.busy::before {
  content: ""; display: inline-block; width: 13px; height: 13px; margin-right: 8px;
  vertical-align: -2px; border: 2px solid var(--line); border-top-color: var(--accent);
  border-radius: 50%; animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.pair { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); }
fieldset { border: 1px solid var(--line); border-radius: 12px; padding: 20px;
           display: flex; flex-direction: column; gap: 14px; margin: 0;
           background: var(--paper); }
legend { padding: 0 8px; font: 600 12px var(--sans); color: var(--accent-ink);
         text-transform: uppercase; letter-spacing: .09em; }

/* ---------- notice ---------- */

.notice { background: var(--warn-bg); border: 1px solid #edd9b8; color: #7a4d15;
          padding: 14px 18px; border-radius: 12px; margin-bottom: 20px; font-size: 14px; }

/* ---------- the answer ---------- */

.answer-card {
  padding: 38px 42px; margin-bottom: 24px;
  background: linear-gradient(168deg, #fff 0%, #fdfbf7 100%);
  border-color: #ddd6e8; box-shadow: var(--shadow-lg);
}
.asked { margin: 0 0 14px; font-size: 13px; color: var(--ink-soft); }
.asked::before { content: "You asked"; display: block; font-weight: 600;
                 color: var(--accent); letter-spacing: .06em; text-transform: uppercase;
                 font-size: 11px; margin-bottom: 5px; }
#answer-text { font: 400 29px/1.32 var(--serif); margin: 0 0 18px;
               letter-spacing: -.015em; color: var(--ink); }

.answer-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.pill { font-size: 12px; font-weight: 600; padding: 5px 13px; border-radius: 999px;
        letter-spacing: .01em; }
.timing-pill { background: var(--accent-bg); color: var(--accent-ink);
               font-family: var(--mono); font-weight: 500; }
.pill.high { background: var(--good-bg); color: var(--good); }
.pill.moderate { background: var(--warn-bg); color: var(--warn); }
.pill.low { background: var(--card-soft); color: var(--ink-soft); }

.answer-body { display: grid; gap: 28px; border-top: 1px solid var(--line-soft);
               padding-top: 26px; }
.answer-narrative { display: flex; flex-direction: column; gap: 26px; }
@media (min-width: 1000px) {
  /* `stretch` rather than `start`: the two columns rarely have equal content,
     and a bounded panel that fills the row reads as a sidebar, where a bare
     column of the same height just reads as a hole. */
  .answer-body { grid-template-columns: 1fr 0.85fr; gap: 40px; align-items: stretch; }
  .answer-body .factors {
    grid-template-columns: 1fr; gap: 28px; border-top: 0;
    background: rgba(250, 247, 241, .75); border: 1px solid var(--line-soft);
    border-radius: 14px; padding: 24px 26px; align-content: start;
  }
}
.reasoning { font-size: 17px; line-height: 1.72; color: var(--ink-mid); margin: 0; }

.factors { display: grid; gap: 24px; grid-template-columns: 1fr; }
@media (min-width: 720px) and (max-width: 999px) {
  .factors { grid-template-columns: 1fr 1fr; gap: 34px; }
}
.factor-col h3 { font: 600 12px var(--sans); text-transform: uppercase;
                 letter-spacing: .09em; margin: 0 0 14px; }
#supports-col h3 { color: var(--good); }
#challenges-col h3 { color: var(--warn); }
.factor-col ul { list-style: none; margin: 0; padding: 0;
                 display: flex; flex-direction: column; gap: 15px; }
.factor-col li { padding-left: 20px; position: relative; }
.factor-col li::before {
  content: ""; position: absolute; left: 0; top: 8px;
  width: 7px; height: 7px; border-radius: 50%;
}
#supports li::before { background: var(--good); }
#challenges li::before { background: var(--warn); }
.factor-col strong { display: block; font-size: 14.5px; font-weight: 600; margin-bottom: 3px; }
.factor-col span { font-size: 14px; color: var(--ink-mid); line-height: 1.55; }

/* ---------- general reading ---------- */

.headline { font: 400 25px/1.4 var(--serif); margin: 0 0 26px;
            letter-spacing: -.012em; max-width: 42em; }
.sections { display: flex; flex-direction: column; gap: 20px; margin-bottom: 20px; }
.section-card { background: var(--card); border: 1px solid var(--line);
                border-radius: var(--radius); padding: 24px 26px; box-shadow: var(--shadow-sm); }
.section-card .area { font: 600 11px var(--sans); text-transform: uppercase;
                      letter-spacing: .1em; color: var(--accent); margin-bottom: 10px; }
.section-card .verdict { font: 500 18px/1.45 var(--sans); margin: 0 0 8px; }
.section-card .meaning { color: var(--ink-mid); margin: 0 0 14px; font-size: 15px; }
.section-card .detail-text { font-size: 14.5px; line-height: 1.66; color: var(--ink-mid);
                             background: var(--paper); border-radius: 10px;
                             padding: 15px 17px; margin: 0 0 14px; }
.section-foot { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.evidence-chip { font-size: 11.5px; background: var(--card-soft); color: var(--ink-soft);
                 padding: 4px 11px; border-radius: 999px; font-family: var(--mono); }

/* ---------- what helps / caveats ---------- */

.todo { list-style: none; margin: 0; padding: 0; display: flex;
        flex-direction: column; gap: 14px; }
.todo li { padding-left: 30px; position: relative; }
.todo li::before {
  content: ""; position: absolute; left: 0; top: 2px; width: 19px; height: 19px;
  border-radius: 50%; background: var(--good-bg);
  box-shadow: inset 0 0 0 1.5px rgba(47,122,82,.28);
}
.todo li::after {
  content: ""; position: absolute; left: 6px; top: 8px; width: 7px; height: 4px;
  border-left: 1.8px solid var(--good); border-bottom: 1.8px solid var(--good);
  transform: rotate(-45deg);
}
.todo strong { display: block; font-weight: 500; font-size: 15px; margin-bottom: 2px; }
.todo span { font-size: 13.5px; color: var(--ink-soft); }

.caveats { list-style: none; margin: 0; padding: 0; display: flex;
           flex-direction: column; gap: 9px; }
.caveats li { font-size: 13.5px; color: var(--ink-soft); padding-left: 18px; position: relative; }
.caveats li::before { content: ""; position: absolute; left: 0; top: 9px;
                      width: 8px; height: 1.5px; background: var(--line); }

/* ---------- summary tiles ---------- */

.chart-block { margin-top: 42px; padding-top: 34px; border-top: 1px solid var(--line); }
.summary { display: grid; gap: 14px; margin-bottom: 20px;
           grid-template-columns: repeat(auto-fit, minmax(min(150px, 100%), 1fr)); }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: 13px;
        padding: 17px 19px; box-shadow: var(--shadow-sm); }
.tile-label { font-size: 11px; font-weight: 600; color: var(--ink-soft);
              text-transform: uppercase; letter-spacing: .08em; }
.tile-value { font: 400 21px/1.2 var(--serif); margin-top: 7px; }
.tile-sub { font-size: 12px; color: var(--ink-soft); font-family: var(--mono); margin-top: 3px; }

/* ---------- toggles ---------- */

.toggle { display: flex; background: var(--card-soft); padding: 3px; border-radius: 9px; }
.toggle button { border: 0; background: transparent; color: var(--ink-mid);
                 font: 500 13px var(--sans); padding: 7px 15px; border-radius: 7px;
                 cursor: pointer; transition: background .16s, color .16s; }
.toggle button.on { background: var(--card); color: var(--accent-ink); box-shadow: var(--shadow-sm); }
select { width: auto; max-width: 100%; min-width: 0; padding: 8px 12px; font-size: 13px;
         text-overflow: ellipsis; }

/* ---------- kundli chart ---------- */

#chart-wrap { display: flex; justify-content: center; padding: 6px 0 2px; }
/* The chart is square and modest; pair it with the key facts rather than
   letting it float in the middle of a wide empty card. */
.chart-split { display: grid; gap: 28px; align-items: center; }
@media (min-width: 820px) { .chart-split { grid-template-columns: 1fr 1fr; } }
/* A hard two columns cannot fit a 320px phone; let it collapse. */
.chart-split .summary { margin: 0; }
@media (min-width: 420px) {
  .chart-split .summary { grid-template-columns: 1fr 1fr; }
}
.kundli { width: 100%; max-width: 430px; height: auto; }
.kundli .board { fill: #fffdf9; }
.kundli .frame { fill: none; stroke: var(--gold); stroke-width: 1.6; opacity: .55; }
.kundli .rule { stroke: var(--line); stroke-width: 1.2; fill: none; }
.kundli .cell { fill: #fffdf9; stroke: none; }
.kundli .cell-edge { fill: none; stroke: var(--line); stroke-width: 1.2; }
.kundli .cell.lagna { fill: var(--gold-bg); }
.kundli .sign-num, .kundli .sign-name { fill: var(--ink-soft); font-size: 11px;
                                        font-family: var(--mono); }
.kundli .planet-label { fill: var(--accent-ink); font-size: 13px; font-weight: 600;
                        font-family: var(--sans); }
.kundli .planet-label .retro { fill: var(--warn); }
.kundli .lagna-mark { stroke: var(--gold); stroke-width: 1.8; }

/* ---------- bars ---------- */

.bar-row { display: grid; align-items: center; gap: 12px; }
#ashtakavarga { display: flex; flex-direction: column; gap: 11px; }
#ashtakavarga .bar-row { grid-template-columns: 118px 1fr 30px; }
.bar-label { font-size: 14px; }
.bar-label small { display: block; color: var(--ink-soft); font-size: 11.5px; margin-top: 1px;
                   white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-track { display: block; height: 7px; background: var(--card-soft);
             border-radius: 999px; overflow: hidden; }
.bar-fill { display: block; height: 100%; border-radius: 999px; min-width: 3px;
            background: var(--good); transition: width .45s cubic-bezier(.4,0,.2,1); }
.bar-fill.mid { background: var(--warn); }
.bar-fill.low { background: var(--bad); }
.bar-score { font-family: var(--mono); font-size: 12.5px; color: var(--ink-mid); text-align: right; }

#koota-bars { display: flex; flex-direction: column; gap: 13px; }
#koota-bars .bar-row { grid-template-columns: 132px 1fr 52px; }

/* ---------- yogas ---------- */

.yoga { background: var(--paper); border-radius: 11px; padding: 15px 17px;
        border-left: 3px solid var(--accent); }
.yoga.cat-dhana { border-left-color: var(--good); }
.yoga.cat-cancellation { border-left-color: var(--warn); }
.yoga.cat-lunar, .yoga.cat-other { border-left-color: var(--line); }
.yoga-name { font-weight: 600; font-size: 14.5px; margin-bottom: 4px; }
.yoga-detail { font-size: 13.5px; color: var(--ink-mid); }
.yoga-why { font-size: 12.5px; color: var(--ink-soft); margin-top: 6px; line-height: 1.5; }

/* ---------- dasha ---------- */

.timeline { display: flex; min-width: 0; height: 44px; border-radius: 11px; overflow: hidden;
            border: 1px solid var(--line); margin-bottom: 18px; }
/* Without overflow:hidden the nowrap label inside each segment sets the
   segment's min-content width, and twelve of them push the page sideways. */
.seg { display: flex; align-items: center; justify-content: center;
       min-width: 0; overflow: hidden;
       background: var(--card-soft); border-right: 1px solid var(--line);
       font-size: 11.5px; color: var(--ink-soft); }
.seg:last-child { border-right: 0; }
.seg span { padding: 0 6px; min-width: 0; white-space: nowrap;
            overflow: hidden; text-overflow: ellipsis; }
.seg.now { background: var(--accent); color: #fff; font-weight: 600; }

.running { display: flex; flex-direction: column; gap: 7px; }
.run { display: flex; gap: 4px 12px; align-items: baseline; font-size: 14px;
       flex-wrap: wrap; min-width: 0; }
.run .lbl { font-weight: 500; min-width: 190px; }
.run .rng { color: var(--ink-soft); font-size: 13px; font-family: var(--mono); }
.run.lvl-2 { padding-left: 18px; }
.run.lvl-3 { padding-left: 36px; }

/* ---------- findings ---------- */

.finding { background: var(--paper); border-radius: 11px; padding: 15px 17px;
           border-left: 3px solid var(--line); }
.finding.sev-present, .finding.sev-strong { border-left-color: var(--bad); }
.finding.sev-partial, .finding.sev-cancelled { border-left-color: var(--warn); }
.finding.sev-none { border-left-color: var(--good); }
.finding-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.finding .key { font-weight: 600; font-size: 14.5px; text-transform: capitalize; }
.finding .sev { font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em;
                color: var(--ink-soft); }
.finding p { margin: 6px 0 0; font-size: 13.5px; color: var(--ink-mid); }
.finding .why { color: var(--ink-soft); font-size: 12.5px; }

/* ---------- tables ---------- */

.scroll { overflow-x: auto; margin-top: 18px; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th { text-align: left; font: 600 11px var(--sans); color: var(--ink-soft);
     text-transform: uppercase; letter-spacing: .07em;
     padding: 0 14px 10px 0; border-bottom: 1px solid var(--line); }
td { padding: 11px 14px 11px 0; border-bottom: 1px solid var(--line-soft); white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td.name { font-weight: 600; }
td.mono, .mono { font-family: var(--mono); }
td.wrap-cell { white-space: normal; min-width: 240px; color: var(--ink-mid); font-size: 13px; }
.dim { color: var(--ink-soft); }
.tag { font-size: 11px; padding: 3px 9px; border-radius: 6px;
       background: var(--card-soft); color: var(--ink-soft); }
.tag.exalted, .tag.own, .tag.moolatrikona { background: var(--good-bg); color: var(--good); }
.tag.debilitated, .tag.enemy { background: var(--bad-bg); color: var(--bad); }

/* ---------- details ---------- */

.details-card { padding: 0; }
.details-card summary { display: flex; align-items: center; gap: 12px; padding: 22px 26px;
                        cursor: pointer; list-style: none; }
.details-card summary::-webkit-details-marker { display: none; }
.details-card summary .card-title { margin-right: auto; }
.chev { width: 9px; height: 9px; border-right: 1.8px solid var(--ink-soft);
        border-bottom: 1.8px solid var(--ink-soft); transform: rotate(45deg);
        transition: transform .2s; margin-bottom: 3px; }
.details-card[open] .chev { transform: rotate(-135deg); margin-bottom: -3px; }
.details-card > *:not(summary) { padding: 0 26px 26px; }
.details-card .scroll { margin-top: 0; }

/* ---------- compatibility ---------- */

.score-card { display: flex; align-items: center; gap: 30px; flex-wrap: wrap;
              padding: 32px; box-shadow: var(--shadow); }
.score-ring { width: 122px; height: 122px; border-radius: 50%; flex-shrink: 0;
              display: flex; flex-direction: column; align-items: center;
              justify-content: center; background: var(--accent-bg);
              box-shadow: inset 0 0 0 2px rgba(74,63,143,.16); }
.score-ring span { font: 400 40px/1 var(--serif); color: var(--accent-ink); }
.score-ring small { font-size: 12px; color: var(--ink-soft); margin-top: 4px; }
.score-body { flex: 1; min-width: 230px; }
.score-body h2 { font: 400 26px/1.25 var(--serif); margin: 0 0 8px; text-transform: capitalize; }
.score-body p { margin: 0; color: var(--ink-mid); font-size: 15px; }

.match-group h3 { font: 600 12px var(--sans); text-transform: uppercase;
                  letter-spacing: .09em; color: var(--accent); margin: 0 0 14px; }
.match-item { padding: 15px 0; border-bottom: 1px solid var(--line-soft); }
.match-item:last-child { border-bottom: 0; }
.match-item .area { font-size: 11px; text-transform: uppercase; letter-spacing: .08em;
                    color: var(--ink-soft); margin-bottom: 5px; }
.match-item .verdict { font-weight: 500; margin: 0 0 5px; font-size: 15.5px; }
.match-item .meaning { margin: 0; color: var(--ink-mid); font-size: 14.5px; }
.match-item .helps { font-size: 13.5px; margin-top: 8px; color: var(--good); }

/* ---------- footer ---------- */

.site-foot { margin-top: 70px; padding: 32px 0 54px; border-top: 1px solid var(--line-soft); }
.site-foot p { margin: 0; font-size: 13px; color: var(--ink-soft); }
.site-foot .fine { margin-top: 7px; font-size: 12px; }
.site-foot .credit { margin-top: 14px; color: var(--ink-mid); }
.site-foot .credit a { color: var(--ink); font-weight: 500; text-decoration: none;
                       border-bottom: 1px solid var(--gold-line); }
.site-foot .credit a:hover { border-bottom-color: var(--gold); }

/* Brand plus both tabs do not fit a 320px phone at full size. */
@media (max-width: 400px) {
  .site-head .wrap { gap: 10px; padding: 0 14px; }
  .modes button { padding: 8px 11px; font-size: 13px; }
  /* The lockup is the widest thing in the bar; shrink it before the tabs. */
  .vd-mark-sm { width: 28px; height: 28px; }
  .vd-word { font-size: 17px; }
  .vd-lockup { gap: 7px; }
  .wrap { padding: 0 16px; }
}

@media (max-width: 620px) {
  .intro { padding: 38px 0 24px; }
  .intro h1 { font-size: 31px; }
  .card, .form-card, .answer-card { padding: 21px; }
  #answer-text { font-size: 23px; }
  .details-card summary { padding: 20px 21px; }
  .details-card > *:not(summary) { padding: 0 21px 21px; }
  #ashtakavarga .bar-row { grid-template-columns: 96px 1fr 28px; }
  .card-head { gap: 12px; }
  .controls { width: 100%; }
  .controls select { flex: 1 1 0; width: 100%; }
  .run .rng { font-size: 12px; }
  /* Nine segments across a phone leaves ~34px each - too narrow to read a
     planet name, and the nowrap labels drag the layout wider than the screen.
     The bar still shows the shape, and the period names are listed below it. */
  .timeline { height: 30px; }
  .seg span { display: none; }
  .run .lbl { min-width: 0; }
}


/* ---------- strength of each area ---------- */

.lead-note { font-size: 15.5px; line-height: 1.6; color: var(--ink);
             background: var(--accent-bg); border-radius: 11px;
             padding: 14px 17px; margin: 0 0 22px; }

/* Twelve areas in one column makes a very tall card on a wide screen. */
#ashtakavarga { gap: 22px 40px; }
@media (min-width: 880px) {
  #ashtakavarga { display: grid; grid-template-columns: 1fr 1fr; }
}
.area-row { display: flex; flex-direction: column; gap: 7px; }
.area-head { display: flex; align-items: baseline; gap: 10px; }
.area-title { font-weight: 600; font-size: 15.5px; }
.area-verdict { font-size: 11px; font-weight: 600; text-transform: uppercase;
                letter-spacing: .07em; padding: 3px 9px; border-radius: 999px;
                background: var(--good-bg); color: var(--good); white-space: nowrap; }
.area-verdict.mid { background: var(--warn-bg); color: var(--warn); }
.area-verdict.low { background: var(--bad-bg); color: var(--bad); }
.area-score { margin-left: auto; font-family: var(--mono); font-size: 13px;
              color: var(--ink-mid); white-space: nowrap; }
.area-score small { color: var(--ink-soft); font-size: 11px; margin-left: 6px; }
.area-score small::before { content: "· "; }
.area-covers { margin: 0; font-size: 13.5px; color: var(--ink-soft); }
.area-note { margin: 0; font-size: 14px; color: var(--ink-mid); }

/* ---------- life periods ---------- */

.timeline { height: 46px; }
.seg { border: 0; border-right: 1px solid var(--line); font: inherit;
       cursor: pointer; transition: background .15s; padding: 0; }
.seg:hover { background: #ece7de; }
.seg.now:hover { background: var(--accent-ink); }
.seg.picked { outline: 2px solid var(--accent); outline-offset: -2px; z-index: 1; }
.timeline-hint { font-size: 12px; color: var(--ink-soft); margin: 0 0 18px; }

.period-now { border-left: 3px solid var(--accent); padding: 4px 0 4px 16px; }
.period-major { margin: 0 0 6px; font-size: 15.5px; line-height: 1.6; }
.period-range { margin: 0 0 10px; font-family: var(--mono); font-size: 12.5px;
                color: var(--ink-soft); }
.period-sub { margin: 0; font-size: 14.5px; color: var(--ink-mid); line-height: 1.6; }

.period-detail { margin-top: 18px; padding: 14px 17px; background: var(--paper);
                 border: 1px solid var(--line); border-radius: 11px;
                 display: flex; flex-direction: column; gap: 4px; }
.period-detail strong { font-size: 15px; }
.period-detail span { font-family: var(--mono); font-size: 12.5px; color: var(--ink-soft); }
.period-detail em { font-style: normal; font-size: 13px; color: var(--accent); }

/* ---------- planets ---------- */

#planet-cards { display: grid; gap: 14px;
                grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); }
#yogas { display: grid; gap: 14px; align-items: start;
         grid-template-columns: repeat(auto-fit, minmax(min(330px, 100%), 1fr)); }
.planet-card { background: var(--paper); border-radius: 12px; padding: 16px 18px; }
.planet-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 8px; }
.planet-name { font-weight: 600; font-size: 16px; }
.planet-where { font-size: 12.5px; color: var(--ink-soft); font-family: var(--mono); }
.planet-meaning { margin: 0 0 8px; font-size: 14px; line-height: 1.6; color: var(--ink-mid); }
.planet-strength { margin: 0; font-size: 13.5px; font-weight: 500; }
.planet-flag { margin: 6px 0 0; font-size: 12.5px; color: var(--ink-soft); }

.nested { margin-top: 22px; border-top: 1px solid var(--line-soft); padding-top: 16px; }
.nested summary { cursor: pointer; font-size: 13.5px; color: var(--accent);
                  font-weight: 500; }

/* ---------- checks ---------- */

.finding .what-is { font-size: 13.5px; color: var(--ink-mid); margin: 8px 0 0; }
.finding .your-case { font-size: 14px; margin: 10px 0 0; color: var(--ink); }
.finding .context-note { font-size: 12.5px; color: var(--ink-soft);
                         font-style: italic; margin-top: 8px; }

/* ---------- bottom line ---------- */

.bottom-line-card { background: linear-gradient(168deg, #fff, #faf7f1);
                    border-color: #ddd6e8; box-shadow: var(--shadow); padding: 30px 34px; }
.bottom-line-card .card-title { color: var(--accent); text-transform: uppercase;
                                letter-spacing: .09em; font-size: 11.5px; margin-bottom: 12px; }
.bottom-line-card p { margin: 0; font: 400 20px/1.55 var(--serif); letter-spacing: -.008em; }

@media (max-width: 620px) {
  .wrap { padding: 0 16px; }
  .answer-card { padding: 22px; }
  .bottom-line-card { padding: 22px; }
  .bottom-line-card p { font-size: 17px; }
  .area-head { flex-wrap: wrap; }
  .area-score { margin-left: 0; }
}


/* ---------- yoga and check meaning ---------- */

.yoga { padding: 17px 19px; }
.yoga-name { font-size: 15px; margin-bottom: 7px;
             display: flex; align-items: center; gap: 8px; }
.yoga-count { font-size: 11px; font-weight: 600; background: var(--accent-bg);
              color: var(--accent-ink); border-radius: 999px; padding: 2px 8px; }
.yoga-count::before { content: "×"; margin-right: 1px; }

.yoga-list { margin: 0; padding-left: 18px; display: flex; flex-direction: column;
             gap: 8px; font-size: 14px; line-height: 1.55; }
.yoga-list li { color: var(--ink); }
.yoga-list li::marker { color: var(--accent); }
.yoga-what { margin: 0 0 8px; font-size: 14px; line-height: 1.6; color: var(--ink-mid); }
.yoga-yours { margin: 0; font-size: 14px; line-height: 1.6; color: var(--ink);
              font-weight: 500; }

.yoga-detail-toggle { margin-top: 11px; }
.yoga-detail-toggle summary { cursor: pointer; font-size: 12.5px; color: var(--accent);
                              list-style: none; font-weight: 500; }
.yoga-detail-toggle summary::-webkit-details-marker { display: none; }
.yoga-detail-toggle .why { margin: 8px 0 0; }

.finding .your-means { margin: 9px 0 0; font-size: 14px; line-height: 1.6;
                       color: var(--ink); font-weight: 500; }
.finding .yoga-detail-toggle { margin: 10px 0 0; }
.finding .context-note { margin-top: 10px; }


/* ---------- what helps, inside the answer ---------- */

.inline-todo h3 { font: 600 12px var(--sans); text-transform: uppercase;
                  letter-spacing: .09em; color: var(--good); margin: 0 0 14px; }

/* ---------- the expanded "how it forms" panel ---------- */

.yoga-detail-toggle summary { display: inline-flex; align-items: center; gap: 7px; }
.yoga-detail-toggle summary::after {
  content: ""; width: 6px; height: 6px; margin-bottom: 2px;
  border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg); transition: transform .2s;
}
.yoga-detail-toggle[open] summary::after { transform: rotate(-135deg); margin-bottom: -2px; }

.working { margin-top: 11px; background: var(--card); border: 1px solid var(--line);
           border-radius: 10px; overflow: hidden; }
.working-item { padding: 10px 13px; }
.working-item + .working-item { border-top: 1px solid var(--line-soft); }
.working-item p { margin: 0; font-size: 12.5px; line-height: 1.55; color: var(--ink-soft); }
.working-item p + p { margin-top: 3px; }
.working-head { color: var(--ink-mid) !important; font-weight: 600;
                margin-bottom: 4px !important; }

/* A plain grid, topped-aligned. Column layout was tried and is worse here:
   it balances by height, so one expanded card empties whole columns. */
#yogas { display: grid; gap: 16px; align-items: start;
         grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); }
.yoga { margin: 0; }


/* ---------- question chips ---------- */

.ask { margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--line-soft); }
.ask__head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.ask__label { font-size: 13px; font-weight: 500; color: var(--ink-mid); }
.ask__toggle { background: none; border: 0; padding: 0; cursor: pointer;
               font: 500 13px var(--sans); color: var(--accent); }
.ask__toggle:hover { text-decoration: underline; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { cursor: pointer; font: 500 13.5px var(--sans); color: var(--ink);
        background: var(--card); border: 1px solid var(--line); border-radius: 999px;
        padding: 9px 15px; transition: background .15s, border-color .15s, color .15s, transform .12s; }
.chip:hover { border-color: var(--accent); background: var(--accent-bg); color: var(--accent-ink); }
.chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.chip:active { transform: translateY(1px); }
.chip--none { color: var(--ink-soft); font-style: italic; }
.chip--none.on { color: #fff; font-style: normal; }
.chips--sm .chip { font-size: 12.5px; padding: 7px 13px; }
.ask__own { margin-top: 12px; }

/* ---------- skeleton loader ---------- */

.loader { padding: 32px 26px 28px; }
.loader__sky { position: relative; width: 108px; height: 108px; margin: 4px auto 0; display: grid; place-items: center; }
.loader__sky .vd-mark { width: 88px; height: 88px; }
.loader__ping { position: absolute; inset: 0; border-radius: 50%; border: 1px solid var(--gold);
                opacity: 0; animation: ping 3.3s ease-out infinite; animation-delay: var(--delay, 0s); }
@keyframes ping { 0% { transform: scale(.62); opacity: .5; } 100% { transform: scale(1.5); opacity: 0; } }
.loader__step { text-align: center; margin: 14px 0 26px; font-size: 14px; color: var(--ink-mid);
                min-height: 1.4em; transition: opacity .3s; }

/* Shimmer runs across the whole block, not each bar, so it reads as one sweep. */
.skeleton { display: flex; flex-direction: column; gap: 12px;
            background: linear-gradient(100deg, transparent 12%, rgba(255,255,255,.85) 35%, transparent 58%)
                        0 0 / 220% 100% no-repeat;
            animation: sweep 1.7s linear infinite; }
@keyframes sweep { to { background-position: -160% 0; } }
.sk { display: block; border-radius: 8px; background: var(--card-soft); height: 13px; }
.sk--eyebrow { width: 92px; height: 10px; }
.sk--title { height: 26px; border-radius: 10px; }
.sk--short { width: 62%; }
.sk--narrow { width: 108px; }
.sk--pill { width: 168px; height: 26px; border-radius: 999px; }
.sk--line { height: 12px; margin-bottom: 9px; }
.sk-row { display: flex; gap: 8px; margin: 4px 0 8px; }
.sk-cols { display: grid; gap: 22px; grid-template-columns: 1fr; margin-top: 6px; }
@media (min-width: 760px) { .sk-cols { grid-template-columns: 1.2fr 1fr; } }

@media (prefers-reduced-motion: reduce) {
  .loader__ping, .skeleton { animation: none; }
  .skeleton { background: none; }
}

/* ---------- follow-up chat ---------- */

.chat { margin-top: 24px; }
.chat__log { display: flex; flex-direction: column; gap: 18px; margin: 20px 0; }
.chat__log:empty { display: none; }

.turn--you { align-self: flex-end; max-width: 80%; background: var(--accent); color: #fff;
             border-radius: 16px 16px 4px 16px; padding: 11px 16px; font-size: 14.5px; line-height: 1.5; }
.turn--ai { max-width: 92%; }
.turn__answer { font: 400 18px/1.45 var(--serif); letter-spacing: -.008em; margin: 0 0 8px; }
.turn__detail { margin: 0; font-size: 14.5px; line-height: 1.65; color: var(--ink-mid); }
.turn__foot { display: flex; gap: 7px; flex-wrap: wrap; align-items: center; margin-top: 12px; }
.turn__foot .pill { font-size: 11px; padding: 4px 11px; }
.turn__ev { font-size: 11px; background: var(--card-soft); color: var(--ink-soft);
            padding: 4px 10px; border-radius: 999px; font-family: var(--mono);
            max-width: 100%; overflow-wrap: break-word; }

/* An aside is answered but visually set apart, so it never reads as a finding. */
.turn--aside { border-left: 3px solid var(--line); padding-left: 16px; }
.turn--aside .turn__answer { font-family: var(--sans); font-size: 15.5px; font-weight: 500; }
.turn__tag { display: inline-flex; align-items: center; gap: 6px; font: 600 10.5px var(--sans);
             text-transform: uppercase; letter-spacing: .1em; color: var(--ink-soft); margin-bottom: 8px; }
.turn__tag::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--ink-soft); }

.turn--thinking { display: flex; gap: 6px; padding: 6px 0; }
.turn--thinking i { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-soft);
                    animation: blink 1.3s ease-in-out infinite; }
.turn--thinking i:nth-child(2) { animation-delay: .18s; }
.turn--thinking i:nth-child(3) { animation-delay: .36s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }

.chat__form { display: flex; gap: 10px; margin-top: 18px; }
.chat__form input { flex: 1; min-width: 0; }
#chat-go { flex: none; width: 46px; height: 46px; border: 0; border-radius: 12px; cursor: pointer;
           background: var(--accent); color: #fff; display: grid; place-items: center;
           transition: background .15s, transform .12s; }
#chat-go:hover:not(:disabled) { background: var(--accent-ink); }
#chat-go:disabled { opacity: .5; cursor: progress; }
#chat-go svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2;
               stroke-linecap: round; stroke-linejoin: round; }
.chat__err { margin: 10px 0 0; font-size: 13px; color: var(--bad); }

/* ---------- account ---------- */

.account { position: relative; margin-left: 12px; }
.account__btn { display: flex; align-items: center; gap: 8px; cursor: pointer;
                background: var(--card); border: 1px solid var(--line); border-radius: 999px;
                padding: 6px 14px 6px 8px; font: 500 13.5px var(--sans); color: var(--ink);
                transition: border-color .15s, background .15s; }
.account__btn:hover { border-color: var(--accent); }
.account__btn img { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; }
.account__btn:not(:has(img:not([hidden]))) { padding-left: 14px; }

.account__menu { position: absolute; right: 0; top: calc(100% + 8px); min-width: 210px; z-index: 40;
                 background: var(--card); border: 1px solid var(--line); border-radius: 12px;
                 padding: 6px; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; }
.account__who { padding: 10px 12px 12px; border-bottom: 1px solid var(--line-soft); margin-bottom: 6px; }
.account__who b { display: block; font-size: 14px; }
.account__who span { display: block; font-size: 12.5px; color: var(--ink-soft);
                     overflow: hidden; text-overflow: ellipsis; }
.account__menu button { background: none; border: 0; text-align: left; cursor: pointer;
                        padding: 9px 12px; border-radius: 8px; font: 500 13.5px var(--sans); color: var(--ink); }
.account__menu button:hover { background: var(--card-soft); }

/* ---------- save bar ---------- */

.savebar { margin-top: 24px; display: flex; align-items: center; justify-content: space-between;
           gap: 20px; flex-wrap: wrap; padding: 20px 24px;
           background: linear-gradient(168deg, #fff, #fdfbf7); border-color: #ddd6e8; }
.savebar__text b { display: block; font-size: 15.5px; }
.savebar__text span { font-size: 13.5px; color: var(--ink-mid); }
.savebar__actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.savebar__actions button { background: var(--accent); color: #fff; border: 0; border-radius: 10px;
                           padding: 11px 20px; font: 600 14px var(--sans); cursor: pointer;
                           transition: background .15s; }
.savebar__actions button:hover:not(:disabled) { background: var(--accent-ink); }
.savebar__actions button:disabled { opacity: .55; cursor: default; }
.savebar__actions .saved { color: var(--good); font-size: 14px; font-weight: 500; }

/* ---------- history drawer ---------- */

.drawer { position: fixed; inset: 0; z-index: 60; }
.drawer__scrim { position: absolute; inset: 0; background: rgba(30,27,23,.32);
                 animation: fade .2s ease; }
@keyframes fade { from { opacity: 0; } }
.drawer__panel { position: absolute; top: 0; right: 0; bottom: 0; width: min(440px, 100%);
                 background: var(--paper); border-left: 1px solid var(--line);
                 display: flex; flex-direction: column; animation: slide .26s cubic-bezier(.2,.7,.2,1); }
@keyframes slide { from { transform: translateX(100%); } }
.drawer__head { display: flex; align-items: center; justify-content: space-between;
                padding: 22px 24px; border-bottom: 1px solid var(--line-soft); }
.drawer__head h2 { margin: 0; font: 600 16px var(--sans); }
.drawer__close { background: none; border: 0; font-size: 26px; line-height: 1; cursor: pointer;
                 color: var(--ink-soft); padding: 0 4px; }
.drawer__close:hover { color: var(--ink); }
.drawer__body { flex: 1; overflow-y: auto; padding: 18px 24px 28px;
                display: flex; flex-direction: column; gap: 10px; }

.saved-item { display: flex; align-items: flex-start; gap: 12px; text-align: left; width: 100%;
              background: var(--card); border: 1px solid var(--line); border-radius: 12px;
              padding: 14px 16px; cursor: pointer; font: inherit; color: inherit;
              transition: border-color .15s, transform .12s; }
.saved-item:hover { border-color: var(--accent); }
.saved-item:active { transform: translateY(1px); }
.saved-item__body { flex: 1; min-width: 0; }
.saved-item__q { display: block; font-weight: 500; font-size: 14.5px; margin-bottom: 3px; }
.saved-item__meta { display: block; font-size: 12.5px; color: var(--ink-soft); }
.saved-item__del { background: none; border: 0; cursor: pointer; color: var(--ink-soft);
                   font-size: 18px; line-height: 1; padding: 2px 4px; flex: none; }
.saved-item__del:hover { color: var(--bad); }
.drawer__empty { font-size: 14px; color: var(--ink-soft); padding: 8px 2px; }

@media (max-width: 620px) {
  .account__btn span { display: none; }
  .account__btn { padding: 6px; }
  .account__btn:not(:has(img:not([hidden]))) span { display: inline; }
}
