/* USDC Control Plane — base shell (Phase 1) */

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

:root {
  /* Inspired by intentional, human-centric product marketing UX: restrained surfaces, vivid accent, readable type — standalone (no attribution). */
  --font-sans: "IBM Plex Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
    sans-serif;
  --font-mono: "IBM Plex Mono", var(--font-mono);

  --text-primary: #fafaf9;
  --text-body: #e7e5e4;
  --text-muted: #a8a29e;
  --text-dim: #78716c;

  --ink: #151210;
  --surface-panel: #1f1d1b;
  --surface-mid: #2c2724;
  --surface-line: #3a3632;

  --accent: #ea682b;
  --accent-bright: #ffa24a;
  --accent-hover: #ffc074;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: var(--font-sans);
  /* Aligns seam with desktop-shell bliss sky gradient */
  background-color: #4a93d9;
  color: var(--text-primary);
  line-height: 1.5;
}

#app-root {
  min-height: 100vh;
  padding: 0;
}

#app-root.app-mount {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ---- Phase 2 — boot sequence ---- */

.boot-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
  background: var(--ink);
  transition: opacity 0.28s ease, visibility 0.28s ease;
}

.boot-overlay--out {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.boot-log {
  flex: 1;
  margin: 0;
  overflow: auto;
  font-family: var(--font-mono);
  font-size: clamp(13px, 1.85vw, 15px);
  line-height: 1.65;
  color: var(--accent-bright);
}

.boot-line {
  margin: 0 0 0.35rem;
  white-space: pre-wrap;
  word-break: break-word;
}

/* ---- Phase 2 / 2.5 — desktop shell ---- */

.desktop-shell {
  position: relative;
  min-height: 100vh;
  padding-bottom: 3rem;
  /* Bliss-inspired landscape (original Windows XP wallpaper is Microsoft IP; homage via CSS gradients) */
  --bliss-sky-0: #4a93d9;
  --bliss-sky-1: #7fb8ec;
  --bliss-sky-2: #9ec8e8;
  --bliss-hill-mid: #6cb84a;
  --bliss-hill-near: #3d8a32;
  --bliss-hill-shadow: #2a5f24;
  background-color: var(--bliss-sky-0);
  background-image:
    radial-gradient(ellipse 130% 55% at 50% 108%, var(--bliss-hill-near) 0%, var(--bliss-hill-shadow) 48%, transparent 49%),
    radial-gradient(ellipse 90% 40% at 18% 96%, rgba(110, 200, 90, 0.55) 0%, transparent 52%),
    radial-gradient(ellipse 70% 35% at 88% 92%, rgba(90, 180, 75, 0.45) 0%, transparent 50%),
    linear-gradient(180deg, var(--bliss-sky-0) 0%, var(--bliss-sky-1) 38%, var(--bliss-sky-2) 58%, #a8d4a0 78%, var(--bliss-hill-mid) 100%);
  background-attachment: fixed;
}

.desktop-shell--chromed {
  flex: 1;
  min-height: 0;
}

.desktop-window.desktop-window--closed:not(.desktop-window--minimized) {
  display: none !important;
}

.desktop-window.desktop-window--minimized {
  display: flex !important;
  max-height: 2.85rem;
}

.desktop-window.desktop-window--minimized .desktop-window__body {
  display: none !important;
}

.desktop-window.desktop-window--minimized .desktop-window__head {
  flex: 1;
  padding: 0.32rem 0.45rem;
  border-bottom: none;
}

.desktop-window.desktop-window--minimized .desktop-window__btn--minimize {
  visibility: hidden;
  pointer-events: none;
}

.desktop-window.desktop-window--minimized .desktop-window__title {
  font-size: 0.7rem;
}

/* Phase 2.5 — draggable desktop icons */

.desktop-icons-surface {
  position: absolute;
  inset: 0;
  z-index: 8;
  pointer-events: none;
}

.desktop-draggable-icon {
  position: absolute;
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 0.28rem;
  width: 5.65rem;
  margin: 0;
  padding: 0;
  /* Idle: arrow like Windows desktop; grabbing is set via JS during icon drag only. */
  cursor: default;
  font-family: inherit;
  color: inherit;
  text-align: center;
  text-decoration: none;
  background: transparent;
  border: none;
  box-sizing: border-box;
}

.desktop-draggable-icon:focus-visible {
  outline: 2px solid var(--accent-bright);
  outline-offset: 3px;
  border-radius: 10px;
}

.desktop-draggable-icon-tile {
  display: grid;
  place-items: center;
  width: 3.1rem;
  height: 3.1rem;
  margin: 0 auto;
  border-radius: 10px;
  font-size: 1.75rem;
  line-height: 1;
  color: inherit;
  background: rgba(26, 22, 19, 0.68);
  border: 1px solid rgba(255, 255, 255, 0.09);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.2) inset,
    0 8px 20px rgba(0, 0, 0, 0.32);
}

.desktop-draggable-icon-label {
  max-width: 5.85rem;
  font-size: 0.62rem;
  font-weight: 600;
  line-height: 1.28;
  letter-spacing: 0.02em;
  color: #fff;
  text-shadow:
    0 1px 2px rgba(0, 0, 0, 0.9),
    0 0 1px rgba(0, 0, 0, 0.8);
}

.desktop-draggable-icon--program .desktop-draggable-icon-tile {
  background: rgba(36, 30, 26, 0.78);
}

/* Doc / outbound tiles (PostHog-style “file on desk”) */
.desktop-draggable-icon--file {
  width: 6rem;
}

/* Hover hint: URL still appears in browser status bar for real links; this repeats it in-page. */
.desktop-draggable-icon--file::after {
  content: attr(data-link-hint);
  display: block;
  position: absolute;
  left: 50%;
  top: calc(100% + 0.35rem);
  transform: translateX(-50%);
  max-width: 11rem;
  padding: 0.28rem 0.45rem;
  font-size: 0.57rem;
  font-weight: 600;
  line-height: 1.28;
  white-space: nowrap;
  letter-spacing: 0.015em;
  color: rgba(255, 255, 249, 0.98);
  text-shadow:
    0 1px 2px rgba(0, 0, 0, 0.75),
    0 0 1px rgba(0, 0, 0, 0.5);
  background: rgba(18, 16, 14, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  box-shadow:
    0 4px 14px rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(0, 0, 0, 0.2);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  z-index: 12;
  transition:
    opacity 0.14s ease,
    visibility 0.14s ease;
}

.desktop-draggable-icon--file:hover::after {
  opacity: 1;
  visibility: visible;
}

.desktop-draggable-file-preview {
  width: 4.95rem;
  min-height: 4.85rem;
  padding: 0.45rem 0.42rem;
  border-radius: 10px;
  background: linear-gradient(175deg, #faf8f6 0%, #ece9e6 82%, #e2ded9 100%);
  border: 1px solid rgba(62, 55, 50, 0.18);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.65) inset,
    0 10px 22px rgba(0, 0, 0, 0.2);
}

.desktop-draggable-icon--doc .desktop-draggable-file-preview {
  background: linear-gradient(175deg, #fffdf9 0%, #eef4ff 100%);
}

.desktop-draggable-icon--code .desktop-draggable-file-preview {
  background: linear-gradient(175deg, #f6fdf9 0%, #eaf7f0 100%);
}

.desktop-draggable-file-glyph {
  display: grid;
  place-items: center;
  font-size: 1.95rem;
  line-height: 1;
}

.desktop-draggable-file-caption {
  display: block;
  margin-top: 0.4rem;
  font-size: 0.53rem;
  font-weight: 500;
  line-height: 1.25;
  color: #574c45;
}

.desktop-draggable-icon--file .desktop-draggable-icon-label {
  color: rgba(255, 255, 250, 0.98);
  max-width: 6.75rem;
}

/* First-run: tour does not auto-open; this is the quiet entry point */
.desktop-onboarding-invite {
  position: absolute;
  right: clamp(12px, 3vw, 22px);
  bottom: clamp(48px, 8vh, 88px);
  z-index: 28;
  padding: 0.5rem 0.85rem;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--ink);
  background: linear-gradient(180deg, var(--accent-bright), var(--accent));
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
}

.desktop-onboarding-invite:hover {
  filter: brightness(1.05);
}

.desktop-onboarding-invite:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.win-onboarding {
  left: 50%;
  top: 46%;
  transform: translate(-50%, -50%);
  width: clamp(296px, 52vw, 500px);
  min-height: 260px;
  max-height: min(432px, 72vh);
  z-index: 42;
}

.onboarding-wizard-root {
  min-height: 0;
}

.onboarding-wizard {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  min-height: 0;
}

.onboarding-wizard-progress {
  display: flex;
  gap: 0.35rem;
  justify-content: center;
  margin-bottom: 0.2rem;
}

.onboarding-wizard-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--surface-line);
}

.onboarding-wizard-dot--active {
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(234, 104, 43, 0.2);
}

.onboarding-wizard-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.02em;
}

.onboarding-wizard-body {
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.52;
  color: var(--text-body);
}

.onboarding-wizard-body strong {
  color: var(--accent-bright);
  font-weight: 600;
}

.onboarding-wizard-nav {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 0.55rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--surface-line);
}

.onboarding-wizard-btn {
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.45rem 0.95rem;
  border-radius: 8px;
  cursor: pointer;
  border: 1px solid var(--surface-line);
}

.onboarding-wizard-btn--secondary {
  color: var(--text-muted);
  background: var(--surface-mid);
}

.onboarding-wizard-btn--secondary:hover:not(:disabled) {
  color: var(--text-primary);
  border-color: var(--accent);
}

.onboarding-wizard-btn--secondary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.onboarding-wizard-btn--primary {
  color: var(--ink);
  background: linear-gradient(180deg, var(--accent-bright), var(--accent));
  border-color: rgba(255, 255, 255, 0.12);
}

.onboarding-wizard-btn--primary:hover {
  filter: brightness(1.06);
}

/* ---- Phase 8 — desktop chrome (top links) ---- */

.desktop-chrome {
  position: sticky;
  top: 0;
  z-index: 120;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.5rem clamp(12px, 2vw, 20px);
  background: rgba(22, 17, 13, 0.94);
  border-bottom: 1px solid rgba(90, 76, 68, 0.45);
  backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04);
}

.desktop-chrome-brand {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}

.desktop-chrome-title {
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text-primary);
}

.desktop-chrome-tagline {
  font-size: 0.68rem;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

.desktop-chrome-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
}

.desktop-chrome-link {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--accent-bright);
  text-decoration: none;
}

.desktop-chrome-link:hover {
  text-decoration: underline;
  color: var(--accent-hover);
}

.desktop-window {
  position: absolute;
  display: flex;
  flex-direction: column;
  min-width: 200px;
  max-width: min(560px, 92vw);
  border: 1px solid var(--surface-line);
  border-radius: 11px;
  background: var(--surface-panel);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.04) inset,
    0 16px 42px rgba(0, 0, 0, 0.4);
  overflow: hidden;
}

.desktop-window__head {
  flex-shrink: 0;
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.38rem 0.45rem 0.38rem 0.65rem;
  background: linear-gradient(180deg, var(--surface-mid) 0%, #1e1b18 100%);
  border-bottom: 1px solid var(--surface-line);
  user-select: none;
}

.desktop-window__drag-handle {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
}

.desktop-window__controls {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
}

.desktop-window__btn {
  display: inline-grid;
  place-items: center;
  margin: 0;
  width: 1.55rem;
  height: 1.45rem;
  padding: 0;
  border-radius: 6px;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  border: 1px solid transparent;
}

.desktop-window__btn--minimize {
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.04);
}

.desktop-window__btn--minimize:hover {
  color: var(--text-primary);
  background: rgba(255, 180, 80, 0.14);
  border-color: rgba(255, 162, 74, 0.25);
}

.desktop-window__btn--close {
  color: #fca5a5;
  background: rgba(220, 53, 69, 0.12);
}

.desktop-window__btn--close:hover {
  color: #fff;
  background: rgba(220, 53, 69, 0.45);
  border-color: rgba(255, 255, 255, 0.08);
}

.desktop-window__btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.desktop-window__title {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.desktop-window__body {
  flex: 1;
  padding: 0.65rem 0.85rem;
  overflow: auto;
  font-size: 0.85rem;
  color: var(--text-body);
}

.desktop-window__placeholder {
  margin: 0;
  line-height: 1.5;
}

/* Quadrant placement (overlap center window) */

.win-lifecycle {
  left: clamp(12px, 2.5vw, 28px);
  top: clamp(52px, 8vh, 96px);
  width: clamp(260px, 44vw, 560px);
  height: clamp(168px, 30vh, 320px);
  z-index: 10;
}

.win-invariant {
  left: auto;
  right: clamp(12px, 2.5vw, 28px);
  top: clamp(52px, 8vh, 96px);
  width: clamp(260px, 46vw, 580px);
  min-height: clamp(300px, 44vh, 480px);
  max-height: min(560px, 88vh);
  z-index: 10;
}

/* ---- Phase 5 — trust invariant hero ---- */

.invariant-monitor-host {
  overflow: auto;
}

.invariant-monitor {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-height: 0;
}

.invariant-monitor-hero {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent-bright);
}

.invariant-monitor-sub {
  margin: 0;
  font-size: 0.72rem;
  line-height: 1.35;
  color: var(--text-dim);
}

.invariant-rows {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.35rem 0.85rem;
  align-items: baseline;
  margin: 0;
  padding: 0.5rem 0 0;
  border-top: 1px solid var(--surface-mid);
}

.invariant-row-label {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-primary);
}

.invariant-rows dt {
  grid-column: 1;
}

.invariant-rows dd {
  margin: 0;
  grid-column: 2;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
}

.invariant-row-value--standby {
  color: var(--text-dim);
}

.invariant-row-value--pass {
  color: #3fb950;
  text-shadow: 0 0 12px rgba(63, 185, 80, 0.25);
}

.invariant-row-value--valid {
  color: var(--accent-bright);
  text-shadow: 0 0 14px rgba(255, 162, 74, 0.25);
}

.win-explorer {
  left: clamp(12px, 2.5vw, 28px);
  right: auto;
  bottom: clamp(100px, 14vh, 160px);
  top: auto;
  width: clamp(280px, 46vw, 600px);
  height: auto;
  min-height: clamp(228px, 36vh, 400px);
  max-height: min(480px, 58vh);
  z-index: 10;
}

/* ---- Phase 6 — chain state explorer CLI ---- */

.chain-explorer-host {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.chain-explorer {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  min-height: 12rem;
}

.chain-explorer-note {
  margin: 0;
  font-size: 0.69rem;
  line-height: 1.35;
  color: var(--text-dim);
}

.chain-explorer-scroll {
  flex: 1;
  min-height: 7rem;
  overflow: auto;
  padding: 0.35rem 0.45rem;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  line-height: 1.42;
  color: #9ea7b3;
  background: #080c11;
  border: 1px solid var(--surface-mid);
  border-radius: 6px;
}

.chain-explorer-line--cmd {
  color: var(--text-muted);
}

.chain-explorer-line--out {
  color: var(--text-body);
}

.chain-explorer-line--err {
  color: #f85149;
}

.chain-explorer-line--meta {
  color: var(--text-dim);
  margin-bottom: 0.35rem;
}

.chain-explorer-form {
  flex-shrink: 0;
}

.chain-explorer-prompt {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0;
  padding: 0.25rem 0.45rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent);
  background: var(--ink);
  border: 1px solid var(--surface-mid);
  border-radius: 6px;
}

.chain-explorer-chevron {
  flex-shrink: 0;
}

.chain-explorer-input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  font: inherit;
  color: var(--text-primary);
}

.chain-explorer-input::placeholder {
  color: #484f58;
}

.win-failure {
  left: auto;
  right: clamp(12px, 2.5vw, 28px);
  bottom: clamp(100px, 14vh, 160px);
  top: auto;
  width: clamp(280px, 46vw, 600px);
  height: auto;
  min-height: clamp(260px, 42vh, 520px);
  max-height: min(560px, 86vh);
  z-index: 10;
}

/* ---- Phase 7 — failure modes drills ---- */

.failure-modes-host {
  overflow: auto;
}

.failure-modes {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  min-height: 0;
}

.failure-modes-intro {
  margin: 0;
  font-size: 0.69rem;
  line-height: 1.35;
  color: var(--text-dim);
}

.failure-scenario-card {
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--surface-mid);
  border-radius: 8px;
  background: #0f1419;
}

.failure-scenario-heading {
  margin: 0 0 0.2rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: #d29922;
}

.failure-scenario-blurb {
  margin: 0 0 0.45rem;
  font-size: 0.7rem;
  line-height: 1.4;
  color: #9ea7b3;
}

.failure-stage-list {
  margin: 0 0 0.55rem;
  padding: 0 0 0 1.05rem;
  font-size: 0.72rem;
  line-height: 1.42;
  color: var(--text-body);
}

.failure-stage {
  padding: 0.12rem 0;
}

.failure-stage .failure-stage-text {
  color: inherit;
}

.failure-stage-idx {
  display: inline-block;
  width: 1rem;
  margin-right: 0.35rem;
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--text-dim);
}

.failure-stage--pending {
  opacity: 0.7;
}

.failure-stage--active .failure-stage-idx {
  color: #d29922;
}

.failure-stage--active .failure-stage-text {
  color: var(--text-primary);
}

.failure-stage--done .failure-stage-idx {
  color: #3fb950;
}

.failure-stage--done .failure-stage-text {
  color: var(--text-muted);
}

.failure-run-btn {
  font-family: inherit;
  font-size: 0.72rem;
  padding: 0.35rem 0.65rem;
  cursor: pointer;
  color: var(--text-primary);
  background: var(--surface-mid);
  border: 1px solid var(--surface-line);
  border-radius: 6px;
}

.failure-run-btn:hover:not(:disabled) {
  border-color: var(--text-muted);
}

.failure-run-btn:disabled {
  opacity: 0.45;
}

.failure-prd-summary {
  margin-top: 0.35rem;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--surface-line);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(35, 134, 54, 0.08), transparent);
  opacity: 0;
  transform: translateY(4px);
  transition:
    opacity 0.35s ease,
    transform 0.35s ease;
}

.failure-prd-summary--visible {
  opacity: 1;
  transform: translateY(0);
}

.failure-summary-dl {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.2rem 0.85rem;
  margin: 0;
  align-items: baseline;
  font-family: var(--font-mono);
  font-size: 0.72rem;
}

.failure-summary-dt {
  margin: 0;
  grid-column: 1;
  color: var(--text-muted);
}

.failure-summary-val {
  margin: 0;
  grid-column: 2;
  font-weight: 600;
  color: #3fb950;
  text-align: right;
}

.failure-summary-val--accent {
  color: var(--accent);
}

.win-architecture {
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: clamp(280px, 52vw, 560px);
  height: clamp(220px, 34vh, 360px);
  z-index: 30;
}

/* Architecture window — system context + link to repo doc */

.architecture-window-root {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  font-size: 0.76rem;
  line-height: 1.4;
}

.architecture-window-lede {
  margin: 0;
  color: var(--text-body);
}

.architecture-window-label {
  margin: 0.15rem 0 0;
  font-size: 0.61rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--text-dim);
}

.architecture-window-label--sub {
  margin-top: 0.35rem;
}

.architecture-flow {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 0.45rem 0.55rem;
  border: 1px solid var(--surface-line);
  border-radius: 6px;
  background: rgba(24, 20, 17, 0.68);
}

.architecture-flow__lane {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  justify-content: center;
}

.architecture-flow__arrow {
  color: var(--text-dim);
  font-size: 0.85rem;
}

.architecture-flow__node {
  padding: 0.2rem 0.45rem;
  border-radius: 4px;
  border: 1px solid var(--surface-line);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  white-space: nowrap;
}

.architecture-flow__node--review {
  color: #ffa657;
  border-color: rgba(255, 166, 87, 0.35);
  background: rgba(255, 166, 87, 0.06);
}

.architecture-flow__node--spa {
  color: var(--accent-bright);
  border-color: rgba(255, 162, 74, 0.42);
  background: rgba(234, 104, 43, 0.1);
}

.architecture-flow__tiles {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  justify-content: center;
}

.architecture-tile {
  padding: 0.15rem 0.42rem;
  border-radius: 4px;
  border: 1px dashed var(--surface-line);
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-muted);
}

.architecture-deploy-strip {
  margin: 0;
  font-size: 0.71rem;
  color: var(--text-muted);
}

.architecture-window-footer {
  margin: 0.15rem 0 0;
  font-size: 0.7rem;
  color: var(--text-dim);
}

.architecture-doc-link {
  color: var(--accent-bright);
  text-decoration: none;
  font-weight: 600;
}

.architecture-doc-link:hover {
  text-decoration: underline;
  color: var(--accent-hover);
}

/* ---- Phase 3 — command palette & memo stub ---- */

.palette-overlay {
  position: fixed;
  inset: 0;
  z-index: 400;
  pointer-events: none;
}

/* Author `display:flex`/`display:block` overrides the UA `hidden` rule — force hide when closed */
.palette-overlay[hidden] {
  display: none !important;
}

.palette-overlay:not([hidden]) {
  pointer-events: auto;
}

.palette-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(1, 4, 9, 0.62);
}

.palette-panel {
  position: relative;
  z-index: 1;
  max-width: 520px;
  margin: 12vh auto 0;
  padding: 0;
  background: var(--surface-panel);
  border: 1px solid var(--surface-line);
  border-radius: 10px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
  overflow: hidden;
}

.palette-input {
  display: block;
  width: 100%;
  box-sizing: border-box;
  margin: 0;
  padding: 0.75rem 1rem;
  font-size: 0.95rem;
  font-family: inherit;
  color: var(--text-primary);
  background: var(--ink);
  border: none;
  border-bottom: 1px solid var(--surface-mid);
  outline: none;
}

.palette-input::placeholder {
  color: var(--text-dim);
}

.palette-results {
  margin: 0;
  padding: 0.35rem 0;
  list-style: none;
  max-height: min(50vh, 320px);
  overflow: auto;
}

.palette-result {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.35rem;
  padding: 0.5rem 1rem;
  cursor: pointer;
  font-size: 0.875rem;
  color: var(--text-primary);
}

.palette-result:hover,
.palette-result--active {
  background: var(--surface-mid);
}

.palette-result-label {
  font-weight: 500;
}

.palette-result-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.palette-hint-bar {
  padding: 0.45rem 1rem;
  font-size: 0.72rem;
  color: var(--text-dim);
  border-top: 1px solid var(--surface-mid);
}

.palette-hint-bar kbd {
  display: inline-block;
  margin: 0 0.1rem;
  padding: 0.1rem 0.35rem;
  font-family: inherit;
  font-size: inherit;
  color: var(--text-muted);
  background: var(--surface-mid);
  border-radius: 4px;
  border: 1px solid var(--surface-line);
}

.memo-overlay {
  position: fixed;
  inset: 0;
  z-index: 410;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  pointer-events: none;
}

.memo-overlay[hidden] {
  display: none !important;
}

.memo-overlay:not([hidden]) {
  pointer-events: auto;
}

.memo-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
}

.memo-panel {
  position: relative;
  z-index: 1;
  max-width: min(480px, 92vw);
  padding: 1.25rem 1.5rem;
  background: var(--surface-panel);
  border: 1px solid var(--surface-line);
  border-radius: 10px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.memo-title {
  margin: 0 0 0.5rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--accent);
}

.memo-body {
  margin: 0 0 1rem;
  font-size: 0.875rem;
  line-height: 1.55;
  color: var(--text-body);
}

.memo-close {
  font-family: inherit;
  font-size: 0.8rem;
  padding: 0.4rem 0.85rem;
  cursor: pointer;
  color: var(--text-primary);
  background: var(--surface-mid);
  border: 1px solid var(--surface-line);
  border-radius: 6px;
}

.memo-close:hover {
  background: var(--surface-line);
}

.memo-lead {
  margin: 0 0 0.65rem;
  font-size: 0.835rem;
  line-height: 1.52;
  color: var(--text-primary);
}

.memo-body-text {
  margin: 0 0 0.6rem;
  font-size: 0.8rem;
  line-height: 1.5;
  color: var(--text-body);
}

.memo-note {
  font-size: 0.72rem;
  color: var(--text-muted) !important;
}

.memo-panel .memo-close {
  margin-top: 0.35rem;
}

/* ---- Phase 4 — hybrid lifecycle simulator ---- */

.desktop-window.win-lifecycle {
  min-height: clamp(340px, 52vh, 520px);
  max-height: min(620px, 88vh);
}

.lifecycle-sim-host {
  overflow: auto;
}

.lifecycle-sim {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  min-height: 0;
}

.lifecycle-mode {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.lifecycle-mode-label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.lifecycle-mode-label input {
  accent-color: var(--accent);
}

.lifecycle-steps {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.lifecycle-step {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  padding: 0.35rem 0.45rem;
  border-radius: 6px;
  border: 1px solid var(--surface-mid);
  font-size: 0.8rem;
  line-height: 1.35;
  transition:
    border-color 0.15s ease,
    background 0.15s ease;
}

.lifecycle-step-mark {
  flex-shrink: 0;
  display: inline-flex;
  width: 1.35rem;
  height: 1.35rem;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 700;
  border-radius: 4px;
  background: var(--surface-mid);
  color: var(--text-muted);
}

.lifecycle-step-text {
  color: var(--text-body);
}

.lifecycle-step--pending {
  opacity: 0.75;
}

.lifecycle-step--active {
  border-color: var(--accent);
  background: rgba(88, 166, 255, 0.08);
}

.lifecycle-step--active .lifecycle-step-mark {
  background: var(--accent)33;
  color: var(--accent-bright);
}

.lifecycle-step--done .lifecycle-step-mark {
  background: #23863633;
  color: #3fb950;
}

.lifecycle-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.lifecycle-btn {
  font-family: inherit;
  font-size: 0.78rem;
  padding: 0.35rem 0.65rem;
  cursor: pointer;
  color: var(--text-primary);
  background: var(--surface-mid);
  border: 1px solid var(--surface-line);
  border-radius: 6px;
}

.lifecycle-btn:hover:not(:disabled) {
  border-color: var(--text-muted);
}

.lifecycle-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.lifecycle-btn--primary {
  background: rgba(234, 104, 43, 0.2);
  border-color: rgba(255, 162, 74, 0.55);
  color: var(--accent-bright);
}

.lifecycle-log {
  min-height: 5.25rem;
  max-height: 8.75rem;
  overflow: auto;
  padding: 0.45rem 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  line-height: 1.45;
  color: var(--accent-bright);
  background: var(--ink);
  border: 1px solid var(--surface-mid);
  border-radius: 6px;
}

.lifecycle-log-line--meta {
  color: var(--text-muted);
}

.lifecycle-sim-footnote {
  margin: 0;
  font-size: 0.66rem;
  line-height: 1.35;
  color: var(--text-dim);
}
