:root {
  color-scheme: dark;
  --page: #08090d;
  --surface: #101118;
  --surface-high: #161821;
  --surface-soft: #1b1d27;
  --line: rgba(255, 255, 255, 0.1);
  --line-strong: rgba(255, 255, 255, 0.18);
  --text: #f6f3ec;
  --muted: #9d9ca7;
  --quiet: #696a75;
  --mint: #75f3d1;
  --mint-deep: #1fbf9f;
  --rose: #ff718d;
  --amber: #f3cb72;
  --violet: #a88bff;
  --blue: #68b9ff;
  --shadow: 0 22px 70px rgba(0, 0, 0, 0.36);
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 13px;
  --font: "Segoe UI Variable", "Segoe UI", Inter, system-ui, -apple-system,
    BlinkMacSystemFont, sans-serif;
  --mono: "Cascadia Code", "SFMono-Regular", Consolas, monospace;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--page);
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  font-family: var(--font);
  background:
    radial-gradient(circle at 13% -8%, rgba(104, 185, 255, 0.12), transparent 27rem),
    radial-gradient(circle at 94% 4%, rgba(255, 113, 141, 0.11), transparent 25rem),
    linear-gradient(180deg, #0a0b11 0%, var(--page) 45%);
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 3px solid rgba(117, 243, 209, 0.72);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 10px;
  left: 10px;
  padding: 10px 14px;
  color: #06100d;
  background: var(--mint);
  border-radius: 10px;
  transform: translateY(-160%);
  transition: transform 160ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.app-header {
  position: sticky;
  z-index: 40;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 76px;
  padding: 12px clamp(18px, 3.2vw, 50px);
  border-bottom: 1px solid var(--line);
  background: rgba(8, 9, 13, 0.82);
  backdrop-filter: blur(22px) saturate(130%);
}

.brand-lockup,
.header-actions,
.brand-mark,
.runtime-badge,
.view-switch,
.transport,
.timeline-heading,
.timeline-legend,
.panel-heading,
.activity-title-block,
.app-footer {
  display: flex;
  align-items: center;
}

.brand-lockup {
  gap: 12px;
}

.brand-mark {
  position: relative;
  width: 39px;
  height: 39px;
  justify-content: center;
  gap: 3px;
  overflow: hidden;
  border: 1px solid rgba(117, 243, 209, 0.36);
  border-radius: 12px;
  background: linear-gradient(145deg, rgba(117, 243, 209, 0.18), rgba(104, 185, 255, 0.04));
  box-shadow: inset 0 0 24px rgba(117, 243, 209, 0.06);
}

.brand-mark::after {
  position: absolute;
  content: "";
  width: 22px;
  height: 1px;
  background: rgba(117, 243, 209, 0.3);
  transform: rotate(-24deg);
}

.brand-mark span {
  width: 3px;
  border-radius: 8px;
  background: var(--mint);
  box-shadow: 0 0 12px rgba(117, 243, 209, 0.55);
}

.brand-mark span:nth-child(1) {
  height: 11px;
}

.brand-mark span:nth-child(2) {
  height: 23px;
}

.brand-mark span:nth-child(3) {
  height: 16px;
}

.brand-name {
  font-size: 18px;
  font-weight: 740;
  letter-spacing: -0.02em;
}

.brand-tagline {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.02em;
}

.header-actions {
  gap: 9px;
}

.runtime-badge {
  min-height: 36px;
  gap: 8px;
  padding: 7px 11px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.025);
}

.runtime-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 10px rgba(243, 203, 114, 0.46);
}

.runtime-badge[data-state="ready"] .runtime-dot {
  background: var(--mint);
  box-shadow: 0 0 12px rgba(117, 243, 209, 0.68);
}

.runtime-badge[data-state="fallback"] .runtime-dot,
.runtime-badge[data-state="error"] .runtime-dot {
  background: var(--rose);
  box-shadow: 0 0 11px rgba(255, 113, 141, 0.55);
}

.button {
  min-height: 38px;
  padding: 9px 13px;
  cursor: pointer;
  border: 1px solid transparent;
  border-radius: 11px;
  font-size: 12px;
  font-weight: 680;
  transition:
    transform 150ms ease,
    border-color 150ms ease,
    background 150ms ease,
    opacity 150ms ease;
}

.button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.button:active:not(:disabled) {
  transform: translateY(0);
}

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

.button-quiet {
  color: #c9c7ce;
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.025);
}

.button-quiet:hover:not(:disabled) {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.06);
}

.button-primary {
  color: #06110e;
  border-color: rgba(117, 243, 209, 0.7);
  background: var(--mint);
  box-shadow: 0 10px 28px rgba(31, 191, 159, 0.16);
}

.button-danger {
  color: #ffd9df;
  border-color: rgba(255, 113, 141, 0.35);
  background: rgba(255, 113, 141, 0.12);
}

.button-wide {
  width: 100%;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(330px, 400px);
  gap: clamp(18px, 2.2vw, 32px);
  max-width: 1600px;
  margin: 0 auto;
  padding: clamp(26px, 3.5vw, 54px) clamp(18px, 3.2vw, 50px) 32px;
}

.rehearsal-column,
.intelligence-column {
  min-width: 0;
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.eyebrow {
  margin: 0 0 7px;
  color: var(--mint);
  font-size: 10px;
  font-weight: 760;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 720px;
  margin-bottom: 0;
  font-size: clamp(24px, 3.2vw, 43px);
  font-weight: 580;
  letter-spacing: -0.045em;
  line-height: 1.03;
}

h2 {
  margin-bottom: 0;
  font-size: 18px;
  letter-spacing: -0.025em;
}

h3 {
  margin-bottom: 0;
  font-size: 14px;
  letter-spacing: -0.015em;
}

.revision-pill {
  min-width: 70px;
  padding: 9px 11px;
  color: var(--muted);
  text-align: center;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.025);
}

.revision-pill span {
  display: block;
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.revision-pill strong {
  display: block;
  margin-top: 2px;
  color: var(--text);
  font-family: var(--mono);
  font-size: 17px;
}

.stage-card,
.timeline-card,
.intent-card,
.intelligence-column,
.activity-rail {
  border: 1px solid var(--line);
  background: rgba(16, 17, 24, 0.82);
  box-shadow: var(--shadow);
}

.stage-card {
  overflow: hidden;
  border-radius: var(--radius-xl);
}

.stage-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 50px;
  padding: 8px 12px 8px 17px;
  border-bottom: 1px solid var(--line);
}

.live-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.live-indicator span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--rose);
  box-shadow: 0 0 12px rgba(255, 113, 141, 0.62);
}

.view-switch {
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #0c0d12;
}

.view-option {
  padding: 6px 10px;
  cursor: pointer;
  color: var(--muted);
  border: 0;
  border-radius: 7px;
  background: transparent;
  font-size: 10px;
  font-weight: 680;
}

.view-option.is-active {
  color: var(--text);
  background: var(--surface-soft);
}

.view-option:disabled {
  cursor: not-allowed;
  opacity: 0.36;
}

.stage-scene {
  position: relative;
  isolation: isolate;
  aspect-ratio: 16 / 8.65;
  min-height: 310px;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 26% 80%, rgba(104, 185, 255, 0.2), transparent 27%),
    radial-gradient(ellipse at 73% 79%, rgba(255, 113, 141, 0.16), transparent 26%),
    linear-gradient(180deg, #101428 0%, #11111a 54%, #09090d 100%);
}

.stage-scene::before {
  position: absolute;
  z-index: -2;
  inset: 64% -5% -20%;
  content: "";
  background:
    repeating-linear-gradient(90deg, transparent 0 9%, rgba(255, 255, 255, 0.03) 9% 9.2%),
    linear-gradient(180deg, #1d1c25, #08090c 54%);
  transform: perspective(520px) rotateX(58deg);
  transform-origin: top;
}

.stage-grain {
  position: absolute;
  z-index: 8;
  inset: 0;
  pointer-events: none;
  opacity: 0.16;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.2'/%3E%3C/svg%3E");
  mix-blend-mode: soft-light;
}

.stage-arch {
  position: absolute;
  z-index: -1;
  top: -28%;
  left: 50%;
  width: 84%;
  height: 110%;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 50% 50% 8px 8px;
  transform: translateX(-50%);
  box-shadow:
    inset 0 0 0 13px rgba(0, 0, 0, 0.12),
    0 0 70px rgba(104, 185, 255, 0.04);
}

.projection-title {
  position: absolute;
  top: 11%;
  left: 50%;
  padding: 8px 15px;
  color: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.17);
  background: rgba(12, 14, 24, 0.54);
  box-shadow: 0 0 28px rgba(168, 139, 255, 0.15);
  font-family: var(--mono);
  font-size: clamp(9px, 1.1vw, 13px);
  letter-spacing: 0.22em;
  opacity: 0;
  transform: translateX(-50%) translateY(-8px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.projection-title.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.spotlight {
  position: absolute;
  top: -18%;
  width: 34%;
  height: 104%;
  clip-path: polygon(42% 0, 58% 0, 100% 100%, 0 100%);
  filter: blur(10px);
  opacity: 0.33;
}

.spotlight-mara {
  left: 7%;
  background: linear-gradient(180deg, rgba(104, 185, 255, 0.26), rgba(104, 185, 255, 0.015));
}

.spotlight-jon {
  right: 7%;
  background: linear-gradient(180deg, rgba(255, 113, 141, 0.22), rgba(255, 113, 141, 0.015));
}

.actor {
  position: absolute;
  bottom: 13%;
  width: 82px;
  height: 142px;
  opacity: 0.68;
  transition: opacity 170ms ease, transform 170ms ease, filter 170ms ease;
}

.actor-mara {
  left: 25%;
}

.actor-jon {
  right: 25%;
}

.actor.is-speaking {
  filter: drop-shadow(0 0 25px rgba(255, 255, 255, 0.12));
  opacity: 1;
  transform: translateY(-3px);
}

.actor-head {
  width: 38px;
  height: 43px;
  margin: 0 auto -4px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 46% 54% 47% 53%;
  background: linear-gradient(145deg, #252735, #11121a);
}

.actor-body {
  width: 76px;
  height: 94px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 48% 48% 17% 17%;
  background: linear-gradient(145deg, #252735, #0d0e15 72%);
  clip-path: polygon(28% 0, 72% 0, 100% 100%, 0 100%);
}

.actor-mara .actor-body {
  box-shadow: inset 18px 0 30px rgba(104, 185, 255, 0.1);
}

.actor-jon .actor-body {
  box-shadow: inset -18px 0 30px rgba(255, 113, 141, 0.08);
}

.actor > span {
  display: block;
  margin-top: 8px;
  color: rgba(255, 255, 255, 0.48);
  text-align: center;
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.18em;
}

.beat-now {
  position: absolute;
  z-index: 12;
  top: 18px;
  left: 18px;
  align-items: center;
  gap: 7px;
  padding: 7px 10px;
  color: #fff1cb;
  border: 1px solid rgba(243, 203, 114, 0.32);
  border-radius: 999px;
  background: rgba(58, 44, 12, 0.5);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.beat-now:not([hidden]) {
  display: flex;
}

.caption-overlay {
  position: absolute;
  z-index: 10;
  left: 50%;
  width: min(78%, 670px);
  padding: 12px 18px 13px;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 10px;
  background: rgba(4, 5, 9, 0.88);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.42);
  transform: translateX(-50%);
  transition: top 180ms ease, bottom 180ms ease, opacity 120ms ease;
}

.caption-overlay.position-bottom,
.caption-overlay.position-lower-left {
  bottom: 6.5%;
  top: auto;
}

.caption-overlay.position-lower-left {
  left: 4%;
  width: min(58%, 510px);
  text-align: left;
  transform: none;
}

.caption-overlay.position-top {
  top: 9%;
  bottom: auto;
}

.caption-speaker {
  margin-bottom: 4px;
  color: var(--mint);
  font-size: 9px;
  font-weight: 760;
  letter-spacing: 0.14em;
}

.caption-text {
  font-size: clamp(14px, 1.75vw, 22px);
  font-weight: 590;
  line-height: 1.25;
  text-wrap: balance;
}

.stage-corner {
  position: absolute;
  z-index: 9;
  bottom: 13px;
  color: rgba(255, 255, 255, 0.32);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.1em;
}

.stage-corner-left {
  left: 15px;
}

.stage-corner-right {
  right: 15px;
}

.transport {
  min-height: 56px;
  gap: 12px;
  padding: 9px 15px;
  border-top: 1px solid var(--line);
}

.play-button,
.speed-button {
  display: grid;
  flex: 0 0 auto;
  cursor: pointer;
  place-items: center;
  border: 1px solid var(--line-strong);
  background: var(--surface-high);
}

.play-button {
  width: 34px;
  height: 34px;
  padding-left: 2px;
  border-radius: 50%;
  font-size: 11px;
}

.speed-button {
  width: 37px;
  height: 29px;
  border-radius: 9px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
}

.timecode {
  flex: 0 0 auto;
  font-family: var(--mono);
  font-size: 10px;
}

.timecode-muted {
  color: var(--quiet);
}

.scrubber-label {
  display: flex;
  flex: 1 1 auto;
}

input[type="range"] {
  width: 100%;
  height: 4px;
  cursor: pointer;
  appearance: none;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--mint) var(--scrub, 0%), #2a2c37 var(--scrub, 0%));
}

input[type="range"]::-webkit-slider-thumb {
  width: 13px;
  height: 13px;
  appearance: none;
  border: 3px solid var(--page);
  border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 0 0 1px rgba(117, 243, 209, 0.42);
}

.timeline-card,
.intent-card {
  position: relative;
  margin-top: 17px;
  border-radius: var(--radius-lg);
}

.timeline-card {
  overflow: hidden;
  padding: 17px;
}

.timeline-heading {
  justify-content: space-between;
  gap: 15px;
  margin-bottom: 14px;
}

.timeline-legend {
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 12px;
  color: var(--muted);
  font-size: 9px;
}

.timeline-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.timeline-legend i {
  display: inline-block;
  width: 9px;
  height: 7px;
  border-radius: 2px;
}

.legend-cue {
  background: var(--blue);
}

.legend-error {
  background: var(--rose);
}

.legend-lock {
  background: var(--amber);
}

.timeline {
  position: relative;
  height: 122px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background:
    repeating-linear-gradient(90deg, transparent 0 calc(12.5% - 1px), rgba(255, 255, 255, 0.055) calc(12.5% - 1px) 12.5%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.025), transparent);
}

.timeline::before,
.timeline::after {
  position: absolute;
  z-index: 1;
  left: 10px;
  color: var(--quiet);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.1em;
}

.timeline::before {
  top: 10px;
  content: "CAPTIONS";
}

.timeline::after {
  bottom: 9px;
  content: "BEATS";
}

.cue-block,
.beat-block {
  position: absolute;
  border-radius: 5px;
}

.cue-block {
  z-index: 4;
  top: 31px;
  min-width: 3px;
  height: 35px;
  overflow: hidden;
  color: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(104, 185, 255, 0.28);
  background: linear-gradient(180deg, rgba(104, 185, 255, 0.34), rgba(104, 185, 255, 0.16));
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.08);
}

.cue-block span {
  display: block;
  overflow: hidden;
  padding: 6px 6px 0;
  font-family: var(--mono);
  font-size: 7px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cue-block.has-error {
  border-color: rgba(255, 113, 141, 0.72);
  background: linear-gradient(180deg, rgba(255, 113, 141, 0.46), rgba(255, 113, 141, 0.2));
  box-shadow: 0 0 18px rgba(255, 113, 141, 0.1);
}

.cue-block.is-clean {
  border-color: rgba(117, 243, 209, 0.46);
  background: linear-gradient(180deg, rgba(117, 243, 209, 0.32), rgba(117, 243, 209, 0.13));
}

.cue-error-count {
  position: absolute;
  z-index: 7;
  top: -6px;
  right: -3px;
  display: grid;
  width: 15px;
  height: 15px;
  place-items: center;
  color: white;
  border: 2px solid var(--surface);
  border-radius: 50%;
  background: var(--rose);
  font-family: var(--mono);
  font-size: 7px;
  font-style: normal;
}

.beat-block {
  z-index: 3;
  bottom: 19px;
  height: 20px;
  border: 1px solid rgba(243, 203, 114, 0.38);
  background: repeating-linear-gradient(135deg, rgba(243, 203, 114, 0.26) 0 4px, rgba(243, 203, 114, 0.09) 4px 8px);
}

.beat-block.is-optional {
  border-color: rgba(255, 255, 255, 0.2);
  background: repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.11) 0 4px, rgba(255, 255, 255, 0.03) 4px 8px);
}

.timeline-tick {
  position: absolute;
  z-index: 2;
  bottom: 3px;
  color: var(--quiet);
  font-family: var(--mono);
  font-size: 7px;
  transform: translateX(-50%);
}

.playhead {
  position: absolute;
  z-index: 12;
  top: 66px;
  bottom: 17px;
  left: 17px;
  width: 1px;
  pointer-events: none;
  background: var(--mint);
  box-shadow: 0 0 12px rgba(117, 243, 209, 0.75);
  transform: translateX(0);
}

.playhead::before {
  position: absolute;
  top: -3px;
  left: -3px;
  width: 7px;
  height: 7px;
  content: "";
  border-radius: 50%;
  background: var(--mint);
}

.intent-card {
  display: grid;
  grid-template-columns: minmax(210px, 0.8fr) minmax(330px, 1.2fr);
  gap: 22px;
  padding: 20px;
}

.intent-card p:not(.eyebrow) {
  max-width: 510px;
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.beat-controls {
  display: grid;
  gap: 8px;
}

.beat-control {
  display: grid;
  grid-template-columns: 32px 1fr auto;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 7px 9px;
  cursor: pointer;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.02);
}

.beat-control:hover {
  border-color: var(--line-strong);
}

.beat-lock-icon {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  color: var(--quiet);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.04);
}

.beat-control.is-locked .beat-lock-icon {
  color: #3e2d04;
  background: var(--amber);
}

.beat-copy strong,
.beat-copy small {
  display: block;
}

.beat-copy strong {
  font-size: 11px;
}

.beat-copy small {
  overflow: hidden;
  margin-top: 2px;
  color: var(--muted);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.beat-state {
  color: var(--quiet);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.08em;
}

.beat-control.is-locked .beat-state {
  color: var(--amber);
}

.intelligence-column {
  position: sticky;
  top: 100px;
  align-self: start;
  max-height: calc(100vh - 122px);
  overflow: auto;
  padding: 19px;
  border-radius: var(--radius-xl);
  scrollbar-width: thin;
  scrollbar-color: var(--surface-soft) transparent;
}

.intelligence-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 15px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.phase-badge,
.count-badge,
.proposal-status,
.step-count {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.phase-badge {
  padding: 7px 9px;
  color: var(--rose);
  border: 1px solid rgba(255, 113, 141, 0.25);
  border-radius: 9px;
  background: rgba(255, 113, 141, 0.08);
}

.phase-badge[data-phase="committed"] {
  color: var(--mint);
  border-color: rgba(117, 243, 209, 0.25);
  background: rgba(117, 243, 209, 0.08);
}

.phase-badge[data-phase="approved"],
.phase-badge[data-phase="proposed"] {
  color: var(--blue);
  border-color: rgba(104, 185, 255, 0.25);
  background: rgba(104, 185, 255, 0.08);
}

.phase-badge[data-phase="stale"] {
  color: var(--amber);
  border-color: rgba(243, 203, 114, 0.25);
  background: rgba(243, 203, 114, 0.08);
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin: 15px 0;
}

.metric {
  min-height: 92px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.024);
}

.metric-primary {
  background: linear-gradient(145deg, rgba(255, 113, 141, 0.11), rgba(255, 255, 255, 0.02));
}

.metric-label,
.metric-note {
  display: block;
}

.metric-label {
  color: var(--muted);
  font-size: 9px;
}

.metric strong {
  display: block;
  margin: 6px 0 4px;
  font-family: var(--mono);
  font-size: 23px;
  font-weight: 650;
}

.metric strong small {
  color: var(--muted);
  font-size: 9px;
  font-weight: 500;
}

.metric-note {
  color: var(--quiet);
  font-size: 8px;
}

.action-panel,
.issues-panel,
.proposal-panel {
  margin-top: 11px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.02);
}

.action-panel {
  border-color: rgba(117, 243, 209, 0.18);
  background: linear-gradient(145deg, rgba(117, 243, 209, 0.055), rgba(255, 255, 255, 0.018));
}

.panel-heading {
  justify-content: space-between;
  gap: 10px;
}

.panel-heading.compact {
  margin-bottom: 11px;
}

.step-count {
  color: var(--mint);
}

.action-copy {
  margin: 10px 0 13px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.action-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.count-badge,
.proposal-status {
  color: var(--muted);
}

.issue-list {
  display: grid;
  max-height: 226px;
  gap: 6px;
  overflow: auto;
}

.issue-item {
  display: grid;
  grid-template-columns: 25px 1fr;
  gap: 9px;
  padding: 8px;
  border: 1px solid rgba(255, 113, 141, 0.12);
  border-radius: 10px;
  background: rgba(255, 113, 141, 0.045);
}

.issue-index {
  display: grid;
  width: 23px;
  height: 23px;
  place-items: center;
  color: #ffd6dd;
  border-radius: 7px;
  background: rgba(255, 113, 141, 0.14);
  font-family: var(--mono);
  font-size: 8px;
}

.issue-type {
  display: block;
  margin-bottom: 2px;
  color: var(--rose);
  font-size: 8px;
  font-weight: 740;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.issue-message {
  margin: 0;
  color: #c8c5cc;
  font-size: 9px;
  line-height: 1.4;
}

.clean-state {
  padding: 17px 10px;
  color: var(--mint);
  text-align: center;
  font-size: 11px;
}

.clean-state strong,
.clean-state span {
  display: block;
}

.clean-state strong {
  margin: 7px 0 3px;
}

.clean-state span {
  color: var(--muted);
  font-size: 9px;
}

.empty-state {
  padding: 18px 8px;
  color: var(--quiet);
  text-align: center;
}

.empty-state > span {
  font-size: 25px;
}

.empty-state p {
  max-width: 240px;
  margin: 7px auto 0;
  font-size: 10px;
  line-height: 1.45;
}

.stale-card {
  padding: 11px;
  color: #efdba9;
  border: 1px solid rgba(243, 203, 114, 0.21);
  border-radius: 11px;
  background: rgba(243, 203, 114, 0.07);
}

.stale-card strong,
.stale-card span {
  display: block;
}

.stale-card strong {
  font-size: 11px;
}

.stale-card span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.4;
}

.plan-list {
  display: grid;
  gap: 7px;
}

.plan-card {
  position: relative;
  padding: 10px;
  cursor: pointer;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.02);
}

.plan-card:hover {
  border-color: rgba(104, 185, 255, 0.32);
}

.plan-card.is-selected {
  border-color: rgba(117, 243, 209, 0.46);
  background: rgba(117, 243, 209, 0.07);
}

.plan-card.is-committed {
  cursor: default;
}

.plan-card.is-committed:hover {
  border-color: rgba(117, 243, 209, 0.46);
}

.plan-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 9px;
}

.plan-title-row strong {
  font-size: 10px;
}

.plan-id {
  color: var(--quiet);
  font-family: var(--mono);
  font-size: 7px;
}

.plan-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 8px;
}

.plan-metrics span {
  padding: 4px 6px;
  color: var(--muted);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.045);
  font-family: var(--mono);
  font-size: 7px;
}

.plan-committed-label {
  margin-top: 8px;
  color: var(--mint);
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.proposal-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 9px 0;
  color: var(--muted);
  font-size: 8px;
}

.proposal-summary strong {
  color: var(--text);
  font-family: var(--mono);
}

.approval-strip,
.receipt-card {
  margin-top: 9px;
  padding: 10px;
  border-radius: 10px;
}

.approval-strip {
  color: #d9fdf2;
  border: 1px solid rgba(117, 243, 209, 0.25);
  background: rgba(117, 243, 209, 0.075);
  font-size: 9px;
}

.approval-strip code,
.receipt-card code {
  font-family: var(--mono);
}

.receipt-card {
  border: 1px solid rgba(117, 243, 209, 0.2);
  background: linear-gradient(145deg, rgba(117, 243, 209, 0.08), rgba(104, 185, 255, 0.035));
}

.receipt-card strong,
.receipt-card span {
  display: block;
}

.receipt-card strong {
  color: var(--mint);
  font-size: 11px;
}

.receipt-card span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 8px;
  line-height: 1.45;
}

.profile-note {
  display: grid;
  grid-template-columns: 26px 1fr;
  gap: 9px;
  margin-top: 12px;
  padding: 11px;
  color: var(--muted);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.025);
}

.profile-icon {
  display: grid;
  width: 23px;
  height: 23px;
  place-items: center;
  color: var(--blue);
  border: 1px solid rgba(104, 185, 255, 0.24);
  border-radius: 50%;
  font-family: var(--mono);
  font-size: 10px;
}

.profile-note strong {
  display: block;
  color: #d2cfd7;
  font-size: 9px;
}

.profile-note p {
  margin: 3px 0 0;
  font-size: 8px;
  line-height: 1.45;
}

.activity-rail {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr) minmax(230px, auto);
  align-items: center;
  gap: 18px;
  max-width: calc(1600px - clamp(36px, 6.4vw, 100px));
  min-height: 94px;
  margin: 0 auto 24px;
  padding: 15px 18px;
  border-radius: var(--radius-lg);
}

.activity-title-block {
  gap: 10px;
}

.activity-pulse {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 0 0 5px rgba(117, 243, 209, 0.07), 0 0 18px rgba(117, 243, 209, 0.4);
}

.activity-title-block h2 {
  font-size: 13px;
}

.activity-list {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  scrollbar-width: none;
}

.activity-list::-webkit-scrollbar {
  display: none;
}

.activity-item {
  flex: 0 0 auto;
  min-width: 185px;
  max-width: 245px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
}

.activity-actor {
  display: block;
  margin-bottom: 4px;
  color: var(--blue);
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.08em;
}

.activity-item[data-actor="HUMAN"] .activity-actor {
  color: var(--amber);
}

.activity-item[data-actor="SYSTEM"] .activity-actor {
  color: var(--muted);
}

.activity-item strong,
.activity-item span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.activity-item strong {
  font-size: 9px;
}

.activity-item span:not(.activity-actor) {
  margin-top: 3px;
  color: var(--quiet);
  font-size: 8px;
}

.tool-inventory {
  display: flex;
  max-width: 360px;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 4px;
}

.tool-chip {
  padding: 4px 6px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.025);
  font-family: var(--mono);
  font-size: 6.5px;
}

.app-footer {
  justify-content: space-between;
  gap: 20px;
  max-width: 1600px;
  margin: 0 auto;
  padding: 0 clamp(18px, 3.2vw, 50px) 32px;
  color: var(--quiet);
  font-size: 9px;
}

.app-footer p {
  margin: 0;
}

.app-footer a {
  color: var(--muted);
  text-decoration: none;
}

.app-footer a:hover {
  color: var(--mint);
}

.toast {
  position: fixed;
  z-index: 80;
  right: 22px;
  bottom: 22px;
  max-width: 370px;
  padding: 11px 14px;
  color: var(--text);
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  background: rgba(22, 24, 33, 0.96);
  box-shadow: var(--shadow);
  font-size: 10px;
  line-height: 1.45;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.toast.is-error {
  border-color: rgba(255, 113, 141, 0.4);
}

@media (max-width: 1080px) {
  .workspace {
    grid-template-columns: minmax(0, 1fr) 340px;
  }

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

  .activity-rail {
    grid-template-columns: 150px 1fr;
  }

  .tool-inventory {
    display: none;
  }
}

@media (max-width: 860px) {
  .app-header {
    position: static;
  }

  .brand-tagline,
  .runtime-badge,
  #copy-prompt-button {
    display: none;
  }

  .workspace {
    grid-template-columns: 1fr;
  }

  .intelligence-column {
    position: static;
    max-height: none;
  }

  .stage-scene {
    min-height: 280px;
  }
}

@media (max-width: 560px) {
  .app-header,
  .workspace,
  .app-footer {
    padding-right: 14px;
    padding-left: 14px;
  }

  .workspace {
    padding-top: 24px;
  }

  .section-heading {
    align-items: flex-start;
  }

  h1 {
    font-size: 27px;
  }

  .stage-scene {
    min-height: 255px;
    aspect-ratio: 1.25;
  }

  .actor-mara {
    left: 17%;
  }

  .actor-jon {
    right: 17%;
  }

  .caption-overlay {
    width: 90%;
  }

  .timecode-muted,
  .timeline-legend {
    display: none;
  }

  .metric-grid {
    grid-template-columns: 1fr 1fr;
  }

  .activity-rail {
    grid-template-columns: 1fr;
    margin-right: 14px;
    margin-left: 14px;
  }

  .app-footer {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
