:root {
  color-scheme: light;
  --ink: #1f2722;
  --muted: #6b716b;
  --line: #d9ded6;
  --paper: #f7f4ec;
  --panel: #fffdf7;
  --accent: #3f6f68;
  --accent-2: #a05e4b;
  --accent-3: #b5913e;
  --shadow: 0 16px 38px rgba(43, 54, 46, 0.12);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

button,
input,
select,
textarea {
  font: inherit;
}

.app-shell {
  display: grid;
  grid-template-columns:
    minmax(280px, 360px)
    minmax(160px, 200px)
    minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
  border-right: 1px solid var(--line);
  background: #ebe8de;
  padding: 20px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.mark {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid #9fa99b;
  background: #f9f6ed;
  color: var(--accent);
  font-weight: 800;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 18px;
  line-height: 1.1;
}

h2 {
  font-size: 13px;
  margin-bottom: 12px;
  text-transform: uppercase;
  color: #4e584f;
}

.brand p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

/* Language picker (round-1 languages work, 2026-05-11). Three small
   pill buttons; the active language carries aria-checked="true" and
   highlights via the [aria-checked] selector. Catalog button labels
   re-render on click via the JS setLang() handler. */
.language-picker {
  display: flex;
  gap: 6px;
  margin: 12px 0 0;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(33, 25, 15, 0.03);
}

.lang-btn {
  flex: 1;
  padding: 6px 10px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
  font: inherit;
  font-size: 0.88rem;
  color: inherit;
}

.lang-btn:hover {
  background: rgba(33, 25, 15, 0.06);
}

.lang-btn[aria-checked="true"] {
  background: rgba(33, 25, 15, 0.10);
  border-color: rgba(33, 25, 15, 0.20);
  font-weight: 600;
}

.tool-panel {
  border: 1px solid var(--line);
  background: var(--panel);
  padding: 14px;
  box-shadow: var(--shadow);
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

label {
  display: grid;
  gap: 6px;
  min-width: 0;
}

label span {
  color: var(--muted);
  font-size: 12px;
}

.full {
  grid-column: 1 / -1;
}

input,
select,
textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid #cdd4ca;
  border-radius: 4px;
  background: #ffffff;
  color: var(--ink);
  padding: 9px 10px;
}

textarea {
  min-height: 180px;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.5;
}

.button-row,
.action-section {
  display: grid;
  gap: 8px;
}

.action-stack {
  gap: 12px;
}

.primary-action {
  min-height: 46px;
  font-weight: 800;
}

.action-section {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.partner-form-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.partner-form-title {
  margin: 0;
  font-size: 1rem;
}

/* Close button inside the partner form header (2026-06-07). */
.partner-form-close {
  appearance: none;
  border: 0;
  background: transparent;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  line-height: 1;
  color: var(--muted);
  display: grid;
  place-items: center;
  transition: background 0.12s ease, color 0.12s ease;
}

.partner-form-close:hover {
  background: rgba(33, 25, 15, 0.10);
  color: var(--ink);
}

.partner-form-instructions {
  margin: 0 0 10px;
  opacity: 0.78;
  font-size: 0.92rem;
}` above overrides the UA's
   `[hidden] { display: none }

.partner-form-go {
  margin-top: 10px;
  width: 100%;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: white;
  cursor: pointer;
  font: inherit;
}

.partner-form-go:hover {
  filter: brightness(1.05);
}

.partner-form-secondary {
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid rgba(33, 25, 15, 0.28);
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
  font-size: 0.86rem;
  opacity: 0.85;
}

.partner-form-secondary:hover {
  background: rgba(33, 25, 15, 0.06);
  opacity: 1;
}

.timing-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

/* Inline panel-heading variant — used by the Transit panel where
 * the page already has a V-Nav label. Tightens vertical space so
 * the chart sits closer to the top of the page. */
.panel-heading--inline {
  margin-bottom: 4px;
}

button {
  border: 1px solid #315d57;
  border-radius: 4px;
  background: var(--accent);
  color: white;
  cursor: pointer;
  min-height: 38px;
  padding: 8px 10px;
}

button:hover {
  background: #315d57;
}

.mode-active {
  background: #264b46;
}

.workspace {
  min-width: 0;
  padding: 20px;
}

.tabs {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  padding: 20px 12px;
  border-right: 1px solid var(--line);
  background: #f3efe3;
  /* Above the coming-soon veil (z 30) — the sticky bar floats over the
     veiled view while scrolling and must stay tappable. */
  z-index: 40;
  align-self: stretch;
  position: sticky;
  top: 0;
}

.tabs .tab {
  text-align: left;
  padding: 10px 14px;
}

.tabs .tab[hidden] {
  display: none;
}

.tab {
  border-color: #b8c1b5;
  background: #fdfbf5;
  color: #26312a;
}

.tab.active {
  border-color: var(--accent);
  background: var(--accent);
  color: white;
}

.view {
  display: none;
  min-height: calc(100vh - 88px);
}

.view.active {
  display: block;
}

/* Confidence tab is a study/practitioner surface, visually
 * demarcated from the main reading pages. Pushed to the right
 * with a soft separator so the eye groups the four reading
 * pages plus Timing as the primary destinations. */
.tab--study {
  margin-left: auto;
  border-style: dashed;
  opacity: 0.86;
}

/* Charts page: the PHS / Dream / Mandala sub-tabs sit inside a
 * single primary view so the top-level navigation stays at six
 * buttons. role="tablist" on the container deliberately avoids a
 * second <nav> — that would trip the single-interface contract
 * guard. */
.charts-subtabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(33, 25, 15, 0.08);
}

.charts-subtab {
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid #b8c1b5;
  background: #fdfbf5;
  color: #26312a;
  cursor: pointer;
  font: inherit;
  font-size: 0.92rem;
}

.charts-subtab.active,
.charts-subtab[aria-selected="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

.charts-subview {
  display: none;
}

.charts-subview.active {
  display: block;
}

/* The Bodygraph page's chart stage holds the default bodygraph
 * panel plus the four sub-views (PHS, Dream, Rave Mandala,
 * Incarnation Cross). Only one is visible at a time:
 *  - default: `.chart-stage-default` shows the bodygraph SVG
 *  - sub-tab clicked: that `.chart-stage-alt` shows; the default
 *    is hidden via the `:has` selector below
 * Browsers without `:has` support fall back to the bodygraph
 * staying visible behind the active sub-view (no broken state). */
.overview-chart-stage {
  display: grid;
  gap: 14px;
}

#chart-view.subviews-open .overview-chart-stage .chart-stage-default {
  display: none;
}

/* Mandala sub-view inside the Charts page. The render buttons
 * live next to the display area so the user does not have to
 * leave Page 3 to render a wheel. */
.mandala-layout {
  display: grid;
  gap: 14px;
}

.mandala-visual-panel {
  display: grid;
  gap: 12px;
}

.mandala-display {
  min-height: 320px;
  border-radius: 18px;
  background:
    linear-gradient(rgba(33, 25, 15, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(33, 25, 15, 0.04) 1px, transparent 1px),
    rgba(255, 252, 242, 0.38);
  background-size: 28px 28px;
  display: grid;
  place-items: center;
  padding: 18px;
  overflow: auto;
}

.mandala-display svg {
  width: min(100%, 560px);
  height: auto;
}

.mandala-instructions {
  margin: 0;
  opacity: 0.7;
  text-align: center;
}

.status {
  border-left: 4px solid var(--accent-3);
  background: #fffaf0;
  padding: 10px 12px;
  color: #514b3b;
}

/* Hide the status banner whenever it has nothing to say. Only
 * appears for genuine errors / validation messages. */
.status:empty {
  display: none;
}

.overview-layout {
  display: grid;
  grid-template-columns: 1fr;
  align-items: start;
  gap: 14px;
  margin-top: 14px;
}

.overview-bodygraph {
  min-height: 520px;
  overflow: auto;
}

.overview-bodygraph .status {
  margin: 0;
}

.overview-bodygraph svg {
  display: block;
  /* 840px (was 680): the planet-column gutters widened the viewBox, so
     the graph itself needs a larger display budget to read at the same
     size (operator 2026-07-02: "make the whole picture bigger"). */
  width: min(100%, 920px);
  height: auto;
  margin: 0 auto;
}

.overview-secondary-grid {
  display: grid;
  grid-template-columns: minmax(240px, 0.85fr) minmax(320px, 1.15fr);
  gap: 14px;
}

/* Bodygraph inspector skeleton (Phase 1 of the rendering merge).
 * The panel stays `hidden` until Phase 3 wires click selection on the
 * bodygraph. Source-context cards are NOT rendered here — Knowledge
 * supplies that material as a payload in a later phase. */
.bodygraph-inspector {
  border: 1px solid rgba(33, 25, 15, 0.12);
  border-radius: 18px;
  padding: 18px;
  line-height: 1.5;
  overflow: auto;
}

.bodygraph-inspector .inspector-kicker {
  display: inline-block;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.62;
  margin-bottom: 6px;
}

.bodygraph-inspector .inspector-title {
  margin: 0 0 8px;
  font-size: 1.25rem;
}

.bodygraph-inspector .inspector-instructions {
  margin: 0;
  opacity: 0.78;
}

.bodygraph-inspector .inspector-slots {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.bodygraph-inspector .inspector-slot {
  border-top: 1px solid rgba(33, 25, 15, 0.08);
  padding-top: 10px;
}

.bodygraph-inspector .inspector-slot h3 {
  margin: 0 0 6px;
  font-size: 1rem;
}

/* Reading-pace / workspace-launcher skeleton CSS retired for v1.0
   (operator decision 2026-05-13). The `.reading-pace-title` +
   `.reading-pace-instructions` selectors stay because the catalog-
   driven Readings section reuses them; same chrome, single surface. */
.reading-pace-title {
  margin: 0 0 6px;
  font-size: 1.2rem;
}

.reading-pace-instructions {
  margin: 0 0 12px;
  opacity: 0.78;
}

/* Composite relationship-type picker (composite v1 UX, 2026-05-13).
   Four-button 2x2 grid that appears after the composite is computed,
   before any reading button fires. Selection threads into
   /api/catalog-reading as `relationship_type`. */
.composite-relationship-picker {
  border: 1px solid rgba(125, 90, 156, 0.32);
  background: rgba(125, 90, 156, 0.06);
  border-radius: 14px;
  padding: 14px 16px 16px;
  margin: 16px 0 0;
}

.composite-relationship-picker legend {
  padding: 0 8px;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.composite-relationship-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 12px;
  margin-top: 6px;
}

.composite-relationship-grid label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid rgba(33, 25, 15, 0.12);
  border-radius: 8px;
  background: rgba(33, 25, 15, 0.03);
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 0.15s;
}

.composite-relationship-grid label:hover {
  background: rgba(33, 25, 15, 0.08);
}

.composite-relationship-grid label:has(input:checked) {
  background: rgba(33, 25, 15, 0.12);
  border-color: rgba(33, 25, 15, 0.32);
  font-weight: 600;
}

.composite-relationship-grid input[type="radio"] {
  margin: 0;
  cursor: pointer;
}

/* Catalog-driven reading buttons (round-3 contract, 2026-05-07).
   Knowledge owns the canonical labels + emojis at hd/reading_catalog.py;
   Studio renders one tap-to-go button per entry. Both natal depths
   and the ☀️ Daily Transits entry render with this same shape. */
.reading-catalog-buttons {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.reading-catalog-button {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid rgba(33, 25, 15, 0.16);
  background: rgba(33, 25, 15, 0.04);
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.reading-catalog-button:hover {
  background: rgba(33, 25, 15, 0.10);
}

.reading-catalog-button[data-transit-required="yes"] {
  background: rgba(125, 90, 156, 0.10);
  border-color: rgba(79, 58, 97, 0.30);
}

.reading-catalog-button[data-transit-required="yes"]:hover {
  background: rgba(125, 90, 156, 0.18);
}

.reading-catalog-emoji {
  font-size: 1.2rem;
}

.reading-catalog-label {
  font-weight: 600;
  font-size: 0.95rem;
}

/* "Add partner for composite" affordance lives inside the Bodygraph
   result panel (canonical composite entry — 2026-05-21). Hidden until
   a chart is calculated. */
.composite-from-bodygraph {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.composite-from-bodygraph-instructions {
  margin: 0;
  font-size: 0.92rem;
  opacity: 0.86;
}

.composite-from-bodygraph-action {
  align-self: flex-start;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid rgba(33, 25, 15, 0.16);
  background: rgba(125, 90, 156, 0.12);
  cursor: pointer;
  font: inherit;
  font-weight: 600;
}

.composite-from-bodygraph-action:hover {
  background: rgba(125, 90, 156, 0.22);
}

/* When the catalog reading lands a daily payload it carries both
   the structured transit panel AND the LLM narration. Pre-formatted
   the panel since it contains HTML (Telegram-style markup) we want
   visible as-is for parity with the bot output. */
.reading-transit-panel {
  margin-top: 12px;
  padding: 12px;
  border-radius: 10px;
  background: rgba(33, 25, 15, 0.04);
  border: 1px solid rgba(33, 25, 15, 0.10);
}

.reading-transit-panel pre {
  white-space: pre-wrap;
  font-family: inherit;
  font-size: 0.92rem;
  margin: 0;
}

/* Reading workspace output (Phase 4). Hidden until the workspace
 * launcher's "Reading" button kicks off /api/reading. */
.reading-output {
  border: 1px solid rgba(33, 25, 15, 0.12);
  border-radius: 18px;
  padding: 18px;
  display: grid;
  gap: 14px;
}

.reading-output .reading-header h2 {
  margin: 0 0 6px;
}

.reading-output .reading-headline {
  margin: 0;
  opacity: 0.8;
}

.reading-output .reading-chapter {
  border-top: 1px solid rgba(33, 25, 15, 0.08);
  padding-top: 12px;
}

.reading-output .reading-chapter:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.reading-output .reading-chapter h3 {
  margin: 0 0 6px;
  font-size: 1.05rem;
}

.reading-output .reading-chapter p {
  margin: 0;
  line-height: 1.6;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin: 0 0 14px;
}

.metric {
  border: 1px solid var(--line);
  background: var(--panel);
  padding: 14px;
}

.metric span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
}

.metric strong {
  display: block;
  font-size: 18px;
  line-height: 1.2;
}

.columns {
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: 14px;
}

.columns > section,
.list,
pre {
  border: 1px solid var(--line);
  background: var(--panel);
}

.columns > section {
  padding: 14px;
}

.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  border: 1px solid #b9c3b6;
  border-radius: 4px;
  background: #f5f8f1;
  padding: 6px 8px;
  color: #354238;
  font-size: 13px;
}

.list {
  display: grid;
  gap: 0;
  overflow: hidden;
}

.row {
  display: grid;
  grid-template-columns: minmax(96px, 1fr) minmax(0, 1.6fr) minmax(0, 1fr);
  gap: 12px;
  border-top: 1px solid var(--line);
  padding: 10px 12px;
}

/* Longer localized labels (e.g. German "Prioritätsmethode") wrap inside the
   first column instead of overflowing into the value. */
.row strong {
  overflow-wrap: anywhere;
}

.row:first-child {
  border-top: 0;
}

.row small {
  color: var(--muted);
}

.channel-row {
  width: 100%;
  background: transparent;
  border: 0;
  border-top: 1px solid var(--line);
  font: inherit;
  text-align: left;
  cursor: pointer;
  color: inherit;
}

.channel-row:hover {
  background: rgba(33, 25, 15, 0.04);
}

.channel-row:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.spacious {
  margin-top: 12px;
}

.composite-themes {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.compact-list .compact-row {
  grid-template-columns: 78px minmax(0, 1fr) 88px;
  padding: 6px 0;
}

.composite-kpis em {
  display: block;
  color: var(--ink);
  font-size: 12px;
  font-style: normal;
  line-height: 1.25;
  margin-top: 2px;
}

.phs-layout {
  display: grid;
  grid-template-columns: 1fr;
  align-items: start;
  gap: 14px;
}

.dream-layout {
  display: grid;
  grid-template-columns: 1fr;
  align-items: start;
  gap: 14px;
}

.phs-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  align-items: start;
  gap: 12px;
}

/* Composite bodygraph sits up top; person charts go under it. Cap
 * the composite SVG at the same width as the per-person bodygraphs
 * so they read as a coherent set rather than the composite
 * dominating. */
.composite-visual svg {
  display: block;
  width: min(100%, 620px);
  height: auto;
  margin: 0 auto;
}

.phs-card {
  border: 1px solid var(--line);
  background: var(--panel);
  padding: 16px;
  overflow: auto;
}

.phs-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.phs-card-head strong {
  color: var(--accent);
  font-size: 16px;
  text-transform: none;
  white-space: nowrap;
}

.phs-card h2 {
  margin-bottom: 8px;
  color: var(--ink);
  font-size: 20px;
  line-height: 1.2;
  text-transform: none;
}

.phs-card p {
  color: #465148;
  line-height: 1.45;
}

.phs-card dl {
  display: grid;
  gap: 8px;
  margin: 14px 0 0;
}

.phs-card dl > div {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 8px;
  border-top: 1px solid var(--line);
  padding-top: 8px;
}

.phs-card dt {
  color: var(--muted);
  font-size: 12px;
}

.phs-card dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.dream-info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  gap: 12px;
}

.dream-info-card {
  border: 1px solid var(--line);
  background: #fffdf7;
  padding: 14px;
  min-height: 160px;
}

.dream-info-card h3 {
  margin: 0 0 10px;
  font-size: 16px;
  line-height: 1.25;
}

.dream-info-card p {
  color: #465148;
  line-height: 1.45;
}

.dream-info-card .source-note-inline {
  margin-top: 10px;
  border-top: 1px solid #d8d1bf;
  padding-top: 9px;
  color: #7a6652;
  font-size: 12px;
  line-height: 1.4;
}

.dream-info-card dl {
  display: grid;
  gap: 8px;
  margin: 12px 0 0;
}

.dream-info-card dl > div {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 8px;
  border-top: 1px solid var(--line);
  padding-top: 8px;
}

.dream-info-card dt {
  color: var(--muted);
  font-size: 12px;
}

.dream-info-card dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.dream-info-card .list {
  margin-top: 10px;
}

.dream-wide {
  grid-column: 1 / -1;
}

.setup-grid {
  display: grid;
  grid-template-columns: minmax(220px, 0.8fr) minmax(280px, 1.2fr);
  gap: 12px;
  margin-bottom: 12px;
}

.input-card,
.person-card {
  border: 1px solid var(--line);
  background: var(--panel);
  padding: 14px;
}

.person-summary {
  display: grid;
  gap: 8px;
  color: var(--muted);
}

.person-summary strong {
  color: var(--ink);
  font-size: 18px;
  line-height: 1.2;
}

.person-summary span,
.person-summary small {
  font-size: 13px;
}

.person-fields {
  gap: 10px;
}

.people-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.composite-results[hidden] {
  display: none;
}

/* Composite tab empty state — shown when no composite has been
   computed yet (2026-06-07). Keeps the workflow legible from the
   tab itself: "you're in the right place; here's what to do next". */
.composite-empty {
  max-width: 560px;
  margin: 16px auto;
  padding: 24px;
  border: 1px dashed rgba(33, 25, 15, 0.20);
  border-radius: 16px;
  background: rgba(33, 25, 15, 0.03);
}

.composite-empty[hidden] {
  display: none;
}

.composite-empty h2 {
  margin: 0 0 12px;
  color: var(--accent);
}

.composite-empty-instructions {
  margin: 0 0 16px;
  line-height: 1.5;
}

.composite-empty-steps {
  margin: 0 0 20px;
  padding-left: 22px;
  line-height: 1.7;
}

.composite-empty-cta {
  appearance: none;
  border: 1px solid rgba(125, 90, 156, 0.32);
  background: rgba(125, 90, 156, 0.12);
  color: inherit;
  font: inherit;
  font-weight: 700;
  padding: 12px 22px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.12s ease;
}

.composite-empty-cta:hover {
  background: rgba(125, 90, 156, 0.22);
}

.composite-person-charts {
  display: grid;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.composite-person-visual {
  min-height: 340px;
  overflow: auto;
}

.composite-person-visual:empty {
  display: none;
}

.composite-person-visual svg {
  display: block;
  width: min(100%, 310px);
  height: auto;
  margin: 0 auto;
}

.composite-reading {
  display: grid;
  gap: 12px;
}

.composite-details-grid {
  display: grid;
  grid-template-columns: minmax(240px, 0.8fr) minmax(320px, 1.2fr);
  gap: 12px;
}

.compact-list {
  display: grid;
  border: 1px solid var(--line);
  background: #fffdf7;
}

.compact-row {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr) 96px;
  gap: 8px;
  border-top: 1px solid var(--line);
  padding: 7px 9px;
  font-size: 12px;
}

.compact-row:first-child {
  border-top: 0;
}

.compact-row strong,
.compact-row span,
.compact-row small {
  overflow-wrap: anywhere;
}

.compact-row small {
  color: var(--muted);
}

.composite-channel-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: 10px;
}

.composite-channel-grid h2 {
  margin-bottom: 6px;
  font-size: 11px;
}

#composite-output,
#composite-details-output,
#group-output {
  border: 0;
  background: transparent;
  overflow: visible;
}

.timing-mode {
  display: none;
}

.timing-mode.active {
  display: grid;
  grid-template-columns: minmax(360px, 1.25fr) minmax(320px, 0.75fr);
  gap: 12px;
}

/* Returns mode: single column so the horizontal lifecycle timeline
 * gets the full available width, and the Returns analysis sits
 * below it as a stacked panel. */
#returns-timing-section.timing-mode.active {
  grid-template-columns: minmax(0, 1fr);
}

.timing-visual-panel {
  --transit-stage-height: min(70vh, 560px);
  position: relative;
  display: grid;
  grid-template-columns: minmax(300px, 1fr) minmax(210px, 240px);
  grid-template-areas:
    "visual rail"
    "summary summary";
  align-items: stretch;
  column-gap: 18px;
}

/* Lock the transit chart and the slider rail to the same height so
 * the slider track visually matches the bodygraph extent. */
.timing-visual-panel .transit-visual {
  height: var(--transit-stage-height);
}

.timing-visual-panel .transit-visual svg {
  height: 100%;
  width: auto;
  max-width: 100%;
}

.timing-visual-panel .transit-control-rail {
  height: var(--transit-stage-height);
}

/* Date label sits inside the rail above the timeframe pills so it
 * tracks the slider visually. */
.transit-date-label {
  display: block;
  text-align: center;
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.timing-visual-panel .transit-control-rail {
  grid-area: rail;
}

.timing-visual-panel .transit-visual {
  grid-area: visual;
}

.timing-visual-panel .transit-summary-grid {
  grid-area: summary;
}

.transit-control-rail {
  align-self: stretch;
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  gap: 10px;
  width: 100%;
  max-width: 240px;
  justify-self: center;
}

/* Now-snap button (2026-06-07): pinned to the foot of the rail so
   the operator can return to "now" without dragging the slider back
   from an edge. */
.transit-now-button {
  appearance: none;
  border: 1px solid var(--accent);
  background: rgba(63, 111, 104, 0.08);
  color: var(--accent);
  font: inherit;
  font-weight: 600;
  font-size: 12px;
  padding: 6px 14px;
  border-radius: 999px;
  cursor: pointer;
  justify-self: center;
  transition: background 0.12s ease, color 0.12s ease;
}

.transit-now-button:hover {
  background: var(--accent);
  color: #ffffff;
}

.panel-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.panel-heading h2 {
  margin-bottom: 0;
}

.panel-heading strong {
  color: var(--accent);
  font-size: 13px;
}

.slider-row {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  grid-template-areas:
    "range markers";
  align-items: stretch;
  column-gap: 10px;
  margin-bottom: 0;
  height: 100%;
}

.timeframe-switch {
  display: inline-grid;
  grid-template-columns: repeat(3, minmax(72px, 1fr));
  gap: 0;
  width: min(100%, 330px);
  border: 1px solid #b8c1b5;
  border-radius: 4px;
  overflow: hidden;
}

.timing-visual-panel .timeframe-switch {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  width: 100%;
  align-self: start;
}

.timing-visual-panel .timeframe-option {
  min-height: 28px;
  padding-right: 4px;
  padding-left: 4px;
  font-size: 12px;
  letter-spacing: 0.02em;
}

.timeframe-option {
  min-height: 32px;
  border: 0;
  border-left: 1px solid #b8c1b5;
  border-radius: 0;
  background: #fdfbf5;
  color: #26312a;
  font-size: 13px;
}

.timeframe-option:first-child {
  border-left: 0;
}

.timeframe-option.active {
  background: var(--accent);
  color: #ffffff;
}

.slider-row input {
  grid-area: range;
  justify-self: center;
  width: 36px;
  min-width: 36px;
  height: 100%;
  padding: 0;
  accent-color: var(--accent);
  writing-mode: vertical-lr;
  -webkit-appearance: slider-vertical; /* iOS <17.4 / Chromium <129 fallback (mobile QA P0-5) */
  direction: rtl;
}

.slider-markers {
  grid-area: markers;
  position: relative;
  height: 100%;
  margin-top: 0;
  color: var(--muted);
  font-size: 11px;
}

.slider-markers span {
  position: absolute;
  left: 0;
  top: var(--tick-pos, 0%);
  display: flex;
  align-items: center;
  transform: translateY(-50%);
  white-space: nowrap;
}

.slider-markers i {
  display: block;
  width: 7px;
  height: 1px;
  margin-right: 5px;
  background: #b8c1b5;
}

.slider-markers .minor i {
  width: 4px;
  background: #cbd2c7;
}

.slider-markers .major i {
  width: 10px;
  background: #88958a;
}

.slider-markers .center i {
  width: 14px;
  height: 2px;
  background: var(--accent);
}

.slider-markers em {
  font-style: normal;
}

.slider-markers .minor em {
  visibility: hidden;
}

.transit-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.transit-summary-card {
  min-width: 0;
  border: 1px solid #d5dccf;
  background: #fbf8ef;
  padding: 8px 10px;
}

.transit-summary-card span,
.transit-summary-card em {
  display: block;
  min-width: 0;
}

.transit-summary-card span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.transit-summary-card strong {
  display: block;
  margin-top: 2px;
  color: #26312a;
  font-size: 20px;
  line-height: 1;
}

.transit-summary-card em {
  margin-top: 5px;
  overflow: hidden;
  color: #4f5b51;
  font-size: 11px;
  font-style: normal;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* No `min-height` here — the timing-visual-panel pins the chart and
 * rail to the same `--transit-stage-height` (70vh capped at 560px).
 * A `min-height` floor would let the chart outgrow the rail on short
 * viewports and break the slider/chart alignment. */
.transit-visual {
  min-height: 0;
}

.transit-visual svg {
  width: 100%;
  max-width: 560px;
}

/* Lifecycle timeline — horizontal LTR (2026-05-05). The progress
 * axis runs left-to-right; events alternate above/below the axis
 * to avoid label overlap. The JS `--timeline-progress` variable is
 * a percentage (0-100) along the horizontal length. */
.returns-timeline {
  position: relative;
  height: 280px;
  overflow: hidden;
  border: 1px solid #d8d1bf;
  background:
    linear-gradient(180deg, rgba(255, 253, 247, 0.9), rgba(255, 253, 247, 0.48)),
    repeating-linear-gradient(90deg, transparent 0 58px, rgba(63, 111, 104, 0.08) 58px 59px);
  padding: 18px;
}

.timeline-age-label {
  position: absolute;
  top: 8px;
  left: 18px;
  color: #758076;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.timeline-axis {
  position: absolute;
  top: 50%;
  left: 20px;
  right: 20px;
  height: 2px;
  background: linear-gradient(90deg, #c5bba8, #8fa097, #c5bba8);
  transform: translateY(-50%);
}

.timeline-year-scale {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.timeline-year-tick {
  position: absolute;
  left: var(--timeline-progress);
  top: calc(50% + 12px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  transform: translateX(-50%);
  color: #71796f;
  font-size: 10px;
  font-weight: 800;
}

.timeline-year-tick i {
  display: block;
  width: 1px;
  height: 8px;
  background: #adb8aa;
}

.timeline-year-tick em {
  font-style: normal;
}

/* Dot sits ON the horizontal axis at the point's progress. Label
 * floats above (side-left) or below (side-right) using absolute
 * positioning so the dot's coordinate is always on the axis line. */
.timeline-point {
  position: absolute;
  left: var(--timeline-progress);
  top: 50%;
  width: 15px;
  height: 15px;
  transform: translate(-50%, -50%);
  z-index: 2;
}

.timeline-dot {
  display: block;
  width: 100%;
  height: 100%;
  border: 2px solid #2f3b45;
  border-radius: 50%;
  background: #fffdf7;
}

.timeline-label {
  position: absolute;
  left: 50%;
  width: 132px;
  padding: 5px 6px;
  border: 1px solid #d8d1bf;
  background: #fbf7ec;
  border-radius: 4px;
  font-size: 10px;
  text-align: center;
  transform: translateX(-50%);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
}

.timeline-point.side-left .timeline-label {
  bottom: calc(100% + 8px);
}

.timeline-point.side-right .timeline-label {
  top: calc(100% + 8px);
}

.timeline-point.now .timeline-dot {
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: 0 0 0 5px rgba(63, 111, 104, 0.15);
}

.timeline-point.birth .timeline-dot {
  border-color: var(--accent-3);
  background: #f6e7b5;
}

.timeline-point.return .timeline-dot {
  border-color: #3f6f68;
}

.timeline-point.opposition .timeline-dot {
  border-color: #8f7256;
}

.timeline-point.square .timeline-dot {
  border-color: #ad7370;
}

.timeline-point.jupiter .timeline-dot {
  border-color: #b5913e;
  background: #efe0ad;
}

.timeline-point.saturn .timeline-dot {
  border-color: #6d5f52;
  background: #c4b69e;
}

.timeline-point.uranus .timeline-dot {
  border-color: #486e87;
  background: #b6d3e1;
}

.timeline-point.chiron .timeline-dot {
  border-color: #824f65;
  background: #d9b6c4;
}

.timeline-point.past .timeline-label {
  opacity: 0.74;
}

.timeline-point.future .timeline-label {
  box-shadow: 0 10px 20px rgba(43, 54, 46, 0.08);
}

/* (Original .timeline-label rules consolidated into the horizontal
 * timeline rule above 2026-05-05; kept here only for the
 * strong/span typography overrides used by the JS-rendered HTML.) */
.timeline-label strong {
  font-size: 10px;
  display: block;
  font-weight: 700;
}

.timeline-label span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 9px;
  display: block;
}

.returns-subhead {
  margin: 14px 0 7px;
  color: #3f6f68;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.returns-guidance {
  margin: 8px 0 12px;
  border-left: 3px solid #b5913e;
  background: #fbf4df;
  padding: 9px 11px;
  color: #30362f;
  font-size: 13px;
  line-height: 1.35;
}

.returns-source-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin-top: 9px;
}

.source-note {
  border: 1px solid #d8d1bf;
  background: #fbf7ec;
  padding: 10px;
  border-radius: 6px;
}

.source-note strong,
.source-note span,
.source-note small,
.source-note em {
  display: block;
}

.source-note strong {
  font-size: 13px;
}

.source-note span {
  margin-top: 5px;
  color: #30362f;
  font-size: 12px;
  line-height: 1.35;
}

.source-note small,
.source-note em {
  margin-top: 7px;
  color: #758076;
  font-size: 10px;
  line-height: 1.3;
}

.source-note em {
  color: #8f7256;
  font-style: normal;
  font-weight: 800;
}

.confidence-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.confidence-metric {
  border: 1px solid #d7ddcf;
  background: #fbf8ef;
  padding: 12px;
}

.confidence-metric span,
.confidence-metric em {
  display: block;
}

.confidence-metric span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.confidence-metric strong {
  display: block;
  margin-top: 4px;
  color: #26312a;
  font-size: 24px;
  line-height: 1;
}

.confidence-metric em {
  margin-top: 6px;
  color: #5b645d;
  font-size: 11px;
  font-style: normal;
  line-height: 1.25;
}

.confidence-dashboard {
  display: grid;
  grid-template-columns: repeat(2, minmax(280px, 1fr));
  gap: 12px;
}

.source-sync-panel {
  margin-bottom: 14px;
}

.source-extract-panel {
  margin-bottom: 14px;
}

.source-sync-board {
  display: grid;
  grid-template-columns: 1.05fr 1.2fr 0.9fr;
  gap: 12px;
}

.source-extract-board {
  display: grid;
  grid-template-columns: minmax(320px, 1.15fr) minmax(280px, 0.85fr);
  gap: 12px;
}

.source-sync-card {
  min-width: 0;
  border: 1px solid #d7ddcf;
  background: #fbf8ef;
  padding: 13px;
}

.source-extract-card {
  min-width: 0;
  border: 1px solid #d7ddcf;
  background: #fbf8ef;
  padding: 13px;
}

.source-extract-wide {
  grid-column: 1 / -1;
}

.source-sync-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.source-sync-head h3 {
  margin: 0;
  color: #27342d;
  font-size: 16px;
  line-height: 1.2;
}

.source-sync-head strong {
  border: 1px solid #cfd6ca;
  background: #f7f4ec;
  padding: 3px 7px;
  color: #324038;
  font-size: 11px;
  text-transform: uppercase;
}

.source-root-list,
.extraction-lane-list,
.fixture-target-list {
  display: grid;
  gap: 8px;
}

.source-root-item,
.extraction-lane,
.fixture-target {
  display: grid;
  gap: 5px;
  border-top: 1px solid #d7ddcf;
  padding-top: 8px;
}

.source-root-item:first-child,
.extraction-lane:first-child,
.fixture-target:first-child {
  border-top: 0;
  padding-top: 0;
}

.source-root-item strong,
.extraction-lane strong,
.fixture-target strong {
  color: #27342d;
  font-size: 13px;
  line-height: 1.25;
}

.source-root-item span,
.extraction-lane span,
.fixture-target span {
  color: #465148;
  font-size: 12px;
  line-height: 1.35;
}

.source-root-item small,
.extraction-lane small,
.fixture-target small {
  color: #7a6652;
  font-size: 10px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.source-root-item.available strong::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.source-root-item.missing strong::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 6px;
  border-radius: 50%;
  background: #a05e4b;
}

.fixture-target.complete strong::before,
.fixture-target.incomplete strong::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 6px;
  border-radius: 50%;
}

.fixture-target.complete strong::before {
  background: var(--accent);
}

.fixture-target.incomplete strong::before {
  background: #b5913e;
}

.extraction-lane > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.extraction-lane em {
  color: #8f7256;
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
}

.mechanic-rule-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.mechanic-rule {
  display: grid;
  gap: 7px;
  border: 1px solid #d7ddcf;
  background: #fffdf7;
  padding: 10px;
}

.mechanic-rule div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.mechanic-rule h4,
.dream-gate-domain-grid h4 {
  margin: 0;
  color: #27342d;
  font-size: 13px;
  line-height: 1.2;
}

.mechanic-rule span {
  color: #3f6f68;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.mechanic-rule p,
.mechanic-rule small,
.principle-item span,
.principle-item small,
.open-extract-list span {
  margin: 0;
  color: #465148;
  font-size: 12px;
  line-height: 1.35;
}

.mechanic-rule small,
.principle-item small {
  color: #7a6652;
}

.principle-list,
.dream-gate-domain-grid,
.planet-role-list,
.open-extract-list {
  display: grid;
  gap: 8px;
}

.principle-item,
.planet-role-row,
.open-extract-list > div {
  display: grid;
  gap: 5px;
  border-top: 1px solid #d7ddcf;
  padding-top: 8px;
}

.principle-item:first-child,
.planet-role-row:first-child,
.open-extract-list > div:first-child {
  border-top: 0;
  padding-top: 0;
}

.principle-item strong,
.planet-role-row strong,
.open-extract-list strong {
  color: #27342d;
  font-size: 13px;
  line-height: 1.25;
}

.principle-item.open strong::after,
.principle-item.partial strong::after {
  content: "needs extraction";
  margin-left: 7px;
  color: #8f7256;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.dream-gate-domain-grid section {
  display: grid;
  gap: 7px;
  border-top: 1px solid #d7ddcf;
  padding-top: 8px;
}

.dream-gate-domain-grid section:first-child {
  border-top: 0;
  padding-top: 0;
}

.cycle-extract-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
}

.cycle-extract-grid h4 {
  margin: 0 0 8px;
  color: #27342d;
  font-size: 13px;
}

.planet-role-row {
  grid-template-columns: 96px minmax(0, 1fr) 112px;
  align-items: baseline;
  gap: 8px;
}

.planet-role-row span {
  color: #465148;
  font-size: 12px;
  line-height: 1.35;
}

.planet-role-row em {
  color: #7a6652;
  font-size: 10px;
  font-style: normal;
  font-weight: 900;
  text-align: right;
  text-transform: uppercase;
}

.phs-extract-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
}

.phs-extract-table {
  display: grid;
  gap: 8px;
  border: 1px solid #d7ddcf;
  background: #fffdf7;
  padding: 10px;
}

.phs-extract-table > div:first-child {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.phs-extract-table h4 {
  margin: 0;
  color: #27342d;
  font-size: 13px;
  line-height: 1.2;
}

.phs-extract-table span {
  color: #7a6652;
  font-size: 10px;
  font-weight: 900;
  text-align: right;
  text-transform: uppercase;
}

.phs-extract-table small {
  color: #465148;
  font-size: 11px;
  line-height: 1.35;
}

.phs-row-list {
  display: grid;
  gap: 4px;
}

.phs-row-list em {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 5px;
  color: #3d493f;
  font-size: 11px;
  font-style: normal;
  line-height: 1.25;
}

.phs-row-list strong {
  color: #3f6f68;
  font-size: 11px;
  font-weight: 900;
}

.tone-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.tone-chip-row span {
  border: 1px solid #d7ddcf;
  background: #f7f4ec;
  padding: 5px 7px;
  color: #324038;
  font-size: 11px;
  font-weight: 800;
}

.wa-extract-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  gap: 12px;
}

.wa-layer-group {
  display: grid;
  gap: 7px;
}

.wa-layer-group h4 {
  margin: 0;
  color: #27342d;
  font-size: 13px;
  line-height: 1.2;
  text-transform: capitalize;
}

.wa-channel-row {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) minmax(120px, 0.75fr);
  gap: 8px;
  align-items: baseline;
  border-top: 1px solid #e2e6dc;
  padding-top: 7px;
}

.wa-channel-row strong {
  color: #3f6f68;
  font-size: 13px;
  font-weight: 900;
}

.wa-channel-row span {
  color: #39453d;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.25;
}

.wa-channel-row em {
  color: #7a6652;
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
  line-height: 1.25;
}

.confidence-card {
  min-width: 0;
  border: 1px solid #d7ddcf;
  border-left-width: 5px;
  background: #fffaf0;
  padding: 13px;
}

.confidence-card.verified,
.confidence-card.high {
  border-left-color: var(--accent);
}

.confidence-card.medium {
  border-left-color: #b5913e;
}

.confidence-card.partial {
  border-left-color: #8f7256;
}

.confidence-card.heuristic {
  border-left-color: #7d5a9c;
}

.confidence-card.missing {
  border-left-color: #a05e4b;
}

.confidence-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.confidence-card-head span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.confidence-card h3 {
  margin: 3px 0 0;
  font-size: 17px;
  line-height: 1.15;
}

.confidence-card-head strong {
  flex: 0 0 auto;
  border: 1px solid #cfd6ca;
  background: #f7f4ec;
  padding: 4px 7px;
  color: #324038;
  font-size: 11px;
  text-transform: uppercase;
}

.confidence-meter {
  height: 8px;
  overflow: hidden;
  margin: 12px 0;
  border: 1px solid #cfd6ca;
  background: #ebe8de;
}

.confidence-meter i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #3f6f68, #b5913e);
}

.confidence-card dl {
  display: grid;
  gap: 6px 10px;
  grid-template-columns: 116px minmax(0, 1fr);
  margin: 0;
}

.confidence-card dt {
  color: #4e584f;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.confidence-card dd {
  min-width: 0;
  margin: 0;
  color: #2b332d;
  font-size: 13px;
  line-height: 1.4;
}

.evidence-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.evidence-chip-list span {
  border: 1px solid #d7ddcf;
  background: #fffdf7;
  padding: 4px 6px;
  color: #3d493f;
  font-size: 10px;
  font-weight: 800;
  line-height: 1.2;
}

.source-gap-panel {
  margin-top: 14px;
}

.source-gap-board {
  display: grid;
  grid-template-columns: repeat(3, minmax(240px, 1fr));
  gap: 12px;
}

.source-gap-group {
  min-width: 0;
  border: 1px solid #d7ddcf;
  background: #fbf8ef;
  padding: 13px;
}

.source-gap-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.source-gap-head h3 {
  margin: 0;
  font-size: 16px;
  line-height: 1.2;
}

.source-gap-head strong {
  border: 1px solid #cfd6ca;
  background: #f7f4ec;
  padding: 3px 7px;
  color: #324038;
  font-size: 11px;
}

.source-gap-list {
  display: grid;
  gap: 8px;
}

.source-gap-item {
  display: grid;
  gap: 5px;
  border-top: 1px solid #d7ddcf;
  padding-top: 8px;
}

.source-gap-item:first-child {
  border-top: 0;
  padding-top: 0;
}

.source-gap-item strong {
  color: #27342d;
  font-size: 13px;
  line-height: 1.25;
}

.source-gap-item span {
  color: #465148;
  font-size: 12px;
  line-height: 1.35;
}

.source-gap-item small {
  color: #7a6652;
  font-size: 11px;
  line-height: 1.3;
}

.two-up {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}

pre {
  min-height: 70vh;
  overflow: auto;
  margin: 0;
  padding: 14px;
  font-size: 12px;
  line-height: 1.45;
}

@media (max-width: 900px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  /* Mobile-first page nav: turn the V-Nav into a horizontal chip rail
     that scrolls if the labels overflow. Sticky to the top so the
     user can switch pages while scrolled deep into a workspace. */
  .tabs {
    flex-direction: row;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 10px 12px;
    gap: 6px;
    position: sticky;
    top: 0;
    /* above the coming-soon veil (z 30) — must stay tappable */
    z-index: 40;
  }

  .tabs .tab {
    flex: 0 0 auto;
    text-align: center;
    padding: 8px 14px;
    white-space: nowrap;
  }

  .workspace {
    padding: 14px;
  }

  /* Single-column timing layout: mechanics stacks below the reading. */
  #transit-timing-section .transit-mechanics-panel {
    grid-column: 1;
    grid-row: auto;
  }

  .overview-bodygraph-panel,
  .phs-visual-panel,
  .dream-visual-panel {
    order: -1;
  }

  .phs-card {
    aspect-ratio: auto;
  }

  .overview-bodygraph {
    min-height: 360px;
  }

  .overview-bodygraph svg {
    width: min(100%, 560px);
  }

  .row {
    grid-template-columns: 1fr;
  }

  .transit-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .confidence-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .confidence-dashboard {
    grid-template-columns: 1fr;
  }

  .source-sync-board {
    grid-template-columns: 1fr;
  }

  .planet-role-row {
    grid-template-columns: 1fr;
  }

  .wa-channel-row {
    grid-template-columns: 1fr;
  }

  .source-gap-board {
    grid-template-columns: 1fr;
  }

  .returns-source-grid {
    grid-template-columns: 1fr;
  }

  .confidence-card dl {
    grid-template-columns: 1fr;
  }

  .transit-visual {
    min-height: 360px;
  }

  .returns-timeline {
    min-height: 420px;
  }

  .timeline-axis {
    /* Vertical axis on mobile (P0-4 fix 2026-07-13: the old override
       repositioned everything to left:26px but never mapped
       --timeline-progress to the vertical axis, so every dot + label
       stacked at one coordinate). */
    left: 26px;
    right: auto;
    top: 20px;
    bottom: 20px;
    width: 2px;
    height: auto;
    transform: none;
    background: linear-gradient(180deg, #c5bba8, #8fa097, #c5bba8);
  }

  .timeline-age-label {
    left: 4px;
  }

  .timeline-year-tick {
    left: 2px;
    min-width: 20px;
    top: var(--timeline-progress);
    transform: translateY(-50%);
  }

  .timeline-year-tick i {
    width: 8px;
  }

  .timeline-year-tick em {
    display: none;
  }

  .timeline-point,
  .timeline-point.side-left,
  .timeline-point.side-right {
    left: 26px;
    top: var(--timeline-progress);
    transform: translateY(-50%);
    width: calc(100% - 34px);
    height: auto;
    margin-left: 0;
    display: grid;
    grid-template-columns: 22px minmax(0, 1fr);
    align-items: center;
  }
  .timeline-point .timeline-label {
    position: static;
    transform: none;
    width: auto;
    text-align: left;
  }

  .timeline-point.side-left .timeline-dot,
  .timeline-point.side-right .timeline-dot {
    grid-column: 1;
    justify-self: start;
    transform: translateX(-50%);
  }

  .timeline-point.side-left .timeline-label {
    text-align: left;
  }
}

@media (max-width: 500px) {
  .timing-visual-panel {
    grid-template-columns: 1fr;
    grid-template-areas:
      "heading"
      "visual"
      "rail"
      "summary";
  }

  .timing-visual-panel .transit-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .confidence-summary {
    grid-template-columns: 1fr;
  }
}

/* ---------------------------------------------------------------------------
 * Studio Cosmology workspace
 *
 * Chart-independent storytelling surface. Sister to the chart-linked
 * Story workspace (Reading) but driven by theme/mode/depth pickers
 * instead of birth data. Layout intent: one full-width panel that
 * holds the pickers up top, the rendered story in the middle, and
 * the source panel below — so the operator's reading rhythm goes
 * pick → read → check the source. Same paper-and-ink palette as the
 * rest of the app to keep the page coherent.
 * --------------------------------------------------------------------------- */

#cosmology-view.view {
  padding: 0;
}

.cosmology-panel {
  display: grid;
  gap: 18px;
  border: 1px solid rgba(33, 25, 15, 0.12);
  border-radius: 18px;
  background: var(--panel);
  padding: 22px 24px;
  box-shadow: var(--shadow);
}

.cosmology-header h2 {
  margin: 0 0 4px;
  text-transform: none;
  font-size: 22px;
  letter-spacing: 0;
  color: var(--ink);
}

.cosmology-instructions {
  margin: 0;
  max-width: 64ch;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.cosmology-controls {
  display: grid;
  gap: 12px;
}

.cosmology-secondary-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: end;
}

.cosmology-fieldset {
  border: 1px solid rgba(33, 25, 15, 0.10);
  border-radius: 12px;
  padding: 10px 14px 12px;
  margin: 0;
  background: rgba(255, 252, 242, 0.5);
}

.cosmology-fieldset-tight {
  flex: 0 0 auto;
  padding: 8px 12px 10px;
}

.cosmology-fieldset legend {
  padding: 0 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.cosmology-options {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.cosmology-fieldset:not(.cosmology-fieldset-tight) .cosmology-options {
  gap: 6px;
}

.cosmology-option {
  border: 1px solid #b8c1b5;
  background: #fdfbf5;
  color: #26312a;
  padding: 5px 12px;
  border-radius: 999px;
  cursor: pointer;
  font: inherit;
  font-size: 0.88rem;
  min-height: 30px;
}

.cosmology-fieldset:not(.cosmology-fieldset-tight) .cosmology-option {
  padding: 6px 14px;
  font-size: 0.92rem;
  min-height: 34px;
}

.cosmology-option:hover {
  background: #f3eedc;
}

.cosmology-option[aria-checked="true"] {
  border-color: var(--accent);
  background: var(--accent);
  color: white;
}

.cosmology-loading {
  color: var(--muted);
  font-size: 12px;
  font-style: italic;
  animation: cosmology-loading-pulse 1.4s ease-in-out infinite;
}

@keyframes cosmology-loading-pulse {
  0%, 100% { opacity: 0.45; }
  50%      { opacity: 1.0; }
}

.cosmology-render-button {
  margin-left: auto;
  min-height: 38px;
  padding: 0 18px;
  border-radius: 8px;
}

@media (max-width: 720px) {
  .cosmology-render-button {
    margin-left: 0;
    width: 100%;
  }
}

.cosmology-story {
  border: 1px solid rgba(33, 25, 15, 0.12);
  border-radius: 12px;
  padding: 22px 24px;
  background: #fffdf7;
  line-height: 1.6;
}

.cosmology-story-header h3 {
  margin: 0 0 4px;
  font-size: 18px;
  text-transform: none;
  letter-spacing: 0;
  color: var(--ink);
}

.cosmology-story-subtitle {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 12px;
  font-style: italic;
}

.cosmology-story-body p {
  margin: 0 0 12px;
  color: var(--ink);
  font-size: 15px;
}

.cosmology-story-body p:last-child {
  margin-bottom: 0;
}

.cosmology-chapter {
  margin: 0 0 18px;
  padding: 0 0 14px;
  border-bottom: 1px solid rgba(33, 25, 15, 0.06);
}

.cosmology-chapter:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: 0;
}

.cosmology-chapter h4 {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--accent);
  text-transform: none;
}

.cosmology-sources {
  border: 1px dashed rgba(33, 25, 15, 0.18);
  border-radius: 12px;
  padding: 14px 18px;
  background: rgba(63, 111, 104, 0.04);
  /* Visual demarcation from the story panel above so a source
   * snippet can never be misread as part of the narration. The
   * dashed border + tinted background read as "study material,
   * not story." */
  margin-top: 4px;
}

.cosmology-sources h3 {
  margin: 0 0 4px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.cosmology-sources-instructions {
  margin: 0 0 10px;
  font-size: 11px;
  color: var(--muted);
}

.cosmology-sources-list {
  display: grid;
  gap: 8px;
}

.cosmology-source {
  border: 1px solid rgba(33, 25, 15, 0.08);
  border-radius: 8px;
  background: #fffdf7;
}

.cosmology-source > summary {
  cursor: pointer;
  padding: 10px 14px;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 12px;
  list-style: none;
}

.cosmology-source > summary::-webkit-details-marker {
  display: none;
}

.cosmology-source > summary::before {
  content: "▸";
  color: var(--muted);
  font-size: 11px;
  margin-right: 2px;
}

.cosmology-source[open] > summary::before {
  content: "▾";
}

.cosmology-source > summary strong {
  font-weight: 600;
  color: var(--ink);
  font-size: 13px;
}

.cosmology-source-meta {
  font-size: 11px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.cosmology-source-snippet {
  margin: 0;
  padding: 0 14px 12px;
  font-size: 12px;
  line-height: 1.55;
  color: #4f5b51;
  font-style: italic;
}

.cosmology-sources-empty {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
  font-style: italic;
}

.cosmology-recovery-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.cosmology-recovery-button {
  border: 1px solid var(--accent);
  background: rgba(63, 111, 104, 0.08);
  color: var(--accent);
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 600;
}

.cosmology-recovery-button:hover {
  background: var(--accent);
  color: white;
}

@media (max-width: 720px) {
  .cosmology-panel {
    padding: 16px;
  }
  .cosmology-story,
  .cosmology-sources {
    padding: 14px 16px;
  }
}

/* ---------------------------------------------------------------------------
 * Chart zoom modal — clicking any chart SVG opens it full-window for
 * close inspection. The cloned SVG honours every render-pipeline
 * invariant (no layout/processing change), just gets stretched to fit
 * the viewport. Backdrop is the same warm parchment as the page so the
 * chart reads in its native palette.
 * --------------------------------------------------------------------------- */

.chart-zoom-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(33, 25, 15, 0.84);
  backdrop-filter: blur(2px);
}

.chart-zoom-modal[hidden] {
  display: none;
}

.chart-zoom-stage {
  position: relative;
  width: min(96vw, 1300px);
  height: min(94vh, 1800px);
  background: var(--paper);
  border-radius: 12px;
  padding: 18px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
}

.chart-zoom-stage svg {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.chart-zoom-close {
  position: fixed;
  top: 18px;
  right: 22px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.08);
  color: #fffdf7;
  cursor: pointer;
  font-size: 24px;
  line-height: 1;
  font-weight: 300;
  display: grid;
  place-items: center;
  z-index: 10000;
}

.chart-zoom-close:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.6);
}

/* Hint that chart SVGs are clickable */
/* Planet-column rows open the inspector — show they're interactive */
#overview-bodygraph svg [data-planet],
#chart-zoom-stage svg [data-planet] {
  cursor: pointer;
}

/* When zoom modal is open, prevent body scroll */
body.chart-zoom-open {
  overflow: hidden;
}

/* ---------------------------------------------------------------------------
 * Inspector popup (2026-06-07). Clicking a gate, centre, or channel inside
 * the bodygraph SVG opens this modal with the Knowledge-rendered text.
 * Replaces the inline aside panel. The bodygraph-inspector aside element
 * stays in the DOM (hidden) so legacy JS hooks don't crash.
 * --------------------------------------------------------------------------- */
.bodygraph-inspector {
  display: none !important;
}

.inspector-modal {
  position: fixed;
  inset: 0;
  /* Above the chart-zoom modal (9999) so tapping a gate/channel while
     zoomed shows the inspector on top of the zoomed chart. */
  z-index: 10000;
  display: grid;
  place-items: center;
  padding: 24px;
}

.inspector-modal[hidden] {
  display: none;
}

.inspector-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(33, 25, 15, 0.62);
  backdrop-filter: blur(2px);
  cursor: pointer;
}

.inspector-modal-card {
  position: relative;
  width: min(560px, 100%);
  max-height: 86vh;
  overflow-y: auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 24px 26px 20px;
  color: var(--ink);
}

.inspector-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  appearance: none;
  border: 0;
  background: transparent;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  font: inherit;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  color: var(--muted);
  transition: background 0.12s ease, color 0.12s ease;
}

.inspector-modal-close:hover {
  background: rgba(33, 25, 15, 0.10);
  color: var(--ink);
}

.inspector-modal-kicker {
  display: inline-block;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 4px;
}

.inspector-modal-title {
  margin: 0 0 12px;
  font-size: 1.35rem;
  line-height: 1.25;
}

.inspector-modal-summary {
  margin: 0 0 12px;
  line-height: 1.5;
  white-space: pre-wrap;
}

/* Channel popup: drill-down chips for the two gates that compose
   the channel. Tapping a chip re-fires the inspector with the gate
   payload. */
.inspector-modal-gates {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 4px 0 12px;
}

.inspector-modal-gates[hidden] {
  display: none;
}

.inspector-modal-gate-chip {
  appearance: none;
  border: 1px solid rgba(125, 90, 156, 0.32);
  background: rgba(125, 90, 156, 0.10);
  color: inherit;
  font: inherit;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.12s ease;
}

.inspector-modal-gate-chip:hover {
  background: rgba(125, 90, 156, 0.22);
}

.inspector-modal-line-title {
  margin: 16px 0 4px;
  font-size: 0.95rem;
  color: var(--accent);
}

.inspector-modal-study {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 0.94rem;
  line-height: 1.55;
  white-space: pre-wrap;
}

.inspector-modal-sources {
  margin-top: 14px;
  font-size: 0.86rem;
}

.inspector-modal-sources summary {
  cursor: pointer;
  color: var(--muted);
}

.inspector-modal-sources-list {
  margin: 8px 0 0;
  padding-left: 20px;
  display: grid;
  gap: 6px;
}

.inspector-modal-sources-list em {
  color: var(--muted);
  font-style: normal;
}

/* Hover cursor + opacity on SVG inspector targets — gates, centres,
   channels. SVG ids are uniquified (`r{N}-{hash}-Gate64`) and gain a
   trailing `-zoom` in the zoom clone, so contains-matches (`*=`) catch
   both. Scoped via :is() to BOTH the inline bodygraph AND the zoom
   stage so the selection affordance works while zoomed (operator
   2026-06-07: "in the zoom the selection graphic is not working, the
   mouse cursor looks a bit weird"). */
:is(#overview-bodygraph, #chart-zoom-stage) svg [id*="-Gate"]:not([id*="-GateSpan"]),
:is(#overview-bodygraph, #chart-zoom-stage) svg [id*="-Channel"],
:is(#overview-bodygraph, #chart-zoom-stage) svg [id*="-Ajna"],
:is(#overview-bodygraph, #chart-zoom-stage) svg [id*="-Head"],
:is(#overview-bodygraph, #chart-zoom-stage) svg [id*="-Throat"],
:is(#overview-bodygraph, #chart-zoom-stage) svg [id*="-Sacral"],
:is(#overview-bodygraph, #chart-zoom-stage) svg [id*="-Spleen"],
:is(#overview-bodygraph, #chart-zoom-stage) svg [id*="-Root"],
:is(#overview-bodygraph, #chart-zoom-stage) svg [id*="-Heart"],
:is(#overview-bodygraph, #chart-zoom-stage) svg [id*="-Ego"],
:is(#overview-bodygraph, #chart-zoom-stage) svg [id*="-SolarPlexus"] {
  cursor: pointer;
  transition: opacity 0.12s ease;
}

:is(#overview-bodygraph, #chart-zoom-stage) svg [id*="-Gate"]:not([id*="-GateSpan"]):hover {
  opacity: 0.72;
}

/* Channels are transparent hit-line <line> elements that already carry
   an inline `style="cursor: pointer"`, so they show the pointer in both
   inline and zoom views without extra CSS. We deliberately do NOT paint
   them on hover — an earlier 2026-06-07 experiment did, and the accent
   stroke bled through the centres (the channel line passes under centre
   shapes), producing a visible artifact. */

/* Prevent body scroll while inspector modal is open. */
body.inspector-modal-open {
  overflow: hidden;
}

/* Incarnation Cross reading panel (deterministic, 2026-06-12) */
.cross-reading-panel { margin-top: 1.5rem; }
.cross-reading { padding: 0.25rem 0; }
.cross-reading .cross-name {
  font-size: 1.1rem; color: var(--accent); margin: 0 0 0.5rem 0;
}
.cross-reading .cross-intro,
.cross-reading .cross-angle {
  color: var(--ink); line-height: 1.55; margin: 0 0 0.75rem 0; max-width: 60ch;
}
.cross-reading .cross-angle {
  border-left: 3px solid var(--accent-3); padding-left: 0.75rem; color: var(--muted);
}
.cross-spheres {
  display: grid; gap: 0.75rem; margin-top: 1rem;
}
.cross-sphere {
  border: 1px solid var(--line); border-radius: 8px;
  padding: 0.75rem 0.9rem; background: rgba(255,255,255,0.4);
}
.cross-sphere-role {
  font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--accent-2); margin-bottom: 0.2rem;
}
.cross-sphere-gate { color: var(--ink); margin-bottom: 0.15rem; }
.cross-sphere-hint { font-size: 0.85rem; color: var(--muted); margin-bottom: 0.35rem; }
.cross-sphere-text { margin: 0; line-height: 1.5; color: var(--ink); }
@media (min-width: 900px) {
  .cross-spheres { grid-template-columns: 1fr 1fr; }
}

/* Dream Rave matrix — native UI (replaces the SVG, 2026-06-12) */
.dream-matrix { padding: 0.25rem 0; }
.dream-matrix-head { display: flex; gap: 0.6rem; align-items: baseline; margin-bottom: 0.9rem; }
.dream-matrix-head strong { font-size: 1.05rem; color: var(--accent); }
.dream-matrix-head span { color: var(--muted); font-size: 0.9rem; }
.dream-domains { display: grid; gap: 0.85rem; grid-template-columns: 1fr; }
@media (min-width: 720px) { .dream-domains { grid-template-columns: repeat(3, 1fr); } }
.dream-domain { border: 1px solid var(--line); border-radius: 10px; padding: 0.7rem 0.75rem; background: rgba(255,255,255,0.45); }
.dream-domain-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 0.6rem; }
.dream-domain-head h4 { margin: 0; font-size: 0.95rem; color: var(--ink); }
.dream-domain-count { font-size: 0.72rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.dream-domain-tiles { display: grid; gap: 0.4rem; }
.dream-gate-tile {
  position: relative; display: flex; align-items: center; gap: 0.5rem;
  padding: 0.4rem 0.55rem; border: 1px solid var(--line); border-radius: 7px;
  background: var(--paper); opacity: 0.55;
}
.dream-gate-tile.on { opacity: 1; border-color: var(--accent); background: rgba(63,111,104,0.10); }
.dgt-gate { font-weight: 800; font-variant-numeric: tabular-nums; min-width: 1.7em; color: var(--ink); }
.dgt-theme { font-size: 0.85rem; color: var(--ink); }
.dream-gate-tile:not(.on) .dgt-theme { color: var(--muted); }
.dgt-portal { margin-left: auto; color: var(--accent-3); font-size: 0.95rem; }
.dream-structural { margin-top: 0.9rem; display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.dream-structural-label { font-size: 0.78rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }

/* PHS Four-Arrows native overview (replaces the SVG, 2026-06-12) */
.phs-arrows { display: grid; gap: 0.6rem; grid-template-columns: 1fr 1fr; }
@media (min-width: 760px) { .phs-arrows { grid-template-columns: repeat(4, 1fr); } }
.phs-arrow-tile {
  border: 1px solid var(--line); border-radius: 10px; padding: 0.7rem 0.6rem;
  background: rgba(255,255,255,0.45); text-align: center;
}
.phs-arrow-tile.phs-left { border-top: 3px solid var(--accent-2); }
.phs-arrow-tile.phs-right { border-top: 3px solid var(--accent); }
.phs-arrow-name { font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.phs-arrow-glyph { font-size: 1.8rem; line-height: 1.1; color: var(--ink); }
.phs-arrow-theme { font-size: 0.9rem; color: var(--ink); font-weight: 700; }
.phs-arrow-dir { font-size: 0.72rem; color: var(--muted); margin-top: 0.15rem; }

/* ---------------------------------------------------------------------------
 * Tester feedback widget (2026-06-21). Floating button + small modal panel.
 * --------------------------------------------------------------------------- */
.feedback-fab {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 9998;
  appearance: none;
  border: 1px solid rgba(33, 25, 15, 0.18);
  background: var(--panel);
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 10px 16px;
  border-radius: 999px;
  box-shadow: var(--shadow);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.feedback-fab:hover { background: rgba(125, 90, 156, 0.12); }

.feedback-panel {
  position: fixed;
  inset: 0;
  z-index: 10001;
  display: grid;
  place-items: center;
  padding: 24px;
}
.feedback-panel[hidden] { display: none; }
.feedback-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(33, 25, 15, 0.55);
  backdrop-filter: blur(2px);
  cursor: pointer;
}
.feedback-card {
  position: relative;
  width: min(460px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 22px 24px 18px;
}
.feedback-card h2 { margin: 0 0 8px; font-size: 1.2rem; }
.feedback-close {
  position: absolute;
  top: 12px; right: 12px;
  appearance: none; border: 0; background: transparent;
  width: 30px; height: 30px; border-radius: 999px;
  cursor: pointer; font-size: 15px; color: var(--muted);
  display: grid; place-items: center;
}
.feedback-close:hover { background: rgba(33, 25, 15, 0.10); color: var(--ink); }
.feedback-hint { margin: 0 0 12px; font-size: 0.88rem; opacity: 0.82; line-height: 1.5; }
.feedback-text {
  width: 100%;
  resize: vertical;
  font: inherit;
  font-size: 0.95rem;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  box-sizing: border-box;
}
.feedback-actions {
  display: flex; align-items: center; gap: 12px; margin-top: 12px;
}
.feedback-send {
  appearance: none;
  border: 1px solid rgba(125, 90, 156, 0.32);
  background: rgba(125, 90, 156, 0.14);
  color: inherit; font: inherit; font-weight: 700;
  padding: 9px 18px; border-radius: 999px; cursor: pointer;
}
.feedback-send:hover { background: rgba(125, 90, 156, 0.24); }
.feedback-status { font-size: 0.85rem; color: var(--accent); }

@media (max-width: 900px) {
  .feedback-fab { right: 12px; bottom: 12px; padding: 9px 13px; font-size: 0.85rem; }
}

/* ---------------------------------------------------------------------------
 * My Charts — ephemeral guest library (2026-06-21).
 * --------------------------------------------------------------------------- */
.my-charts-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  margin-bottom: 8px;
}
.my-charts-head h2 { margin: 0; }
.my-charts-save {
  appearance: none; border: 1px solid rgba(33, 25, 15, 0.16);
  background: rgba(125, 90, 156, 0.10); color: inherit; font: inherit;
  font-size: 0.82rem; font-weight: 600; padding: 6px 12px;
  border-radius: 999px; cursor: pointer; white-space: nowrap;
}
.my-charts-save:hover { background: rgba(125, 90, 156, 0.20); }
.my-charts-status { font-size: 0.82rem; color: var(--accent); min-height: 1em; margin-bottom: 6px; }
.my-charts-empty { font-size: 0.85rem; opacity: 0.7; margin: 0; }
.my-charts-list { display: grid; gap: 6px; }
.my-charts-item {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 4px;
}
.my-charts-item strong { font-size: 0.92rem; color: var(--ink); }
.my-charts-item small { color: var(--muted); font-size: 0.8rem; }

/* Download-PDF button in the reading header (2026-06-21). */
.reading-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.reading-pdf-btn {
  appearance: none; border: 1px solid rgba(63, 111, 104, 0.4);
  background: rgba(63, 111, 104, 0.10); color: var(--accent);
  font: inherit; font-weight: 600; font-size: 0.85rem;
  padding: 7px 14px; border-radius: 999px; cursor: pointer; white-space: nowrap;
}
.reading-pdf-btn:hover { background: var(--accent); color: #fff; }
.reading-pdf-btn:disabled { opacity: 0.6; cursor: default; }

/* ---------------------------------------------------------------------------
 * First-visit welcome banner (2026-06-21). Sticky top strip, dismissible.
 * --------------------------------------------------------------------------- */
.welcome-banner {
  position: sticky;
  top: 0;
  z-index: 9997;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: var(--accent);
  color: #fff;
  font-size: 0.9rem;
  line-height: 1.4;
}
.welcome-banner[hidden] { display: none; }
.welcome-text { display: block; }
.welcome-text strong { margin-right: 6px; }
.welcome-dismiss {
  margin-left: auto;
  flex: 0 0 auto;
  appearance: none;
  border: 0;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  width: 28px; height: 28px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
}
.welcome-dismiss:hover { background: rgba(255, 255, 255, 0.32); }
@media (max-width: 900px) { .welcome-banner { font-size: 0.82rem; padding: 9px 12px; } }
/* Mobile: banner scrolls away instead of pinning ~110px over the sticky
   tab rail (mobile QA P1-7, 2026-07-13). */
@media (max-width: 700px) {
  .welcome-banner { position: static; }
  .welcome-dismiss { width: 40px; height: 40px; }
}

/* Labeled-reading section headings (ratified standard 2026-07-02).
   Same contract as the PDF: "Your Type — X", "How Your Energy Is
   Wired", "This Week", … render as headings inside the reading. */
.reading-output .reading-section-label {
  margin: 18px 0 6px;
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--accent);
  border-bottom: 1px solid rgba(63, 111, 104, 0.25);
  padding-bottom: 4px;
}

/* Clickable PHS cards + dream-gate targets (pop-out feature 2026-07-06) */
.phs-card-clickable {
  cursor: pointer;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}
.phs-card-clickable:hover,
.phs-card-clickable:focus-visible {
  box-shadow: 0 3px 14px rgba(63, 111, 104, 0.22);
  transform: translateY(-1px);
  outline: none;
}

/* The bodygraph stage's companion panels (readings, summary,
   composite affordance, centres/channels lists) belong ONLY to the
   default stage (operator 2026-07-07/08: "each window opened by one
   button... no redundant or duplicate things"). When any
   charts-subview (PHS / Dream / Mandala / Incarnation Cross) is
   active, every overview-layout sibling of the stage hides — each
   subview panel shows only its own content. */
#chart-view.subviews-open .overview-layout > :not(.overview-chart-stage) {
  display: none;
}

/* Account panel + reading quota (operator go-live 2026-07-09) */
.account-panel { margin-bottom: 14px; }
.account-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.account-chip {
  font-size: 0.8rem; font-weight: 700; color: var(--accent);
  background: rgba(63, 111, 104, 0.12); padding: 2px 9px; border-radius: 10px;
}
.account-quota-line { font-size: 0.82rem; color: var(--muted); margin: 6px 0 4px; }
.account-blurb { font-size: 0.85rem; color: var(--muted); margin: 6px 0 8px; }
.account-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.account-btn {
  font: inherit; font-size: 0.85rem; font-weight: 600; cursor: pointer;
  padding: 7px 14px; border-radius: 8px; border: 1px solid var(--accent);
  background: var(--accent); color: #fff; transition: filter 0.15s ease;
}
.account-btn:hover { filter: brightness(1.06); }
.account-btn-ghost { background: transparent; color: var(--accent); }
.account-form { display: flex; flex-direction: column; gap: 9px; margin-top: 8px; }
.account-field { display: flex; flex-direction: column; gap: 3px; font-size: 0.82rem; color: var(--muted); }
.account-field input {
  font: inherit; padding: 7px 9px; border-radius: 7px;
  border: 1px solid var(--line, #d9ded6); background: var(--panel, #fff);
}
.account-form-status { font-size: 0.8rem; color: var(--accent2, #a05e4b); min-height: 1em; margin: 0; }
.account-signed-in { margin-top: 8px; }
.reading-quota-cta {
  background: rgba(160, 94, 75, 0.08); border: 1px solid rgba(160, 94, 75, 0.25);
  border-radius: 10px; padding: 14px 16px; margin-bottom: 14px;
  display: flex; flex-direction: column; gap: 10px; align-items: flex-start;
}
.reading-quota-cta p { margin: 0; font-size: 0.92rem; color: var(--ink, #1f2722); }

/* Place confirmation search (operator 2026-07-13) */
.place-field { position: relative; }
.place-search { position: relative; }
.place-results {
  position: absolute; top: calc(100% + 3px); left: 0; right: 0; z-index: 40;
  background: var(--panel, #fff); border: 1px solid var(--line, #d9ded6);
  border-radius: 9px; box-shadow: 0 6px 20px rgba(31, 39, 34, 0.14);
  max-height: 240px; overflow-y: auto;
}
.place-option {
  padding: 9px 12px; font-size: 0.86rem; cursor: pointer; color: var(--ink, #1f2722);
  border-bottom: 1px solid rgba(217, 222, 214, 0.5);
}
.place-option:last-child { border-bottom: none; }
.place-option:hover, .place-option.active { background: rgba(63, 111, 104, 0.1); }
.place-noresult { padding: 11px 12px; font-size: 0.82rem; color: var(--muted, #6b716b); }
.place-confirm { margin: 5px 0 0; font-size: 0.8rem; }
.place-confirm-ok { color: var(--accent, #3f6f68); font-weight: 600; }
.place-confirm-info { color: var(--muted, #6b716b); }

/* Account modal (operator 2026-07-13: popup instead of sidebar form) */
.account-modal {
  position: fixed; inset: 0; z-index: 120;
  background: rgba(31, 39, 34, 0.45);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.account-modal[hidden] { display: none; }
.account-modal-card {
  position: relative;
  background: var(--panel, #fffdf7);
  border-radius: 14px;
  box-shadow: 0 18px 60px rgba(31, 39, 34, 0.35);
  padding: 26px 26px 22px;
  width: min(400px, 92vw);
}
.account-modal-card h2 { margin: 0 0 6px; font-size: 1.15rem; }
.account-modal-blurb { margin: 0 0 14px; font-size: 0.85rem; color: var(--muted, #6b716b); }
.account-modal-close {
  position: absolute; top: 10px; right: 12px;
  font: inherit; font-size: 1rem; line-height: 1;
  background: none; border: none; cursor: pointer; color: var(--muted, #6b716b);
  padding: 6px;
}
.account-modal-close:hover { color: var(--ink, #1f2722); }
body.account-modal-open { overflow: hidden; }

/* ═══ Mobile QA sprint P0/P1 (2026-07-13) — consolidated overrides ═══ */

/* Mobile planet rows under the compact bodygraph (P0-3 companion) */
.planets-mobile { display: none; }
@media (max-width: 700px) {
  .planets-mobile {
    display: block;
    margin-top: 10px;
    border-top: 1px solid var(--line, #d8d1bf);
    padding-top: 8px;
  }
  .planets-mobile[hidden] { display: none; }
  .planets-mobile-head, .planets-mobile-row {
    display: grid;
    grid-template-columns: 1fr 34px 1fr;
    align-items: center;
    padding: 2px 4px;
    font-size: 0.85rem;
  }
  .planets-mobile-head { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
  .planets-mobile-row:nth-child(even) { background: rgba(63, 111, 104, 0.04); }
  .pm-glyph { text-align: center; color: var(--muted, #6b716b); font-size: 1rem; }
  .pm-design { text-align: right; color: #b5573f; font-weight: 600; }
  .pm-personality { text-align: left; color: var(--ink, #1f2722); font-weight: 600; }
  .planets-mobile-head .pm-design { color: #b5573f; }
}

@media (max-width: 700px) {
  /* iOS zooms the page when a focused control is <16px (P1-6) */
  input, select, textarea, .account-field input {
    font-size: 16px !important;
  }
  /* Tap targets ≥40px (P1-11) */
  .inspector-modal-close, .feedback-close, .account-modal-close,
  .chart-zoom-close, .partner-form-close {
    min-width: 40px; min-height: 40px;
    display: inline-grid; place-items: center;
  }
  /* Account modal: keyboard-safe height + internal scroll (P1-6b) */
  .account-modal-card {
    max-height: 85vh;
    max-height: 85dvh;
    overflow-y: auto;
  }
}

/* Modal heights: dvh beats iOS toolbar overlap; vh stays as fallback (P1-10) */
@supports (height: 100dvh) {
  .chart-zoom-stage { max-height: 94dvh; }
  .inspector-modal-card, .inspector-modal .modal-card { max-height: 86dvh; }
}

/* Account modal must top the feedback FAB (z 9998) — it's a dialog (P2) */
.account-modal { z-index: 10001; }
@media (max-width: 700px) {
  .chart-zoom-stage {
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x pan-y pinch-zoom;
    /* the desktop stage centers via flex — flex-shrink was crushing the
       oversized clone back down to fit (the whole bug in one property) */
    display: block;
  }
  .chart-zoom-stage svg { flex-shrink: 0; }
  .chart-zoom-stage svg {
    width: 230vw !important;
    height: auto !important;
    max-width: none !important;
    max-height: none !important;
  }
}

/* Catalog descriptions visible (were title=-only — invisible on touch) */
.reading-catalog-desc {
  display: block;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--muted, #6b716b);
  margin-top: 2px;
  line-height: 1.35;
}

/* The Bond card (composite greenlight round, 2026-07-13) */
.composite-bond-theme {
  margin: 10px 0 0;
  font-style: italic;
  color: var(--accent, #3f6f68);
}
.composite-bond-bridges {
  margin: 6px 0 0;
  font-size: 0.85rem;
  color: var(--muted, #657269);
}
.composite-bond-bridges span {
  font-weight: 700;
}

/* Glossary wiki + clickable reading terms (operator 2026-07-13) */
.glossary-head {
  max-width: 720px;
  margin: 0 auto 18px;
  padding: 0 4px;
}
.glossary-head h1 { margin: 0 0 4px; }
.glossary-sub { margin: 0 0 12px; color: var(--muted, #657269); }
#glossary-search {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--line, #d8d1bf);
  border-radius: 10px;
  background: var(--panel, #fffdf7);
  font-size: 16px;
}
.glossary-list { max-width: 720px; margin: 0 auto; }
.glossary-cat h2 {
  margin: 22px 4px 10px;
  font-size: 0.85rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted, #657269);
}
.glossary-terms { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 700px) {
  .glossary-terms { grid-template-columns: 1fr; }
}
.glossary-term {
  text-align: left;
  padding: 12px 14px;
  border: 1px solid var(--line, #d8d1bf);
  border-radius: 10px;
  background: var(--panel, #fffdf7);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 44px;
}
.glossary-term strong { font-size: 1rem; color: var(--ink, #24302a); }
.glossary-term span { color: var(--muted, #657269); font-size: 0.85rem; }
.glossary-term-flash { outline: 2px solid var(--accent, #3f6f68); }
.glossary-empty { text-align: center; color: var(--muted, #657269); }

.glossary-modal {
  position: fixed;
  inset: 0;
  z-index: 10002;
  background: rgba(31, 39, 34, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
}
.glossary-modal[hidden] { display: none; }
.glossary-card {
  position: relative;
  width: min(560px, 100%);
  max-height: 85dvh;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--panel, #fffdf7);
  border-radius: 14px;
  padding: 22px 24px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.25);
}
.glossary-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 40px;
  height: 40px;
  border: none;
  background: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--muted, #657269);
}
.glossary-kicker {
  margin: 0 0 2px;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent, #3f6f68);
}
.glossary-card h2 { margin: 0 0 8px; }
.glossary-short { margin: 0 0 10px; font-weight: 600; }
.glossary-body p { margin: 0 0 10px; }
.glossary-seealso { margin: 12px 0 0; }
.glossary-seealso > span {
  display: block;
  margin-bottom: 6px;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted, #657269);
}
.glossary-chip {
  display: inline-block;
  margin: 0 6px 6px 0;
  padding: 6px 12px;
  border: 1px solid var(--line, #d8d1bf);
  border-radius: 999px;
  background: none;
  cursor: pointer;
  font-size: 0.85rem;
}
.glossary-open-wiki {
  margin-top: 14px;
  padding: 9px 16px;
  border: 1px solid var(--accent, #3f6f68);
  border-radius: 10px;
  background: none;
  color: var(--accent, #3f6f68);
  cursor: pointer;
}
body.glossary-modal-open { overflow: hidden; }

.term-link {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  font: inherit;
  color: inherit;
  display: inline;
  text-decoration: underline dotted var(--accent, #3f6f68);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  cursor: pointer;
}
.term-link:hover { color: var(--accent, #3f6f68); }

/* Analytics SVGs at phone width (mobile pass 2, 2026-07-13): the PHS
   dashboard (1280-wide viewBox) and dream/penta boards squeezed to ~25-44%
   scale — micro-text. Render them legible-width inside a native
   horizontal-scroll strip instead; tap-to-zoom (230vw clone) stays the
   detail affordance. */
@media (max-width: 700px) {
  /* RESTORED (audit 2026-07-22): host rule was swept with the penta
     selectors — without overflow-x + the width pin the 200vw svg
     inflated the host past the viewport. */
  #phs-visual, #dream-visual {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }
  #phs-visual svg {
    width: 200vw;
    height: auto;
    max-width: none;
  }
  #dream-visual svg {
    width: 150vw;
    height: auto;
    max-width: none;
  }
}

/* Wiki colour-coding, round 2 (operator: "hardly visible" → BOLDER;
   type-family sections). Accents ride the glossary data (centres =
   bodygraph fills). Mid-tone earth colours on cream: solid bands +
   washes + bars, never body-text-on-white. Reading links stay neutral. */
.glossary-term {
  border-left: 5px solid var(--term-accent, var(--line, #d8d1bf));
  background: var(--panel, #fffdf7);
  background: color-mix(in srgb, var(--term-accent, #d8d1bf) 12%, var(--panel, #fffdf7));
}
.glossary-role {
  font-style: normal;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--term-accent, var(--muted, #657269));
}
.glossary-family {
  margin: 30px 0;
}
.glossary-family-band {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 14px;
  width: 100%;
  text-align: left;
  border: none;
  cursor: pointer;
  background: var(--term-accent, var(--line, #d8d1bf));
  color: #24302a;
  border-radius: 12px;
  padding: 14px 18px;
  margin-bottom: 12px;
}
.glossary-family-band strong {
  font-size: 1.15rem;
  letter-spacing: 0.02em;
}
.glossary-family-band span {
  font-size: 0.9rem;
  opacity: 0.85;
}
.glossary-family .glossary-terms {
  padding: 0 2px;
}
.glossary-card {
  border-top: 6px solid var(--term-accent, var(--line, #d8d1bf));
}
.glossary-card .glossary-kicker {
  display: inline-block;
  background: var(--term-accent, var(--accent, #3f6f68));
  color: #24302a;
  border-radius: 6px;
  padding: 3px 10px;
  margin-bottom: 6px;
}
.glossary-cat { margin: 30px 0; }
@media (max-width: 700px) {
  .glossary-head {
    position: sticky;
    top: 0;
    z-index: 5;
    background: var(--paper, #f5f0e2);
    padding-top: 8px;
    padding-bottom: 10px;
  }
}
.reading-empty-note {
  color: var(--muted, #657269);
  text-align: center;
  padding: 34px 12px;
}
#relationship-view .partner-form,
#group-view .partner-form {
  max-width: 680px;
  margin-bottom: 20px;
}
/* The veiled view must be the veil's positioning box — with a static
   parent the absolute veil anchored to the PAGE and covered the sticky
   tab bar (z 30 over z 5): users were trapped on Coming Soon with no
   way to tap another tab (operator, mobile, 2026-07-22). */
.coming-soon-locked { position: relative; }
.coming-soon-veil {
  position: absolute; inset: 0; z-index: 30;
  display: flex; align-items: flex-start; justify-content: center;
  padding-top: 18vh;
  background: rgba(245, 241, 232, 0.72);
  backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px);
  border-radius: inherit;
}
.coming-soon-card { text-align: center; padding: 2rem 2.5rem; }
.coming-soon-card h2 { margin: 0 0 0.4rem; font-size: 1.5rem; }
.coming-soon-card p { margin: 0; opacity: 0.75; }
.soon-badge {
  margin-left: 0.45em; padding: 0.1em 0.55em; border-radius: 999px;
  font-size: 0.62em; letter-spacing: 0.04em; text-transform: uppercase;
  background: #b8865a; color: #fff; vertical-align: middle;
}

/* Wiki glyphs: hexagram lines + mini bodygraph (operator 2026-07-15) */
.glossary-term { position: relative; }
.glossary-term .glossary-glyph {
  position: absolute; top: 10px; right: 10px;
  color: #6b6154; pointer-events: none;
}
.glossary-term strong, .glossary-term span { padding-right: 34px; display: block; }
.glossary-modal-glyph { float: right; color: #6b6154; margin: -4px 0 4px 12px; }
.glossary-modal-glyph:empty { display: none; }

/* Transit layout fixes (operator 2026-07-15): columns must not stretch
   each other — the mechanics list was inflating the chart panel, which
   blew up the summary cards. Reading sits under the chart in column 1;
   mechanics keeps the right column across all rows. */
#transit-timing-section.timing-mode.active { align-items: start; }
#transit-timing-section .timing-visual-panel { grid-column: 1; }
/* Mechanics sits beside the dashboard only; the transit reading spans
   the FULL width below both — it was crushed into the 360px column,
   2000px tall (operator audit 2026-07-16). */
#transit-timing-section .transit-mechanics-panel { grid-column: 2; grid-row: 1; }
#transit-timing-section #transit-reading-controls,
#transit-timing-section #transit-reading-output { grid-column: 1 / -1; }
.transit-summary-grid { align-content: start; }
.transit-summary-card { align-self: start; height: auto; }
.transit-group-note {
  margin: 2px 0 8px;
  font-size: 12px;
  color: var(--muted);
  max-width: 62ch;
}

/* Cross life-theme passage (verbatim canon, operator 2026-07-15) */
.cross-canon { margin: 6px 0 14px; }
.cross-canon p { margin: 0 0 8px; line-height: 1.55; }
.cross-canon-source { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; }

/* PageAgent pilot: upstream panel CSS uses word-break:break-all on
   history bubbles, chopping words mid-letter (operator 2026-07-15).
   Wrap on word boundaries instead; long tokens still break as needed. */
[class*="_historyContent_"],
[class*="_historyItem_"] {
  word-break: normal !important;
  overflow-wrap: anywhere !important;
}

/* Transit page at phone width (mobile transit pass, 2026-07-15).
   The desktop metaphor is chart-left + VERTICAL slider rail right,
   both locked to the chart height — at 375px that squeezed the chart
   to a postage stamp beside a crushed rail. Mobile: single column,
   compact chart (server renders minimal chrome via compact:true), and
   the rail becomes a horizontal control strip with a normal slider. */
@media (max-width: 700px) {
  .timing-visual-panel {
    display: block;
    --transit-stage-height: auto;
  }
  .timing-visual-panel .transit-visual {
    height: auto;
    margin-bottom: 10px;
  }
  .timing-visual-panel .transit-visual svg {
    height: auto;
    width: 100%;
  }
  .timing-visual-panel .transit-control-rail {
    height: auto;
    max-width: none;
    display: block;
    padding: 12px;
    margin-bottom: 14px;
  }
  .transit-date-label {
    margin-bottom: 8px;
  }
  .timing-visual-panel .timeframe-switch {
    width: 100%;
    margin-bottom: 10px;
  }
  .slider-row {
    display: block;
    height: auto;
  }
  .slider-row input {
    writing-mode: horizontal-tb;
    -webkit-appearance: none;
    appearance: auto;
    direction: ltr;
    width: 100%;
    min-width: 0;
    height: 32px;
    justify-self: stretch;
  }
  /* Horizontal tick rail under the slider (operator 2026-07-15: the
     timeline needs its points on mobile too). Ticks show for every
     stop; labels only at the edges + centre — the live date label
     above the slider names the exact selected moment. */
  .slider-markers {
    display: block;
    position: relative;
    height: 30px;
    margin-top: 2px;
  }
  .slider-markers span {
    top: 0;
    left: calc(100% - var(--tick-pos, 0%));
    transform: translateX(-50%);
    flex-direction: column;
    align-items: center;
  }
  .slider-markers i {
    width: 1px;
    height: 7px;
    margin-right: 0;
    margin-bottom: 2px;
  }
  .slider-markers .center i { width: 2px; height: 10px; }
  .slider-markers em { display: none; font-size: 10px; }
  .slider-markers .center em,
  .slider-markers .edge em { display: block; }
  .transit-now-button {
    width: 100%;
    margin-top: 8px;
    min-height: 40px;
  }
  .timing-visual-panel .transit-summary-grid {
    grid-template-columns: 1fr 1fr;
  }
  .timing-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .timing-actions button {
    min-height: 42px;
  }
}

/* The desktop "mechanics keeps the right column" rules above are
   unconditional and re-created a phantom second column on phones even
   after .timing-mode.active collapses to 1fr — everything squeezed to
   ~175px (mobile transit pass, 2026-07-15). Neutralize below 900px —
   .timing-mode.active collapses at 900, not 700 (audit 2026-07-15). */
@media (max-width: 900px) {
  #transit-timing-section .timing-visual-panel,
  #transit-timing-section #transit-reading-controls,
  #transit-timing-section #transit-reading-output,
  #transit-timing-section .transit-mechanics-panel {
    grid-column: auto;
    grid-row: auto;
  }
}

/* Reading typography pass (operator 2026-07-15: "weird spacing, no
   titles or bold" — paragraphs had margin:0, term links were faint). */
.reading-output .reading-chapter p {
  margin: 0 0 12px;
  line-height: 1.65;
}
.reading-output .reading-chapter p:last-child { margin-bottom: 0; }
.reading-output .reading-section-label {
  margin: 26px 0 10px;
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: 0.01em;
}
.reading-output .reading-chapter h3.reading-section-label:first-child { margin-top: 8px; }
.term-link {
  font-weight: 650;
  color: var(--accent, #3f6f68);
  /* buttons default to line-height:normal, inflating the line box of
     any prose line containing a term — the "weird spacing" (2026-07-15) */
  line-height: inherit;
  vertical-align: baseline;
}
@media (max-width: 720px) {
  .reading-output .reading-chapter p {
    font-size: 16px;
    line-height: 1.7;
    margin-bottom: 14px;
  }
  .reading-output .reading-section-label {
    font-size: 1.08rem;
    margin: 22px 0 8px;
  }
}

/* Global 13px-uppercase h2 leaked into modal/reading titles, inverting
   the type hierarchy (title smaller than body text). */
.glossary-card h2,
.reading-output .reading-header h2 {
  font-size: 1.25rem;
  text-transform: none;
  letter-spacing: 0;
  color: var(--ink, #24302a);
}

/* iOS scroll chaining: modal inner scrollers escaped into the page. */
.glossary-modal, .glossary-card { overscroll-behavior: contain; }
.glossary-card { max-height: 85vh; max-height: 85dvh; }

/* Catalog buttons: description drops to its own full-width line instead
   of squeezing as a third column beside the label. */
.reading-catalog-button { flex-wrap: wrap; }
.reading-catalog-button .reading-catalog-desc { flex-basis: 100%; }

@media (max-width: 900px) {
  /* Sticky needs slack: as a grid item the nav's containing block was
     its own row, so sticky was inert. Flex column restores it and lets
     the nav rail render before the sidebar panels. */
  .app-shell { display: flex; flex-direction: column; }
  .tabs { order: -1; }

  /* Sticky rail is ~58px of opaque cover — scroll targets duck under it. */
  .overview-chart-stage, #status { scroll-margin-top: 64px; }

  /* Life-cycle timeline: stacked rows need real height (JS sets
     min-height per point count); dots stay dots; age ticks stay dashes
     with sparse labels. */
  .returns-timeline { height: auto; min-height: 420px; }
  .timeline-point .timeline-dot { width: 15px; height: 15px; }
  .timeline-year-tick i { height: 1px; }
  .timeline-year-tick em { display: block; }
  .timeline-year-tick:nth-child(even) em { display: none; }
}

@media (max-width: 700px) {
  /* Touch-target floor (40-44px) for the most-tapped controls. */
  .glossary-chip { min-height: 40px; padding: 9px 14px; vertical-align: middle; }
  .reading-pdf-btn, .reading-quota-cta .account-btn { min-height: 40px; font-size: 0.95rem; }
  .charts-subtab, .inspector-modal-gate-chip {
    min-height: 40px; display: inline-flex; align-items: center;
  }
  .timing-visual-panel .timeframe-option { min-height: 44px; font-size: 14px; }
  .slider-row input { height: 44px; }
  .place-option { min-height: 44px; display: flex; align-items: center; }

  /* Scrub feedback + summary text up to readable sizes. */
  .transit-date-label { font-size: 14px; }
  .transit-summary-card span, .transit-summary-card em { font-size: 12px; }
  label span { font-size: 13px; }
  #mandala-display svg, #incarnation-cross-display svg {
    width: 170vw; max-width: none;
  }
}

/* My Readings shelf (operator 2026-07-16: persistence) */
.my-readings-list { display: grid; gap: 8px; }
.my-reading-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; min-height: 44px;
  border: 1px solid var(--line); background: var(--panel);
  text-align: left; cursor: pointer;
}
.my-reading-item:hover { border-color: var(--accent); }
.my-reading-emoji { font-size: 1.2rem; }
.my-reading-main { display: grid; gap: 2px; min-width: 0; }
.my-reading-main strong { font-size: 0.95rem; }
.my-reading-main small { color: var(--muted); font-size: 12px; }

/* Reading language-mismatch note (tester feedback 2026-07-15) */
.reading-lang-note {
  margin: 0 0 10px; padding: 8px 12px;
  border: 1px solid rgba(184, 134, 90, 0.4); background: rgba(184, 134, 90, 0.08);
  font-size: 13px; color: #6b5335;
}

/* Daily panel as product UI (operator audit 2026-07-16) */
.daily-panel .daily-head {
  margin: 16px 0 6px;
  font-size: 0.98rem;
}
.daily-panel .daily-head:first-child { margin-top: 0; }
.daily-panel .daily-line { margin: 4px 0; }
.daily-panel .daily-list {
  margin: 4px 0 10px;
  padding-left: 22px;
}
.daily-panel .daily-list li { margin: 4px 0; line-height: 1.5; }
.daily-panel .daily-sky {
  width: 100%;
  max-width: 560px;
  border-collapse: collapse;
  margin: 6px 0 10px;
  font-size: 0.92rem;
}
.daily-panel .daily-sky th {
  text-align: left;
  font-weight: 600;
  padding: 3px 10px 3px 0;
  white-space: nowrap;
  width: 1%;
}
.daily-panel .daily-sky td {
  padding: 3px 10px 3px 0;
  color: var(--muted, #657269);
}
.daily-panel .daily-sky td:first-of-type {
  color: var(--ink, #24302a);
  font-variant-numeric: tabular-nums;
}
.daily-panel .daily-sky tr + tr { border-top: 1px solid rgba(33,25,15,0.07); }

/* Auto-saved library rows (operator 2026-07-21): charts with nested
   readings, each with PDF + delete actions. */
.my-chart-group { margin-bottom: 10px; }
.my-charts-item {
  display: flex;
  align-items: stretch;
  gap: 4px;
}
.my-chart-open {
  flex: 1;
  text-align: left;
  border: 1px solid var(--line, #d8d1bf);
  background: var(--panel, #fffdf7);
  border-radius: 8px;
  padding: 8px 10px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-height: 44px;
}
.my-charts-item-plain {
  padding: 6px 2px 2px;
  color: var(--muted, #657269);
}
.row-action {
  border: 1px solid var(--line, #d8d1bf);
  background: var(--panel, #fffdf7);
  border-radius: 8px;
  min-width: 40px;
  cursor: pointer;
  color: var(--accent, #3f6f68);
}
.row-action-delete { color: #a05e4b; }
.my-chart-readings {
  margin: 4px 0 0 10px;
  padding-left: 8px;
  border-left: 2px solid var(--line, #d8d1bf);
  display: grid;
  gap: 4px;
}
.my-reading-item { display: flex; gap: 4px; }
.my-reading-open {
  flex: 1;
  text-align: left;
  border: none;
  background: none;
  padding: 6px 8px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 6px;
  min-height: 36px;
}
.my-reading-open:hover { background: rgba(63, 111, 104, 0.08); }
.my-reading-open small { color: var(--muted, #657269); white-space: nowrap; }
.my-chart-open, .my-reading-open { color: var(--ink, #24302a); font: inherit; }
.my-reading-open span { color: var(--ink, #24302a); }
.my-reading-item .row-action { min-width: 34px; border: none; }


/* First-visit tour (operator 2026-08-01: "highlight what's available").
   The old banner was one long sentence nobody read; the funnel showed
   zero tab switches — visitors never discovered the reading. */
.welcome-steps {
  display: grid; gap: 8px; margin: 10px 0 8px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}
.welcome-step {
  display: block; text-align: left; cursor: pointer;
  background: rgba(255, 255, 255, 0.14); border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 10px; padding: 9px 11px; color: inherit; font: inherit;
  transition: background .15s, transform .06s;
}
.welcome-step:hover { background: rgba(255, 255, 255, 0.24); }
.welcome-step:active { transform: scale(.985); }
.welcome-step b { display: block; margin-bottom: 2px; font-size: 13.5px; }
.welcome-step span { display: block; font-size: 12.5px; opacity: .92; line-height: 1.35; }
.welcome-foot { display: block; font-size: 12.5px; opacity: .85; }
@media (max-width: 700px) {
  .welcome-steps { grid-template-columns: 1fr; }
}

/* Mobile: the three cards stack, so keep each one tight — the tour must
   fit above the fold, not push the app off screen. */
@media (max-width: 700px) {
  .welcome-banner { padding: 8px 10px; }
  .welcome-steps { gap: 6px; margin: 8px 0 6px; }
  .welcome-step { padding: 7px 9px; }
  .welcome-step b { font-size: 13px; }
  .welcome-step span { font-size: 12px; line-height: 1.3; }
  .welcome-foot { font-size: 12px; }
}

/* RESTORED (2026-07-22, sweep casualty #4): the ≤900px single-column
   rule for the timing + composite boards died with .penta-board in its
   selector list. Without it the mobile transit section kept the desktop
   360px+320px columns → the phone zoomed out → compact renders never
   engaged (innerWidth read ~706). */
@media (max-width: 900px) {
  .timing-mode.active,
  .composite-board {
    grid-template-columns: 1fr;
  }
}

/* RESTORED (audit 2026-07-22): the penta CSS sweep removed a SHARED
   min-width pin because its selector list also named .penta-layout —
   collateral: grid min-width:auto inflated the bodygraph stage to
   574px on a 375px phone (chart overflowed the page) and unpinned the
   PHS/dream mobile strips. Same pin, penta selectors dropped. */
@media (max-width: 700px) {
  .overview-layout,
  .overview-layout > *,
  .overview-chart-stage,
  .overview-chart-stage > *,
  .phs-layout, .phs-visual-panel,
  .dream-layout, .dream-visual-panel {
    min-width: 0;
  }
  /* Detail panels hold intrinsically wide card grids/tables — without a
     min-width pin they drive the shared 1fr track past the viewport.
     Wide internals scroll inside the panel (same strip pattern). */
  .phs-detail-panel, .dream-detail-panel {
    min-width: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .overview-secondary-grid {
    grid-template-columns: 1fr;
  }
  .overview-bodygraph svg {
    width: 100%;
  }
}

/* Reading language-mismatch notice (tester feedback 2026-07-15) */
.reading-lang-notice {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  margin: 0 0 14px;
  padding: 10px 14px;
  border: 1px solid var(--line, #d8d1bf);
  border-left: 4px solid var(--accent, #3f6f68);
  border-radius: 10px;
  background: rgba(63, 111, 104, 0.06);
  font-size: 0.92rem;
}
.reading-lang-regen {
  border: 1px solid var(--accent, #3f6f68);
  background: none;
  color: var(--accent, #3f6f68);
  border-radius: 8px;
  padding: 6px 12px;
  cursor: pointer;
  font: inherit;
  min-height: 36px;
}

/* Chart Input lives with the Bodygraph only (operator 2026-07-22) — the
   other tabs keep Account + My Charts in the sidebar, not the same form. */
body:not([data-view="chart-view"]) #chart-input-panel {
  display: none;
}

/* ── App menu drawer (operator 2026-07-22) ──────────────────────────
   Motion doctrine: transform/opacity only, ≤200ms ease-out, CSS
   transitions (interruptible), anchored to the right edge where the
   toggle lives, reduced-motion = near-instant. */
:root { --ease-out-strong: cubic-bezier(0.2, 0.8, 0.2, 1); }

.menu-toggle {
  margin-left: auto;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line, #d8d1bf);
  border-radius: 10px;
  background: var(--panel, #fffdf7);
  cursor: pointer;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  flex-shrink: 0;
}
.menu-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: var(--ink, #24302a);
}
@media (hover: hover) and (pointer: fine) {
  .menu-toggle:hover { background: rgba(63, 111, 104, 0.08); }
}

.app-menu-backdrop {
  position: fixed;
  inset: 0;
  z-index: 8999;
  background: rgba(31, 39, 34, 0.42);
  opacity: 0;
  transition: opacity 180ms var(--ease-out-strong);
}
.app-menu-backdrop[hidden] { display: none; }
.app-menu-backdrop.open { opacity: 1; }

.app-menu {
  position: fixed;
  top: 0;
  right: 0;
  height: 100dvh;
  width: min(380px, 90vw);
  z-index: 9000;
  background: var(--paper, #f5f0e2);
  border-left: 1px solid var(--line, #d8d1bf);
  box-shadow: -12px 0 40px rgba(0, 0, 0, 0.18);
  padding: 16px 18px 28px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  transform: translateX(24px);
  opacity: 0;
  transition: transform 200ms var(--ease-out-strong), opacity 160ms var(--ease-out-strong);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.app-menu[hidden] { display: none; }
.app-menu.open { transform: none; opacity: 1; }
.app-menu-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2px;
}
.app-menu-head h2 { margin: 0; font-size: 1.05rem; }
.app-menu-close {
  width: 40px;
  height: 40px;
  border: none;
  background: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--muted, #657269);
}
.app-menu .language-picker { margin: 0; }
.app-menu .tool-panel { margin: 0; }
body.menu-open { overflow: hidden; }

@media (prefers-reduced-motion: reduce) {
  .app-menu, .app-menu-backdrop { transition-duration: 1ms; }
  .app-menu { transform: none; }
}

/* Tappable planet activations on phones (operator 2026-07-22) */
.pm-tap {
  font: inherit;
  color: inherit;
  background: none;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 4px 8px;
  min-height: 36px;
  cursor: pointer;
  text-decoration: underline dotted var(--accent, #3f6f68);
  text-underline-offset: 3px;
}
.pm-tap:active { background: rgba(63, 111, 104, 0.1); }

/* Library rows must shrink to their container (drawer = 90vw on phones);
   flex children default to min-width:auto and pushed the delete buttons
   past the edge (drawer round, 2026-07-22). */
.my-charts-list, .my-chart-group, .my-charts-item, .my-reading-item,
.my-chart-readings { min-width: 0; max-width: 100%; }
.my-chart-open, .my-reading-open { min-width: 0; overflow: hidden; }
.my-chart-open strong, .my-reading-open span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.my-reading-open { flex-wrap: nowrap; }
.my-reading-open small { flex-shrink: 0; }

/* Audio-reading controls only when the server can deliver audio
   (body.cap-audio set from /api/health capabilities, 2026-07-22). */
body:not(.cap-audio) [data-reading-audio],
body:not(.cap-audio) #reading-listen-btn,
body:not(.cap-audio) #reading-audio-slot { display: none; }
