/* ── THE AI HARNESS ──
   Page-specific components for /reference/ai-quality-architecture.html.
   Builds on the tokens in design.css. The video stage scales like a real
   video: everything inside it is sized in em, and the stage's font-size is
   tied to its own width (1cqw), so the whole frame grows and shrinks as one.
   Wide players get a 16:9 layout; narrow ones a 9:16 "reel" layout. */

:root {
  --hx-danger: #ff5f56;
  --hx-danger-soft: rgba(255, 95, 86, 0.12);
  --hx-amber: #f5a35c;
  --hx-line: #2a2a2a;
  --hx-panel: #0d0d0d;
  --hx-glow: rgba(232, 255, 74, 0.2);
}

.hx-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

/* ── HERO & TYPE ── */
.hx-hero .page-tag { max-width: none; }
.hx-hero-meta {
  list-style: none; display: flex; flex-wrap: wrap; gap: 0.4rem 0;
  margin-top: 1.8rem;
  font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--muted);
}
.hx-hero-meta li + li::before { content: '·'; color: var(--accent); margin: 0 0.9rem; }
.hx-hero-meta a {
  color: var(--fg); text-transform: none; letter-spacing: 0.04em;
  text-decoration: underline; text-decoration-color: #555; text-underline-offset: 3px; transition: color 0.2s;
}
.hx-hero-meta a:hover { color: var(--accent); text-decoration-color: var(--accent); }
.hx-actions { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 2rem; }
.hx-btn-sm { padding: 0.65rem 1.2rem; font-size: 0.68rem; cursor: pointer; font-family: var(--mono); }
button.btn { cursor: pointer; }

.hx-content { max-width: 1240px; }
.hx-content .back-link { margin-bottom: 2.5rem; }
.hx-h2 {
  font-size: clamp(2rem, 4.6vw, 3.5rem); font-weight: 900;
  line-height: 1.02; letter-spacing: -0.03em; text-transform: uppercase;
  margin-bottom: 1.6rem; max-width: 920px; text-wrap: balance;
}
.hx-h2 span { color: var(--accent); }
.hx-lede { font-size: 1.12rem; line-height: 1.75; color: #bbb; max-width: 760px; margin-bottom: 1.4rem; }
.hx-mini-label {
  display: block; font-family: var(--mono); font-size: 0.6rem; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 0.55rem;
}
.hx-section {
  padding-top: 4.5rem; margin-top: 4.5rem; border-top: 1px solid var(--border);
  scroll-margin-top: 70px;
}
.hx-watch { scroll-margin-top: 70px; }

/* ── PLAYER ── */
.hx-player { container: hxwrap / inline-size; position: relative; margin-top: 0.6rem; }
.hx-frame { container-type: inline-size; position: relative; }

.hx-stage {
  position: relative;
  aspect-ratio: 16 / 9;
  font-size: 1cqw;
  overflow: hidden;
  display: grid;
  /* pad | panel | link | building | link | systems | pad  = 100em */
  grid-template-columns: 3em 28em 5em 33em 5em 23em 3em;
  /* pad | hud + people | sign | floor 08 … floor 01 | ground | caption */
  grid-template-rows: 2.2em 4.8em 3.6em repeat(8, minmax(0, 1fr)) 3em 9.6em;
  background-color: #0b0b0b;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.026) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.026) 1px, transparent 1px);
  background-size: 4em 4em;
  border: 1px solid var(--border);
  color: var(--fg);
  line-height: 1.3;
  outline: none;
  -webkit-user-select: none; user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.hx-stage:focus-visible { box-shadow: 0 0 0 2px var(--accent); }
.js .hx-stage:not([data-mode="poster"]) { cursor: pointer; }

/* Seeking renders a frame without animating into it. */
.hx-stage.is-instant, .hx-stage.is-instant *,
.hx-stage.is-instant *::before, .hx-stage.is-instant *::after { transition: none !important; }
.hx-stage.is-paused * { animation-play-state: paused !important; }

/* HUD */
.hx-hud {
  grid-row: 2; grid-column: 2; align-self: center;
  display: flex; align-items: baseline; gap: 1em; min-width: 0;
  font-family: var(--mono); text-transform: uppercase; letter-spacing: 0.14em; white-space: nowrap;
}
.hx-hud-num { font-size: 0.95em; color: var(--accent); }
.hx-hud-title { font-size: 0.95em; color: #b5b5b5; overflow: hidden; text-overflow: ellipsis; }

/* Employees and the sign on the roof */
.hx-people {
  grid-row: 2; grid-column: 4; align-self: end;
  display: flex; flex-direction: column; align-items: center; gap: 0.25em; padding-bottom: 0.3em;
}
.hx-people-label { font-family: var(--mono); font-size: 0.78em; letter-spacing: 0.22em; text-transform: uppercase; color: #7a7a7a; }
.hx-people-row { display: flex; gap: 0.5em; }
.hx-people svg { width: 1.55em; height: 1.55em; fill: #2f2f2f; transition: fill 0.5s; }
.hx-stage.is-users .hx-people svg { fill: #cfcfcf; }
.hx-stage.is-users .hx-people svg:nth-child(3n + 2) { fill: var(--accent); }
.hx-people svg:nth-child(2) { transition-delay: 0.05s; } .hx-people svg:nth-child(3) { transition-delay: 0.1s; }
.hx-people svg:nth-child(4) { transition-delay: 0.15s; } .hx-people svg:nth-child(5) { transition-delay: 0.2s; }
.hx-people svg:nth-child(6) { transition-delay: 0.25s; } .hx-people svg:nth-child(7) { transition-delay: 0.3s; }
.hx-people svg:nth-child(8) { transition-delay: 0.35s; } .hx-people svg:nth-child(9) { transition-delay: 0.4s; }
.hx-people svg:nth-child(10) { transition-delay: 0.45s; } .hx-people svg:nth-child(11) { transition-delay: 0.5s; }
.hx-people svg:nth-child(12) { transition-delay: 0.55s; }

.hx-sign {
  grid-row: 3; grid-column: 4; justify-self: center; align-self: center; position: relative;
  display: inline-flex; align-items: center; gap: 0.55em;
  background: var(--accent); color: #0a0a0a;
  font-weight: 900; font-size: 1.45em; letter-spacing: 0.05em; text-transform: uppercase;
  padding: 0.32em 0.9em; transition: box-shadow 0.6s;
}
.hx-sign::after {
  content: ''; position: absolute; top: 100%; left: 50%; width: 2px; height: 0.7em;
  background: var(--accent); transform: translateX(-50%);
}
.hx-sign-dot { width: 0.42em; height: 0.42em; border-radius: 50%; background: #0a0a0a; }
.hx-stage.is-summary .hx-sign { box-shadow: 0 0 2.2em rgba(232, 255, 74, 0.45); }

/* ── FLOORS ── */
.hx-floors {
  grid-row: 4 / 12; grid-column: 4; list-style: none; position: relative;
  display: grid; grid-template-rows: repeat(8, minmax(0, 1fr));
  border-left: 2px solid #262626; border-right: 2px solid #262626; padding: 0 0.5em;
}
.hx-floor { position: relative; display: flex; padding: 0.26em 0; min-height: 0; }
.hx-floor[data-floor="8"] { grid-row: 1; } .hx-floor[data-floor="7"] { grid-row: 2; }
.hx-floor[data-floor="6"] { grid-row: 3; } .hx-floor[data-floor="5"] { grid-row: 4; }
.hx-floor[data-floor="4"] { grid-row: 5; } .hx-floor[data-floor="3"] { grid-row: 6; }
.hx-floor[data-floor="2"] { grid-row: 7; } .hx-floor[data-floor="1"] { grid-row: 8; }

.hx-slot {
  position: relative; flex: 1; display: block; min-width: 0; padding: 0;
  font: inherit; color: inherit; text-align: left; cursor: pointer;
  background: transparent; border: 1px dashed #303030;
  transition: border-color 0.3s, background-color 0.3s;
}
.hx-slot:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.hx-slot:hover { border-color: #5a5a5a; }
html:not(.js) .hx-slot { cursor: default; }

.hx-ghost {
  position: absolute; inset: 0; display: flex; align-items: center; padding: 0 1.2em;
  font-family: var(--mono); font-size: 0.95em; letter-spacing: 0.12em; text-transform: uppercase;
  color: #7a7a7a; white-space: nowrap; overflow: hidden;
}

.hx-slab {
  position: absolute; inset: -1px;
  display: grid; grid-template-columns: 3.1em 2.5em minmax(0, 1fr) auto 1.2em; align-items: center;
  padding: 0 0.9em 0 1.1em;
  background: #151515; border: 1px solid var(--hx-line);
  opacity: 0; transform: translateY(-55%);
  transition: opacity 0.3s ease, transform 0.55s cubic-bezier(0.2, 0.9, 0.3, 1.25),
    border-color 0.35s, box-shadow 0.35s, background-color 0.35s;
}
.hx-floor.is-built .hx-slab { opacity: 1; transform: none; }
.hx-ghost { transition: opacity 0.2s; }
.hx-floor.is-built .hx-ghost { opacity: 0; }
.hx-fnum { font-family: var(--mono); font-size: 1em; color: var(--accent); letter-spacing: 0.1em; }
.hx-ficon {
  width: 1.8em; height: 1.8em; fill: none; stroke: var(--fg);
  stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round;
}
.hx-ftext { display: flex; flex-direction: column; min-width: 0; }
.hx-fname {
  font-weight: 800; font-size: 1.38em; line-height: 1.1; letter-spacing: 0.02em; text-transform: uppercase;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.hx-fsub {
  font-family: var(--mono); font-size: 0.88em; color: #8c8c8c; letter-spacing: 0.04em; margin-top: 0.2em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.hx-flink { display: none; }
.hx-fdot {
  justify-self: end; width: 0.65em; height: 0.65em; border-radius: 50%;
  background: #3a3a3a; transition: background-color 0.3s, box-shadow 0.3s;
}
.hx-floor.is-built .hx-fdot { background: var(--accent); }

/* The floor being added now */
.hx-floor.is-current .hx-slab {
  border-color: var(--accent); background: #171a0b;
  box-shadow: 0 0 0 1px var(--accent), 0 0 2.2em var(--hx-glow);
}
.hx-floor.is-current .hx-fdot { box-shadow: 0 0 0.9em rgba(232, 255, 74, 0.8); }
.hx-floor.is-next .hx-slot { border-color: #6a6a6a; }
.hx-floor.is-next .hx-ghost { color: #9a9a9a; }
/* A missing floor while something is breaking */
.hx-floor.is-gap .hx-slot { border-color: var(--hx-danger); animation: hx-gap 1.3s ease-in-out infinite; }
.hx-floor.is-gap .hx-ghost { color: var(--hx-danger); }
@keyframes hx-gap { 50% { background-color: rgba(255, 95, 86, 0.16); } }

/* Connector from the story panel to the floor in play */
.hx-floor::before {
  content: ''; position: absolute; right: calc(100% + 0.5em + 2px); top: 50%; width: 5em;
  border-top: 2px dashed transparent; pointer-events: none; transition: border-color 0.3s;
}
.hx-floor.is-focus::before { border-top-color: var(--accent); }
.hx-floor.is-focus.is-gap::before { border-top-color: var(--hx-danger); }

/* Summary: one rented floor, seven of yours */
.hx-stage.is-summary .hx-floor:not([data-floor="1"]) .hx-slab { border-color: rgba(232, 255, 74, 0.5); }
.hx-stage.is-summary .hx-floor[data-floor="1"] .hx-slab { opacity: 0.6; border-style: dashed; background: #101010; }

/* Quality engineering: a test on every floor */
.hx-spine {
  grid-row: 4 / 12; grid-column: 3; justify-self: center; width: 2px;
  margin: 1.2em 0; background: var(--accent);
  transform: scaleY(0); transform-origin: 50% 100%; transition: transform 0.9s ease;
}
.hx-stage.is-qe .hx-spine { transform: scaleY(1); }
.hx-spine span { display: none; }
.hx-fcheck {
  position: absolute; left: calc(-3em - 2px); top: 50%; z-index: 1;
  width: 1.7em; height: 1.7em; margin: -0.85em 0 0 -0.85em; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--accent); color: #0a0a0a; font-size: 1em; font-weight: 900; line-height: 1;
  transform: scale(0); transition: transform 0.35s cubic-bezier(0.2, 0.9, 0.3, 1.4);
}
.hx-stage.is-qe .hx-fcheck { transform: scale(1); }
.hx-floor[data-floor="1"] .hx-fcheck { transition-delay: 0.1s; } .hx-floor[data-floor="2"] .hx-fcheck { transition-delay: 0.2s; }
.hx-floor[data-floor="3"] .hx-fcheck { transition-delay: 0.3s; } .hx-floor[data-floor="4"] .hx-fcheck { transition-delay: 0.4s; }
.hx-floor[data-floor="5"] .hx-fcheck { transition-delay: 0.5s; } .hx-floor[data-floor="6"] .hx-fcheck { transition-delay: 0.6s; }
.hx-floor[data-floor="7"] .hx-fcheck { transition-delay: 0.7s; } .hx-floor[data-floor="8"] .hx-fcheck { transition-delay: 0.8s; }

/* ── SYSTEMS OUTSIDE THE BUILDING ── */
.hx-systems {
  grid-row: 4 / 12; grid-column: 6; list-style: none;
  display: grid; grid-template-rows: repeat(8, minmax(0, 1fr));
}
.hx-sys {
  position: relative; align-self: center;
  display: flex; flex-direction: column; justify-content: center;
  padding: 0.45em 0.9em; min-height: 0;
  background: #121212; border: 1px solid var(--hx-line);
  opacity: 0; transform: translateX(1.2em);
  transition: opacity 0.4s, transform 0.5s ease, border-color 0.35s, box-shadow 0.35s;
}
.hx-sys[data-floor="8"] { grid-row: 1; } .hx-sys[data-floor="7"] { grid-row: 2; }
.hx-sys[data-floor="5"] { grid-row: 4; } .hx-sys[data-floor="4"] { grid-row: 5; }
.hx-sys[data-floor="3"] { grid-row: 6; } .hx-sys[data-floor="1"] { grid-row: 8; }
.hx-sys.is-on { opacity: 1; transform: none; }
.hx-sys::before {
  content: ''; position: absolute; right: calc(100% + 1px); top: 50%; width: calc(5em - 2px);
  border-top: 1px dashed #5a5a5a; transform: scaleX(0); transform-origin: 0 50%;
  transition: transform 0.45s 0.15s ease, border-color 0.3s;
}
.hx-sys.is-on::before { transform: scaleX(1); }
.hx-sys.is-new { border-color: var(--accent); box-shadow: 0 0 1.6em var(--hx-glow); }
.hx-sys.is-new::before { border-top-color: var(--accent); }
.hx-via {
  position: absolute; right: calc(100% + 0.7em); bottom: 50%; margin-bottom: 0.3em;
  font-family: var(--mono); font-size: 0.78em; letter-spacing: 0.08em; color: #7a7a7a;
}
.hx-sys.is-new .hx-via { color: var(--accent); }
.hx-sys-name { font-weight: 800; font-size: 1.12em; letter-spacing: 0.04em; text-transform: uppercase; white-space: nowrap; }
.hx-sys-sub { font-family: var(--mono); font-size: 0.82em; color: #8c8c8c; white-space: nowrap; margin-top: 0.15em; }
.hx-sys--cloud { border-radius: 1.6em; border-style: dashed; border-color: #4a4a4a; padding-left: 1.3em; background: #101010; }
.hx-stamp {
  position: absolute; top: -0.85em; right: 0.9em; padding: 0.12em 0.5em;
  font-family: var(--mono); font-size: 0.72em; letter-spacing: 0.16em; text-transform: uppercase;
  color: #bdbdbd; background: #0b0b0b; border: 1px solid #6a6a6a; transform: rotate(4deg);
  transition: all 0.4s;
}
.hx-stage.is-summary .hx-stamp { color: #0a0a0a; background: var(--accent); border-color: var(--accent); }

.hx-ground {
  grid-row: 12; grid-column: 4 / 7;
  display: grid; grid-template-columns: 33em 5em 23em; align-items: start;
  font-family: var(--mono); font-size: 1em; letter-spacing: 0.18em; text-transform: uppercase; color: #7a7a7a;
}
.hx-ground span { font-size: 0.8em; padding-top: 0.55em; border-top: 2px solid #3a3a3a; text-align: center; }
.hx-ground span + span { grid-column: 3; border-top: 1px dashed #3a3a3a; }

/* ── STORY PANEL ── */
.hx-panel {
  grid-row: 3 / 13; grid-column: 2; position: relative; min-height: 0; overflow: hidden;
  display: flex; flex-direction: column; gap: 1em;
  padding: 1.5em 1.5em 1.6em;
  background: rgba(13, 13, 13, 0.94); border: 1px solid var(--hx-line);
}
.hx-kicker { display: flex; flex-wrap: wrap; gap: 0.5em; min-height: 1.9em; }
.hx-badge {
  display: none; align-self: flex-start;
  font-family: var(--mono); font-size: 0.82em; letter-spacing: 0.14em; text-transform: uppercase;
  padding: 0.3em 0.7em; border: 1px solid;
}
.hx-badge.is-on { display: inline-block; }
.hx-badge--muted { color: #a5a5a5; border-color: #3c3c3c; }
.hx-badge--bad { color: var(--hx-danger); border-color: var(--hx-danger); background: var(--hx-danger-soft); }
.hx-badge--ok { color: var(--accent); border-color: var(--accent); background: rgba(232, 255, 74, 0.06); }
.hx-ptitle {
  font-size: 2em; font-weight: 900; line-height: 1.06; letter-spacing: -0.01em;
  text-transform: uppercase; text-wrap: balance;
}
.hx-pbody { display: flex; flex-direction: column; gap: 0.7em; min-height: 0; }
.hx-panel.is-chat { gap: 0.8em; }

/* Items in the panel fade in at their step. */
.hx-pbody > *, .hx-plain {
  opacity: 0; transform: translateY(0.6em);
  transition: opacity 0.35s ease, transform 0.35s ease;
}
.hx-pbody > .is-on, .hx-plain.is-on { opacity: 1; transform: none; }
.hx-pbody > :not(.is-on) { pointer-events: none; }

.hx-msg {
  max-width: 94%; padding: 0.6em 0.85em; font-size: 1.24em; line-height: 1.38;
  background: #161616; border: 1px solid var(--hx-line);
}
.hx-msg-who {
  display: block; margin-bottom: 0.25em;
  font-family: var(--mono); font-size: 0.6em; letter-spacing: 0.16em; text-transform: uppercase; color: #8a8a8a;
}
.hx-msg--user { align-self: flex-end; background: #1c1c1c; }
.hx-msg--ai { align-self: flex-start; }
.hx-msg--bad { border-color: rgba(255, 95, 86, 0.65); color: #ffd6d3; }
.hx-msg--bad .hx-msg-who { color: var(--hx-danger); }
.hx-pbody > .is-on.is-struck { opacity: 0.38; }
.hx-msg--good { border-color: rgba(232, 255, 74, 0.6); background: #15180a; }
.hx-msg--good .hx-msg-who { color: var(--accent); }
.hx-msg-text { display: block; }
.hx-tag {
  display: block; margin-top: 0.5em;
  font-family: var(--mono); font-size: 0.6em; letter-spacing: 0.08em; text-transform: uppercase;
}
.hx-msg--bad .hx-tag { color: var(--hx-danger); }
.hx-msg--good .hx-tag { color: var(--accent); }
.hx-msg .hx-trace { margin-top: 0.5em; font-size: 0.8em; }

/* The chat: newest line at the bottom; older lines slide up and fade under the top edge. */
.hx-log {
  flex: 1 1 auto; min-height: 0; overflow: hidden;
  display: flex; flex-direction: column; justify-content: flex-end;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, transparent 0.5em, #000 3.6em);
          mask-image: linear-gradient(to bottom, transparent 0, transparent 0.5em, #000 3.6em);
}
.hx-li {
  flex-shrink: 0; display: flex; flex-direction: column; align-items: flex-start;
  max-height: 0; margin-top: 0; opacity: 0; overflow: hidden;
  transition: max-height 0.45s ease, margin-top 0.45s ease, opacity 0.35s ease 0.05s;
}
.hx-li.is-on { max-height: 20em; margin-top: 0.6em; opacity: 1; }
.hx-li--user { align-items: flex-end; }
.hx-li--note { align-items: center; }
.hx-li.is-on.is-struck { opacity: 0.42; }
.hx-li.is-struck .hx-msg-text, .hx-li.is-struck .hx-meter-value { text-decoration: line-through; text-decoration-color: var(--hx-danger); }
.hx-li .hx-msg { max-width: 94%; }

.hx-typing { display: inline-flex; gap: 0.32em; padding: 0.75em 0.9em; background: #161616; border: 1px solid var(--hx-line); }
.hx-typing span { width: 0.5em; height: 0.5em; border-radius: 50%; background: #9a9a9a; animation: hx-dot 1.1s ease-in-out infinite; }
.hx-typing span:nth-child(2) { animation-delay: 0.15s; }
.hx-typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes hx-dot { 0%, 80%, 100% { opacity: 0.25; transform: none; } 40% { opacity: 1; transform: translateY(-0.25em); } }

.hx-email {
  max-width: 94%; padding: 0.55em 0.85em; font-size: 1.1em; line-height: 1.38; font-style: italic;
  color: #f6d7b8; background: rgba(245, 163, 92, 0.07); border: 1px dashed var(--hx-amber);
}
.hx-email-label {
  display: block; margin-bottom: 0.3em; font-style: normal;
  font-family: var(--mono); font-size: 0.58em; letter-spacing: 0.14em; text-transform: uppercase; color: var(--hx-amber);
}
.hx-note {
  padding: 0.35em 0.8em; font-family: var(--mono); font-size: 0.86em; letter-spacing: 0.04em;
  color: #c8c8c8; background: #121212; border: 1px solid #333;
}
.hx-sysline { font-family: var(--mono); font-size: 0.92em; letter-spacing: 0.06em; color: var(--hx-danger); }
.hx-source {
  display: block; margin-top: 0.45em; font-family: var(--mono); font-size: 0.62em; letter-spacing: 0.06em; color: var(--accent);
}
.hx-chip {
  align-self: flex-start; padding: 0.35em 0.7em;
  font-family: var(--mono); font-size: 0.86em; letter-spacing: 0.05em;
  border: 1px solid var(--hx-line); color: #cfcfcf;
}
.hx-chip--ok { border-color: rgba(232, 255, 74, 0.5); color: var(--accent); }
.hx-code {
  padding: 0.8em 1em; font-family: var(--mono); font-size: 1.02em; line-height: 1.5;
  color: #d5d5d5; background: #050505; border: 1px solid var(--hx-line); word-break: break-word;
}
.hx-code b { color: var(--accent); font-weight: 400; }
.hx-code i { color: #8c8c8c; font-style: normal; }

.hx-meter { padding: 0.9em 1em; border: 1px solid rgba(255, 95, 86, 0.55); background: rgba(255, 95, 86, 0.06); }
.hx-meter-label { font-family: var(--mono); font-size: 0.92em; color: #c5c5c5; margin-bottom: 0.35em; }
.hx-meter-value { font-size: 3.3em; font-weight: 900; line-height: 1; letter-spacing: -0.03em; color: var(--hx-danger); }
.hx-meter-value small { display: inline-block; font-size: 0.32em; font-weight: 500; letter-spacing: 0; color: #c5c5c5; margin-left: 0.4em; }

.hx-routes, .hx-trace { list-style: none; display: grid; gap: 0.4em; }
.hx-routes li, .hx-trace li {
  display: grid; align-items: center; gap: 0.8em; padding: 0.45em 0.75em;
  font-size: 1.08em; background: #151515; border: 1px solid var(--hx-line);
}
.hx-routes li { grid-template-columns: minmax(0, 1fr) auto; }
.hx-routes b { font-family: var(--mono); font-weight: 400; font-size: 0.86em; color: var(--accent); white-space: nowrap; }
.hx-trace li { grid-template-columns: 1.4em minmax(0, 1fr); }
.hx-trace li span { font-family: var(--mono); font-size: 0.85em; color: var(--accent); }
.hx-trace li.is-bad { border-color: rgba(255, 95, 86, 0.55); }
.hx-trace li.is-bad span { color: var(--hx-danger); }

.hx-checklist { list-style: none; display: grid; gap: 0.15em; }
.hx-checklist li {
  display: grid; grid-template-columns: 2.4em minmax(0, 1fr) auto; align-items: center;
  padding: 0.38em 0.2em; font-size: 1.1em; color: #dedede; border-bottom: 1px solid #1f1f1f;
}
.hx-checklist li span { font-family: var(--mono); font-size: 0.82em; color: var(--accent); }
.hx-checklist li::after { content: '\2713'; color: var(--accent); font-weight: 900; }
.js .hx-pbody .hx-checklist li { opacity: 0; transition: opacity 0.3s; }
.js .hx-pbody .hx-checklist.is-on li { opacity: 1; }
.hx-checklist li:nth-child(2) { transition-delay: 0.12s; } .hx-checklist li:nth-child(3) { transition-delay: 0.24s; }
.hx-checklist li:nth-child(4) { transition-delay: 0.36s; } .hx-checklist li:nth-child(5) { transition-delay: 0.48s; }
.hx-checklist li:nth-child(6) { transition-delay: 0.6s; } .hx-checklist li:nth-child(7) { transition-delay: 0.72s; }

.hx-split { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5em; }
.hx-split > div { padding: 0.6em 0.8em; border: 1px solid var(--hx-line); }
.hx-split-label { font-family: var(--mono); font-size: 0.8em; letter-spacing: 0.14em; text-transform: uppercase; color: #9a9a9a; }
.hx-split-value { font-size: 1.7em; font-weight: 900; text-transform: uppercase; }
.hx-split .is-ok { border-color: rgba(232, 255, 74, 0.6); }
.hx-split .is-ok .hx-split-value { color: var(--accent); }

.hx-compare { padding: 0.7em 0.9em; border: 1px solid var(--hx-line); }
.hx-compare--bad { border-color: rgba(255, 95, 86, 0.55); }
.hx-compare--good { border-color: rgba(232, 255, 74, 0.6); background: #15180a; }
.hx-compare-label { font-family: var(--mono); font-size: 0.8em; letter-spacing: 0.14em; text-transform: uppercase; color: #9a9a9a; margin-bottom: 0.2em; }
.hx-compare--good .hx-compare-label { color: var(--accent); }
.hx-compare-text { font-size: 1.32em; font-weight: 700; }

.hx-plain {
  margin-top: auto; padding: 0.75em 0 0.75em 1.1em;
  border-left: 3px solid var(--accent);
  background: linear-gradient(90deg, rgba(232, 255, 74, 0.09), transparent 85%);
}
.hx-plain-label { font-family: var(--mono); font-size: 0.78em; letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent); margin-bottom: 0.35em; }
.hx-plain-text { font-size: 1.42em; font-weight: 700; line-height: 1.32; text-wrap: balance; }
/* In a chat scene the plain-terms card sits under the headline and opens when the floor lands. */
.hx-plain--top {
  margin-top: 0; flex-shrink: 0; max-height: 12em; overflow: hidden;
  transition: opacity 0.35s ease, transform 0.35s ease, max-height 0.45s ease, padding 0.45s ease, margin 0.45s ease;
}
.hx-plain--top:not(.is-on) { max-height: 0; padding-top: 0; padding-bottom: 0; margin-top: -0.8em; }

/* ── CAPTIONS ── */
.hx-caption {
  grid-row: 13; grid-column: 2 / 7; align-self: center; justify-self: center;
  max-width: 80em; padding: 0 1em; text-align: center; text-wrap: balance; transition: opacity 0.25s;
}
.hx-caption span {
  font-size: 1.68em; line-height: 1.45; color: #fff; background: rgba(0, 0, 0, 0.82);
  padding: 0.1em 0.5em; -webkit-box-decoration-break: clone; box-decoration-break: clone;
}
.hx-caption span:empty { display: none; }
.hx-stage[data-mode="poster"] .hx-caption, .hx-stage.no-cc .hx-caption { opacity: 0; }
/* Plain-terms lines are already on screen in the panel; keep them for screen readers only. */
.hx-caption.is-plain span {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; padding: 0;
}

/* ── POSTER & END SCREEN ── */
.hx-poster, .hx-end {
  position: absolute; inset: 0; z-index: 6;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1.3em;
  padding: 2em; text-align: center;
}
.hx-poster {
  background: radial-gradient(ellipse at 50% 48%, rgba(10, 10, 10, 0.93) 0%, rgba(10, 10, 10, 0.86) 45%, rgba(10, 10, 10, 0.74) 100%);
  transition: opacity 0.35s, visibility 0.35s;
}
.hx-stage:not([data-mode="poster"]) .hx-poster { opacity: 0; visibility: hidden; pointer-events: none; }
.hx-poster-kicker { font-family: var(--mono); font-size: 1em; letter-spacing: 0.22em; text-transform: uppercase; color: var(--accent); }
.hx-poster-title { font-size: 4.4em; font-weight: 900; line-height: 0.98; letter-spacing: -0.03em; text-transform: uppercase; }
.hx-poster-title span { color: var(--accent); }
.hx-bigplay {
  width: 7em; height: 7em; border-radius: 50%; border: 0; cursor: pointer;
  display: grid; place-items: center; background: var(--accent); color: #0a0a0a;
  animation: hx-ring 2.2s ease-out infinite;
}
.hx-bigplay svg { width: 3em; height: 3em; fill: currentColor; margin-left: 0.3em; }
.hx-bigplay:hover { transform: scale(1.05); }
.hx-bigplay:focus-visible { outline: 3px solid #fff; outline-offset: 4px; }
@keyframes hx-ring {
  0% { box-shadow: 0 0 0 0 rgba(232, 255, 74, 0.45); }
  100% { box-shadow: 0 0 0 2.2em rgba(232, 255, 74, 0); }
}
.hx-poster-hint { font-family: var(--mono); font-size: 0.95em; letter-spacing: 0.06em; color: #a8a8a8; }

.hx-end { background: rgba(10, 10, 10, 0.88); gap: 2.2em; }
.hx-end[hidden] { display: none; }
.hx-end-title { font-size: 4em; font-weight: 900; line-height: 1; letter-spacing: -0.03em; text-transform: uppercase; }
.hx-end-title span { color: var(--accent); }
.hx-end-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.8rem; }
.hx-end-credit { font-family: var(--mono); font-size: 0.95em; letter-spacing: 0.04em; color: #a8a8a8; }
.hx-end-credit a { color: var(--fg); text-decoration: underline; text-decoration-color: #666; text-underline-offset: 0.2em; }
.hx-end-credit a:hover { color: var(--accent); }

/* ── CONTROLS ── */
.hx-controls {
  display: flex; align-items: center; gap: 0.15rem;
  padding: 0.4rem 0.6rem; background: #0f0f0f;
  border: 1px solid var(--border); border-top: 0;
}
.hx-btn {
  flex-shrink: 0; width: 42px; height: 42px; display: grid; place-items: center;
  background: transparent; border: 0; color: var(--fg); cursor: pointer; transition: color 0.2s;
}
.hx-btn:hover { color: var(--accent); }
.hx-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.hx-btn svg { width: 20px; height: 20px; fill: currentColor; }
.hx-btn--play svg { width: 24px; height: 24px; }
.hx-btn--text { font-family: var(--mono); font-size: 0.74rem; font-weight: 700; letter-spacing: 0.06em; }
.hx-btn[aria-pressed="true"] { color: var(--accent); }
.hx-btn--text[aria-pressed="false"] { color: #777; text-decoration: line-through; }
.hx-btn[hidden] { display: none; }

.hx-scrub { position: relative; flex: 1; min-width: 0; height: 42px; display: flex; align-items: center; margin: 0 0.7rem; }
.hx-range {
  -webkit-appearance: none; appearance: none; width: 100%; height: 6px; margin: 0;
  background: linear-gradient(to right, var(--accent) var(--fill, 0%), #303030 var(--fill, 0%));
  border-radius: 0; cursor: pointer; outline: none;
}
.hx-range::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; width: 16px; height: 16px; border-radius: 50%;
  background: var(--accent); border: 2px solid #0f0f0f;
}
.hx-range::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: var(--accent); border: 2px solid #0f0f0f; }
.hx-range:focus-visible { box-shadow: 0 0 0 2px #0f0f0f, 0 0 0 4px var(--accent); }
.hx-ticks { position: absolute; left: 0; right: 0; top: 50%; height: 0; z-index: 1; pointer-events: none; }
.hx-ticks span { position: absolute; top: -3px; width: 3px; height: 6px; margin-left: -1px; background: #0f0f0f; }
.hx-time { flex-shrink: 0; margin: 0 0.5rem 0 0; font-family: var(--mono); font-size: 0.72rem; color: #a8a8a8; white-space: nowrap; }
.hx-voice-note { min-height: 0; margin-top: 0.5rem; font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.04em; color: var(--muted); }
.hx-voice-note:empty { display: none; }

/* ── CHAPTERS & TRANSCRIPT ── */
.hx-below { margin-top: 1.4rem; }
.hx-chapters {
  list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid var(--border); border-left: 1px solid var(--border);
}
.hx-chapters button {
  width: 100%; height: 100%; display: grid; grid-template-columns: 3.2rem 1.8rem minmax(0, 1fr); align-items: baseline; gap: 0.5rem;
  padding: 0.75rem 1rem; text-align: left; cursor: pointer;
  font: inherit; font-size: 0.9rem; line-height: 1.45; color: #b5b5b5;
  background: transparent; border: 0; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border);
  transition: background-color 0.2s, color 0.2s;
}
.hx-chapters button:hover { background: #111; color: var(--fg); }
.hx-chapters button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.hx-chapters button[aria-current="true"] { background: #13150a; color: var(--fg); box-shadow: inset 3px 0 0 var(--accent); }
.hx-ch-time, .hx-ch-num { font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.06em; }
.hx-ch-time { color: var(--muted); }
.hx-ch-num { color: var(--accent); }
.hx-voice-credit { margin-top: 0.9rem; font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.04em; color: var(--muted); }
.hx-keys { margin-top: 0.9rem; font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.04em; color: var(--muted); }
.hx-keys kbd {
  font-family: var(--mono); font-size: 0.62rem; color: #cfcfcf;
  border: 1px solid #333; padding: 0.05rem 0.35rem; margin-right: 0.2rem;
}

.hx-transcript { margin-top: 1.6rem; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.hx-transcript > summary {
  display: flex; justify-content: space-between; align-items: center; padding: 1rem 0.2rem;
  list-style: none; cursor: pointer;
  font-family: var(--mono); font-size: 0.74rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--fg);
}
.hx-transcript > summary::-webkit-details-marker { display: none; }
.hx-transcript > summary::after { content: '+'; color: var(--accent); font-size: 1rem; }
.hx-transcript[open] > summary::after { content: '\2013'; }
.hx-transcript > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.hx-script { list-style: none; display: grid; gap: 1.3rem; padding: 0.4rem 0.2rem 1.6rem; }
.hx-script > li { max-width: 780px; }
.hx-script-head {
  font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 0.35rem;
}
.hx-script-time { color: var(--muted); margin-right: 0.8rem; }
.hx-script-time:empty { display: none; }
.hx-script p[data-seg] { display: inline; color: #bdbdbd; font-size: 0.96rem; line-height: 1.75; }
.hx-script p[data-seg]::after { content: ' '; }
.hx-script p[data-plain] { display: block; margin-top: 0.35rem; color: var(--fg); }
.hx-script p[data-plain]::before {
  content: 'In plain terms — '; font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--accent);
}

/* ── PULL A FLOOR ── */
.hx-lab { position: relative; padding: 2.2rem; }
.hx-pull { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 2.6rem; align-items: start; }
.hx-pull-floors { list-style: none; display: grid; gap: 6px; }
.hx-pull-floor, .hx-pull-base {
  width: 100%; display: grid; grid-template-columns: 2.1rem 1.3rem minmax(0, 1fr) auto; align-items: center; gap: 0.75rem;
  padding: 0.72rem 1rem; text-align: left;
  font: inherit; color: var(--fg); background: #161616; border: 1px solid var(--hx-line);
  transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}
.hx-pull-floor { cursor: pointer; }
.hx-pull-floor:hover { border-color: #5a5a5a; }
.hx-pull-floor:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.hx-pull-floor[aria-checked="false"] { background: transparent; border-style: dashed; border-color: rgba(255, 95, 86, 0.65); color: #8c8c8c; }
.hx-pull-base { background: #101010; border-style: dashed; color: #9a9a9a; margin-top: 4px; }
.hx-pull-num { font-family: var(--mono); font-size: 0.72rem; color: var(--accent); letter-spacing: 0.08em; }
.hx-pull-floor[aria-checked="false"] .hx-pull-num { color: var(--hx-danger); }
.hx-pull-floor svg, .hx-pull-base svg {
  width: 1.2rem; height: 1.2rem; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round;
}
.hx-pull-name { font-weight: 700; font-size: 0.88rem; letter-spacing: 0.04em; text-transform: uppercase; }
.hx-pull-state { font-family: var(--mono); font-size: 0.6rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); }
.hx-pull-base .hx-pull-state { color: #8a8a8a; }
.hx-pull-floor[aria-checked="true"] .hx-pull-state::before { content: 'Standing'; }
.hx-pull-floor[aria-checked="false"] .hx-pull-state::before { content: 'Pulled'; color: var(--hx-danger); }
.hx-pull-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 1.2rem; }

.hx-pull-out { border-left: 1px solid var(--border); padding-left: 2.6rem; min-height: 100%; }
.hx-pull-count { font-size: 2.8rem; font-weight: 900; line-height: 1; letter-spacing: -0.02em; }
.hx-pull-verdict { margin: 1rem 0 1.3rem; font-size: 1rem; line-height: 1.65; color: #cfcfcf; }
.hx-pull-breaks { list-style: none; display: grid; gap: 0.6rem; }
.hx-break { padding: 0.85rem 1rem; background: #121212; border: 1px solid var(--hx-line); border-left: 3px solid var(--hx-danger); }
.hx-break--l1 { border-left-color: #7a7a7a; }
.hx-break--l2 { border-left-color: var(--hx-amber); }
.hx-break--l0 { border-left-color: #444; }
.hx-break-head { display: flex; justify-content: space-between; align-items: baseline; gap: 0.8rem; }
.hx-break-title { font-weight: 700; font-size: 0.95rem; }
.hx-break-title span { font-family: var(--mono); font-size: 0.68rem; font-weight: 400; color: var(--muted); margin-right: 0.5rem; }
.hx-break-text { margin-top: 0.35rem; font-size: 0.88rem; line-height: 1.55; color: #a8a8a8; }
.hx-risk {
  flex-shrink: 0; padding: 0.15rem 0.45rem; border: 1px solid;
  font-family: var(--mono); font-size: 0.56rem; letter-spacing: 0.12em; text-transform: uppercase; white-space: nowrap;
}
.hx-risk--4 { color: #0a0a0a; background: var(--hx-danger); border-color: var(--hx-danger); }
.hx-risk--3 { color: var(--hx-danger); border-color: var(--hx-danger); }
.hx-risk--2 { color: var(--hx-amber); border-color: var(--hx-amber); }
.hx-risk--1 { color: #b5b5b5; border-color: #555; }
.hx-risk--0 { color: #8a8a8a; border-color: #3a3a3a; }
.hx-pull-next { margin-top: 1.2rem; padding: 1rem 1.15rem; border: 1px solid var(--accent); background: #13150a; }
.hx-pull-next:empty { display: none; }
.hx-pull-next-name { font-weight: 800; font-size: 1rem; text-transform: uppercase; letter-spacing: 0.03em; }
.hx-pull-next-why { margin-top: 0.3rem; font-size: 0.9rem; line-height: 1.6; color: #cfcfcf; }
html:not(.js) .hx-js-only { display: none; }

/* ── FLOOR BY FLOOR ── */
.hx-fl-list { list-style: none; margin-top: 1.8rem; border-top: 1px solid var(--border); }
.hx-fl-list > li { border-bottom: 1px solid var(--border); }
.hx-fl { scroll-margin-top: 70px; transition: background-color 0.2s; }
.hx-fl[open] { background: #0e0e0e; }
.hx-fl > summary {
  display: grid; grid-template-columns: 3rem minmax(0, 1fr) 1rem; align-items: baseline; gap: 1.2rem;
  padding: 1.35rem 0.4rem; list-style: none; cursor: pointer;
}
.hx-fl > summary::-webkit-details-marker { display: none; }
.hx-fl > summary::after { content: '+'; justify-self: end; font-family: var(--mono); color: var(--accent); font-size: 1rem; }
.hx-fl[open] > summary::after { content: '\2013'; }
.hx-fl > summary:hover .hx-fl-name { color: var(--accent); }
.hx-fl > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.hx-fl-num { font-family: var(--mono); font-size: 0.75rem; letter-spacing: 0.12em; color: var(--accent); }
.hx-fl-main { display: flex; flex-direction: column; gap: 0.3rem; min-width: 0; }
.hx-fl-name { font-size: 1.1rem; font-weight: 800; letter-spacing: 0.03em; text-transform: uppercase; transition: color 0.2s; }
.hx-fl-why { font-size: 0.95rem; line-height: 1.55; color: #9a9a9a; }
.hx-fl-body {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.3rem 2.4rem;
  padding: 0.2rem 0.4rem 1.7rem calc(3rem + 1.2rem + 0.4rem);
}
.hx-fl-body p:not(.hx-mini-label) { font-size: 0.93rem; line-height: 1.68; color: #bdbdbd; }

.hx-callout {
  margin-top: 2.2rem; max-width: 880px; padding: 1.4rem 1.6rem;
  border: 1px solid var(--accent); background: #12140a;
}
.hx-callout-label { font-family: var(--mono); font-size: 0.64rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent); margin-bottom: 0.5rem; }
.hx-callout p:not(.hx-callout-label) { color: #dcdcdc; line-height: 1.72; }

.hx-related .hx-actions { margin-top: 0.4rem; }

/* ── NO JAVASCRIPT ── */
html:not(.js) .hx-poster, html:not(.js) .hx-end, html:not(.js) .hx-controls,
html:not(.js) .hx-below, html:not(.js) .hx-caption, html:not(.js) .hx-voice-note { display: none !important; }

/* ── NARROW PLAYERS: VERTICAL "REEL" LAYOUT ── */
@container hxwrap (max-width: 859px) {
  .hx-frame { max-width: 460px; margin: 0 auto; }
  .hx-stage {
    aspect-ratio: 9 / 16;
    font-size: 2.8cqw;
    grid-template-columns: 1.2em minmax(0, 1fr) 1.2em;
    /* pad | hud | panel | sign | floor 08 … floor 01 | ground | caption | pad */
    grid-template-rows: 0.9em 2.3em 22em 2.9em repeat(8, minmax(0, 1fr)) 1.8em 7em 0.5em;
    background-size: 3em 3em;
  }
  .hx-hud { grid-row: 2; grid-column: 2; }
  .hx-hud-num, .hx-hud-title { font-size: 0.9em; }
  .hx-people, .hx-systems, .hx-spine { display: none; }

  .hx-panel { grid-row: 3; grid-column: 2; gap: 0.6em; padding: 0.9em 1em 1em; }
  .hx-kicker { min-height: 1.7em; }
  .hx-badge { font-size: 0.74em; }
  .hx-ptitle { font-size: 1.55em; }
  .hx-pbody { gap: 0.5em; }
  .hx-msg { font-size: 1.22em; padding: 0.5em 0.7em; max-width: 100%; }
  .hx-msg-who { font-size: 0.58em; margin-bottom: 0.15em; }
  .hx-chip { font-size: 0.86em; }
  .hx-code { font-size: 1.05em; padding: 0.6em 0.8em; }
  .hx-meter { padding: 0.6em 0.8em; }
  .hx-meter-value { font-size: 2.6em; }
  .hx-routes li, .hx-trace li { font-size: 1.05em; padding: 0.35em 0.6em; }
  .hx-checklist li { font-size: 0.98em; padding: 0.16em 0.1em; }
  .hx-pbody:has(.hx-split.is-on) .hx-checklist { display: none; }
  .hx-split-value { font-size: 1.4em; }
  .hx-compare-text { font-size: 1.18em; }
  /* Small screens show one beat at a time: the fix replaces the break, the plain-terms card replaces both. */
  .hx-pbody > .is-struck { display: none; }
  .hx-panel.is-plain .hx-pbody { display: none; }
  .hx-panel.is-plain .hx-plain { margin-top: 0; }
  .hx-plain-text { font-size: 1.5em; }
  .hx-panel.is-chat { gap: 0.6em; }
  .hx-plain--top .hx-plain-text { font-size: 1.32em; }
  .hx-plain--top:not(.is-on), .hx-plain--top.is-done { max-height: 0; padding-top: 0; padding-bottom: 0; margin-top: -0.6em; opacity: 0; }
  .hx-li.is-on { margin-top: 0.45em; }
  .hx-email { font-size: 1.05em; padding: 0.45em 0.7em; }
  .hx-note { font-size: 0.8em; }
  .hx-typing { padding: 0.6em 0.75em; }
  .hx-routes li { font-size: 1em; padding: 0.3em 0.6em; }

  .hx-sign { grid-row: 4; grid-column: 2; font-size: 1.15em; padding: 0.3em 0.8em; }
  .hx-sign::after { height: 0.55em; }
  .hx-floors { grid-row: 5 / 13; grid-column: 2; padding: 0 0.4em; }
  .hx-floor { padding: 0.2em 0; }
  .hx-floor::before { display: none; }
  .hx-ghost { font-size: 0.9em; padding: 0 0.9em; }
  .hx-slab { grid-template-columns: 2.4em 2em minmax(0, 1fr) auto 1em; padding: 0 0.7em 0 0.8em; }
  .hx-fnum { font-size: 0.92em; }
  .hx-ficon { width: 1.5em; height: 1.5em; }
  .hx-fname { font-size: 1.26em; }
  .hx-fsub { display: none; }
  .hx-flink {
    display: block; padding-left: 0.6em; white-space: nowrap;
    font-family: var(--mono); font-size: 0.8em; letter-spacing: 0.04em; color: #8c8c8c;
  }
  .hx-fdot { width: 0.55em; height: 0.55em; }
  .hx-fcheck { left: auto; right: 0.45em; width: 1.35em; height: 1.35em; margin: -0.675em 0 0; font-size: 0.8em; }
  .hx-stage.is-qe .hx-fdot { opacity: 0; }

  .hx-ground { grid-row: 13; grid-column: 2; grid-template-columns: 1fr; }
  .hx-ground span { font-size: 0.72em; padding-top: 0.4em; }
  .hx-ground span + span { display: none; }
  .hx-caption { grid-row: 14; grid-column: 2; padding: 0; }
  .hx-caption span { font-size: 1.42em; }

  .hx-poster { gap: 1.1em; padding: 1.5em; }
  .hx-poster-kicker { font-size: 0.85em; }
  .hx-poster-title { font-size: 2.9em; }
  .hx-bigplay { width: 5.4em; height: 5.4em; }
  .hx-bigplay svg { width: 2.4em; height: 2.4em; }
  .hx-poster-hint { font-size: 0.8em; max-width: 24em; }
  .hx-end-title { font-size: 2.6em; }
  .hx-end-actions { flex-direction: column; align-items: stretch; }
  .hx-end-credit { font-size: 1.05em; }

  .hx-controls { max-width: 460px; margin: 0 auto; flex-wrap: wrap; padding: 0.3rem 0.4rem; }
  .hx-scrub { order: -1; flex-basis: 100%; margin: 0 0.35rem; height: 32px; }
  .hx-controls { gap: 0; }
  .hx-time { margin-right: auto; margin-left: 0.2rem; font-size: 0.68rem; }
  .hx-btn { width: 36px; height: 40px; }
  .hx-voice-note { max-width: 460px; margin-left: auto; margin-right: auto; }
}

/* ── FULL SCREEN ── */
.hx-player:fullscreen {
  display: flex; flex-direction: column; justify-content: center; align-items: center;
  padding: 1.2rem; background: #0a0a0a; margin: 0;
}
.hx-player:fullscreen .hx-frame,
.hx-player:fullscreen .hx-controls { width: min(100%, calc((100vh - 6.5rem) * 16 / 9)); max-width: none; }
.hx-player:fullscreen .hx-voice-note { display: none; }
@container hxwrap (max-width: 859px) {
  .hx-player:fullscreen .hx-frame,
  .hx-player:fullscreen .hx-controls { width: min(100%, calc((100vh - 8.5rem) * 9 / 16)); max-width: none; }
}

/* ── RESPONSIVE PAGE ── */
@media (max-width: 900px) {
  .hx-pull { grid-template-columns: 1fr; gap: 1.8rem; }
  .hx-pull-out { border-left: 0; padding-left: 0; border-top: 1px solid var(--border); padding-top: 1.6rem; }
  .hx-chapters { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .hx-section { padding-top: 3.2rem; margin-top: 3.2rem; }
  .hx-lede { font-size: 1.02rem; }
  .hx-hero-meta li + li::before { margin: 0 0.6rem; }
  .hx-lab { padding: 1.4rem 1.1rem; }
  .hx-keys { display: none; }
  .hx-fl > summary { grid-template-columns: 2.1rem minmax(0, 1fr) 1rem; gap: 0.8rem; padding: 1.2rem 0.3rem; }
  .hx-fl-body { grid-template-columns: 1fr; gap: 1rem; padding: 0 0.3rem 1.4rem calc(2.1rem + 0.8rem + 0.3rem); }
  .hx-chapters button { padding: 0.7rem 0.8rem; font-size: 0.86rem; }
  .hx-pull-floor, .hx-pull-base { gap: 0.55rem; padding: 0.65rem 0.8rem; }
  .hx-pull-name { font-size: 0.8rem; }
  .hx-pull-out { padding-top: 1.4rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hx-stage, .hx-stage *, .hx-content * { transition: none !important; animation: none !important; }
}

/* ── PRINT ──
   A light document: transcript and floor-by-floor guidance, without the player. */
@media print {
  @page { size: A4; margin: 16mm 15mm 18mm; }
  :root { --bg: #fff; --fg: #151515; --muted: #5c5c5c; --accent: #4a5f00; --border: #d9d9d9; --card: #fff; }
  html { scroll-behavior: auto; }
  body { background: #fff; color: var(--fg); font-size: 10pt; line-height: 1.55; overflow: visible; }

  body > nav, .back-link, .hx-player, .hx-below, .hx-js-only, .hx-hero .hx-actions, .hx-related .hx-actions,
  .hx-transcript > summary::after, .hx-fl > summary::after, footer p + p { display: none !important; }

  .page-hero { padding: 0 0 1.2rem; }
  .page-hero h1 { font-size: 34pt; }
  .page-hero p { color: #333; max-width: none; }
  .hx-content.page-content { max-width: none; padding: 0.6rem 0 0; }
  footer { padding: 1rem 0 0; justify-content: flex-start; }

  .hx-section { margin-top: 1.4rem; padding-top: 1.2rem; }
  .hx-h2 { font-size: 20pt; margin-bottom: 0.8rem; }
  .hx-lede, .hx-script p[data-seg], .hx-fl-why, .hx-fl-body p:not(.hx-mini-label), .hx-callout p:not(.hx-callout-label) { color: #2a2a2a; max-width: none; }
  .hx-transcript { border: 0; margin-top: 0.4rem; }
  .hx-transcript > summary { padding: 0.4rem 0; }
  .hx-script > li, .hx-fl-list > li, .hx-callout { break-inside: avoid; }
  .hx-fl[open] { background: none; }
  .hx-fl > summary { padding: 0.7rem 0; }
  .hx-fl-body { padding: 0 0 0.8rem calc(3rem + 1.2rem); }
  .hx-callout { background: #fff; border-color: var(--accent); }
  .hx-h2, .section-label, .hx-mini-label, .hx-fl > summary { break-after: avoid; }
}
