/* Alpa-Sense (अल्पार्थ) · Tāḍapatra Scripture Folio & Pāṇinian Mathematical Proof Engine */
/* Authentic mineral scripture pigments on warm aged palm-leaf parchment — zero glow, pure 2D lineart. */

:root {
  --bg: #f2ead6;
  --bg-deep: #e7ddc4;
  --folio-card: #faf5e8;
  --folio-inset: #ebe2cb;
  --folio-tile: #fdfaf1;

  --ink: #1d1510;
  --ink-2: #544334;
  --ink-3: #7a6854;
  --line: rgba(43, 30, 18, 0.16);
  --line-strong: rgba(43, 30, 18, 0.30);
  --panel: rgba(43, 30, 18, 0.045);

  /* Traditional Pañcavarṇa mineral manuscript pigments */
  --sindura: #a43018;       /* Mineral vermilion / cinnabar — sacred rubrics, sandhi splits, active proofs */
  --sindura-soft: rgba(164, 48, 24, 0.10);
  --haridra: #8e5f16;       /* Turmeric / raw yellow-ochre — dhātu roots, Rūḍha stems */
  --haridra-soft: rgba(142, 95, 22, 0.10);
  --patra: #275a4b;         /* Botanical palm-leaf mineral green — Yaugika compositional proofs */
  --patra-soft: rgba(39, 90, 75, 0.10);
  --laksha: #7d293b;        /* Red sandalwood / lac dye — Yogarūḍha semantic leap */
  --laksha-soft: rgba(125, 41, 59, 0.10);

  /* Remap inherited style.css tokens cleanly onto scripture palette */
  --gold: var(--sindura);
  --saffron: var(--haridra);
  --rose: var(--laksha);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  color-scheme: light;
}

.sr-svg-defs {
  position: absolute;
  width: 0;
  height: 0;
  pointer-events: none;
}

body.scripture-page {
  background:
    radial-gradient(120% 80% at 50% 0%, #f7f1e1 0%, var(--bg) 62%, var(--bg-deep) 100%);
  color: var(--ink);
}

.folio-grain {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.04;
  filter: url(#tada-grain);
  background: #3b2a19;
}

/* Override inherited dark chrome from ../css/style.css */
body.scripture-page a {
  color: var(--sindura);
}
body.scripture-page a:hover {
  color: #7c200e;
}
body.scripture-page :focus-visible {
  outline: 2px solid var(--sindura);
  outline-offset: 2px;
}
body.scripture-page kbd {
  background: var(--folio-tile);
  border-color: var(--line-strong);
  color: var(--ink);
}

body.scripture-page .top {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
body.scripture-page .brand {
  color: var(--ink);
}
body.scripture-page .brand-deva {
  color: var(--sindura);
}
body.scripture-page .top nav a {
  color: var(--ink-2);
}
body.scripture-page .top nav a:hover {
  color: var(--ink);
}
body.scripture-page .top nav a[aria-current="page"] {
  color: var(--sindura);
  font-weight: 560;
  position: relative;
}
body.scripture-page .top nav a[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -4px;
  height: 1.5px;
  background: var(--sindura);
}

body.scripture-page .button {
  border-color: var(--line-strong);
  background: var(--folio-tile);
  color: var(--ink);
}
body.scripture-page .button:hover {
  border-color: var(--sindura);
  background: var(--folio-card);
  color: var(--sindura);
}
body.scripture-page .button.primary {
  background: var(--sindura);
  border: 1px solid #842310;
  color: #fbf6eb;
  font-weight: 560;
}
body.scripture-page .button.primary:hover {
  background: #8d2612;
  color: #fffaf0;
}

body.scripture-page .voices {
  border-color: var(--line-strong);
  background: var(--folio-inset);
}
body.scripture-page .voice-choice {
  color: var(--ink-2);
}
body.scripture-page .voice-choice:hover {
  color: var(--ink);
}
body.scripture-page .voice-choice[aria-pressed="true"] {
  background: var(--folio-tile);
  color: var(--sindura);
  box-shadow: inset 0 0 0 1px rgba(164, 48, 24, 0.36);
}

body.scripture-page .switch {
  color: var(--ink-2);
}
body.scripture-page .switch:hover,
body.scripture-page .switch[aria-checked="true"] {
  color: var(--ink);
}
body.scripture-page .switch-track {
  background: rgba(43, 30, 18, 0.22);
}
body.scripture-page .switch-thumb {
  background: var(--folio-tile);
}
body.scripture-page .switch[aria-checked="true"] .switch-track {
  background: var(--sindura);
}
body.scripture-page .switch[aria-checked="true"] .switch-thumb {
  background: #fdf9f0;
}

body.scripture-page .itrans-preview {
  background: var(--folio-inset);
  border: 1px solid var(--line);
  color: var(--ink);
}
body.scripture-page .note {
  color: var(--sindura);
}
body.scripture-page .status.error {
  color: var(--sindura);
}

body.scripture-page .prose h2,
body.scripture-page .prose h3 {
  color: var(--ink);
}
body.scripture-page .prose code {
  font-family: var(--mono);
  font-size: 0.9em;
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--folio-inset);
  color: var(--ink);
}
body.scripture-page .facts li {
  background: var(--folio-card);
  border-color: var(--line);
}
body.scripture-page .facts b {
  color: var(--sindura);
}
body.scripture-page .foot {
  border-top-color: var(--line);
  color: var(--ink-3);
}
body.scripture-page .foot a {
  color: var(--ink-2);
}
.foot-links {
  display: inline-flex;
  align-items: center;
  gap: 16px;
}

/* ---------- Main Container & Entry Threshold ---------- */
body.scripture-page {
  display: flex;
  flex-direction: column;
  min-height: 100svh;
}
body.scripture-page .top {
  width: 100%;
}
body.scripture-page .foot {
  width: 100%;
  margin-top: auto;
}

.sense-main {
  width: 100%;
  max-width: 920px;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* Pure centered first-impression threshold before a śloka is entered */
body.scripture-page[data-stage="entry"] .sense-main {
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: clamp(24px, 5vh, 52px);
  padding-bottom: clamp(28px, 6vh, 64px);
}
body.scripture-page[data-stage="entry"] .hero-intro {
  margin-top: 0;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}
body.scripture-page[data-stage="entry"] .hero-intro h1 {
  justify-content: center;
  font-size: clamp(30px, 5vw, 42px);
}
body.scripture-page[data-stage="entry"] .title-deva {
  font-size: clamp(32px, 5.2vw, 45px);
}
body.scripture-page[data-stage="entry"] .hero-lede {
  max-width: 54ch;
  text-align: center;
}
body.scripture-page[data-stage="entry"] .composer {
  width: 100%;
  max-width: 720px;
  margin: 26px auto 0;
}
body.scripture-page[data-stage="entry"] .composer-input {
  min-height: 58px;
  padding: 13px 18px;
  font-size: 21px;
  border-color: var(--line-strong);
  box-shadow: inset 0 0 0 4px var(--folio-tile), inset 0 0 0 5px rgba(43, 30, 18, 0.08);
}
body.scripture-page[data-stage="entry"] .composer-go {
  padding: 0 26px;
}
body.scripture-page[data-stage="entry"] .showcase {
  justify-content: center;
}
body.scripture-page[data-stage="entry"] .foot {
  margin-top: 0;
  max-width: 920px;
}

/* Minimalist 2D SVG yantra emblem — visible on entry threshold only */
.entry-emblem {
  width: 56px;
  height: 56px;
  margin-bottom: 12px;
  display: block;
}
.emblem-outer {
  fill: none;
  stroke: rgba(43, 30, 18, 0.28);
  stroke-width: 0.9;
}
.emblem-geo {
  fill: none;
  stroke: rgba(43, 30, 18, 0.22);
  stroke-width: 0.75;
}
.emblem-tri {
  fill: none;
  stroke: rgba(164, 48, 24, 0.55);
  stroke-width: 0.85;
}
.emblem-bindu {
  fill: var(--sindura);
}
body.scripture-page[data-stage="engaged"] .entry-emblem,
body.scripture-page[data-stage="engaged"] .entry-engine,
body.scripture-page[data-stage="engaged"] .showcase-divider {
  display: none;
}

/* Quiet local engine readiness whisper beneath entry input */
.entry-engine {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}
.entry-status {
  font-size: 12px;
  color: var(--ink-3);
  letter-spacing: 0.02em;
}
.entry-status.is-ready {
  color: var(--patra);
}
.entry-bar {
  display: block;
  width: min(220px, 60%);
  height: 2px;
  background: rgba(43, 30, 18, 0.14);
  overflow: hidden;
}
.entry-fill {
  display: block;
  height: 100%;
  width: 0%;
  background: var(--sindura);
  transition: width 180ms linear;
}
.entry-bar[hidden] {
  display: none;
}

.showcase-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 22px 0 12px;
}
.div-rule {
  flex: 1 1 auto;
  height: 1px;
  background: var(--line);
}
.div-label {
  font-size: 11px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-3);
}

/* ---------- Hero Intro (Engaged Compact Header) ---------- */
.hero-intro {
  margin-top: clamp(18px, 2.8vw, 28px);
}
.hero-rubric {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--ink-3);
}
.rubric-mark {
  font-family: var(--deva);
  font-size: 13px;
  color: var(--sindura);
}
.hero-intro h1 {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 14px;
  font-size: clamp(26px, 4vw, 34px);
  font-weight: 650;
  letter-spacing: -0.025em;
  line-height: 1.15;
  color: var(--ink);
}
.title-deva {
  font-family: var(--deva);
  font-weight: 400;
  font-size: clamp(28px, 4.2vw, 37px);
  color: var(--sindura);
  letter-spacing: 0;
}
.hero-lede {
  margin: 7px 0 0;
  max-width: 74ch;
  font-size: 14.5px;
  line-height: 1.58;
  color: var(--ink-2);
}
.hero-lede strong {
  color: var(--ink);
  font-weight: 600;
}

/* ---------- Composer & Curated Showcase ---------- */
.composer {
  margin-top: 18px;
}
.composer-row {
  display: flex;
  align-items: stretch;
  gap: 10px;
}
.composer-input {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 50px;
  padding: 10px 15px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--folio-tile);
  color: var(--ink);
  font: 400 20px/1.45 var(--deva);
  resize: none;
  overflow-y: hidden;
  transition: border-color 180ms var(--ease-out), background 180ms var(--ease-out);
}
.composer-input.latin {
  font: 400 16px/1.5 var(--sans);
}
.composer-input::placeholder {
  color: var(--ink-3);
}
.composer-input:focus-visible {
  outline: 2px solid var(--sindura);
  outline-offset: 2px;
  border-color: var(--sindura);
}
.composer-go {
  flex: none;
  padding: 0 22px;
  border-radius: 10px;
  white-space: nowrap;
}
.composer-go svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
  stroke: none;
}
.composer-go svg[hidden] {
  display: none;
}

.composer-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 16px;
  margin-top: 7px;
}
.composer-left {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 18px;
}
.compact-switch {
  min-height: 30px;
  gap: 8px;
  font-size: 13.5px;
}
.compact-switch .switch-track {
  width: 34px;
  height: 20px;
}
.compact-switch .switch-thumb {
  width: 14px;
  height: 14px;
  top: 3px;
  left: 3px;
}
.compact-switch[aria-checked="true"] .switch-thumb {
  transform: translateX(14px);
}
.scheme-hint {
  font-size: 12px;
  color: var(--ink-3);
  letter-spacing: 0.03em;
}

.text-btn {
  padding: 4px 2px;
  border: 0;
  background: none;
  color: var(--ink-2);
  font: 500 13px/1.3 var(--sans);
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: rgba(43, 30, 18, 0.28);
  text-underline-offset: 3px;
  transition: color 160ms var(--ease-out), text-decoration-color 160ms var(--ease-out);
}
.text-btn:hover {
  color: var(--sindura);
  text-decoration-color: var(--sindura);
}
.text-btn:disabled {
  opacity: 0.4;
  cursor: default;
}

.showcase {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 11px;
}
.chip {
  display: inline-flex;
  align-items: baseline;
  gap: 7px;
  padding: 5px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(250, 245, 232, 0.65);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: background 160ms var(--ease-out), border-color 160ms var(--ease-out), transform 160ms var(--ease-out);
}
.chip:hover {
  background: var(--folio-tile);
  border-color: var(--sindura);
  transform: translateY(-1px);
}
.chip[aria-current="true"] {
  background: var(--sindura-soft);
  border-color: rgba(164, 48, 24, 0.55);
}
.chip-deva {
  font-family: var(--deva);
  font-size: 15.5px;
  line-height: 1.25;
}
.chip-note {
  font-size: 11.5px;
  color: var(--ink-3);
}

/* ---------- Manuscript Folio Proof Stage ---------- */
.theatre {
  margin-top: 20px;
  padding: clamp(18px, 2.8vw, 30px);
  border: 1px solid var(--line-strong);
  outline: 1px solid rgba(43, 30, 18, 0.09);
  outline-offset: -7px;
  border-radius: 4px;
  background: var(--folio-card);
  position: relative;
}

.folio-corner {
  position: absolute;
  width: 24px;
  height: 24px;
  pointer-events: none;
  fill: var(--sindura);
  stroke: rgba(43, 30, 18, 0.34);
  stroke-width: 1;
}
.folio-corner path { fill: none; }
.corner-tl { top: 6px; left: 6px; }
.corner-tr { top: 6px; right: 6px; }
.corner-bl { bottom: 6px; left: 6px; }
.corner-br { bottom: 6px; right: 6px; }

.theatre-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  padding-bottom: 14px;
  border-bottom: 1px double var(--line-strong);
}

/* 4-Stage Logical Proof Stepper */
.acts {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  font-size: 12.5px;
  color: var(--ink-3);
}
.acts li {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  letter-spacing: 0.02em;
  transition: color 200ms var(--ease-out);
}
.act-num {
  font-family: var(--deva);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink-3);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 0 5px;
  line-height: 1.5;
}
.theatre[data-act="sound"] .acts li[data-step="sound"],
.theatre[data-act="unweave"] .acts li[data-step="unweave"],
.theatre[data-act="cot"] .acts li[data-step="cot"],
.theatre[data-act="sense"] .acts li[data-step="sense"] {
  color: var(--sindura);
  font-weight: 600;
}
.theatre[data-act="sound"] .acts li[data-step="sound"] .act-num,
.theatre[data-act="unweave"] .acts li[data-step="unweave"] .act-num,
.theatre[data-act="cot"] .acts li[data-step="cot"] .act-num,
.theatre[data-act="sense"] .acts li[data-step="sense"] .act-num {
  border-color: var(--sindura);
  color: var(--sindura);
  background: var(--sindura-soft);
}
.theatre[data-act="unweave"] .acts li[data-step="sound"],
.theatre[data-act="cot"] .acts li[data-step="sound"],
.theatre[data-act="cot"] .acts li[data-step="unweave"],
.theatre[data-act="sense"] .acts li[data-step="sound"],
.theatre[data-act="sense"] .acts li[data-step="unweave"],
.theatre[data-act="sense"] .acts li[data-step="cot"] {
  color: var(--ink-2);
}

/* Fused / Unwoven Toggle & Replay */
.stage-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.view-toggle {
  display: inline-flex;
  padding: 2px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--folio-inset);
}
.seg-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 30px;
  padding: 4px 12px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--ink-2);
  font: 500 12.5px/1.2 var(--sans);
  cursor: pointer;
  transition: background 160ms var(--ease-out), color 160ms var(--ease-out);
}
.seg-btn [lang="sa"] {
  font-family: var(--deva);
  font-weight: 400;
  font-size: 13.5px;
  line-height: 1;
}
.seg-btn:hover:not(:disabled) {
  color: var(--ink);
}
.seg-btn[aria-pressed="true"] {
  background: var(--folio-tile);
  color: var(--sindura);
  box-shadow: inset 0 0 0 1px rgba(164, 48, 24, 0.34);
}
.seg-btn:disabled {
  opacity: 0.38;
  cursor: not-allowed;
}

.ghost-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 32px;
  padding: 0 11px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--folio-tile);
  color: var(--ink-2);
  font: 500 12.5px/1 var(--sans);
  cursor: pointer;
  transition: border-color 160ms var(--ease-out), color 160ms var(--ease-out);
}
.ghost-pill:hover {
  border-color: var(--sindura);
  color: var(--sindura);
}
.ghost-pill svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------- Complete Multi-Line Śloka Stanza Showcase ---------- */
.stanza-scroll {
  margin-top: 16px;
  padding: 14px 18px 12px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--sindura);
  border-radius: 3px;
  background: rgba(235, 226, 203, 0.55);
}
.stanza-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.stanza-eyebrow {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--sindura);
}
.stanza-count {
  font-size: 12px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}
.stanza-lines {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.stanza-line {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 10px;
  width: 100%;
  padding: 5px 8px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--ink-2);
  text-align: left;
  cursor: pointer;
  transition: background 150ms var(--ease-out), color 150ms var(--ease-out);
}
.stanza-line:hover {
  background: rgba(43, 30, 18, 0.05);
  color: var(--ink);
}
.stanza-line[aria-current="true"] {
  background: var(--folio-tile);
  color: var(--ink);
  box-shadow: inset 2px 0 0 var(--sindura);
}
.stanza-idx {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-3);
}
.stanza-deva {
  font-family: var(--deva);
  font-size: clamp(18px, 2.6vw, 22px);
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.stanza-mark {
  font-size: 11px;
  color: var(--ink-3);
  white-space: nowrap;
}
.stanza-line.is-sensed .stanza-mark {
  color: var(--patra);
  font-weight: 600;
}

/* ---------- 2D SVG Nāda-Yantra Voice Hub ---------- */
.voice-hub {
  display: flex;
  align-items: center;
  gap: clamp(14px, 2.6vw, 22px);
  margin-top: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.sense-orb-wrap {
  flex: none;
  position: relative;
  width: 78px;
  height: 78px;
}
.yantra-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}
.yantra-circle-outer {
  fill: none;
  stroke: rgba(43, 30, 18, 0.24);
  stroke-width: 0.9;
}
.yantra-geo {
  fill: none;
  stroke: rgba(43, 30, 18, 0.20);
  stroke-width: 0.75;
}
.yantra-tri {
  fill: none;
  stroke: rgba(164, 48, 24, 0.34);
  stroke-width: 0.8;
}
.yantra-tick {
  stroke: var(--sindura);
  stroke-width: 1;
  stroke-linecap: round;
  stroke-opacity: 0.24;
}
.yantra-pulse {
  fill: var(--folio-tile);
  stroke: var(--sindura);
  stroke-width: 1.05;
  stroke-opacity: 0.36;
}
.theatre.loading .sense-orb-wrap .ring {
  opacity: 1;
}
body.scripture-page .ring-track {
  stroke: rgba(43, 30, 18, 0.12);
}
body.scripture-page .ring-fill {
  stroke: var(--sindura);
  stroke-width: 1.6;
}
body.scripture-page .sense-orb-wrap .play {
  width: 40px;
  height: 40px;
  border: 1.2px solid rgba(164, 48, 24, 0.55);
  background: var(--folio-tile);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  color: var(--sindura);
}
body.scripture-page .sense-orb-wrap .play:hover {
  background: var(--sindura);
  color: #fdf9f0;
  border-color: var(--sindura);
}
body.scripture-page .sense-orb-wrap .play svg {
  width: 16px;
  height: 16px;
}
.theatre.speaking .sense-orb-wrap .play .icon-play { display: none; }
.theatre.speaking .sense-orb-wrap .play .icon-stop { display: block; }
.theatre.speaking .sense-orb-wrap .play {
  opacity: 1;
  background: var(--sindura);
  color: #fdf9f0;
}

.hub-meta {
  flex: 1 1 auto;
  min-width: 0;
}
.hub-meta .status {
  margin: 0;
  min-height: 1.4em;
  font-size: 13.5px;
  color: var(--ink-2);
}
.load-track {
  margin-top: 6px;
  height: 2.5px;
  width: min(100%, 340px);
  background: rgba(43, 30, 18, 0.14);
  overflow: hidden;
}
.load-fill {
  height: 100%;
  width: 0%;
  background: var(--sindura);
  transition: width 180ms linear;
}
.hub-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  margin-top: 8px;
}
.compact-voices {
  margin-top: 0;
  padding: 2px;
}
.compact-voices .voice-choice {
  min-height: 28px;
  padding: 0 12px;
  font-size: 12.5px;
}

/* ---------- Movement I & II: Unbroken Śloka -> Fluid Sandhi Explosion ---------- */
.sloka-stage {
  padding: clamp(16px, 2.6vw, 26px) 2px clamp(12px, 2vw, 18px);
  text-align: center;
  min-height: 140px;
}

.fused-view {
  margin: 0;
  transition: transform 340ms var(--ease-out), opacity 280ms var(--ease-out);
  transform-origin: center top;
}
.samhita-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 4px;
}
.sloka-stage .verse-text {
  font-family: var(--deva);
  font-size: clamp(28px, 4.8vw, 42px);
  line-height: 1.5;
  color: var(--ink);
  transition: font-size 280ms var(--ease-out);
}
.sloka-stage .verse-iast {
  margin-top: 4px;
  font-family: var(--deva);
  font-style: italic;
  font-size: clamp(15px, 2.3vw, 17.5px);
  color: var(--ink-2);
}
.sloka-stage .verse-source {
  margin-top: 5px;
  font-size: 12.5px;
  color: var(--ink-3);
}

/* Phoneme & Prosodic Mātrā Measuring Caliper */
.caliper-wrap {
  margin: 10px auto 0;
  max-width: 560px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.caliper-svg {
  width: 100%;
  height: 24px;
  display: block;
}
.caliper-rule {
  stroke: rgba(43, 30, 18, 0.28);
  stroke-width: 0.9;
}
.caliper-cap {
  stroke: var(--sindura);
  stroke-width: 1.2;
}
.caliper-tick {
  stroke: rgba(43, 30, 18, 0.34);
  stroke-width: 1;
}
.caliper-tick.is-guru {
  stroke: var(--sindura);
  stroke-width: 1.3;
}
.caliper-label {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.04em;
  color: var(--ink-3);
}

/* Crisp pigment underline during Alpa TTS speech — zero blur/glow */
body.scripture-page .theatre.playing .fused-view .w { opacity: 0.45; }
body.scripture-page .theatre.playing .fused-view .w.spoken { opacity: 0.88; }
body.scripture-page .theatre.playing .fused-view .w.now {
  opacity: 1;
  color: var(--sindura);
  text-shadow: none;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 6px;
}

/* When unwoven: fused line becomes a stately quiet archival reference above the filaments */
.theatre[data-view="unwoven"] .fused-view {
  opacity: 0.72;
  transform: scale(0.76);
  margin-bottom: -14px;
}
.theatre[data-view="unwoven"] .fused-view .verse-iast,
.theatre[data-view="unwoven"] .fused-view .verse-source,
.theatre[data-view="unwoven"] .fused-view .caliper-wrap {
  display: none;
}

/* Movement II: Branching 2D SVG Filaments & Exploded Word Units */
.unwoven-view {
  margin-top: 2px;
}
.split-wires-svg {
  display: block;
  width: 100%;
  height: 42px;
  overflow: visible;
  margin-bottom: -1px;
}
.wire-knot {
  fill: var(--sindura);
}
.proof-wire {
  fill: none;
  stroke: rgba(43, 30, 18, 0.28);
  stroke-width: 1.1;
  transition: stroke 160ms var(--ease-out), stroke-width 160ms var(--ease-out), opacity 160ms var(--ease-out);
}
.proof-wire.is-subtle {
  stroke-dasharray: 3 3;
  opacity: 0.55;
}
.proof-wire.is-linked,
.proof-wire.is-streaming-wire {
  stroke: var(--sindura);
  stroke-width: 1.9;
  opacity: 1;
}
.wire-node {
  fill: var(--folio-card);
  stroke: rgba(43, 30, 18, 0.45);
  stroke-width: 1.1;
  transition: stroke 160ms var(--ease-out), fill 160ms var(--ease-out);
}
.wire-node.is-linked {
  fill: var(--sindura);
  stroke: var(--sindura);
}

.split-caption {
  margin: 4px 0 2px;
  font-size: 12px;
  letter-spacing: 0.03em;
  color: var(--ink-3);
}

.pad-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: stretch;
  gap: 10px 6px;
}

.pad-word {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 82px;
  max-width: 240px;
  gap: 2px;
  padding: 13px 15px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: var(--folio-tile);
  color: var(--ink);
  cursor: pointer;
  will-change: transform, opacity;
  transition: transform 180ms var(--ease-out), border-color 160ms var(--ease-out), background 160ms var(--ease-out);
}
.pad-word::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2.5px;
  background: rgba(43, 30, 18, 0.16);
  transition: background 200ms var(--ease-out);
}
.pad-word[data-sem="yaugika"]::after { background: var(--patra); }
.pad-word[data-sem="yogarudha"]::after { background: var(--laksha); }
.pad-word[data-sem="rudha"]::after { background: var(--haridra); }

.pad-word:hover,
.pad-word.is-linked {
  background: #fffdf7;
  border-color: var(--sindura);
  transform: translateY(-2px);
}
.pad-word.is-speaking {
  background: var(--sindura-soft);
  border-color: var(--sindura);
}
.pad-word.is-speaking .pad-deva {
  color: var(--sindura);
}

.pad-idx {
  position: absolute;
  top: 4px;
  left: 6px;
  font-family: var(--mono);
  font-size: 9.5px;
  color: var(--ink-3);
  letter-spacing: 0.02em;
}
.pad-deva {
  font-family: var(--deva);
  font-size: clamp(22px, 3.8vw, 31px);
  line-height: 1.32;
  color: var(--ink);
}
.pad-iast {
  font-family: var(--deva);
  font-style: italic;
  font-size: clamp(12.5px, 1.8vw, 14.5px);
  line-height: 1.25;
  color: var(--ink-2);
}
.pad-gloss {
  margin-top: 4px;
  padding-top: 4px;
  border-top: 1px dashed rgba(43, 30, 18, 0.16);
  width: 100%;
  font-size: 11px;
  line-height: 1.3;
  color: var(--ink-2);
  max-width: 24ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pad-gloss:empty {
  display: none;
}

.seam {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: center;
  width: 20px;
  height: 20px;
  color: var(--sindura);
  user-select: none;
}
.seam svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: var(--sindura);
  stroke-width: 1.25;
}

/* ---------- Movement III & IV: Proof Ledger, Convergence & Translation ---------- */
.meaning-panel {
  margin-top: 10px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

/* Multi-line Full Śloka Synthesis Folio */
.shloka-panel {
  margin-bottom: 18px;
  padding: 15px 18px 13px;
  border: 1px solid rgba(164, 48, 24, 0.34);
  border-radius: 4px;
  background: var(--folio-tile);
}
.shloka-sense {
  margin: 10px 0 0;
  font-family: var(--deva);
  font-size: clamp(18px, 2.3vw, 21.5px);
  line-height: 1.62;
  color: var(--ink);
}
.shloka-clause {
  display: block;
  width: fit-content;
  max-width: 100%;
  padding: 2px 7px;
  margin: 2px 0 2px -7px;
  border: 0;
  border-radius: 3px;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 150ms var(--ease-out), color 150ms var(--ease-out);
}
.shloka-clause:hover {
  background: rgba(164, 48, 24, 0.08);
}
.shloka-clause.is-active {
  background: var(--sindura-soft);
  color: var(--ink);
  box-shadow: inset 2px 0 0 var(--sindura);
}
.shloka-clause.is-pending {
  color: var(--ink-3);
  font-style: italic;
  cursor: default;
}
.shloka-hint {
  font-size: 12px;
  color: var(--ink-3);
}

/* Movement III: Live Pāṇinian CoT Deduction Ledger */
.cot-panel {
  padding: 14px 16px 14px;
  border: 1px solid var(--line-strong);
  border-top: 2px solid var(--ink);
  border-radius: 3px;
  background: var(--folio-inset);
}
.cot-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}
.cot-title-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.cot-eyebrow {
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--ink);
}
.cot-head-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}
.cot-step-count {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--ink-3);
}

.cot-sandhi-eq {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 8px;
  padding: 9px 0 8px;
  border-bottom: 1px dashed var(--line-strong);
  font-size: 13.5px;
  color: var(--ink-2);
}
.cot-op-label {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--sindura);
  font-weight: 600;
}
.cot-eq-fused {
  font-family: var(--deva);
  font-size: 16px;
  color: var(--ink);
}
.cot-op {
  font-family: var(--mono);
  font-weight: 700;
  color: var(--sindura);
}
.cot-eq-parts {
  font-family: var(--deva);
  font-size: 16px;
  color: var(--ink);
}
.cot-eq-plus {
  color: var(--sindura);
  margin: 0 3px;
  font-family: var(--mono);
  font-size: 12px;
}

.cot-steps {
  list-style: none;
  margin: 6px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}
.cot-step {
  display: grid;
  grid-template-columns: 28px minmax(92px, 132px) minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 4px 10px;
  padding: 7px 6px;
  border-bottom: 1px solid rgba(43, 30, 18, 0.09);
  border-radius: 3px;
  cursor: pointer;
  transition: background 150ms var(--ease-out);
}
.cot-step:last-child {
  border-bottom: 0;
}
.cot-step:hover,
.cot-step.is-linked {
  background: var(--folio-tile);
}
.cot-step-num {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-3);
}
.cot-step-word {
  font-family: var(--deva);
  font-size: 17px;
  color: var(--ink);
  white-space: nowrap;
}
.cot-step-derivation {
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--ink-2);
  min-width: 0;
  overflow-wrap: anywhere;
}
.cot-step-derivation .cot-root {
  color: var(--haridra);
  font-weight: 600;
}
.cot-step-derivation .cot-sem {
  display: inline-block;
  margin-left: 5px;
  padding: 0 5px;
  border: 1px solid var(--line);
  border-radius: 3px;
  font-size: 10.5px;
  font-weight: 550;
}
.cot-step-derivation .cot-sem[data-sem="yaugika"] {
  border-color: rgba(39, 90, 75, 0.4);
  color: var(--patra);
}
.cot-step-derivation .cot-sem[data-sem="yogarudha"] {
  border-color: rgba(125, 41, 59, 0.42);
  color: var(--laksha);
}
.cot-step-derivation .cot-sem[data-sem="rudha"] {
  border-color: rgba(142, 95, 22, 0.38);
  color: var(--haridra);
}
.cot-step-sense {
  font-size: 13px;
  font-weight: 560;
  color: var(--ink);
  text-align: right;
  max-width: 28ch;
}
.cot-step-sense .cot-arrow {
  color: var(--sindura);
  margin-right: 5px;
  font-family: var(--mono);
}
.cot-step.is-live::after {
  content: "▏";
  color: var(--sindura);
  animation: blinkCursor 0.9s steps(2) infinite;
}
@keyframes blinkCursor {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.15; }
}

.raw-cot {
  margin: 12px 0 0;
  padding: 12px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: var(--folio-tile);
  color: var(--ink-2);
  font: 400 12px/1.6 var(--mono);
  white-space: pre-wrap;
  overflow-x: auto;
}

/* Movement IV: 2D SVG Convergence Arcs -> Computed English Translation */
.convergence-wrap {
  margin: 4px 0 -2px;
}
.convergence-svg {
  display: block;
  width: 100%;
  height: 48px;
  overflow: visible;
}
.conv-rule {
  stroke: rgba(43, 30, 18, 0.22);
  stroke-width: 0.9;
}
.conv-wire[data-sem="yaugika"] { stroke: rgba(39, 90, 75, 0.42); }
.conv-wire[data-sem="yogarudha"] { stroke: rgba(125, 41, 59, 0.48); }
.conv-wire[data-sem="rudha"] { stroke: rgba(142, 95, 22, 0.36); }
.conv-wire.is-linked {
  stroke: var(--sindura);
  stroke-width: 1.9;
}
.seal-outer {
  fill: var(--folio-card);
  stroke: var(--sindura);
  stroke-width: 1.3;
}
.seal-inner {
  fill: var(--sindura);
}

.sense-banner {
  padding: 14px 18px 14px;
  border: 1px solid var(--line-strong);
  border-top: 2px solid var(--sindura);
  border-radius: 4px;
  background: var(--folio-tile);
}
.sense-banner-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
}
.sense-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--sindura);
}
.stream-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--sindura);
  animation: pulseDot 1.1s ease-in-out infinite;
}
@keyframes pulseDot {
  0%, 100% { opacity: 0.3; transform: scale(0.85); }
  50% { opacity: 1; transform: scale(1.1); }
}
.sense-timing {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

.phrase-sense {
  margin: 10px 0 0;
  font-family: var(--deva);
  font-size: clamp(20px, 2.9vw, 26px);
  font-weight: 400;
  line-height: 1.5;
  color: var(--ink);
}
.phrase-sense.is-streaming {
  color: var(--ink-2);
}
.sense-bridge {
  margin: 6px 0 0;
  font-size: 14.5px;
  color: var(--ink-2);
}
.sense-bridge em {
  color: var(--ink);
  font-style: italic;
}
.sense-bridge .arrow {
  color: var(--laksha);
  margin: 0 6px;
}

.sense-utils {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 18px;
  margin-top: 12px;
}
.util-feedback {
  font-size: 12px;
  font-weight: 500;
  color: var(--patra);
}

/* ---------- Detailed Pāṇinian Word Anatomy Cards ---------- */
.anatomy-section {
  margin-top: 24px;
}
.section-label {
  margin: 0 0 10px;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.anatomy-list {
  display: flex;
  flex-direction: column;
}
.word-row {
  display: grid;
  grid-template-columns: minmax(145px, 195px) minmax(0, 1fr) minmax(170px, 245px);
  gap: 10px 18px;
  align-items: start;
  padding: 14px 10px;
  border-top: 1px solid var(--line);
  border-radius: 4px;
  transition: background 150ms var(--ease-out);
}
.word-row:hover,
.word-row.is-linked {
  background: rgba(164, 48, 24, 0.05);
}
.word-row.is-speaking {
  background: var(--sindura-soft);
}

.word-head {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}
.word-speak {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}
.word-speak:hover .word-deva {
  color: var(--sindura);
}
.word-deva {
  font-family: var(--deva);
  font-size: 23px;
  line-height: 1.25;
  transition: color 150ms var(--ease-out);
}
.speak-icon {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: var(--ink-3);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
  transition: stroke 150ms var(--ease-out);
}
.word-speak:hover .speak-icon {
  stroke: var(--sindura);
}
.word-iast {
  font-family: var(--deva);
  font-style: italic;
  font-size: 14.5px;
  line-height: 1.2;
  color: var(--ink-2);
}

.sem-tag {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  margin-top: 3px;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 560;
  border: 1px solid var(--line);
  color: var(--ink-2);
  background: var(--folio-tile);
}
.sem-tag [lang="sa"] {
  font-family: var(--deva);
  font-weight: 400;
}
.sem-tag[data-sem="yaugika"] {
  border-color: rgba(39, 90, 75, 0.42);
  background: var(--patra-soft);
  color: var(--patra);
}
.sem-tag[data-sem="yogarudha"] {
  border-color: rgba(125, 41, 59, 0.45);
  background: var(--laksha-soft);
  color: var(--laksha);
}
.sem-tag[data-sem="rudha"] {
  border-color: rgba(142, 95, 22, 0.38);
  background: var(--haridra-soft);
  color: var(--haridra);
}

.word-morph-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}
.samasa-branch {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 5px 8px;
  font-size: 13.5px;
  color: var(--ink-2);
}
.samasa-tag {
  font-size: 10.5px;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--sindura);
}
.samasa-parts {
  font-family: var(--deva);
  font-size: 16.5px;
  color: var(--ink);
}
.samasa-plus {
  color: var(--sindura);
  margin: 0 3px;
}
.samasa-iast {
  font-family: var(--deva);
  font-style: italic;
  font-size: 13px;
  color: var(--ink-3);
}

.morph-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.m-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--folio-tile);
  font-size: 12px;
  line-height: 1.4;
}
.m-chip[data-role="dhatu"] {
  border-color: rgba(142, 95, 22, 0.42);
  background: var(--haridra-soft);
}
.m-chip-k {
  font-size: 10.5px;
  color: var(--ink-3);
}
.m-chip-v {
  color: var(--ink);
}
.m-chip[data-role="dhatu"] .m-chip-v {
  color: var(--haridra);
  font-weight: 600;
}

.word-sense-col {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.word-sense-main {
  font-size: 15px;
  font-weight: 560;
  line-height: 1.45;
  color: var(--ink);
}
.word-literal {
  font-size: 13px;
  line-height: 1.4;
  color: var(--ink-2);
}
.word-literal .arrow {
  color: var(--laksha);
  margin: 0 3px;
}
.sense-main .facts li {
  grid-template-columns: 116px minmax(0, 1fr);
}
.sense-main .facts b {
  white-space: nowrap;
}
.word-alt {
  font-size: 12.5px;
  line-height: 1.4;
  color: var(--ink-3);
}
.low-conf-note {
  font-size: 11.5px;
  color: var(--haridra);
}

/* ---------- Opt-In Deterministic Sound & Symbolic Lens Drawer ---------- */
.lens-drawer {
  margin-top: 22px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: var(--folio-card);
}
.lens-summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 15px 18px;
  cursor: pointer;
  user-select: none;
}
.lens-summary::-webkit-details-marker { display: none; }
.lens-summary strong {
  display: block;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--ink);
}
.lens-sub {
  display: block;
  margin-top: 2px;
  font-size: 12.5px;
  color: var(--ink-3);
}
.chev {
  flex: none;
  width: 17px;
  height: 17px;
  fill: none;
  stroke: var(--ink-2);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 200ms var(--ease-out);
}
.lens-drawer[open] .chev {
  transform: rotate(180deg);
}

.lens-body {
  padding: 0 18px 20px;
  border-top: 1px solid var(--line);
}
.lens-group { margin-top: 18px; }
.lens-group-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px 14px;
}
.lens-group h3 {
  margin: 0;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--ink);
}
.text-link {
  font-size: 12.5px;
  color: var(--sindura);
}
.lens-note {
  margin: 5px 0 12px;
  font-size: 13px;
  color: var(--ink-2);
}

.sthana-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-bottom: 12px;
  font-size: 12px;
  color: var(--ink-2);
}
.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.phoneme-ribbon {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: stretch;
}
.ph-gap { width: 10px; }
.ph-tile {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  padding: 5px 6px 6px;
  border: 1px solid var(--line);
  border-bottom: 2.5px solid var(--ph-color, var(--line-strong));
  border-radius: 4px;
  background: var(--folio-tile);
  color: var(--ink);
  cursor: pointer;
  transition: transform 140ms var(--ease-out), border-color 140ms var(--ease-out);
}
.ph-tile:hover,
.ph-tile[aria-pressed="true"] {
  border-color: var(--sindura);
  border-bottom-color: var(--ph-color, var(--sindura));
  transform: translateY(-1px);
}
.ph-sym {
  font-family: var(--deva);
  font-size: 16px;
  line-height: 1.2;
}
.ph-iast {
  font-size: 11px;
  color: var(--ink-3);
  line-height: 1.2;
}
.ph-guru {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--sindura);
  margin-top: 2px;
}

.phoneme-detail {
  margin-top: 10px;
  min-height: 1.6em;
  font-size: 13.5px;
  color: var(--ink-2);
}
.phoneme-detail strong { color: var(--ink); }

.symbolic-refs {
  display: grid;
  gap: 10px;
}
.ref-item {
  padding: 11px 14px;
  border-left: 2px solid var(--sindura);
  background: var(--folio-inset);
  border-radius: 0 4px 4px 0;
}
.ref-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 12px;
}
.ref-term {
  font-weight: 600;
  color: var(--ink);
  font-size: 14px;
}
.ref-cite {
  font-size: 11.5px;
  color: var(--ink-3);
}
.ref-note {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--ink-2);
}
.ref-empty {
  margin: 0;
  font-size: 13px;
  color: var(--ink-3);
}

/* ---------- Responsive ---------- */
@media (max-width: 760px) {
  .word-row {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 13px 4px;
  }
  .cot-step {
    grid-template-columns: 24px minmax(0, 1fr);
    gap: 3px 8px;
  }
  .cot-step-derivation,
  .cot-step-sense {
    grid-column: 2;
    text-align: left;
    max-width: none;
  }
  .composer-row {
    flex-direction: column;
  }
  .composer-go {
    justify-content: center;
    min-height: 46px;
  }
}

@media (max-width: 560px) {
  .theatre {
    outline-offset: -5px;
  }
  .folio-corner {
    width: 18px;
    height: 18px;
  }
  .voice-hub {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  .sense-orb-wrap {
    width: 84px;
    height: 84px;
  }
  .load-track {
    margin-left: auto;
    margin-right: auto;
  }
  .hub-controls {
    justify-content: center;
  }
  .theatre-bar {
    justify-content: center;
  }
  .pad-word {
    min-width: 68px;
    padding: 12px 11px 9px;
  }
  .stanza-line {
    grid-template-columns: 22px minmax(0, 1fr);
  }
  .stanza-mark {
    grid-column: 2;
  }
  .sense-main .facts li {
    grid-template-columns: 1fr;
    gap: 2px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .stream-dot,
  .cot-step.is-live::after {
    animation: none !important;
  }
  .fused-view,
  .proof-wire {
    transition: none !important;
  }
}
