/* Scenarios sandbox — grey/blue canvas, one teal CTA per view */

:root {
  --void: #0c1318;
  --obsidian: #1a2530;
  --slate: #2e404f;
  --steel: #4a5d6e;
  --mist: #7a99ab;
  --halo: #b8cdd8;
  --bloom: #e8eef2;
  --teal-core: #00c4a0;
  --teal-glow: #00e5c0;
  --teal-mid: #007a64;
  --teal-deep: #003d33;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: #050507;
  color: #fff;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}

body {
  background:
    radial-gradient(circle at 50% 22%, rgba(122, 153, 171, 0.28), rgba(74, 93, 110, 0.12) 32%, transparent 54%),
    linear-gradient(180deg, #08080c 0%, #060609 44%, #040407 100%);
  background-color: #050507;
}

.hidden {
  display: none !important;
}

.hiw-badge {
  position: fixed;
  top: max(8px, env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  font: 600 11px/1 'Segoe UI', system-ui, sans-serif;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #b8cdd8;
  background: rgba(12, 19, 24, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  padding: 6px 12px;
  backdrop-filter: blur(8px);
  pointer-events: none;
}

.sc-shell {
  position: relative;
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  padding: max(40px, calc(env(safe-area-inset-top) + 28px)) 18px 48px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-height: 100vh;
}

.sc-shell::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.3;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.5), transparent 72%);
}

.sc-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 36px;
}

.sc-wordmark {
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: rgba(255, 255, 255, 0.92);
}

.sc-topbar-btn {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.84);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 7px 12px;
  border-radius: 999px;
  cursor: pointer;
}

.sc-topbar-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.22);
}

.sc-eyebrow {
  margin: 0 0 8px;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(122, 153, 171, 0.92);
}

.sc-title {
  margin: 0;
  font-size: clamp(1.7rem, 6.4vw, 2.3rem);
  line-height: 1.08;
  letter-spacing: -0.04em;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.96);
}

.sc-list-title {
  margin: 4px 0 0;
  font-size: clamp(1.85rem, 7vw, 2.35rem);
  line-height: 1.05;
  letter-spacing: -0.045em;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.96);
}

.sc-shell-list {
  gap: 14px;
}

.sc-subtitle {
  margin: 8px 0 0;
  font-size: 0.96rem;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.62);
  max-width: 42ch;
}

.sc-voice-chip {
  margin: 0;
  max-width: 46vw;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border: 1px solid rgba(229, 160, 0, 0.4);
  background: rgba(229, 160, 0, 0.1);
  color: rgba(255, 220, 160, 0.95);
}

.sc-voice-chip[hidden] {
  display: none !important;
}

.sc-voice-chip.is-ok {
  border-color: rgba(0, 196, 160, 0.35);
  background: rgba(0, 196, 160, 0.1);
  color: rgba(232, 238, 242, 0.92);
}

.sc-voice-chip.is-warn {
  border-color: rgba(229, 160, 0, 0.4);
  background: rgba(229, 160, 0, 0.1);
}

.sc-voice-banner {
  margin: 14px 0 0;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 0.8rem;
  line-height: 1.4;
  color: var(--halo);
  border: 1px solid rgba(122, 153, 171, 0.35);
  background: rgba(74, 93, 110, 0.18);
}

.sc-voice-banner.is-ok {
  border-color: rgba(0, 196, 160, 0.35);
  background: rgba(0, 196, 160, 0.1);
  color: rgba(232, 238, 242, 0.92);
}

.sc-voice-banner.is-warn {
  border-color: rgba(229, 160, 0, 0.35);
  background: rgba(229, 160, 0, 0.08);
}

.sc-cta.sc-cta-secondary {
  margin-top: 10px;
  background: transparent;
  color: var(--halo);
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.sc-cta.sc-cta-secondary:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.sc-cta:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  background: var(--steel);
  color: rgba(255, 255, 255, 0.7);
}


/* List: Continue, then grouped full-width rows. Mobile-first.
   Grey/blue canvas; teal lives on the brief Start, not on every card.
   Hover/focus may lift a quiet teal ring on the one active row. */
.sc-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-top: 2px;
  padding-bottom: max(12px, env(safe-area-inset-bottom));
}

.sc-home-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sc-home-label {
  margin: 0 0 1px 2px;
  font-size: 0.66rem;
  font-weight: 850;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.46);
}

.sc-home-rows {
  display: flex;
  flex-direction: column;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.018));
  overflow: hidden;
}

.sc-home-rows[hidden] {
  display: none !important;
}

.sc-home-row,
.sc-home-continue {
  appearance: none;
  -webkit-appearance: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  font-family: inherit;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  min-height: 64px;
  padding: 13px 14px;
  background: transparent;
  border: 0;
  color: inherit;
  cursor: pointer;
  transition: background-color 0.16s ease;
}

.sc-home-row {
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.sc-home-row:first-child {
  border-top: 0;
}

.sc-home-continue {
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.018));
}

.sc-home-row:hover,
.sc-home-row:focus-visible,
.sc-home-continue:hover,
.sc-home-continue:focus-visible {
  background: rgba(0, 229, 192, 0.07);
  outline: none;
}

.sc-home-row:active,
.sc-home-continue:active {
  background: rgba(0, 229, 192, 0.11);
}

.sc-home-row-text {
  min-width: 0;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.sc-home-row-name {
  font-size: 0.98rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.25;
  color: rgba(255, 255, 255, 0.95);
}

.sc-home-row-desc {
  font-size: 0.82rem;
  line-height: 1.35;
  color: rgba(255, 255, 255, 0.56);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sc-home-row-chev {
  flex: 0 0 auto;
  color: rgba(255, 255, 255, 0.34);
  font-size: 1.25rem;
  line-height: 1;
  transition: color 0.16s ease, transform 0.16s ease;
}

.sc-home-row:hover .sc-home-row-chev,
.sc-home-row:focus-visible .sc-home-row-chev,
.sc-home-continue:hover .sc-home-row-chev,
.sc-home-continue:focus-visible .sc-home-row-chev {
  color: rgba(0, 229, 192, 0.9);
  transform: translateX(2px);
}

.sc-home-more {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: -4px;
}

.sc-home-more-toggle {
  appearance: none;
  -webkit-appearance: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  font-family: inherit;
  width: 100%;
  min-height: 48px;
  padding: 12px 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: transparent;
  border: 0;
  color: var(--mist);
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  cursor: pointer;
}

.sc-home-more-toggle:focus-visible {
  outline: 2px solid var(--teal-glow);
  outline-offset: 2px;
  border-radius: 8px;
}

.sc-home-more-chev {
  font-size: 1.15rem;
  line-height: 1;
  color: rgba(255, 255, 255, 0.34);
  transition: transform 0.16s ease;
}

.sc-home-more-toggle[aria-expanded="true"] .sc-home-more-chev {
  transform: rotate(90deg);
}

.sc-row {
  appearance: none;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
  text-align: left;
  min-height: 64px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.035);
  color: inherit;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.sc-row:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(122, 153, 171, 0.35);
}

.sc-row-rank {
  flex: 0 0 auto;
  width: 28px;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--mist);
  font-variant-numeric: tabular-nums;
}

.sc-row-body {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sc-row-name {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: rgba(255, 255, 255, 0.95);
}

.sc-row-badge {
  display: inline-block;
  margin-left: 6px;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--mist);
  border: 1px solid rgba(122, 153, 171, 0.35);
  border-radius: 999px;
  padding: 2px 7px;
  vertical-align: middle;
}

.sc-row-desc {
  font-size: 0.84rem;
  line-height: 1.35;
  color: rgba(255, 255, 255, 0.55);
}

.sc-row-chev {
  flex: 0 0 auto;
  color: rgba(255, 255, 255, 0.35);
  font-size: 1.35rem;
  line-height: 1;
}

@media (max-width: 380px) {
  .sc-home-row,
  .sc-home-continue {
    min-height: 60px;
    padding: 12px 13px;
  }

  .sc-home-row-name {
    font-size: 0.94rem;
  }

  .sc-home-row-desc {
    font-size: 0.78rem;
  }
}

/* Brief */
.sc-card {
  padding: 16px 16px 14px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.035);
}

.sc-card-label {
  margin: 0 0 8px;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--mist);
}

.sc-card p,
.sc-open-hint {
  margin: 8px 0 0;
  font-size: 0.9rem;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.62);
}

.sc-opens-badge {
  display: inline-block;
  margin-bottom: 8px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--halo);
  border: 1px solid rgba(122, 153, 171, 0.4);
  border-radius: 999px;
  padding: 5px 10px;
}

.sc-steps {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sc-steps li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 0.9rem;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.78);
}

.sc-step-n {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--halo);
  border: 1px solid rgba(122, 153, 171, 0.4);
  background: rgba(74, 93, 110, 0.25);
}

.sc-setup {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.sc-setup-group-label {
  margin: 0 0 8px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--mist);
}

.sc-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.sc-pill {
  appearance: none;
  border: 1px solid rgba(122, 153, 171, 0.35);
  background: rgba(74, 93, 110, 0.22);
  color: rgba(255, 255, 255, 0.9);
  padding: 9px 14px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.sc-pill:hover {
  border-color: rgba(122, 153, 171, 0.55);
  background: rgba(74, 93, 110, 0.32);
}

/* Active setup pills stay neutral — teal is reserved for Start CTA */
.sc-pill.is-active {
  border-color: rgba(184, 205, 216, 0.55);
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-weight: 600;
}

.sc-pill-action {
  font-weight: 600;
}

.sc-cta {
  appearance: none;
  width: 100%;
  margin-top: 4px;
  border: none;
  border-radius: 14px;
  padding: 14px 18px;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  cursor: pointer;
  background: var(--teal-core);
  color: var(--void);
  transition: background 0.15s ease;
}

.sc-cta:hover {
  background: var(--teal-glow);
}

.sc-cta:active {
  background: var(--teal-mid);
}

/* Live */
.sc-live-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.sc-live-meta {
  text-align: right;
}

.sc-phase-chip {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--halo);
  border: 1px solid rgba(122, 153, 171, 0.35);
  border-radius: 999px;
  padding: 5px 10px;
}

.sc-live-hint {
  margin: 4px 0 0;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.5);
}

#sc-voice-visual.kouli-coach-stage {
  min-height: clamp(220px, 42vh, 420px);
  flex: 0 0 auto;
}

.sc-status {
  margin: 0;
  text-align: center;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mist);
}

.sc-line-wrap {
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.035);
  min-height: 88px;
}

.sc-line-role {
  display: block;
  margin-bottom: 8px;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--mist);
}

.sc-line {
  margin: 0;
  font-size: 1.02rem;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.92);
  letter-spacing: -0.015em;
}

.sc-line[data-role='counterpart'] {
  color: rgba(255, 255, 255, 0.88);
}

.sc-live-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sc-end-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}

.sc-end-wrap.hidden {
  display: none !important;
}

.sc-cta.sc-end-cta {
  margin-top: 0;
  width: 100%;
  font-size: 1.05rem;
  padding: 16px 18px;
  letter-spacing: -0.01em;
}

.sc-end-hint {
  margin: 0;
  text-align: center;
  font-size: 0.78rem;
  line-height: 1.35;
  color: rgba(255, 255, 255, 0.48);
}

/* Legacy quiet end (mock) */
.sc-end-btn {
  appearance: none;
  align-self: center;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: transparent;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
}

.sc-end-btn:hover {
  border-color: rgba(255, 255, 255, 0.28);
  color: #fff;
}

.sc-phase-chip[data-phase='briefing'] {
  border-color: rgba(122, 153, 171, 0.45);
}
.sc-phase-chip[data-phase='roleplay'] {
  border-color: rgba(184, 205, 216, 0.55);
  color: #fff;
}
.sc-phase-chip[data-phase='debrief'] {
  border-color: rgba(0, 196, 160, 0.45);
  color: var(--teal-mist);
}

@media (max-width: 420px) {
  .sc-shell {
    padding-left: 14px;
    padding-right: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .kouli-mist-col {
    animation: none !important;
  }

  .sc-home-row,
  .sc-home-row-chev,
  .sc-home-continue,
  .sc-home-more-chev {
    transition: none;
  }

  .sc-home-row:hover .sc-home-row-chev,
  .sc-home-row:focus-visible .sc-home-row-chev,
  .sc-home-continue:hover .sc-home-row-chev,
  .sc-home-continue:focus-visible .sc-home-row-chev {
    transform: none;
  }

  .sc-home-more-toggle[aria-expanded="true"] .sc-home-more-chev {
    transform: rotate(90deg);
  }
}

/* ── Streamlined brief + live (mobile-first) ───────────────────────── */

.sc-brief-hero {
  margin-top: 4px;
}

.sc-setup-flat {
  gap: 16px;
}

.sc-scene {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sc-scene-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.sc-scene-head .sc-setup-group-label {
  margin: 0;
}

.sc-scene-meta {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--mist);
}

.sc-scene-meta[data-state='edited'] {
  color: var(--halo);
}

.sc-scene-meta[data-state='preset'] {
  color: rgba(184, 205, 216, 0.7);
}

.sc-scene-meta[data-state='custom'] {
  color: var(--halo);
}

.sc-scene-hint {
  margin: 0;
  font-size: 0.72rem;
  line-height: 1.35;
  color: var(--mist);
}

#brief-extra-note[hidden] {
  display: none !important;
}

.sc-scene-error {
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.4;
  color: #c0392b;
}

.sc-scene-error[hidden] {
  display: none !important;
}

.sc-objective {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sc-objective[hidden] {
  display: none !important;
}

.sc-pills-objective {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.sc-pills-objective[hidden] {
  display: none !important;
}

.sc-field-objective {
  min-height: 72px;
}

.sc-field-scene {
  min-height: 88px;
  line-height: 1.45;
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.9);
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.04);
  caret-color: var(--teal-core);
}

.sc-field-scene::placeholder {
  color: rgba(122, 153, 171, 0.75);
}

.sc-field-scene.is-editing,
.sc-field-scene:focus {
  border-color: rgba(122, 153, 171, 0.55);
  background: rgba(255, 255, 255, 0.05);
  outline: none;
}

/* Scene presets — horizontal tabs (not pills).
   Must beat global mobile `button { width: 100% }` in index.html, which
   otherwise makes each tab full-bleed so users never see a swipe peek. */
.sc-scene-tabs-wrap {
  position: relative;
  margin: 0 -4px;
}

.sc-scene-tabs-wrap::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  bottom: 1px;
  width: 36px;
  pointer-events: none;
  background: linear-gradient(
    to right,
    rgba(8, 8, 12, 0),
    rgba(8, 8, 12, 0.88)
  );
  opacity: 0;
  transition: opacity 0.2s ease;
}

.sc-scene-tabs-wrap.is-overflowing::after {
  opacity: 1;
}

.sc-scene-tabs-wrap.is-at-end::after {
  opacity: 0;
}

.sc-scene-tabs {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: stretch;
  gap: 0;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x proximity;
  overscroll-behavior-x: contain;
  margin: 0;
  padding: 0 28px 0 4px; /* trailing pad so last tab isn’t under the fade */
  border-bottom: 1px solid rgba(122, 153, 171, 0.22);
  scrollbar-width: none;
}

.sc-scene-tabs::-webkit-scrollbar {
  display: none;
}

button.sc-scene-tab,
.sc-scene-tab {
  appearance: none;
  -webkit-appearance: none;
  flex: 0 0 auto !important;
  width: auto !important;
  max-width: none !important;
  scroll-snap-align: start;
  margin: 0 !important;
  padding: 10px 14px 12px !important;
  min-height: 44px;
  border: none !important;
  border-bottom: 2px solid transparent !important;
  margin-bottom: -1px !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: var(--mist) !important;
  font: inherit !important;
  font-size: 0.88rem !important;
  font-weight: 550 !important;
  letter-spacing: -0.01em !important;
  text-transform: none !important;
  white-space: nowrap;
  box-shadow: none !important;
  transform: none !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 0 !important;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
}

button.sc-scene-tab:hover:not(:disabled),
.sc-scene-tab:hover {
  color: var(--halo) !important;
  background: transparent !important;
  box-shadow: none !important;
  transform: none !important;
}

button.sc-scene-tab.is-active,
.sc-scene-tab.is-active {
  color: #fff !important;
  font-weight: 650 !important;
  border-bottom-color: rgba(184, 205, 216, 0.85) !important;
  background: transparent !important;
}

button.sc-scene-tab-custom,
.sc-scene-tab-custom {
  font-style: italic;
  color: rgba(184, 205, 216, 0.75) !important;
}

button.sc-scene-tab-custom.is-active,
.sc-scene-tab-custom.is-active {
  color: #fff !important;
  font-style: normal;
}

button.sc-scene-tab:focus-visible,
.sc-scene-tab:focus-visible {
  outline: 2px solid var(--teal-glow);
  outline-offset: 2px;
  border-radius: 6px;
}

.sc-pills-personality {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.sc-pills-personality .sc-pill {
  width: 100%;
  box-sizing: border-box;
  text-align: center;
  font-size: 0.78rem;
  padding: 10px 6px;
  border-radius: 12px;
  white-space: normal;
  line-height: 1.2;
  overflow: hidden;
}

.sc-field {
  width: 100%;
  resize: none;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
  font: inherit;
  font-size: 1rem;
  line-height: 1.4;
  padding: 12px 14px;
}

.sc-field:focus {
  outline: none;
  border-color: rgba(0, 196, 160, 0.55);
}

.sc-field::placeholder {
  color: rgba(255, 255, 255, 0.35);
}

.sc-text-link {
  appearance: none;
  border: none;
  background: none;
  color: var(--mist);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 8px;
  cursor: pointer;
  text-align: center;
}

.sc-text-link:hover {
  color: var(--halo);
}

.sc-shell-live {
  gap: 14px;
  padding-bottom: max(28px, env(safe-area-inset-bottom));
}

.sc-shell-live .sc-wordmark {
  font-size: 0.95rem;
  font-weight: 700;
  max-width: 70%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#sc-voice-visual.kouli-coach-stage {
  position: relative;
  min-height: clamp(240px, 46vh, 440px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.sc-live-counterpart {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 4;
  margin: 0;
  max-width: calc(100% - 24px);
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0.02em;
  line-height: 1.2;
  color: var(--halo);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
}

.sc-live-counterpart[hidden] {
  display: none !important;
}

.sc-live-counterpart-sep,
.sc-live-counterpart #live-counterpart-personality {
  color: var(--mist);
  font-weight: 500;
}

.sc-turn {
  position: absolute;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  z-index: 4;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(12, 19, 24, 0.72);
  backdrop-filter: blur(10px);
  pointer-events: none;
}

.sc-turn-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--mist);
}

.sc-turn-label {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--halo);
}

.sc-turn.is-them .sc-turn-dot {
  background: var(--halo);
  box-shadow: 0 0 10px rgba(184, 205, 216, 0.45);
}

.sc-turn.is-you .sc-turn-dot {
  background: var(--teal-core);
  box-shadow: 0 0 10px rgba(0, 196, 160, 0.45);
}

.sc-turn.is-you .sc-turn-label {
  color: #fff;
}

.sc-turn.is-coach .sc-turn-dot {
  background: var(--teal-core);
}

.sc-turn.is-transition {
  border-color: rgba(184, 205, 216, 0.35);
}

.sc-turn-label.is-flashlight,
.sc-line-live.is-flashlight {
  color: rgba(255, 255, 255, 0.74);
  background:
    linear-gradient(
      100deg,
      rgba(255, 255, 255, 0.46) 0%,
      rgba(255, 255, 255, 0.46) 36%,
      rgba(255, 255, 255, 0.98) 46%,
      rgba(216, 231, 255, 1) 50%,
      rgba(255, 255, 255, 0.98) 54%,
      rgba(255, 255, 255, 0.46) 64%,
      rgba(255, 255, 255, 0.46) 100%
    );
  background-size: 240% 100%;
  background-position: 140% 50%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: scLabelFlashlight 2.8s ease-in-out infinite;
}

@keyframes scLabelFlashlight {
  0% {
    background-position: 140% 50%;
  }
  100% {
    background-position: -140% 50%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sc-turn-label.is-flashlight,
  .sc-line-live.is-flashlight {
    animation: none;
    background: none;
    color: var(--halo);
    -webkit-text-fill-color: var(--halo);
  }
}

.sc-line-live {
  min-height: 2.8em;
  text-align: center;
  font-size: 0.98rem;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.78);
  padding: 0 6px;
}

.sc-live-scene {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0 4px;
  text-align: center;
}

.sc-live-scene.hidden {
  display: none;
}

.sc-live-scene-label {
  margin: 0;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--mist);
}

.sc-live-scene-text {
  margin: 0;
  font-size: 0.84rem;
  line-height: 1.4;
  color: rgba(184, 205, 216, 0.78);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.sc-live-scene.is-compact {
  gap: 8px;
}

.sc-live-scene.is-compact #live-scene-text {
  -webkit-line-clamp: 2;
  font-size: 0.88rem;
  color: var(--halo);
}

.sc-live-scene.is-compact #live-objective-text {
  -webkit-line-clamp: 2;
}

.sc-live-progress {
  width: 100%;
  max-width: 280px;
  margin: 2px auto 0;
}

.sc-live-progress[hidden] {
  display: none !important;
}

.sc-live-progress-track {
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.sc-live-progress-fill {
  display: block;
  height: 100%;
  width: 8%;
  border-radius: 999px;
  background: rgba(184, 205, 216, 0.7);
  transition: width 0.55s cubic-bezier(0.4, 0, 0.1, 1);
}

.sc-live-scene-label[hidden],
.sc-live-scene-text[hidden] {
  display: none !important;
}

.sc-line-live:empty {
  min-height: 0;
}

.sc-line-live[data-role='hint'] {
  color: var(--mist);
  font-size: 0.9rem;
}

.sc-debug {
  margin: 0;
  max-height: 140px;
  overflow: auto;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(229, 160, 0, 0.35);
  background: rgba(12, 19, 24, 0.88);
  color: rgba(255, 220, 160, 0.95);
  font: 500 0.65rem/1.35 ui-monospace, SFMono-Regular, Menlo, monospace;
  white-space: pre-wrap;
  word-break: break-word;
}

.sc-debug.hidden {
  display: none !important;
}

.sc-start-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}

.sc-start-label {
  margin: 0;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--mist);
}

.sc-pills-live {
  justify-content: center;
}

.sc-pill-start {
  font-size: 0.8rem;
}

.sc-row-rank {
  display: none;
}

.sc-cta.sc-end-cta {
  /* Live End is the teal moment; keep strong */
  font-size: 1.05rem;
}

/* Self-view — Shadow Interview tile, scoped to Role Play live.
   Grey/blue only; End stays the teal moment. Camera is local. */
.sc-self-view-panel {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sc-self-view-panel.hidden,
.sc-self-view-panel[hidden] {
  display: none !important;
}

.sc-self-view-frame {
  position: relative;
}

.sc-self-view-nudge {
  position: absolute;
  left: 10px;
  bottom: 10px;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 7px;
  max-width: calc(100% - 20px);
  min-height: 28px;
  padding: 6px 10px 6px 8px;
  border-radius: 999px;
  background: rgba(12, 19, 24, 0.72);
  box-shadow: inset 0 0 0 1px rgba(184, 205, 216, 0.18);
  color: var(--halo);
  pointer-events: none;
  opacity: 0;
  transform: translateY(6px) scale(0.96);
  transition: opacity 0.22s ease, transform 0.22s ease, padding 0.2s ease, gap 0.2s ease;
}

.sc-self-view-nudge.is-in {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.sc-self-view-nudge.is-hit {
  transform: translateY(0) scale(1.04);
}

.sc-self-view-nudge[hidden] {
  display: none !important;
}

.sc-self-view-nudge.is-idle {
  padding: 6px;
  gap: 0;
}

.sc-self-view-nudge-arrow {
  display: flex;
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  color: inherit;
}

.sc-self-view-nudge-arrow svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
  transform-origin: 50% 50%;
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

.sc-self-view-nudge.is-landed {
  color: #34c759;
  box-shadow: inset 0 0 0 1px rgba(52, 199, 89, 0.4);
}

.sc-self-view-nudge.is-landed .sc-self-view-nudge-arrow svg {
  transform: rotate(0deg);
}

.sc-self-view-nudge.is-keep {
  color: var(--halo);
  box-shadow: inset 0 0 0 1px rgba(184, 205, 216, 0.28);
}

.sc-self-view-nudge.is-keep .sc-self-view-nudge-arrow svg {
  transform: rotate(90deg);
}

.sc-self-view-nudge.is-losing {
  color: #c0392b;
  box-shadow: inset 0 0 0 1px rgba(192, 57, 43, 0.45);
}

.sc-self-view-nudge.is-losing .sc-self-view-nudge-arrow svg {
  transform: rotate(180deg);
}

.sc-self-view-nudge-label {
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.01em;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  max-width: 220px;
  opacity: 1;
  transition: opacity 0.28s ease, max-width 0.28s ease;
}

.sc-self-view-nudge.is-idle .sc-self-view-nudge-label {
  opacity: 0;
  max-width: 0;
}

.sc-self-view-try {
  margin: 0;
  padding: 0 2px;
  font-size: 0.86rem;
  line-height: 1.4;
  color: var(--halo);
}

.sc-self-view-try[hidden] {
  display: none !important;
}

.sc-self-view-try-k {
  color: var(--mist);
  font-weight: 650;
}

.sc-shell-live.is-self-view #sc-voice-visual.kouli-coach-stage {
  min-height: clamp(160px, 28vh, 280px);
}

.sc-shell-live.is-self-view #live-line,
.sc-shell-live.is-rapport-live #live-line {
  display: none !important;
}

.sc-shell-live.is-rapport-debrief #sc-voice-visual.kouli-coach-stage {
  min-height: clamp(140px, 24vh, 240px);
}

.sc-rapport-metrics {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.sc-rapport-metrics.hidden,
.sc-rapport-metrics[hidden] {
  display: none !important;
}

.sc-rapport-metrics-kicker {
  margin: 0;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--mist);
}

.sc-metric-row {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.sc-metric-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.sc-metric-label {
  font-size: 0.92rem;
  font-weight: 650;
  color: var(--halo);
  letter-spacing: -0.01em;
}

.sc-metric-verdict {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mist);
}

.sc-metric-row.is-focus .sc-metric-label {
  color: #fff;
}

.sc-metric-row.is-focus .sc-metric-verdict {
  color: var(--halo);
}

.sc-metric-track {
  height: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.sc-metric-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: rgba(184, 205, 216, 0.55);
  transition: width 0.55s cubic-bezier(0.4, 0, 0.1, 1);
}

.sc-metric-row.is-focus .sc-metric-fill {
  background: rgba(184, 205, 216, 0.88);
}

.sc-metric-row.is-loading .sc-metric-fill {
  width: 18% !important;
  opacity: 0.45;
}

.sc-metric-note {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.35;
  color: var(--mist);
}

.sc-metric-row.is-presence {
  margin-top: 6px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.sc-metric-empty {
  margin: 0;
  font-size: 0.86rem;
  line-height: 1.4;
  color: var(--mist);
}

.sc-result-outcome {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-bottom: 4px;
}

.sc-result-outcome-kicker {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--mist);
}

.sc-result-outcome-label {
  font-size: 1.35rem;
  font-weight: 650;
  letter-spacing: -0.02em;
  color: #fff;
  line-height: 1.15;
}

.sc-result-outcome.is-loading .sc-result-outcome-label {
  color: var(--mist);
}

.sc-improve {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 22px;
}

.sc-improve-line {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.4;
  color: var(--halo);
}

.sc-improve-k {
  color: var(--mist);
  font-weight: 650;
}

.sc-cta.sc-try-again {
  width: 100%;
  margin-top: 22px;
}

button.sc-self-view,
.sc-self-view {
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  display: block !important;
  width: 100% !important;
  min-height: 240px;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 16px !important;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 26%, rgba(255, 255, 255, 0.09), transparent 45%),
    rgba(255, 255, 255, 0.06) !important;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.08),
    inset 0 -16px 28px rgba(6, 6, 15, 0.35) !important;
  color: rgba(255, 255, 255, 0.78) !important;
  cursor: pointer;
  transform: none !important;
}

button.sc-self-view:hover,
.sc-self-view:hover {
  background:
    radial-gradient(circle at 50% 26%, rgba(255, 255, 255, 0.11), transparent 45%),
    rgba(255, 255, 255, 0.075) !important;
  box-shadow:
    inset 0 0 0 1px rgba(184, 205, 216, 0.22),
    inset 0 -16px 28px rgba(6, 6, 15, 0.35) !important;
}

button.sc-self-view.is-on,
.sc-self-view.is-on {
  box-shadow:
    inset 0 0 0 1px rgba(184, 205, 216, 0.28),
    0 0 0 1px rgba(184, 205, 216, 0.1) !important;
}

button.sc-self-view:focus-visible,
.sc-self-view:focus-visible {
  outline: 2px solid var(--teal-glow);
  outline-offset: 2px;
}

.sc-self-view-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1) scale(1.05);
  filter: brightness(1.16) contrast(0.96) saturate(1.04) blur(0.85px);
  opacity: 0;
  transition: opacity 0.18s ease;
}

.sc-self-view.is-on .sc-self-view-video {
  opacity: 1;
}

.sc-self-view-veil {
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  opacity: 0;
  background:
    radial-gradient(ellipse 90% 62% at 50% 12%, rgba(255, 236, 214, 0.32), transparent 62%),
    radial-gradient(ellipse 80% 50% at 18% 30%, rgba(255, 248, 236, 0.12), transparent 55%),
    radial-gradient(ellipse 95% 72% at 50% 108%, rgba(12, 19, 24, 0.38), transparent 58%);
}

.sc-self-view.is-on .sc-self-view-veil {
  opacity: 1;
}

.sc-self-view-guide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  stroke: rgba(255, 255, 255, 0.12);
  stroke-width: 0.4;
  fill: none;
  mix-blend-mode: screen;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.18s ease;
}

.sc-self-view.is-on .sc-self-view-guide {
  opacity: 1;
}

.sc-self-view-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  pointer-events: none;
  transition: opacity 0.18s ease;
}

.sc-self-view.is-on .sc-self-view-placeholder {
  opacity: 0;
}

.sc-self-view-label {
  font-size: 0.95rem;
  font-weight: 650;
  color: var(--halo);
}

.sc-self-view-hint {
  font-size: 0.78rem;
  color: var(--mist);
}

@media (max-width: 390px) {
  button.sc-self-view,
  .sc-self-view {
    min-height: 200px;
  }
}

@media (max-width: 600px) and (max-height: 700px) {
  .sc-shell-live.is-self-view #sc-voice-visual.kouli-coach-stage {
    min-height: clamp(140px, 24vh, 220px);
  }

  button.sc-self-view,
  .sc-self-view {
    min-height: 180px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sc-self-view-video {
    transform: scaleX(-1);
    filter: brightness(1.14) contrast(0.98) saturate(1.04);
  }
}
