:root {
  color-scheme: dark;
  --bg: #030404;
  --panel: rgba(8, 11, 11, 0.78);
  --ink: #f7fbf7;
  --muted: #8c9691;
  --dim: rgba(247, 251, 247, 0.38);
  --line: rgba(247, 251, 247, 0.13);
  --line-strong: rgba(247, 251, 247, 0.29);
  --green: #66ff95;
  --green-soft: rgba(102, 255, 149, 0.15);
  --cyan: #82d8ff;
  --orange: #ffad42;
  --red: #ff6464;
  --gray: #747d78;
  --blue: #bddcff;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background:
    radial-gradient(circle at 44% 34%, rgba(102, 255, 149, 0.055), transparent 34rem),
    linear-gradient(140deg, rgba(130, 216, 255, 0.04), transparent 45%),
    #030404;
  letter-spacing: 0;
}

@supports (height: 100dvh) {
  body,
  .front-door,
  .airlock {
    min-height: 100dvh;
  }
}

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

button {
  cursor: pointer;
}

.frame-grid,
.screen-vignette {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.frame-grid {
  z-index: 0;
  opacity: 0.15;
  background-image:
    radial-gradient(circle, rgba(247, 251, 247, 0.36) 0 1px, transparent 1.7px),
    linear-gradient(rgba(102, 255, 149, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(130, 216, 255, 0.035) 1px, transparent 1px);
  background-size: 67px 71px, 44px 44px, 44px 44px;
  mask-image: linear-gradient(to bottom, black, transparent 88%);
}

.screen-vignette {
  z-index: 1;
  box-shadow: inset 0 0 12rem rgba(0, 0, 0, 0.82);
}

.front-door,
.airlock,
.app {
  position: relative;
  z-index: 2;
}

.front-door,
.airlock {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: clamp(1rem, 4vw, 3rem);
}

.front-door[hidden],
.airlock[hidden],
.app[hidden],
.venture-dock[hidden],
.tower[hidden],
.modal[hidden],
.signal-drawer[hidden] {
  display: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  clip-path: inset(50%);
}

.airlock-mark,
.brand,
.flight,
.kicker,
.gate-message,
.hud-button,
.endpoint,
.menu-pill,
.tunnel-form,
.level-boundary,
.segment-anchor,
.console-topline,
.status-chip,
.surface-list,
.feedback-header,
.signal-status,
.attempt-list,
.metric,
.route-row,
.signal-list,
.drawer-copy,
.front-door-line,
.onboarding-levels button,
.onboarding-endpoints,
.venture-line span,
.venture-line em {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.airlock-mark,
.brand {
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 600;
  text-shadow: 0 0 0.7rem rgba(102, 255, 149, 0.22);
}

.airlock-mark {
  position: fixed;
  top: 1.4rem;
  left: 1.4rem;
}

.gate-form {
  width: min(33rem, 100%);
}

.gate-form h1,
.dock-copy h1,
.tower-title h1 {
  margin: 0;
  font-weight: 760;
  letter-spacing: 0;
}

.gate-form h1 {
  max-width: 28rem;
  margin-bottom: 1.15rem;
  font-size: clamp(1.85rem, 5vw, 4.25rem);
  line-height: 0.95;
}

.gate-stack {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 0.68rem;
}

.gate-stack input,
.gate-stack button,
.hud-button,
.primary-action,
.quiet-action,
.reaction-nudge button,
.venture-line,
.feedback-note,
.route-json,
.hq-runtime-tools select,
.runtime-toggle,
.menu-pill,
.tunnel-form,
.tunnel-form input,
.tunnel-form button {
  border: 1px solid var(--line-strong);
  border-radius: 0;
  background: rgba(0, 0, 0, 0.33);
  color: var(--ink);
  outline: none;
}

.gate-stack input,
.gate-stack button {
  min-height: 3.25rem;
}

.gate-stack input {
  width: 100%;
  padding: 0 0.95rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  text-transform: lowercase;
}

.gate-stack button,
.primary-action {
  color: var(--green);
  padding: 0 1rem;
}

.gate-stack input:focus,
.tunnel-form input:focus,
.feedback-note:focus,
.route-json:focus,
.hud-button:focus-visible,
.primary-action:focus-visible,
.quiet-action:focus-visible,
.reaction-nudge button:focus-visible,
.venture-line:focus-visible,
.menu-pill:focus-visible,
.tunnel-form button:focus-visible,
.segment-anchor:focus-visible {
  border-color: var(--green);
  box-shadow: 0 0 0 1px rgba(102, 255, 149, 0.56), 0 0 2rem rgba(102, 255, 149, 0.1);
}

.gate-tester-hint {
  margin: 1.4rem 0 0;
  font-size: 0.78rem;
  color: rgba(247, 251, 247, 0.5);
  text-align: center;
}

.gate-message {
  position: fixed;
  bottom: 1.4rem;
  left: 1.4rem;
  margin: 0;
  color: var(--muted);
  font-size: 0.75rem;
}

.gate-message.denied {
  color: var(--red);
}

.front-door-grid {
  width: min(72rem, 100%);
  min-height: min(42rem, calc(100vh - 7rem));
  display: grid;
  grid-template-columns: minmax(18rem, 0.82fr) minmax(24rem, 1.18fr);
  align-items: center;
  gap: clamp(1.5rem, 4vw, 4.5rem);
}

.front-door-copy {
  align-self: center;
}

.front-door-copy h1 {
  max-width: 34rem;
  margin: 0.6rem 0 1rem;
  font-size: clamp(2.35rem, 6vw, 5.4rem);
  line-height: 0.9;
  letter-spacing: 0;
}

.front-door-line {
  max-width: 31rem;
  margin: 0;
  color: rgba(247, 251, 247, 0.68);
  font-size: clamp(0.85rem, 1.2vw, 1rem);
  line-height: 1.7;
  text-transform: uppercase;
}

/* E2E-12: plain-language support line under the one-liner (sentence case,
   readable body type — deliberately not the uppercase mono kicker voice). */
.front-door-support {
  max-width: 30rem;
  margin: 0.65rem 0 0;
  color: rgba(247, 251, 247, 0.82);
  font-size: clamp(0.95rem, 1.4vw, 1.1rem);
  line-height: 1.6;
}

.front-door-actions {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-top: 1.45rem;
  flex-wrap: wrap;
}

.front-door-actions .primary-action,
.front-door-actions .quiet-action {
  min-height: 3.2rem;
  min-width: 7.5rem;
}

.front-door-status {
  position: static;
  margin-top: 1.05rem;
}

.audio-action.is-playing,
.onboarding-levels button.is-playing {
  color: var(--green);
  border-color: rgba(102, 255, 149, 0.72);
  box-shadow: 0 0 2rem rgba(102, 255, 149, 0.12);
}

.onboarding-instrument {
  position: relative;
  min-height: 28rem;
  display: grid;
  align-content: center;
  padding: clamp(1rem, 2vw, 2rem);
}

.onboarding-instrument svg {
  width: 100%;
  aspect-ratio: 860 / 420;
  overflow: visible;
  filter: drop-shadow(0 0 1.3rem rgba(102, 255, 149, 0.12));
}

.onboarding-curve-area {
  fill: rgba(102, 255, 149, 0.12);
}

.onboarding-curve-line {
  fill: none;
  stroke: rgba(102, 255, 149, 0.92);
  stroke-width: 6;
  stroke-linecap: round;
}

.onboarding-instrument circle {
  fill: var(--green);
  stroke: rgba(3, 4, 4, 0.9);
  stroke-width: 3;
}

.onboarding-levels {
  display: flex;
  justify-content: space-between;
  gap: 0.55rem;
  width: min(31rem, 83%);
  margin: -0.75rem auto 0;
}

.onboarding-levels button {
  width: clamp(4.1rem, 7.5vw, 5.9rem);
  min-height: 4.2rem;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 0.22rem;
  padding: 0.35rem 0.28rem;
  border: 1px solid rgba(102, 255, 149, 0.34);
  border-radius: 0;
  color: rgba(247, 251, 247, 0.86);
  background:
    radial-gradient(circle at 50% 50%, rgba(102, 255, 149, 0.14), transparent 58%),
    rgba(0, 0, 0, 0.24);
  text-align: center;
  box-shadow: 0 0 1.4rem rgba(102, 255, 149, 0.055);
}

.onboarding-levels button:hover,
.onboarding-levels button:focus-visible {
  color: var(--ink);
  border-color: var(--green);
}

.onboarding-levels span {
  color: var(--green);
  font-size: 0.76rem;
  font-weight: 700;
}

.onboarding-levels strong {
  color: rgba(247, 251, 247, 0.68);
  font-size: clamp(0.52rem, 0.78vw, 0.66rem);
  font-weight: 600;
  line-height: 1.05;
  text-transform: uppercase;
}

.onboarding-endpoints {
  display: flex;
  justify-content: space-between;
  margin-top: 0.75rem;
  color: var(--muted);
  font-size: 0.74rem;
}

.hud-top {
  position: fixed;
  z-index: 14;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: clamp(0.9rem, 2vw, 1.4rem);
  pointer-events: none;
}

.hud-top > * {
  pointer-events: auto;
}

.tester-pwa-active .hud-top {
  display: none;
}

.flight {
  margin-top: 0.3rem;
  color: var(--muted);
  font-size: 0.72rem;
}

.hud-button {
  min-height: 2.4rem;
  color: rgba(247, 251, 247, 0.76);
  padding: 0 0.8rem;
  font-size: 0.72rem;
}

.venture-dock {
  min-height: 100vh;
  display: grid;
  align-content: center;
  gap: clamp(1.5rem, 4vw, 3rem);
  width: min(68rem, 100%);
  margin: 0 auto;
  padding: 7rem clamp(1rem, 4vw, 3rem) 3rem;
}

.kicker {
  margin: 0 0 0.44rem;
  color: var(--green);
  font-size: 0.74rem;
  font-weight: 600;
}

.dock-copy h1 {
  max-width: 34rem;
  font-size: clamp(2.6rem, 8vw, 7rem);
  line-height: 0.88;
}

.venture-stack {
  display: grid;
  gap: 0.7rem;
}

.venture-line {
  display: grid;
  grid-template-columns: 5.5rem minmax(0, 1fr) auto;
  align-items: center;
  gap: 1rem;
  min-height: 4.7rem;
  padding: 0 1rem;
  text-align: left;
  transition:
    border-color 180ms ease,
    color 180ms ease,
    transform 180ms ease,
    opacity 180ms ease;
}

.venture-line:hover {
  transform: translateY(-1px);
  border-color: rgba(102, 255, 149, 0.5);
}

.venture-line span,
.venture-line em {
  color: var(--muted);
  font-size: 0.68rem;
  font-style: normal;
  text-transform: uppercase;
}

.venture-line strong {
  font-size: clamp(1.05rem, 2vw, 1.6rem);
}

.venture-line.is-active span,
.venture-line.is-active em {
  color: var(--green);
}

.venture-line.is-hq span,
.venture-line.is-hq em {
  color: var(--cyan);
}

.venture-line.is-tester span,
.venture-line.is-tester em {
  color: var(--blue);
}

.venture-line.is-locked {
  opacity: 0.42;
}

.tower {
  min-height: 100vh;
  padding: 4.6rem clamp(0.8rem, 2.5vw, 1.6rem) 2rem;
}

.tester-pwa {
  min-height: 100vh;
  width: min(74rem, 100%);
  margin: 0 auto;
  padding: 6.8rem clamp(1rem, 4vw, 3rem) 3rem;
}

.tester-top {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.tester-top h1 {
  margin: 0;
  font-size: clamp(1.85rem, 4.2vw, 3.45rem);
  line-height: 0.96;
}

.tester-controls {
  min-width: min(27rem, 100%);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 0.48rem;
  align-items: center;
}

.tester-controls label,
.tester-pwa-status,
.tester-route-blocked,
.tester-context {
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.68rem;
  text-transform: uppercase;
}

.tester-controls select {
  min-height: 2.4rem;
  min-width: 0;
  border: 1px solid var(--line-strong);
  border-radius: 0;
  background: rgba(0, 0, 0, 0.32);
  color: var(--ink);
  padding: 0 0.62rem;
}

.tester-pwa-status {
  min-height: 1rem;
  margin: 0 0 0.7rem;
  color: var(--green);
}

.tester-seat-list {
  display: grid;
  gap: 0.72rem;
}

.tester-seat-card {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(17rem, 1.1fr);
  gap: 0.8rem;
  border-left: 1px solid rgba(102, 255, 149, 0.48);
  background: rgba(0, 0, 0, 0.22);
  padding: clamp(0.78rem, 1.6vw, 1rem);
}

.tester-seat-main span {
  color: var(--green);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.68rem;
  text-transform: uppercase;
}

.tester-seat-main h3 {
  display: block;
  margin-top: 0.28rem;
  margin-bottom: 0;
  color: var(--ink);
  font-size: clamp(1.2rem, 2.4vw, 2rem);
  line-height: 1;
}

.tester-seat-main p,
.tester-context {
  margin: 0.34rem 0 0;
  color: rgba(247, 251, 247, 0.66);
  overflow-wrap: anywhere;
  text-transform: none;
}

.tester-seat-actions {
  min-width: 0;
  display: grid;
  gap: 0.55rem;
}

.tester-feedback-panel {
  display: grid;
  gap: 0.55rem;
}

.tester-feedback-panel[hidden] {
  display: none;
}

.tester-card-status {
  min-height: 1rem;
  margin: 0;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.68rem;
}

.tester-card-status[data-state="locked"] {
  color: rgba(255, 173, 66, 0.74);
}

.tester-card-status[data-state="opened"] {
  color: var(--blue);
}

.tester-route-blocked {
  min-height: 2.75rem;
  display: inline-flex;
  align-items: center;
  color: var(--orange);
}

.tester-reaction-nudge button {
  min-height: 3.1rem;
}

.tester-reaction-nudge button:disabled,
.tester-seat-card .feedback-note:disabled {
  cursor: default;
  opacity: 0.48;
}

.tester-reaction-nudge [data-tester-reaction-type="problem"] span {
  color: var(--orange);
}

.tester-reaction-nudge [data-tester-reaction-type="good"] span,
.tester-reaction-nudge [data-tester-reaction-type="love"] span {
  color: var(--green);
}

.tester-reaction-nudge [data-selected="true"] {
  border-color: rgba(102, 255, 149, 0.62);
  background: rgba(102, 255, 149, 0.08);
}

.self-serve-body {
  min-height: 100vh;
}

.self-serve-shell {
  position: relative;
  z-index: 2;
  width: min(64rem, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: clamp(1rem, 4vw, 3rem);
  display: grid;
  align-content: center;
  gap: 0.9rem;
}

.self-serve-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.self-serve-top h1 {
  margin: 0;
  max-width: 36rem;
  font-size: clamp(2.3rem, 7vw, 6.2rem);
  line-height: 0.88;
  letter-spacing: 0;
}

.self-serve-pill,
.self-serve-status,
.self-serve-card-main span,
.self-serve-route-wait,
.self-serve-card-status {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  text-transform: uppercase;
}

.self-serve-pill {
  min-height: 1.7rem;
  display: inline-flex;
  align-items: center;
  border-left: 1px solid rgba(130, 216, 255, 0.48);
  background: rgba(130, 216, 255, 0.08);
  color: var(--blue);
  padding: 0 0.54rem;
  font-size: 0.62rem;
  white-space: nowrap;
}

.self-serve-status {
  min-height: 1.1rem;
  margin: 0;
  color: var(--green);
  font-size: 0.72rem;
}

.self-serve-assignments {
  display: grid;
  gap: 0.74rem;
}

.self-serve-card {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(18rem, 1.05fr);
  gap: 0.86rem;
  border-left: 1px solid rgba(102, 255, 149, 0.54);
  background:
    linear-gradient(90deg, rgba(102, 255, 149, 0.09), transparent 38%),
    rgba(0, 0, 0, 0.24);
  padding: clamp(0.86rem, 2vw, 1.15rem);
}

.self-serve-card[data-opened="true"] {
  border-left-color: rgba(130, 216, 255, 0.72);
  background:
    linear-gradient(90deg, rgba(130, 216, 255, 0.1), transparent 38%),
    rgba(0, 0, 0, 0.24);
}

.self-serve-card-main {
  min-width: 0;
}

.self-serve-card-main span {
  color: var(--green);
  font-size: 0.68rem;
}

.self-serve-card-main h2 {
  margin: 0.32rem 0 0;
  font-size: clamp(1.45rem, 3vw, 2.55rem);
  line-height: 0.98;
  letter-spacing: 0;
}

.self-serve-card-main p {
  margin: 0.48rem 0 0;
  color: rgba(247, 251, 247, 0.64);
  overflow-wrap: anywhere;
}

.self-serve-card-actions {
  min-width: 0;
  display: grid;
  gap: 0.58rem;
}

.self-serve-primary,
.self-serve-route-wait,
.self-serve-note,
.self-serve-reactions button,
.self-serve-save {
  border: 1px solid var(--line-strong);
  border-radius: 0;
  background: rgba(0, 0, 0, 0.34);
  color: var(--ink);
  outline: none;
}

.self-serve-primary,
.self-serve-route-wait {
  min-height: 3.12rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.self-serve-primary {
  color: var(--green);
  border-color: rgba(102, 255, 149, 0.64);
  box-shadow: inset 0 0 1.8rem rgba(102, 255, 149, 0.045);
  font-weight: 760;
}

.self-serve-route-wait {
  color: var(--orange);
  font-size: 0.74rem;
}

.self-serve-note {
  width: 100%;
  min-height: 5.2rem;
  resize: vertical;
  padding: 0.72rem;
}

.self-serve-task-packet {
  display: grid;
  gap: 0.48rem;
  padding: 0.66rem;
  border: 1px solid rgba(130, 216, 255, 0.46);
  background: rgba(130, 216, 255, 0.07);
}

.self-serve-task-packet[hidden] {
  display: none;
}

.self-serve-task-top {
  display: grid;
  gap: 0.22rem;
}

.self-serve-task-top span {
  color: var(--blue);
  font-size: 0.66rem;
}

.self-serve-task-top strong {
  color: rgba(247, 251, 247, 0.88);
  font-size: 0.72rem;
  font-weight: 720;
}

.self-serve-task-packet dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.42rem;
  margin: 0;
}

.self-serve-task-packet div {
  min-width: 0;
}

.self-serve-task-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.34rem 0.42rem;
}

.self-serve-task-packet dt {
  grid-column: 1 / -1;
  color: rgba(247, 251, 247, 0.48);
  font-size: 0.62rem;
  text-transform: uppercase;
}

.self-serve-task-packet dd {
  margin: 0.12rem 0 0;
  color: rgba(247, 251, 247, 0.9);
  font-size: 0.78rem;
  overflow-wrap: anywhere;
}

.self-serve-task-row button {
  min-height: 1.72rem;
  border: 1px solid rgba(130, 216, 255, 0.48);
  border-radius: 0;
  background: rgba(0, 0, 0, 0.22);
  color: var(--blue);
  font-size: 0.58rem;
  font-weight: 780;
}

.self-serve-card[data-opened="true"] .self-serve-note {
  border-color: rgba(130, 216, 255, 0.56);
  box-shadow: inset 0 0 1.5rem rgba(130, 216, 255, 0.055);
}

.self-serve-feedback-panel {
  display: grid;
  gap: 0.58rem;
}

.self-serve-feedback-panel[hidden] {
  display: none;
}

.self-serve-reactions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.46rem;
}

.self-serve-reactions button {
  min-height: 3.35rem;
  padding: 0.2rem 0.4rem;
  color: rgba(247, 251, 247, 0.78);
}

.self-serve-note:disabled,
.self-serve-reactions button:disabled,
.self-serve-save:disabled {
  cursor: default;
  opacity: 0.48;
}

.self-serve-reactions button:disabled span {
  color: rgba(247, 251, 247, 0.42);
}

.self-serve-reactions button[data-selected="true"] {
  border-color: rgba(102, 255, 149, 0.62);
  background: rgba(102, 255, 149, 0.08);
}

.self-serve-reactions [data-reaction-type="problem"][data-selected="true"] {
  border-color: rgba(255, 173, 66, 0.7);
  background: rgba(255, 173, 66, 0.08);
}

.self-serve-reactions button span {
  display: block;
  margin-bottom: 0.14rem;
  font-size: 1.42rem;
  line-height: 1;
}

.self-serve-reactions button em {
  display: block;
  font-size: 0.7rem;
  font-style: normal;
  font-weight: 740;
}

.self-serve-save {
  min-height: 3.12rem;
  color: var(--green);
  border-color: rgba(102, 255, 149, 0.58);
  font-weight: 780;
  text-transform: uppercase;
}

.self-serve-save:not(:disabled) {
  box-shadow: inset 0 0 1.8rem rgba(102, 255, 149, 0.055);
}

.self-serve-save:disabled {
  color: rgba(247, 251, 247, 0.52);
  border-color: var(--line-strong);
  box-shadow: none;
}

.self-serve-reactions [data-reaction-type="good"] span,
.self-serve-reactions [data-reaction-type="love"] span {
  color: var(--green);
}

.self-serve-reactions [data-reaction-type="problem"] span {
  color: var(--orange);
}

.self-serve-card-status {
  min-height: 1rem;
  margin: 0;
  color: var(--muted);
  font-size: 0.68rem;
}

.self-serve-card-status[data-state="saving"] {
  color: var(--orange);
}

.self-serve-card-status[data-state="locked"] {
  color: rgba(255, 173, 66, 0.74);
}

.self-serve-card-status[data-state="opened"] {
  color: var(--blue);
}

.self-serve-card-status[data-state="dirty"] {
  color: var(--orange);
}

.self-serve-card-status[data-state="saved"] {
  color: var(--green);
}

.self-serve-card-status[data-state="error"] {
  color: var(--red);
}

.live-handoff-body {
  min-height: 100vh;
}

.live-handoff-shell {
  position: relative;
  z-index: 2;
  width: min(68rem, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: clamp(1rem, 4vw, 3rem);
  display: grid;
  align-content: center;
  gap: 0.9rem;
}

.live-handoff-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.live-handoff-top h1 {
  margin: 0;
  max-width: 39rem;
  font-size: clamp(2.1rem, 6.5vw, 5.7rem);
  line-height: 0.9;
  letter-spacing: 0;
}

.live-stage-pill,
.live-primary span,
.live-steps span,
.live-evidence-grid span,
.live-detail span {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  text-transform: uppercase;
}

.live-stage-pill {
  min-height: 1.7rem;
  display: inline-flex;
  align-items: center;
  border-left: 1px solid rgba(102, 255, 149, 0.54);
  background: rgba(102, 255, 149, 0.08);
  color: var(--green);
  padding: 0 0.54rem;
  font-size: 0.62rem;
  white-space: nowrap;
}

.live-unlock {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.5rem;
  width: min(28rem, 100%);
}

.live-unlock input,
.live-unlock button,
.live-actions button,
.live-copy-again {
  min-height: 3rem;
  border: 1px solid var(--line-strong);
  border-radius: 0;
  background: rgba(0, 0, 0, 0.34);
  color: var(--ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  outline: none;
}

.live-unlock input {
  min-width: 0;
  padding: 0 0.76rem;
}

.live-unlock button,
.live-actions button,
.live-copy-again {
  padding: 0 0.88rem;
  color: var(--green);
  border-color: rgba(102, 255, 149, 0.62);
  font-weight: 760;
}

.live-console {
  display: grid;
  gap: 0.72rem;
}

.live-unlock[hidden],
.live-console[hidden] {
  display: none;
}

.live-primary {
  min-height: 13rem;
  display: grid;
  align-content: center;
  gap: 0.42rem;
  border-left: 1px solid rgba(102, 255, 149, 0.62);
  background:
    linear-gradient(90deg, rgba(102, 255, 149, 0.09), transparent 38%),
    rgba(0, 0, 0, 0.22);
  padding: clamp(0.9rem, 2.5vw, 1.35rem);
}

.live-primary span,
.live-evidence-grid span,
.live-detail span {
  color: var(--muted);
  font-size: 0.64rem;
}

.live-primary strong {
  color: var(--ink);
  font-size: clamp(1.65rem, 4vw, 3.2rem);
  line-height: 0.98;
  letter-spacing: 0;
}

.live-primary p {
  max-width: 36rem;
  margin: 0;
  color: rgba(247, 251, 247, 0.66);
}

.live-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.42rem;
}

.live-actions button:first-child {
  min-width: min(100%, 17rem);
  min-height: 3.35rem;
  background: rgba(102, 255, 149, 0.08);
  box-shadow: inset 0 0 1.8rem rgba(102, 255, 149, 0.055);
}

.live-actions button:last-child {
  color: rgba(247, 251, 247, 0.68);
  border-color: rgba(247, 251, 247, 0.2);
  min-height: 2.4rem;
  align-self: end;
}

.live-actions button:disabled {
  cursor: not-allowed;
  opacity: 0.44;
}

.live-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.54rem;
}

.live-steps article,
.live-evidence-grid article,
.live-detail {
  border-left: 1px solid rgba(247, 251, 247, 0.16);
  background: rgba(0, 0, 0, 0.2);
}

.live-steps article {
  min-height: 4.7rem;
  display: grid;
  align-content: center;
  gap: 0.2rem;
  padding: 0.62rem;
}

.live-steps article[data-state="current"] {
  border-left-color: rgba(130, 216, 255, 0.72);
  background: rgba(130, 216, 255, 0.075);
}

.live-steps article[data-state="done"] {
  border-left-color: rgba(102, 255, 149, 0.66);
  background: rgba(102, 255, 149, 0.075);
}

.live-steps span {
  color: var(--muted);
  font-size: 0.62rem;
}

.live-steps article[data-state="current"] span,
.live-steps article[data-state="current"] strong {
  color: var(--blue);
}

.live-steps article[data-state="done"] span,
.live-steps article[data-state="done"] strong {
  color: var(--green);
}

.live-steps strong {
  color: rgba(247, 251, 247, 0.78);
  font-size: clamp(0.84rem, 2vw, 1.05rem);
  line-height: 1.05;
}

.live-evidence-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.54rem;
}

.live-evidence-grid article {
  min-height: 5rem;
  display: grid;
  align-content: center;
  gap: 0.18rem;
  padding: 0.62rem;
}

.live-evidence-grid article[data-evidence-state="pass"] {
  border-left-color: rgba(102, 255, 149, 0.66);
  background: rgba(102, 255, 149, 0.075);
}

.live-evidence-grid article[data-evidence-state="warn"] {
  border-left-color: rgba(255, 173, 66, 0.72);
  background: rgba(255, 173, 66, 0.075);
}

.live-evidence-grid article[data-evidence-state="waiting"] {
  border-left-color: rgba(130, 216, 255, 0.52);
  background: rgba(130, 216, 255, 0.055);
}

.live-evidence-grid strong {
  color: var(--ink);
  font-size: clamp(1.05rem, 2.6vw, 1.55rem);
  line-height: 1;
  overflow-wrap: anywhere;
}

.live-evidence-grid article[data-evidence-state="pass"] strong {
  color: var(--green);
}

.live-evidence-grid article[data-evidence-state="warn"] strong {
  color: var(--orange);
}

.live-detail {
  display: flex;
  flex-direction: column;
  gap: 0.54rem;
  padding: 0.68rem;
}

.live-diagnostics summary {
  cursor: pointer;
  list-style: none;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.62rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

.live-diagnostics summary::-webkit-details-marker {
  display: none;
}

.live-diagnostics summary::after {
  content: " \25B8";
  color: rgba(247, 251, 247, 0.38);
}

.live-diagnostics[open] summary::after {
  content: " \25BE";
}

.live-diagnostics div {
  margin-top: 0.5rem;
}

.live-detail p {
  margin: 0.2rem 0 0;
  color: rgba(247, 251, 247, 0.72);
  overflow-wrap: anywhere;
}

.live-copy-again {
  min-height: 2.4rem;
  align-self: stretch;
  border-color: rgba(102, 255, 149, 0.42);
  background: rgba(102, 255, 149, 0.04);
  font-size: 0.64rem;
  white-space: nowrap;
}

.live-copy-again[hidden] {
  display: none;
}

.menu-strip {
  position: sticky;
  z-index: 12;
  top: 0.58rem;
  display: grid;
  grid-template-columns:
    minmax(9rem, 0.72fr)
    minmax(18rem, 2.1fr)
    minmax(9.5rem, 0.9fr)
    minmax(6.2rem, 0.42fr);
  gap: 0;
  width: min(88rem, 100%);
  margin: 0 auto 0.86rem;
  align-items: stretch;
  border: 1px solid rgba(247, 251, 247, 0.11);
  background: rgba(3, 4, 4, 0.58);
  box-shadow:
    inset 0 0 2rem rgba(102, 255, 149, 0.018),
    0 1rem 2.5rem rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(16px);
}

.menu-pill,
.tunnel-form {
  min-height: 2.72rem;
  display: grid;
  align-content: center;
  gap: 0.2rem;
  padding: 0.38rem 0.62rem;
  border: 0;
  border-right: 1px solid rgba(247, 251, 247, 0.08);
  background: transparent;
  text-align: left;
  text-decoration: none;
}

.menu-strip > :last-child {
  border-right: 0;
}

.menu-pill span,
.tunnel-form label {
  color: var(--muted);
  font-size: 0.62rem;
  text-transform: uppercase;
}

.menu-pill strong {
  color: var(--ink);
  font-size: 0.72rem;
  font-weight: 650;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.menu-pill em {
  overflow: hidden;
  color: rgba(247, 251, 247, 0.48);
  font-size: 0.58rem;
  font-style: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.menu-pill.is-strong strong {
  color: var(--green);
}

.menu-pill.is-danger strong {
  color: var(--red);
}

.menu-pill.is-danger:hover {
  border-color: rgba(255, 100, 100, 0.55);
}

.tower-more-toggle span {
  color: var(--ink);
  font-size: 0.86rem;
  line-height: 0.6;
}

.tower-more-toggle[aria-expanded="true"] {
  background: rgba(102, 255, 149, 0.06);
}

.tower-more-toggle[aria-expanded="true"] strong {
  color: var(--green);
}

/* E2E-7 Phase 3: everything that used to crowd the menu rail now discloses
   behind the single ⋯ MORE control. */
.tower-more-panel {
  width: min(88rem, 100%);
  margin: -0.28rem auto 0.86rem;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid rgba(247, 251, 247, 0.11);
  border-top: 0;
  background: rgba(3, 4, 4, 0.72);
  box-shadow: 0 1rem 2.5rem rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(16px);
}

.tower-more-panel[hidden] {
  display: none;
}

.tower-more-panel .menu-pill {
  border-bottom: 1px solid rgba(247, 251, 247, 0.08);
  min-width: 0;
}

/* Long secondary labels (e.g. VERSION) degrade with an ellipsis instead of a
   hard clip. */
.tower-more-panel .menu-pill strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.tower-more-panel > :nth-child(4n) {
  border-right: 0;
}

/* OD-S2-03: the practice-session status line must stay readable even when it
   carries the full fail-closed FQ-009 message, so it wraps instead of
   ellipsising. */
.tower-more-panel .practice-session-status strong {
  white-space: normal;
  font-weight: 500;
  font-size: 0.62rem;
  line-height: 1.35;
}

.tunnel-form {
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.55rem;
}

.tunnel-form label {
  align-self: center;
}

.tunnel-form input {
  min-width: 0;
  min-height: 1.9rem;
  padding: 0 0.6rem;
  color: var(--ink);
  font-size: 0.78rem;
}

.tunnel-form input::placeholder,
.feedback-note::placeholder,
.route-json::placeholder {
  color: rgba(247, 251, 247, 0.28);
}

.tunnel-form button {
  min-height: 1.9rem;
  padding: 0 0.65rem;
  color: var(--green);
  font-size: 0.68rem;
}

.tower-grid {
  width: min(88rem, 100%);
  min-height: calc(100vh - 10.5rem);
  margin: 0 auto;
}

.curve-zone {
  min-width: 0;
}

.curve-zone {
  display: grid;
  grid-template-rows: auto minmax(31rem, 1fr);
  min-height: calc(100vh - 11.8rem);
}

.tower-title {
  position: relative;
  z-index: 6;
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 0.72rem;
  min-height: 4.8rem;
  padding: 0 clamp(0.3rem, 1vw, 0.8rem);
  pointer-events: none;
}

.curve-title-button {
  max-width: min(44rem, 92%);
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: clamp(1.45rem, 3.2vw, 3.05rem);
  font-weight: 760;
  line-height: 0.94;
  text-align: center;
  text-wrap: balance;
  pointer-events: auto;
}

.curve-title-button:hover,
.curve-title-button:focus-visible {
  outline: none;
}

.curve-level-context {
  max-width: min(48rem, 92%);
  margin: -0.35rem 0 0;
  display: grid;
  gap: 0.14rem;
  color: rgba(247, 251, 247, 0.48);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: clamp(0.62rem, 1vw, 0.76rem);
  line-height: 1.35;
  text-align: center;
}

.level-code {
  color: var(--green);
  font-size: clamp(0.62rem, 1vw, 0.74rem);
  font-weight: 650;
  text-transform: uppercase;
}

.level-body {
  color: rgba(247, 251, 247, 0.46);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: clamp(0.72rem, 1.1vw, 0.84rem);
  font-weight: 430;
  letter-spacing: 0;
  text-transform: none;
}

.boundary-label {
  max-width: min(44rem, 92%);
  margin: -0.34rem 0 0;
  color: rgba(247, 251, 247, 0.54);
  font-size: clamp(0.7rem, 1vw, 0.82rem);
  line-height: 1.35;
  text-align: center;
}

.readiness-summary {
  margin: 0;
  color: rgba(247, 251, 247, 0.58);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: clamp(0.62rem, 1.2vw, 0.76rem);
  text-align: right;
  text-transform: uppercase;
}

.curve-instrument {
  position: relative;
  min-height: min(37rem, calc(100vh - 15.8rem));
  overflow: hidden;
  isolation: isolate;
  touch-action: pan-y;
  user-select: none;
  border: 1px solid rgba(102, 255, 149, 0.18);
  border-radius: 2px;
  background:
    linear-gradient(180deg, rgba(102, 255, 149, 0.04), transparent 55%),
    rgba(3, 4, 4, 0.28);
  box-shadow:
    inset 0 0 3rem rgba(102, 255, 149, 0.025),
    0 0 3.5rem rgba(0, 0, 0, 0.32);
}

.curve-instrument svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.curve-area-fill {
  fill: rgba(102, 255, 149, 0.09);
  stroke: none;
}

.segment-stroke {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  cursor: pointer;
  pointer-events: stroke;
}

.segment-stroke {
  stroke-width: 4.4;
  transition:
    stroke 180ms ease,
    opacity 180ms ease,
    stroke-width 180ms ease;
}

.status-orange {
  --state-color: var(--orange);
}

.status-green {
  --state-color: var(--green);
}

.status-red {
  --state-color: var(--red);
}

.status-gray {
  --state-color: var(--gray);
}

.status-stale {
  --state-color: var(--blue);
}

.segment-stroke.status-orange,
.segment-anchor.status-orange,
.status-chip.status-orange,
.attempt-card.status-orange,
.route-row.status-pending {
  border-color: rgba(255, 173, 66, 0.42);
  color: var(--orange);
  stroke: var(--orange);
}

.segment-stroke.status-orange {
  opacity: 0.58;
}

.segment-stroke.status-gray {
  opacity: 0.72;
}

.segment-stroke.is-selected {
  stroke-width: 6.1;
  opacity: 1;
}

.segment-stroke.status-orange.is-selected {
  filter: drop-shadow(0 0 0.52rem rgba(255, 173, 66, 0.42));
}

.segment-stroke.status-gray.is-selected {
  filter: drop-shadow(0 0 0.46rem rgba(168, 176, 172, 0.32));
}

.segment-stroke.status-green {
  filter: drop-shadow(0 0 0.34rem rgba(102, 255, 149, 0.4));
}

.segment-stroke.status-red {
  filter: drop-shadow(0 0 0.34rem rgba(255, 100, 100, 0.35));
}

.segment-stroke.status-green,
.segment-anchor.status-green,
.status-chip.status-green,
.attempt-card.status-green,
.route-row.status-pass {
  border-color: rgba(102, 255, 149, 0.52);
  color: var(--green);
  stroke: var(--green);
}

.segment-stroke.status-red,
.segment-anchor.status-red,
.status-chip.status-red,
.attempt-card.status-red,
.route-row.status-fail {
  border-color: rgba(255, 100, 100, 0.55);
  color: var(--red);
  stroke: var(--red);
}

.segment-stroke.status-gray,
.segment-anchor.status-gray,
.status-chip.status-gray {
  border-color: rgba(116, 125, 120, 0.65);
  color: #a8b0ac;
  stroke: var(--gray);
}

.segment-stroke.status-stale,
.segment-anchor.status-stale,
.status-chip.status-stale,
.attempt-card.status-stale {
  border-color: rgba(189, 220, 255, 0.5);
  color: var(--blue);
  stroke: var(--blue);
}

.segment-stroke.is-stale {
  stroke-dasharray: 12 10;
}

.segment-hit-layer,
.level-boundaries {
  position: absolute;
  inset: 0;
}

.segment-hit-layer {
  z-index: 3;
  pointer-events: none;
}

.level-boundaries {
  z-index: 5;
}

.curve-slider {
  position: absolute;
  z-index: 9;
  left: 50%;
  bottom: 2.15rem;
  width: min(48rem, 70%);
  height: 2.7rem;
  margin: 0;
  appearance: none;
  transform: translateX(-50%);
  background: transparent;
  opacity: 1;
  cursor: ew-resize;
}

.curve-slider::-webkit-slider-runnable-track {
  height: 2px;
  border-radius: 0;
  background: rgba(102, 255, 149, 0.14);
  box-shadow: none;
}

.curve-slider::-webkit-slider-thumb {
  width: 16px;
  height: 16px;
  appearance: none;
  margin-top: -7px;
  border: 1.5px solid rgba(102, 255, 149, 0.64);
  border-radius: 50%;
  background: rgba(3, 4, 4, 0.92);
  box-shadow:
    0 0 0 3px rgba(102, 255, 149, 0.14),
    0 0 0.8rem rgba(102, 255, 149, 0.2);
  cursor: grab;
  transition:
    box-shadow 180ms ease,
    transform 180ms ease,
    background 180ms ease;
}

.curve-slider:hover::-webkit-slider-thumb {
  box-shadow:
    0 0 0 4px rgba(102, 255, 149, 0.24),
    0 0 1.2rem rgba(102, 255, 149, 0.3);
  transform: scale(1.15);
}

.curve-slider:active::-webkit-slider-thumb {
  cursor: grabbing;
  background: rgba(102, 255, 149, 0.14);
}

.curve-slider::-moz-range-track {
  height: 2px;
  border: 0;
  background: rgba(102, 255, 149, 0.14);
}

.curve-slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border: 1.5px solid rgba(102, 255, 149, 0.64);
  border-radius: 50%;
  background: rgba(3, 4, 4, 0.92);
}

.segment-anchor {
  position: absolute;
  left: var(--x);
  top: var(--y);
  display: grid;
  place-items: center;
  width: clamp(2.65rem, 5vw, 4.1rem);
  min-height: 2.2rem;
  padding: 0;
  transform: translate(-50%, -50%);
  border: 0;
  background: transparent;
  box-shadow: none;
  opacity: 0;
  pointer-events: auto;
  cursor: pointer;
  transition:
    transform 180ms ease,
    opacity 180ms ease;
}

.segment-anchor::before {
  content: none;
}

.segment-anchor span {
  display: none;
}

.segment-anchor:hover,
.segment-anchor.is-active {
  transform: translate(-50%, -50%);
}

.segment-anchor.is-active::before {
  content: none;
}

.curve-cursor {
  display: none;
}

.curve-cursor::before,
.curve-cursor::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  background: rgba(255, 255, 255, 0.82);
  transform: translate(-50%, -50%);
}

.curve-cursor::before {
  width: 54%;
  height: 1px;
}

.curve-cursor::after {
  width: 1px;
  height: 54%;
}

.curve-cursor:active {
  cursor: grabbing;
}

[data-curve-drag="true"] .curve-cursor {
  transition: none;
}

.level-node {
  fill: rgba(102, 255, 149, 0.26);
  stroke: rgba(102, 255, 149, 0.66);
  stroke-width: 1.8;
  cursor: pointer;
  filter: drop-shadow(0 0 0.42rem rgba(102, 255, 149, 0.34));
  transition:
    fill 180ms ease,
    r 180ms ease,
    stroke 180ms ease;
}

.level-node.is-active {
  fill: var(--green);
  stroke: var(--green);
  filter:
    drop-shadow(0 0 0.48rem rgba(102, 255, 149, 0.72))
    drop-shadow(0 0 1.5rem rgba(102, 255, 149, 0.28));
}

.level-node:hover {
  stroke: var(--green);
}

.level-label {
  position: absolute;
  left: var(--x);
  top: var(--y);
  display: grid;
  gap: 0.05rem;
  width: 5.2rem;
  min-height: 3.2rem;
  padding: 0;
  transform: translate(-50%, -50%);
  border: 0;
  background: transparent;
  color: rgba(247, 251, 247, 0.5);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  text-align: center;
  opacity: 0;
  pointer-events: auto;
  cursor: pointer;
  transition:
    color 180ms ease,
    opacity 180ms ease,
    transform 180ms ease;
}

.level-label span {
  font-size: 0.58rem;
  font-weight: 700;
  line-height: 1;
}

.level-label strong {
  font-size: 0.5rem;
  font-weight: 600;
  line-height: 1;
  text-transform: uppercase;
}

.level-label.is-active {
  color: var(--green);
}

.level-label:hover,
.level-label:focus-visible {
  opacity: 1;
  color: var(--green);
  transform: translate(-50%, calc(-100% - 0.55rem));
}

.endpoint {
  display: none;
}

.segment-console {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 0.84rem;
  padding: clamp(0.85rem, 1.7vw, 1.05rem);
  overflow: hidden;
}

.segment-hud {
  position: absolute;
  z-index: 6;
  left: var(--x);
  top: var(--y);
  width: min(31rem, calc(100vw - 2rem));
  max-height: min(33rem, calc(100vh - 9rem));
  overflow: auto;
  border: 1px solid rgba(247, 251, 247, 0.18);
  background:
    linear-gradient(135deg, rgba(102, 255, 149, 0.09), transparent 56%),
    rgba(3, 4, 4, 0.9);
  box-shadow:
    0 0 0 1px rgba(3, 4, 4, 0.85),
    0 1.3rem 4rem rgba(0, 0, 0, 0.46),
    0 0 2.2rem rgba(130, 216, 255, 0.11);
  backdrop-filter: blur(14px);
  pointer-events: none;
}

.segment-hud:not(.is-open) {
  display: none;
}

.segment-hud.is-open {
  display: grid;
}

.segment-hud button,
.segment-hud a,
.segment-hud textarea,
.segment-hud input,
.segment-hud .attempt-list {
  pointer-events: auto;
}

.segment-hud[data-side="east"] {
  right: auto;
  transform: translate(1.15rem, -50%);
}

.segment-hud[data-side="west"] {
  right: calc(100% - var(--x) + 1.15rem);
  left: auto;
  transform: translateY(-50%);
}

.segment-hud[data-depth="upper"] {
  top: max(var(--y), 6.5rem);
}

.segment-hud[data-depth="lower"] {
  top: var(--y);
}

.segment-hud[data-side="east"][data-depth="upper"] {
  transform: translate(1.15rem, 0.7rem);
}

.segment-hud[data-side="west"][data-depth="upper"] {
  transform: translateY(0.7rem);
}

.segment-hud[data-side="east"][data-depth="lower"] {
  transform: translate(1.15rem, calc(-100% - 1.15rem));
}

.segment-hud[data-side="west"][data-depth="lower"] {
  transform: translateY(calc(-100% - 1.15rem));
}

[data-curve-drag="true"] .segment-hud {
  opacity: 0.36;
  pointer-events: none;
}

.console-topline {
  display: flex;
  align-items: center;
  gap: 0.42rem;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.68rem;
}

.console-topline > span {
  min-height: 1.8rem;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  padding: 0 0.48rem;
}

.status-chip {
  color: currentColor;
  text-transform: uppercase;
}

.segment-console h2 {
  margin: 0;
  font-size: clamp(1.35rem, 2.8vw, 2.5rem);
  line-height: 1.02;
}

.segment-purpose {
  min-height: 4.1rem;
  margin: 0;
  color: rgba(247, 251, 247, 0.78);
  font-size: clamp(0.94rem, 1.4vw, 1.1rem);
  line-height: 1.36;
}

.console-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(12rem, 0.9fr);
  gap: 0.72rem;
}

.console-grid h3,
.attempt-ledger h3 {
  margin: 0 0 0.38rem;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 650;
  text-transform: uppercase;
}

.console-grid section {
  min-width: 0;
  border-top: 1px solid var(--line);
  padding-top: 0.62rem;
}

#criteria-list {
  display: grid;
  gap: 0.36rem;
  margin: 0;
  padding-left: 1rem;
  color: rgba(247, 251, 247, 0.76);
  font-size: 0.84rem;
  line-height: 1.32;
}

code {
  color: var(--green);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.surface-list {
  display: grid;
  gap: 0.45rem;
  margin: 0;
}

.surface-list div {
  min-width: 0;
}

.surface-list dt {
  color: var(--muted);
  font-size: 0.64rem;
  text-transform: uppercase;
}

.surface-list dd {
  min-width: 0;
  margin: 0.12rem 0 0;
  overflow-wrap: anywhere;
  color: rgba(247, 251, 247, 0.82);
  font-size: 0.78rem;
}

.handoff-box {
  min-height: 7.8rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.8rem;
  border-top: 1px solid var(--line);
  background: transparent;
  padding: 0.74rem 0 0;
}

.handoff-box span {
  display: block;
  color: var(--green);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.68rem;
  text-transform: uppercase;
}

.handoff-box strong {
  display: block;
  margin-top: 0.32rem;
  overflow-wrap: anywhere;
  color: rgba(247, 251, 247, 0.83);
  font-size: 0.84rem;
  font-weight: 600;
  line-height: 1.35;
}

.handoff-box img {
  width: 8.25rem;
  height: 8.25rem;
  border: 1px solid rgba(247, 251, 247, 0.18);
  background: #fff;
}

.action-row,
.finish-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.48rem;
  align-items: center;
}

.primary-action,
.quiet-action {
  min-height: 2.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.7rem;
  text-transform: uppercase;
}

.quiet-action {
  color: rgba(247, 251, 247, 0.76);
  padding: 0 0.82rem;
}

.quiet-action.is-disabled {
  pointer-events: none;
  opacity: 0.42;
}

.feedback-panel {
  display: grid;
  gap: 0.55rem;
  border-top: 1px solid var(--line);
  padding-top: 0.76rem;
}

.feedback-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  color: var(--muted);
  font-size: 0.68rem;
}

.feedback-header span {
  color: var(--green);
}

.reaction-nudge {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.42rem;
}

.reaction-nudge button {
  min-height: 3.55rem;
  display: grid;
  align-content: center;
  gap: 0.2rem;
  color: rgba(247, 251, 247, 0.72);
  font-size: 0.68rem;
}

.reaction-nudge span {
  color: var(--green);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 1.08rem;
}

.feedback-note,
.route-json {
  width: 100%;
  resize: vertical;
  padding: 0.68rem;
  color: var(--ink);
}

.feedback-note {
  min-height: 3.8rem;
}

.signal-status {
  flex: 1 1 12rem;
  min-height: 1rem;
  margin: 0;
  color: var(--muted);
  font-size: 0.7rem;
}

.attempt-ledger {
  min-height: 5rem;
  border-top: 1px solid var(--line);
  padding-top: 0.7rem;
}

.attempt-list {
  display: grid;
  max-height: 11.5rem;
  gap: 0.48rem;
  overflow: auto;
  padding-right: 0.15rem;
}

.attempt-card,
.empty-signal,
.signal-list article,
.route-row {
  border-left: 1px solid var(--line-strong);
  padding: 0.52rem 0.62rem;
  background: rgba(0, 0, 0, 0.2);
}

.segment-hud .attempt-card,
.segment-hud .empty-signal {
  background: transparent;
}

.segment-hud[data-expanded="false"] {
  width: min(24rem, calc(100vw - 2rem));
  gap: 0.58rem;
}

.segment-hud[data-expanded="false"][data-depth="upper"] {
  pointer-events: auto;
}

.segment-hud[data-expanded="true"] {
  pointer-events: auto;
}

.segment-hud[data-expanded="false"] .console-grid,
.segment-hud[data-expanded="false"] .feedback-panel,
.segment-hud[data-expanded="false"] .attempt-ledger {
  display: none;
}

.segment-hud[data-expanded="false"] .segment-purpose {
  min-height: 0;
  font-size: 0.88rem;
}

.segment-hud[data-expanded="false"] .handoff-box {
  min-height: auto;
  grid-template-columns: 1fr;
}

.segment-hud[data-expanded="false"] #handoff-qr {
  display: none;
}

.attempt-card span,
.empty-signal,
.signal-list span,
.route-row span,
.route-row em {
  color: var(--muted);
  font-size: 0.66rem;
  font-style: normal;
}

.attempt-card strong,
.signal-list strong,
.route-row strong {
  display: block;
  margin-top: 0.24rem;
  color: var(--ink);
  font-size: 0.82rem;
}

.attempt-card p,
.signal-list p,
.route-row p,
.drawer-copy {
  margin: 0.26rem 0 0;
  color: rgba(247, 251, 247, 0.66);
  font-size: 0.78rem;
  line-height: 1.35;
}

.signal-card.resolution-accepted {
  border-left-color: rgba(102, 255, 149, 0.65);
}

.signal-card.resolution-deferred {
  border-left-color: rgba(255, 173, 66, 0.7);
}

.signal-card.resolution-rejected {
  border-left-color: rgba(255, 100, 100, 0.68);
}

.resolution-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) repeat(4, auto);
  gap: 0.35rem;
  align-items: center;
  margin-top: 0.5rem;
}

.resolution-line span {
  color: var(--green);
  font-size: 0.62rem;
}

.resolution-line button {
  min-height: 1.8rem;
  border: 1px solid var(--line);
  border-radius: 0;
  background: rgba(0, 0, 0, 0.22);
  color: rgba(247, 251, 247, 0.64);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.58rem;
}

.resolution-line button:hover,
.resolution-line button.is-active {
  border-color: rgba(102, 255, 149, 0.58);
  color: var(--green);
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(3, 4, 4, 0.78);
  backdrop-filter: blur(12px);
}

.modal-sheet {
  width: min(28rem, 100%);
  border-left: 1px solid rgba(102, 255, 149, 0.42);
  background:
    linear-gradient(90deg, rgba(102, 255, 149, 0.1), transparent 78%),
    rgba(3, 4, 4, 0.92);
  padding: 1rem;
  box-shadow: 0 0 2.6rem rgba(0, 0, 0, 0.48);
}

.modal-sheet h2,
.signal-drawer h2 {
  margin: 0;
}

.modal-sheet h2 {
  font-size: clamp(1.35rem, 4vw, 2.2rem);
  line-height: 1;
}

.modal-sheet p {
  color: rgba(247, 251, 247, 0.7);
  line-height: 1.38;
}

.signal-drawer {
  position: fixed;
  z-index: 26;
  right: 0;
  top: 0;
  width: min(28rem, 100%);
  height: 100vh;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  gap: 0.78rem;
  padding: 1rem;
  background: #030404;
  border-left: 1px solid rgba(102, 255, 149, 0.22);
  box-shadow: -2rem 0 4rem rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.hq-drawer {
  z-index: 60;
  top: 4.8rem;
  width: min(42rem, 100%);
  height: calc(100vh - 4.8rem);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  isolation: isolate;
  background: #030404;
}

.hq-drawer .hq-run-list,
.hq-drawer .hq-focus-list,
.hq-drawer .hq-roster-list,
.hq-drawer .hq-assignment-list {
  min-height: auto;
  overflow: visible;
}

.hq-drawer .hq-section {
  min-height: auto;
}

.signal-drawer header {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  background: #030404;
}

.signal-drawer header .hud-button {
  background: #030404;
}

.signal-list,
.route-list,
.hq-run-list,
.hq-focus-list,
.hq-roster-list,
.hq-assignment-list {
  display: grid;
  align-content: start;
  gap: 0.56rem;
  min-height: 0;
  overflow: auto;
}

.hq-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(5.6rem, 1fr));
  gap: 0.45rem;
}

.hq-kpis article,
.hq-run-card,
.hq-focus-card,
.hq-runtime-card,
.hq-self-serve-card {
  border-left: 1px solid rgba(247, 251, 247, 0.18);
  background: rgba(0, 0, 0, 0.19);
}

.hq-kpis article {
  min-height: 4.2rem;
  display: grid;
  align-content: center;
  gap: 0.1rem;
  padding: 0.48rem;
}

.hq-kpis span,
.hq-kpis em,
.hq-run-card span,
.hq-focus-card span,
.hq-runtime-card span,
.hq-self-serve-card span,
.hq-section h3 {
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.62rem;
  font-style: normal;
  text-transform: uppercase;
}

.hq-kpis strong {
  color: var(--ink);
  font-size: clamp(1.15rem, 3vw, 1.85rem);
  line-height: 1;
}

.hq-section {
  min-height: 0;
  display: grid;
  gap: 0.45rem;
}

.hq-section h3 {
  margin: 0;
  color: var(--green);
}

.hq-runtime-grid {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  gap: 0.58rem;
}

.hq-runtime-tools {
  display: grid;
  grid-template-columns: auto minmax(0, 11rem) minmax(0, 1fr);
  gap: 0.48rem;
  align-items: center;
}

.hq-runtime-tools label,
.hq-runtime-tools span {
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.62rem;
  text-transform: uppercase;
}

.hq-runtime-tools select {
  min-height: 2.12rem;
  min-width: 0;
  padding: 0 0.52rem;
  color: var(--ink);
  background: rgba(0, 0, 0, 0.25);
}

.hq-run-card,
.hq-focus-card,
.hq-runtime-card,
.hq-self-serve-card {
  padding: 0.62rem 0.68rem;
}

.hq-run-card strong,
.hq-focus-card strong,
.hq-runtime-card h3,
.hq-self-serve-card strong {
  display: block;
  margin-top: 0.22rem;
  margin-bottom: 0;
  color: var(--ink);
  font-size: 0.88rem;
  line-height: 1.15;
}

.hq-run-card p,
.hq-focus-card p,
.hq-runtime-card p,
.hq-self-serve-card p {
  margin: 0.24rem 0 0;
  color: rgba(247, 251, 247, 0.66);
  font-size: 0.76rem;
  line-height: 1.34;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.hq-self-serve-card.status-ready {
  border-left-color: rgba(102, 255, 149, 0.62);
}

.hq-self-serve-card.status-offline {
  border-left-color: rgba(255, 173, 66, 0.76);
}

.hq-self-serve-link-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  gap: 0.42rem;
  margin-top: 0.52rem;
}

.hq-self-serve-link-row input {
  min-width: 0;
  min-height: 1.86rem;
  border: 1px solid var(--line-strong);
  border-radius: 0;
  background: rgba(0, 0, 0, 0.28);
  color: rgba(247, 251, 247, 0.8);
  padding: 0 0.48rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.62rem;
}

.runtime-toggle {
  min-height: 1.86rem;
  margin-top: 0.46rem;
  padding: 0 0.46rem;
  color: rgba(247, 251, 247, 0.76);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.58rem;
}

.hq-self-serve-link-row .runtime-toggle {
  margin-top: 0;
}

.hq-self-serve-copy {
  color: var(--green);
  border-color: rgba(102, 255, 149, 0.62);
  box-shadow: inset 0 0 1.4rem rgba(102, 255, 149, 0.045);
}

.hq-self-serve-reset {
  color: rgba(255, 216, 145, 0.92);
  border-color: rgba(255, 173, 66, 0.62);
}

.runtime-toggle:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.hq-runtime-card.status-approved,
.hq-runtime-card.status-active {
  border-left-color: rgba(102, 255, 149, 0.62);
}

.hq-runtime-card.status-pending_login,
.hq-runtime-card.status-paused {
  border-left-color: rgba(255, 173, 66, 0.76);
}

.hq-runtime-card.status-disabled,
.hq-runtime-card.status-closed {
  border-left-color: rgba(255, 100, 100, 0.68);
}

.hq-focus-card.priority-p0 {
  border-left-color: rgba(255, 100, 100, 0.76);
}

.hq-focus-card.priority-p1 {
  border-left-color: rgba(255, 173, 66, 0.76);
}

.hq-focus-card.priority-p2 {
  border-left-color: rgba(130, 216, 255, 0.72);
}

.route-json {
  min-height: 6.2rem;
}

@media (max-width: 1080px) {
  .menu-strip {
    position: relative;
    top: auto;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .tunnel-form {
    grid-column: span 2;
  }

  .curve-zone {
    min-height: 40rem;
  }

  .segment-hud {
    overflow: auto;
  }
}

@media (max-width: 760px) {
  .gate-stack,
  .venture-line,
  .tester-top,
  .tester-controls,
  .tester-seat-card,
  .console-grid,
  .handoff-box,
  .hq-kpis,
  .hq-runtime-grid,
  .hq-runtime-tools,
  .hq-self-serve-link-row,
  .live-unlock,
  .live-steps,
  .live-evidence-grid,
  .live-detail {
    grid-template-columns: 1fr;
  }

  .live-handoff-top {
    display: grid;
  }

  .live-handoff-shell {
    align-content: start;
  }

  .hud-top {
    position: absolute;
  }

  .venture-dock {
    padding-top: 6rem;
  }

  .tester-pwa {
    padding-top: 6rem;
  }

  .tower {
    padding-top: 5.35rem;
  }

  .dock-copy h1 {
    font-size: clamp(2.4rem, 14vw, 5rem);
  }

  .venture-line {
    align-items: start;
    min-height: 5.8rem;
    padding: 0.8rem;
  }

  .tester-top {
    display: grid;
  }

  .self-serve-shell {
    align-content: start;
    padding-top: 3.3rem;
  }

  .self-serve-top {
    display: grid;
  }

  .self-serve-card {
    grid-template-columns: 1fr;
  }

  .self-serve-reactions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .menu-strip {
    display: flex;
    flex-wrap: wrap;
    max-width: 100%;
    gap: 0.42rem;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  .menu-pill,
  .tunnel-form {
    flex: 1 1 6.8rem;
    border: 1px solid rgba(247, 251, 247, 0.11);
    background: rgba(3, 4, 4, 0.48);
  }

  .tower-more-toggle {
    flex-grow: 0;
    flex-basis: 4.6rem;
  }

  .tunnel-form {
    order: -8;
    flex: 1 1 100%;
    grid-column: auto;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 0.36rem;
  }

  .menu-strip [data-action="back-to-dock"] {
    order: -2;
  }

  .tower-more-panel {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 0.42rem;
  }

  .tower-more-panel > :nth-child(4n) {
    border-right: 1px solid rgba(247, 251, 247, 0.08);
  }

  .tower-more-panel > :nth-child(2n) {
    border-right: 0;
  }

  .tunnel-form label {
    display: none;
  }

  .menu-pill span,
  .tunnel-form label {
    font-size: 0.56rem;
  }

  .menu-pill strong {
    font-size: 0.68rem;
  }

  .tunnel-form input,
  .tunnel-form button {
    width: auto;
    font-size: 0.68rem;
  }

  .tunnel-form input {
    padding: 0 0.42rem;
  }

  .tunnel-form button {
    padding: 0 0.48rem;
  }

  .tower-title {
    display: grid;
    align-items: start;
  }

  .readiness-summary {
    text-align: left;
  }

  .curve-zone {
    grid-template-rows: auto 28rem;
    min-height: auto;
  }

  .curve-instrument {
    min-height: 28rem;
  }

  .curve-slider {
    bottom: 2.6rem;
    width: min(21rem, 76%);
    height: 3rem;
  }

  .curve-slider::-webkit-slider-thumb {
    width: 22px;
    height: 22px;
    margin-top: -10px;
  }

  .curve-slider::-moz-range-thumb {
    width: 22px;
    height: 22px;
  }

  .level-label strong {
    display: none;
  }

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

  .segment-purpose {
    min-height: auto;
  }

  .handoff-box img {
    width: 7.5rem;
    height: 7.5rem;
  }

  .segment-hud,
  .segment-hud[data-side="east"],
  .segment-hud[data-side="west"] {
    left: 50% !important;
    right: auto !important;
    top: 3.6rem !important;
    width: min(22rem, calc(100vw - 2rem));
    max-height: 19rem;
    transform: translateX(-50%) !important;
    z-index: 10;
    background:
      linear-gradient(135deg, rgba(102, 255, 149, 0.08), rgba(3, 4, 4, 0.96) 58%),
      #030404;
  }

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

  .resolution-line span {
    grid-column: 1 / -1;
  }
}

@media (max-width: 430px) {
  /* The link pill's checked-time truncated to "checked…" on phones; the
     stage strip still shows the full time, so the pill drops it here. */
  .pill-checked-time {
    display: none;
  }

  .front-door {
    align-items: start;
    padding-top: 5.2rem;
  }

  .front-door-grid {
    min-height: auto;
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .front-door-copy h1 {
    max-width: 21rem;
    font-size: clamp(2.1rem, 13vw, 3.35rem);
  }

  .front-door-line {
    max-width: 20rem;
    font-size: 0.72rem;
    line-height: 1.55;
  }

  .front-door-support {
    max-width: 20rem;
    font-size: 0.9rem;
    line-height: 1.5;
  }

  .front-door-actions {
    align-items: stretch;
  }

  .front-door-actions .primary-action,
  .front-door-actions .quiet-action {
    flex: 1 1 9rem;
  }

  .onboarding-instrument {
    min-height: auto;
    padding: 0;
  }

  .onboarding-levels {
    gap: 0.32rem;
    width: 100%;
    margin-top: 0.2rem;
  }

  .onboarding-levels button {
    width: clamp(3.55rem, 17vw, 4.15rem);
    min-height: 3.8rem;
  }

  .onboarding-levels span {
    font-size: 0.62rem;
  }

  .onboarding-levels strong {
    font-size: 0.5rem;
  }

  .tower {
    padding-left: 0.62rem;
    padding-right: 0.62rem;
  }

  .menu-strip {
    gap: 0.38rem;
  }

  .menu-pill,
  .tunnel-form {
    min-height: 2.78rem;
    padding: 0.42rem 0.42rem;
  }

  .menu-pill {
    flex-basis: 5.3rem;
  }

  .tunnel-form {
    flex-basis: 14.2rem;
  }

  .curve-zone,
  .segment-console {
    padding: 0.72rem;
  }

  .curve-zone {
    grid-template-rows: auto 24rem;
  }

  .curve-instrument {
    min-height: 24rem;
  }

  .action-row .quiet-action,
  .action-row .primary-action {
    flex: 1 1 8rem;
  }
}

#live-update-banner {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  padding: 0.6rem 1rem;
  background: rgba(255, 173, 66, 0.14);
  border-bottom: 1px solid rgba(255, 173, 66, 0.5);
  color: #ffad42;
  font-size: 0.82rem;
}

#live-update-banner button {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  color: #ffad42;
  background: transparent;
  border: 1px solid #ffad42;
  border-radius: 0.5rem;
  padding: 0.35rem 0.8rem;
  cursor: pointer;
}

/* Operator stage strip (E2E-7 Phases 1-2) — dark cockpit, mono kickers,
   one primary action per stage, matching the tester.css card language.
   Desktop keeps it a compact single row so the curve instrument (and its
   click geometry asserted by verify-control-tower) stays in the first
   viewport; mobile stacks it. */
.stage-strip {
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  width: min(88rem, 100%);
  margin: 0 auto 0.6rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.42rem 1rem;
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow:
    inset 0 0 2rem rgba(102, 255, 149, 0.02),
    0 1rem 2.5rem rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(14px);
}

.stage-strip[hidden] {
  display: none;
}

.stage-copy {
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 1rem;
}

.stage-kicker {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--dim);
  white-space: nowrap;
}

.stage-headline {
  margin: 0;
  font-size: 0.94rem;
  font-weight: 650;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stage-progress {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.64rem;
  letter-spacing: 0.08em;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stage-action {
  flex: 0 0 auto;
}

.stage-primary {
  min-height: 2.1rem;
  padding: 0 1.05rem;
  white-space: nowrap;
  border-color: rgba(102, 255, 149, 0.42);
  background: var(--green-soft);
}

.stage-primary:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.stage-strip[data-stage="connect"] .stage-progress,
.stage-strip[data-stage="triage"] .stage-progress {
  color: var(--orange);
}

.stage-strip[data-stage="triage"] {
  border-color: rgba(255, 173, 66, 0.45);
}

.stage-strip[data-stage="next"] .stage-progress {
  color: var(--green);
}

/* Wrap / next-run after-action summary (E2E-7 Phase 5). */
.stage-summary {
  flex-basis: 100%;
  min-width: 0;
  display: grid;
  gap: 0.55rem;
  padding: 0.55rem 0 0.2rem;
  border-top: 1px solid rgba(247, 251, 247, 0.08);
}

.stage-summary[hidden] {
  display: none;
}

.stage-summary-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.stage-chip {
  padding: 0.22rem 0.5rem;
  border: 1px solid rgba(247, 251, 247, 0.14);
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.12em;
  color: var(--muted);
  white-space: nowrap;
}

.stage-chip-green {
  border-color: rgba(102, 255, 149, 0.4);
  color: var(--green);
}

.stage-chip-red {
  border-color: rgba(255, 100, 100, 0.45);
  color: var(--red);
}

.stage-chip-gap {
  border-color: rgba(247, 251, 247, 0.24);
}

.stage-summary-next {
  display: grid;
  gap: 0.32rem;
}

.stage-summary-next h3 {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.58rem;
  letter-spacing: 0.22em;
  color: var(--dim);
}

.stage-summary-next ul {
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.24rem;
  list-style: none;
}

.stage-summary-next li {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  font-size: 0.74rem;
  color: var(--ink);
  min-width: 0;
}

.stage-summary-next li span {
  flex: 0 0 auto;
  font-family: var(--mono);
  font-size: 0.56rem;
  letter-spacing: 0.14em;
  color: var(--orange);
}

.stage-summary-next li.priority-p2 span {
  color: rgba(130, 216, 255, 0.85);
}

.stage-summary-next p {
  margin: 0;
  font-size: 0.72rem;
  color: var(--muted);
}

@media (max-width: 760px) {
  .stage-strip {
    flex-direction: column;
    align-items: stretch;
    gap: 0.6rem;
    padding: 0.72rem 0.9rem;
  }

  .stage-copy {
    flex-direction: column;
    align-items: stretch;
    gap: 0.3rem;
  }

  /* Keep the strip short on small viewports so the curve instrument stays
     near the first screen: kicker + progress carry the message; the headline
     is redundant with the primary action there. */
  .stage-headline {
    display: none;
  }

  .stage-progress {
    white-space: normal;
  }

  .stage-action {
    display: grid;
  }

  .stage-primary {
    width: 100%;
  }
}

/* Google-mode airlock: one sign-in door instead of the name/password form.
   Only rendered when /api/health reports google or local-google auth mode. */
.google-gate-stack {
  grid-template-columns: minmax(0, 1fr);
}

a.google-signin {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3.25rem;
  padding: 0 1rem;
  text-decoration: none;
  letter-spacing: 0.08em;
}

/* Cloud product mode (E2E-11): local-only tools disappear entirely when the
   operator session is a Google (or local-google) one. openSession stamps
   body[data-auth-mode]; [data-cloud-hidden] marks prototype-only controls
   such as the MORE panel's Tester PWA simulator pill. */
body[data-auth-mode="google"] [data-cloud-hidden],
body[data-auth-mode="local-google"] [data-cloud-hidden] {
  display: none !important;
}

/* Cloud invite roster (E2E-11 Phase 4): one compact row per approved tester
   inside the stage strip's action area. Never shows the raw link/token. */
.invite-roster {
  display: grid;
  gap: 0.4rem;
  width: 100%;
  min-width: min(21rem, 100%);
}

.invite-roster-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--line);
  background: rgba(247, 251, 247, 0.03);
}

.invite-roster-main {
  display: grid;
  gap: 0.12rem;
  min-width: 0;
}

.invite-roster-title {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
}

.invite-roster-main strong {
  font-size: 0.82rem;
  letter-spacing: 0.02em;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.invite-roster-main span {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.62rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.invite-roster-main .invite-roster-posture {
  flex: 0 0 auto;
  padding: 0.16rem 0.42rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.7rem;
  line-height: 1;
}

.invite-roster-posture-human-tester {
  border-color: rgba(128, 255, 181, 0.48);
  color: #8dffbc;
}

.invite-roster-posture-setup-needed {
  border-color: rgba(255, 218, 122, 0.48);
  color: #ffdd86;
}

.invite-roster-posture-agent-only {
  border-color: rgba(147, 166, 186, 0.45);
  color: #b8c2cc;
}

/* Compact per-row action: the phone media query widens .stage-primary to
   100%, which would crush the name column here — keep roster buttons sized
   to their label on every viewport. */
.invite-roster-copy {
  flex: 0 0 auto;
  width: auto;
  min-height: 1.9rem;
  padding: 0 0.8rem;
  font-size: 0.68rem;
}

.invite-roster-empty {
  margin: 0;
  font-size: 0.78rem;
  color: var(--muted);
}

/* The roster needs the stage strip's action column to grow on phones. */
.stage-strip[data-stage="invite"] .stage-action {
  flex: 1 1 18rem;
}
