:root {
  color-scheme: dark;
  --bg: #07100f;
  --surface: #0d1716;
  --surface-2: #121f1d;
  --surface-3: #182824;
  --line: #263a35;
  --line-strong: #3a5750;
  --text: #edf7f3;
  --muted: #9bb0aa;
  --accent: #86f0c4;
  --accent-strong: #33c98f;
  --accent-ink: #062016;
  --warning: #ffd27b;
  --danger: #ff8f87;
  --info: #8fc8ff;
  --radius: 20px;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.28);
}

* { box-sizing: border-box; }
html { background: var(--bg); scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 5% -10%, rgba(63, 196, 144, 0.16), transparent 34rem),
    radial-gradient(circle at 100% 0%, rgba(82, 128, 173, 0.12), transparent 30rem),
    linear-gradient(180deg, #081110 0%, #07100f 55%, #050b0a 100%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

a { color: inherit; }
button, input, textarea, select { font: inherit; }
button { color: inherit; }
img { max-width: 100%; }
[hidden] { display: none !important; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 72px;
  padding: 12px max(24px, calc((100vw - 1560px) / 2));
  border-bottom: 1px solid rgba(58, 87, 80, 0.55);
  background: rgba(7, 16, 15, 0.86);
  backdrop-filter: blur(18px);
}
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line-strong);
  border-radius: 13px;
  color: var(--accent);
  background: linear-gradient(145deg, var(--surface-3), var(--surface));
  font-weight: 900;
  letter-spacing: -0.08em;
}
.brand strong, .brand small { display: block; }
.brand strong { font-size: 15px; letter-spacing: -0.015em; }
.brand small { color: var(--muted); font-size: 11px; margin-top: 1px; }
.header-actions { display: flex; align-items: center; gap: 10px; }
.runtime-badge { display: inline-flex; align-items: center; min-height: 28px; padding: 4px 9px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface-2); color: var(--muted); font-size: 10px; font-weight: 850; letter-spacing: 0.06em; text-transform: uppercase; }
.runtime-badge.local { color: var(--accent); border-color: rgba(134, 240, 196, 0.35); }
.runtime-badge.static { color: var(--info); border-color: rgba(143, 200, 255, 0.32); }
.primary-nav { display: flex; align-items: center; gap: 4px; }
.primary-nav a {
  padding: 9px 12px;
  border-radius: 10px;
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
}
.primary-nav a:hover, .primary-nav a[aria-current="page"] { color: var(--text); background: var(--surface-2); }
.nav-toggle { display: none; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); padding: 8px 11px; }

.app-layout {
  display: grid;
  grid-template-columns: minmax(300px, 380px) minmax(0, 1fr);
  gap: 24px;
  width: min(1560px, calc(100% - 48px));
  margin: 30px auto 72px;
  align-items: start;
}
.workspace-panel {
  position: sticky;
  top: 102px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  background: rgba(13, 23, 22, 0.92);
  box-shadow: var(--shadow);
}
.workspace-heading { display: flex; align-items: start; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.workspace-heading h2 { margin: 4px 0 0; font-size: 20px; letter-spacing: -0.035em; }
.eyebrow { color: var(--accent); text-transform: uppercase; letter-spacing: 0.13em; font-size: 10px; font-weight: 800; }
.text-button { border: 0; background: transparent; color: var(--accent); padding: 4px; font-size: 12px; font-weight: 750; cursor: pointer; }
.text-button:disabled { opacity: 0.35; cursor: default; }
.drop-zone {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 285px;
  border: 1px dashed var(--line-strong);
  border-radius: 16px;
  overflow: hidden;
  background: #07100f;
  cursor: pointer;
  transition: border-color 150ms ease, background 150ms ease, transform 150ms ease;
}
.drop-zone:hover, .drop-zone:focus-visible, .drop-zone.is-dragging { border-color: var(--accent); background: #0c1916; outline: none; }
.drop-zone.is-dragging { transform: translateY(-2px); }
.drop-zone img { width: 100%; height: 100%; max-height: 380px; object-fit: contain; background: #030807; }
.drop-placeholder { display: grid; justify-items: center; gap: 7px; padding: 28px; text-align: center; color: var(--muted); }
.drop-placeholder strong { color: var(--text); font-size: 16px; }
.drop-placeholder small { font-size: 11px; }
.drop-glyph { display: grid; place-items: center; width: 48px; height: 48px; margin-bottom: 3px; border: 1px solid var(--line); border-radius: 15px; color: var(--accent); font-size: 29px; }
kbd { padding: 1px 5px; border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 5px; background: var(--surface); color: var(--text); font: inherit; font-size: 0.9em; }
.workspace-status { margin-top: 12px; min-height: 20px; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.workspace-status.error { color: var(--danger); }
.workspace-metadata { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 13px 0 0; }
.workspace-metadata div { padding: 10px; border: 1px solid #20332e; border-radius: 11px; background: var(--surface-2); }
.workspace-metadata dt { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em; }
.workspace-metadata dd { margin: 4px 0 0; font-size: 12px; font-weight: 750; overflow-wrap: anywhere; }
.workspace-note { margin: 13px 2px 0; color: #7f9690; font-size: 11px; line-height: 1.55; }

.route-content { min-width: 0; outline: none; }
.page-header { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 22px; }
.page-header h1 { margin: 7px 0 8px; font-size: clamp(34px, 5vw, 64px); line-height: 0.98; letter-spacing: -0.055em; }
.page-header p { max-width: 760px; margin: 0; color: var(--muted); font-size: 16px; line-height: 1.65; }
.badge-row { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 14px; }
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 26px;
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}
.badge.exact { color: var(--accent); border-color: rgba(134, 240, 196, 0.35); }
.badge.estimated { color: var(--warning); border-color: rgba(255, 210, 123, 0.35); }
.badge.generated { color: #d3b6ff; border-color: rgba(211, 182, 255, 0.35); }
.badge.local { color: var(--info); border-color: rgba(143, 200, 255, 0.32); }
.badge.upload { color: var(--warning); border-color: rgba(255, 210, 123, 0.32); }

.hero-panel, .panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(13, 23, 22, 0.88);
  box-shadow: var(--shadow);
}
.hero-panel { position: relative; overflow: hidden; padding: clamp(28px, 5vw, 66px); }
.hero-panel::after { content: ""; position: absolute; inset: auto -10% -45% 40%; height: 380px; border-radius: 50%; background: radial-gradient(circle, rgba(51, 201, 143, 0.17), transparent 66%); pointer-events: none; }
.hero-panel h1 { position: relative; max-width: 980px; margin: 10px 0 18px; font-size: clamp(42px, 7vw, 88px); line-height: 0.93; letter-spacing: -0.065em; }
.hero-panel .lead { position: relative; max-width: 740px; margin: 0; color: var(--muted); font-size: 17px; line-height: 1.7; }
.hero-actions, .button-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.button, button.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--text);
  text-decoration: none;
  font-weight: 800;
  font-size: 13px;
  cursor: pointer;
}
.button:hover { border-color: var(--line-strong); background: var(--surface-3); }
.button.primary { border-color: transparent; background: linear-gradient(135deg, var(--accent), var(--accent-strong)); color: var(--accent-ink); }
.button.danger { color: var(--danger); }
.button:disabled { opacity: 0.38; cursor: not-allowed; }

.tool-grid, .feature-grid, .pricing-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-top: 18px; }
.tool-card, .feature-card, .price-card { display: flex; flex-direction: column; min-height: 220px; padding: 22px; border: 1px solid var(--line); border-radius: 17px; background: var(--surface); text-decoration: none; }
.tool-card:hover { border-color: var(--line-strong); transform: translateY(-1px); }
.tool-card h2, .feature-card h3, .price-card h2 { margin: 12px 0 8px; letter-spacing: -0.035em; }
.tool-card p, .feature-card p, .price-card p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.6; }
.tool-card .arrow { margin-top: auto; padding-top: 20px; color: var(--accent); font-weight: 850; }
.layer-number { color: var(--accent); font-size: 11px; font-weight: 900; letter-spacing: 0.12em; }

.panel { padding: 22px; margin-top: 16px; }
.panel-header { display: flex; align-items: start; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.panel-header h2 { margin: 4px 0 0; font-size: 21px; letter-spacing: -0.035em; }
.panel-header p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.empty-state { display: grid; place-items: center; min-height: 220px; padding: 30px; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: 15px; background: rgba(7, 16, 15, 0.65); }
.empty-state strong { display: block; color: var(--text); margin-bottom: 6px; }

.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.field { display: grid; gap: 7px; }
.field.full { grid-column: 1 / -1; }
.field label, .field > span { color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }
textarea, input[type="text"], select, input[type="range"] { width: 100%; }
textarea, input[type="text"], select {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #07100f;
  color: var(--text);
  padding: 11px 12px;
  outline: none;
}
textarea:focus, input[type="text"]:focus, select:focus { border-color: var(--accent); }
textarea { min-height: 142px; resize: vertical; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; line-height: 1.5; }
.output-area { min-height: 200px; max-height: 420px; }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.metric { min-width: 0; padding: 15px; border: 1px solid #20332e; border-radius: 13px; background: var(--surface-2); }
.metric span { display: block; color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: 0.07em; }
.metric strong { display: block; margin-top: 7px; font-size: 18px; overflow-wrap: anywhere; }
.metric.primary strong { font-size: 27px; color: var(--accent); }

.data-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.data-table th, .data-table td { padding: 10px 9px; border-bottom: 1px solid #20332e; text-align: left; vertical-align: top; overflow-wrap: anywhere; }
.data-table th { width: 34%; color: var(--muted); font-weight: 650; }
.data-table td { color: var(--text); }
.table-wrap { overflow-x: auto; }
.code-block { margin: 0; padding: 15px; border: 1px solid #20332e; border-radius: 12px; background: #040a08; color: #bff6de; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; font: 12px/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

.split-view { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.image-stage { min-height: 310px; display: grid; place-items: center; border: 1px solid #20332e; border-radius: 14px; overflow: hidden; background: #030807; }
.image-stage img { width: 100%; height: 100%; max-height: 620px; object-fit: contain; }
.image-stage .empty-state { width: 100%; min-height: 310px; border: 0; }
.stage-label { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; color: var(--muted); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; }

.notice { padding: 13px 15px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); color: var(--muted); font-size: 12px; line-height: 1.6; }
.notice.warning { border-color: rgba(255, 210, 123, 0.32); color: #f5dfb4; }
.notice.error { border-color: rgba(255, 143, 135, 0.35); color: #ffd0cc; background: rgba(74, 22, 19, 0.28); }
.notice.success { border-color: rgba(134, 240, 196, 0.3); color: #c8f7e4; }

.local-launch { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 16px; border: 1px solid rgba(143, 200, 255, 0.28); border-radius: 14px; background: rgba(20, 37, 43, 0.48); }
.local-launch strong { display: block; color: var(--text); margin-bottom: 5px; }
.local-launch p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.local-launch .button { flex: 0 0 auto; white-space: nowrap; }
.status-line { min-height: 22px; margin-top: 12px; color: var(--muted); font-size: 12px; }
.status-line.error { color: var(--danger); }
.progress-bar { height: 4px; overflow: hidden; border-radius: 999px; background: var(--surface-3); }
.progress-bar::after { content: ""; display: block; width: 34%; height: 100%; background: var(--accent); animation: progress 1s ease-in-out infinite alternate; }
@keyframes progress { to { transform: translateX(195%); } }

.result-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.feedback-group { display: flex; flex-wrap: wrap; gap: 8px; }
.feedback-group button[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); }
.list-clean { margin: 0; padding-left: 18px; color: var(--muted); font-size: 12px; line-height: 1.7; }

.price-card.featured { border-color: rgba(134, 240, 196, 0.45); background: linear-gradient(160deg, rgba(25, 48, 41, 0.95), var(--surface)); }
.price-label { color: var(--accent); font-size: 12px; font-weight: 850; text-transform: uppercase; letter-spacing: 0.1em; }
.price-value { margin: 10px 0 4px; font-size: 32px; font-weight: 900; letter-spacing: -0.05em; }
.price-card ul { padding-left: 18px; color: var(--muted); font-size: 12px; line-height: 1.8; }
.price-card .button { margin-top: auto; }

.site-footer { display: flex; justify-content: space-between; gap: 20px; width: min(1560px, calc(100% - 48px)); margin: 0 auto; padding: 22px 0 38px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.site-footer p { margin: 0; }
.site-footer nav { display: flex; gap: 14px; }
.toast-region { position: fixed; right: 20px; bottom: 20px; z-index: 60; display: grid; gap: 8px; pointer-events: none; }
.toast { min-width: 240px; max-width: 360px; padding: 11px 13px; border: 1px solid var(--line-strong); border-radius: 11px; background: rgba(18, 31, 29, 0.97); box-shadow: var(--shadow); color: var(--text); font-size: 12px; animation: toast-in 160ms ease-out; }
.toast.error { border-color: rgba(255, 143, 135, 0.5); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

@media (max-width: 1120px) {
  .app-layout { grid-template-columns: 300px minmax(0, 1fr); width: min(100% - 30px, 1560px); }
  .tool-grid, .feature-grid, .pricing-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 820px) {
  .site-header { padding-inline: 16px; flex-wrap: wrap; }
  .nav-toggle { display: inline-flex; }
  .primary-nav { display: none; width: 100%; padding-bottom: 8px; overflow-x: auto; }
  .primary-nav.is-open { display: flex; }
  .app-layout { display: block; width: min(100% - 24px, 1560px); margin-top: 18px; }
  .workspace-panel { position: static; margin-bottom: 22px; }
  .drop-zone { min-height: 220px; }
  .page-header { display: block; }
  .split-view { grid-template-columns: 1fr; }
  .site-footer { width: min(100% - 24px, 1560px); flex-direction: column; }
}

@media (max-width: 560px) {
  .brand small { display: none; }
  .tool-grid, .feature-grid, .pricing-grid, .field-grid, .metric-grid { grid-template-columns: 1fr; }
  .field.full { grid-column: auto; }
  .workspace-metadata { grid-template-columns: 1fr 1fr; }
  .panel, .hero-panel { padding: 17px; }
  .hero-panel h1 { font-size: 45px; }
  .page-header h1 { font-size: 39px; }
  .button-row, .hero-actions { align-items: stretch; }
  .button { flex: 1 1 auto; }
}
.section-gap { margin-top: 16px; }

.clipboard-proxy { position: fixed; left: -10000px; top: 0; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.runtime-detail { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.security-list { margin: 0; padding-left: 18px; color: var(--muted); font-size: 12px; line-height: 1.75; }

@media (max-width: 760px) {
  .local-launch { align-items: stretch; flex-direction: column; }
  .local-launch .button { width: 100%; }
}

/* Phase 1 browser runtime diagnostic */
.runtime-badge.browser { color: var(--warning); border-color: rgba(255, 210, 123, 0.34); }
.runtime-badge.browser.ready { color: var(--accent); border-color: rgba(134, 240, 196, 0.42); }
.runtime-badge.browser.failed { color: var(--danger); border-color: rgba(255, 143, 135, 0.42); }
.runtime-badge.browser.stopped { color: var(--muted); border-color: var(--line); }
.runtime-state-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 6px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: var(--surface-2);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}
.runtime-state-pill[data-state="starting"] { color: var(--warning); border-color: rgba(255, 210, 123, 0.36); }
.runtime-state-pill[data-state="ready"] { color: var(--accent); border-color: rgba(134, 240, 196, 0.42); }
.runtime-state-pill[data-state="failed"] { color: var(--danger); border-color: rgba(255, 143, 135, 0.42); }
.runtime-console { overflow: hidden; }
.runtime-actions { margin-top: 0; }
.runtime-progress { padding: 14px; border: 1px solid #20332e; border-radius: 13px; background: var(--surface-2); }
.runtime-progress p { margin: 10px 0 0; color: var(--muted); font-size: 12px; }
.runtime-metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.runtime-metrics .metric strong { font-size: 15px; }
.runtime-detail-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.runtime-detail-grid > div { min-width: 0; padding: 12px 13px; border: 1px solid #20332e; border-radius: 12px; background: rgba(7, 16, 15, 0.58); }
.runtime-detail-grid span { display: block; color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: 0.07em; text-transform: uppercase; }
.runtime-detail-grid strong { display: block; margin-top: 5px; font-size: 12px; overflow-wrap: anywhere; }
.runtime-log-wrap { min-width: 0; }
.runtime-log {
  max-height: 210px;
  margin: 0;
  padding: 13px 14px 13px 34px;
  overflow: auto;
  border: 1px solid #20332e;
  border-radius: 12px;
  background: #040a08;
  color: var(--muted);
  font: 11px/1.65 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.runtime-log li + li { margin-top: 3px; }
.runtime-log strong { color: #bff6de; font-weight: 700; }

@media (max-width: 1120px) {
  .runtime-metrics, .runtime-detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
  .runtime-metrics, .runtime-detail-grid { grid-template-columns: 1fr; }
  .runtime-state-pill { margin-top: 8px; }
}

/* Phase 2 scientific capability diagnostic */
.runtime-badge.browser.capability-failed {
  color: var(--danger);
  border-color: rgba(255, 143, 135, 0.44);
}
.runtime-state-pill[data-state="capability-failed"] {
  color: var(--danger);
  border-color: rgba(255, 143, 135, 0.44);
}
.phase2-metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.capability-list { display: grid; gap: 9px; }
.capability-item {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) minmax(150px, 0.55fr);
  align-items: start;
  gap: 13px;
  padding: 13px;
  border: 1px solid #20332e;
  border-radius: 13px;
  background: var(--surface-2);
}
.capability-item.pass { border-color: rgba(134, 240, 196, 0.24); }
.capability-item.fail { border-color: rgba(255, 143, 135, 0.42); background: rgba(74, 22, 19, 0.23); }
.capability-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 25px;
  padding: 4px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.08em;
}
.capability-item.pass .capability-status { color: var(--accent); border-color: rgba(134, 240, 196, 0.38); }
.capability-item.fail .capability-status { color: var(--danger); border-color: rgba(255, 143, 135, 0.46); }
.capability-item > div { min-width: 0; }
.capability-item strong { display: block; font-size: 13px; }
.capability-item p { margin: 4px 0 0; color: var(--muted); font-size: 11px; line-height: 1.55; overflow-wrap: anywhere; }
.capability-meta { display: grid; justify-items: end; gap: 6px; min-width: 0; color: var(--muted); font-size: 10px; }
.capability-meta code {
  display: block;
  max-width: 100%;
  padding: 5px 7px;
  overflow: hidden;
  border: 1px solid #20332e;
  border-radius: 7px;
  background: #040a08;
  color: #bff6de;
  text-overflow: ellipsis;
  white-space: nowrap;
  font: 9px/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.phase2-preview-stage { min-height: 360px; }
.phase2-preview-stage img { image-rendering: auto; }

@media (max-width: 1120px) {
  .phase2-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .capability-item { grid-template-columns: 58px minmax(0, 1fr); }
  .capability-meta { grid-column: 2; justify-items: start; }
}

@media (max-width: 680px) {
  .phase2-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .capability-item { grid-template-columns: 1fr; }
  .capability-meta { grid-column: auto; justify-items: start; }
}

@media (max-width: 460px) {
  .phase2-metrics { grid-template-columns: 1fr; }
}

/* Phase 3 selected-image line detection */
.phase3-control { overflow: hidden; }
.phase3-image-grid { align-items: stretch; }
.phase3-image-stage { min-height: 420px; background: #020605; }
.phase3-image-stage img { max-height: 720px; }
.phase3-metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.phase3-runtime-metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.runtime-state-pill[data-state="completed"],
.runtime-state-pill[data-state="ready"] { color: var(--accent); border-color: rgba(134, 240, 196, 0.42); }
.runtime-state-pill[data-state="cancelled"] { color: var(--warning); border-color: rgba(255, 210, 123, 0.36); }

@media (max-width: 1120px) {
  .phase3-metrics, .phase3-runtime-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
  .phase3-metrics, .phase3-runtime-metrics { grid-template-columns: 1fr; }
  .phase3-image-stage { min-height: 300px; }
}


/* Phase 4 vanishing-point group diagnostics */
.vp-card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 11px; }
.vp-card { min-width: 0; padding: 14px; border: 1px solid #20332e; border-radius: 14px; background: var(--surface-2); }
.vp-card h3 { margin: 0; color: var(--accent); font-size: 16px; }
.vp-card p { margin: 5px 0 12px; color: var(--muted); font-size: 11px; overflow-wrap: anywhere; }
.vp-card dl { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 10px; margin: 0; }
.vp-card dt { color: var(--muted); font-size: 10px; }
.vp-card dd { margin: 0; font-size: 11px; font-weight: 800; text-align: right; }
@media (max-width: 1120px) { .vp-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 620px) { .vp-card-grid { grid-template-columns: 1fr; } }

/* Phase 5A calibration-direction candidate selection */
.vp-card.selected-candidate {
  border-color: rgba(134, 240, 196, 0.64);
  box-shadow: inset 0 0 0 1px rgba(134, 240, 196, 0.12);
}
.vp-card.merge-accepted { border-color: rgba(134, 240, 196, 0.42); }
.vp-card.merge-rejected { border-color: rgba(255, 210, 123, 0.34); }
.vp-card.merge-rejected h3 { color: var(--warning); }

.inline-field {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 2.75rem;
  padding: 0 0.8rem;
  border: 1px solid var(--border);
  border-radius: 0.8rem;
  color: var(--muted);
  font-size: 0.86rem;
}
.inline-field select {
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
}
.inline-field option { color: #08120f; }
