:root {
  --bg: #07111d;
  --panel: rgba(12, 24, 38, 0.94);
  --panel-strong: #102236;
  --line: rgba(163, 190, 214, 0.16);
  --line-strong: rgba(163, 190, 214, 0.26);
  --rail-bg: rgba(6, 15, 25, 0.72);
  --text: #eef4f8;
  --muted: #9fb3c4;
  --accent: #45c6b3;
  --accent-2: #ffb44f;
  --danger: #ff7869;
  --good: #89dd8b;
  --blue: #68a7ff;
  --phase-intake: #45c6b3;
  --phase-setup: #9bb7ff;
  --phase-validate: #ffb44f;
  --phase-area: #68a7ff;
  --phase-evaluate: #89dd8b;
  --phase-approve: #f2d16b;
  --phase-command: #d6b4ff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 18% 10%, rgba(69, 198, 179, 0.09), transparent 28%),
    radial-gradient(circle at 82% 20%, rgba(104, 167, 255, 0.08), transparent 26%),
    var(--bg);
  color: var(--text);
}

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

.app-shell {
  min-height: 100vh;
  padding: clamp(22px, 2.2vw, 38px);
}

.topbar,
.panel,
.clarification-box,
.satellite-card,
.decision-row,
.timeline li,
.command-output {
  border: 1px solid var(--line);
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: center;
  padding: 20px 22px;
  background: rgba(9, 18, 29, 0.88);
  border-radius: 8px;
  margin-bottom: 32px;
}

.eyebrow,
.field-label {
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: 0;
  font-size: 12px;
  color: var(--muted);
}

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

h1 {
  margin-bottom: 0;
  font-size: 30px;
}

h2 {
  margin-bottom: 0;
  font-size: 18px;
}

.topbar-status,
.pill,
.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.topbar-actions {
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: flex-end;
}

.topbar-status {
  color: var(--muted);
}

.presentation-toolbar {
  display: none;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 24px;
  background: rgba(9, 18, 29, 0.92);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.18);
}

.presentation-mode .presentation-toolbar {
  display: grid;
}

.presentation-step-summary {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.presentation-step-summary strong {
  font-size: 18px;
}

.presentation-step-summary p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--good);
  box-shadow: 0 0 18px rgba(137, 221, 139, 0.65);
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(310px, 0.86fr) minmax(390px, 1fr) minmax(640px, 1.72fr);
  gap: clamp(28px, 2vw, 42px);
  align-items: start;
}

.presentation-mode .workspace-grid {
  grid-template-columns: minmax(330px, 0.78fr) minmax(0, 1.78fr);
  gap: clamp(28px, 2.4vw, 48px);
}

.workflow-rail,
.input-rail,
.output-rail {
  position: relative;
  display: grid;
  gap: 28px;
  align-content: start;
  min-width: 0;
  border: 1px solid rgba(163, 190, 214, 0.18);
  border-radius: 8px;
  padding: 22px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent 120px),
    var(--rail-bg);
  box-shadow: 0 24px 72px rgba(0, 0, 0, 0.24);
}

.workflow-rail {
  --rail-accent: var(--phase-intake);
}

.presentation-mode .workflow-rail {
  position: sticky;
  top: 22px;
  max-height: calc(100vh - 44px);
  overflow: auto;
}

.presentation-mode .input-rail,
.presentation-mode .output-rail {
  display: contents;
}

.presentation-mode .input-rail::before,
.presentation-mode .output-rail::before,
.presentation-mode .input-rail > .column-header,
.presentation-mode .output-rail > .column-header {
  display: none;
}

.presentation-mode .panel {
  display: none;
}

.presentation-mode .panel.active-step {
  display: block;
  grid-column: 2;
  min-height: min(760px, calc(100vh - 190px));
  align-self: start;
}

.presentation-mode .panel.active-step::after {
  content: "Independent step card / 獨立步驟卡片";
  position: absolute;
  top: 14px;
  right: 24px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.presentation-mode .mission-input .button-row {
  display: none;
}

.input-rail {
  --rail-accent: var(--blue);
}

.output-rail {
  --rail-accent: var(--phase-command);
}

.workflow-rail::before,
.input-rail::before,
.output-rail::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  border-radius: 8px 0 0 8px;
  background: linear-gradient(180deg, var(--rail-accent), transparent 72%);
  opacity: 0.9;
}

.column-header {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 16px;
  align-items: start;
  min-height: 116px;
  border: 1px solid rgba(163, 190, 214, 0.3);
  border-radius: 8px;
  padding: 20px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.055), transparent 56%),
    rgba(9, 18, 29, 0.98);
  box-shadow: inset 4px 0 0 var(--rail-accent);
}

.column-header h2 {
  margin-bottom: 6px;
}

.column-header p,
.input-helper {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.45;
}

.input-helper {
  margin: -2px 0 14px;
}

.panel {
  position: relative;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent 92px),
    var(--panel);
  border-radius: 8px;
  padding: 24px;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.22);
}

.panel[data-phase-label] {
  padding-top: 60px;
  border-top-width: 4px;
  border-color: rgba(163, 190, 214, 0.2);
}

.panel[data-phase-label]::before {
  content: attr(data-phase-label);
  position: absolute;
  top: 14px;
  left: 24px;
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  border-radius: 999px;
  padding: 4px 9px;
  color: #04121a;
  background: var(--phase-color, var(--accent));
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
}

.phase-intake {
  --phase-color: var(--phase-intake);
  border-color: rgba(69, 198, 179, 0.34);
}

.phase-setup {
  --phase-color: var(--phase-setup);
  border-color: rgba(155, 183, 255, 0.32);
}

.phase-validate {
  --phase-color: var(--phase-validate);
  border-color: rgba(255, 180, 79, 0.34);
}

.phase-area,
.phase-interpret {
  --phase-color: var(--phase-area);
  border-color: rgba(104, 167, 255, 0.34);
}

.phase-evaluate {
  --phase-color: var(--phase-evaluate);
  border-color: rgba(137, 221, 139, 0.3);
}

.phase-reference {
  --phase-color: #cbd7e3;
  border-color: rgba(203, 215, 227, 0.25);
}

.phase-approve {
  --phase-color: var(--phase-approve);
  border-color: rgba(242, 209, 107, 0.35);
}

.phase-command {
  --phase-color: var(--phase-command);
  border-color: rgba(214, 180, 255, 0.32);
}

.panel-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(163, 190, 214, 0.12);
}

.panel-heading > div {
  min-width: 0;
}

.panel-subtitle {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.operator-progress {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.workflow-rail .operator-progress {
  grid-template-columns: 1fr;
}

.flow-section-label {
  margin: 8px 2px -2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.operator-progress .flow-section-label:not(:first-child) {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid rgba(163, 190, 214, 0.18);
}

.progress-step {
  appearance: none;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 10px;
  align-items: center;
  width: 100%;
  min-height: 94px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  text-align: left;
}

.presentation-mode .progress-step {
  cursor: pointer;
  min-height: auto;
  padding: 12px;
  grid-template-columns: 34px 1fr;
}

.progress-step span {
  display: grid;
  place-items: center;
  grid-row: 1 / 3;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  font-weight: 800;
}

.presentation-mode .progress-step span {
  width: 28px;
  height: 28px;
}

.progress-step strong {
  color: var(--text);
  font-size: 14px;
}

.progress-step small {
  line-height: 1.35;
}

.progress-step.active {
  border-color: rgba(69, 198, 179, 0.52);
  background: rgba(69, 198, 179, 0.09);
}

.progress-step.complete span {
  color: #04121a;
  background: var(--accent);
}

.progress-step.blocked {
  border-color: rgba(255, 180, 79, 0.46);
  background: rgba(255, 180, 79, 0.09);
}

.progress-step.locked {
  opacity: 0.52;
  cursor: not-allowed;
}

.progress-step.locked span {
  border-style: dashed;
}

.progress-step.presentation-current {
  border-color: rgba(214, 180, 255, 0.68);
  box-shadow: inset 4px 0 0 var(--phase-command), 0 0 0 1px rgba(214, 180, 255, 0.08);
  opacity: 1;
}

.guided-workflow {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(520px, 1.6fr);
  gap: 16px;
}

.workflow-rail .guided-workflow {
  grid-template-columns: 1fr;
}

.workflow-callout,
.guided-task-list {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(9, 18, 29, 0.94);
}

.workflow-callout {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: start;
  padding: 18px;
}

.workflow-callout h2 {
  margin-bottom: 6px;
}

.workflow-callout p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.45;
}

.phase-chip {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border-radius: 999px;
  padding: 7px 10px;
  color: #04121a;
  background: var(--accent);
  font-size: 12px;
  font-weight: 800;
}

.guided-task-list {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  overflow: hidden;
}

.workflow-rail .guided-task-list {
  grid-template-columns: 1fr;
}

.guided-task {
  position: relative;
  display: grid;
  gap: 6px;
  min-height: 122px;
  padding: 16px;
  border-right: 1px solid var(--line);
}

.workflow-rail .guided-task {
  min-height: auto;
  border-right: 0;
  border-bottom: 1px solid var(--line);
}

.guided-task:last-child {
  border-right: 0;
}

.workflow-rail .guided-task:last-child {
  border-bottom: 0;
}

.guided-task::before {
  content: attr(data-index);
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  font-size: 12px;
  font-weight: 800;
}

.guided-task strong {
  font-size: 13px;
  line-height: 1.25;
}

.guided-task p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.guided-task.done::before {
  color: #04121a;
  background: var(--good);
}

.guided-task.active {
  background: rgba(69, 198, 179, 0.1);
}

.guided-task.active::before {
  color: #04121a;
  background: var(--accent);
}

.guided-task.blocked {
  background: rgba(255, 180, 79, 0.1);
}

.guided-task.blocked::before {
  color: #04121a;
  background: var(--accent-2);
}

.guided-task.locked {
  opacity: 0.58;
}

.pill,
.status-chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 10px;
  font-size: 12px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.03);
}

.pill.muted {
  color: var(--muted);
}

.scenario-buttons,
.button-row {
  display: flex;
  gap: 12px;
}

.scenario-buttons {
  display: grid;
  grid-template-columns: 1fr;
  margin-bottom: 18px;
}

.scenario-button,
.primary-button,
.secondary-button,
.ghost-button,
.upload-button {
  border-radius: 8px;
  border: 1px solid var(--line);
  padding: 11px 14px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
  text-align: center;
}

.scenario-button.active,
.primary-button {
  background: var(--accent);
  color: #04121a;
  font-weight: 700;
}

.secondary-button {
  background: rgba(104, 167, 255, 0.16);
}

.ghost-button {
  background: transparent;
}

.primary-button:disabled,
.secondary-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

textarea,
input,
select {
  width: 100%;
  border-radius: 8px;
  border: 1px solid var(--line);
  color: var(--text);
  background: rgba(255, 255, 255, 0.035);
}

textarea {
  resize: vertical;
  min-height: 154px;
  padding: 14px;
  margin-bottom: 14px;
}

input {
  padding: 12px 14px;
  margin-bottom: 12px;
}

select {
  min-height: 44px;
  padding: 10px 12px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.button-row.compact {
  margin-top: 0;
}

.clarification-box {
  border-radius: 8px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.045);
}

.clarification-box p {
  color: var(--muted);
  line-height: 1.5;
  margin-bottom: 0;
}

.clarification-box.warning {
  border-color: rgba(255, 180, 79, 0.4);
  background: rgba(255, 180, 79, 0.08);
}

.construction-tools.hidden,
.aoi-hint.hidden,
.hidden {
  display: none;
}

.mission-map-panel {
  min-height: 520px;
}

.map-heading p {
  margin: 6px 0 0;
  color: var(--muted);
}

.map-card-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0 12px;
}

.map-mode-button {
  min-height: 34px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-weight: 700;
}

.map-mode-button.active {
  color: #04121a;
  background: var(--accent);
  border-color: transparent;
}

.map-imagery-controls {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto auto;
  gap: 10px;
  align-items: end;
  margin: 14px 0;
}

.input-rail .map-imagery-controls {
  grid-template-columns: 1fr;
}

.map-imagery-controls .field-label,
.map-image-status {
  grid-column: 1 / -1;
}

.map-imagery-controls .field-label {
  margin-bottom: -4px;
}

.map-image-status {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.upload-button {
  background: rgba(69, 198, 179, 0.11);
  border-color: rgba(69, 198, 179, 0.34);
}

.mission-map {
  position: relative;
  overflow: hidden;
  min-height: 430px;
  border-radius: 8px;
  border: 1px solid var(--line);
  --map-image: none;
  --map-position: center;
  --map-size: cover;
  background:
    linear-gradient(135deg, rgba(15, 43, 64, 0.94), rgba(9, 24, 37, 0.96)),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.02) 0 1px, transparent 1px 80px),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.02) 0 1px, transparent 1px 80px);
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.mission-map.dragging {
  cursor: grabbing;
}

.mission-map.has-image {
  background-image:
    linear-gradient(180deg, rgba(7, 16, 25, 0.06), rgba(7, 16, 25, 0.54)),
    var(--map-image);
  background-size: cover, var(--map-size);
  background-position: center, var(--map-position);
}

.osm-map-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  filter: saturate(0.86) contrast(1.02);
}

.mission-map.has-osm::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(180deg, rgba(7, 16, 25, 0.04), rgba(7, 16, 25, 0.48));
  pointer-events: none;
}

.mission-map.has-osm-tiles {
  background: #d9e4dc;
}

.mission-map.has-osm-tiles::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(180deg, rgba(7, 16, 25, 0.08), rgba(7, 16, 25, 0.5));
  pointer-events: none;
}

.osm-tile-layer {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 0;
  display: grid;
  filter: saturate(0.82) contrast(0.98);
}

.osm-tile-layer img {
  width: 256px;
  height: 256px;
  display: block;
}

.mission-map.idle::after {
  content: "Analysis results will appear here / 分析結果將顯示於此";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-weight: 600;
  background: rgba(7, 16, 25, 0.34);
  z-index: 8;
}

.clarification-box.empty-state {
  border-style: dashed;
}

.map-grid {
  position: absolute;
  inset: 0;
  z-index: 2;
  background:
    radial-gradient(circle at 25% 62%, rgba(69, 198, 179, 0.08), transparent 20%),
    radial-gradient(circle at 70% 34%, rgba(104, 167, 255, 0.06), transparent 18%);
  pointer-events: none;
}

.map-target {
  position: absolute;
  top: var(--aoi-y, 50%);
  left: var(--aoi-x, 50%);
  width: var(--aoi-width, clamp(132px, 18%, 240px));
  height: var(--aoi-height, clamp(76px, 12%, 140px));
  z-index: 4;
  display: grid;
  place-items: center;
  color: #04121a;
  background: rgba(255, 180, 79, 0.88);
  border: 2px solid rgba(255, 238, 210, 0.6);
  font-weight: 800;
  transform: translate(-50%, -50%);
  transition: width 180ms ease, height 180ms ease, left 180ms ease, top 180ms ease, opacity 180ms ease;
}

.map-target.out-of-view {
  opacity: 0.34;
}

.map-navigation-controls {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 7;
  display: flex;
  gap: 6px;
  align-items: center;
  padding: 6px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: rgba(6, 16, 26, 0.8);
  backdrop-filter: blur(10px);
}

.map-navigation-controls button {
  min-width: 34px;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  font-weight: 800;
  cursor: pointer;
}

.map-navigation-controls button:last-child {
  min-width: 92px;
  font-size: 12px;
}

.map-scale-badge {
  position: absolute;
  left: 14px;
  bottom: 14px;
  z-index: 7;
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  color: var(--text);
  background: rgba(6, 16, 26, 0.8);
  font-size: 12px;
  font-weight: 700;
}

.wildfire-target {
  --aoi-width: clamp(132px, 18%, 260px);
  --aoi-height: clamp(76px, 12%, 150px);
  border-radius: 42% 58% 52% 48% / 52% 40% 60% 48%;
}

.construction-target {
  --aoi-width: clamp(96px, 12%, 170px);
  --aoi-height: clamp(72px, 11%, 130px);
  border-radius: 8px;
}

.track {
  position: absolute;
  z-index: 3;
  width: 120%;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.42), transparent);
  transform-origin: left center;
}

.track-a {
  top: 92px;
  left: -18px;
  transform: rotate(12deg);
}

.track-b {
  top: 212px;
  left: -22px;
  transform: rotate(-8deg);
}

.track-c {
  top: 304px;
  left: -20px;
  transform: rotate(16deg);
}

.satellite {
  position: absolute;
  z-index: 5;
  min-width: 76px;
  height: 38px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(6, 16, 26, 0.92);
  color: var(--text);
}

.satellite.selected {
  border-color: rgba(69, 198, 179, 0.75);
  box-shadow: 0 0 0 2px rgba(69, 198, 179, 0.14);
}

.sat-a {
  top: 56px;
  left: 115px;
}

.sat-b {
  top: 188px;
  left: 528px;
}

.sat-c {
  top: 286px;
  left: 184px;
}

.aoi-hint {
  position: absolute;
  z-index: 6;
  right: 18px;
  bottom: 18px;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(69, 198, 179, 0.16);
  border: 1px solid rgba(69, 198, 179, 0.38);
}


.toggle-row {
  display: flex;
  gap: 10px;
  align-items: center;
  color: var(--text);
  line-height: 1.4;
  margin-bottom: 14px;
}

.toggle-row input {
  width: auto;
  margin: 0;
}

.custom-controls {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: end;
  margin-bottom: 14px;
}

.input-rail .custom-controls {
  grid-template-columns: 1fr;
}

.custom-controls .field-label {
  grid-column: 1 / -1;
  margin-bottom: -4px;
}

.custom-controls input {
  margin-bottom: 0;
}

.custom-satellite-editor {
  display: grid;
  gap: 16px;
  margin-bottom: 16px;
}

.custom-sat-row {
  display: grid;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.045);
}

.custom-sat-row h3 {
  margin: 0;
  font-size: 15px;
}

.custom-sat-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.custom-sat-grid label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

.custom-sat-grid input,
.custom-sat-grid select {
  width: 100%;
  min-width: 0;
  border-radius: 8px;
  border: 1px solid var(--line);
  padding: 10px 11px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.035);
}

.satellite-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.scenario-flow-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.workflow-rail .scenario-flow-grid {
  grid-template-columns: 1fr;
}

.scenario-flow {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.045);
}

.scenario-flow.active {
  border-color: rgba(69, 198, 179, 0.5);
  background: rgba(69, 198, 179, 0.065);
}

.scenario-flow h3 {
  margin: 0 0 10px;
  font-size: 15px;
}

.flow-line {
  display: grid;
  gap: 14px;
}

.flow-node {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 10px;
  align-items: start;
  border: 1px solid rgba(163, 190, 214, 0.12);
  border-radius: 8px;
  padding: 14px;
  background: rgba(6, 16, 26, 0.58);
}

.flow-node:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 21px;
  bottom: -13px;
  width: 1px;
  height: 13px;
  background: var(--line-strong);
}

.flow-node span {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  color: #04121a;
  background: var(--accent);
  font-weight: 800;
  font-size: 12px;
}

.flow-node strong {
  display: block;
  margin-bottom: 3px;
}

.flow-node small {
  color: var(--muted);
  line-height: 1.35;
}

.satellite-card {
  border-radius: 8px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.045);
}

.satellite-card h3 {
  margin: 0 0 10px;
}

.satellite-card p {
  color: var(--muted);
  margin-bottom: 8px;
}

.satellite-card strong {
  color: var(--text);
}

.key-value-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin: 0;
}

.key-value-list div {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(163, 190, 214, 0.09);
}

.key-value-list div:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.key-value-list dt {
  color: var(--muted);
}

.key-value-list dd {
  margin: 0;
}

.api-note {
  margin: 12px 0 0;
  color: var(--accent-2);
  line-height: 1.5;
}

.decision-table {
  display: grid;
  gap: 16px;
}

.decision-row {
  display: grid;
  grid-template-columns: 82px 1fr auto;
  gap: 16px;
  align-items: center;
  border-radius: 8px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.045);
}

.decision-row p {
  margin: 4px 0 0;
  color: var(--muted);
}

.good {
  color: var(--good);
}

.warn {
  color: var(--accent-2);
}

.bad {
  color: var(--danger);
}

.timeline {
  display: grid;
  gap: 18px;
  margin: 0;
  padding-left: 20px;
}

.recommended-asset {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  margin-bottom: 20px;
  background: rgba(255, 255, 255, 0.045);
}

.recommended-asset .label {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.recommended-asset strong {
  font-size: 18px;
}

.state-pill {
  border-radius: 999px;
  border: 1px solid var(--line);
  padding: 9px 12px;
  background: rgba(255, 255, 255, 0.05);
}

.state-arrow {
  color: var(--muted);
  font-weight: 700;
}

.empty-plan {
  border-style: dashed;
  color: var(--muted);
}

.timeline-state {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}

.timeline li {
  border-radius: 8px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.045);
}

.command-lanes {
  display: grid;
  gap: 14px;
  margin-top: 14px;
}

.command-lane {
  display: grid;
  grid-template-columns: 116px 1fr;
  gap: 14px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.045);
}

.command-lane strong {
  color: var(--text);
}

.plan-actions,
.command-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 14px;
}

.timeline span {
  color: var(--muted);
}

.command-output {
  margin: 0;
  white-space: pre-wrap;
  border-radius: 8px;
  padding: 16px;
  min-height: 220px;
  background: #071019;
  color: #d9f4ef;
  overflow: auto;
}


.suitability-grid,
.boundary-grid {
  display: grid;
  gap: 18px;
}

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

.suitability-card,
.boundary-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.045);
}

.suitability-card p,
.boundary-card p {
  color: var(--muted);
  line-height: 1.5;
  margin: 8px 0 0;
}

.satellite-card-heading {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}

.mini-pill {
  display: inline-flex;
  width: fit-content;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  background: rgba(255, 255, 255, 0.04);
}

.metric-list {
  display: grid;
  gap: 8px;
  margin: 0 0 12px;
  padding-left: 18px;
  color: var(--muted);
}

.satellite-footer {
  margin-bottom: 0;
  color: var(--text);
}

.satellite-card.good {
  border-color: rgba(137, 221, 139, 0.32);
}

.satellite-card.warn {
  border-color: rgba(255, 180, 79, 0.32);
}

.satellite-card.bad {
  border-color: rgba(255, 120, 105, 0.32);
}

.command-panel .boundary-grid {
  margin-bottom: 14px;
}

@media (max-width: 1280px) {
  .workspace-grid,
  .presentation-mode .workspace-grid {
    grid-template-columns: 1fr;
  }

  .presentation-mode .workflow-rail {
    position: static;
    max-height: none;
  }

  .presentation-mode .panel.active-step {
    grid-column: auto;
    min-height: auto;
  }

  .workflow-rail,
  .input-rail,
  .output-rail {
    padding: 16px;
  }

  .satellite-card-grid,
  .suitability-grid,
  .scenario-flow-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .operator-progress {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .guided-workflow {
    grid-template-columns: 1fr;
  }

  .guided-task-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .app-shell {
    padding: 16px;
  }

  .topbar {
    margin-bottom: 18px;
  }

  .topbar-actions,
  .presentation-toolbar {
    grid-template-columns: 1fr;
    flex-direction: column;
    align-items: stretch;
  }

  .workflow-rail,
  .input-rail,
  .output-rail {
    gap: 16px;
    padding: 12px;
  }

  .column-header {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .topbar,
  .panel-heading,
  .scenario-buttons,
  .button-row,
  .map-imagery-controls {
    flex-direction: column;
    align-items: stretch;
  }

  .map-imagery-controls {
    display: grid;
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 24px;
  }

  .satellite-card-grid,
  .suitability-grid,
  .scenario-flow-grid,
  .operator-progress,
  .guided-task-list {
    grid-template-columns: 1fr;
  }

  .guided-task {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .guided-task:last-child {
    border-bottom: 0;
  }

  .key-value-list div,
  .decision-row,
  .custom-sat-grid,
  .command-lane {
    grid-template-columns: 1fr;
  }

  .mission-map {
    min-height: 320px;
  }
}

/* Intent-to-command presentation consolidation */
.presentation-toolbar {
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: stretch;
}

.presentation-step-summary {
  gap: 14px;
}

.summary-mainline {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.toolbar-workflow-state {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid rgba(199, 216, 228, 0.14);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.035);
}

.toolbar-workflow-state p {
  margin: 0;
  color: var(--muted);
  line-height: 1.35;
}

.operator-progress {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 8px;
}

.operator-progress .flow-section-label {
  display: none;
}

.operator-progress .progress-step {
  min-height: 78px;
  padding: 10px;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 7px 9px;
}

.operator-progress .progress-step strong {
  font-size: 12px;
  line-height: 1.2;
}

.operator-progress .progress-step small {
  display: none;
}

.guided-task-list.compact {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  border-radius: var(--radius);
  border: 1px solid rgba(199, 216, 228, 0.14);
  background: rgba(255, 255, 255, 0.02);
}

.guided-task-list.compact .guided-task {
  min-height: 72px;
  padding: 10px;
}

.guided-task-list.compact .guided-task p {
  display: none;
}

.guided-task-list.compact .guided-task strong {
  font-size: 12px;
}

.presentation-mode .workspace-grid {
  grid-template-columns: minmax(0, 1fr);
}

.presentation-mode .workflow-rail {
  display: none;
}

.presentation-mode .panel.active-step {
  grid-column: 1;
}

.dashboard-mode .operator-progress {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.dashboard-mode .guided-task-list.compact {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.analysis-progress {
  display: grid;
  gap: 12px;
  margin-top: 18px;
  padding: 16px;
  border: 1px solid rgba(53, 208, 178, 0.32);
  border-radius: var(--radius);
  background:
    linear-gradient(90deg, rgba(53, 208, 178, 0.12), rgba(118, 184, 255, 0.05)),
    rgba(255, 255, 255, 0.035);
}

.analysis-progress.hidden {
  display: none;
}

.analysis-progress-header {
  display: flex;
  gap: 10px;
  align-items: center;
}

.analysis-spinner {
  width: 18px;
  height: 18px;
  border: 3px solid rgba(255, 255, 255, 0.18);
  border-top-color: var(--accent);
  border-radius: 999px;
  animation: analysisSpin 880ms linear infinite;
}

.analysis-progress.complete .analysis-spinner,
.analysis-progress.failed .analysis-spinner {
  animation: none;
  border-color: var(--accent);
}

.analysis-progress.failed {
  border-color: rgba(255, 112, 95, 0.45);
  background:
    linear-gradient(90deg, rgba(255, 112, 95, 0.12), rgba(243, 179, 75, 0.05)),
    rgba(255, 255, 255, 0.035);
}

@keyframes analysisSpin {
  to {
    transform: rotate(360deg);
  }
}

.analysis-meter {
  overflow: hidden;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.analysis-meter span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--blue));
  transition: width 220ms ease;
}

.analysis-progress.failed .analysis-meter span {
  background: linear-gradient(90deg, var(--danger), var(--accent-2));
}

.analysis-stage-list {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.analysis-stage-list li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 7px;
  align-items: center;
  min-height: 50px;
  padding: 9px;
  border: 1px solid rgba(199, 216, 228, 0.12);
  border-radius: var(--radius);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.025);
}

.analysis-stage-list li span {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  font-size: 11px;
  font-weight: 800;
}

.analysis-stage-list li strong {
  font-size: 11px;
  line-height: 1.25;
}

.analysis-stage-list li.active,
.analysis-stage-list li.done {
  color: var(--text);
  border-color: rgba(53, 208, 178, 0.28);
}

.analysis-stage-list li.done span {
  color: #03120f;
  background: var(--accent);
}

.analysis-stage-list li.failed {
  border-color: rgba(255, 112, 95, 0.42);
}

.analysis-stage-list li.failed span {
  color: #220904;
  background: var(--danger);
}

.suitability-details {
  margin-top: 18px;
  border: 1px solid rgba(199, 216, 228, 0.16);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.025);
}

.suitability-details summary {
  cursor: pointer;
  padding: 14px 16px;
  color: var(--text);
  font-weight: 800;
}

.suitability-details .suitability-grid {
  padding: 0 16px 16px;
}

.command-detail {
  display: grid;
  gap: 9px;
  min-width: 0;
}

.command-detail code {
  width: fit-content;
  max-width: 100%;
  padding: 5px 8px;
  border: 1px solid rgba(53, 208, 178, 0.22);
  border-radius: 6px;
  color: #dffcf5;
  background: rgba(53, 208, 178, 0.09);
  overflow-wrap: anywhere;
}

.command-detail dl {
  display: grid;
  gap: 6px;
  margin: 0;
}

.command-detail dl div {
  display: grid;
  grid-template-columns: minmax(120px, 0.24fr) minmax(0, 1fr);
  gap: 10px;
  padding-top: 6px;
  border-top: 1px solid rgba(199, 216, 228, 0.09);
}

.command-detail dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.command-detail dd {
  margin: 0;
  color: var(--text);
  overflow-wrap: anywhere;
}

@media (max-width: 1280px) {
  .operator-progress,
  .analysis-stage-list {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .guided-task-list.compact {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .presentation-toolbar,
  .summary-mainline,
  .toolbar-workflow-state,
  .command-detail dl div {
    grid-template-columns: 1fr;
  }

  .operator-progress,
  .analysis-stage-list,
  .guided-task-list.compact {
    grid-template-columns: 1fr;
  }
}

/* Mission control visual refresh */
:root {
  --bg: #05090f;
  --panel: rgba(10, 17, 25, 0.88);
  --panel-strong: #111b27;
  --line: rgba(178, 199, 215, 0.16);
  --line-strong: rgba(199, 216, 228, 0.34);
  --rail-bg: rgba(8, 14, 22, 0.76);
  --text: #f4f7f6;
  --muted: #94a8b3;
  --accent: #35d0b2;
  --accent-2: #f3b34b;
  --danger: #ff705f;
  --good: #8ce08f;
  --blue: #76b8ff;
  --phase-intake: #35d0b2;
  --phase-setup: #aab8ff;
  --phase-validate: #f3b34b;
  --phase-area: #76b8ff;
  --phase-evaluate: #8ce08f;
  --phase-approve: #efd46f;
  --phase-command: #d9b8ff;
  --shadow-soft: 0 22px 70px rgba(0, 0, 0, 0.34);
  --shadow-panel: 0 16px 46px rgba(0, 0, 0, 0.28);
  --radius: 8px;
}

html {
  color-scheme: dark;
}

body {
  min-height: 100vh;
  font-family: "Avenir Next", "IBM Plex Sans", "Segoe UI", ui-sans-serif, system-ui, sans-serif;
  background:
    linear-gradient(180deg, rgba(118, 184, 255, 0.08), transparent 260px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(180deg, rgba(255, 255, 255, 0.026) 1px, transparent 1px),
    linear-gradient(135deg, #05090f 0%, #07121c 48%, #05090f 100%);
  background-size: auto, 64px 64px, 64px 64px, auto;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(110deg, transparent 0 42%, rgba(53, 208, 178, 0.065) 42% 42.4%, transparent 42.4% 100%),
    linear-gradient(290deg, transparent 0 56%, rgba(243, 179, 75, 0.055) 56% 56.35%, transparent 56.35% 100%);
  opacity: 0.9;
}

.app-shell {
  width: min(1840px, 100%);
  margin: 0 auto;
}

.topbar {
  position: relative;
  overflow: hidden;
  padding: clamp(20px, 2.1vw, 34px);
  border-color: rgba(199, 216, 228, 0.24);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.075), transparent 36%),
    linear-gradient(180deg, rgba(13, 25, 37, 0.96), rgba(7, 13, 21, 0.92));
  box-shadow: var(--shadow-soft);
}

.topbar::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--blue), var(--accent-2));
}

.eyebrow,
.field-label {
  font-weight: 800;
  color: #9fb8c6;
}

h1 {
  max-width: 980px;
  font-size: clamp(28px, 2.8vw, 46px);
  line-height: 1.04;
  letter-spacing: 0;
}

h2 {
  line-height: 1.18;
}

.topbar-status,
.pill,
.phase-chip,
.status-chip,
.mini-pill,
.map-scale-badge {
  white-space: normal;
  line-height: 1.25;
}

.topbar-status {
  max-width: 360px;
  padding: 10px 12px;
  border: 1px solid rgba(178, 199, 215, 0.14);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.035);
  backdrop-filter: blur(12px);
}

.presentation-toolbar,
.workflow-rail,
.input-rail,
.output-rail,
.panel,
.clarification-box,
.workflow-callout,
.guided-task-list,
.scenario-flow,
.flow-node,
.satellite-card,
.decision-row,
.recommended-asset,
.timeline li,
.command-lane,
.suitability-card,
.boundary-card,
.custom-sat-row {
  border-radius: var(--radius);
}

.presentation-toolbar {
  padding: 18px;
  border-color: rgba(199, 216, 228, 0.24);
  background:
    linear-gradient(90deg, rgba(53, 208, 178, 0.09), transparent 42%),
    rgba(8, 15, 24, 0.9);
  box-shadow: var(--shadow-panel);
}

.workspace-grid {
  grid-template-columns: minmax(300px, 0.82fr) minmax(360px, 1fr) minmax(520px, 1.58fr);
}

.presentation-mode .workspace-grid {
  grid-template-columns: minmax(310px, 0.72fr) minmax(0, 1.86fr);
}

.workflow-rail,
.input-rail,
.output-rail {
  gap: 24px;
  border-color: rgba(199, 216, 228, 0.18);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.058), rgba(255, 255, 255, 0.014) 180px),
    linear-gradient(135deg, rgba(53, 208, 178, 0.04), transparent 42%),
    var(--rail-bg);
  box-shadow: var(--shadow-soft);
}

.workflow-rail::before,
.input-rail::before,
.output-rail::before {
  width: 3px;
  background: linear-gradient(180deg, var(--rail-accent), rgba(255, 255, 255, 0.42), transparent 82%);
}

.column-header {
  min-height: 104px;
  border-color: rgba(199, 216, 228, 0.2);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.07), transparent 58%),
    rgba(7, 14, 23, 0.74);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.panel {
  border-color: rgba(199, 216, 228, 0.18);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.065), transparent 112px),
    linear-gradient(135deg, rgba(118, 184, 255, 0.045), transparent 48%),
    var(--panel);
  box-shadow: var(--shadow-panel), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.panel[data-phase-label] {
  padding-top: 64px;
  border-top-width: 1px;
}

.panel[data-phase-label]::before {
  top: 16px;
  left: 20px;
  min-height: 26px;
  padding: 6px 10px;
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
}

.presentation-mode .panel.active-step {
  min-height: min(780px, calc(100vh - 184px));
  animation: stepReveal 320ms ease both;
}

@keyframes stepReveal {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.panel-heading {
  align-items: flex-start;
  border-bottom-color: rgba(199, 216, 228, 0.14);
}

.phase-chip {
  box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.18);
}

.pill,
.status-chip,
.mini-pill,
.state-pill {
  border-color: rgba(199, 216, 228, 0.2);
  background: rgba(255, 255, 255, 0.055);
}

.scenario-button,
.primary-button,
.secondary-button,
.ghost-button,
.upload-button,
.map-mode-button {
  min-height: 44px;
  border-color: rgba(199, 216, 228, 0.2);
  font-weight: 800;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.scenario-button:hover,
.primary-button:hover,
.secondary-button:hover,
.ghost-button:hover,
.upload-button:hover,
.map-mode-button:hover,
.progress-step:not(.locked):hover {
  transform: translateY(-1px);
  border-color: rgba(53, 208, 178, 0.48);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.2);
}

.scenario-button.active,
.primary-button,
.map-mode-button.active {
  border-color: rgba(53, 208, 178, 0.72);
  background: linear-gradient(180deg, #5de6cf, var(--accent));
  color: #03120f;
  box-shadow: 0 12px 28px rgba(53, 208, 178, 0.18);
}

.secondary-button {
  border-color: rgba(118, 184, 255, 0.34);
  background: rgba(118, 184, 255, 0.13);
}

.ghost-button {
  background: rgba(255, 255, 255, 0.02);
}

textarea,
input,
select {
  border-color: rgba(199, 216, 228, 0.2);
  background: rgba(3, 8, 14, 0.56);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
  outline: none;
}

textarea:focus,
input:focus,
select:focus {
  border-color: rgba(53, 208, 178, 0.72);
  box-shadow: 0 0 0 3px rgba(53, 208, 178, 0.13), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.progress-step,
.guided-task,
.scenario-flow,
.satellite-card,
.decision-row,
.recommended-asset,
.timeline li,
.command-lane,
.suitability-card,
.boundary-card,
.custom-sat-row,
.clarification-box {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.055), transparent 95px),
    rgba(255, 255, 255, 0.032);
}

.progress-step {
  border-color: rgba(199, 216, 228, 0.16);
}

.progress-step span,
.guided-task::before,
.flow-node span {
  box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.26);
}

.progress-step.active,
.guided-task.active,
.scenario-flow.active {
  border-color: rgba(53, 208, 178, 0.52);
  background:
    linear-gradient(90deg, rgba(53, 208, 178, 0.14), rgba(53, 208, 178, 0.045)),
    rgba(255, 255, 255, 0.035);
}

.progress-step.presentation-current {
  border-color: rgba(118, 184, 255, 0.62);
  box-shadow: inset 3px 0 0 var(--blue), 0 0 0 1px rgba(118, 184, 255, 0.12);
}

.guided-task-list,
.workflow-callout {
  border-color: rgba(199, 216, 228, 0.16);
}

.mission-map {
  min-height: 460px;
  border-color: rgba(199, 216, 228, 0.24);
  background:
    linear-gradient(135deg, rgba(18, 52, 70, 0.88), rgba(6, 15, 24, 0.94)),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(180deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: auto, 52px 52px, 52px 52px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.035), 0 24px 54px rgba(0, 0, 0, 0.28);
}

.mission-map.has-image {
  background-image:
    linear-gradient(180deg, rgba(4, 9, 14, 0.02), rgba(4, 9, 14, 0.62)),
    var(--map-image);
}

.map-grid {
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(180deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.9), rgba(0, 0, 0, 0.36));
}

.mission-map.idle::after {
  background:
    linear-gradient(180deg, rgba(4, 9, 14, 0.24), rgba(4, 9, 14, 0.64)),
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 16px);
  font-weight: 800;
}

.map-target {
  color: #241300;
  background: rgba(243, 179, 75, 0.9);
  border-color: rgba(255, 238, 206, 0.8);
  box-shadow: 0 0 0 6px rgba(243, 179, 75, 0.15), 0 14px 34px rgba(0, 0, 0, 0.26);
}

.track {
  height: 3px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.24), rgba(53, 208, 178, 0.72), transparent);
}

.satellite {
  border-color: rgba(199, 216, 228, 0.24);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.11), transparent),
    rgba(4, 10, 16, 0.92);
  font-weight: 800;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
}

.satellite.selected {
  border-color: rgba(53, 208, 178, 0.88);
  box-shadow: 0 0 0 3px rgba(53, 208, 178, 0.16), 0 10px 24px rgba(0, 0, 0, 0.28);
}

.map-navigation-controls,
.map-scale-badge {
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(3, 8, 14, 0.78);
}

.key-value-list div {
  grid-template-columns: minmax(126px, 0.36fr) 1fr;
  border-bottom-color: rgba(199, 216, 228, 0.11);
}

.decision-row {
  grid-template-columns: minmax(70px, 0.18fr) 1fr auto;
}

.command-output {
  border-color: rgba(53, 208, 178, 0.2);
  background:
    linear-gradient(180deg, rgba(53, 208, 178, 0.055), transparent 120px),
    #03080d;
  color: #dffcf5;
  font-family: "SF Mono", "Cascadia Code", "Roboto Mono", ui-monospace, monospace;
}

.good {
  color: #a0eba2;
}

.warn {
  color: #ffd17b;
}

.bad {
  color: #ff8c7e;
}

@media (max-width: 1280px) {
  .presentation-mode .panel.active-step {
    min-height: 620px;
  }
}

@media (max-width: 720px) {
  .app-shell {
    padding: 12px;
  }

  .topbar {
    padding: 18px;
  }

  .topbar-status {
    max-width: none;
  }

  .presentation-toolbar {
    gap: 12px;
  }

  .panel,
  .column-header {
    padding: 18px;
  }

  .panel[data-phase-label] {
    padding-top: 58px;
  }

  .presentation-mode .panel.active-step {
    min-height: auto;
  }

  .decision-row {
    grid-template-columns: 1fr;
  }
}

/* Companion polish for the consolidated mission strip and LLM progress states. */
.summary-mainline {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.presentation-toolbar .presentation-step-summary {
  gap: 14px;
}

.presentation-toolbar .operator-progress {
  grid-template-columns: repeat(8, minmax(88px, 1fr));
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: thin;
}

.presentation-toolbar .flow-section-label {
  display: none;
}

.presentation-toolbar .progress-step {
  min-height: 66px;
  padding: 10px;
  grid-template-columns: 26px minmax(0, 1fr);
}

.presentation-toolbar .progress-step span {
  width: 24px;
  height: 24px;
  font-size: 11px;
}

.presentation-toolbar .progress-step strong {
  font-size: 12px;
}

.presentation-toolbar .progress-step small {
  display: none;
}

.toolbar-workflow-state {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid rgba(199, 216, 228, 0.16);
  border-radius: var(--radius);
  background:
    linear-gradient(90deg, rgba(53, 208, 178, 0.1), transparent 58%),
    rgba(255, 255, 255, 0.035);
}

.toolbar-workflow-state p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.guided-task-list.compact {
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  border-color: rgba(199, 216, 228, 0.13);
  overflow-x: auto;
}

.guided-task-list.compact .guided-task {
  min-height: 92px;
  padding: 12px;
}

.analysis-progress {
  display: grid;
  gap: 12px;
  margin-top: 16px;
  padding: 16px;
  border: 1px solid rgba(53, 208, 178, 0.26);
  border-radius: var(--radius);
  background:
    linear-gradient(120deg, rgba(53, 208, 178, 0.12), transparent 62%),
    rgba(3, 8, 14, 0.48);
}

.analysis-progress.hidden {
  display: none;
}

.analysis-progress.failed {
  border-color: rgba(255, 112, 95, 0.38);
  background:
    linear-gradient(120deg, rgba(255, 112, 95, 0.11), transparent 62%),
    rgba(3, 8, 14, 0.48);
}

.analysis-progress.complete {
  border-color: rgba(140, 224, 143, 0.38);
}

.analysis-progress-header {
  display: flex;
  gap: 10px;
  align-items: center;
}

.analysis-spinner {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  border: 2px solid rgba(244, 247, 246, 0.2);
  border-top-color: var(--accent);
  border-radius: 999px;
  animation: analysisSpin 900ms linear infinite;
}

.analysis-progress.failed .analysis-spinner,
.analysis-progress.complete .analysis-spinner {
  animation: none;
}

.analysis-progress.failed .analysis-spinner {
  border-color: var(--danger);
}

.analysis-progress.complete .analysis-spinner {
  border-color: var(--good);
  background: var(--good);
}

@keyframes analysisSpin {
  to {
    transform: rotate(360deg);
  }
}

.analysis-meter {
  overflow: hidden;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.analysis-meter span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--blue));
  transition: width 240ms ease;
}

.analysis-progress.failed .analysis-meter span {
  background: linear-gradient(90deg, var(--danger), var(--accent-2));
}

.analysis-stage-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.analysis-stage-list li {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
}

.analysis-stage-list li span {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 1px solid rgba(199, 216, 228, 0.18);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.035);
  font-size: 11px;
  font-weight: 800;
}

.analysis-stage-list li.done span,
.analysis-stage-list li.active span {
  color: #03120f;
  background: var(--accent);
  border-color: transparent;
}

.analysis-stage-list li.failed span {
  color: #1b0705;
  background: var(--danger);
  border-color: transparent;
}

.analysis-stage-list li.done strong,
.analysis-stage-list li.active strong {
  color: var(--text);
}

.suitability-details {
  margin-top: 18px;
  border: 1px solid rgba(199, 216, 228, 0.16);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.032);
}

.suitability-details summary {
  cursor: pointer;
  padding: 14px 16px;
  color: var(--text);
  font-weight: 800;
}

.suitability-details[open] summary {
  border-bottom: 1px solid rgba(199, 216, 228, 0.12);
}

.suitability-details .suitability-grid {
  padding: 16px;
}

@media (max-width: 1280px) {
  .presentation-toolbar .operator-progress,
  .guided-task-list.compact {
    grid-template-columns: repeat(4, minmax(130px, 1fr));
  }
}

@media (max-width: 720px) {
  .summary-mainline,
  .toolbar-workflow-state {
    grid-template-columns: 1fr;
  }

  .presentation-toolbar .operator-progress,
  .guided-task-list.compact {
    grid-template-columns: 1fr;
  }
}

/* Final layout authority: flow lives in the top strip, not the side rail. */
.presentation-toolbar {
  display: grid;
}

.presentation-mode .workspace-grid {
  grid-template-columns: minmax(0, 1fr);
}

.presentation-mode .workflow-rail {
  display: none;
}

.presentation-mode .panel.active-step {
  grid-column: 1;
}

.dashboard-mode .workspace-grid {
  grid-template-columns: minmax(260px, 0.62fr) minmax(360px, 0.92fr) minmax(520px, 1.46fr);
}

.dashboard-mode .workflow-rail {
  display: grid;
  position: relative;
  max-height: none;
  overflow: visible;
}
