/* ============================================================================
   RISHI — ASTRA SKIN   (opt-in alternate art direction)

   EVERY rule in this file is prefixed `body[data-skin="astra"]` so it is
   physically impossible for it to touch the DEFAULT Atelier skin (which runs
   with no data-skin attribute). Astra is opt-in only — SKIN='atelier' by
   default; #skin=astra forces it for QA.

   Palette + type live in astra-tokens.css (--as-* vars).

   SCOPE: onboarding/chart-cast wizard (renderOnboardingAstra) + Today/home
   (renderTodayAstra) + Reading plate (openSectionAstra). All reuse every
   canonical handler + the real engine (/api/glance, /api/presence SSE,
   /api/reading SSE, md(), QLIB, sendChat, shareLine) — this file only restyles.
   Chat screen is NOT ported yet.
   ============================================================================ */

/* --- navy ground: skin the whole app shell while Astra is active --- */
body[data-skin="astra"]{ background:var(--as-bg-top); }
body[data-skin="astra"] #view{ background:var(--as-gradient); }
body[data-skin="astra"] .screen{ background:var(--as-gradient); color:var(--as-cream); }

/* --------------------------------------------------------------------------
   ONBOARDING WIZARD
   -------------------------------------------------------------------------- */
body[data-skin="astra"] .as-ob{
  padding:64px 34px 42px; display:flex; flex-direction:column; min-height:100%;
  font-family:var(--as-sans); color:var(--as-cream);
}
body[data-skin="astra"] .as-grow{ flex:1; min-height:14px; }

/* top row — back + step dots */
body[data-skin="astra"] .as-top{
  display:flex; align-items:center; justify-content:space-between; min-height:30px; margin-bottom:6px;
}
body[data-skin="astra"] .as-back{
  background:none; border:0; color:var(--as-cream); font-size:26px; line-height:1;
  cursor:pointer; padding:0 8px 2px 0; opacity:.85; transition:opacity .15s ease;
}
body[data-skin="astra"] .as-back:active{ opacity:.5; }
body[data-skin="astra"] .as-dots{ display:flex; gap:7px; }
body[data-skin="astra"] .as-dots i{
  width:6px; height:6px; border-radius:50%; background:rgba(243,236,223,.22); transition:background .4s ease;
}
body[data-skin="astra"] .as-dots i.on{ background:var(--as-gold); }

/* celestial crest (reuses ornOrbit svg — recolour its ink to butter gold) */
body[data-skin="astra"] .as-crest{ display:flex; justify-content:center; margin-top:10px; }
body[data-skin="astra"] .as-crest svg{ max-width:200px; height:auto; }
body[data-skin="astra"] .as-crest svg [stroke]{ stroke:var(--as-gold); }
body[data-skin="astra"] .as-crest svg [fill]:not([fill="none"]){ fill:var(--as-gold); }

/* display headline + copy */
body[data-skin="astra"] .as-display{
  font-family:var(--as-serif); font-weight:500; color:var(--as-cream);
  font-size:33px; line-height:1.12; text-align:center; letter-spacing:.2px; margin-top:16px;
}
body[data-skin="astra"] .as-explain{
  margin-top:14px; color:var(--as-subtitle); font-size:13px; line-height:1.62;
  text-align:center; font-weight:400; padding:0 2px;
}
body[data-skin="astra"] .as-note{
  margin-top:12px; color:var(--as-label); font-size:12.5px; line-height:1.6;
  text-align:center; padding:0 6px;
}
body[data-skin="astra"] .as-explain b{ color:var(--as-cream); font-weight:600; }
body[data-skin="astra"] .as-fine{
  text-align:center; font-size:11.5px; color:var(--as-subtitle); line-height:1.55; margin-top:16px; padding:0 8px;
}
body[data-skin="astra"] .as-fine a{ color:var(--as-gold); text-decoration:none; }

/* fields */
body[data-skin="astra"] .as-field{ margin-top:24px; }
body[data-skin="astra"] .as-field label{
  display:block; color:var(--as-label); font-size:12px; font-weight:500;
  letter-spacing:.2px; margin-bottom:7px;
}
body[data-skin="astra"] .as-field input{
  width:100%; background:var(--as-field); border:1px solid var(--as-outline);
  border-radius:var(--as-r-field); padding:14px 15px; color:var(--as-cream);
  font-family:var(--as-sans); font-size:16px; outline:none; transition:border-color .15s ease;
}
body[data-skin="astra"] .as-field input::placeholder{ color:#8f929c; }
body[data-skin="astra"] .as-field input:focus{ border-color:var(--as-gold-line); }
/* native date/time glyphs read on dark */
body[data-skin="astra"] .as-field input[type=date]::-webkit-calendar-picker-indicator,
body[data-skin="astra"] .as-field input[type=time]::-webkit-calendar-picker-indicator{ filter:invert(1) opacity(.6); }

/* "I don't know my birth time" toggle */
body[data-skin="astra"] .as-switchrow{
  display:flex; align-items:center; justify-content:space-between; margin-top:16px;
  color:var(--as-label); font-size:13.5px; cursor:pointer;
}
body[data-skin="astra"] .as-sw{
  width:44px; height:26px; border-radius:14px; background:var(--as-chip);
  border:1px solid var(--as-outline); position:relative; transition:background .2s ease;
}
body[data-skin="astra"] .as-sw:after{
  content:''; position:absolute; top:2px; left:2px; width:20px; height:20px; border-radius:50%;
  background:var(--as-cream); transition:transform .2s ease;
}
body[data-skin="astra"] .as-sw.on{ background:var(--as-gold); }
body[data-skin="astra"] .as-sw.on:after{ transform:translateX(18px); }

/* place results (placeSearch injects .placeopt into #placeresults) */
body[data-skin="astra"] .as-placeresults{ margin-top:10px; display:flex; flex-direction:column; gap:8px; }
body[data-skin="astra"] .as-placeresults .placeopt{
  background:var(--as-chip); border:1px solid var(--as-hair); border-radius:14px;
  padding:14px 15px; color:var(--as-cream); font-size:14.5px; cursor:pointer;
  box-shadow:var(--as-e-chip); transition:border-color .15s ease, background .15s ease;
}
body[data-skin="astra"] .as-placeresults .placeopt:active{ background:#53566180; }
body[data-skin="astra"] .as-placeresults .placeopt .cc{ color:var(--as-subtitle); }

/* confirm card */
body[data-skin="astra"] .as-confcard{
  margin-top:20px; background:var(--as-chip); border:1px solid var(--as-hair);
  border-radius:18px; padding:6px 18px; box-shadow:var(--as-e-chip);
}
body[data-skin="astra"] .as-confrow{
  display:flex; align-items:center; justify-content:space-between;
  padding:15px 0; border-bottom:1px solid var(--as-hair);
}
body[data-skin="astra"] .as-confrow:last-child{ border-bottom:0; }
body[data-skin="astra"] .as-confrow .k{ color:var(--as-subtitle); font-size:12.5px; letter-spacing:.04em; }
body[data-skin="astra"] .as-confrow .v{ color:var(--as-cream); font-size:15px; font-family:var(--as-serif); }

/* buttons — butter primary pill + ghost */
body[data-skin="astra"] .as-btn{
  width:100%; border:0; border-radius:26px; padding:16px; cursor:pointer;
  font-family:var(--as-sans); font-size:15px; font-weight:600;
  transition:transform .14s ease; margin-top:22px;
}
body[data-skin="astra"] .as-btn:active{ transform:scale(.985); }
body[data-skin="astra"] .as-btn-primary{
  background:var(--as-yellow); color:var(--as-yellow-text); box-shadow:0 8px 22px rgba(0,0,0,.26);
}
body[data-skin="astra"] .as-btn-ghost{
  background:transparent; border:1px solid var(--as-outline); color:var(--as-cream); margin-top:12px;
}

/* --------------------------------------------------------------------------
   TODAY / HOME
   Ported from today-astra.html. The engine is untouched — the butter note is
   the live #presencebody (streamPresence fills it), the headline is the
   /api/glance moon_sign, the chips route to the real chat. Styling only.
   -------------------------------------------------------------------------- */
body[data-skin="astra"] .as-today{
  padding:60px 28px 176px; min-height:100%;   /* clears Chat Now bar + tab bar */
  font-family:var(--as-sans); color:var(--as-cream);
}

/* header: gold eyebrow + Moon-in-sign serif title */
body[data-skin="astra"] .as-thead{
  display:flex; justify-content:space-between; align-items:flex-start;
}
body[data-skin="astra"] .as-greet{
  font-size:var(--as-t-greet); color:var(--as-gold); font-weight:500;
  letter-spacing:.2px; margin-bottom:4px;
}
body[data-skin="astra"] .as-htitle{
  font-family:var(--as-serif); font-weight:500; color:var(--as-cream);
  font-size:var(--as-t-title); line-height:1.12; letter-spacing:.2px;
}
body[data-skin="astra"] .as-ticons{ display:flex; gap:14px; align-items:center; padding-top:6px; }
body[data-skin="astra"] .as-ticon{
  background:none; border:0; padding:0; cursor:pointer; display:flex;
  transition:opacity .15s ease;
}
body[data-skin="astra"] .as-ticon:active{ opacity:.5; }
body[data-skin="astra"] .as-ticon svg{ width:21px; height:21px; }

/* subtitle / explainer */
body[data-skin="astra"] .as-tsub{
  margin-top:16px; color:var(--as-subtitle); font-size:var(--as-t-sub);
  line-height:1.55; font-weight:400;
}

/* centred divider + section label (Title Case in the markup) */
body[data-skin="astra"] .as-tdivider{ height:1px; width:46px; background:var(--as-divider); margin:30px auto 0; }
body[data-skin="astra"] .as-seclabel{
  text-align:center; color:var(--as-gold); font-size:var(--as-t-seclabel);
  font-weight:500; letter-spacing:var(--as-tr-label); text-transform:uppercase; margin-top:18px;
}

/* butter torn-paper NOTE = the presence reading (#presencebody) */
body[data-skin="astra"] .as-note-wrap{ margin:22px 10px 0; display:flex; justify-content:center; }
body[data-skin="astra"] .as-note{
  position:relative; width:100%; background:var(--as-yellow);
  padding:30px 28px; filter:drop-shadow(var(--as-e-note));
  clip-path:polygon(
    0% 3%, 9% 1.2%, 19% 2.4%, 30% 0.8%, 41% 2.2%, 52% 1%, 63% 2.4%, 74% 0.8%, 85% 2.2%, 94% 1%, 100% 2.4%,
    99.2% 13%, 100% 26%, 98.8% 38%, 100% 51%, 99.2% 64%, 100% 76%, 98.8% 88%, 100% 97.5%,
    91% 99%, 80% 97.6%, 69% 100%, 58% 97.8%, 47% 99.6%, 36% 97.8%, 25% 99.8%, 14% 97.8%, 5% 99.4%, 0% 97.2%,
    1.2% 86%, 0% 73%, 1.2% 60%, 0% 48%, 0.8% 36%, 0% 24%, 1.2% 13%
  );
}
body[data-skin="astra"] .as-quote{
  font-family:var(--as-serif); font-weight:500; color:var(--as-yellow-text);
  font-size:var(--as-t-note); line-height:1.34; text-align:center;
}
/* the reading streams as markdown paragraphs — keep them centred + dark on butter */
body[data-skin="astra"] .as-quote p{ margin:0 0 .5em; color:var(--as-yellow-text); }
body[data-skin="astra"] .as-quote p:last-child{ margin-bottom:0; }
body[data-skin="astra"] .as-quote strong{ color:var(--as-yellow-text); font-weight:600; }
body[data-skin="astra"] .as-quote .cursor{
  display:inline-block; width:2px; height:1em; vertical-align:-2px;
  background:var(--as-yellow-text); opacity:.6; margin-left:2px;
}

/* suggested question chips (real QLIB → canonical sendChat) */
body[data-skin="astra"] .as-chips{ margin-top:16px; display:flex; flex-direction:column; gap:14px; }
body[data-skin="astra"] .as-chip{
  display:flex; align-items:center; justify-content:space-between; width:100%; text-align:left;
  background:var(--as-chip); border:1px solid var(--as-hair); border-radius:var(--as-r-chip);
  padding:14px 14px 14px 18px; cursor:pointer; box-shadow:var(--as-e-chip);
  transition:transform .14s ease, background .14s ease;
}
body[data-skin="astra"] .as-chip:active{ transform:scale(.985); }
body[data-skin="astra"] .as-cq{ color:var(--as-white); font-size:var(--as-t-chip); font-weight:400; }
body[data-skin="astra"] .as-send{
  flex:0 0 auto; width:34px; height:34px; border-radius:50%;
  background:var(--as-gold-wash); border:1px solid var(--as-gold-line);
  display:flex; align-items:center; justify-content:center; margin-left:10px;
}
body[data-skin="astra"] .as-send svg{ width:15px; height:15px; }

/* the canonical reflect card + today hook, Astra-spaced */
body[data-skin="astra"] .as-reflectslot:empty,
body[data-skin="astra"] .as-todayhook:empty{ margin:0; }
body[data-skin="astra"] .as-reflectslot{ margin-top:22px; }
body[data-skin="astra"] .as-todayhook{ margin-top:18px; }

/* frosted Chat Now bar — the signature Astra CTA, pinned just ABOVE the global
   tab bar (which stays as app-wide nav; the bar is the feature action). */
body[data-skin="astra"] .as-footer{
  position:fixed; bottom:69px; left:0; right:0; height:70px;
  background:var(--as-bar-bg); border-top:1px solid var(--as-bar-top);
  backdrop-filter:blur(18px) saturate(140%); -webkit-backdrop-filter:blur(18px) saturate(140%);
  display:flex; align-items:center; justify-content:center; gap:9px;
  z-index:55; cursor:pointer;   /* below the z:60 tab bar, above content */
}
body[data-skin="astra"] .as-footer svg{ width:19px; height:19px; }
body[data-skin="astra"] .as-footer span{ color:var(--as-cream); font-size:var(--as-t-bar); font-weight:500; }
/* on desktop the tab bar becomes a full-height LEFT sidebar — the bar returns to
   the bottom of the centred reading column. */
@media(min-width:1024px){
  body[data-skin="astra"] .as-footer{ bottom:0; left:var(--sidebar-w,254px); right:0; }
}

/* ==========================================================================
   READING PLATE  (renderReadingAstra / openSectionAstra)
   The canonical /api/reading SSE rendered by the real md() into the Astra
   language: "Your Reading / <title>" serif header, placement chips, the
   essence verdict lifted into the butter note, serif body on navy with gold
   section titles (md() # → H2, ## → H3), md() '---' → <hr> styled as a gold
   hairline. "Read Again" + "Ask Rishi" footer. Reuses the Today note classes
   (.as-note-wrap/.as-note/.as-quote/.as-seclabel) verbatim.
   ========================================================================== */
body[data-skin="astra"] .as-reading-page{
  padding:60px 28px 134px; min-height:100%;   /* clears the two-button footer */
  font-family:var(--as-sans); color:var(--as-cream);
}

/* top nav row: back + share */
body[data-skin="astra"] .as-rnav{ display:flex; align-items:center; justify-content:space-between; }
body[data-skin="astra"] .as-rback,
body[data-skin="astra"] .as-rshare{
  background:none; border:0; padding:0; cursor:pointer; display:flex;
  transition:opacity .15s ease;
}
body[data-skin="astra"] .as-rback:active,
body[data-skin="astra"] .as-rshare:active{ opacity:.5; }
body[data-skin="astra"] .as-rback svg{ width:26px; height:26px; }
body[data-skin="astra"] .as-rshare svg{ width:22px; height:22px; }

/* reading header: gold eyebrow + serif title (centred) */
body[data-skin="astra"] .as-reyebrow{
  text-align:center; color:var(--as-gold); font-size:var(--as-t-greet);
  font-weight:500; letter-spacing:.2px; margin-top:18px;
}
body[data-skin="astra"] .as-rtitle{
  font-family:var(--as-serif); font-weight:500; color:var(--as-cream);
  font-size:var(--as-t-title); line-height:1.1; letter-spacing:.2px;
  text-align:center; margin-top:5px;
}

/* placement chips (Sun / Moon / Rising from S.chart) */
body[data-skin="astra"] .as-placements{
  display:flex; flex-wrap:wrap; justify-content:center; gap:8px; margin-top:16px;
}
body[data-skin="astra"] .as-pchip{
  background:var(--as-chip); border:1px solid var(--as-hair); border-radius:12px;
  padding:7px 12px; color:var(--as-white); font-size:12px; font-weight:500; box-shadow:var(--as-e-chip);
}
body[data-skin="astra"] .as-pchip b{ color:var(--as-gold); font-weight:600; }

/* centred divider above the essence note */
body[data-skin="astra"] .as-rdivider{ height:1px; width:46px; background:var(--as-divider); margin:28px auto 0; }

/* ---- reading body (serif on navy) ---- */
body[data-skin="astra"] .as-reading{ margin-top:28px; }
body[data-skin="astra"] .as-reading h2{
  font-family:var(--as-serif); font-weight:600; color:var(--as-cream);
  font-size:23px; line-height:1.2; margin:28px 0 12px;
}
body[data-skin="astra"] .as-reading h2:first-child{ margin-top:0; }
body[data-skin="astra"] .as-reading h3{
  font-family:var(--as-serif); font-weight:600; color:var(--as-gold-soft);
  font-size:17px; margin:20px 0 8px; letter-spacing:.2px;
}
body[data-skin="astra"] .as-reading h4{
  font-family:var(--as-serif); font-weight:600; color:var(--as-gold-soft);
  font-size:15px; margin:16px 0 6px; letter-spacing:.2px;
}
body[data-skin="astra"] .as-reading h5{
  font-family:var(--as-serif); font-weight:600; color:#e4ddcf;
  font-size:13px; margin:14px 0 5px; letter-spacing:.4px; text-transform:uppercase;
}
body[data-skin="astra"] .as-reading p{
  font-family:var(--as-serif); color:#e4ddcf; font-size:17.5px; line-height:1.56; margin:12px 0;
}
body[data-skin="astra"] .as-reading ul,
body[data-skin="astra"] .as-reading ol{ margin:10px 0; padding:0; }
body[data-skin="astra"] .as-reading li{
  font-family:var(--as-serif); color:#dcd5c7; font-size:16.5px; line-height:1.5;
  margin:7px 0 7px 4px; padding-left:18px; position:relative; list-style:none;
}
body[data-skin="astra"] .as-reading li:before{
  content:''; position:absolute; left:0; top:11px; width:5px; height:5px;
  border-radius:50%; background:var(--as-gold);
}
body[data-skin="astra"] .as-reading ol{ counter-reset:as-oli; }
body[data-skin="astra"] .as-reading ol li{ counter-increment:as-oli; }
body[data-skin="astra"] .as-reading ol li:before{
  content:counter(as-oli); top:0; width:auto; height:auto; border-radius:0;
  background:none; color:var(--as-gold); font-family:var(--as-sans);
  font-size:12px; font-weight:600; line-height:1.5;
}
body[data-skin="astra"] .as-reading strong{ color:var(--as-cream); font-weight:600; }
body[data-skin="astra"] .as-reading em{ color:#efe7d6; }
/* md() '---' horizontal rule → a gold hairline (not literal text) */
body[data-skin="astra"] .as-reading hr{
  border:0; height:1px; background:var(--as-divider); margin:22px 0;
}
/* any pullquote the md() emits inside the body (the lead one is lifted to the
   note by splitEssenceAstra; this styles any that remain) → legible on navy */
body[data-skin="astra"] .as-reading .pullquote{
  font-family:var(--as-serif); font-style:italic; color:var(--as-cream);
  font-size:21px; line-height:1.44; border-left:2.5px solid var(--as-gold);
  padding:4px 0 4px 18px; margin:6px 0 22px;
}
/* the streaming cursor inside the body */
body[data-skin="astra"] .as-reading .cursor{
  display:inline-block; width:2px; height:1em; vertical-align:-2px;
  background:var(--as-cream); opacity:.55; margin-left:2px;
}

/* two-button footer: Read Again + Ask Rishi (replaces Today's Chat Now bar) */
body[data-skin="astra"] .as-rfooter{
  position:fixed; bottom:69px; left:0; right:0; height:84px;
  background:var(--as-bar-bg); border-top:1px solid var(--as-bar-top);
  backdrop-filter:blur(18px) saturate(140%); -webkit-backdrop-filter:blur(18px) saturate(140%);
  display:flex; align-items:center; justify-content:center; gap:10px; padding:0 24px 18px;
  z-index:55;   /* below z:60 tab bar, above content */
}
body[data-skin="astra"] .as-foot-btn{
  flex:1; display:flex; align-items:center; justify-content:center; gap:8px;
  border-radius:24px; padding:14px; cursor:pointer; font-size:13.5px; font-weight:600;
  font-family:var(--as-sans); border:1px solid var(--as-gold-line);
  background:var(--as-gold-wash); color:var(--as-cream);
  transition:transform .14s ease;
}
body[data-skin="astra"] .as-foot-btn:active{ transform:scale(.985); }
body[data-skin="astra"] .as-foot-btn svg{ width:16px; height:16px; }
body[data-skin="astra"] .as-foot-btn.ask{ background:var(--as-yellow); color:var(--as-yellow-text); border-color:transparent; }
@media(min-width:1024px){
  body[data-skin="astra"] .as-rfooter{ bottom:0; left:var(--sidebar-w,254px); right:0; }
}

/* ---- reading → chat SEED: the per-section open-loop hook card (SECTION_HOOK),
   restored in Astra (the reading port had dropped it). Clicking seeds the
   chart-specific thread into chat via goChatAstra → sendChat. ---- */
body[data-skin="astra"] .as-askhook{
  display:block; width:100%; text-align:left; cursor:pointer;
  margin:30px 0 2px; padding:17px 18px 16px;
  background:var(--as-gold-wash); border:1px solid var(--as-gold-line);
  border-radius:18px; font-family:var(--as-sans);
  transition:transform .14s ease;
}
body[data-skin="astra"] .as-askhook:active{ transform:scale(.99); }
body[data-skin="astra"] .as-askhook-label{
  color:var(--as-gold); font-size:11.5px; font-weight:600;
  letter-spacing:var(--as-tr-label); text-transform:none;
}
body[data-skin="astra"] .as-askhook-line{
  font-family:var(--as-serif); color:var(--as-cream);
  font-size:17.5px; line-height:1.48; margin:8px 0 0;
}
body[data-skin="astra"] .as-askhook-cta{
  display:flex; align-items:center; gap:6px; margin-top:12px;
  color:var(--as-gold); font-size:13px; font-weight:600;
}
body[data-skin="astra"] .as-askhook-cta svg{ width:15px; height:15px; }

/* ==========================================================================
   THE ORACLE  (renderChatAstra + the shared #chatbar composer, reskinned)
   The canonical /api/chat engine (sendChat/sse/S.chat/distill/mic/followups)
   is untouched — only the surface is Astra: "The Oracle · Rishi reading your
   chart" header, dark pill user bubbles, serif reply cards on navy (md() gold
   # → h3-weight / ## → h3), a cold-start lead + real-QLIB suggested chips with
   gold send-rings, and the frosted navy composer with a butter send-ring.
   ========================================================================== */

/* Oracle header (avatar + name + subline) — sticks to the top of the scroll */
body[data-skin="astra"] .as-chat-head{
  position:sticky; top:0; z-index:25;
  display:flex; align-items:center; gap:13px; padding:60px 26px 16px;
  background:linear-gradient(180deg,var(--as-bg-top) 72%,rgba(44,49,64,.72));
  backdrop-filter:blur(8px); -webkit-backdrop-filter:blur(8px);
}
body[data-skin="astra"] .as-chat-ava{
  width:40px; height:40px; border-radius:50%; flex:0 0 auto;
  background:var(--as-gold-wash); border:1px solid var(--as-gold-line);
  display:flex; align-items:center; justify-content:center;
}
body[data-skin="astra"] .as-chat-ava svg{ width:22px; height:22px; }
body[data-skin="astra"] .as-chat-who .n{
  font-family:var(--as-serif); font-size:21px; font-weight:500;
  color:var(--as-cream); line-height:1;
}
body[data-skin="astra"] .as-chat-who .s{
  font-size:11px; color:var(--as-gold); letter-spacing:.3px; margin-top:3px;
}

/* the message log column (below the sticky header) */
body[data-skin="astra"] .as-chat-scroll{
  padding:10px 24px 20px;
}

/* cold-start empty state */
body[data-skin="astra"] .as-cold{ text-align:center; padding-top:10px; }
body[data-skin="astra"] .as-cold-lead{
  font-family:var(--as-serif); font-size:24px; color:var(--as-cream); line-height:1.22;
}
body[data-skin="astra"] .as-cold-sub{
  color:var(--as-subtitle); font-size:var(--as-t-sub); line-height:1.55;
  margin-top:12px; padding:0 10px;
}
body[data-skin="astra"] .as-cold-div{ height:1px; width:46px; background:var(--as-divider); margin:26px auto 0; }
/* the cold state disappears the moment a message exists, without forking sendChat */
body[data-skin="astra"] .as-chat-scroll:has(#chatlog:not(:empty)) .as-cold{ display:none; }

body[data-skin="astra"] .as-cold-chips{
  margin-top:18px; display:flex; flex-direction:column; gap:13px;
}
/* suggested-question chip with a gold send-ring (shared .as-chip look + layout) */
body[data-skin="astra"] .as-cold-chips .as-chip{
  display:flex; align-items:center; justify-content:space-between; width:100%; text-align:left;
  background:var(--as-chip); border:1px solid var(--as-hair); border-radius:var(--as-r-chip);
  padding:14px 14px 14px 18px; cursor:pointer; box-shadow:var(--as-e-chip);
  transition:transform .14s ease;
}
body[data-skin="astra"] .as-cold-chips .as-chip:active{ transform:scale(.985); }
body[data-skin="astra"] .as-cold-chips .as-cq{
  color:var(--as-white); font-size:var(--as-t-chip); font-weight:400; line-height:1.3;
}
body[data-skin="astra"] .as-cold-chips .as-send{
  flex:0 0 auto; width:34px; height:34px; border-radius:50%; margin-left:10px;
  background:var(--as-gold-wash); border:1px solid var(--as-gold-line);
  display:flex; align-items:center; justify-content:center;
}
body[data-skin="astra"] .as-cold-chips .as-send svg{ width:15px; height:15px; }

/* ---- message bubbles (ids/classes sendChat() emits: .msg-u / .msg-a / .reading) ---- */
body[data-skin="astra"] #chatlog .msg-u{
  max-width:80%; margin:16px 0 16px auto; background:var(--as-chip);
  border:1px solid var(--as-hair); border-radius:18px 18px 6px 18px; padding:12px 15px;
  color:var(--as-white); font-size:14.5px; line-height:1.45; box-shadow:var(--as-e-chip);
  width:fit-content;
}
body[data-skin="astra"] #chatlog .msg-a{ margin:16px 2px 20px; }
body[data-skin="astra"] #chatlog .msg-a .reading{
  font-family:var(--as-serif); color:#e4ddcf; font-size:17px; line-height:1.5;
}
body[data-skin="astra"] #chatlog .msg-a .reading p{ margin:10px 0; }
body[data-skin="astra"] #chatlog .msg-a .reading p:first-child{ margin-top:0; }
body[data-skin="astra"] #chatlog .msg-a .reading strong{ color:var(--as-cream); font-weight:600; }
body[data-skin="astra"] #chatlog .msg-a .reading em{ color:#efe7d6; }
/* md() gold headers: # → h2, ## → h3 — both in the Astra serif/gold language */
body[data-skin="astra"] #chatlog .msg-a .reading h2{
  font-family:var(--as-serif); color:var(--as-cream); font-size:20px; margin:18px 0 6px;
}
body[data-skin="astra"] #chatlog .msg-a .reading h3{
  font-family:var(--as-serif); color:var(--as-gold-soft); font-size:17px; margin:16px 0 6px;
}
body[data-skin="astra"] #chatlog .msg-a .reading li{
  list-style:none; position:relative; padding-left:16px; margin:6px 0;
  font-family:var(--as-serif); color:#dcd5c7; font-size:16px; line-height:1.5;
}
body[data-skin="astra"] #chatlog .msg-a .reading li:before{
  content:''; position:absolute; left:0; top:10px; width:4px; height:4px; border-radius:50%; background:var(--as-gold);
}
body[data-skin="astra"] #chatlog .msg-a .reading hr{
  border:0; height:1px; background:var(--as-divider); margin:18px 0;
}
body[data-skin="astra"] #chatlog .msg-a .reading .pullquote{
  font-family:var(--as-serif); font-style:italic; color:var(--as-cream);
  font-size:19px; line-height:1.44; border-left:2.5px solid var(--as-gold);
  padding:2px 0 2px 16px; margin:6px 0 16px;
}
/* no Atelier ✦ pre-mark on reply cards in Astra */
body[data-skin="astra"] #chatlog .msg-a > .reading::before{ content:none; }
/* streaming cursor */
body[data-skin="astra"] #chatlog .cursor{
  display:inline-block; width:2px; height:1em; vertical-align:-2px;
  background:var(--as-gold); opacity:.6; margin-left:2px;
}

/* ---- thinking bubble (SK.thinking() → .thinkbub) reskinned to the navy card ---- */
body[data-skin="astra"] #chatlog .thinkbub{
  background:var(--as-chip); border:1px solid var(--as-hair); box-shadow:var(--as-e-chip);
  border-radius:20px 20px 20px 6px;
}
body[data-skin="astra"] #chatlog .thinkbub i{ background:var(--as-gold); }

/* ---- follow-up chips after an answer (showFollowups → .followups/.fuchip) ---- */
body[data-skin="astra"] #chatlog .followups{ display:flex; flex-wrap:wrap; gap:8px; margin-top:12px; }
body[data-skin="astra"] #chatlog .followups .fumicro{
  width:100%; color:var(--as-gold); font-size:11.5px; font-weight:600;
  letter-spacing:var(--as-tr-label); margin-bottom:2px;
}
body[data-skin="astra"] #chatlog .followups .fuchip{
  background:var(--as-gold-wash); border:1px solid var(--as-gold-line); border-radius:14px;
  padding:8px 13px; color:var(--as-cream); font-size:12.5px; cursor:pointer;
  font-family:var(--as-sans);
}

/* ---- the shared #chatbar composer, reskinned to the frosted navy bar.
   Same element/ids the engine owns (#chatinput/#chatchips/#micbtn/#sendbtn);
   only its paint + position change under Astra. ---- */
body[data-skin="astra"] #chatbar{
  bottom:69px;   /* ride above the Astra tab bar (matches .as-footer/.as-rfooter) */
  background:var(--as-bar-bg); border-top:1px solid var(--as-bar-top);
  backdrop-filter:blur(18px) saturate(140%); -webkit-backdrop-filter:blur(18px) saturate(140%);
  padding-top:10px;
}
body[data-skin="astra"] #chatbar .inputrow{ padding:6px 18px 16px; gap:11px; align-items:center; }
body[data-skin="astra"] #chatbar textarea{
  background:var(--as-field); border:1px solid var(--as-outline); border-radius:22px;
  color:var(--as-cream); font-family:var(--as-sans); font-size:16px; line-height:1.4;
}
body[data-skin="astra"] #chatbar textarea::placeholder{ color:#8f929c; }
body[data-skin="astra"] #chatbar textarea:focus{ border-color:var(--as-gold-line); outline:none; }
/* hide the canonical #chatchips rail in Astra (cold chips live in the log) */
body[data-skin="astra"] #chatbar #chatchips{ display:none; }
/* butter send-ring */
body[data-skin="astra"] #chatbar #sendbtn{
  background:var(--as-yellow); border:0; box-shadow:0 6px 16px rgba(0,0,0,.26);
}
body[data-skin="astra"] #chatbar #sendbtn svg{ fill:var(--as-yellow-text); }
/* mic ring in the Astra language */
body[data-skin="astra"] #chatbar #micbtn{
  background:var(--as-gold-wash); border:1px solid var(--as-gold-line);
}
body[data-skin="astra"] #chatbar #micbtn svg{ stroke:var(--as-gold); fill:none; }

@media(min-width:1024px){
  body[data-skin="astra"] #chatbar{ bottom:0; left:var(--sidebar-w,254px); right:0; }
}

/* ==========================================================================
   GLOBAL TAB BAR  (the #tabbar bottom nav / desktop rail, reskinned to Astra)
   The Atelier base styles #tabbar as a cream frosted bar with ink glyphs +
   a dark orb — visibly wrong on the navy Astra world. Here we repaint ONLY the
   SKIN (ground, glyphs, labels, active state, the Oracle orb) to the navy /
   butter-gold language. Structure, flex layout, positions, the 5 tabs and all
   handlers are untouched — this is colour/finish only, scoped to [data-skin=
   "astra"] so the Atelier tab bar is never affected.
   ========================================================================== */

/* --- bottom bar ground: dark navy, butter hairline, cool shadow --- */
body[data-skin="astra"] #tabbar{
  background:linear-gradient(180deg, rgba(34,38,50,.80), rgba(26,29,39,.86));
  backdrop-filter:blur(24px) saturate(140%);
  -webkit-backdrop-filter:blur(24px) saturate(140%);
  border-top:1px solid var(--as-gold-line);
  box-shadow:0 -0.5px 0 rgba(205,191,147,.18),
             0 1px 0 rgba(255,255,255,.04) inset,
             0 -18px 40px -24px rgba(0,0,0,.55);
}

/* --- inactive glyph + label: muted cream/gold --- */
body[data-skin="astra"] #tabbar .tab{
  color:var(--as-subtitle);
  font-family:var(--as-sans);
}
/* --- active tab: gold --- */
body[data-skin="astra"] #tabbar .tab.active{
  color:var(--as-gold);
}

/* --- centre Oracle orb: navy fill, gold ring + pulse, butter glyph --- */
body[data-skin="astra"] #tabbar .tab.center .orb{
  background:radial-gradient(120% 120% at 50% 20%, #343a4c 0%, #23283a 100%);
  border:1px solid var(--as-gold-line);
  box-shadow:0 6px 22px rgba(0,0,0,.45), 0 0 0 1px rgba(205,191,147,.10) inset;
}
body[data-skin="astra"] #tabbar .tab.center .orb::before{
  border-color:var(--as-gold-line);
}
body[data-skin="astra"] #tabbar .tab.center .orb svg{
  fill:var(--as-yellow);
}

/* --- desktop left rail variant (>=1024px): mirror the Atelier rail chips --- */
@media(min-width:1024px){
  body[data-skin="astra"] #tabbar{
    border-top:0; border-right:1px solid var(--as-gold-line);
  }
  /* NOTE: the rail logo (#tabbar::before) is a gold-stroke Rishi wordmark SVG
     that already reads on navy — left untouched so the mark is never clobbered. */
  body[data-skin="astra"] #tabbar .tab:hover{
    background:rgba(205,191,147,.06); color:var(--as-cream);
  }
  body[data-skin="astra"] #tabbar .tab.active{
    color:var(--as-gold); background:rgba(205,191,147,.10);
    box-shadow:none;
  }
  /* active-rail accent bar → gold */
  body[data-skin="astra"] #tabbar .tab.active::before{
    background:var(--as-gold);
  }
  body[data-skin="astra"] #tabbar .tab.center .orb svg{ fill:var(--as-yellow); }
  /* "The Oracle" rail caption on navy */
  body[data-skin="astra"] #tabbar .tab.center::after{ color:var(--as-subtitle); }
  body[data-skin="astra"] #tabbar .tab.center.active::after{ color:var(--as-gold); }
}

/* ============================================================
   MONETIZATION — paywall sheet, free ribbon, teaser/scope wall
   All scoped under body[data-skin="astra"] (navy ground, cream
   serif, soft-gold accents). Mirrors the Atelier structure. */

/* free-question ribbon */
body[data-skin="astra"] .as-freeribbon{
  margin:4px 20px 2px; padding:9px 14px; text-align:center;
  border:1px solid var(--as-gold-line); border-radius:14px;
  background:var(--as-gold-wash); color:var(--as-cream);
  font:500 13px var(--as-sans); letter-spacing:.01em;
}
body[data-skin="astra"] .as-freeribbon a{ color:var(--as-gold); text-decoration:none; border-bottom:1px solid var(--as-divider); }

/* teaser + scope wall cards (reuse .teaser-* from base, restyle for navy) */
body[data-skin="astra"] .teaser-card{
  background:var(--as-field); border:1px solid var(--as-outline);
  border-radius:20px; padding:20px 18px; margin:4px 20px 0;
  position:relative; overflow:hidden; backdrop-filter:blur(6px);
}
body[data-skin="astra"] .teaser-card .tctitle{ color:var(--as-cream); font:600 13px var(--as-sans); letter-spacing:.04em; }
body[data-skin="astra"] .teaser-card .tcicon{ color:var(--as-gold); }
body[data-skin="astra"] .teaser-line{ color:var(--as-cream); font-family:var(--as-serif); font-size:21px; line-height:1.4; }
body[data-skin="astra"] .teaser-fade{ color:var(--as-subtitle); }
body[data-skin="astra"] .teaser-cta{
  background:var(--as-gold); color:#2a2a1f; border:none; border-radius:14px;
  padding:14px; width:100%; font:600 15px var(--as-sans);
}
body[data-skin="astra"] .teaser-sub{ color:var(--as-subtitle); }

/* paywall SHEET */
body[data-skin="astra"] .pw-sheet{
  background:linear-gradient(180deg,#2c3140,#363b4a);
  border-top:1px solid var(--as-gold-line);
}
body[data-skin="astra"] .pw-grab{ background:rgba(243,236,223,.28); }
body[data-skin="astra"] .pw-eyebrow{ color:var(--as-gold); }
body[data-skin="astra"] .pw-title{ color:var(--as-cream); font-family:var(--as-serif); }
body[data-skin="astra"] .pw-sub{ color:var(--as-subtitle); }
body[data-skin="astra"] .pw-list li{ color:var(--as-cream); }
body[data-skin="astra"] .pw-tick{ color:var(--as-gold); }
body[data-skin="astra"] .pw-plan{ border:1px solid var(--as-outline); background:rgba(255,255,255,.04); }
body[data-skin="astra"] .pw-plan-best{ border-color:var(--as-gold-line); background:var(--as-gold-wash); }
body[data-skin="astra"] .pw-plan-l{ color:var(--as-cream); }
body[data-skin="astra"] .pw-plan-note{ color:var(--as-gold); }
body[data-skin="astra"] .pw-plan-r{ color:var(--as-cream); font-family:var(--as-serif); }
body[data-skin="astra"] .pw-plan-per{ color:var(--as-subtitle); }
body[data-skin="astra"] .pw-fine{ color:var(--as-subtitle); }
body[data-skin="astra"] .pw-later{ color:var(--as-subtitle); }
body[data-skin="astra"] .pw-mark svg{ stroke:var(--as-gold); }

/* paywallCard (inkpanel) restyle on navy for the out-of-questions chat state */
body[data-skin="astra"] .paywall.inkpanel{
  background:var(--as-field); border:1px solid var(--as-outline); border-radius:20px;
}
body[data-skin="astra"] .paywall .serif{ color:var(--as-cream); font-family:var(--as-serif); }
body[data-skin="astra"] .paywall p{ color:var(--as-subtitle); }
body[data-skin="astra"] .paywall .btn-ink{ background:var(--as-gold); color:#2a2a1f; }

/* Astra free day-wall: shown under the one-line butter note for free users */
body[data-skin="astra"] .as-daywall{ margin:14px 20px 2px; text-align:center; }
body[data-skin="astra"] .as-daywall-fade{
  color:var(--as-subtitle); font:500 14px/1.6 var(--as-sans);
  filter:blur(3px); opacity:.55; margin-bottom:14px; user-select:none;
  -webkit-mask-image:linear-gradient(180deg,#000 10%,transparent 100%);
  mask-image:linear-gradient(180deg,#000 10%,transparent 100%);
}
body[data-skin="astra"] .as-daywall .teaser-cta{
  background:var(--as-gold); color:#2a2a1f; border:none; border-radius:14px;
  padding:14px; width:100%; font:600 15px var(--as-sans);
}
body[data-skin="astra"] .as-daywall .teaser-sub{ color:var(--as-subtitle); margin-top:10px; font:500 12.5px var(--as-sans); }
