:root {
  color-scheme: light;
  --canvas: #e9e8e2;
  --canvas-deep: #dfded6;
  --paper: #f7f6f0;
  --paper-raised: #fffef8;
  --paper-muted: #efeee7;
  --ink: #1c201f;
  --ink-strong: #0d100f;
  --ink-secondary: #565c59;
  --ink-tertiary: #777d79;
  --line: #b8bbb5;
  --line-strong: #747a76;
  --grid-line: rgba(40, 47, 44, .055);
  --graphite: #171b1a;
  --graphite-raised: #232826;
  --graphite-line: #414744;
  --oxide: #d94b1c;
  --oxide-dark: #a93210;
  --oxide-soft: #f4ded4;
  --telemetry: #087f8c;
  --telemetry-soft: #dcecee;
  --success: #24704d;
  --success-soft: #e0eee5;
  --warning: #8a5a00;
  --warning-soft: #f3ead2;
  --error: #a62c3e;
  --error-soft: #f4dde1;
  --focus: #005fcc;
  --code-bg: #e3e4df;
  --terminal-bg: #111513;
  --terminal-fg: #cfdbd4;
  --font-body: Aptos, "Segoe UI", Arial, sans-serif;
  --font-display: Bahnschrift, "Arial Narrow", "Segoe UI", sans-serif;
  --font-mono: "Cascadia Mono", "IBM Plex Mono", Consolas, monospace;
  --radius: 2px;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --canvas: #111513;
  --canvas-deep: #0b0e0d;
  --paper: #191e1c;
  --paper-raised: #202522;
  --paper-muted: #151917;
  --ink: #e3e5df;
  --ink-strong: #fffef8;
  --ink-secondary: #adb3ae;
  --ink-tertiary: #7e8781;
  --line: #343b37;
  --line-strong: #66706a;
  --grid-line: rgba(223, 228, 221, .04);
  --graphite: #080b0a;
  --graphite-raised: #141917;
  --graphite-line: #3b433f;
  --oxide: #f06536;
  --oxide-dark: #ff7a4c;
  --oxide-soft: rgba(240, 101, 54, .13);
  --telemetry: #54c2ca;
  --telemetry-soft: rgba(84, 194, 202, .12);
  --success: #67c391;
  --success-soft: rgba(103, 195, 145, .12);
  --warning: #e1b451;
  --warning-soft: rgba(225, 180, 81, .12);
  --error: #ef7687;
  --error-soft: rgba(239, 118, 135, .12);
  --focus: #78b8ff;
  --code-bg: #2a302d;
  --terminal-bg: #070a09;
  --terminal-fg: #c6d2cb;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --canvas: #111513;
    --canvas-deep: #0b0e0d;
    --paper: #191e1c;
    --paper-raised: #202522;
    --paper-muted: #151917;
    --ink: #e3e5df;
    --ink-strong: #fffef8;
    --ink-secondary: #adb3ae;
    --ink-tertiary: #7e8781;
    --line: #343b37;
    --line-strong: #66706a;
    --grid-line: rgba(223, 228, 221, .04);
    --graphite: #080b0a;
    --graphite-raised: #141917;
    --graphite-line: #3b433f;
    --oxide: #f06536;
    --oxide-dark: #ff7a4c;
    --oxide-soft: rgba(240, 101, 54, .13);
    --telemetry: #54c2ca;
    --telemetry-soft: rgba(84, 194, 202, .12);
    --success: #67c391;
    --success-soft: rgba(103, 195, 145, .12);
    --warning: #e1b451;
    --warning-soft: rgba(225, 180, 81, .12);
    --error: #ef7687;
    --error-soft: rgba(239, 118, 135, .12);
    --focus: #78b8ff;
    --code-bg: #2a302d;
    --terminal-bg: #070a09;
    --terminal-fg: #c6d2cb;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: auto; }
[hidden] { display: none !important; }

body {
  min-height: 100vh;
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font: 15px/1.5 var(--font-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  content: "";
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 24px 24px;
}

a { color: var(--telemetry); }
img, svg { max-width: 100%; }
button, input, select, textarea { font: inherit; }
strong, h1, h2, h3 { color: var(--ink-strong); }
code, pre, .log, .metric-card strong, .workspace-stat strong, .telemetry-card, table {
  font-variant-numeric: tabular-nums;
}

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

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 100;
  padding: 9px 12px;
  border: 2px solid var(--focus);
  background: var(--paper-raised);
  color: var(--ink-strong);
  font: 700 .78rem var(--font-mono);
  text-decoration: none;
  transform: translateY(-160%);
}
.skip-link:focus { transform: translateY(0); }

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  border-bottom: 3px solid var(--oxide);
  background: var(--graphite);
  color: #e9ece8;
}

.header-inner {
  width: min(1320px, 100%);
  min-height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin: 0 auto;
  padding: 0 28px;
}

.brand {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: #fff;
  text-decoration: none;
}

.brand-mark {
  position: relative;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  display: grid;
  place-items: center;
  border: 1px solid #ff8a62;
  border-radius: 0;
  background: var(--oxide);
}
.brand-mark::after { content: none; }
.brand-mark svg { width: 19px; height: 19px; }
.brand-copy { display: grid; gap: 0; line-height: 1.1; }
.brand-name { font: 700 1rem var(--font-display); letter-spacing: .01em; }
.brand-project { color: #9ba59f; font: 600 .6rem var(--font-mono); letter-spacing: .08em; text-transform: uppercase; }

.site-nav { display: flex; align-items: center; gap: 0; }
.header-reset-form { margin: 0; }
.theme-toggle, .header-icon {
  min-width: 44px;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 12px;
  border: 0;
  border-left: 1px solid var(--graphite-line);
  border-radius: 0;
  background: transparent;
  color: #aeb8b2;
  box-shadow: none;
  cursor: pointer;
  font-size: .72rem;
  font-weight: 650;
  text-decoration: none;
}
.theme-toggle:hover, .header-icon:hover { background: #242a27; color: #fff; transform: none; }
.reset-workspace-toggle:hover { background: #33201e; color: #ff9b78; }
.theme-toggle svg path { fill: none; }
.nav-action-label { line-height: 1; }
.logout-link {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  padding: 0 13px;
  border-left: 1px solid var(--graphite-line);
  color: #c5ccc8;
  font-size: .72rem;
  font-weight: 650;
  text-decoration: none;
}
.logout-link:hover { background: #242a27; color: #fff; }

main {
  width: min(1320px, 100%);
  min-height: calc(100vh - 130px);
  margin: 0 auto;
  padding: 28px 28px 64px;
}

.site-footer { border-top: 1px solid var(--line-strong); background: var(--paper); }
.footer-inner {
  width: min(1320px, 100%);
  min-height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin: 0 auto;
  padding: 0 28px;
  color: var(--ink-tertiary);
  font: .66rem var(--font-mono);
}
.footer-inner p { margin: 0; }
.footer-brand { color: var(--ink); font-weight: 650; }
.footer-ember { display: inline-block; width: 9px; height: 9px; margin-right: 8px; background: var(--oxide); }
.footer-note { letter-spacing: .02em; }

h1, h2, h3 {
  margin-top: 0;
  font-family: var(--font-display);
  font-stretch: condensed;
}
h1 { margin-bottom: 0; font-size: clamp(2.5rem, 5vw, 4.7rem); font-weight: 700; line-height: .98; letter-spacing: -.045em; }
h2 { font-size: 1.45rem; font-weight: 680; line-height: 1.15; letter-spacing: -.015em; }
h3 { font-weight: 680; line-height: 1.2; }
p { color: var(--ink-secondary); }

.eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  color: var(--ink-secondary);
  font: 600 .68rem var(--font-mono);
  letter-spacing: .025em;
  text-transform: none;
}
.eyebrow::before { color: var(--oxide); content: "//"; font-weight: 800; }
.eyebrow > span:first-child { display: none; }
.eyebrow-on-dark { color: #b8c2bc; }
.page-subtitle { max-width: 760px; margin: 12px 0 0; color: var(--ink-secondary); font-size: .95rem; line-height: 1.6; }
.page-subtitle code { font-size: .88em; }
.content-heading { margin: 34px 0 14px; }

.section-heading-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 420px);
  align-items: end;
  gap: 28px;
  margin: 0 0 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line-strong);
}
.section-heading-row h2 { margin: 0; font-size: clamp(1.55rem, 3vw, 2.05rem); }
.section-heading-row > p { margin: 0; text-align: right; font-size: .8rem; }
.section-heading-compact { margin-top: 38px; }
.section-heading-compact h2 { font-size: 1.55rem; }

:where(a, button, input, select, textarea, summary):focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

button, .btn {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 9px 16px;
  border: 1px solid var(--oxide-dark);
  border-radius: var(--radius);
  background: var(--oxide);
  color: #fff;
  box-shadow: none;
  cursor: pointer;
  font-size: .76rem;
  font-weight: 720;
  line-height: 1;
  text-decoration: none;
}
button:hover, .btn:hover { border-color: var(--ink-strong); background: var(--ink-strong); color: var(--paper-raised); transform: none; }
.btn-secondary { border-color: var(--line-strong); background: transparent; color: var(--ink); }
.btn-secondary:hover { border-color: var(--ink); background: var(--ink); color: var(--paper); }
.btn-ghost-light { border-color: #717a75; background: transparent; color: #f3f5f2; }
.btn-ghost-light:hover { border-color: #fff; background: #fff; color: #111513; }
.danger-button { border-color: var(--error); background: transparent; color: var(--error); }
.danger-button:hover { border-color: var(--error); background: var(--error); color: #fff; }
.form-actions, .page-actions, .result-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; margin-top: 20px; }

.card {
  margin-bottom: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: none;
}
.section-card { overflow: visible; }
.section-card::before { content: none; }
.section-card:hover, .section-card[open] { border-color: var(--line-strong); box-shadow: none; }
.section-summary {
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 12px 16px;
  border-radius: 0;
  cursor: pointer;
  list-style: none;
}
.section-summary::-webkit-details-marker { display: none; }
.section-summary:hover { background: var(--paper-muted); }
.section-card[open] > .section-summary { border-bottom: 1px solid var(--line); background: var(--paper-muted); }
.section-title { margin: 0; color: var(--ink); font-size: .95rem; font-weight: 680; letter-spacing: 0; }
.section-chevron {
  width: 9px;
  height: 9px;
  flex: 0 0 9px;
  border-right: 1px solid var(--ink-tertiary);
  border-bottom: 1px solid var(--ink-tertiary);
  transform: rotate(45deg) translate(-2px, -2px);
}
.section-card[open] > .section-summary .section-chevron { border-color: var(--oxide); transform: rotate(225deg) translate(-1px, -1px); }
.section-content { padding: 20px 18px 22px; }
.section-content > :first-child { margin-top: 0; }
.section-content > :last-child { margin-bottom: 0; }

.pipeline-shell {
  margin: 0 0 20px;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: none;
}
.pipeline-header {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 8px 13px;
  border-bottom: 1px solid var(--line);
  background: var(--paper-muted);
  cursor: pointer;
  list-style: none;
}
.pipeline-header::-webkit-details-marker { display: none; }
.pipeline-header p { margin: 0; }
.pipeline-eyebrow { color: var(--ink); font: 700 .66rem var(--font-mono); letter-spacing: .04em; text-transform: uppercase; }
.pipeline-summary { margin-top: 1px !important; color: var(--ink-tertiary); font-size: .68rem; }
.pipeline-stage-count { color: var(--ink-tertiary); font: 600 .62rem var(--font-mono); letter-spacing: .04em; text-transform: uppercase; }
.pipeline-ready-status { margin-left: auto; color: var(--success); font: 700 .62rem var(--font-mono); letter-spacing: .04em; text-transform: uppercase; }
.pipeline-chevron { width: 9px; height: 9px; margin: 0 1px 3px 7px; border-right: 1px solid currentColor; border-bottom: 1px solid currentColor; color: var(--ink-secondary); transform: rotate(45deg); transition: transform .15s ease; }
.pipeline-shell[open] .pipeline-chevron { margin-bottom: -2px; transform: rotate(225deg); }
.pipeline { display: flex; align-items: stretch; padding: 0; }
.pipeline-step {
  min-width: 0;
  flex: 1 1 0;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 13px 14px;
  border: 0;
  border-bottom: 3px solid transparent;
  border-radius: 0;
  background: transparent;
  color: inherit;
  text-decoration: none;
}
.pipeline-step:hover { background: var(--paper-muted); transform: none; }
.pipeline-step.is-current { border-bottom-color: var(--oxide); background: var(--oxide-soft); }
.pipeline-step.is-done { border-bottom-color: var(--success); background: var(--success-soft); }
.pipeline-step.is-blocked { opacity: .78; }
.pipeline-step-num {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 0;
  color: var(--ink-secondary);
  font: 700 .72rem var(--font-mono);
}
.is-current .pipeline-step-num { border-color: var(--oxide); background: var(--oxide); color: #fff; }
.is-done .pipeline-step-num { border-color: var(--success); background: var(--success); color: #fff; }
.is-blocked .pipeline-step-num { border-color: var(--warning); background: transparent; color: var(--warning); }
.pipeline-step-body { min-width: 0; }
.pipeline-step-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pipeline-step-title { overflow: hidden; color: var(--ink); font-size: .78rem; font-weight: 700; line-height: 1.2; text-overflow: ellipsis; white-space: nowrap; }
.pipeline-step-status { color: var(--ink-tertiary); font: 600 .56rem var(--font-mono); letter-spacing: .035em; text-transform: uppercase; }
.is-current .pipeline-step-status { color: var(--oxide); }
.is-done .pipeline-step-status { color: var(--success); }
.pipeline-step-desc { margin-top: 3px; overflow: hidden; color: var(--ink-secondary); font-size: .65rem; line-height: 1.3; text-overflow: ellipsis; white-space: nowrap; }
.pipeline-step-tag { color: var(--ink-tertiary); font-size: .6rem; font-weight: 500; }
.pipeline-arrow { width: 28px; flex: 0 0 28px; display: grid; place-items: center; position: relative; color: var(--line-strong); }
.pipeline-connector-line { position: absolute; width: 100%; height: 1px; background: var(--line); }
.pipeline-connector-arrow { position: relative; padding: 0 4px; background: var(--paper); font: .72rem var(--font-mono); }
.pipeline-caption { margin: -8px 0 22px; color: var(--ink-tertiary); font-size: .72rem; }

.home-hero {
  position: relative;
  min-height: 500px;
  display: none;
  grid-template-columns: minmax(0, .92fr) minmax(420px, 1.08fr);
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--graphite-line);
  border-left: 6px solid var(--oxide);
  border-radius: 0;
  background: var(--graphite);
  box-shadow: none;
}
.home-hero::before { content: none; }
.home-hero-copy { position: relative; z-index: 2; display: flex; flex-direction: column; justify-content: center; padding: 54px 50px; }
.home-hero h1 { color: #f7f6f0; font-size: clamp(3.7rem, 7vw, 6.5rem); line-height: .84; letter-spacing: -.06em; }
.home-hero h1 em { color: var(--oxide); font-style: normal; }
.home-hero-lede { max-width: 550px; margin: 24px 0 0; color: #b7c0bb; font-size: 1rem; line-height: 1.65; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 28px; }
.btn-hero { min-height: 44px; padding-inline: 18px; }
.hero-specs { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 34px; color: #7f8b84; font: 600 .62rem var(--font-mono); letter-spacing: .04em; text-transform: uppercase; }
.hero-specs span { display: inline-flex; align-items: baseline; gap: 6px; }
.hero-specs span + span { padding-left: 20px; border-left: 1px solid #39413d; }
.hero-specs strong { color: #dce1dd; font-size: .72rem; }
.home-hero-visual {
  position: relative;
  z-index: 1;
  min-height: 500px;
  overflow: hidden;
  border-left: 1px solid var(--graphite-line);
  background-image:
    linear-gradient(rgba(218, 226, 220, .055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(218, 226, 220, .055) 1px, transparent 1px);
  background-size: 24px 24px;
}
.home-hero-visual::before, .home-hero-visual::after {
  position: absolute;
  z-index: 0;
  content: "";
  background: var(--oxide);
}
.home-hero-visual::before { top: 40px; right: 28px; width: 42px; height: 1px; }
.home-hero-visual::after { top: 20px; right: 49px; width: 1px; height: 42px; }
.motor-cutaway { position: absolute; top: 46%; left: 50%; z-index: 1; width: min(520px, 94%); transform: translate(-50%, -50%); filter: none; }
.orbit { display: none; }
.telemetry-card { border: 0; border-radius: 0; background: transparent; box-shadow: none; }
.telemetry-card-main {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  min-width: 0;
  padding: 14px 18px;
  border-top: 1px solid var(--graphite-line);
  background: #121715;
}
.telemetry-card-main strong { color: #f7f6f0; font-size: .8rem; }
.telemetry-label { color: var(--telemetry); font: 650 .58rem var(--font-mono); letter-spacing: .06em; text-transform: uppercase; }
.telemetry-line { display: flex; align-items: center; gap: 7px; color: #99a59f; font-size: .62rem; }
.telemetry-line i, .pulse-dot { width: 6px; height: 6px; background: var(--success); }
.telemetry-card-float { display: none; }

.workspace-strip {
  display: none;
  grid-template-columns: 1.25fr repeat(3, 1fr);
  margin: 0 0 58px;
  border: 1px solid var(--line-strong);
  border-top: 1px solid var(--line-strong);
  border-radius: 0;
  background: var(--paper);
  box-shadow: none;
}
.workspace-strip > div { min-height: 82px; padding: 16px 18px; display: flex; align-items: center; gap: 12px; border-right: 1px solid var(--line); }
.workspace-strip > div:last-child { border-right: 0; }
.workspace-strip-heading { display: block !important; }
.workspace-strip-heading .eyebrow { margin-bottom: 4px; color: var(--ink-tertiary); font-size: .58rem; }
.workspace-strip-heading strong { font-size: .9rem; }
.workspace-stat-icon {
  width: 31px;
  height: 31px;
  flex: 0 0 31px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 0;
  background: transparent;
  color: var(--oxide);
  font: 700 .62rem var(--font-mono);
}
.chemistry-icon, .geometry-icon, .burn-icon { background: transparent; color: var(--oxide); }
.workspace-stat > span:last-child { display: grid; }
.workspace-stat strong { font: 700 1.08rem var(--font-mono); line-height: 1.1; }
.workspace-stat small { margin-top: 3px; color: var(--ink-tertiary); font-size: .64rem; }

.home-section { margin-bottom: 58px; }
.tools-panel { overflow: hidden; border-radius: 0; }
.tools-panel[open] { box-shadow: none; }
.tools-panel > .section-summary { min-height: 50px; }
.tools-panel > .section-content { padding: 0; }
.tools-grid { display: grid; grid-template-columns: 1fr; gap: 0; }
.tool-card {
  position: relative;
  min-height: 132px;
  display: grid;
  grid-template-columns: 110px 46px minmax(240px, 1.1fr) minmax(300px, 1.5fr) 100px;
  align-items: center;
  gap: 18px;
  padding: 18px;
  overflow: hidden;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: var(--paper);
  color: inherit;
  box-shadow: none;
  text-decoration: none;
}
.tool-card:last-child { border-bottom: 0; }
.tool-card::before { position: absolute; top: 0; bottom: 0; left: 0; width: 3px; content: ""; background: transparent; }
.tool-card::after { content: none; }
.tool-card:hover { border-color: var(--line); background: var(--paper-muted); box-shadow: none; transform: none; }
.tool-card:hover::before { background: var(--oxide); }
.tool-card-topline { grid-column: 1; display: grid; justify-items: start; gap: 7px; }
.tool-step { color: var(--oxide); font: 700 .64rem var(--font-mono); letter-spacing: .05em; text-transform: uppercase; }
.tool-state { padding: 3px 5px; border: 1px solid var(--line); border-radius: 0; color: var(--ink-tertiary); font: 600 .56rem var(--font-mono); letter-spacing: .025em; text-transform: uppercase; }
.tool-state.is-complete { border-color: var(--success); background: var(--success-soft); color: var(--success); }
.tool-icon {
  position: static;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  margin: 0;
  border: 0;
  border-left: 2px solid var(--oxide);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
}
.tool-card-2 .tool-icon, .tool-card-3 .tool-icon { border-color: var(--oxide); background: transparent; color: var(--ink); }
.tool-icon svg { width: 27px; height: 27px; }
.tool-card h3 { position: static; margin: 0; font-size: 1.15rem; letter-spacing: -.01em; }
.tool-card .desc { position: static; margin: 0; color: var(--ink-secondary); font-size: .78rem; line-height: 1.5; }
.tool-cta { position: static; display: flex; align-items: center; justify-content: flex-end; gap: 6px; margin: 0; padding: 0; color: var(--ink); font-size: .72rem; font-weight: 700; }
.tool-card:hover .tool-cta, .tool-card-2:hover .tool-cta, .tool-card-3:hover .tool-cta { color: var(--oxide); }

.process-grid { display: grid; grid-template-columns: 1fr; gap: 0; border: 1px solid var(--line-strong); background: var(--paper); }
.process-card {
  position: relative;
  min-height: 0;
  display: grid;
  grid-template-columns: 68px 175px 190px minmax(0, 1fr) 30px;
  grid-template-areas: "number kicker title description info";
  align-items: center;
  gap: 22px;
  padding: 20px 18px;
  overflow: visible;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.process-card:last-child { border-bottom: 0; }
.process-card-number { grid-area: number; position: static; color: var(--line-strong); font: 700 2rem var(--font-mono); letter-spacing: -.08em; line-height: 1; }
.process-kicker { grid-area: kicker; display: block; margin: 0; color: var(--oxide); font: 650 .62rem var(--font-mono); letter-spacing: .04em; text-transform: uppercase; }
.process-card h3 { grid-area: title; margin: 0; font-size: 1rem; }
.process-card p { grid-area: description; margin: 0; font-size: .76rem; line-height: 1.5; }
.process-card .info { grid-area: info; justify-self: end; }
.home-details-grid { display: grid; grid-template-columns: 1fr; gap: 0; margin: 46px 0 26px; border-top: 1px solid var(--line-strong); }
.home-details-grid .section-card { margin: 0; border-top: 0; }
.home-details-grid .section-content { font-size: .82rem; }
.workspace-card form { margin-bottom: 0; }

.page-heading {
  position: relative;
  min-height: 230px;
  display: none;
  grid-template-columns: minmax(0, 1fr) 260px;
  align-items: stretch;
  gap: 0;
  margin: 0 0 24px;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--graphite-line);
  border-left: 5px solid var(--oxide);
  border-radius: 0;
  background: var(--graphite);
  box-shadow: none;
}
.page-heading::before, .page-heading::after { content: none; }
.page-heading-copy { position: relative; z-index: 2; display: flex; flex-direction: column; justify-content: center; padding: 32px 38px; }
.page-heading h1 { max-width: 860px; color: #f7f6f0; font-size: clamp(2.6rem, 5vw, 4.3rem); }
.page-heading .page-subtitle { max-width: 760px; color: #b7c0bb; }
.page-heading-tags { display: flex; flex-wrap: wrap; gap: 0; margin-top: 18px; }
.page-heading-tags span { padding: 5px 9px; border: 1px solid var(--graphite-line); border-right: 0; border-radius: 0; background: transparent; color: #aab5ae; font: 600 .6rem var(--font-mono); letter-spacing: .02em; }
.page-heading-tags span:last-child { border-right: 1px solid var(--graphite-line); }
.page-heading-graphic {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  padding: 22px;
  border-left: 1px solid var(--graphite-line);
  color: var(--telemetry);
  background-image:
    linear-gradient(rgba(218, 226, 220, .05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(218, 226, 220, .05) 1px, transparent 1px);
  background-size: 20px 20px;
  opacity: 1;
}
.page-heading-graphic svg { width: 100%; max-height: 170px; filter: none; }
.page-heading-geometry, .page-heading-results, .page-heading-upgrade { background: var(--graphite); }
.geometry-heading-graphic { color: var(--oxide); }
.results-heading-graphic { color: var(--telemetry); }
.page-heading-upgrade .page-heading-graphic { color: var(--warning); }

.form-intro { display: flex; align-items: end; justify-content: space-between; gap: 28px; margin: 0 0 14px; padding: 0; }
.form-intro h2 { margin: 0; font-size: 1.5rem; }
.form-intro > p { max-width: 500px; margin: 0; text-align: right; font-size: .78rem; }
.config-form { margin: 0 0 34px; counter-reset: form-section; }
.config-form {
  --config-control-min-width: 205px;
  --config-control-height: 42px;
}
.config-form > .section-card > .section-summary .section-title { display: flex; align-items: center; gap: 12px; }
.config-form > .section-card > .section-summary .section-title::before {
  width: 27px;
  height: 25px;
  display: grid;
  place-items: center;
  border-right: 1px solid var(--line-strong);
  color: var(--ink-tertiary);
  content: counter(form-section, decimal-leading-zero);
  counter-increment: form-section;
  font: 700 .59rem var(--font-mono);
}
.config-form > .section-card[open] > .section-summary .section-title::before { color: var(--oxide); }
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(205px, 1fr)); gap: 14px; }
.config-form .row { grid-template-columns: repeat(auto-fill, minmax(var(--config-control-min-width), 1fr)); }
.field { min-width: 0; margin-bottom: 15px; }
.field:last-child { margin-bottom: 0; }
.row .field { margin-bottom: 0; }
label { display: block; margin-bottom: 6px; color: var(--ink-secondary); font-size: .74rem; font-weight: 670; line-height: 1.35; }
.label-row { min-width: 0; display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.label-row label { margin: 0; }
.structured-row .field:not(.checkbox-field) .label-row { min-height: 2.15em; align-items: flex-start; }
.field-help { display: block; margin-top: 6px; color: var(--ink-tertiary); font-size: .68rem; line-height: 1.45; }
.section-content > .field-help:first-child { margin: 0 0 16px; }
.section-message { margin: 0 0 15px; padding: 11px 12px; border-left: 3px solid var(--telemetry); background: var(--paper-muted); color: var(--ink-secondary); font-size: .74rem; }

input[type=text], input[type=password], input[type=number], input[type=file], select, textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--paper-raised);
  color: var(--ink);
  box-shadow: none;
}
input[type=text], input[type=password], input[type=number], input[type=file], select { min-height: 42px; padding: 8px 10px; font-size: .82rem; }
textarea { min-height: 390px; padding: 12px; resize: vertical; font: .76rem/1.55 var(--font-mono); tab-size: 2; }
input::placeholder, textarea::placeholder { color: var(--ink-tertiary); opacity: .8; }
input:hover, select:hover, textarea:hover { border-color: var(--ink); }
input:focus, select:focus, textarea:focus { border-color: var(--focus); outline: 2px solid var(--focus); outline-offset: 2px; box-shadow: none; }
input:disabled, select:disabled, textarea:disabled { cursor: not-allowed; opacity: .58; background: var(--paper-muted); }
input[readonly] { border-style: dashed; background: var(--paper-muted); color: var(--ink-secondary); }
input[type=file] { padding: 4px; }
input[type=file]::file-selector-button { height: 32px; margin-right: 9px; padding: 0 10px; border: 0; border-right: 1px solid var(--line); background: var(--code-bg); color: var(--ink); cursor: pointer; font-size: .7rem; font-weight: 700; }
input[type=checkbox] { width: 16px; height: 16px; flex: 0 0 16px; margin: 1px 0 0; accent-color: var(--oxide); }
.checkbox-field { min-height: 42px; display: flex; align-items: flex-start; gap: 9px; padding: 10px; border: 1px solid var(--line); background: var(--paper-muted); }
.checkbox-field label { margin: 0; }
.config-form .checkbox-field {
  box-sizing: border-box;
  height: var(--config-control-height);
  min-height: 0;
  align-self: end;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 6px 10px;
}
.config-form .checkbox-field input[type=checkbox] { margin: 0; }
.config-form .checkbox-field label {
  min-width: 0;
  margin: 0;
  color: var(--ink-secondary);
  font-size: .66rem;
  line-height: 1.08;
  text-align: center;
  overflow-wrap: anywhere;
}

.info { position: relative; display: inline-flex; vertical-align: middle; }
.info-icon {
  width: 25px;
  min-width: 25px;
  height: 25px;
  min-height: 25px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--telemetry);
  box-shadow: none;
}
.info-icon:hover { border-color: var(--telemetry); background: var(--telemetry-soft); color: var(--telemetry); }
.info-pop {
  --info-shift-x: 0px;
  position: absolute;
  top: calc(100% + 9px);
  left: 0;
  z-index: 80;
  width: min(310px, calc(100vw - 24px));
  display: none;
  padding: 12px 13px;
  border: 1px solid var(--line-strong);
  border-radius: 0;
  background: var(--paper-raised);
  color: var(--ink-secondary);
  box-shadow: 6px 6px 0 rgba(0, 0, 0, .12);
  font-size: .7rem;
  line-height: 1.5;
  transform: translateX(var(--info-shift-x));
}
.info-pop.is-wide { width: min(520px, calc(100vw - 24px)); }
.info:hover:not(.is-suppressed) .info-pop, .info.is-open .info-pop { display: block; }
.info.flip-left .info-pop { right: 0; left: auto; }
.info.flip-up .info-pop { top: auto; bottom: calc(100% + 9px); }
.info-pop p { margin: 0 0 8px; }
.info-pop p:last-child { margin-bottom: 0; }
.info-pop code { padding: 1px 3px; background: var(--code-bg); color: var(--ink); font-family: var(--font-mono); }

.dependency-banner {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  margin: 0 0 18px;
  padding: 13px 15px;
  border: 1px solid var(--line-strong);
  border-left: 4px solid var(--telemetry);
  background: var(--paper);
}
.dependency-banner-icon { width: 38px; height: 38px; display: grid; place-items: center; border-right: 1px solid var(--line); color: var(--telemetry); }
.dependency-banner-icon svg { width: 22px; }
.dependency-banner strong { font-size: .78rem; }
.dependency-banner p { margin: 2px 0 0; font-size: .7rem; }
.dependency-counts { display: flex; flex-wrap: wrap; gap: 6px; }
.dependency-counts span { padding: 5px 7px; border: 1px solid var(--line); color: var(--ink-tertiary); font: .62rem var(--font-mono); }
.dependency-counts span.is-ready { border-color: var(--success); background: var(--success-soft); color: var(--success); }
.dependency-counts b { margin-right: 3px; }

.launch-bar {
  position: static;
  min-height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 16px;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-left: 4px solid var(--success);
  background: var(--paper-raised);
  box-shadow: none;
}
.launch-bar-copy { display: flex; align-items: center; gap: 10px; }
.launch-bar-copy > span:last-child { display: grid; }
.launch-bar-copy strong { font-size: .76rem; }
.launch-bar-copy small { color: var(--ink-tertiary); font-size: .63rem; }
.launch-ready-dot { width: 7px; height: 7px; flex: 0 0 7px; background: var(--success); }
.form-submit { min-width: 154px; }

.shape-selection-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(280px, .95fr);
  gap: 18px;
  align-items: stretch;
}
.shape-preview-card {
  position: relative;
  min-height: 245px;
  overflow: hidden;
  display: grid;
  place-items: center;
  padding: 18px;
  border: 1px solid var(--line-strong);
  border-radius: 0;
  background: var(--paper-raised);
}
.shape-preview-card::before {
  position: absolute;
  top: 9px;
  left: 10px;
  z-index: 2;
  color: var(--ink-tertiary);
  content: "FIG. G-02";
  font: 600 .56rem var(--font-mono);
}
.shape-preview-grid { position: absolute; inset: 0; background: linear-gradient(var(--grid-line) 1px, transparent 1px), linear-gradient(90deg, var(--grid-line) 1px, transparent 1px); background-size: 18px 18px; }
.shape-preview-card svg { position: relative; z-index: 1; width: 164px; height: 164px; }
.preview-case { fill: var(--oxide-soft); stroke: var(--oxide); stroke-width: 2; }
.preview-guide { fill: none; stroke: var(--line-strong); stroke-width: 1; stroke-dasharray: 3 6; }
.preview-port { fill: var(--paper-raised); stroke: var(--telemetry); stroke-width: 2.2; stroke-linejoin: round; }
.preview-check { fill: none; stroke: var(--success); stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; }
.shape-preview-card [data-preview-shape] { display: none; }
.shape-preview-card[data-active-shape="circular"] [data-preview-shape="circular"],
.shape-preview-card[data-active-shape="star"] [data-preview-shape="star"],
.shape-preview-card[data-active-shape="wagon_wheel"] [data-preview-shape="wagon_wheel"],
.shape-preview-card[data-active-shape="custom_outline"] [data-preview-shape="custom_outline"],
.shape-preview-card[data-active-shape="custom_npz"] [data-preview-shape="custom_npz"] { display: block; }
.shape-preview-card > div:last-child { position: relative; z-index: 1; display: grid; justify-items: center; margin-top: -6px; }
.shape-preview-card > div:last-child span { color: var(--ink-tertiary); font: 600 .56rem var(--font-mono); letter-spacing: .04em; text-transform: uppercase; }
.shape-preview-card > div:last-child strong { margin-top: 2px; font-size: .75rem; }
.shape-shortcuts { display: flex; flex-wrap: wrap; gap: 0; margin-top: 14px; }
.shape-shortcuts button { min-height: 34px; padding: 7px 11px; border-color: var(--line-strong); border-right-width: 0; border-radius: 0; background: var(--paper); color: var(--ink-secondary); box-shadow: none; font-size: .68rem; }
.shape-shortcuts button:last-child { border-right-width: 1px; }
.shape-shortcuts button:hover, .shape-shortcuts button.is-selected { border-color: var(--telemetry); background: var(--telemetry-soft); color: var(--telemetry); box-shadow: none; transform: none; }

.upgrade-notice { display: flex; gap: 12px; margin-bottom: 18px; padding: 13px 14px; border: 1px solid var(--warning); border-left: 4px solid var(--warning); background: var(--warning-soft); color: var(--warning); }
.upgrade-notice svg { flex: 0 0 22px; margin-top: 1px; }
.upgrade-notice strong { color: var(--warning); font-size: .78rem; }
.upgrade-notice p { margin: 2px 0 0; color: var(--warning); font-size: .71rem; }
.upgrade-form { margin-bottom: 0; }
.locked-help { color: var(--success); }

.geometry-result { margin-top: 20px; border-top: 4px solid var(--success); }
.geometry-result-intro { display: flex; align-items: center; justify-content: space-between; gap: 28px; margin-bottom: 16px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.geometry-result-intro p { max-width: 680px; margin: 8px 0 0; font-size: .76rem; }
.result-ready-badge { display: inline-flex; align-items: center; gap: 7px; color: var(--success); font: 650 .61rem var(--font-mono); letter-spacing: .035em; text-transform: uppercase; }
.result-ready-badge i { width: 7px; height: 7px; background: var(--success); }
.geometry-result-dimensions { display: flex; flex: 0 0 auto; gap: 0; border: 1px solid var(--line); }
.geometry-result-dimensions > span { min-width: 112px; display: grid; padding: 9px 11px; border-right: 1px solid var(--line); background: var(--paper-muted); }
.geometry-result-dimensions > span:last-child { border-right: 0; }
.geometry-result-dimensions strong { font: 700 .92rem var(--font-mono); }
.geometry-result-dimensions small { margin-top: 2px; color: var(--ink-tertiary); font-size: .58rem; }

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  border-top: 1px solid var(--line-strong);
  border-left: 1px solid var(--line-strong);
}
.metric-card {
  position: relative;
  min-height: 126px;
  overflow: hidden;
  padding: 15px;
  border: 0;
  border-right: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line-strong);
  border-radius: 0;
  background: var(--paper-raised);
}
.metric-card::after { content: none; }
.metric-card > span { color: var(--ink-tertiary); font: 650 .58rem var(--font-mono); letter-spacing: .035em; text-transform: uppercase; }
.metric-card > strong { display: block; margin-top: 13px; font: 700 clamp(1.18rem, 2.4vw, 1.65rem) var(--font-mono); letter-spacing: -.04em; line-height: 1.1; }
.metric-card > strong small { color: var(--ink-tertiary); font: 500 .62em var(--font-mono); letter-spacing: 0; }
.metric-card p { margin: 7px 0 0; color: var(--ink-tertiary); font-size: .62rem; line-height: 1.4; }
.metric-card-accent { border-top: 3px solid var(--oxide); background: var(--oxide-soft); }
.metric-card-accent > span, .metric-card-accent > strong { color: var(--oxide); }
.geometry-metrics { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.metric-card-wide { grid-column: span 1; }
.result-actions { margin: 18px 0 24px; }
.result-actions .btn:first-child { min-width: 210px; }

.result-status-line { display: flex; align-items: center; flex-wrap: wrap; gap: 11px; margin-top: 18px; color: #97a29b; font: .64rem var(--font-mono); }
.status-badge { display: inline-flex; align-items: center; gap: 7px; padding: 5px 8px; border: 1px solid currentColor; border-radius: 0; font: 650 .59rem var(--font-mono); letter-spacing: .035em; line-height: 1; text-transform: uppercase; }
.status-badge i { width: 5px; height: 5px; background: currentColor; }
.status-running { background: var(--warning-soft); color: var(--warning); }
.status-done { background: var(--success-soft); color: var(--success); }
.status-error { background: var(--error-soft); color: var(--error); }
.page-heading .status-done { border: 1px solid #67b88b; background: rgba(103, 195, 145, .1); color: #76d09e; }
.page-heading .status-error { border: 1px solid #d46372; background: rgba(239, 118, 135, .1); color: #ef8996; }

.engineering-details { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; margin-top: 18px; border-top: 2px solid var(--line-strong); border-left: 1px solid var(--line); }
.engineering-detail { min-width: 0; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 15px; padding: 11px 12px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.engineering-detail > span { color: var(--ink-secondary); font-size: .7rem; }
.engineering-detail > strong { font: 650 .7rem var(--font-mono); text-align: right; }
.engineering-detail .label-row { margin: 0; }
.engineering-detail .info-icon { width: 25px; height: 25px; min-height: 25px; }

.results-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.result-figure { min-width: 0; overflow: hidden; margin: 0; border: 1px solid var(--line-strong); border-radius: 0; background: var(--paper); box-shadow: none; }
.figure-header { min-height: 45px; display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 10px 12px; border-bottom: 1px solid var(--line-strong); background: var(--paper-muted); }
.figure-header span { color: var(--ink); font-size: .73rem; font-weight: 700; }
.figure-header span::before { margin-right: 7px; color: var(--oxide); content: "FIG."; font: 650 .56rem var(--font-mono); }
.figure-header small { color: var(--ink-tertiary); font: 600 .56rem var(--font-mono); letter-spacing: .035em; text-transform: uppercase; }
.result-figure img, .results-grid > img { width: 100%; display: block; background: #fff; }
.geometry-preview-grid { margin-top: 8px; }
.download-list { display: flex; flex-wrap: wrap; gap: 7px; }
.download-button { justify-content: flex-start; }
.downloads a { margin: 0; }
.result-page-actions { margin: 20px 0 28px; }

.run-status-hero {
  min-height: 215px;
  display: none;
  grid-template-columns: 150px minmax(0, 1fr);
  align-items: center;
  gap: 28px;
  margin-bottom: 20px;
  padding: 28px 34px;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-left: 5px solid var(--warning);
  border-radius: 0;
  background: var(--paper);
  box-shadow: none;
}
.run-status-orb { position: relative; width: 126px; height: 126px; display: grid; place-items: center; border: 1px solid var(--line-strong); background-image: linear-gradient(var(--grid-line) 1px, transparent 1px), linear-gradient(90deg, var(--grid-line) 1px, transparent 1px); background-size: 14px 14px; }
.run-status-ring { position: absolute; inset: 18px; border: 1px dashed var(--warning); border-radius: 50%; animation: none; }
.run-status-ring::before { position: absolute; top: 50%; right: -18px; left: -18px; height: 1px; background: var(--line); content: ""; }
.run-status-core { width: 54px; height: 54px; display: grid; place-items: center; border: 1px solid var(--warning); border-radius: 0; background: var(--warning-soft); color: var(--warning); box-shadow: none; animation: none; }
.run-status-core svg { width: 28px; }
.run-status-copy h1 { font-size: clamp(2rem, 4vw, 3.25rem); }
.run-status-copy > p:not(.eyebrow) { max-width: 700px; margin: 10px 0 0; }
.run-status-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 9px 16px; margin-top: 16px; color: var(--ink-tertiary); font: .64rem var(--font-mono); }
.run-status-meta code { padding: 2px 5px; background: var(--code-bg); color: var(--ink); }

.terminal-toolbar { min-height: 37px; display: flex; align-items: center; gap: 0; padding: 7px 11px; border: 1px solid #3b443f; border-bottom: 0; border-radius: 0; background: #1a201d; color: #9ba8a1; }
.terminal-toolbar > span { display: none; }
.terminal-toolbar b { margin-left: 0; font: 500 .61rem var(--font-mono); }
.terminal-toolbar b::before { margin-right: 8px; color: var(--oxide); content: "LOG /"; font-weight: 700; }
.terminal-toolbar em { margin-left: auto; color: var(--success); font: 600 .56rem var(--font-mono); letter-spacing: .04em; text-transform: uppercase; }
.log { max-height: 430px; min-height: 140px; overflow: auto; padding: 14px; border: 1px solid #3b443f; border-radius: 0; background: var(--terminal-bg); color: var(--terminal-fg); font: .72rem/1.6 var(--font-mono); white-space: pre-wrap; }
.log-panel .section-content, .live-log-panel .section-content { padding: 14px; }

.card table { width: 100%; border-collapse: collapse; font-size: .73rem; font-variant-numeric: tabular-nums; }
.card table th, .card table td { padding: 10px 11px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.card table th { background: var(--paper-muted); color: var(--ink-secondary); font: 650 .61rem var(--font-mono); letter-spacing: .035em; text-transform: uppercase; }
.card table tr:last-child th, .card table tr:last-child td { border-bottom: 0; }
.card table tbody tr:hover { background: var(--paper-muted); }
.table-scroll { max-width: 100%; overflow-x: auto; border: 1px solid var(--line-strong); border-radius: 0; scrollbar-color: var(--line-strong) transparent; }
.table-scroll table { min-width: 650px; }
.history-table-scroll:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.saved-history { margin-top: 20px; }
.history-summary-line { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 10px; }
.history-summary-line > span { display: inline-flex; align-items: center; gap: 7px; color: var(--ink-secondary); font-size: .67rem; font-weight: 700; }
.history-summary-line i { width: 6px; height: 6px; background: var(--telemetry); }
.history-summary-line small { color: var(--ink-tertiary); font-size: .62rem; }
.history-primary-link { display: inline-flex; align-items: center; gap: 7px; color: var(--ink); font-weight: 700; text-decoration: none; }
.history-primary-link:hover { color: var(--oxide); }
.history-type-badge, .history-status { display: inline-flex; align-items: center; gap: 6px; padding: 3px 5px; border: 1px solid var(--line); border-radius: 0; background: var(--code-bg); color: var(--ink-secondary); font: 600 .58rem var(--font-mono); }
.history-status i { width: 5px; height: 5px; background: currentColor; }
.history-status-done { border-color: var(--success); background: var(--success-soft); color: var(--success); }
.history-status-running { border-color: var(--warning); background: var(--warning-soft); color: var(--warning); }
.history-status-error, .history-status-interrupted { border-color: var(--error); background: var(--error-soft); color: var(--error); }
.history-table code { padding: 2px 4px; background: var(--code-bg); color: var(--ink-secondary); font: .62rem var(--font-mono); }
.history-empty { min-height: 105px; display: flex; align-items: center; justify-content: center; gap: 13px; padding: 18px; border: 1px dashed var(--line-strong); background: var(--paper-muted); }
.history-empty > span { width: 38px; height: 38px; flex: 0 0 38px; display: grid; place-items: center; border-right: 2px solid var(--oxide); color: var(--ink-tertiary); }
.history-empty svg { width: 23px; }
.history-empty strong { font-size: .75rem; }
.history-empty .field-help { margin: 2px 0 0; }

.error { position: relative; margin: 0 0 16px; padding: 12px 14px 12px 42px; border: 1px solid var(--error); border-left: 4px solid var(--error); background: var(--error-soft); color: var(--error); font-size: .75rem; box-shadow: none; }
.error::before { position: absolute; top: 50%; left: 14px; width: 18px; height: 18px; display: grid; place-items: center; border: 1px solid currentColor; content: "!"; font: 700 .66rem var(--font-mono); transform: translateY(-50%); }

.readme-content { max-width: 80ch; line-height: 1.65; }
.readme-content h1 { margin-top: 30px; font-size: 1.6rem; }
.readme-content h2 { margin-top: 26px; font-size: 1.22rem; }
.readme-content h3 { margin-top: 21px; font-size: 1rem; }
.readme-content p { margin: 10px 0; }
.readme-content code { padding: 2px 4px; background: var(--code-bg); color: var(--ink); font: .82em var(--font-mono); }
.readme-content pre { overflow-x: auto; padding: 14px; border: 1px solid #3b443f; background: var(--terminal-bg); color: var(--terminal-fg); }
.readme-content pre code { padding: 0; background: none; color: inherit; }
.readme-content table { width: 100%; border-collapse: collapse; }
.readme-content th, .readme-content td { padding: 8px 9px; border: 1px solid var(--line); text-align: left; }
.readme-content th { background: var(--paper-muted); }
.readme-content blockquote { margin-left: 0; padding: 4px 0 4px 14px; border-left: 3px solid var(--telemetry); color: var(--ink-secondary); }
.readme-content ul, .readme-content ol { padding-left: 22px; }

.login-page { background: var(--canvas-deep); }
.login-page::before { background-image: linear-gradient(var(--grid-line) 1px, transparent 1px), linear-gradient(90deg, var(--grid-line) 1px, transparent 1px); background-size: 24px 24px; }
.login-page main { width: min(1180px, 100%); min-height: calc(100vh - 62px); padding: 40px 28px 56px; }
.login-page .site-footer { display: none; }
.login-shell { width: min(560px, 100%); min-height: 540px; overflow: hidden; display: grid; grid-template-columns: 1fr; margin: 0 auto; border: 1px solid var(--graphite-line); border-left: 6px solid var(--oxide); border-radius: 0; background: var(--paper); box-shadow: none; }
.login-visual { position: relative; min-width: 0; overflow: hidden; border-right: 1px solid var(--graphite-line); background: var(--graphite); }
.login-grid { position: absolute; inset: 0; background: linear-gradient(rgba(218, 226, 220, .05) 1px, transparent 1px), linear-gradient(90deg, rgba(218, 226, 220, .05) 1px, transparent 1px); background-size: 24px 24px; }
.login-orbit { display: none; }
.login-motor { position: absolute; top: 43%; left: 50%; width: min(570px, 90%); transform: translate(-50%, -50%); filter: none; }
.login-visual-copy { position: absolute; right: 38px; bottom: 36px; left: 38px; z-index: 2; padding-top: 18px; border-top: 1px solid var(--graphite-line); }
.login-visual-copy p { margin: 0 0 8px; color: var(--oxide); font: 600 .6rem var(--font-mono); letter-spacing: .08em; }
.login-visual-copy h2 { margin: 0 0 14px; color: #f7f6f0; font-size: clamp(1.8rem, 3.6vw, 2.8rem); }
.login-visual-copy > span { display: inline-flex; align-items: center; gap: 8px; color: #9da8a2; font: .65rem var(--font-mono); }
.login-visual-copy i { width: 6px; height: 6px; background: var(--success); }
.login-panel { min-width: 0; display: grid; place-items: center; padding: 48px; background: var(--paper); }
.login-panel-inner { width: min(380px, 100%); }
.login-lock { width: 42px; height: 42px; display: grid; place-items: center; margin-bottom: 24px; border-left: 3px solid var(--oxide); background: var(--paper-muted); color: var(--oxide); }
.login-lock svg { width: 22px; }
.login-heading h1 { font-size: clamp(2.3rem, 4vw, 3.1rem); }
.login-heading > p:last-child { margin: 12px 0 0; font-size: .82rem; }
.login-form { margin: 29px 0 0; }
.password-field-wrap { position: relative; }
.password-field-wrap > svg { position: absolute; top: 50%; left: 12px; z-index: 1; color: var(--ink-tertiary); transform: translateY(-50%); }
.password-field-wrap input { min-height: 46px; padding-left: 40px; }
.login-submit { width: 100%; min-height: 46px; justify-content: space-between; margin-top: 4px; padding-inline: 16px; }
.login-footnote { display: flex; align-items: center; gap: 7px; margin: 21px 0 0; color: var(--ink-tertiary); font: .63rem var(--font-mono); }
.login-footnote span { color: var(--success); font-size: .5rem; }

@media (max-width: 1060px) {
  .home-hero { grid-template-columns: minmax(0, .9fr) minmax(370px, 1.1fr); }
  .home-hero-copy { padding: 46px 38px; }
  .tool-card { grid-template-columns: 92px 42px minmax(200px, 1fr) minmax(230px, 1.2fr) 82px; gap: 13px; }
  .geometry-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .geometry-metrics .metric-card:last-child { grid-column: span 2; }
  .login-panel { padding: 40px; }
}

@media (max-width: 900px) {
  .nav-action-label { display: none; }
  .theme-toggle, .header-icon { width: 44px; padding: 0; }
  .home-hero { grid-template-columns: 1fr; }
  .home-hero-copy { min-height: 430px; }
  .home-hero-visual { min-height: 340px; border-top: 1px solid var(--graphite-line); border-left: 0; }
  .motor-cutaway { width: min(520px, 78vw); }
  .workspace-strip { grid-template-columns: repeat(3, 1fr); }
  .workspace-strip-heading { grid-column: 1 / -1; min-height: 64px !important; border-right: 0 !important; border-bottom: 1px solid var(--line); }
  .tool-card { grid-template-columns: 85px 42px minmax(180px, 1fr) minmax(230px, 1.15fr); }
  .tool-cta { grid-column: 3 / -1; justify-content: flex-start; margin-top: -7px; }
  .page-heading { grid-template-columns: minmax(0, 1fr) 210px; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .geometry-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .geometry-metrics .metric-card:last-child { grid-column: span 2; }
  .shape-selection-layout { grid-template-columns: 1fr; }
  .shape-preview-card { min-height: 235px; }
  .login-shell { grid-template-columns: 1fr; }
  .login-visual { min-height: 330px; border-right: 0; border-bottom: 1px solid var(--graphite-line); }
  .login-panel { padding: 46px 34px; }
}

@media (max-width: 720px) {
  .header-inner { min-height: 60px; padding: 0 17px; }
  .brand-mark { width: 34px; height: 34px; flex-basis: 34px; }
  .logout-link { min-height: 44px; padding: 0 8px; }
  main { padding: 18px 16px 48px; }
  .pipeline-header { align-items: flex-start; }
  .pipeline-summary, .pipeline-stage-count { display: none; }
  .pipeline { flex-direction: column; }
  .pipeline-step { flex: none; border-bottom-width: 1px; border-left: 3px solid transparent; }
  .pipeline-step.is-current { border-bottom-color: var(--line); border-left-color: var(--oxide); }
  .pipeline-step.is-done { border-bottom-color: var(--line); border-left-color: var(--success); }
  .pipeline-arrow { width: 34px; height: 10px; margin-left: 14px; }
  .pipeline-connector-line { width: 1px; height: 100%; }
  .pipeline-connector-arrow { display: none; }
  .pipeline-step-desc { white-space: normal; }
  .home-hero-copy { min-height: 390px; padding: 38px 28px; }
  .home-hero h1 { font-size: clamp(3.25rem, 14vw, 5rem); }
  .home-hero-lede { font-size: .92rem; }
  .home-hero-visual { min-height: 300px; }
  .section-heading-row { display: block; }
  .section-heading-row > p { margin-top: 9px; text-align: left; }
  .tool-card { grid-template-columns: 72px 40px minmax(0, 1fr); gap: 12px; }
  .tool-card .desc { grid-column: 3; }
  .tool-cta { grid-column: 3; }
  .process-card {
    grid-template-columns: 50px minmax(0, 1fr) 28px;
    grid-template-areas:
      "number kicker info"
      "number title info"
      ". description description";
    gap: 8px 13px;
  }
  .page-heading { min-height: 210px; grid-template-columns: 1fr; }
  .page-heading-copy { padding: 28px 25px; }
  .page-heading-graphic { position: absolute; right: 0; bottom: 0; width: 180px; height: 180px; border-left: 1px solid var(--graphite-line); opacity: .18; }
  .page-heading-copy { z-index: 3; }
  .form-intro { display: block; }
  .form-intro > p { margin-top: 8px; text-align: left; }
  .dependency-banner { grid-template-columns: auto 1fr; }
  .dependency-counts { grid-column: 1 / -1; padding-left: 52px; }
  .launch-bar { position: static; }
  .results-grid { grid-template-columns: 1fr; }
  .engineering-details { grid-template-columns: 1fr; }
  .run-status-hero { grid-template-columns: 112px 1fr; padding: 24px; }
  .run-status-orb { width: 100px; height: 100px; }
  .geometry-result-intro { align-items: flex-start; flex-direction: column; }
  .geometry-result-dimensions { width: 100%; }
  .geometry-result-dimensions > span { flex: 1; }
  .footer-inner { padding-inline: 17px; }
  .footer-note { display: none; }
}

@media (max-width: 560px) {
  body { font-size: 14px; }
  .brand-project { display: none; }
  .site-nav { gap: 0; }
  .theme-toggle, .header-icon { width: 44px; min-width: 44px; min-height: 44px; }
  main { padding-inline: 13px; }
  .home-hero { border-left-width: 4px; }
  .home-hero-copy { min-height: 360px; padding: 32px 20px; }
  .home-hero h1 { font-size: clamp(2.85rem, 15vw, 4rem); }
  .hero-actions { align-items: stretch; flex-direction: column; }
  .hero-actions .btn { width: 100%; }
  .hero-specs { gap: 8px 13px; }
  .hero-specs span + span { padding-left: 13px; }
  .home-hero-visual { min-height: 255px; }
  .motor-cutaway { width: 400px; max-width: 120%; }
  .workspace-strip { grid-template-columns: 1fr; }
  .workspace-strip > div { min-height: 66px; padding: 13px 15px; border-right: 0; border-bottom: 1px solid var(--line); }
  .workspace-strip > div:last-child { border-bottom: 0; }
  .workspace-strip-heading { grid-column: auto; }
  .section-heading-row h2 { font-size: 1.45rem; }
  .tools-panel > .section-content { padding: 0; }
  .tool-card { min-height: 0; grid-template-columns: 64px minmax(0, 1fr); padding: 16px 14px; }
  .tool-card-topline { grid-row: 1 / span 3; grid-column: 1; align-self: start; }
  .tool-icon { display: none; }
  .tool-card h3, .tool-card .desc, .tool-cta { grid-column: 2; }
  .process-card { padding: 16px 13px; }
  .page-heading { min-height: 230px; border-left-width: 4px; }
  .page-heading h1 { font-size: 2.35rem; }
  .page-heading-tags { margin-top: 15px; }
  .section-summary { min-height: 54px; padding: 12px 13px; }
  .section-content { padding: 16px 13px 18px; }
  .row { grid-template-columns: 1fr; gap: 0; }
  .row .field { margin-bottom: 14px; }
  .row .field:last-child { margin-bottom: 0; }
  .structured-row .field:not(.checkbox-field) .label-row { min-height: 0; }
  textarea { min-height: 280px; }
  .launch-bar { align-items: stretch; flex-direction: column; padding: 13px; box-shadow: none; }
  .launch-bar .form-submit { width: 100%; }
  .dependency-counts { padding-left: 0; }
  .shape-shortcuts { display: grid; grid-template-columns: repeat(2, 1fr); }
  .shape-shortcuts button { width: 100%; border-right-width: 1px; }
  .metric-grid, .geometry-metrics { grid-template-columns: 1fr; }
  .geometry-metrics .metric-card:last-child { grid-column: auto; }
  .metric-card { min-height: 112px; }
  .run-status-hero { display: none; }
  .run-status-orb { margin: 0 0 20px; }
  .run-status-meta { align-items: flex-start; flex-direction: column; }
  .engineering-detail { grid-template-columns: 1fr; gap: 4px; }
  .engineering-detail > strong { text-align: left; }
  .geometry-result-dimensions { flex-direction: column; }
  .geometry-result-dimensions > span { border-right: 0; border-bottom: 1px solid var(--line); }
  .geometry-result-dimensions > span:last-child { border-bottom: 0; }
  .result-actions, .page-actions { align-items: stretch; flex-direction: column; }
  .result-actions .btn, .page-actions .btn { width: 100%; }
  .history-summary-line { align-items: flex-start; flex-direction: column; gap: 3px; }
  .login-page main { padding: 22px 12px 36px; }
  .login-shell { min-height: 0; border-left-width: 4px; }
  .login-visual { min-height: 190px; }
  .login-motor { top: 37%; width: 360px; max-width: 105%; opacity: .72; }
  .login-visual-copy { right: 20px; bottom: 19px; left: 20px; padding-top: 10px; }
  .login-visual-copy h2 { margin-bottom: 0; font-size: 1.55rem; }
  .login-visual-copy > span { display: none; }
  .login-panel { padding: 34px 21px; }
  .login-lock { margin-bottom: 20px; }
}

@media (max-width: 390px) {
  .brand-name { font-size: .9rem; }
  .logout-link { padding-inline: 5px; }
  .hero-specs span + span { padding-left: 0; border-left: 0; }
  .page-heading h1 { font-size: 2.05rem; }
  .section-title { font-size: .86rem; }
  .config-form > .section-card > .section-summary .section-title { gap: 8px; }
  .shape-shortcuts { grid-template-columns: 1fr; }
}

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

/* Account disclosure, dialogs, and unified history */
.account-control { position: relative; }
.account-trigger { list-style: none; }
.account-trigger::-webkit-details-marker { display: none; }
.account-control[open] .account-trigger { background: #242a27; color: #fff; }
.account-popover {
  position: absolute;
  z-index: 30;
  top: calc(100% + 7px);
  right: 6px;
  width: min(268px, calc(100vw - 26px));
  max-height: calc(100vh - 80px);
  overflow-y: auto;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--paper-raised);
  color: var(--ink);
  box-shadow: 0 18px 42px rgb(0 0 0 / .22);
}
.account-popover-title { margin: 0; padding: 13px 14px 8px; color: var(--ink); font: 700 .72rem var(--font-mono); letter-spacing: .05em; text-transform: uppercase; }
.account-popover-identity, .account-status { display: block; padding: 0 14px 12px; color: var(--ink-secondary); font-size: .78rem; overflow-wrap: anywhere; }
.account-status { display: flex; align-items: center; gap: 7px; color: var(--warning); font: 700 .67rem var(--font-mono); letter-spacing: .04em; text-transform: uppercase; }
.account-status::before { width: 7px; height: 7px; border: 1px solid currentColor; border-radius: 50%; content: ""; }
.account-popover-actions, .account-popover form { margin: 0; border-top: 1px solid var(--line); }
.account-popover-action { width: 100%; min-height: 38px; display: flex; align-items: center; padding: 0 14px; border: 0; background: transparent; color: var(--ink); cursor: pointer; font: 650 .76rem var(--font-body); text-align: left; text-decoration: none; }
.account-popover-action:hover, .account-popover-action:focus-visible { background: var(--paper-muted); color: var(--ink-strong); }
.account-popover-action.is-danger { color: var(--error); }
.storage-warning { display: flex; align-items: center; justify-content: space-between; gap: 20px; width: min(1180px, calc(100% - 32px)); margin: 0 auto 18px; padding: 12px 16px; border: 1px solid color-mix(in srgb, var(--oxide) 45%, var(--line)); border-left: 4px solid var(--oxide); background: var(--paper-raised); color: var(--ink-secondary); font-size: .85rem; }
.account-dialog { width: min(520px, calc(100vw - 28px)); padding: 28px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--paper-raised); color: var(--ink); box-shadow: 0 24px 80px rgb(0 0 0 / .32); }
.account-dialog::backdrop { background: rgb(4 9 14 / .74); backdrop-filter: blur(3px); }
.dialog-close-form { position: absolute; top: 8px; right: 10px; }
.dialog-close-form button { border: 0; background: transparent; color: var(--ink-secondary); cursor: pointer; font-size: 1.7rem; }
.dialog-actions, .history-bulk-actions, .record-danger-actions, .pagination { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.history-filters { display: grid; grid-template-columns: minmax(180px, 2fr) repeat(4, minmax(125px, 1fr)) auto auto; align-items: end; gap: 12px; margin: 0 0 18px; padding: 16px; border: 1px solid var(--line); background: var(--paper-raised); }
.history-bulk-actions { margin-bottom: 14px; }
.history-manager-table td:first-child, .history-manager-table th:first-child { width: 42px; text-align: center; }
.history-manager-table td:nth-child(2) small { display: block; margin-top: 4px; }
.lineage-summary { display: block; color: var(--oxide); font-weight: 700; }
.history-manager-table td:last-child small { display: block; margin-top: 4px; color: var(--ink-tertiary); }
.pagination { justify-content: center; margin-top: 16px; }
.btn-danger { border-color: #a33; background: #8f2f28; color: #fff; }
.btn-danger:disabled { opacity: .45; cursor: not-allowed; }
.lineage-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.lineage-card { display: flex; flex-direction: column; gap: 7px; min-height: 145px; padding: 16px; border: 1px solid var(--line); background: var(--paper-raised); }
.lineage-card > span { color: var(--oxide); font: 800 .7rem/1 var(--font-body); letter-spacing: .12em; text-transform: uppercase; }
.lineage-card small, .artifact-list small { color: var(--ink-tertiary); }
.artifact-list { display: grid; gap: 7px; }
.artifact-preview-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin-bottom: 18px; }
.artifact-preview { overflow: hidden; padding: 0; border: 1px solid var(--line); background: var(--paper-raised); color: var(--ink); cursor: zoom-in; text-align: left; }
.artifact-preview img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: contain; background: #fff; }
.artifact-preview span { display: block; overflow: hidden; padding: 9px 11px; font-size: .76rem; text-overflow: ellipsis; white-space: nowrap; }
.image-lightbox { width: min(1100px, calc(100vw - 30px)); max-height: calc(100vh - 30px); padding: 40px 14px 14px; border: 1px solid var(--line-strong); background: var(--paper-raised); }
.image-lightbox::backdrop { background: rgb(2 5 8 / .88); }
.image-lightbox img { display: block; max-width: 100%; max-height: calc(100vh - 90px); margin: auto; object-fit: contain; }
.image-lightbox button { position: absolute; top: 5px; right: 10px; border: 0; background: transparent; color: var(--ink); cursor: pointer; font-size: 1.8rem; }
.artifact-list > a { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 11px 13px; border: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.artifact-list > a:hover { border-color: var(--oxide); }
.artifact-list span:first-child { display: flex; flex-direction: column; min-width: 0; }
.artifact-list strong { overflow-wrap: anywhere; }
.json-record { max-height: 540px; overflow: auto; padding: 14px; border: 1px solid var(--line); background: var(--code-bg); color: var(--ink); white-space: pre-wrap; }
.record-danger-actions { justify-content: space-between; margin: 22px 0; padding-top: 18px; border-top: 1px solid var(--line); }
.record-danger-actions form { display: flex; gap: 9px; }
.admin-users-table small { display: block; margin-top: 3px; color: var(--ink-tertiary); }
.admin-row-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.admin-row-actions form { display: flex; align-items: center; gap: 5px; margin: 0; }
.admin-row-actions select { min-height: 32px; width: auto; padding: 4px 6px; font-size: .7rem; }
.admin-reset-control { position: relative; }
.admin-reset-control > summary { cursor: pointer; color: var(--ink-secondary); font-size: .72rem; }
.admin-reset-control > form { position: absolute; z-index: 5; right: 0; width: 250px; display: grid; gap: 8px; padding: 12px; border: 1px solid var(--line-strong); background: var(--paper-raised); box-shadow: 0 12px 28px rgb(0 0 0 / .18); }
.admin-reset-control label { margin: 0; font-size: .68rem; }
.admin-reset-control input { min-height: 34px; margin-top: 3px; }

@media (max-width: 800px) {
  .history-filters { grid-template-columns: 1fr 1fr; }
  .lineage-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .account-popover { right: 0; }
  .history-filters { grid-template-columns: 1fr; }
  .record-danger-actions, .record-danger-actions form { align-items: stretch; flex-direction: column; }
}
