
/* ════════════════════════════════════════════════════════════════
   EDRA × Defy. — Pitch Floor
   
   Built strictly under Defy. Brand Guidelines V2.0:
   - Wordmark: "Defy." with red square punctuation
   - Display: Playfair Display 900 / 800
   - Body: DM Sans 400 / 500 / 700
   - Palette: black, warm white, cream, Defy Red + supporting greys
   - 50% black · 40% warm white/cream · 10% Defy Red ratio
   - No mono fonts (not in brand spec)
   - No rounded corners, no shadows, no gradients
   
   Booth demo is HERO treatment: dark surface, light type.
   ════════════════════════════════════════════════════════════════ */

:root {
  /* Defy palette — primary */
  --defy-red:     #CC0000;
  --black:        #0A0A0A;
  --warm-white:   #F9F9F7;
  --cream:        #F3F1EC;
  
  /* Defy palette — supporting */
  --charcoal:     #2D2D2D;
  --mid-grey:     #777777;
  --border-grey:  #E8E6E1;
  --red-dark:     #990000;

  /* derived (only opacity variants of primary, allowed by brand for layered states) */
  --cream-dim:    rgba(243, 241, 236, 0.65);
  --cream-faint:  rgba(243, 241, 236, 0.4);
  --cream-line:   rgba(243, 241, 236, 0.18);
  
  /* fonts — strictly two families per brand */
  --f-display:    'Playfair Display', Georgia, serif;
  --f-body:       'DM Sans', 'Helvetica Neue', sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }

/* ═══════════════════════════════════════════════════════════════
   AUTH GATE — full-screen overlay before booth starts
   ═══════════════════════════════════════════════════════════════ */

.auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: var(--black);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.5s ease;
}

.auth-overlay.-fading {
  opacity: 0;
  pointer-events: none;
}

.auth-card {
  width: 380px;
  max-width: calc(100vw - 4rem);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 36px;
}

.auth-wordmark {
  display: flex;
  align-items: baseline;
  line-height: 1;
}

.auth-heading {
  font-family: var(--f-display);
  font-weight: 500;
  font-size: 22px;
  color: var(--cream);
  letter-spacing: -0.3px;
  text-align: center;
}

.auth-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-input {
  width: 100%;
  background: transparent;
  border: 1px solid var(--cream);
  color: var(--cream);
  font-family: var(--f-body);
  font-size: 16px;
  padding: 14px 18px;
  letter-spacing: 0.02em;
}

.auth-input::placeholder {
  color: var(--cream-faint);
}

.auth-input:focus {
  outline: none;
  border-color: var(--warm-white);
}

.auth-input.-invalid {
  border-color: var(--defy-red);
}

.auth-error {
  font-family: var(--f-body);
  font-size: 13px;
  color: var(--defy-red);
  min-height: 20px;
  line-height: 1.4;
}

.auth-submit {
  width: 100%;
  font-family: var(--f-body);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 4px;
  text-transform: uppercase;
  padding: 16px;
  background: var(--defy-red);
  color: var(--warm-white);
  border: none;
  cursor: pointer;
  transition: opacity 0.15s ease;
}

.auth-submit:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.auth-submit:not(:disabled):hover {
  opacity: 0.85;
}

body {
  background: var(--black);
  color: var(--cream);
  font-family: var(--f-body);
  font-size: 16px;
  line-height: 1.85;          /* per brand: body breathes */
  overflow: hidden;
  height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ═══════════════════════════════════════════════════════════════
   STAGE
   ═══════════════════════════════════════════════════════════════ */

.stage {
  position: fixed;
  inset: 0;
  overflow: hidden;
}

/* ─── BACKGROUND: dark hero with subtle window haze ─── */

.bg {
  position: absolute;
  inset: 0;
  background: var(--black);
}

.bg::before {
  content: '';
  position: absolute;
  inset: 0;
  /* the only gradients allowed: very subtle ambient haze suggesting windows */
  background:
    radial-gradient(ellipse 380px 460px at 18% 36%, rgba(249, 249, 247, 0.05), transparent 70%),
    radial-gradient(ellipse 320px 400px at 78% 32%, rgba(249, 249, 247, 0.04), transparent 70%);
  pointer-events: none;
}

.bg::after {
  content: '';
  position: absolute;
  inset: 0;
  /* window mullion silhouettes — pure black overlays, sharp lines */
  background:
    linear-gradient(90deg,
      transparent 11%, rgba(0,0,0,0.7) 11.2%, transparent 11.4%,
      transparent 24%, rgba(0,0,0,0.5) 24.2%, transparent 24.4%,
      transparent 76%, rgba(0,0,0,0.5) 76.2%, transparent 76.4%,
      transparent 89%, rgba(0,0,0,0.7) 89.2%, transparent 89.4%
    ),
    linear-gradient(0deg,
      transparent 38%, rgba(0,0,0,0.4) 38.3%, transparent 38.6%
    );
  pointer-events: none;
}

/* film grain — strict monochrome */
.grain {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(circle at 30% 20%, rgba(243, 241, 236, 0.018) 0px, transparent 1px),
    radial-gradient(circle at 70% 60%, rgba(243, 241, 236, 0.015) 0px, transparent 1px),
    radial-gradient(circle at 50% 90%, rgba(243, 241, 236, 0.012) 0px, transparent 1px);
  background-size: 3px 3px, 5px 5px, 7px 7px;
}

/* monochrome warm-white "bokeh" — extremely subtle haze dots, brand-allowed atmospheric */
.bokeh {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}
.bokeh-dot {
  position: absolute;
  background: var(--warm-white);
  filter: blur(14px);
  animation: float 14s ease-in-out infinite;
}
.bokeh-dot.-l { width: 60px; height: 60px; opacity: 0.06; }
.bokeh-dot.-m { width: 36px; height: 36px; opacity: 0.04; filter: blur(10px); }
.bokeh-dot.-s { width: 18px; height: 18px; opacity: 0.05; filter: blur(6px); }

.bokeh-dot:nth-child(1)  { top: 14%; left: 12%; animation-delay: 0s; }
.bokeh-dot:nth-child(2)  { top: 22%; left: 22%; animation-delay: -2s; }
.bokeh-dot:nth-child(3)  { top: 28%; left: 14%; animation-delay: -4s; }
.bokeh-dot:nth-child(4)  { top: 8%;  left: 28%; animation-delay: -6s; }
.bokeh-dot:nth-child(5)  { top: 16%; left: 76%; animation-delay: -1s; }
.bokeh-dot:nth-child(6)  { top: 24%; left: 84%; animation-delay: -3s; }
.bokeh-dot:nth-child(7)  { top: 32%; left: 92%; animation-delay: -5s; }
.bokeh-dot:nth-child(8)  { top: 11%; left: 88%; animation-delay: -7s; }
.bokeh-dot:nth-child(9)  { top: 18%; left: 48%; animation-delay: -8s; }
.bokeh-dot:nth-child(10) { top: 42%; left: 38%; animation-delay: -10s; }
.bokeh-dot:nth-child(11) { top: 6%;  left: 42%; animation-delay: -3s; }
.bokeh-dot:nth-child(12) { top: 12%; left: 62%; animation-delay: -6s; }

@keyframes float {
  0%, 100% { transform: translate(0, 0); }
  33% { transform: translate(8px, -10px); }
  66% { transform: translate(-6px, 5px); }
}

/* ═══════════════════════════════════════════════════════════════
   DEFY WORDMARK — top-left, exactly as specified in brand guidelines
   "Defy" in Playfair Display Black 900 + red square punctuation
   ═══════════════════════════════════════════════════════════════ */

.defy-mark {
  position: absolute;
  top: 36px;
  left: 48px;
  z-index: 25;
  display: flex;
  align-items: baseline;
  line-height: 1;
}
.defy-word {
  font-family: var(--f-display);
  font-weight: 900;
  font-size: 36px;
  color: var(--warm-white);
  letter-spacing: -0.5px;
  line-height: 1;
}
.defy-square {
  width: 11px;
  height: 11px;
  background: var(--defy-red);
  flex-shrink: 0;
  margin-left: 3px;
  margin-bottom: 3px;          /* aligns with baseline of "Defy" */
  align-self: flex-end;
}

/* ═══════════════════════════════════════════════════════════════
   AGENT SLOT — placeholder for external PNG
   Brand: documentary B&W or high-contrast monochrome with single red accent
   ═══════════════════════════════════════════════════════════════ */

.agent-slot {
  position: absolute;
  bottom: 22%;
  left: 50%;
  transform: translateX(-50%);
  height: 64%;
  aspect-ratio: 0.667;
  pointer-events: none;
  animation: idleBreathe 5s ease-in-out infinite;
  transition: left 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}
@keyframes idleBreathe {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(-4px); }
}

.edra-avatar {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: bottom center;
  object-position: bottom center;
  display: none;
  opacity: 0;
  transition: opacity 0.45s ease;
}

.edra-avatar.-visible {
  display: block;
  opacity: 1;
}

@keyframes avatarFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.edra-avatar.-entering {
  display: block;
  animation: avatarFadeIn 0.6s ease forwards;
}

.agent-slot-placeholder {
  width: 100%;
  height: 100%;
  border: 1px dashed var(--defy-red);
  background: rgba(204, 0, 0, 0.02);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 32px;
  text-align: center;
  position: relative;
}
.agent-slot-placeholder::before {
  content: '';
  position: absolute;
  inset: 12px;
  border: 1px dotted rgba(204, 0, 0, 0.18);
  pointer-events: none;
}
/* signature red square corner — brand element */
.agent-slot-placeholder::after {
  content: '';
  position: absolute;
  top: -6px; right: -6px;
  width: 18px; height: 18px;
  background: var(--defy-red);
}
.agent-slot-placeholder svg {
  width: 28%;
  height: auto;
  opacity: 0.55;
}

.placeholder-label {
  font-family: var(--f-body);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 5px;
  text-transform: uppercase;
  color: var(--defy-red);
  line-height: 1;
}
.placeholder-detail {
  font-family: var(--f-display);
  font-weight: 400;
  font-style: italic;
  font-size: 16px;
  color: var(--cream-dim);
  line-height: 1.4;
  max-width: 220px;
}
.placeholder-current {
  margin-top: 8px;
  padding: 6px 16px;
  border: 1px solid var(--defy-red);
  font-family: var(--f-body);
  font-weight: 700;
  font-size: 10px;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--defy-red);
}

/* ═══════════════════════════════════════════════════════════════
   SPEECH BUBBLE — comic/manga style, Defy brand adaptation
   ═══════════════════════════════════════════════════════════════ */

.speech-bubble {
  position: absolute;
  /* Positioned to the right of the avatar, vertically in the upper third (face area) */
  top: 18%;
  left: calc(50% + 12%);
  z-index: 6;
  max-width: 350px;
  min-width: 200px;
  padding: 22px 26px;
  background: var(--charcoal);
  border: 1px solid var(--cream-line);
  border-top: 3px solid var(--defy-red);
  /* 2px border-radius — the ONE exception for speech bubbles */
  border-radius: 2px;
  opacity: 1;
  transition: opacity 0.3s ease, left 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}

.speech-bubble.-hidden {
  display: none;
}

.speech-bubble.-fade-out {
  opacity: 0;
}

.speech-bubble.-fade-in {
  opacity: 0;
  animation: bubbleFadeIn 0.35s ease forwards;
}

@keyframes bubbleFadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.speech-bubble-text {
  font-family: var(--f-display);
  font-weight: 500;
  font-size: 18px;
  line-height: 1.5;
  color: var(--warm-white);
  letter-spacing: -0.2px;
}

.speech-bubble.-thought {
  border-color: var(--mid-grey);
}
.speech-bubble.-thought .speech-bubble-text {
  color: var(--cream);
  font-style: italic;
}
.speech-bubble.-thought .speech-bubble-tail {
  border-right-color: var(--mid-grey);
}

.bubble-continue-hint {
  margin-top: 12px;
  font-family: var(--f-body);
  font-style: normal;
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--mid-grey);
  animation: hintPulse 1.5s ease-in-out infinite;
}

@keyframes hintPulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

/* Triangular tail pointing LEFT toward the avatar */
.speech-bubble-tail {
  position: absolute;
  left: -12px;
  top: 28px;
  width: 0;
  height: 0;
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
  border-right: 12px solid var(--charcoal);
}

/* Outer tail for the border effect */
.speech-bubble-tail::before {
  content: '';
  position: absolute;
  left: -1px;
  top: -9px;
  width: 0;
  height: 0;
  border-top: 9px solid transparent;
  border-bottom: 9px solid transparent;
  border-right: 13px solid var(--cream-line);
  z-index: -1;
}

/* ═══════════════════════════════════════════════════════════════
   DIALOG MODE TOGGLE — small button, bottom-right above gauge
   ═══════════════════════════════════════════════════════════════ */

.dialog-mode-toggle {
  position: absolute;
  bottom: 98px;
  right: 48px;
  z-index: 15;
  background: var(--charcoal);
  border: 1px solid var(--cream-line);
  color: var(--cream-dim);
  font-family: var(--f-body);
  font-weight: 700;
  font-size: 9px;
  letter-spacing: 3px;
  text-transform: uppercase;
  padding: 7px 14px;
  cursor: pointer;
  transition: all 0.15s ease;
  line-height: 1;
}

.dialog-mode-toggle:hover {
  border-color: var(--defy-red);
  color: var(--warm-white);
}

.dialog-mode-toggle.-active {
  background: var(--defy-red);
  border-color: var(--defy-red);
  color: var(--warm-white);
}

/* When bubble mode is active, hide the textbox */
.textbox.-bubble-hidden {
  display: none;
}

/* ═══════════════════════════════════════════════════════════════
   VN TEXTBOX — editorial broadsheet style
   ═══════════════════════════════════════════════════════════════ */

.textbox {
  position: absolute;
  left: 8%;
  right: 8%;
  /* Stack above choices (which sit at bottom: 110, ~84px tall + 20px gap). */
  bottom: 220px;
  padding: 36px 52px 40px;
  background: rgba(10, 10, 10, 0.94);
  border-top: 4px solid var(--defy-red);
  border-bottom: 1px solid var(--cream-line);
  border-left: 1px solid var(--cream-line);
  border-right: 1px solid var(--cream-line);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  min-height: 184px;
  z-index: 5;
}

/* speaker plate — top-left */
.speaker {
  position: absolute;
  top: -20px;
  left: 36px;
  background: var(--black);
  border: 1px solid var(--defy-red);
  border-top: 4px solid var(--defy-red);
  padding: 14px 24px 12px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.speaker-name {
  font-family: var(--f-display);
  font-weight: 800;
  font-size: 22px;
  color: var(--warm-white);
  letter-spacing: -0.3px;
  line-height: 1;
}
.speaker-square {
  width: 8px;
  height: 8px;
  background: var(--defy-red);
}

/* internal thought line */
.thought {
  font-family: var(--f-display);
  font-style: italic;
  font-weight: 400;
  font-size: 18px;
  line-height: 1.45;
  color: var(--cream-dim);
  margin-bottom: 18px;
  padding-left: 20px;
  border-left: 3px solid var(--defy-red);
}
.thought-tag {
  font-family: var(--f-body);
  font-style: normal;
  font-weight: 700;
  font-size: 10px;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--defy-red);
  margin-left: 12px;
  padding: 2px 8px;
  vertical-align: middle;
}

/* spoken line — Playfair Display hero typography */
.utterance {
  font-family: var(--f-display);
  font-weight: 500;
  font-size: 30px;
  line-height: 1.4;
  color: var(--warm-white);
  letter-spacing: -0.3px;
  min-height: 84px;
}
.utterance-em {
  color: var(--defy-red);
  font-weight: 700;
  font-style: italic;
}

/* "click to continue" — solid red square per brand */
.continue-square {
  position: absolute;
  bottom: 20px;
  right: 36px;
  width: 14px;
  height: 14px;
  background: var(--defy-red);
  animation: blink 1.4s ease-in-out infinite;
}
@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* visitor choice buttons — editorial */
.choices {
  position: absolute;
  left: 12%;
  right: 12%;
  /* Sit above the gauge (height: 92, bottom: 0) with an 18px breathing
     gap. Previously this was bottom: 60, which placed the buttons partly
     under the gauge AND partly inside the textbox's bottom border. */
  bottom: 110px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  z-index: 10;
  transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1),
              left 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* when right panel opens, push choices and textbox left so they don't get covered */
.stage:has(.panel-trigger.-right:hover) .choices,
.stage:has(.panel-right:hover) .choices {
  right: calc(12% + 368px);
}
.stage:has(.panel-trigger.-right:hover) .textbox,
.stage:has(.panel-right:hover) .textbox {
  right: calc(8% + 368px);
}
.stage:has(.panel-trigger.-right:hover) .agent-slot,
.stage:has(.panel-right:hover) .agent-slot {
  left: calc(50% - 320px);
}
.stage:has(.panel-trigger.-right:hover) .speech-bubble,
.stage:has(.panel-right:hover) .speech-bubble {
  left: calc(50% + 12% - 420px);
}

/* same for left panel: push choices and textbox right */
.stage:has(.panel-trigger.-left:hover) .choices,
.stage:has(.panel-left:hover) .choices {
  left: calc(12% + 408px);
}
.stage:has(.panel-trigger.-left:hover) .textbox,
.stage:has(.panel-left:hover) .textbox {
  left: calc(8% + 408px);
}

.textbox {
  transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1),
              left 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}
.choice {
  font-family: var(--f-display);
  font-weight: 500;
  font-style: italic;
  font-size: 20px;
  background: var(--black);
  color: var(--warm-white);
  border: 1px solid var(--warm-white);
  padding: 18px 24px;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
  letter-spacing: -0.2px;
  display: flex;
  align-items: baseline;
  gap: 16px;
}
.choice-ix {
  font-family: var(--f-body);
  font-style: normal;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--mid-grey);
  flex-shrink: 0;
}
.choice:hover {
  background: var(--warm-white);
  color: var(--black);
}
.choice:hover .choice-ix { color: var(--defy-red); }
.choice.-positive:hover  { background: var(--warm-white); color: var(--black); }
.choice.-skeptical:hover { background: var(--charcoal); color: var(--warm-white); border-color: var(--warm-white); }
.choice.-negative:hover  { background: var(--defy-red); color: var(--warm-white); border-color: var(--defy-red); }
.choice.-negative:hover .choice-ix { color: var(--warm-white); }

/* ═══════════════════════════════════════════════════════════════
   INTEREST GAUGE — editorial bar with red accents
   ═══════════════════════════════════════════════════════════════ */

.gauge {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 92px;
  background: var(--black);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 32px;
  padding: 16px 60px 18px;
  border-top: 1px solid var(--warm-white);
}

.gauge-side {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.gauge-side.-left  { align-items: flex-start; }
.gauge-side.-right { align-items: flex-end; }

.gauge-label {
  font-family: var(--f-body);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 5px;
  text-transform: uppercase;
  color: var(--defy-red);
  line-height: 1;
}
.gauge-end {
  font-family: var(--f-display);
  font-style: italic;
  font-weight: 400;
  font-size: 16px;
  color: var(--cream-dim);
  line-height: 1;
  transition: color 0.35s ease;
}
.gauge-end.-low { color: var(--defy-red); }

.gauge-track-wrap { position: relative; }
.gauge-track {
  display: grid;
  grid-template-columns: repeat(11, 30px);
  gap: 4px;
  align-items: center;
}
.gauge-cell {
  height: 18px;
  background: transparent;
  border: 1px solid var(--mid-grey);
  position: relative;
  transition: all 0.3s ease;
}
.gauge-cell.-mid {
  border-color: var(--warm-white);
  border-width: 2px;
  height: 28px;
  background: var(--charcoal);
}
.gauge-cell.-mid::after {
  content: '0';
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--f-body);
  font-weight: 700;
  font-size: 10px;
  color: var(--warm-white);
}
.gauge-cell.-on {
  background: var(--warm-white);
  border-color: var(--warm-white);
}
.gauge-cell.-on.-warm,
.gauge-cell.-on.-hot {
  background: var(--defy-red);
  border-color: var(--defy-red);
}

.gauge-value-wrap {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-bottom: 8px;
  text-align: center;
  pointer-events: none;
}
.gauge-value {
  font-family: var(--f-display);
  font-weight: 900;
  font-size: 32px;
  line-height: 1;
  color: var(--defy-red);
  letter-spacing: -1px;
}
.gauge-value::before { content: '+'; }

/* ═══════════════════════════════════════════════════════════════
   HOVER PANELS — editorial, no shadows
   ═══════════════════════════════════════════════════════════════ */

.edge-handle {
  position: absolute;
  z-index: 20;
  background: var(--black);
  border-style: solid;
  border-color: var(--mid-grey);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--f-body);
  font-weight: 700;
  font-size: 10px;
  letter-spacing: 5px;
  text-transform: uppercase;
  color: var(--mid-grey);
}
.edge-handle:hover { color: var(--defy-red); border-color: var(--defy-red); }

.edge-top {
  top: 0; left: 0; right: 0;
  height: 28px;
  border-width: 0 0 1px 0;
  letter-spacing: 6px;
  padding-left: 180px;     /* clear the wordmark */
  padding-right: 280px;    /* clear the EDRA mark */
}
.edge-top::after { content: attr(data-label); }

.edge-right {
  top: 28px; bottom: 92px;
  right: 0;
  width: 32px;
  border-width: 0 0 0 1px;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  padding: 18px 0;
  letter-spacing: 6px;
}
.edge-right::after { content: attr(data-label); }

.edge-left {
  top: 28px; bottom: 92px;
  left: 0;
  width: 32px;
  border-width: 0 1px 0 0;
  writing-mode: vertical-lr;
  transform: rotate(180deg);
  padding: 18px 0;
  letter-spacing: 6px;
}
.edge-left::after { content: attr(data-label); }

.panel {
  position: absolute;
  z-index: 30;
  background: var(--black);
  transition: opacity 0.35s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
  pointer-events: none;
  opacity: 0;
}
.panel-trigger:hover ~ .panel,
.panel:hover {
  pointer-events: auto;
  opacity: 1;
}

.panel-right {
  top: 28px; bottom: 92px;
  right: 0;
  width: 400px;
  border-left: 1px solid var(--warm-white);
  transform: translateX(calc(100% - 32px));
  padding: 32px 36px;
}
.panel-trigger.-right:hover ~ .panel-right,
.panel-right:hover {
  transform: translateX(0);
}

.panel-left {
  top: 28px; bottom: 92px;
  left: 0;
  width: 440px;
  border-right: 1px solid var(--warm-white);
  transform: translateX(calc(-100% + 32px));
  padding: 32px 36px;
}
.panel-trigger.-left:hover ~ .panel-left,
.panel-left:hover {
  transform: translateX(0);
}

.panel-top {
  top: 0;
  left: 0; right: 0;
  height: 110px;
  border-bottom: 1px solid var(--warm-white);
  transform: translateY(calc(-100% + 28px));
  padding: 22px 48px 22px 200px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 32px;
}
.panel-trigger.-top:hover ~ .panel-top,
.panel-top:hover {
  transform: translateY(0);
}

/* ═══════════════════════════════════════════════════════════════
   PANEL CONTENTS — editorial layout
   ═══════════════════════════════════════════════════════════════ */

/* section eyebrow — small red bold uppercase, per brand */
.section-num {
  font-family: var(--f-body);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 5px;
  text-transform: uppercase;
  color: var(--defy-red);
  margin-bottom: 10px;
  line-height: 1;
}

.panel-title {
  font-family: var(--f-display);
  font-weight: 800;
  font-size: 38px;
  letter-spacing: -0.5px;
  color: var(--warm-white);
  line-height: 1.05;
  margin-bottom: 6px;
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.panel-title-square {
  width: 12px;
  height: 12px;
  background: var(--defy-red);
  flex-shrink: 0;
}

.panel-meta {
  font-family: var(--f-body);
  font-weight: 400;
  font-size: 13px;
  color: var(--mid-grey);
  margin-bottom: 24px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--cream-line);
  line-height: 1.5;
}

/* PROFILE PANEL */
.profile-portrait {
  width: 100%;
  aspect-ratio: 1.05;
  background: var(--charcoal);
  position: relative;
  margin-bottom: 22px;
  border: 1px solid var(--warm-white);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 20px;
  text-align: center;
}
/* signature red square corner */
.profile-portrait::after {
  content: '';
  position: absolute;
  top: -6px; right: -6px;
  width: 14px; height: 14px;
  background: var(--defy-red);
  z-index: 2;
}
/* avatar — fills the portrait box; grayscale + slight contrast to fit
   the documentary B&W treatment of the rest of the panel. Hidden until
   the JS sets a src and adds the .-has-image class on the parent. */
.profile-portrait-img {
  display: none;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(1) contrast(1.05);
}
.profile-portrait.-has-image .profile-portrait-img {
  display: block;
}
.profile-portrait.-has-image .ph-icon,
.profile-portrait.-has-image .ph-label,
.profile-portrait.-has-image .ph-detail {
  display: none;
}
.ph-icon {
  font-family: var(--f-display);
  font-weight: 400;
  font-size: 36px;
  color: var(--mid-grey);
  line-height: 1;
}
.ph-label {
  font-family: var(--f-body);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 5px;
  text-transform: uppercase;
  color: var(--mid-grey);
}
.ph-detail {
  font-family: var(--f-display);
  font-style: italic;
  font-weight: 400;
  font-size: 14px;
  color: var(--cream-dim);
  line-height: 1.4;
  max-width: 220px;
}

.subject-name {
  font-family: var(--f-display);
  font-weight: 800;
  font-size: 36px;
  line-height: 1;
  letter-spacing: -0.5px;
  color: var(--warm-white);
}
.subject-role {
  font-family: var(--f-body);
  font-weight: 400;
  font-size: 14px;
  color: var(--cream-dim);
  margin-top: 8px;
  line-height: 1.5;
}

.archetype {
  margin-top: 20px;
  padding: 16px 18px;
  background: var(--charcoal);
  border-left: 3px solid var(--defy-red);
}
.archetype-lab {
  font-family: var(--f-body);
  font-weight: 700;
  font-size: 10px;
  letter-spacing: 5px;
  text-transform: uppercase;
  color: var(--mid-grey);
  margin-bottom: 6px;
  line-height: 1;
}
.archetype-val {
  font-family: var(--f-display);
  font-weight: 800;
  font-size: 18px;
  color: var(--warm-white);
  letter-spacing: -0.3px;
  line-height: 1.15;
}

/* fields list */
.fields {
  margin-top: 22px;
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 10px 16px;
}
.field-k {
  font-family: var(--f-body);
  font-weight: 700;
  font-size: 10px;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--mid-grey);
  padding-top: 3px;
  line-height: 1.3;
}
.field-v {
  font-family: var(--f-body);
  font-weight: 500;
  font-size: 14px;
  color: var(--warm-white);
  line-height: 1.4;
}
.field-v.-red { color: var(--defy-red); font-weight: 700; }

/* posts */
.posts {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--cream-line);
}
.posts-lab {
  font-family: var(--f-body);
  font-weight: 700;
  font-size: 10px;
  letter-spacing: 5px;
  text-transform: uppercase;
  color: var(--mid-grey);
  margin-bottom: 12px;
  line-height: 1;
}
.post-snip {
  font-family: var(--f-display);
  font-style: italic;
  font-weight: 400;
  font-size: 17px;
  line-height: 1.45;
  color: var(--cream-dim);
  border-left: 3px solid var(--warm-white);
  padding: 4px 0 4px 16px;
  margin-bottom: 12px;
}
.post-when {
  display: block;
  font-family: var(--f-body);
  font-style: normal;
  font-weight: 700;
  font-size: 10px;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--mid-grey);
  margin-top: 8px;
  line-height: 1;
}

/* RULEBOOK PANEL */
.rules-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.rule {
  background: var(--charcoal);
  padding: 18px 20px;
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: 4px 16px;
  position: relative;
  border-left: 2px solid var(--mid-grey);
}
.rule.-fresh {
  border-left-color: var(--defy-red);
}
.rule.-fresh::before {
  content: 'NEW';
  position: absolute;
  top: 8px; right: 12px;
  background: var(--defy-red);
  color: var(--warm-white);
  font-family: var(--f-body);
  font-weight: 700;
  font-size: 9px;
  letter-spacing: 4px;
  padding: 3px 8px;
  line-height: 1;
}
.rule.-revising {
  border-left-color: var(--defy-red);
  animation: pulseRevise 1.6s ease-in-out infinite;
}
@keyframes pulseRevise {
  50% { background: rgba(204, 0, 0, 0.10); }
}
.rule.-deprecated { 
  opacity: 0.4; 
  border-left-color: var(--mid-grey); 
}
.rule.-deprecated .rule-num { text-decoration: line-through; }

.rule-num {
  font-family: var(--f-display);
  font-weight: 900;
  font-size: 40px;
  line-height: 0.9;
  letter-spacing: -1.5px;
  color: var(--warm-white);
  align-self: center;
}
.rule.-fresh .rule-num    { color: var(--defy-red); }
.rule.-revising .rule-num { color: var(--defy-red); }

.rule-body {
  font-family: var(--f-body);
  font-size: 12px;
  line-height: 1.6;
  color: var(--cream-dim);
  align-self: center;
}
.rule-body .if {
  color: var(--mid-grey);
  font-weight: 700;
  font-size: 10px;
  letter-spacing: 4px;
  text-transform: uppercase;
  margin-right: 8px;
}
.rule-body .then {
  color: var(--defy-red);
  font-weight: 700;
  font-size: 10px;
  letter-spacing: 4px;
  text-transform: uppercase;
  margin-right: 4px;
}
.rule-body .clu {
  font-family: var(--f-display);
  font-weight: 800;
  color: var(--warm-white);
  font-size: 15px;
  letter-spacing: -0.2px;
}
.rule-body .clu em {
  font-family: var(--f-display);
  font-style: italic;
  font-weight: 400;
  color: var(--cream-dim);
  font-size: 14px;
}

/* slot grid — wrapping row of slot pairs, never breaks mid-tag */
.slot-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 4px;
  margin-top: 6px;
  align-items: center;
}
.slot-pair {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.slot-label {
  font-family: var(--f-body);
  font-weight: 700;
  font-size: 9px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--mid-grey);
  white-space: nowrap;
  line-height: 1;
}

.slot-val {
  display: inline-block;
  background: var(--black);
  padding: 2px 8px;
  color: var(--warm-white);
  font-family: var(--f-body);
  font-weight: 500;
  font-size: 11px;
  border: 1px solid var(--mid-grey);
  white-space: nowrap;
  line-height: 1.4;
}
.slot-val.-dynamic {
  border-color: var(--defy-red);
  color: var(--defy-red);
  border-style: dashed;
}

/* legacy .slot class kept for the mockup HTML */
.rule-body .slot {
  background: var(--black);
  padding: 2px 8px;
  color: var(--warm-white);
  font-weight: 500;
  border: 1px solid var(--mid-grey);
  white-space: nowrap;
  display: inline-block;
}
.rule-body .dyn {
  display: block;
  margin-top: 6px;
  font-family: var(--f-display);
  font-style: italic;
  font-weight: 400;
  font-size: 14px;
  color: var(--defy-red);
}

.rule-cs {
  align-self: center;
  text-align: right;
  width: 60px;
}
.cs-hist {
  height: 32px;
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 1.5px;
  align-items: end;
  margin-bottom: 6px;
}
.cs-bar {
  background: var(--mid-grey);
  min-height: 3px;
  opacity: 0.4;
}
.cs-bar.-active {
  background: var(--warm-white);
  opacity: 1;
}
.rule.-revising .cs-bar.-active { background: var(--defy-red); }
.rule.-fresh .cs-bar.-active    { background: var(--defy-red); }

.cs-num {
  font-family: var(--f-display);
  font-weight: 900;
  font-size: 18px;
  color: var(--warm-white);
  letter-spacing: -0.5px;
  line-height: 1;
}
.cs-num small {
  font-family: var(--f-body);
  font-size: 10px;
  font-weight: 400;
  color: var(--mid-grey);
}
.rule.-revising .cs-num { color: var(--defy-red); }
.rule.-fresh .cs-num { color: var(--defy-red); }

/* reflection */
.reflection {
  margin-top: 24px;
  padding: 22px 22px;
  background: var(--charcoal);
  border-top: 4px solid var(--defy-red);
  position: relative;
}

.refl-title {
  font-family: var(--f-display);
  font-weight: 800;
  font-size: 22px;
  color: var(--defy-red);
  margin-bottom: 14px;
  letter-spacing: -0.3px;
  display: flex;
  align-items: center;
  gap: 12px;
  line-height: 1;
}
.refl-title-square {
  width: 12px;
  height: 12px;
  background: var(--defy-red);
  flex-shrink: 0;
  animation: warnBlink 1.4s steps(2) infinite;
}
@keyframes warnBlink { 50% { opacity: 0.4; } }

.refl-preview-note {
  font-family: var(--f-body);
  font-weight: 600;
  font-size: 11px;
  line-height: 1.4;
  letter-spacing: 0.2px;
  color: var(--cream-faint);
  margin-bottom: 12px;
}

.refl-text {
  font-family: var(--f-display);
  font-style: italic;
  font-weight: 400;
  font-size: 16px;
  line-height: 1.5;
  color: var(--cream-dim);
  margin-bottom: 14px;
}
.refl-text.-streaming::after {
  content: '▌';
  color: var(--defy-red);
  animation: cursor 1s step-start infinite;
  font-style: normal;
}
@keyframes cursor { 50% { opacity: 0; } }

.refl-proposal {
  font-family: var(--f-body);
  font-weight: 500;
  font-size: 13px;
  line-height: 1.6;
  background: var(--black);
  padding: 14px 16px;
  border: 1px solid var(--warm-white);
  margin-top: 12px;
}
.refl-proposal-head {
  display: block;
  font-family: var(--f-body);
  font-weight: 700;
  font-size: 10px;
  letter-spacing: 5px;
  text-transform: uppercase;
  color: var(--defy-red);
  margin-bottom: 8px;
  line-height: 1;
}
.refl-change {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 2px 0;
}
.refl-slot-name {
  flex: 0 0 78px;
  font-family: var(--f-body);
  font-weight: 700;
  font-size: 9px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--mid-grey);
  line-height: 1.6;
}
.refl-diff {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  flex-wrap: wrap;
}
.refl-change s {
  color: var(--mid-grey);
  text-decoration: line-through;
}
.refl-arrow {
  color: var(--mid-grey);
  font-weight: 700;
}
.refl-change b {
  color: var(--warm-white);
  padding: 1px 6px;
  font-weight: 700;
}
/* changed slot — red accent draws the eye */
.refl-change.-changed b {
  background: var(--defy-red);
}
/* unchanged slot — everything muted, before == after so collapse to one value */
.refl-change.-unchanged b {
  color: var(--cream-dim);
  background: transparent;
  padding: 0;
}
.refl-change.-unchanged s,
.refl-change.-unchanged .refl-arrow {
  display: none;
}

.refl-actions {
  display: flex;
  gap: 0;
  margin-top: 16px;
  border: 1px solid var(--warm-white);
}
.btn-sm {
  flex: 1;
  font-family: var(--f-body);
  font-weight: 700;
  font-size: 11px;
  padding: 11px 8px;
  background: var(--black);
  color: var(--warm-white);
  border: none;
  border-right: 1px solid var(--warm-white);
  cursor: pointer;
  letter-spacing: 4px;
  text-transform: uppercase;
  transition: all 0.12s;
  text-align: center;
  line-height: 1;
}
.btn-sm:last-child { border-right: none; }
.btn-sm.-go:hover { background: var(--warm-white); color: var(--black); }
.btn-sm.-edit:hover { background: var(--charcoal); }
.btn-sm.-no:hover { background: var(--defy-red); color: var(--warm-white); }

/* TOP PANEL */
.top-stats {
  display: flex;
  gap: 56px;
  align-items: baseline;
}
.top-stat { text-align: left; }
.top-stat-num {
  font-family: var(--f-display);
  font-weight: 900;
  font-size: 36px;
  line-height: 1;
  letter-spacing: -1px;
  color: var(--warm-white);
}
.top-stat-num.-red { color: var(--defy-red); }
.top-stat-lab {
  font-family: var(--f-body);
  font-weight: 700;
  font-size: 10px;
  letter-spacing: 5px;
  text-transform: uppercase;
  color: var(--mid-grey);
  margin-top: 6px;
  line-height: 1;
}

.top-controls {
  display: flex;
  gap: 0;
  align-items: center;
  border: 1px solid var(--warm-white);
}
.btn-op {
  font-family: var(--f-body);
  font-weight: 700;
  font-size: 11px;
  padding: 13px 22px;
  background: var(--black);
  color: var(--warm-white);
  border: none;
  border-right: 1px solid var(--warm-white);
  cursor: pointer;
  letter-spacing: 4px;
  text-transform: uppercase;
  transition: all 0.15s ease;
  line-height: 1;
}
.btn-op:last-child { border-right: none; }
.btn-op:hover { background: var(--warm-white); color: var(--black); }
.btn-op.-danger:hover { background: var(--defy-red); color: var(--warm-white); }
.btn-op.-select {
  letter-spacing: 1px;
  padding-right: 28px;
  max-width: 220px;
  text-overflow: ellipsis;
  -webkit-appearance: none;
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--warm-white) 50%),
    linear-gradient(135deg, var(--warm-white) 50%, transparent 50%);
  background-position:
    right 14px center,
    right 9px center;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}
.btn-op.-select:hover {
  background-color: var(--warm-white);
  color: var(--black);
  background-image:
    linear-gradient(45deg, transparent 50%, var(--black) 50%),
    linear-gradient(135deg, var(--black) 50%, transparent 50%);
}
.btn-op.-select option { background: var(--black); color: var(--warm-white); }

/* mockup note */
.mockup-note {
  position: fixed;
  bottom: 100px;
  right: 16px;
  background: var(--black);
  border: 1px solid var(--defy-red);
  padding: 8px 14px;
  font-family: var(--f-body);
  font-weight: 700;
  font-size: 10px;
  letter-spacing: 5px;
  text-transform: uppercase;
  color: var(--defy-red);
  z-index: 1000;
  pointer-events: none;
  display: flex;
  align-items: center;
  gap: 10px;
}
.mockup-note::before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  background: var(--defy-red);
}

.panel::-webkit-scrollbar { width: 4px; }
.panel::-webkit-scrollbar-track { background: transparent; }
.panel::-webkit-scrollbar-thumb { background: var(--mid-grey); }


/* ═══════════════════════════════════════════════════════════════
   Phase 2 additions — data-driven frontend hooks
   ═══════════════════════════════════════════════════════════════ */

/* Expert View toggle: hides the italic in-parens internal-thought line
   and the reflection console's reasoning + proposal sections.
   §10.6 of TASK.md — the operator's "show me the seams" switch. */
body.expert-off .thought,
body.expert-off .refl-text,
body.expert-off .refl-proposal {
  display: none;
}

/* Empty / loading state for the textbox (no episodes yet). */
.utterance.-waiting {
  color: var(--cream-faint);
  font-style: italic;
}

/* Empty rules-list message. */
.rules-empty {
  font-family: var(--f-display);
  font-style: italic;
  font-weight: 400;
  font-size: 16px;
  color: var(--cream-dim);
  padding: 14px 18px;
  border: 1px dashed var(--mid-grey);
  text-align: center;
}

/* Smooth interest-gauge value transition. The mockup hard-paints the
   number — we want it to slide visually as state polls update. */
.gauge-value {
  transition: color 0.25s ease;
}

/* Continue square only blinks when the typewriter has finished. */
.continue-square.-typing {
  animation: none;
  opacity: 0;
}

/* Disabled choice buttons (live mode not active). */
.choice[disabled],
.choice.-disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.choice[disabled]:hover,
.choice.-disabled:hover {
  background: var(--black);
  color: var(--warm-white);
}

/* Reflection block hidden by default until active_revision fires. */
.reflection.-hidden { display: none; }

/* ═══════════════════════════════════════════════════════════════
   Idle hero — editorial treatment for the "waiting" state
   ═══════════════════════════════════════════════════════════════ */

.idle-hero {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.idle-hero.-hidden {
  display: none;
}

.idle-eyebrow {
  font-family: var(--f-body);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 5px;
  text-transform: uppercase;
  color: var(--defy-red);
  line-height: 1;
  margin-bottom: 14px;
}

.idle-headline {
  font-family: var(--f-display);
  font-weight: 800;
  font-size: 44px;
  line-height: 1.15;
  letter-spacing: -0.5px;
  color: var(--warm-white);
  margin-bottom: 20px;
}

.idle-square {
  display: inline-block;
  width: 14px;
  height: 14px;
  background: var(--defy-red);
  margin-left: 8px;
  vertical-align: baseline;
}

.idle-rotation {
  font-family: var(--f-display);
  font-style: italic;
  font-weight: 400;
  font-size: 18px;
  color: var(--cream-dim);
  line-height: 1.45;
  min-height: 26px;
  transition: opacity 0.6s ease;
}

.idle-rotation.-fading {
  opacity: 0;
}

/* ═══════════════════════════════════════════════════════════════
   Gauge terminal state animations
   ═══════════════════════════════════════════════════════════════ */

@keyframes gaugePulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.gauge.-terminal-accepted .gauge-value {
  animation: gaugePulse 2s ease-in-out infinite;
}

.gauge.-terminal-accepted .gauge-side.-right .gauge-end {
  color: var(--warm-white);
}

.gauge.-terminal-accepted .gauge-cell.-on.-warm,
.gauge.-terminal-accepted .gauge-cell.-on.-hot {
  animation: gaugePulse 2s ease-in-out infinite;
}

.gauge.-terminal-rejected .gauge-value {
  color: var(--mid-grey) !important;
}

.gauge.-terminal-rejected .gauge-cell.-on {
  opacity: 0.5;
}

/* ──────────────────────────────────────────────────────────────────
   Live-visit modal (Phase 3) — opens on click of the "Start Live"
   operator button (only present when LIVE_MODE=true). Centered overlay
   so it doesn't compete for layout space with the rest of the booth.
   ──────────────────────────────────────────────────────────────── */
.live-dialog {
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 10, 0.78);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.live-dialog.-hidden { display: none; }
.live-card {
  background: var(--black);
  border: 1px solid var(--defy-red);
  padding: 2rem 2.4rem;
  width: 32rem;
  max-width: calc(100vw - 4rem);
  font-family: var(--f-body);
  color: var(--warm-white);
}
.live-card-eyebrow {
  font-weight: 700;
  font-size: 0.7rem;
  letter-spacing: 0.32em;
  color: var(--defy-red);
  margin-bottom: 0.8rem;
}
.live-card-title {
  font-family: var(--f-display);
  font-size: 1.5rem;
  letter-spacing: 0.01em;
  margin-bottom: 0.8rem;
}
.live-card-body {
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--cream-dim);
  margin-bottom: 1.2rem;
}
.live-input {
  width: 100%;
  background: transparent;
  border: 1px solid var(--cream-line);
  color: var(--warm-white);
  font-family: var(--f-body);
  font-size: 0.95rem;
  padding: 0.55rem 0.7rem;
  letter-spacing: 0.02em;
  margin-bottom: 0.8rem;
}
.live-input::placeholder {
  color: var(--cream-faint);
}
.live-input:focus {
  outline: none;
  border-color: var(--defy-red);
}
.live-status {
  display: block;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cream-dim);
  margin-bottom: 1rem;
  min-height: 1rem;
}
.live-status.-error { color: var(--defy-red); }
.live-status.-ok    { color: var(--warm-white); }
.live-actions {
  display: flex;
  gap: 0.6rem;
  justify-content: flex-end;
}

/* Wi-Fi fallback dialog — shown when ProfileSourceUnavailable bubbles up */
.fallback-dialog {
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 10, 0.78);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.fallback-dialog.-hidden { display: none; }
.fallback-card {
  background: var(--black);
  border: 1px solid var(--defy-red);
  padding: 2rem 2.4rem;
  max-width: 28rem;
  font-family: var(--f-body);
  color: var(--warm-white);
}
.fallback-title {
  font-family: var(--f-display);
  font-size: 1.4rem;
  margin-bottom: 0.6rem;
  letter-spacing: 0.01em;
}
.fallback-body {
  font-size: 0.92rem;
  margin-bottom: 1.4rem;
  line-height: 1.6;
  color: var(--cream-dim);
}
.fallback-select {
  width: 100%;
  background: transparent;
  border: 1px solid var(--cream-line);
  color: var(--warm-white);
  font-family: var(--f-body);
  font-size: 0.95rem;
  padding: 0.5rem 0.6rem;
  margin-bottom: 1.2rem;
}
.fallback-actions {
  display: flex;
  gap: 0.6rem;
  justify-content: flex-end;
}

/* ═══════════════════════════════════════════════════════════════
   Welcome session-start dialog — choose LinkedIn URL or synthetic
   ═══════════════════════════════════════════════════════════════ */
.session-start-dialog {
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 10, 0.78);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.session-start-dialog.-hidden { display: none; }
.session-start-card {
  background: var(--black);
  border: 1px solid var(--defy-red);
  padding: 2rem 2.4rem;
  width: 34rem;
  max-width: calc(100vw - 4rem);
  font-family: var(--f-body);
  color: var(--warm-white);
}
.session-start-eyebrow {
  font-weight: 700;
  font-size: 0.7rem;
  letter-spacing: 0.32em;
  color: var(--defy-red);
  margin-bottom: 0.8rem;
}
.session-start-title {
  font-family: var(--f-display);
  font-size: 1.5rem;
  letter-spacing: 0.01em;
  margin-bottom: 1.4rem;
}
.session-start-section {
  margin-bottom: 0.4rem;
}
.session-start-label {
  display: block;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--cream-dim);
  margin-bottom: 0.5rem;
}
.session-start-live-btn,
.session-start-synth-btn {
  margin-top: 0.5rem;
  width: 100%;
}
.session-start-divider {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin: 1rem 0;
}
.session-start-divider-line {
  flex: 1;
  height: 1px;
  background: var(--cream-line);
}
.session-start-divider-text {
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--cream-dim);
}
.session-start-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 1.2rem;
}
.session-start-section .live-status {
  margin-bottom: 0;
}
/* Hide the LinkedIn section when live mode is off (toggled by JS) */
#session-start-live-section.-unavailable {
  display: none;
}
#session-start-live-section.-unavailable + .session-start-divider {
  display: none;
}

/* ═══════════════════════════════════════════════════════════════
   End-of-dialog popup — shown when interest reaches +5 or -5
   ═══════════════════════════════════════════════════════════════ */

.end-dialog {
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 10, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1100;
  opacity: 0;
  animation: endFadeIn 0.4s ease forwards;
}
.end-dialog.-hidden {
  display: none;
}

@keyframes endFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.end-card {
  background: var(--charcoal);
  width: 28rem;
  max-width: calc(100vw - 4rem);
  padding: 0;
  position: relative;
}

.end-accent {
  height: 4px;
  width: 100%;
}
.end-card.-success .end-accent {
  background: var(--defy-red);
}
.end-card.-failure .end-accent {
  background: var(--mid-grey);
}

.end-eyebrow {
  font-family: var(--f-body);
  font-weight: 700;
  font-size: 10px;
  letter-spacing: 5px;
  text-transform: uppercase;
  line-height: 1;
  padding: 28px 36px 0;
}
.end-card.-success .end-eyebrow {
  color: var(--defy-red);
}
.end-card.-failure .end-eyebrow {
  color: var(--mid-grey);
}

.end-headline {
  font-family: var(--f-display);
  font-weight: 800;
  font-size: 32px;
  line-height: 1.15;
  letter-spacing: -0.5px;
  padding: 14px 36px 0;
}
.end-card.-success .end-headline {
  color: var(--warm-white);
}
.end-card.-failure .end-headline {
  color: var(--cream-dim);
}

.end-body {
  font-family: var(--f-body);
  font-weight: 400;
  font-size: 15px;
  line-height: 1.7;
  padding: 16px 36px 0;
}
.end-card.-success .end-body {
  color: var(--cream);
}
.end-card.-failure .end-body {
  color: var(--cream-dim);
}

.end-btn {
  display: block;
  width: calc(100% - 72px);
  margin: 28px 36px 32px;
  font-family: var(--f-body);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 4px;
  text-transform: uppercase;
  padding: 14px 0;
  cursor: pointer;
  text-align: center;
  line-height: 1;
  transition: all 0.15s ease;
  background: var(--black);
  color: var(--warm-white);
  border: 1px solid var(--warm-white);
}
.end-btn:hover {
  background: var(--warm-white);
  color: var(--black);
}

/* ═══════════════════════════════════════════════════════════════
   Cluster visualization — scatter plot + nearest neighbors
   ═══════════════════════════════════════════════════════════════ */

.cluster-viz {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--cream-line);
}

.cluster-viz-lab {
  font-family: var(--f-body);
  font-weight: 700;
  font-size: 10px;
  letter-spacing: 5px;
  text-transform: uppercase;
  color: var(--mid-grey);
  margin-bottom: 12px;
  line-height: 1;
}

.cluster-viz-canvas-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 1.37;
  background: var(--charcoal);
  border: 1px solid var(--cream-line);
  margin-bottom: 10px;
}

#cluster-viz-canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.cluster-viz-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--f-display);
  font-style: italic;
  font-weight: 400;
  font-size: 14px;
  color: var(--cream-dim);
  pointer-events: none;
}

.cluster-viz-placeholder.-hidden {
  display: none;
}

.cluster-viz-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-bottom: 14px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-family: var(--f-body);
  font-size: 10px;
  font-weight: 500;
  color: var(--cream-dim);
  letter-spacing: 0.5px;
}

.legend-dot {
  width: 8px;
  height: 8px;
  flex-shrink: 0;
}

.neighbors-lab {
  font-family: var(--f-body);
  font-weight: 700;
  font-size: 10px;
  letter-spacing: 5px;
  text-transform: uppercase;
  color: var(--defy-red);
  margin-bottom: 10px;
  line-height: 1;
}

.neighbors-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.neighbor-empty {
  font-family: var(--f-display);
  font-style: italic;
  font-weight: 400;
  font-size: 14px;
  color: var(--cream-dim);
}

.neighbor-card {
  display: grid;
  grid-template-columns: 32px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 8px 10px;
  background: var(--charcoal);
  border-left: 2px solid var(--mid-grey);
}

.neighbor-avatar {
  width: 32px;
  height: 32px;
  background: var(--black);
  border: 1px solid var(--cream-line);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--f-display);
  font-weight: 800;
  font-size: 13px;
  color: var(--cream-dim);
  overflow: hidden;
}

.neighbor-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(1);
}

.neighbor-info {
  min-width: 0;
}

.neighbor-name {
  font-family: var(--f-body);
  font-weight: 700;
  font-size: 12px;
  color: var(--warm-white);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.neighbor-role {
  font-family: var(--f-body);
  font-weight: 400;
  font-size: 10px;
  color: var(--cream-dim);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.neighbor-sim {
  font-family: var(--f-display);
  font-weight: 800;
  font-size: 14px;
  color: var(--mid-grey);
  white-space: nowrap;
}

.neighbor-sim.-high {
  color: var(--warm-white);
}

.neighbor-sim.-top {
  color: var(--defy-red);
}

/* ═══════════════════════════════════════════════════════════════
   RESOLVE BUTTONS — Accept (left of choices) / Decline (right of choices)
   ═══════════════════════════════════════════════════════════════ */

.resolve-btn {
  position: absolute;
  bottom: 110px;
  z-index: 10;
  font-family: var(--f-body);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 3px;
  text-transform: uppercase;
  padding: 18px 20px;
  cursor: pointer;
  border: 1px solid;
  line-height: 1;
  transition: all 0.15s ease,
              left 0.35s cubic-bezier(0.4, 0, 0.2, 1),
              right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.resolve-btn.-accept {
  right: calc(88% + 16px);
  background: transparent;
  color: #4a9;
  border-color: #4a9;
}

.resolve-btn.-accept:not(:disabled):hover {
  background: #4a9;
  color: var(--black);
}

.resolve-btn.-decline {
  left: calc(88% + 16px);
  background: transparent;
  color: var(--defy-red);
  border-color: var(--defy-red);
}

.resolve-btn.-decline:not(:disabled):hover {
  background: var(--defy-red);
  color: var(--warm-white);
}

.resolve-btn.-disabled,
.resolve-btn:disabled {
  opacity: 0.25;
  cursor: not-allowed;
}

/* Push resolve buttons when panels open */
.stage:has(.panel-trigger.-right:hover) .resolve-btn.-decline,
.stage:has(.panel-right:hover) .resolve-btn.-decline {
  left: calc(88% + 16px - 368px);
}
.stage:has(.panel-trigger.-left:hover) .resolve-btn.-accept,
.stage:has(.panel-left:hover) .resolve-btn.-accept {
  right: calc(88% + 16px - 408px);
}

/* ═══════════════════════════════════════════════════════════════
   WELCOME STATE — greeting before pitch starts
   ═══════════════════════════════════════════════════════════════ */

.welcome-cta {
  display: inline-block;
  margin-top: 24px;
  font-family: var(--f-body);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 4px;
  text-transform: uppercase;
  padding: 16px 36px;
  background: var(--defy-red);
  color: var(--warm-white);
  border: none;
  cursor: pointer;
  transition: opacity 0.15s ease;
  line-height: 1;
}

.welcome-cta:hover {
  opacity: 0.85;
}
