:root {
  color-scheme: light;
  --blue-midnight: #01232c;
  --brand-green: #00c57b;
  --dark-green: #009960;
  --extra-light-green: #f0fdf7;
  --grey-600: #4e4e4e;
  --grey-500: #949899;
  --grey-400: #c6cbcc;
  --grey-300: #e1e5e5;
  --grey-200: #edf1f2;
  --grey-100: #f8f9fa;
  --warning: #ffcb45;
  --warning-dark: #bf6800;
  --danger: #ff1f1f;
  --surface: #ffffff;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  --tap: 44px;
  font-family: "Spline Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  overscroll-behavior: none;
  background: var(--grey-100);
  color: var(--blue-midnight);
  font-family: "Spline Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

[hidden] {
  display: none !important;
}

button {
  min-height: var(--tap);
  border: 0;
  border-radius: 100px;
  color: inherit;
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  line-height: 24px;
  letter-spacing: 0;
  cursor: pointer;
}

button:active {
  transform: translateY(1px);
}

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

.app-shell {
  width: 100%;
  max-width: 600px;
  height: 100dvh;
  margin: 0 auto;
  overflow: hidden;
  background: var(--grey-100);
}

.app-view {
  position: relative;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  background: var(--grey-100);
}

.brand-header {
  min-width: 0;
  min-height: calc(64px + env(safe-area-inset-top));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: calc(14px + env(safe-area-inset-top))
    max(20px, env(safe-area-inset-right)) 14px
    max(20px, env(safe-area-inset-left));
  background: var(--surface);
  border-bottom: 1px solid var(--grey-300);
  flex-shrink: 0;
  user-select: none;
  -webkit-user-select: none;
}

.brand-header img {
  display: block;
  width: auto;
  max-width: min(56%, 280px);
  max-height: 48px;
  height: auto;
  min-width: 0;
  object-fit: contain;
}

.live-header {
  gap: 8px;
  min-height: calc(56px + env(safe-area-inset-top));
  padding-top: calc(10px + env(safe-area-inset-top));
  padding-bottom: 10px;
}

.live-header img {
  width: auto;
  max-width: min(160px, 40vw);
  max-height: 36px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.stop-work-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 38px;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--danger);
  color: var(--surface);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  white-space: nowrap;
  box-shadow: 0 1px 4px rgba(255, 31, 31, 0.32);
}

.stop-work-action:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.stop-work-label {
  font-size: 12px;
}

@media (max-width: 420px) {
  .stop-work-label {
    display: none;
  }

  .stop-work-action {
    padding: 6px 9px;
  }

  .connection-label {
    display: none;
  }

  .session-status {
    padding: 4px 6px;
  }

  .live-header img {
    max-width: 140px;
    max-height: 32px;
  }

  .controls-primary {
    grid-template-columns: 1fr 1fr 44px 1fr;
    gap: 4px;
  }

  .control-button-lg span,
  .control-button-finish span {
    font-size: 13px;
  }

  .control-button-lg small,
  .control-button-finish small {
    font-size: 9px;
  }

  .control-button-more span {
    font-size: 20px;
  }
}

.status-chip {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--extra-light-green);
  color: var(--dark-green);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.start-content {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 10px;
  padding: 20px max(20px, env(safe-area-inset-right)) 8px
    max(20px, env(safe-area-inset-left));
  overflow: hidden;
}

.start-copy {
  min-width: 0;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--grey-500);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0;
  text-transform: uppercase;
}

.start-copy h1 {
  margin: 0 0 10px;
  color: var(--blue-midnight);
  font-size: clamp(22px, 6vw, 30px);
  font-weight: 600;
  line-height: 1.18;
  letter-spacing: 0;
}

.start-copy h1 span {
  color: var(--brand-green);
}

.start-copy p:last-child {
  margin: 0;
  color: var(--grey-600);
  font-size: 15px;
  line-height: 1.45;
}

.hero-preview {
  min-height: 0;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  overflow: hidden;
  pointer-events: none;
}

.hero-preview img {
  width: auto;
  height: min(100%, 430px);
  max-width: 90%;
  object-fit: contain;
  filter: drop-shadow(0 16px 36px rgba(1, 35, 44, 0.18));
}

.telemetry-badge {
  position: fixed;
  top: max(8px, env(safe-area-inset-top));
  right: 8px;
  z-index: 9999;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border: 0;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.78);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
  pointer-events: auto;
  cursor: pointer;
}

.telemetry-badge-count {
  display: inline-grid;
  place-items: center;
  min-width: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  font-variant-numeric: tabular-nums;
}

.telemetry-badge-label {
  text-transform: uppercase;
}

.telemetry-badge.is-sending {
  background: rgba(1, 35, 44, 0.78);
  animation: telemetry-pulse 1200ms ease-in-out infinite;
}

.telemetry-badge.is-sent {
  background: var(--dark-green);
  color: #fff;
}

.telemetry-badge.is-error {
  background: var(--warning-dark);
  color: #fff;
}

@keyframes telemetry-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(0, 197, 123, 0.45); }
  50% { box-shadow: 0 0 0 6px rgba(0, 197, 123, 0); }
}

.bottom-dock {
  position: relative;
  z-index: 15;
  flex-shrink: 0;
  display: grid;
  gap: 10px;
  padding: 12px max(20px, env(safe-area-inset-right))
    calc(14px + env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
  border-top: 1px solid var(--grey-300);
  background: rgba(248, 249, 250, 0.96);
  box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.08);
  user-select: none;
  -webkit-user-select: none;
}

.primary-action,
.secondary-action,
.danger-action,
.control-button {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  min-width: 0;
  padding: 10px 18px;
  text-align: center;
  white-space: normal;
}

.primary-action {
  background: var(--brand-green);
  color: var(--surface);
}

.secondary-action {
  background: transparent;
  color: var(--brand-green);
  border: 1px solid var(--brand-green);
}

.primary-action span,
.secondary-action span {
  display: block;
  font-size: 16px;
}

.primary-action small,
.secondary-action small {
  display: block;
  margin-top: 1px;
  font-size: 12px;
  font-weight: 600;
  opacity: 0.78;
}

.permission-priming {
  margin: 0 0 4px;
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--extra-light-green);
  color: var(--dark-green);
  font-size: 12px;
  line-height: 1.35;
  font-weight: 600;
}

.secure-warning {
  position: absolute;
  left: 20px;
  right: 20px;
  bottom: calc(126px + env(safe-area-inset-bottom));
  margin: 0;
  padding: 10px 12px;
  border: 1px solid rgba(255, 31, 31, 0.22);
  border-radius: 8px;
  background: #fff4f4;
  color: #9f1515;
  font-size: 13px;
  line-height: 1.35;
}

.live-stage {
  position: relative;
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 12px;
  padding: 14px max(20px, env(safe-area-inset-right)) 14px
    max(20px, env(safe-area-inset-left));
  overflow: hidden;
}

.autofill-panel {
  min-height: 0;
  min-width: 0;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 10px;
  align-content: start;
  overflow: hidden;
}

.voice-hero {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 16px;
  text-align: center;
  min-width: 0;
  --mic-level: 0;
}

.voice-orb {
  position: relative;
  width: 104px;
  height: 104px;
  margin-bottom: 6px;
  border-radius: 50%;
  background: var(--extra-light-green);
  display: grid;
  place-items: center;
  isolation: isolate;
}

.voice-orb-halo {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  pointer-events: none;
  box-shadow: 0 0 0 calc(var(--mic-level) * 22px)
    rgba(0, 197, 123, calc(var(--mic-level) * 0.4));
  transition: box-shadow 90ms linear;
  z-index: 0;
}

.voice-orb-core {
  position: relative;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--brand-green);
  box-shadow: 0 4px 12px rgba(0, 153, 96, 0.32);
  z-index: 1;
}

.voice-hero.is-muted .voice-orb {
  background: rgba(191, 104, 0, 0.16);
}

.voice-hero.is-muted .voice-orb-core {
  background: var(--warning-dark);
  box-shadow: none;
}

.voice-hero.is-muted .voice-orb-halo {
  box-shadow: 0 0 0 4px rgba(191, 104, 0, 0.18);
}

.voice-hero[data-live-state="idle"] .voice-orb {
  background: var(--grey-200);
}
.voice-hero[data-live-state="idle"] .voice-orb-core {
  background: var(--grey-500);
  box-shadow: none;
}
.voice-hero[data-live-state="idle"] .voice-orb-halo {
  box-shadow: none;
}

.voice-hero[data-live-state="connecting"] .voice-orb {
  background: rgba(255, 173, 31, 0.16);
}
.voice-hero[data-live-state="connecting"] .voice-orb-core {
  background: var(--warning);
  animation: orb-pulse-soft 1.6s ease-in-out infinite;
}
.voice-hero[data-live-state="connecting"] .voice-orb-halo {
  box-shadow: 0 0 0 6px rgba(255, 173, 31, 0.22);
  animation: orb-pulse-soft 1.6s ease-in-out infinite;
}

.voice-hero[data-live-state="speaking"] .voice-orb {
  background: rgba(59, 138, 255, 0.16);
}
.voice-hero[data-live-state="speaking"] .voice-orb-core {
  background: #3b8aff;
  box-shadow: 0 4px 12px rgba(59, 138, 255, 0.32);
}
.voice-hero[data-live-state="speaking"] .voice-orb-halo {
  animation: orb-wave 1.6s ease-in-out infinite;
}

.voice-hero[data-live-state="finalizing"] .voice-orb {
  background: var(--grey-200);
}
.voice-hero[data-live-state="finalizing"] .voice-orb-core {
  background: var(--grey-500);
  animation: orb-pulse-soft 1.2s ease-in-out infinite;
}
.voice-hero[data-live-state="finalizing"] .voice-orb-halo {
  box-shadow: none;
}

.voice-hero[data-live-state="speaking"] .voice-step {
  color: #2c5fc8;
}

.voice-hero[data-live-state="connecting"] .voice-step {
  color: var(--warning-dark);
}

@keyframes orb-pulse-soft {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.7; transform: scale(1.05); }
}

@keyframes orb-wave {
  0%, 100% {
    box-shadow: 0 0 0 6px rgba(59, 138, 255, 0.22);
  }
  50% {
    box-shadow: 0 0 0 24px rgba(59, 138, 255, 0.02);
  }
}

.voice-step {
  margin: 0;
  color: var(--dark-green);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.voice-cue {
  margin: 0;
  color: var(--blue-midnight);
  font-size: clamp(20px, 5.4vw, 26px);
  font-weight: 700;
  line-height: 1.18;
  max-width: 32ch;
}

.voice-heard {
  margin: 0;
  color: var(--grey-600);
  font-size: 13px;
  line-height: 1.3;
  max-width: 34ch;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.voice-status {
  margin: 0;
  color: var(--grey-500);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  min-height: 14px;
}

.plan-summary {
  align-self: stretch;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 8px 14px;
  border: 1px solid var(--grey-300);
  border-radius: 12px;
  background: var(--surface);
  color: var(--blue-midnight);
  box-shadow: 0 1px 2px rgba(1, 35, 44, 0.05);
  font-size: 13px;
  font-weight: 700;
  text-align: left;
}

.plan-summary-icon {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: var(--extra-light-green);
  color: var(--dark-green);
  font-size: 11px;
  font-weight: 800;
  transition: transform 200ms ease;
}

.plan-summary[aria-expanded="true"] .plan-summary-icon {
  transform: rotate(180deg);
}

.plan-summary-text {
  min-width: 0;
  color: var(--blue-midnight);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.plan-summary-count {
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--extra-light-green);
  color: var(--dark-green);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.plan-sheet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 12;
  display: flex;
  flex-direction: column;
  min-height: 0;
  max-height: calc(100% - 12px);
  padding: 8px max(16px, env(safe-area-inset-right)) 12px
    max(16px, env(safe-area-inset-left));
  background: var(--surface);
  border-radius: 18px 18px 0 0;
  box-shadow: 0 -16px 36px rgba(1, 35, 44, 0.2);
  transform: translateY(100%);
  transition: transform 240ms cubic-bezier(0.22, 0.61, 0.36, 1);
  overflow: hidden;
}

.live-screen.plan-peek .plan-sheet {
  transform: translateY(calc(100% - 260px));
  box-shadow: 0 -10px 24px rgba(1, 35, 44, 0.16);
}

.live-screen.plan-peek .plan-sheet-body {
  overflow: hidden;
}

.live-screen.plan-open .plan-sheet {
  transform: translateY(0);
}

.plan-sheet-scrim {
  position: absolute;
  inset: 0;
  z-index: 11;
  background: rgba(1, 35, 44, 0.36);
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms ease;
}

.live-screen.plan-open .plan-sheet-scrim {
  opacity: 1;
  pointer-events: auto;
}

.plan-sheet-handle {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding-top: 8px;
  flex-shrink: 0;
}

.plan-sheet-grip {
  position: absolute;
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
  width: 38px;
  height: 4px;
  border-radius: 999px;
  background: var(--grey-300);
}

.plan-sheet-handle h2 {
  margin: 0;
  color: var(--blue-midnight);
  font-size: 15px;
  font-weight: 700;
}

.plan-sheet-close {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  min-height: 36px;
  width: 36px;
  padding: 0;
  border-radius: 999px;
  background: var(--grey-100);
  color: var(--grey-600);
  font-size: 20px;
  line-height: 1;
  border: 0;
}

.plan-sheet-body {
  min-height: 0;
  display: grid;
  gap: 10px;
  padding: 8px 4px calc(96px + env(safe-area-inset-bottom));
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  align-content: start;
}

.session-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--grey-300);
  background: var(--surface);
  box-shadow: 0 1px 2px rgba(1, 35, 44, 0.05);
  flex-shrink: 0;
}

.connection-dot {
  flex-shrink: 0;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--grey-400);
  box-shadow: 0 0 0 0 currentColor;
}

.session-status[data-state="connecting"] .connection-dot {
  background: var(--warning);
  animation: dot-pulse 1.4s ease-in-out infinite;
}

.session-status[data-state="live"] .connection-dot {
  background: var(--brand-green);
  box-shadow: 0 0 0 3px rgba(0, 197, 123, 0.18);
}

.session-status[data-state="speaking"] .connection-dot {
  background: #3b8aff;
  box-shadow: 0 0 0 3px rgba(59, 138, 255, 0.2);
  animation: dot-pulse 1.4s ease-in-out infinite;
}

.session-status[data-state="paused"] .connection-dot {
  background: var(--warning);
}

.session-status[data-state="disconnected"] .connection-dot {
  background: var(--danger);
}

@keyframes dot-pulse {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.35);
    opacity: 0.65;
  }
}

.session-status-text {
  flex: 1;
  margin: 0;
  min-width: 0;
  color: var(--blue-midnight);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.connection-label {
  flex-shrink: 0;
  color: var(--grey-500);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.session-status[data-state="live"] .connection-label {
  color: var(--dark-green);
}

.session-status[data-state="speaking"] .connection-label {
  color: #2c5fc8;
}

.session-status[data-state="disconnected"] .connection-label {
  color: var(--danger);
}

.session-status[data-state="paused"] .connection-label {
  color: var(--warning-dark);
}

.field-card {
  min-width: 0;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid var(--grey-300);
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.field-card.active {
  border-left: 3px solid var(--brand-green);
}

.field-card.filled {
  border-left: 3px solid var(--dark-green);
}

.field-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-width: 0;
  gap: 12px;
  margin-bottom: 8px;
}

.field-actions {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.field-header span,
.mini-field span {
  color: var(--grey-500);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.field-header strong,
.mini-field strong {
  color: var(--dark-green);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.mini-action {
  min-height: 30px;
  padding: 4px 10px;
  border: 1px solid rgba(0, 197, 123, 0.45);
  border-radius: 8px;
  background: var(--extra-light-green);
  color: var(--dark-green);
  font-size: 12px;
  line-height: 1;
}

.mini-action small {
  display: none;
}

.photo-field {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.live-camera-thumb {
  position: relative;
  width: 64px;
  height: 80px;
  overflow: hidden;
  border-radius: 8px;
  background: linear-gradient(160deg, var(--blue-midnight) 0%, #1a4a5a 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

#cameraPreview {
  width: 100%;
  height: 100%;
  min-height: 100%;
  object-fit: cover;
  display: block;
  background: var(--blue-midnight);
  opacity: 0;
  transition: opacity 220ms ease;
}

.live-camera-thumb.is-flashing #cameraPreview {
  opacity: 1;
}

.live-camera-thumb.is-flashing {
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.8);
  animation: viewfinder-flash 900ms ease-out;
}

@keyframes viewfinder-flash {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.95);
  }
  18% {
    box-shadow: 0 0 0 6px rgba(255, 255, 255, 0.55);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0);
  }
}

.live-camera-thumb span {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px 6px;
  color: var(--surface);
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  text-align: center;
  letter-spacing: 0.02em;
  line-height: 1.2;
  pointer-events: none;
}

.live-camera-thumb.is-flashing span {
  opacity: 0;
}

.live-camera-thumb.is-paused {
  background: rgba(1, 35, 44, 0.6);
}

.live-camera-thumb.is-paused span,
.live-camera-thumb.is-unavailable span {
  opacity: 0.65;
}

.live-camera-thumb.is-unavailable {
  background: rgba(1, 35, 44, 0.4);
}

.field-grid {
  display: none;
  min-height: 0;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.typed-value {
  min-height: 42px;
  margin: 0;
  color: var(--blue-midnight);
  font-size: 14px;
  line-height: 1.35;
}

.typed-value.empty {
  color: var(--grey-500);
}

.typed-value.typing::after {
  content: "";
  display: inline-block;
  width: 2px;
  height: 1em;
  margin-left: 3px;
  vertical-align: -0.15em;
  background: var(--brand-green);
  animation: blink 1s steps(2, start) infinite;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

.inline-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

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

.mini-field {
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--grey-300);
  border-radius: 8px;
  background: var(--surface);
}

.mini-field span,
.mini-field strong {
  display: block;
}

.mini-field strong {
  margin-top: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mini-field.skipped strong {
  color: var(--grey-500);
}

.plan-stream {
  min-height: 0;
  display: grid;
  gap: 8px;
  align-content: start;
  overflow: hidden;
}

.stream-section {
  min-height: 46px;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  align-items: start;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--grey-300);
  border-radius: 8px;
  background: var(--surface);
}

.stream-section.is-active {
  border-color: rgba(0, 197, 123, 0.45);
  background: var(--extra-light-green);
  box-shadow: 0 0 0 1px rgba(0, 197, 123, 0.16);
}

.stream-section.is-filled .section-dot {
  background: var(--brand-green);
  color: var(--surface);
}

.section-dot {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--grey-200);
  color: var(--grey-600);
  font-size: 12px;
  font-weight: 800;
}

.stream-section h3 {
  margin: 0;
  color: var(--blue-midnight);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
}

.stream-section p {
  margin: 3px 0 0;
  color: var(--grey-600);
  font-size: 13px;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.stream-section.is-active p {
  color: var(--blue-midnight);
  -webkit-line-clamp: 2;
}

.section-state {
  color: var(--grey-500);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.session-label {
  margin: 0 0 4px;
  color: var(--brand-green);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.status-text {
  max-width: 58vw;
  margin: 0;
  color: var(--surface);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.25;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.35);
}

.danger-action {
  flex-shrink: 0;
  min-height: 38px;
  padding: 7px 12px;
  background: var(--danger);
  color: var(--surface);
  font-size: 13px;
  white-space: nowrap;
}

.photo-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  min-height: 80px;
}

.photo-slot {
  min-height: 80px;
  display: grid;
  place-items: center;
  border: 1px dashed var(--grey-400);
  border-radius: 8px;
  overflow: hidden;
  background: var(--grey-100);
  color: var(--grey-500);
  font-size: 11px;
  font-weight: 700;
}

.photo-slot.filled {
  border-style: solid;
  border-color: var(--brand-green);
  background: var(--surface);
}

.photo-slot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.stage-pills {
  min-height: 26px;
  display: flex;
  gap: 6px;
  overflow: hidden;
}

.stage-bar {
  min-height: 32px;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  background: var(--grey-200);
}

.stage-pill {
  min-width: 0;
  flex: 1 1 0;
  padding: 5px 6px;
  border-radius: 999px;
  background: var(--grey-200);
  color: var(--grey-600);
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
}

.stage-bar .stage-pill {
  padding: 6px 4px;
  background: transparent;
  color: var(--grey-500);
}

.stage-pill.is-current {
  background: var(--brand-green);
  color: var(--surface);
}

.stage-pill.is-done {
  background: var(--extra-light-green);
  color: var(--dark-green);
}

.stage-bar .stage-pill.is-current {
  background: var(--brand-green);
  color: var(--surface);
  box-shadow: 0 1px 3px rgba(0, 153, 96, 0.32);
}

.stage-bar .stage-pill.is-done {
  background: rgba(0, 197, 123, 0.18);
  color: var(--dark-green);
}

.hazard-row {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}

.hazard-row:empty {
  display: none;
}

.hazard-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-width: 0;
  min-height: 52px;
  padding: 4px 2px;
  border: 1px solid var(--grey-300);
  border-radius: 8px;
  background: var(--grey-100);
  color: var(--grey-500);
  font-size: 9px;
  font-weight: 800;
  line-height: 1.05;
  text-align: center;
  text-transform: uppercase;
}

.hazard-chip > span:last-child {
  display: block;
  width: 100%;
  word-break: break-word;
  hyphens: auto;
}

.hazard-chip .hazard-glyph {
  font-size: 16px;
  line-height: 1;
  filter: grayscale(0.8);
  opacity: 0.55;
  word-break: normal;
}

.hazard-chip.is-active {
  border-color: rgba(255, 31, 31, 0.35);
  background: #fff4f4;
  color: #9f1515;
  box-shadow: 0 1px 3px rgba(255, 31, 31, 0.12);
}

.hazard-chip.is-active .hazard-glyph {
  filter: none;
  opacity: 1;
}

.capture-badge {
  position: fixed;
  top: max(72px, calc(env(safe-area-inset-top) + 64px));
  left: 50%;
  transform: translate(-50%, -12px);
  z-index: 60;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(1, 35, 44, 0.92);
  color: var(--surface);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  box-shadow: 0 8px 22px rgba(1, 35, 44, 0.25);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease, transform 240ms ease;
}

.capture-badge::before {
  content: "📸";
  margin-right: 6px;
}

.capture-badge.is-aiming::before {
  content: "🎯";
}

.capture-badge.is-aiming {
  background: rgba(0, 153, 96, 0.95);
}

.capture-badge.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.capture-toasts {
  position: relative;
  display: grid;
  gap: 6px;
  padding: 0 20px;
  margin-bottom: 6px;
  pointer-events: none;
}

.capture-toasts:empty {
  display: none;
}

.capture-toast {
  pointer-events: auto;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--blue-midnight);
  color: var(--surface);
  font-size: 13px;
  line-height: 1.25;
  box-shadow: 0 6px 18px rgba(1, 35, 44, 0.28);
  animation: toast-in 180ms ease-out;
}

.capture-toast.is-leaving {
  animation: toast-out 160ms ease-in forwards;
}

@keyframes toast-in {
  from {
    transform: translateY(8px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes toast-out {
  from {
    transform: translateY(0);
    opacity: 1;
  }
  to {
    transform: translateY(8px);
    opacity: 0;
  }
}

.capture-toast .toast-glyph {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: rgba(0, 197, 123, 0.22);
  color: var(--brand-green);
  font-size: 13px;
  font-weight: 800;
}

.capture-toast .toast-body {
  min-width: 0;
  overflow: hidden;
}

.capture-toast .toast-label {
  color: rgba(255, 255, 255, 0.65);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.capture-toast .toast-value {
  margin: 1px 0 0;
  color: var(--surface);
  font-size: 13px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.capture-toast .toast-undo {
  min-height: 30px;
  padding: 4px 10px;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 999px;
  background: transparent;
  color: var(--surface);
  font-size: 12px;
  font-weight: 700;
}

.transcript-drawer {
  min-height: 0;
  margin-top: 8px;
  color: var(--grey-600);
  font-size: 12px;
}

.transcript-drawer summary {
  cursor: pointer;
  color: var(--grey-500);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.transcript {
  min-height: 0;
  display: grid;
  align-content: end;
  gap: 6px;
  max-height: 96px;
  margin-top: 6px;
  overflow: hidden;
}

.transcript:empty,
.partials:empty {
  display: none;
}

.transcript-row,
.partial {
  width: fit-content;
  max-width: 90%;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.35;
}

.transcript-row.user,
.partial.user {
  justify-self: end;
  background: #eef6ff;
  color: #183d63;
}

.transcript-row.assistant,
.partial.assistant {
  justify-self: start;
  background: var(--extra-light-green);
  color: var(--blue-midnight);
}

.transcript-row.system {
  justify-self: center;
  background: #fff4f4;
  color: #9f1515;
}

.partials {
  display: grid;
  gap: 6px;
  margin-top: 6px;
  opacity: 0.72;
}

.controls {
  grid-template-columns: 1fr;
  gap: 8px;
}

.controls-primary {
  display: grid;
  grid-template-columns: 1fr 1fr 52px 1fr;
  gap: 6px;
}

.controls-secondary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.controls-secondary[hidden] {
  display: none;
}

.control-button {
  min-height: 44px;
  padding: 8px 8px;
  background: var(--surface);
  color: var(--blue-midnight);
  border: 1px solid var(--grey-300);
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.15;
}

.control-button-lg {
  min-height: 56px;
  padding: 10px 12px;
  font-size: 14px;
}

.control-button-lg span {
  font-size: 15px;
  font-weight: 700;
}

.control-button-capture {
  position: relative;
  background: var(--surface);
  color: var(--blue-midnight);
  border: 1px solid var(--grey-300);
}

.control-button-capture span {
  font-size: 14px;
  font-weight: 700;
}

.control-button-capture::before {
  content: "";
  position: absolute;
  top: 6px;
  right: 6px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--brand-green);
  box-shadow: 0 0 0 2px rgba(0, 153, 96, 0.18);
}

.control-button-capture:disabled::before {
  background: var(--grey-400);
  box-shadow: none;
}

.control-button-more {
  min-height: 56px;
  padding: 8px;
  background: var(--surface);
  color: var(--grey-600);
  border: 1px solid var(--grey-300);
}

.control-button-more span {
  font-size: 22px;
  line-height: 1;
  color: var(--blue-midnight);
}

.control-button-more[aria-expanded="true"] {
  background: var(--grey-200);
  border-color: var(--grey-400);
}

.control-button-finish {
  position: relative;
  overflow: hidden;
  min-height: 56px;
  padding: 8px 10px;
  background: var(--brand-green);
  color: var(--surface);
  border: 1px solid var(--brand-green);
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(0, 153, 96, 0.28);
}

.control-button-finish.is-confirming {
  background: var(--warning-dark);
  border-color: var(--warning-dark);
  box-shadow: 0 2px 6px rgba(191, 104, 0, 0.32);
}

.control-button-finish.is-review {
  background: var(--brand-green);
  border-color: var(--brand-green);
  animation: review-ready 1800ms ease-in-out infinite;
}

@keyframes review-ready {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(0, 153, 96, 0.45), 0 2px 6px rgba(0, 153, 96, 0.28);
  }
  50% {
    box-shadow: 0 0 0 6px rgba(0, 153, 96, 0), 0 2px 6px rgba(0, 153, 96, 0.28);
  }
}

.control-button-finish.is-confirming::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  height: 3px;
  width: 100%;
  background: rgba(255, 255, 255, 0.65);
  transform-origin: right center;
  animation: finish-countdown 3.4s linear forwards;
}

@keyframes finish-countdown {
  from { transform: scaleX(1); }
  to { transform: scaleX(0); }
}

.control-button-finish span {
  display: block;
  color: var(--surface);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.1;
}

.control-button.control-button-finish small {
  color: rgba(1, 35, 44, 0.92);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.control-button small {
  display: block;
  margin-top: 2px;
  color: var(--grey-500);
  font-size: 10px;
  font-weight: 700;
}

.control-button.is-active {
  border-color: rgba(255, 31, 31, 0.45);
  background: #fff4f4;
  color: #9f1515;
}

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

.draft-content {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  gap: 8px;
  padding: 18px max(20px, env(safe-area-inset-right)) 12px
    max(20px, env(safe-area-inset-left));
  overflow: hidden;
}

.draft-content h2 {
  margin: 0 0 12px;
  color: var(--blue-midnight);
  font-size: 22px;
  font-weight: 600;
  line-height: 1.2;
}

.draft-document {
  min-height: 0;
  display: grid;
  gap: 10px;
  padding: 0;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  align-content: start;
}

.draft-section {
  padding: 12px 14px;
  border: 1px solid var(--grey-300);
  border-left: 3px solid var(--brand-green);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.draft-section.is-skipped {
  border-left-color: var(--grey-400);
  background: var(--grey-100);
}

.draft-section h3 {
  margin: 0 0 6px;
  color: var(--grey-500);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.draft-section p {
  margin: 0;
  color: var(--blue-midnight);
  font-size: 15px;
  line-height: 1.45;
}

.draft-section ul {
  margin: 0;
  padding-left: 18px;
  color: var(--blue-midnight);
  font-size: 15px;
  line-height: 1.45;
}

.draft-section li + li {
  margin-top: 2px;
}

.draft-photos {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.draft-photos img {
  width: 100%;
  height: 88px;
  border-radius: 6px;
  object-fit: cover;
}

.draft-raw {
  margin-top: 10px;
  color: var(--grey-600);
  font-size: 12px;
}

.draft-raw summary {
  cursor: pointer;
  color: var(--grey-500);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.draft-raw[hidden] {
  display: none;
}

.draft-text {
  min-height: 0;
  margin: 8px 0 0;
  padding: 12px;
  max-height: 220px;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--grey-300);
  border-radius: 8px;
  background: var(--surface);
  color: var(--blue-midnight);
  font: 14px/1.5 "Spline Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  white-space: pre-wrap;
}

.draft-actions {
  grid-template-columns: 1fr 1fr;
}

.draft-actions .secondary-action.draft-copy {
  grid-column: span 2;
}

@media (min-width: 700px) {
  body {
    display: grid;
    place-items: center;
    padding: 20px;
  }

  .app-shell {
    height: min(900px, calc(100vh - 40px));
    border-radius: 22px;
    box-shadow: 0 18px 70px rgba(1, 35, 44, 0.18);
  }
}

@media (orientation: landscape) and (max-height: 500px) {
  .brand-header {
    min-height: calc(44px + env(safe-area-inset-top));
    padding-top: calc(6px + env(safe-area-inset-top));
    padding-bottom: 6px;
  }

  .brand-header img,
  .live-header img {
    max-height: 28px;
  }

  .live-stage {
    gap: 6px;
    padding-top: 6px;
    padding-bottom: 6px;
  }

  .voice-hero {
    gap: 4px;
    padding: 4px;
  }

  .voice-orb {
    width: 64px;
    height: 64px;
    margin-bottom: 2px;
  }

  .voice-orb-core {
    width: 26px;
    height: 26px;
  }

  .voice-cue {
    font-size: 16px;
  }

  .voice-heard {
    -webkit-line-clamp: 1;
  }

  .plan-summary {
    min-height: 38px;
    padding: 6px 12px;
  }

  .controls-primary > .control-button-lg,
  .control-button-finish {
    min-height: 44px;
    padding: 6px 8px;
  }

  .control-button-more {
    min-height: 44px;
  }
}

@media (max-height: 760px) {
  .brand-header {
    min-height: calc(52px + env(safe-area-inset-top));
    padding-bottom: 8px;
  }

  .brand-header img {
    max-height: 34px;
  }

  .start-content {
    padding-top: 14px;
    gap: 8px;
  }

  .start-copy h1 {
    font-size: clamp(20px, 5.2vw, 26px);
    margin-bottom: 8px;
  }

  .start-copy p:last-child {
    font-size: 14px;
  }

  .bottom-dock {
    padding-top: 8px;
    gap: 8px;
  }

  .live-stage {
    gap: 8px;
    padding-top: 10px;
    padding-bottom: 10px;
  }

  .voice-orb {
    width: 88px;
    height: 88px;
  }

  .voice-orb-core {
    width: 32px;
    height: 32px;
  }

  .voice-cue {
    font-size: clamp(18px, 4.8vw, 22px);
  }

  .field-card {
    padding: 10px 12px;
  }
}
