/* Living Texts — scripture pages. Layers on top of style.css (dark indigo +
   gold accent system already defined there). Scoped to .text-* classes so it
   can't bleed into the rest of the site. */

/* [hidden] must win over our display:flex/grid rules (gate, chat, canvas view,
   personalise badge all toggle via the hidden attribute). */
.text-node [hidden], .text-work [hidden], .texts-hub [hidden] { display: none !important; }

.texts-hub .lede,
.text-work .lede { max-width: 60ch; }

.text-meta {
  display: block;
  margin-top: .4rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: .78rem;
  letter-spacing: .03em;
  opacity: .6;
}

/* ── Work index (list of sutras) ─────────────────────────────────────────── */
.text-index { display: flex; flex-direction: column; gap: 2px; margin-top: 1.5rem; }

.text-sec-label {
  margin: 1.6rem 0 .6rem;
  font-family: 'Space Grotesk', sans-serif;
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .14em;
  color: #c9a84c;
  opacity: .85;
}

.text-row {
  display: grid;
  grid-template-columns: 3.2rem 1fr;
  align-items: baseline;
  gap: .8rem;
  padding: .7rem .9rem;
  border-radius: 10px;
  text-decoration: none;
  color: inherit;
  border: 1px solid transparent;
  transition: background .18s ease, border-color .18s ease;
}
.text-row:hover { background: rgba(201,168,76,.06); border-color: rgba(201,168,76,.2); }
.text-row-ref { font-family: 'JetBrains Mono', monospace; font-size: .85rem; color: #c9a84c; }
.text-row-sa {
  font-family: serif;
  font-size: 1.05rem;
  opacity: .9;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Single verse page ───────────────────────────────────────────────────── */
.text-node article { max-width: 64ch; }

.text-node-head { margin-bottom: 1.4rem; }

/* #2 — the sutra card carries ritual weight: a gold gradient border (via a
   masked pseudo-element) and a slow breathing glow. */
.text-sanskrit {
  position: relative;
  font-family: serif;
  font-size: clamp(1.5rem, 4vw, 2.1rem);
  line-height: 1.85;
  color: #f3ead0;
  padding: 2rem;
  margin: 1.2rem 0 2rem;
  border-radius: 16px;
  background: radial-gradient(120% 120% at 50% 0%, rgba(201,168,76,.12), rgba(8,8,18,.45));
  text-align: center;
  isolation: isolate;
  animation: sutraBreathe 6s ease-in-out infinite;
}
.text-sanskrit::before {
  content: ""; position: absolute; inset: 0; border-radius: 16px; padding: 1px;
  background: linear-gradient(135deg, rgba(231,199,90,.9), rgba(201,168,76,.15) 45%, rgba(231,199,90,.7));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  pointer-events: none;
}
@keyframes sutraBreathe {
  0%,100% { box-shadow: 0 0 24px -8px rgba(201,168,76,.25); }
  50%     { box-shadow: 0 0 46px 2px rgba(201,168,76,.20); }
}
@media (prefers-reduced-motion: reduce) {
  .text-sanskrit { animation: none; }
}

.text-controls {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  flex-wrap: wrap;
  margin-bottom: 1.2rem;
}
.text-lang {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-size: .8rem;
  letter-spacing: .03em;
  opacity: .8;
}
.text-lang select {
  font: inherit;
  font-size: .85rem;
  color: #f3ead0;
  background: rgba(8,8,18,.6);
  border: 1px solid rgba(201,168,76,.25);
  border-radius: 8px;
  padding: .35rem .6rem;
  cursor: pointer;
}
.text-lang select:focus { outline: none; border-color: #c9a84c; }

.text-personalise {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-size: .8rem;
  letter-spacing: .03em;
  color: #c9a84c;
}
.text-personalise .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: #c9a84c; box-shadow: 0 0 8px #c9a84c;
}

.text-reading { min-height: 2rem; line-height: 1.78; }
.text-reading h2 { font-size: 1.3rem; margin: 1.6rem 0 .5rem; }
.text-reading h3 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: .82rem;
  text-transform: uppercase;
  letter-spacing: .14em;
  color: #c9a84c;
  margin: 1.7rem 0 .55rem;
}
.text-reading p { margin: 0 0 1rem; opacity: .92; }

.text-reveal {
  display: inline-block;
  padding: .8rem 1.6rem;
  font: inherit;
  font-size: .95rem;
  color: #0a0a14;
  background: linear-gradient(120deg, #e7c75a, #c9a84c);
  border: none;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 0 0 rgba(201,168,76,.5);
  animation: textRevealPulse 2.6s ease-in-out infinite;
}
.text-reveal:disabled { opacity: .6; cursor: default; animation: none; }
@keyframes textRevealPulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(201,168,76,.35); }
  50%     { box-shadow: 0 0 22px 4px rgba(201,168,76,.18); }
}

.text-loading { display: inline-flex; gap: .5rem; align-items: center; opacity: .7; font-size: .9rem; }
.text-loading::before {
  content: ""; width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid rgba(201,168,76,.3); border-top-color: #c9a84c;
  animation: textSpin .8s linear infinite;
}
@keyframes textSpin { to { transform: rotate(360deg); } }

.text-disclaimer {
  margin-top: 2rem; padding-top: 1.2rem;
  border-top: 1px solid rgba(255,255,255,.08);
  font-size: .82rem; opacity: .55; line-height: 1.6;
}

.text-cta {
  margin: 2rem 0 1rem; padding: 1.4rem;
  border-radius: 14px;
  background: rgba(201,168,76,.06);
  border: 1px solid rgba(201,168,76,.18);
}
.text-cta .pill-cta {
  display: inline-block; padding: .7rem 1.4rem;
  border-radius: 999px; text-decoration: none;
  color: #0a0a14; font-weight: 600;
  background: linear-gradient(120deg, #e7c75a, #c9a84c);
}
.text-cta-note { display: block; margin-top: .7rem; font-size: .82rem; opacity: .7; }

.text-nav {
  display: flex; justify-content: space-between;
  margin-top: 2.4rem; padding-top: 1.2rem;
  border-top: 1px solid rgba(255,255,255,.08);
  font-family: 'JetBrains Mono', monospace; font-size: .9rem;
}
.text-nav a { color: #c9a84c; text-decoration: none; }
.text-nav a:hover { text-decoration: underline; }

/* ── View toggle (Read ⇄ Canvas) ─────────────────────────────────────────── */
.text-view-toggle {
  display: inline-flex; margin-left: auto;
  border: 1px solid rgba(201,168,76,.25); border-radius: 999px; overflow: hidden;
}
.text-view-toggle button {
  font: inherit; font-size: .8rem; padding: .35rem .9rem;
  background: transparent; color: #f3ead0; border: none; cursor: pointer;
}
.text-view-toggle button.active { background: rgba(201,168,76,.85); color: #0a0a14; font-weight: 600; }

/* ── Share (verse → image card) ───────────────────────────────────────────── */
.text-share-btn {
  font: inherit; font-size: .8rem; letter-spacing: .02em;
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .35rem .9rem; border-radius: 999px; cursor: pointer;
  color: #0a0a14; font-weight: 600;
  background: rgba(201,168,76,.85);
  border: 1px solid rgba(201,168,76,.55);
}
.text-share-btn:hover { background: #d8bd68; }
.text-share-btn[disabled] { opacity: .55; cursor: progress; }
.text-share-btn span { font-size: .95rem; line-height: 1; }
.text-reel-btn {
  background: transparent; color: #e2c079; font-weight: 500;
  border: 1px solid rgba(201,168,76,.5);
}
.text-reel-btn:hover { background: rgba(201,168,76,.14); }
.text-reel-btn span { font-size: .7rem; }

.ee-toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%);
  z-index: 9999; max-width: 88vw;
  background: rgba(10,10,20,.94); color: #f3ead0;
  border: 1px solid rgba(201,168,76,.4); border-radius: 12px;
  padding: .7rem 1.1rem; font-size: .85rem; letter-spacing: .02em;
  box-shadow: 0 8px 30px rgba(0,0,0,.5);
  opacity: 0; transition: opacity .25s ease;
}
.ee-toast.show { opacity: 1; }

/* ── Share preview modal ──────────────────────────────────────────────────── */
.ee-share-overlay {
  position: fixed; inset: 0; z-index: 10000;
  display: flex; align-items: center; justify-content: center;
  background: rgba(2,2,8,.82); padding: 4vh 4vw;
  opacity: 0; transition: opacity .25s ease;
}
.ee-share-overlay.show { opacity: 1; }
.ee-share-modal {
  position: relative; display: flex; flex-direction: column; align-items: center;
  gap: 1rem; max-width: 100%;
}
.ee-share-media {
  max-height: 74vh; max-width: 100%; width: auto;
  border-radius: 14px; border: 1px solid rgba(201,168,76,.35);
  box-shadow: 0 12px 50px rgba(0,0,0,.6);
}
.ee-share-x {
  position: absolute; top: -14px; right: -14px;
  width: 36px; height: 36px; border-radius: 999px; cursor: pointer;
  background: rgba(10,10,20,.95); color: #f3ead0;
  border: 1px solid rgba(201,168,76,.4); font-size: 1.3rem; line-height: 1;
}
.ee-share-actions { display: flex; gap: .6rem; flex-wrap: wrap; justify-content: center; }
.ee-share-act {
  font: inherit; font-size: .85rem; font-weight: 600; cursor: pointer;
  padding: .55rem 1.3rem; border-radius: 999px;
  color: #0a0a14; background: rgba(201,168,76,.9); border: 1px solid rgba(201,168,76,.6);
}
.ee-share-act:hover { background: #d8bd68; }
.ee-share-act.ghost { background: transparent; color: #e2c079; }
.ee-share-act.ghost:hover { background: rgba(201,168,76,.14); }

/* ── Canvas (Living Mandala) ──────────────────────────────────────────────── */
#text-canvas-view { position: relative; }
.text-canvas-stage {
  position: relative;
  height: min(70vh, 620px);
  margin-top: 1rem;
  border-radius: 16px;
  background:
    radial-gradient(80% 80% at 50% 45%, rgba(201,168,76,.06), rgba(4,4,7,0)),
    rgba(8,8,18,.45);
  border: 1px solid rgba(201,168,76,.18);
  overflow: hidden;
  cursor: grab;
  touch-action: none;
}
.text-canvas-stage.grabbing { cursor: grabbing; }
#canvas-svg { width: 100%; height: 100%; display: block; }
.text-canvas-hint {
  position: absolute; bottom: 10px; left: 0; right: 0; text-align: center;
  font-size: .72rem; opacity: .4; pointer-events: none; letter-spacing: .04em;
}

.cv-node { cursor: pointer; outline: none; }
.cv-node circle {
  fill: rgba(14,14,28,.92);
  stroke: rgba(201,168,76,.45);
  stroke-width: 1.4;
  transition: stroke .15s ease, fill .15s ease;
}
.cv-node text {
  fill: #e9dcb6; font-family: 'Space Grotesk', sans-serif; font-size: 13px;
  pointer-events: none;
}
.cv-node:hover circle, .cv-node:focus circle { stroke: #e7c75a; fill: rgba(28,24,12,.95); }
.cv-center circle {
  fill: radial-gradient(#1a1606, #0a0a14);
  fill: rgba(24,20,8,.96);
  stroke: #c9a84c; stroke-width: 2.2;
}
.cv-center-ref { font-family: 'JetBrains Mono', monospace; font-size: 14px; fill: #f3ead0; }
.cv-center-sa { font-family: serif; font-size: 16px; fill: #c9a84c; }
.cv-soon circle { stroke-dasharray: 4 4; opacity: .65; }
.cv-nav circle { fill: rgba(8,8,18,.7); }
.cv-concept circle { fill: rgba(24,20,8,.9); }
.cv-edge-label {
  fill: #c9a84c; font-family: 'JetBrains Mono', monospace; font-size: 10px;
  opacity: .8; paint-order: stroke; stroke: rgba(4,4,7,.85); stroke-width: 3px;
}
.cv-mode-btn {
  position: absolute; top: 10px; right: 12px; z-index: 2;
  font: inherit; font-size: .76rem; padding: .35rem .8rem;
  color: #f3ead0; background: rgba(8,8,18,.8);
  border: 1px solid rgba(201,168,76,.3); border-radius: 999px; cursor: pointer;
}
.cv-mode-btn.active { background: rgba(201,168,76,.85); color: #0a0a14; font-weight: 600; }
.cv-mode-btn:disabled { opacity: .6; cursor: default; }

.text-canvas-panel {
  position: absolute; top: 1rem; right: 1rem; width: min(340px, 80%);
  max-height: calc(100% - 2rem); overflow-y: auto;
  background: rgba(10,10,20,.96); backdrop-filter: blur(6px);
  border: 1px solid rgba(201,168,76,.3); border-radius: 14px;
  padding: 1.2rem 1.3rem; box-shadow: 0 12px 40px rgba(0,0,0,.5);
}
.text-canvas-panel h3 {
  font-family: 'Space Grotesk', sans-serif; font-size: .82rem;
  text-transform: uppercase; letter-spacing: .14em; color: #c9a84c;
  margin: 0 0 .7rem; padding-right: 1.5rem;
}
.text-canvas-panel p { margin: 0 0 .8rem; line-height: 1.7; font-size: .92rem; opacity: .92; }
.text-canvas-panel .cv-sanskrit {
  font-family: serif; font-size: 1.3rem;
  line-height: 1.8; color: #f3ead0; text-align: center;
}
.text-canvas-close {
  position: absolute; top: .6rem; right: .7rem;
  background: none; border: none; color: #c9a84c; font-size: 1.4rem;
  line-height: 1; cursor: pointer; opacity: .7;
}
.text-canvas-close:hover { opacity: 1; }

@media (max-width: 640px) {
  .text-canvas-panel { width: calc(100% - 2rem); top: auto; bottom: 1rem; }
}

/* #6 — ambient yantra: a faint, slowly rotating sacred-geometry layer behind
   the verse. Pure SVG + CSS, fixed and non-interactive, near-zero cost. */
.text-yantra {
  position: fixed; top: 50%; left: 50%;
  width: min(92vmin, 880px); height: min(92vmin, 880px);
  transform: translate(-50%, -50%);
  transform-origin: center;
  pointer-events: none; z-index: 0; opacity: .06;
  color: #c9a84c;
  animation: yantraSpin 240s linear infinite;
}
.text-node main, .text-work main, .texts-hub { position: relative; z-index: 1; }
/* Keep the centring translate inside the keyframe — animating `transform`
   replaces the whole property, so a bare rotate() would drop the translate
   and fling the yantra to the corner. */
@keyframes yantraSpin {
  from { transform: translate(-50%, -50%) rotate(0deg); }
  to   { transform: translate(-50%, -50%) rotate(360deg); }
}
@media (prefers-reduced-motion: reduce) { .text-yantra { animation: none; } }

/* #4 — scroll reveal. SEO-safe: content is visible by default; only when the
   `js-reveal` class is added (by texts.js, i.e. JS present) do items start
   hidden and animate in as they enter the viewport. Googlebot sees full text. */
.js-reveal .text-reveal-item { opacity: 0; transform: translateY(14px); }
.js-reveal .text-reveal-item.shown {
  opacity: 1; transform: none;
  transition: opacity .6s ease, transform .6s ease;
}
@media (prefers-reduced-motion: reduce) {
  .js-reveal .text-reveal-item { opacity: 1; transform: none; transition: none; }
}

/* #3 — sutra timeline rail: a sacred map of the work, current verse lit, the
   rest dimmed. Crawlable internal links. Collapses to a horizontal strip on
   narrow screens. */
.text-node article { position: relative; }
/* Floating sacred map — a vertical page-slider pinned to the left edge.
   One tick per verse on a glowing spine; the current verse is a lit handle;
   section starts are gold dashes (full name in tooltip). Drag the rail to
   scrub through verses (a floating number bubble previews; release to jump).
   It floats over the page (doesn't push the centred article). */
.text-rail {
  position: fixed; top: 50%; left: 16px; transform: translateY(-50%);
  width: 66px; height: 84vh; max-height: 760px; box-sizing: border-box;
  display: flex; flex-direction: column; align-items: center; gap: .55rem;
  padding: 14px 6px; z-index: 3; user-select: none; touch-action: none;
  background: rgba(10,10,20,.5); backdrop-filter: blur(7px);
  border: 1px solid rgba(201,168,76,.14); border-radius: 16px;
}
.rail-head { text-align: center; line-height: 1.05; }
.rail-cur {
  display: block; font-family: 'JetBrains Mono', monospace;
  font-size: .86rem; font-weight: 600; color: #e7c75a;
}
.rail-tot {
  display: block; margin-top: 2px; font-family: 'Space Grotesk', sans-serif;
  font-size: .5rem; letter-spacing: .14em; text-transform: uppercase;
  color: #b8b0a0; opacity: .5;
}
.rail-track {
  position: relative; flex: 1 1 auto; min-height: 0; width: 100%;
  display: flex; flex-direction: column; align-items: center;
  justify-content: space-between; padding: 6px 0; cursor: grab;
}
.text-rail.scrubbing .rail-track { cursor: grabbing; }
.rail-spine {
  position: absolute; top: 6px; bottom: 6px; left: 50%; width: 2px;
  transform: translateX(-50%); border-radius: 2px; pointer-events: none;
  background: linear-gradient(to bottom,
    rgba(201,168,76,.04), rgba(201,168,76,.22), rgba(201,168,76,.04));
}
.rail-dot {
  position: relative; z-index: 1; flex: 1 1 0; min-height: 0; width: 100%;
  display: flex; align-items: center; justify-content: center;
  text-decoration: none; cursor: pointer;
}
.rail-tick {
  width: 6px; height: 6px; border-radius: 50%;
  background: #6f6a5c; opacity: .5;
  transition: transform .15s, background .15s, opacity .15s, box-shadow .15s;
}
.rail-dot:hover .rail-tick,
.rail-dot.hot .rail-tick { opacity: 1; background: #c9a84c; transform: scale(1.7); }
.rail-dot.sec-start .rail-tick {
  width: 11px; height: 2px; border-radius: 2px;
  background: rgba(201,168,76,.6); opacity: .85;
}
.rail-dot.current .rail-tick {
  width: 12px; height: 12px; background: #e7c75a; opacity: 1;
  box-shadow: 0 0 11px #c9a84c;
}
.rail-bubble {
  position: absolute; left: calc(100% + 12px); top: 0;
  transform: translateY(-50%); padding: 3px 9px;
  font-family: 'JetBrains Mono', monospace; font-size: .72rem; color: #0a0a14;
  background: #e7c75a; border-radius: 7px; white-space: nowrap;
  opacity: 0; pointer-events: none; transition: opacity .12s;
  box-shadow: 0 4px 14px rgba(0,0,0,.45);
}
.rail-bubble::before {
  content: ""; position: absolute; right: 100%; top: 50%;
  transform: translateY(-50%); border: 5px solid transparent;
  border-right-color: #e7c75a;
}
.text-rail.scrubbing .rail-bubble, .rail-track:hover .rail-bubble { opacity: 1; }
.text-rail-all {
  font-family: 'Space Grotesk', sans-serif; font-size: .56rem;
  letter-spacing: .1em; text-transform: uppercase;
  color: #c9a84c; opacity: .7; text-decoration: none;
}

/* Floating rail only when there's room beside the centred column. Below that
   it would overlap the text, so it drops out (prev/next + canvas still cover
   navigation). */
@media (max-width: 1180px) {
  .text-rail { display: none; }
}

/* "Go deeper" — login-gated, context-aware conversation about this sutra. */
.text-deeper {
  margin-top: 2.2rem; padding-top: 1.4rem;
  border-top: 1px solid rgba(201,168,76,.18);
}
.text-deeper h3 {
  font-family: 'Space Grotesk', sans-serif; font-size: .82rem;
  text-transform: uppercase; letter-spacing: .14em; color: #c9a84c; margin: 0 0 .8rem;
}
.text-deeper-gate {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 1.1rem 1.3rem; border-radius: 12px;
  background: rgba(201,168,76,.06); border: 1px solid rgba(201,168,76,.18);
  font-size: .92rem;
}
.text-deeper-gate a { color: #e7c75a; font-weight: 600; text-decoration: none; white-space: nowrap; }
.text-deeper-thread { display: flex; flex-direction: column; gap: .9rem; margin-bottom: 1rem; }
.td-msg { line-height: 1.7; font-size: .94rem; }
.td-msg.user {
  align-self: flex-end; max-width: 85%;
  background: rgba(201,168,76,.12); border: 1px solid rgba(201,168,76,.2);
  padding: .6rem .9rem; border-radius: 12px 12px 2px 12px;
}
.td-msg.assistant {
  position: relative; max-width: 100%; opacity: 1;
  padding: .15rem 0 .15rem 1rem; border-left: 2px solid rgba(201,168,76,.32);
}
.td-msg.assistant p { margin: 0 0 .7rem; }
.td-msg.assistant ul, .td-msg.assistant ol { margin: .2rem 0 .8rem 1.15rem; padding: 0; }
.td-msg.assistant li { margin: .22rem 0; }
.td-msg.assistant strong { color: #f3ead0; }
.td-msg.assistant em { color: #d8cba8; }
.td-msg.assistant code {
  font-family: 'JetBrains Mono', monospace; font-size: .85em;
  background: rgba(255,255,255,.06); padding: .05rem .35rem; border-radius: 5px;
}
.td-msg.assistant.streaming::after {
  content: ''; display: inline-block; width: 7px; height: 1.02em;
  background: #e7c75a; margin-left: 3px; vertical-align: text-bottom;
  border-radius: 1px; animation: tdCaret 1s steps(2, jump-none) infinite;
}
@keyframes tdCaret { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }

/* Inline chat widgets — mirror of the main chart chat chips (js/chat.js) so the
   verse "Go deeper" answers carry the same gold planet pills, dignity badges,
   shadbala bars and house chips, not flattened plain text. */
.chat-widget { display: inline-flex; align-items: center; gap: .25rem; padding: .08rem .4rem; margin: 0 2px; border-radius: 10px; font-size: .82em; vertical-align: baseline; }
.chat-widget.w-planet { background: rgba(226,192,121,.12); border: 1px solid rgba(226,192,121,.3); color: #e7c75a; }
.chat-widget.w-planet .w-sym { opacity: .8; }
.chat-widget.w-house { background: rgba(90,200,250,.08); border: 1px solid rgba(90,200,250,.25); color: #5ac8fa; }
.chat-widget.w-dignity { border: 1px solid transparent; }
.chat-widget.w-dignity[data-level="exalted"], .chat-widget.w-dignity[data-level="ownsign"], .chat-widget.w-dignity[data-level="moolatrikona"] { background: rgba(74,222,128,.10); border-color: rgba(74,222,128,.35); color: #86efac; }
.chat-widget.w-dignity[data-level="debilitated"] { background: rgba(248,113,113,.10); border-color: rgba(248,113,113,.35); color: #fca5a5; }
.chat-widget.w-dignity[data-level="neutral"] { background: rgba(255,255,255,.05); border-color: rgba(255,255,255,.15); color: rgba(255,255,255,.8); }
.chat-widget.w-shadbala { background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.1); font-family: 'JetBrains Mono', monospace; color: rgba(255,255,255,.85); }
.chat-widget.w-shadbala[data-status="strong"] { border-color: rgba(74,222,128,.4); color: #86efac; }
.chat-widget.w-shadbala[data-status="weak"] { border-color: rgba(248,113,113,.4); color: #fca5a5; }
.chat-widget.w-shadbala .w-bar { width: 36px; height: 3px; background: rgba(255,255,255,.1); border-radius: 2px; overflow: hidden; display: inline-block; margin-left: .2rem; }
.chat-widget.w-shadbala .w-bar-fill { height: 100%; background: currentColor; }

.text-deeper-form { display: flex; gap: .6rem; }
.text-deeper-form textarea {
  flex: 1; resize: none; min-height: 48px; max-height: 140px;
  font: inherit; font-size: .92rem; color: #f3ead0;
  background: rgba(8,8,18,.6); border: 1px solid rgba(201,168,76,.25);
  border-radius: 12px; padding: .7rem .9rem;
}
.text-deeper-form textarea:focus { outline: none; border-color: #c9a84c; }
.text-deeper-form button {
  align-self: flex-end; padding: .7rem 1.2rem; font: inherit; font-weight: 600;
  color: #0a0a14; background: linear-gradient(120deg, #e7c75a, #c9a84c);
  border: none; border-radius: 12px; cursor: pointer;
}
.text-deeper-form button:disabled { opacity: .5; cursor: default; }

/* ── Metered paywall (premium books) ─────────────────────────────────────── */
/* The lead-in paragraph fades into the wall so the page never looks truncated. */
.paywalled-reading { position: relative; }
.text-paywall {
  margin-top: 1.4rem; padding: 2rem 1.6rem; text-align: center;
  border: 1px solid rgba(231, 199, 90, .28); border-radius: 16px;
  background:
    radial-gradient(120% 100% at 50% 0%, rgba(231, 199, 90, .10), transparent 70%),
    rgba(255, 255, 255, .02);
}
.text-paywall::before {
  content: ""; display: block; height: 64px; margin: -5.4rem 0 1.4rem;
  background: linear-gradient(to bottom, transparent, var(--bg, #040407));
  pointer-events: none;
}
.text-paywall-h { font-weight: 600; font-size: 1.15rem; margin: 0 0 .4rem; }
.text-paywall-sub { opacity: .72; font-size: .95rem; margin: 0 auto 1.3rem; max-width: 34ch; }
.text-paywall .pill-cta {
  display: inline-block; padding: .7rem 1.4rem; font-weight: 600;
  color: #0a0a14; background: linear-gradient(120deg, #e7c75a, #c9a84c);
  border-radius: 12px; text-decoration: none;
}

.text-paywall-actions { display: flex; gap: 12px; justify-content: center; align-items: center; flex-wrap: wrap; }
.text-paywall-link { color: #e7c75a; text-decoration: none; font-weight: 600; font-size: .95rem; }
.text-paywall-link:hover { text-decoration: underline; }
.text-paywall-form { display: flex; gap: 8px; justify-content: center; margin: 1.1rem auto 0; max-width: 360px; }
.text-paywall-form input {
  flex: 1; padding: .6rem .8rem; font: inherit; font-size: .92rem; color: #e7ecf3;
  background: rgba(255, 255, 255, .04); border: 1px solid rgba(231, 199, 90, .28);
  border-radius: 10px;
}
.text-paywall-form button {
  padding: .6rem 1rem; font: inherit; font-weight: 600; color: #0a0a14;
  background: linear-gradient(120deg, #e7c75a, #c9a84c); border: none; border-radius: 10px; cursor: pointer;
}
.text-paywall-msg { margin: 1rem 0 0; font-size: .9rem; opacity: .8; }
.text-paywall-msg.ok { color: #6fcf97; opacity: 1; }

.text-paywall-alt {
  background: transparent !important; color: #e7c75a !important;
  border: 1px solid rgba(231, 199, 90, .4);
}
