/* Selah workbench — verse profile follow-ups
   Lens approximation, verse scope bar, envelope receipt chip.
   Split from resources/public/css/workbench.css on 2026-07-01 —
   run git log --follow to trace history through the pre-split file. */

/* ── Lens approximation (verse-surface-brief §3) ──────────────────
   Placeholder styling — proves the algebra (lenses paint the canvas,
   stack by channel, scope drives it). The designer swings on the real
   visual (brief §8). Functional only; nothing precious here. */
.lens-block { margin: 4px 0 2px; }
.lens-bar {
  display: flex; align-items: center; gap: 6px;
  margin-bottom: 12px; flex-wrap: wrap;
}
/* Group gap — the spacer the bar renders where the lens
   declaration's :group steps. Flex gap adds 6px each side,
   so 8px here reads as a clear breath between families. */
.lens-gap { width: 8px; flex: 0 0 auto; }
/* The bar sits ABOVE the verse (2026-07-30): the grouped verse
   block's negative margin-top overlaps the bar with its empty
   upper half-leading — lift the bar so chips stay clickable. */
.lens-bar { position: relative; z-index: 1; }
/* break before the study⫽parallel viewseg — same beat as the
   other chip groups; inline after density, NOT right-pinned (the
   reader's margin-left auto caused a wrap + wasted row here —
   Scott, 2026-07-30) */
.lens-gap--seg { width: 8px; }
.lens-bar .rd-viewseg { margin-left: 0; }
/* Mobile: the seg wraps to its own row and the spacer would
   indent it off the chips' left edge — drop it (Scott,
   2026-07-30). */
@media (max-width: 900px) {
  .lens-gap--seg { display: none; }
}

/* ── Verse-profile parallel arrangement ─────────────────────────
   The hero splits: Hebrew keeps its cell, the per-token Selah
   gloss column (the reader's .rd-par-cell character) takes the
   other. Only the hero splits — translations slot, lens bar and
   channels stay in flow below. */
.pf-hero-parallel {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  column-gap: 1.5rem;
  align-items: start;
}
.pf-hero-parallel > .pf-par-cell {
  min-width: 0;
  direction: ltr;
  text-align: left;
  /* the reader's parallel voice — serif, not the hero's mono */
  font-family: var(--font-english);
  font-size: 1.05rem;
  line-height: 1.75;
  padding-top: 6px;
}
/* Parallel STAYS parallel at every width (Scott, 2026-07-30) —
   no narrow-viewport stacking; the two columns just get lean. */
.lens-bar-label {
  font-family: var(--rd-mono);
  font-size: 9px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--wb-ink-3);
}
.lens-chip {
  font-family: var(--rd-mono);
  font-size: 10px; letter-spacing: 0.04em;
  padding: 3px 10px; border-radius: 3px;
  border: 1px solid var(--wb-rule);
  background: transparent; color: var(--wb-ink-3);
  cursor: pointer;
}
.lens-chip--on {
  color: var(--wb-warm); border-color: var(--wb-warm);
  background: color-mix(in srgb, var(--wb-warm) 12%, transparent);
}
.lens-canvas {
  font-family: var(--font-hebrew);
  font-size: 30px; line-height: 1.7; color: var(--wb-ink);
  display: flex; flex-wrap: wrap; gap: 14px;
  justify-content: center;
}
.lens-token {
  display: inline-flex; flex-direction: column; align-items: center;
}
.lens-token-hb { white-space: nowrap; }
.lens-letter { transition: color 80ms ease; }
.lens-letter--ring {
  outline: 1px solid var(--wb-warm);
  outline-offset: 1px; border-radius: 2px;
}
.lens-token-gv {
  font-family: var(--rd-mono);
  font-size: 10px; color: var(--wb-ink-4); margin-top: 3px;
}

/* ── Verse scope bar: unit ladder + lead/right slots (mockup 17) ──
   The unit ladder is the widest framing lens, pushed hard-left where
   the type label used to sit. Active unit = solid warm chip with its
   label; the rest are quiet glyph-only chips. */
.pf-scope-lead { display: inline-flex; align-items: center; }
.pf-scope-right { color: var(--wb-ink-3); cursor: pointer; }
.pf-scope-right:hover { color: var(--wb-warm); }
.pf-scope-open { display: inline-flex; }

.pf-unit-ladder { display: inline-flex; align-items: center; gap: 3px; }
.pf-unit-slot {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 7px; border-radius: 2px;
  color: var(--wb-ink-3); cursor: pointer;
  user-select: none;
  transition: background 80ms ease, color 80ms ease;
}
.pf-unit-slot:hover {
  background: color-mix(in srgb, var(--wb-warm) 12%, transparent);
  color: var(--wb-warm);
}
.pf-unit-slot-g {
  font-family: var(--font-hebrew);
  font-size: 13px; line-height: 1;
}
.pf-unit-slot-label {
  font-size: 9px; letter-spacing: 0.14em; text-transform: uppercase;
}
.pf-unit-slot--on {
  background: var(--wb-warm); color: var(--wb-bg);
}
.pf-unit-slot--on:hover { color: var(--wb-bg); }

/* Per-letter numbers under each letter — gematria + ELS-density STACK
   (distinct colors), painted on the conditioned canvas. Replaces the
   old LETTERS band's number row. The cluster becomes an inline-flex
   column so the numbers sit under their letter without disturbing the
   RTL Hebrew flow. */
.pf-letter-cluster:has(.pf-letter-subs) {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  vertical-align: baseline;
}
.pf-letter-subs {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 1px;
  line-height: 1.1;
}
.pf-letter-sub {
  direction: ltr;
  font-family: var(--rd-mono);
  font-size: 9px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}
/* gematria = mint · els-density = warm — so a reader can tell the two
   stacked numbers apart at a glance. */
.pf-letter-sub--gv  { color: var(--wb-mint, #79b58c); }
.pf-letter-sub--els { color: var(--wb-warm, #e8c87a); }
/* When els stacks below gv it gets its own pixel of air (Scott,
   2026-07-30); alone it keeps the shared anchor. */
.pf-letter-sub--gv + .pf-letter-sub--els { margin-top: 1px; }

/* Word-level numbers (scope = word/te'amim/verse) — the word's GV-sum +
   density-sum, stacked + centered under the whole word. The token is a
   flex column (letter row on top, these below). */
.pf-token-subs {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 2px;
  line-height: 1.1;
}

/* ── Receipt chip (envelope step 7) ─────────────────────────
   The pill that rides next to every claim — source / tier dot /
   verification dot / method glyph. Click expands the full panel.
   See src/selah/app/workbench/receipt.cljs + the-receipt-layer.md. */

.wb-receipt-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 6px;
  margin-left: 6px;
  font-family: var(--rd-mono);
  font-size: 10px;
  line-height: 1.2;
  border: 1px solid var(--wb-rule);
  border-radius: 10px;
  background: var(--wb-bg-2);
  color: var(--wb-ink-3, #7c8a99);
  cursor: pointer;
  user-select: none;
  vertical-align: baseline;
  position: relative;
  transition: border-color 120ms ease, color 120ms ease;
}
.wb-receipt-chip:hover {
  border-color: var(--wb-rule);
  color: var(--wb-ink-2, #a8b3bf);
}
.wb-receipt-chip--open {
  border-color: var(--wb-warm, #c9a96e);
  color: var(--wb-ink);
}
.wb-receipt-chip--stamp {
  font-size: 9px;
  padding: 0 4px;
  margin-left: 4px;
}
.wb-receipt-chip--block {
  display: flex;
  margin: 6px 0;
}

.wb-receipt-source {
  font-weight: 500;
  letter-spacing: 0.02em;
}

/* Tier badge — small numeric square with tier-graded color */
.wb-receipt-tier {
  display: inline-block;
  min-width: 14px;
  text-align: center;
  padding: 0 3px;
  border-radius: 3px;
  background: var(--wb-bg-4);
  color: var(--wb-ink);
  font-weight: 600;
  font-size: 9px;
}
.wb-receipt-tier--1 { background: var(--wb-mint); color: var(--wb-bg, #0a0f15); }
.wb-receipt-tier--2 { background: var(--wb-cyan); color: var(--wb-bg, #0a0f15); }
.wb-receipt-tier--3 { background: var(--wb-warm, #c9a96e); color: var(--wb-bg, #0a0f15); }
.wb-receipt-tier--4 { background: var(--wb-ink-4, #4a5868); color: var(--wb-ink); }
.wb-receipt-tier--5 { background: var(--wb-violet); color: var(--wb-bg, #0a0f15); }
.wb-receipt-tier--6 { background: var(--wb-bg-4); color: var(--wb-ink-3, #7c8a99); }

/* Verification dot — amber→yellow→yellow-green→green ladder */
.wb-receipt-verif {
  font-size: 7px;
  line-height: 1;
}
.wb-receipt-verif--none      { color: #b8843e; }   /* amber */
.wb-receipt-verif--community { color: #d4b347; }   /* yellow */
.wb-receipt-verif--scholar   { color: #9bb557; }   /* yellow-green */
.wb-receipt-verif--peer      { color: #6db17a; }   /* green */
.wb-receipt-verif--verified  { color: #4cc77a; }   /* deep green */

.wb-receipt-method {
  color: var(--wb-ink-3, #7c8a99);
  font-size: 11px;
}

/* Expanded panel — rendered as a small floating block when chip clicked */
.wb-receipt-panel {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 4px;
  min-width: 260px;
  max-width: 420px;
  padding: 8px 10px;
  background: var(--wb-bg, #0a0f15);
  border: 1px solid var(--wb-warm, #c9a96e);
  border-radius: 4px;
  font-family: ui-sans-serif, system-ui, -apple-system, sans-serif;
  font-size: 11px;
  color: var(--wb-ink);
  z-index: 1000;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  cursor: default;
  text-align: left;
}
.wb-receipt-row {
  display: flex;
  gap: 8px;
  padding: 2px 0;
  border-bottom: 1px dotted var(--wb-rule);
}
.wb-receipt-row:last-child { border-bottom: none; }
.wb-receipt-row--full { flex-direction: column; gap: 2px; }
.wb-receipt-key {
  flex: 0 0 90px;
  color: var(--wb-ink-3, #7c8a99);
  text-transform: lowercase;
  letter-spacing: 0.02em;
}
.wb-receipt-val {
  flex: 1;
  color: var(--wb-ink);
  word-break: break-word;
}
.wb-receipt-val--mono {
  font-family: var(--rd-mono);
  font-size: 10px;
  color: var(--wb-ink-2, #a8b3bf);
}

/* Glossary line with inline receipt chip — used on word profile.
   The factoring/gloss-line is a flex container; chip rides at the
   end without disturbing it. */
.wb-profile-gloss-row {
  display: flex;
  align-items: baseline;
  gap: 4px;
  flex-wrap: wrap;
}


/* ── VP9 2b-3 — the shared renderer in READER clothes ──────────
   The verse-block knobs at reader scale. Profile defaults live on
   the rules themselves (36px hero); inside the reader's verse body
   the same markup wears the reader's size and rhythm. */
.rd-verse-body {
  --sv-hb-size: 30px;
  --sv-word-gap: 10px;
  --sv-cluster-pad: 0 0.5px;
  --sv-annex-top: 42px;
}

/* ── The lens RAIL (VP9 Phase-3 seed; Scott 2026-07-30) ────────
   One shared chip band at the top of a verse surface's main
   column. Ableton-tight: one short row, small chips, hairline
   below; sticky so it never scrolls away, scoped to the column so
   it never spans the mini/panel. */
.sv-rail {
  position: sticky;
  top: 0;
  z-index: 6;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 3px;
  padding: 4px 10px;
  background: var(--rd-bg, var(--wb-bg));
  border-bottom: 1px solid var(--rd-rule, var(--wb-rule));
}
.sv-rail .rd-hl-chip {
  font-size: 9px;
  padding: 1px 6px;
}
.sv-rail .rd-viewseg { margin-left: 0; }
.sv-rail-chip--disabled {
  opacity: 0.35;
  cursor: default;
}
/* the profile's old above-the-verse spacing compensations don't
   apply once the bar is a rail — restore the verse's own top air */
.wb-profile-main > .sv-rail { margin-bottom: 0; }

/* The profile's rail goes FULL-BLEED like the reader's (Scott,
   2026-07-31: 'a thin rail like the reader') — cancel the main
   column's padding so the band runs edge to edge, one row, flush
   under the spine. */
.wb-profile--scope-top .wb-profile-main > .sv-rail {
  align-self: stretch;
  margin: -16px -28px 0;
}

/* PARALLEL mirror on the verse profile (Scott, 2026-09-03) — the
   translation rows continue the hero's two columns: witnesses +
   RTL langs in the left wing (under the Hebrew), LTR langs in the
   right wing (under the gloss column). Same template as
   .pf-hero-parallel so the wings line up. */
.pf-trans-table--mirror {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  column-gap: 1.5rem;
  align-items: start;
}
.pf-mirror-wing {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ── The embedded-reading interlinear (rd-embed-il) ──────────
   Real token-chips with the gloss pinned beneath — the layout
   half of embed-the-reader (2026-09-14). Compact scale by
   default; hosts may retune --sv-hb-size. */
.rd-embed-il {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 8px;
  --sv-hb-size: 21px;
  --sv-word-gap: 5px;
  --sv-cluster-pad: 0;
}
.rd-embed-il-cell {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
}
.rd-embed-il-gloss {
  font-family: var(--rd-mono);
  font-size: 10px;
  line-height: 1.25;
  color: var(--rd-ink-3, var(--wb-ink-3));
  direction: ltr;
  max-width: 14ch;
  text-align: center;
  overflow-wrap: break-word;
}
