/* BreadBowl-Embed v1.3 post: the x-ray (#xray-fig).
   Loaded after blog.css; reuses the launch post's classes (.card, .chip, .seg, .pane, .slotbar, .sb,
   .toks, .tok, .legend, .tip) and keeps their look. Colors come from the theme tokens only. */

/* ------------------------------------------------------------------ shared */
.lab-tip { max-width: 300px; }
.lab-sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.lab-xr .chips { margin-bottom: 14px; }
.lab-xr .chip:focus-visible, .lab-xr .seg button:focus-visible, .lab-xr .sb:focus-visible { outline: 2px solid var(--bb-focus, var(--ink)); outline-offset: 3px; }

/* ------------------------------------------------------------------ x-ray */
.lab-xr-score { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px 20px; align-items: center; margin-bottom: 20px; padding-bottom: 18px; border-bottom: 1px solid var(--line-2); }
.lab-xr-total { grid-row: span 2; display: flex; align-items: baseline; gap: 8px; }
.lab-xr-total b { font: 600 30px/1 var(--font-sans); color: var(--ink); letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.lab-xr-total span { font: 600 10px/1.3 var(--font-mono); text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted); }
.lab-xr-bar { position: relative; height: 6px; border-radius: 3px; overflow: hidden; background: rgba(var(--ink-rgb), 0.07); cursor: default; }
.lab-xr-bar i { position: absolute; top: 0; bottom: 0; left: 0; width: 100%; transform-origin: 0 50%; transition: transform 420ms cubic-bezier(.2,.8,.2,1); }
.lab-xr-bar i.r { background: var(--rt); }
.lab-xr-bar i.v { background: var(--val); }
.lab-xr-bar i.hl { width: 0; background: transparent; box-shadow: inset 0 0 0 1.5px var(--ink); border-radius: 2px; opacity: 0; transform: none; transition: left 200ms ease, width 200ms ease, opacity 160ms ease; }
.lab-xr-bar i.hl.on { opacity: 1; }
.lab-xr-parts { display: flex; flex-wrap: wrap; gap: 4px 12px; font: 500 12px/1.4 var(--font-sans); color: var(--muted); font-variant-numeric: tabular-nums; }
.lab-xr-parts span { display: inline-flex; align-items: center; gap: 6px; }
.lab-xr-parts span::before { content: ""; width: 8px; height: 8px; border-radius: 50%; flex: none; }
.lab-xr-parts .r::before { background: var(--rt); }
.lab-xr-parts .v::before { background: var(--val); }
.lab-xr-parts .r::after { content: "+"; margin-left: 6px; color: var(--faint); }
.lab-xr-parts b { color: var(--ink); font-weight: 650; }

/* passage and map side by side, no boxes: one hairline between them */
.lab-xr-grid { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr); gap: 0; align-items: start; }
.lab-xr-grid .pane { border: 0; border-radius: 0; padding: 0; background: none; }
.lab-xr-grid .lab-xr-slots { margin-left: 26px; padding-left: 26px; border-left: 1px solid var(--line-2); }
.lab-xr-grid .pane h4 { margin-bottom: 10px; }
.lab-xr-mode { margin-bottom: 12px; }
.lab-xr-mode.seg { display: flex; width: fit-content; max-width: 100%; }
.lab-xr-q { margin: 0 0 10px; padding-bottom: 10px; border-bottom: 1px solid var(--line-2); font: 600 15px/1.6 var(--font-sans); color: var(--ink); }
.lab-xr-q .lab-qk { margin-right: 8px; font: 600 10px/1 var(--font-mono); letter-spacing: 0.1em; color: var(--faint); }
.lab-xr-doc { font-size: 19px; line-height: 1.85; }
.lab-xr-doc .tok, .lab-xr-q .tok { cursor: default; padding: 1px 0; }
.lab-xr .toks .tok[data-pct]::after { white-space: nowrap; }
.lab-xr-legend { margin-top: 12px; min-height: 20px; font-size: 11px; gap: 8px 14px; }
.lab-xr-legend i { width: 14px; height: 10px; }
.lab-xr-legend .lhl { background: var(--hl); }

.lab-xr-grid .pane h4.lab-xr-sub { margin: 18px 0 10px; padding-top: 14px; border-top: 1px solid var(--line-2); }
.lab-xr-text .slotbar { margin-bottom: 0; }
/* slot chips as in the launch inspector; the thin bottom bar is the slot's part of the score */
.lab-xr .sb .fill { background: rgba(var(--ink-rgb), 0.45); }
.lab-xr .sb[aria-pressed="true"]::before { content: ""; position: absolute; top: 4px; right: 4px; width: 5px; height: 5px; border-radius: 50%; background: var(--ink); }
.lab-xr-maphead { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.lab-xr-maphead h4 { margin: 0 !important; }
.lab-xr-map { display: block; width: 100%; max-width: 420px; height: auto; margin-inline: auto; overflow: visible; font-family: var(--font-sans); touch-action: manipulation; }
.lab-xr-map:focus { outline: none; }
.lab-xr-map:focus-visible { outline: 2px solid var(--bb-focus, var(--ink)); outline-offset: 4px; border-radius: 6px; }
.lab-xr-map .lab-cell { cursor: pointer; }
.lab-xr-map text { fill: var(--muted); font-size: 10.5px; font-variant-numeric: tabular-nums; }
.lab-xr-map text.ax { fill: var(--faint); font-size: 9.5px; font-weight: 600; letter-spacing: 0.08em; }
.lab-xr-note { min-height: 42px; margin: 10px 0 0; }
.lab-short { display: none; }

@media (max-width: 980px) {
  .lab-xr-grid { grid-template-columns: 1fr; }
  .lab-xr-grid .lab-xr-slots { margin: 22px 0 0; padding: 18px 0 0; border-left: 0; border-top: 1px solid var(--line-2); }
}
@media (max-width: 760px) {
  .lab-xr-score { grid-template-columns: 1fr; }
  .lab-xr-total { grid-row: auto; }
  .lab-xr-total b { font-size: 26px; }
  .lab-xr-doc { font-size: 17.5px; }
  .lab-xr-mode.seg button { padding: 7px 11px; }
}
@media (prefers-reduced-motion: reduce) {
  .lab-xr-bar i { transition: none; }
}
