/* editor.css — App shell, workspaces, and editor-specific UI patterns.
 * Tokens (CSS vars) live in tokens.css. Reusable components live in components.css.
 * This file owns: body/reset, topbar, activity rail, workspace layouts,
 * region tree, history panel, context menu, inspector/detail. */

/* ── reset ── */
* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }

/* Ported from the reference's `body {}` rule. Scoped to `.editor-page` because the Blazor
   WASM app shares one <body> across all routes (dashboard, editor, …); the editor's shell
   is the full-screen wrapper instead. This is the only adaptation to the ported editor.css. */
.editor-page {
  font-family: ui-monospace, monospace;
  font-size: var(--font-lg);
  background: var(--bg-base);
  color: var(--text-bright);
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

/* ══════════════════════════════════════════════════════════════════════════
   TOP BAR
   ══════════════════════════════════════════════════════════════════════════ */

.topbar {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) 14px;
  background: var(--bg-panel);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  position: relative;
}

.topbar-breadcrumb-home {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: var(--font-md);
  white-space: nowrap;
}
.topbar-breadcrumb-home:hover { color: var(--text-strong); }
.topbar-sep  { color: var(--text-muted); font-size: var(--font-base); user-select: none; }
.topbar-crumb { font-size: var(--font-md); color: var(--text-primary); white-space: nowrap; }
.topbar-crumb--dim { color: var(--text-secondary); }
/* The drawing is not in the studio. Loud on purpose: it is the only thing between an author and
   losing every edit made since the last save the server took. */
.topbar-crumb--warn { color: var(--color-warning); font-weight: 600; max-width: 46ch; overflow: hidden; text-overflow: ellipsis; }

.topbar-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

/* Wizard save indicator (ND4): quiet text in the topbar — Saved · Saving… · Unsaved. */
.topbar-save-status {
  font-size: var(--font-sm);
  color: var(--text-muted);
  white-space: nowrap;
}

/* Sketch topbar export actions */
.topbar-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.topbar-changes-badge {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  font-size: var(--font-sm);
  color: var(--color-warning);
  white-space: nowrap;
}
.topbar-changes-badge svg { width: var(--icon-xs); height: var(--icon-xs); flex-shrink: 0; }


/* ══════════════════════════════════════════════════════════════════════════
   EDITOR PAGE — main layout
   ══════════════════════════════════════════════════════════════════════════ */

.app-body { display: flex; flex: 1; min-height: 0; overflow: hidden; }
.activity-viewport { display: flex; flex: 1; min-width: 0; overflow: hidden; }

/* A phase's flow-bar + body, stacked so the flow-bar is a flush strip under the topbar (no gaps, like
   the editor shell): tight against the topbar + rail, the workspace tight against it. Shared by the
   Configure wizard (see new-map-authoring.md §12) and the Edit activities with steps (Setup, Build). */
.phase-body { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.flow-bar--flush { flex-shrink: 0; border: 0; border-bottom: 1px solid var(--border); border-radius: 0; }
.phase-body > .workspace { flex: 1; min-height: 0; }

/* ── App footer (dashboard shell — bottom counterpart to the topbar) ── */
.app-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  flex-shrink: 0;
  padding: var(--space-2) 14px;
  background: var(--bg-panel);
  border-top: 1px solid var(--border);
  font-size: var(--font-base);
}
.app-footer-brand { color: var(--text-muted); user-select: none; }
.app-footer-links { display: flex; align-items: center; gap: var(--space-4); }
.app-footer-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  color: var(--text-secondary);
  text-decoration: none;
}
.app-footer-link:hover { color: var(--text-strong); }
.app-footer-link svg { width: var(--icon-sm); height: var(--icon-sm); }

/* ── sidebar resize handles ── */
.sidebar-handle {
  width: 9px;
  flex-shrink: 0;
  cursor: ew-resize;
  background: var(--bg-panel);
  position: relative;
  touch-action: none;   /* a touch-drag resizes the panel rather than scrolling the page */
}
.sidebar-handle::before {
  content: '';
  position: absolute;
  top: 0; bottom: 0; left: 50%;
  transform: translateX(-50%);
  width: 1px;
  background: var(--border);
  transition: background var(--transition-fast);
}
.sidebar-handle:hover::before,
.sidebar-handle--dragging::before { background: var(--accent); }

/* ── SVG areas ── */
.svg-area {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 12px;
  background: var(--bg-canvas);
  position: relative;   /* anchors the 2-D world surface below the svg (see .world-canvas-2d) */
}

/* The painted world layers of a hybrid surface: a <canvas> pinned under the <svg>, inset by the same
   12px padding so the two share a coordinate origin exactly. It never takes the pointer — the svg above
   stays the single event target, so hit-testing and the drag machinery are unaffected by what paints. */
.world-canvas-2d {
  position: absolute;
  top: 12px;
  left: 12px;
  pointer-events: none;
}
/* Positioned so it stacks above the canvas that precedes it in the DOM. */
.map-canvas-svg { position: relative; }
.map-svg { max-width: 100%; max-height: 100%; cursor: default; }

/* Build-height side-view canvas (C7) — fills its .svg-area; SideviewCanvas sizes the bitmap
   from this element's client box, so it must have real dimensions (no padding shrink surprises). */
.sideview-canvas { width: 100%; height: 100%; display: block; }

/* layer toggle item */
.layer-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: var(--font-base);
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
}
.layer-item input { accent-color: var(--text-muted); cursor: pointer; }

/* draw toolbar */
.draw-tool-btn {
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 4px 5px;
  cursor: pointer;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color var(--transition-fast), background var(--transition-fast), border-color var(--transition-fast);
}
.draw-tool-btn:hover:not(:disabled) { background: var(--border); color: var(--text-bright); }
.draw-tool-btn:disabled { opacity: 0.35; cursor: default; }
.draw-tool-btn--active {
  background: var(--bg-selected);
  border-color: var(--accent);
  color: var(--accent-light);
}
/* ── NAV RAIL ── */
.nav-rail {
  width: 56px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 6px 0 var(--space-2);
  gap: 2px;
  background: var(--bg-panel);
  border-right: 1px solid var(--border);
}
.nav-logo {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 10px 0;
  flex-shrink: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 6px;
}
.nav-logo-box {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background: var(--bg-deep);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
}
.nav-logo-pgm {
  font-family: ui-monospace, monospace;
  font-size: var(--font-sm);
  font-weight: 700;
  color: var(--text-strong);
  letter-spacing: 0.05em;
  line-height: 1;
}
.nav-logo-sub {
  font-family: ui-monospace, monospace;
  font-size: 6px;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.22em;
  line-height: 1;
}

.nav-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 0;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0;
  transition: color var(--transition-fast);
}
.nav-rail .nav-btn svg { width: var(--icon-lg); height: var(--icon-lg); }
.nav-btn:not(:disabled):hover { color: var(--text-strong); }
.nav-btn.active { color: var(--text-strong); }
.nav-btn.active::before {
  content: '';
  position: absolute;
  left: 0; top: 8px; bottom: 8px;
  width: 2px;
  background: var(--text-strong);
  border-radius: 0 2px 2px 0;
}
.nav-btn:disabled { opacity: 0.3; cursor: not-allowed; }

/* Nav status dots */
.nav-btn::after {
  content: "";
  display: none;
  position: absolute;
  bottom: 3px;
  right: 3px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  border: 1.5px solid var(--bg-panel);
  pointer-events: none;
}
.nav-btn[data-status="green"]::after  { display: block; background: var(--color-success); }
.nav-btn[data-status="yellow"]::after { display: block; background: var(--color-warning); }
.nav-btn[data-status="red"]::after    { display: block; background: var(--color-error); }

/* ══════════════════════════════════════════════════════════════════════════
   WORKSPACE STRUCTURE  (shared shell — all activities use these classes)
   ID selectors below only set what is unique per element (width, gap, etc.)
   ══════════════════════════════════════════════════════════════════════════ */

/* Fills the activity viewport — one per activity, display: flex row */
.workspace { display: flex; flex: 1; overflow: hidden; }

/* Left sidebar — list / form content */
.workspace-sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  background: var(--bg-panel);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Right sidebar — detail / property inspector */
.workspace-inspector {
  width: var(--inspector-width);
  flex-shrink: 0;
  background: var(--bg-panel);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
/* An inspector that hosts a whole material form rather than a property list — the dressing phase's, which
   embeds the same editor the style library opens in its rail. It starts at a width that form is readable
   at; the resize handle still takes it anywhere in [MIN_WIDTH, MAX_WIDTH]. */
.workspace-inspector--wide { width: 420px; }

/* Scrollable inner content area of a sidebar — holds .panel-section blocks */
.workspace-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  scrollbar-gutter: stable;
  padding: var(--space-4) 14px;
  gap: var(--space-6);
  display: flex;
  flex-direction: column;
}

/* Canvas / main content column. position:relative makes it a positioning context
   for .canvas-hint and any other absolute overlays inside the canvas. */
.workspace-canvas {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg-canvas);
  position: relative;
}

/* Placeholder state for activities not yet implemented */
.workspace--placeholder {
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: var(--font-md);
}

/* Placeholder block for pages not yet implemented (configure stub, etc.) */
.page-placeholder {
  padding: var(--space-6);
  color: var(--text-muted);
  font-size: var(--font-md);
}

/* ══════════════════════════════════════════════════════════════════════════
   OVERVIEW WORKSPACE
   ══════════════════════════════════════════════════════════════════════════ */



/* ══════════════════════════════════════════════════════════════════════════
   TEAMS WORKSPACE
   ══════════════════════════════════════════════════════════════════════════ */

/* user-select:none — a drag on the drawing surface (ruler, resize, pan) must never select the SVG
   text labels/readouts drawn on top of it. */
.map-canvas-svg { max-width: 100%; max-height: 100%; cursor: default; user-select: none; -webkit-user-select: none; }


/* ══════════════════════════════════════════════════════════════════════════
   REGIONS WORKSPACE (future)
   ══════════════════════════════════════════════════════════════════════════ */

/* Explicit collection wrapper for recursive region rows. */
.region-tree { min-width: 0; }

/* Visibility-toggle icon button — appears on row hover */
.geo-row:hover .vis-btn    { opacity: 1; }
.vis-btn--hidden           { opacity: 1; }

/* ── Region tree row details (used by map-canvas + region sidebar) ── */
.geo-row {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 4px 12px 4px 14px;
  cursor: pointer;
  user-select: none;
  min-height: 28px;
}
.geo-row:hover           { background: var(--bg-selected-hover); }
.geo-row--selected       { background: var(--bg-selected); }
.geo-row--selected-child { background: var(--bg-selected-child); }
.geo-indent { flex-shrink: 0; display: flex; align-items: center; }
.indent-pipe   { display: inline-block; width: 14px; flex-shrink: 0; }
.geo-type-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  line-height: 0;
  margin-right: 6px;
}
.geo-type-icon--warning { color: var(--color-warning); }
.geo-type-icon--flush { margin-right: 0; }
.geo-label {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: var(--font-base);
  color: var(--text-primary);
}
.geo-label--synthetic { font-style: italic; color: var(--text-muted); }

/* Island name inline-edit: looks like text when readonly, becomes an input on dblclick */
.geo-label-input {
  background: none;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 0;
  font-family: inherit;
  min-width: 0;
  cursor: default;
}
.geo-label-input:not([readonly]) {
  background: var(--bg-base);
  border-color: var(--accent);
  padding: 0 4px;
  cursor: text;
  outline: none;
}

/* Faint "base" label on the first child of a complement region */
.complement-base-tag {
  flex-shrink: 0;
  font-size: var(--font-xs);
  color: var(--text-muted);
  margin: 0 6px;
  letter-spacing: 0.04em;
  pointer-events: none;
}

/* Collapse/expand chevron. Negative left margin collapses its flow width
   so the tree icon always aligns with the category title. */
.collapse-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  color: var(--text-muted);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border-radius: var(--radius-sm);
  margin-left: -14px;
}
.collapse-btn:hover { color: var(--text-secondary); }

/* ── History panel ── */
#history-panel {
  flex-shrink: 0;
  max-height: 140px;
  overflow-y: auto;
  border-top: 1px solid var(--border);
  padding: var(--space-2) 14px 10px;
}
#history-panel .section-title { margin-bottom: 5px; }
.history-entry {
  font-size: var(--font-sm);
  padding: 1px 4px;
  border-radius: var(--radius-sm);
  font-family: ui-monospace, monospace;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  user-select: none;
  cursor: default;
}
.history-entry--undo    { color: var(--text-muted); }
.history-entry--redo    { color: var(--text-muted); opacity: 0.55; text-decoration: line-through; }
.history-entry--divider { color: var(--text-muted); font-size: var(--font-xs); text-align: center; padding: 2px 0; opacity: 0.5; }
.history-entry--empty   { color: var(--text-muted); font-style: italic; }

/* ── cat headers / tree ── */
.cat-header {
  padding: 10px 14px 6px;
  font-size: var(--font-base);
  font-weight: 500;
  letter-spacing: .02em;
  color: var(--text-strong);
  user-select: none;
}
.cat-divider { margin: 6px 14px; border-top: 1px solid var(--border); }

/* ── context menu ── */
.ctx-menu {
  position: fixed;
  z-index: 9999;
  min-width: 160px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-float);
  padding: 4px;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.ctx-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 5px 10px;
  background: none;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: var(--font-base);
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}
.ctx-item:hover  { background: var(--bg-selected-hover); color: var(--text-bright); }
.ctx-item--danger:hover { background: var(--color-error-bg); color: var(--color-error); }
.ctx-item kbd {
  font-size: var(--font-xs);
  color: var(--text-muted);
  background: var(--bg-base);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1px 5px;
  font-family: inherit;
  white-space: nowrap;
}
.ctx-sep { height: 1px; background: var(--border); margin: 3px 0; }

/* ── detail widget (editor-specific — XML preview, region coordinate groups) ── */
.detail-xml-pre {
  background: var(--bg-base);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--code-color);
  font-family: ui-monospace, monospace;
  font-size: var(--font-sm);
  line-height: 1.55;
  margin: 0;
  overflow-x: auto;
  padding: var(--space-2) 10px;
  white-space: pre;
}


/* ══════════════════════════════════════════════════════════════════════════
   CONFIGURE ACTIVITY LAYOUT  (inside editor shell)
   ══════════════════════════════════════════════════════════════════════════ */

/* Step panel — wraps one or more panel-section blocks inside cfg-scroll.
   Must replicate the same gap that .workspace-scroll gives to direct
   panel-section children so section spacing is consistent across all steps. */
.cfg-step-panel { display: flex; flex-direction: column; gap: var(--space-6); }

/* Inspector side-view slice (mini SideviewCanvas) — fixed-height box; the canvas fills it 1:1. */
.slice-view { position: relative; height: 150px; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; background: var(--bg-canvas); }
.slice-canvas { display: block; width: 100%; height: 100%; }

/* Slice header: "Side view" label + the X/Z look-axis toggle on one row. */
.slice-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); margin-bottom: var(--space-2); }
.slice-axis { display: flex; gap: 2px; flex-shrink: 0; }

/* ══════════════════════════════════════════════════════════════════════════
   PLAN EDITOR (the seed studio)
   ══════════════════════════════════════════════════════════════════════════ */

/* Inspector stepper / readout value. */
.plan-stepper-value {
  flex: 1;
  align-self: center;
  text-align: center;
  font-size: var(--font-base);
  color: var(--text-bright);
  font-variant-numeric: tabular-nums;
}
.plan-readout {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--font-base);
  color: var(--text-bright);
}

/* Lint panel (inspector) — click a row to pulse its subjects on the canvas. */
.plan-lint-ok {
  display: flex; align-items: center; gap: var(--space-2);
  font-size: var(--font-sm); color: var(--text-muted); padding: var(--space-1) 0;
}
.plan-lint-ok svg { width: var(--icon-md); height: var(--icon-md); color: var(--color-success); }
.plan-lint-list { display: flex; flex-direction: column; gap: 3px; }
.plan-lint-row {
  display: flex; align-items: flex-start; gap: var(--space-2);
  width: 100%; text-align: left; padding: 5px 6px;
  background: transparent; border: 1px solid transparent; border-radius: var(--radius-sm);
  color: var(--text-secondary); font-size: var(--font-sm); font-family: inherit; cursor: pointer;
}
.plan-lint-row:hover { background: var(--border); color: var(--text-bright); border-color: var(--accent); }
.plan-lint-dot { flex-shrink: 0; width: 8px; height: 8px; border-radius: 50%; margin-top: 4px; }
.plan-lint-dot--error { background: #d9534f; }
.plan-lint-dot--lint  { background: #d9a441; }
.plan-lint-chip {
  flex-shrink: 0; font-family: ui-monospace, monospace; font-size: var(--font-xs);
  font-weight: 600; color: var(--accent-lighter); background: var(--bg-selected);
  border-radius: var(--radius-sm); padding: 0 5px; line-height: 1.5;
}
.plan-lint-msg { line-height: 1.35; }
/* Open-from-DB rows reuse .plan-lint-row: name takes the slack, the date sits right-aligned and muted. */
.plan-db-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plan-db-date { flex-shrink: 0; color: var(--text-secondary); font-size: var(--font-xs); }
/* A generated row whose composer has moved on: the stored plan still opens as-is, but its descriptor no
   longer reproduces it, so the marker sits on the origin chip rather than on the row. */
.plan-db-stale {
  flex-shrink: 0; font-family: ui-monospace, monospace; font-size: var(--font-xs);
  color: #d9a441; border: 1px solid currentColor; border-radius: var(--radius-sm);
  padding: 0 4px; line-height: 1.4; opacity: 0.85;
}
.plan-lint-row--static { cursor: default; }
.plan-lint-row--static:hover { background: transparent; color: var(--text-secondary); border-color: transparent; }
/* Selected violation — its evidence is isolated on the canvas; the row stays lit (persistent, unlike hover). */
.plan-lint-row--active,
.plan-lint-row--active:hover { background: var(--bg-selected); color: var(--text-bright); border-color: var(--accent); }

/* Feasibility panel — one group per box, findings indented under their box's clickable head. The unit-level
   findings sit in their own group above, rule-cited like the rest but belonging to no single box. */
.plan-feas-unit { margin-bottom: var(--space-3); }
.plan-feas-unit-title,
.plan-feas-box + .plan-feas-box { border-top: 1px solid var(--border); }
.plan-feas-unit-title {
  border-top: 0; padding-bottom: var(--space-1);
  font-size: var(--font-xs); font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
  color: var(--text-secondary);
}
.plan-feas-box { padding-top: var(--space-2); margin-top: var(--space-2); }
.plan-feas-head {
  display: flex; align-items: baseline; gap: var(--space-2);
  width: 100%; text-align: left; padding: 4px 6px;
  background: transparent; border: 1px solid transparent; border-radius: var(--radius-sm);
  color: var(--text-bright); font-size: var(--font-sm); font-family: inherit; cursor: pointer;
}
.plan-feas-head:hover:not(:disabled) { background: var(--border); border-color: var(--accent); }
.plan-feas-head:disabled { cursor: default; }
.plan-feas-head--active,
.plan-feas-head--active:hover { background: var(--bg-selected); border-color: var(--accent); }
.plan-feas-id { font-family: ui-monospace, monospace; font-weight: 600; }
.plan-feas-identity { margin-left: auto; color: var(--text-secondary); font-size: var(--font-xs); }
.plan-lint-dot--ok { background: var(--success, #3fae74); }
/* A finding line: the cited id (if any) then the detail, indented under its box head. */
.plan-feas-finding {
  display: flex; align-items: flex-start; gap: var(--space-2);
  padding: 3px 6px 3px 20px;
  color: var(--text-secondary); font-size: var(--font-sm); line-height: 1.35;
}
.plan-feas-finding--ok { color: var(--success, #3fae74); font-family: ui-monospace, monospace; font-size: var(--font-xs); }

/* Compile & test drawer body content — the walk-test loop's tabs/JSON/errors/draft. The drawer shell
   itself (backdrop · panel · header · body · footer) is the reusable SideDrawer (.side-drawer-* in
   components.css); these classes style what sits inside its Body/Footer. */
.plan-compile-tabs {
  display: flex; align-items: center; gap: var(--space-2);
  flex-wrap: wrap;
}
.plan-compile-tab-actions { display: inline-flex; gap: var(--space-2); margin-left: auto; }
.plan-compile-json {
  flex: 1; min-height: 0; overflow: auto; margin: 0;
  padding: var(--space-2) var(--space-3);
  background: var(--bg-code, var(--bg-selected)); border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-family: ui-monospace, monospace; font-size: var(--font-xs); line-height: 1.45;
  color: var(--text-bright); white-space: pre; tab-size: 2;
}
.plan-compile-errors { display: flex; flex-direction: column; gap: 3px; }
.plan-compile-warnings { display: flex; flex-direction: column; gap: 3px; margin-bottom: 10px; }
.plan-compile-draft { display: flex; flex-direction: column; gap: var(--space-2); }
.plan-compile-draft a.action-btn { text-decoration: none; justify-content: center; }
.plan-compile-draft-error { color: var(--color-error); }

/* The rebuild confirmation: what a second build trades, said before it happens rather than discovered
   after. Two marked lines — what goes, what stays — so the shape of the answer is readable at a glance. */
.plan-rebuild-warn {
  display: flex; flex-direction: column; gap: var(--space-2);
  padding: var(--space-3);
  border: 1px solid var(--color-warning);
  border-radius: var(--radius-md);
  background: var(--color-warning-bg);
}

.plan-rebuild-list { display: flex; flex-direction: column; gap: var(--space-2); margin: 0; padding: 0; list-style: none; }
.plan-rebuild-list li { display: flex; align-items: flex-start; gap: var(--space-2); font-size: var(--font-sm); color: var(--text-secondary); }
.plan-rebuild-mark { flex-shrink: 0; display: flex; margin-top: 1px; }
.plan-rebuild-mark svg { width: var(--icon-md); height: var(--icon-md); }
.plan-rebuild-mark--drop svg { color: var(--color-warning); }
.plan-rebuild-mark--keep svg { color: var(--color-success); }
