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

/* ── Design tokens (theme-independent) ──────────────────────────────── */
:root {
  --display: 'Bricolage Grotesque', system-ui, sans-serif;
  --serif:   'Instrument Serif', 'Times New Roman', serif;
  --body:    'Inter Tight', -apple-system, system-ui, sans-serif;
  --mono:    'JetBrains Mono', ui-monospace, monospace;

  --radius-sm: 8px;
  --radius:    14px;
  --radius-lg: 22px;
}

/* ── BEIGE theme (default) ──────────────────────────────────────────── */
.beige {
  /* Design tokens */
  --paper:        #f5f1ea;
  --paper-warm:   #ede7dc;
  --paper-card:   #fdfbf6;
  --paper-deep:   #e6dfd0;
  --ink:          #0c0a08;
  --ink-soft:     #1a1612;
  --ink-mute:     #6b6258;
  --ink-faint:    #a89f93;
  --ink-trace:    #d4cdbf;

  --molten:       #e8542a;
  --molten-deep:  #b8391e;
  --molten-glow:  #c96442;
  --cool:         #1d4ed8;
  --cool-soft:    #5a7ce0;
  --jade:         #1f7a4d;
  --signal:       #f0a020;

  --base-rgb:     12, 10, 8;
  --sidebar-bg:   rgba(255,255,255,0.55);
  --overlay-bg:   rgba(253,251,246,0.95);
  --shadow-card:  0 1px 0 rgba(12,10,8,.04), 0 8px 24px -12px rgba(12,10,8,.12);
  --shadow-lift:  0 1px 0 rgba(12,10,8,.04), 0 20px 50px -20px rgba(12,10,8,.25);

  /* Legacy tokens (keep un-redesigned screens working) */
  --bg:        #f5f1ea;
  --surface:   rgba(12,10,8,0.03);
  --line:      rgba(12,10,8,0.08);
  --line-hi:   rgba(12,10,8,0.14);
  --text-1:    #0c0a08;
  --text-2:    #6b6258;
  --text-3:    #a89f93;
  --blue:      #1d4ed8;
  --green:     #1f7a4d;
  --orange:    #e8542a;
  --blue-glow: rgba(29,78,216,0.10);
}

/* ── DARK theme ─────────────────────────────────────────────────────── */
.dark {
  /* Design tokens */
  --paper:        #0c0a08;
  --paper-warm:   #16120e;
  --paper-card:   rgba(245,241,234,0.04);
  --paper-deep:   rgba(245,241,234,0.02);
  --ink:          #f5f1ea;
  --ink-soft:     #e6e0d4;
  --ink-mute:     rgba(245,241,234,0.62);
  --ink-faint:    rgba(245,241,234,0.38);
  --ink-trace:    rgba(245,241,234,0.10);

  --molten:       #ff6840;
  --molten-deep:  #e8542a;
  --molten-glow:  #ffb38a;
  --cool:         #6e90ee;
  --cool-soft:    #a6bbf0;
  --jade:         #4ec48a;
  --signal:       #ffc053;

  --base-rgb:     245, 241, 234;
  --sidebar-bg:   rgba(0,0,0,0.25);
  --overlay-bg:   rgba(20,16,12,0.85);
  --shadow-card:  0 1px 0 rgba(0,0,0,.3), 0 8px 30px -10px rgba(0,0,0,.5);
  --shadow-lift:  0 4px 40px -8px rgba(0,0,0,.6);

  /* Legacy tokens (keep un-redesigned screens working) */
  --bg:        #0c0a08;
  --surface:   rgba(245,241,234,0.04);
  --line:      rgba(245,241,234,0.10);
  --line-hi:   rgba(245,241,234,0.18);
  --text-1:    #f5f1ea;
  --text-2:    rgba(245,241,234,0.62);
  --text-3:    rgba(245,241,234,0.42);
  --blue:      #6e90ee;
  --green:     #4ec48a;
  --orange:    #ff6840;
  --blue-glow: rgba(110,144,238,0.14);
}

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text-1);
  font-family: var(--body);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

/* ── Typography utilities (design language) ─────────────────────────── */
.mono {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-mute);
  font-weight: 500;
}
.mono-sm { font-size: 12px; }
.mono-lg { font-size: 12px; }
.display {
  font-family: var(--display);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 0.92;
  font-variation-settings: "wdth" 100;
}
.serif-italic {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.01em;
}
.tnum { font-variant-numeric: tabular-nums; }

/* ── Buttons (design language) ──────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 18px;
  border-radius: 999px;
  border: 0;
  font-family: var(--body);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: transform .15s, box-shadow .15s, background .15s, border-color .15s;
}
.btn-molten { background: var(--molten); color: #fff; box-shadow: 0 8px 30px -8px var(--molten); }
.btn-molten:hover { transform: translateY(-1px); }
.btn-ghost {
  background: rgba(var(--base-rgb), 0.04);
  color: var(--ink);
  border: 1px solid rgba(var(--base-rgb), 0.12);
}
.btn-ghost:hover { border-color: rgba(var(--base-rgb), 0.24); }

/* ── Auth (login / signup) ──────────────────────────────────────────── */
#authPage {
  display: none; position: fixed; inset: 0; z-index: 400;
  background: var(--bg); color: var(--ink);
  align-items: center; justify-content: center;
}
#authPage.active { display: flex; }
.auth-card {
  position: relative; z-index: 1;
  width: 400px; max-width: calc(100vw - 48px);
  background: var(--paper-card);
  border: 1px solid rgba(var(--base-rgb), 0.10);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lift);
  padding: 40px 40px 32px;
}
.dark .auth-card { background: var(--paper-warm); backdrop-filter: blur(20px); }
.auth-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 28px; }
.auth-title {
  font-size: 40px; letter-spacing: -0.04em; line-height: 0.95;
  color: var(--ink); margin: 10px 0 0;
}
.auth-sub { margin: 10px 0 0; color: var(--ink-mute); font-size: 15px; }
.auth-form { margin-top: 26px; display: flex; flex-direction: column; gap: 16px; }
.auth-field { display: flex; flex-direction: column; gap: 7px; }
.auth-label { color: var(--ink-faint); }
.auth-input {
  width: 100%; padding: 12px 14px;
  font-family: var(--body); font-size: 15px; color: var(--ink);
  background: rgba(var(--base-rgb), 0.04);
  border: 1px solid rgba(var(--base-rgb), 0.14);
  border-radius: var(--radius-sm); outline: none;
  transition: border-color 0.15s;
}
.auth-input::placeholder { color: var(--ink-faint); }
.auth-input:focus { border-color: var(--molten); }
.auth-error {
  display: none; font-family: var(--mono); font-size: 11px; letter-spacing: 0.04em;
  color: #d4543a; padding: 2px 0;
}
.auth-error.show { display: block; }
.auth-submit { justify-content: center; width: 100%; padding: 13px; margin-top: 4px; }
.auth-submit:disabled { opacity: 0.5; cursor: default; box-shadow: none; }
.auth-toggle {
  margin-top: 22px; padding-top: 20px;
  border-top: 1px solid rgba(var(--base-rgb), 0.08);
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.04em;
  color: var(--ink-faint); text-align: center;
}
.auth-toggle-btn {
  background: none; border: none; cursor: pointer; padding: 0 0 0 6px;
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.04em;
  color: var(--molten-glow); text-decoration: underline;
}
.dark #gatingPanel { background: rgba(var(--base-rgb), 0.05); backdrop-filter: blur(20px); }
/* Field was auto-filled from geometry; visual hint that it's a suggestion, not user input. */
.gating-input.gating-autofilled {
  border-color: rgba(232,84,42,0.35);
  background: rgba(255,104,64,0.04);
  color: var(--molten-deep);
  font-style: italic;
}
#gatingAdv { margin-top: 12px; }
.gating-msg.err { color: #d4543a; }
@media (max-width: 900px) { #gatingPanel { position: static; transform: none; width: auto; margin: 24px auto 0; } }

/* ── Molten orb — the brand's heart ─────────────────────────────────── */
.molten-orb {
  position: relative;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 30%, #fff5e8 0%, #ffb38a 14%, #e8542a 35%, #b8391e 60%, #4a1810 100%);
  box-shadow:
    inset -20px -30px 60px rgba(0,0,0,.45),
    inset 12px 8px 30px rgba(255,255,255,.35),
    0 20px 60px -20px rgba(232,84,42,.5);
}
.dark .molten-orb {
  box-shadow:
    inset -20px -30px 60px rgba(0,0,0,.55),
    inset 12px 8px 30px rgba(255,255,255,.4),
    0 30px 100px -10px rgba(232,84,42,.65),
    0 0 80px rgba(255,160,110,.3);
}
.molten-orb::after {
  content: '';
  position: absolute;
  inset: 8% 12% 60% 18%;
  background: radial-gradient(ellipse at center, rgba(255,255,255,.55), rgba(255,255,255,0) 70%);
  filter: blur(6px);
  border-radius: 50%;
  pointer-events: none;
}

@keyframes ay-float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes ay-pulse { 0% { transform: scale(1); opacity: .6; } 100% { transform: scale(2.6); opacity: 0; } }

/* ── Status indicator (dot + label) ─────────────────────────────────── */
.status {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 11px; letter-spacing: 0;
  text-transform: lowercase;
}
.status-dot { position: relative; width: 8px; height: 8px; flex-shrink: 0; }
.status-dot::before,
.status-dot::after {
  content: ''; position: absolute; inset: 0; border-radius: 50%;
  background: currentColor;
}
.status-dot::after { display: none; }
.status.is-pulse .status-dot::after {
  display: block;
  animation: ay-pulse 1.8s ease-out infinite;
}
.status--running { color: var(--molten); }
.status--queued  { color: var(--signal); }
.status--done    { color: var(--jade); }
.status--failed  { color: #c33; }
.status--draft   { color: var(--ink-faint); }

/* ── Precision grid ── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 85% 85% at 50% 50%, black 20%, transparent 100%);
  pointer-events: none;
  z-index: 0;
}

/* ── Corner marks ── */
.corner {
  position: fixed;
  width: 16px;
  height: 16px;
  z-index: 10;
  opacity: 0.25;
}
.corner--tl { top: 22px;    left: 22px;    border-top: 1.5px solid var(--text-1); border-left:  1.5px solid var(--text-1); }
.corner--tr { top: 22px;    right: 22px;   border-top: 1.5px solid var(--text-1); border-right: 1.5px solid var(--text-1); }
.corner--bl { bottom: 22px; left: 22px;    border-bottom: 1.5px solid var(--text-1); border-left: 1.5px solid var(--text-1); }
.corner--br { bottom: 22px; right: 22px;   border-bottom: 1.5px solid var(--text-1); border-right: 1.5px solid var(--text-1); }

/* ── Wordmark ── */
.wordmark {
  position: fixed;
  top: 26px;
  left: 34px;
  z-index: 10;
  display: flex;
  align-items: baseline;
  gap: 10px;
  opacity: 0;
  animation: fadeIn 0.5s 0.05s ease forwards;
}

.wordmark-name {
  font-family: var(--display);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
  line-height: 1;
}

/* ── System tag ── */

/* ── Stage ── */
.stage {
  position: relative;
  z-index: 1;
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* ── Target (circle + rings) ── */
.target {
  position: relative;
  width: 360px;
  opacity: 0;
  animation: riseIn 0.7s 0.18s cubic-bezier(0.22,1,0.36,1) forwards;
}

.ring {
  position: absolute;
  inset: -26px;
  border-radius: 50%;
  border: 1px solid var(--line);
  pointer-events: none;
  transition: border-color 0.3s, box-shadow 0.3s;
}

.ring::before { /* top tick */
  content: '';
  position: absolute;
  top: -4px; left: 50%;
  transform: translateX(-50%);
  width: 1px; height: 8px;
  background: var(--text-3);
}
.ring::after { /* right tick */
  content: '';
  position: absolute;
  right: -4px; top: 50%;
  transform: translateY(-50%);
  width: 8px; height: 1px;
  background: var(--text-3);
}

.ring-2 {
  position: absolute;
  inset: -50px;
  border-radius: 50%;
  border: 1px solid var(--line);
  opacity: 0.35;
  pointer-events: none;
  transition: opacity 0.3s;
}

/* ── Drop zone ── */
.zone {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: rgba(var(--base-rgb), 0.04);
  border: 1px solid rgba(var(--base-rgb), 0.10);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  outline: none;
  backdrop-filter: blur(20px);
  transition:
    border-color 0.25s,
    background   0.25s,
    box-shadow   0.3s,
    transform    0.35s cubic-bezier(0.34,1.4,0.64,1);
}

.zone:hover {
  border-color: rgba(232,84,42,0.45);
  background: rgba(var(--base-rgb), 0.06);
  box-shadow:
    0 0 0 1px rgba(232,84,42,0.15),
    0 0 90px -10px var(--molten),
    var(--shadow-card);
  transform: scale(1.02);
}

.zone:hover + .ring {
  border-color: rgba(232,84,42,0.30);
  box-shadow: 0 0 40px -8px var(--molten);
}

.zone:hover ~ .ring-2 { opacity: 0.65; }

.zone.drag-over {
  border-color: rgba(232,84,42,0.55);
  background: rgba(232,84,42,0.06);
  box-shadow:
    0 0 0 1px rgba(232,84,42,0.25),
    0 0 110px -10px var(--molten);
  transform: scale(1.03);
}

/* ── Icon ── */
.icon-wrap {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: 1px solid rgba(var(--base-rgb), 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(var(--base-rgb), 0.04);
  transition: border-color 0.25s, background 0.25s, transform 0.35s cubic-bezier(0.34,1.5,0.64,1);
}

.zone:hover .icon-wrap {
  border-color: var(--molten);
  background: rgba(232,84,42,0.08);
  transform: translateY(-5px);
}

.zone.drag-over .icon-wrap {
  border-color: var(--molten);
  background: rgba(232,84,42,0.14);
  transform: translateY(-7px) scale(1.08);
}

.icon-wrap svg {
  width: 20px; height: 20px;
  color: var(--ink-mute);
  transition: color 0.25s;
}

.zone:hover .icon-wrap svg,
.zone.drag-over .icon-wrap svg { color: var(--molten); }

/* ── Formats ── */
.formats {
  display: flex;
  gap: 6px;
}

.fmt {
  padding: 3px 10px;
  border: 1px solid rgba(var(--base-rgb), 0.12);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--ink-faint);
  background: rgba(var(--base-rgb), 0.03);
  transition: border-color 0.2s, color 0.2s;
}

.zone:hover .fmt { border-color: rgba(var(--base-rgb), 0.22); color: var(--ink-mute); }

/* ── Readout ── */
.readout {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.04em;
  color: var(--ink-faint);
  transition: color 0.2s;
}

.zone:hover .readout  { color: var(--molten-glow); }
.zone.drag-over .readout { color: var(--molten); }

/* ── Pill + button (post-select) ── */
.pill-wrap {
  margin-top: 30px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.3s, transform 0.3s;
  pointer-events: none;
}

.pill-wrap.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.pill {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  border: 1px solid rgba(var(--base-rgb), 0.12);
  border-radius: 999px;
  background: rgba(var(--base-rgb), 0.04);
  backdrop-filter: blur(20px);
}

.pill-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--molten);
  flex-shrink: 0;
}

.pill-name {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-mute);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 220px;
}

.pill-clear {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--ink-faint);
  font-size: 12px;
  line-height: 1;
  padding: 0 2px;
  transition: color 0.15s;
}
.pill-clear:hover { color: var(--ink); }

.open-btn {
  padding: 13px 30px;
  border: none;
  border-radius: 999px;
  background: var(--molten);
  color: #fff;
  font-family: var(--body);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0;
  cursor: pointer;
  box-shadow: 0 8px 30px -8px var(--molten);
  transition: transform 0.2s;
}

.open-btn:hover {
  transform: translateY(-1px);
}

/* ── Legend ── */

.ldot {
  width: 5px; height: 5px;
  border-radius: 50%;
}

/* ── Version ── */

#file-input { display: none; }

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes riseIn {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Side navigation ── */
#sidenav {
  position: fixed; left: 0; top: 0; bottom: 0;
  width: 52px;
  background: var(--sidebar-bg);
  backdrop-filter: blur(20px);
  border-right: 1px solid rgba(var(--base-rgb), 0.08);
  z-index: 300;
  display: flex; flex-direction: column;
  transition: width 0.32s cubic-bezier(0.22,1,0.36,1);
  overflow: hidden;
}
#sidenav.expanded { width: 220px; }

.nav-toggle {
  flex-shrink: 0; width: 52px; height: 52px;
  display: flex; align-items: center; justify-content: center;
  background: none; border: none; cursor: pointer;
  color: var(--text-3);
  border-bottom: 1px solid var(--line);
  transition: color 0.2s;
}
.nav-toggle:hover { color: var(--text-1); }
.nav-toggle svg { width: 15px; height: 15px; transition: transform 0.32s cubic-bezier(0.22,1,0.36,1); }
#sidenav.expanded .nav-toggle svg { transform: rotate(180deg); }

/* Top section: back to Dashboard / Projects (shown in sim mode) */
.nav-top {
  flex-shrink: 0;
  padding: 6px 0;
  border-bottom: 1px solid rgba(var(--base-rgb), 0.08);
}
.nav-link {
  display: flex; align-items: center; gap: 12px;
  height: 40px; padding: 0 14px; width: 100%; text-align: left;
  background: none; border: none; cursor: pointer; white-space: nowrap;
  transition: background 0.15s;
}
.nav-link:hover { background: rgba(var(--base-rgb), 0.05); }
.nav-link .nav-icon  { color: var(--ink-mute); }
.nav-link .nav-label { color: var(--ink-mute); font-family: var(--body); font-size: 14px; font-weight: 500; flex: 1; }
.nav-link:hover .nav-icon,
.nav-link:hover .nav-label { color: var(--ink); }

.nav-steps { list-style: none; padding: 8px 0; flex: 1; overflow: hidden; }

.nav-item {
  display: flex; align-items: center;
  height: 40px; padding: 0 14px; gap: 12px;
  cursor: pointer; white-space: nowrap; position: relative;
  transition: background 0.15s;
}
.nav-item:hover:not([data-state="locked"]) { background: rgba(var(--base-rgb), 0.05); }
.nav-item::before {
  content: ''; position: absolute; left: 0; top: 9px; bottom: 9px;
  width: 2px; background: transparent; border-radius: 1px;
  transition: background 0.2s;
}
.nav-item[data-state="active"] { background: rgba(255,104,64,0.10); }
.nav-item[data-state="active"]::before { background: var(--molten); }

.nav-icon {
  flex-shrink: 0; width: 24px; height: 24px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-3); transition: color 0.2s;
}
.nav-icon svg { width: 18px; height: 18px; }
.nav-item[data-state="active"]   .nav-icon { color: var(--molten); }
.nav-item[data-state="complete"] .nav-icon { color: var(--jade); }
.nav-item[data-state="available"] .nav-icon { color: var(--ink-mute); }

.nav-label {
  font-family: var(--body); font-size: 16px; font-weight: 500;
  color: var(--ink-mute); opacity: 0; transition: opacity 0.18s; flex: 1;
}
#sidenav.expanded .nav-num,
#sidenav.expanded .nav-label { opacity: 1; transition-delay: 0.1s; }
.nav-item[data-state="active"]   .nav-label { color: var(--ink); }
.nav-item[data-state="complete"] .nav-label { color: var(--ink-mute); }
.nav-item[data-state="locked"]   .nav-icon  { opacity: 0.4; }
.nav-item[data-state="locked"]   .nav-label { color: var(--ink-faint); }
.nav-item[data-state="locked"] { cursor: default; }

/* Wordmark offset from sidenav — only in sim mode (sidenav visible) */
body.sim-mode .wordmark { left: 72px; }

/* ── Page grid overlay (reused on mat + cs pages) ── */
.page-grid-overlay {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 85% 85% at 50% 50%, black 20%, transparent 100%);
}

/* ── Materials page ── */
#materialsPage, #solverPage, #meshPage {
  display: none; position: fixed; inset: 0;
  background: var(--bg); z-index: 100;
  opacity: 0; transition: opacity 0.4s ease;
  overflow-y: auto;
}
#materialsPage.active, #solverPage.active, #meshPage.active { display: block; opacity: 1; }

.mat-inner {
  position: relative; z-index: 1;
  max-width: 1000px; margin: 0 auto;
  padding: 92px 48px 72px 72px;
}
.mat-title {
  font-family: var(--display); font-size: 60px; font-weight: 700;
  color: var(--ink); letter-spacing: -0.045em; line-height: 0.92;
  margin-bottom: 40px;
}
.mat-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 20px;
  margin-bottom: 32px;
}
.mat-card {
  background: rgba(var(--base-rgb), 0.04);
  border: 1px solid rgba(var(--base-rgb), 0.08);
  border-radius: 16px; padding: 26px 30px;
  box-shadow: var(--shadow-card);
}
.dark .mat-card { backdrop-filter: blur(20px); }
.mat-card-title {
  font-family: var(--display); font-size: 20px; font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink); margin-bottom: 18px; padding-bottom: 16px;
  border-bottom: 1px solid rgba(var(--base-rgb), 0.08);
  display: flex; align-items: center; gap: 10px;
}
.mat-card-dot {
  width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0;
}
.mat-field {
  padding: 11px 0; border-bottom: 1px solid rgba(var(--base-rgb), 0.08);
}
.mat-field:last-child { border-bottom: none; padding-bottom: 0; }
.mat-field-label {
  font-family: var(--mono); font-size: 13px; font-weight: 500;
  letter-spacing: 0.03em; text-transform: uppercase;
  color: var(--ink-mute); display: block; margin-bottom: 7px;
}
.mat-input-row { display: flex; align-items: baseline; gap: 6px; }
.mat-input, .mat-select {
  font-family: var(--display); font-size: 22px; letter-spacing: -0.02em;
  color: var(--ink); background: none; border: none;
  outline: none; width: 100%;
  font-variant-numeric: tabular-nums;
  -webkit-appearance: none; appearance: none;
}
.mat-select {
  cursor: pointer; font-size: 18px;
}
.mat-select option { background: var(--paper); color: var(--ink); }
.mat-input:focus, .mat-select:focus { color: var(--molten); }
.mat-input[type=number]::-webkit-inner-spin-button { -webkit-appearance: none; }
.mat-input[type=number] { -moz-appearance: textfield; }
.mat-unit {
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.03em;
  color: var(--ink-faint); flex-shrink: 0; white-space: nowrap;
}
.mat-select-wrap {
  position: relative; display: flex; align-items: center;
}
.mat-select-wrap::after {
  content: '↓'; font-family: var(--mono);
  font-size: 11px; color: var(--ink-faint); pointer-events: none;
  margin-left: 4px; flex-shrink: 0;
}
.mat-footer {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 24px; border-top: 1px solid rgba(var(--base-rgb), 0.08);
}
.mat-back-btn {
  font-family: var(--mono); font-size: 11px;
  letter-spacing: 0.06em; color: var(--ink-faint);
  background: none; border: none; cursor: pointer; padding: 8px 0;
  transition: color 0.15s;
}
.mat-back-btn:hover { color: var(--ink); }
.mat-save-btn {
  font-family: var(--body); font-size: 15px; font-weight: 500;
  color: #fff; background: var(--molten); border: none;
  border-radius: 999px; cursor: pointer; padding: 13px 24px;
  box-shadow: 0 8px 24px -8px var(--molten);
  transition: transform 0.15s, box-shadow 0.15s; letter-spacing: 0;
}
.mat-save-btn:hover { transform: translateY(-1px); }

/* ── Coming soon page ── */
#comingSoonPage {
  display: none; position: fixed; inset: 0;
  background: var(--bg); z-index: 100;
  opacity: 0; transition: opacity 0.4s ease;
  align-items: center; justify-content: center;
  flex-direction: column; gap: 0; text-align: center;
}
#comingSoonPage.active { display: flex; opacity: 1; }
#cfdPage.active { display: block; opacity: 1; }
body.sim-mode #cfdViewport { left: 52px; }
.cfd-tb-btn.active { color: #fff; background: var(--molten); border-color: var(--molten); }

/* Spinner keyframes reused by the analysis page */
@keyframes cfd-an-spin { to { transform: rotate(360deg); } }

/* Canvas wrap (Three.js canvas goes here) */
.cfd-canvas-wrap { position: absolute; inset: 48px 0 0 200px; }

/* ── Dashboard page ── */
#dashboardPage {
  display: none; position: fixed; inset: 0;
  background: var(--bg); z-index: 50;
  opacity: 0; transition: opacity 0.4s ease;
  overflow-y: auto;
}
#dashboardPage.active { display: block; opacity: 1; }

/* ── Dashboard top bar ── */
.dash-topbar {
  position: relative; z-index: 2;
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px 60px;
  border-bottom: 1px solid rgba(var(--base-rgb), 0.06);
}
.dash-tb-left { display: flex; align-items: center; gap: 14px; }
.dash-tb-right { display: flex; align-items: center; gap: 14px; }
.ay-brand { display: flex; align-items: center; gap: 10px; }
.ay-brand-mark {
  width: 24px; height: 24px; border-radius: 7px;
  background: linear-gradient(135deg, #ff6840, #b8391e);
  box-shadow: 0 4px 16px -4px #e8542a;
}
.ay-brand-name {
  font-family: var(--display); font-weight: 700; font-size: 19px;
  letter-spacing: -0.02em; color: var(--ink);
}
.dash-tb-sep { color: var(--ink-faint); }
.dash-tb-btn {
  font-family: var(--body); font-size: 12px; font-weight: 500;
  padding: 6px 12px; border-radius: 999px;
  background: rgba(var(--base-rgb), 0.04);
  color: var(--ink);
  border: 1px solid rgba(var(--base-rgb), 0.12);
  cursor: pointer; transition: border-color .15s, background .15s;
}
.dash-tb-btn:hover { border-color: rgba(var(--base-rgb), 0.24); }

/* ── Dashboard content ── */
.dash-inner {
  position: relative; z-index: 1;
  padding: 36px 60px 60px;
}
.dash-layout {
  display: grid; grid-template-columns: 1.3fr 1fr; gap: 56px;
  align-items: start;
}

/* Left column */
.dash-left { min-width: 0; }
.dash-title {
  font-family: var(--display); font-weight: 700;
  font-size: clamp(56px, 8vw, 124px);
  line-height: 0.86; letter-spacing: -0.045em;
  color: var(--ink); margin: 20px 0 0;
}
.dash-title .serif-italic { color: var(--molten-glow); }
.dash-sub {
  margin-top: 28px; font-size: 18px; line-height: 1.45;
  color: var(--ink-mute); max-width: 480px;
}
.dash-cta-row { display: flex; gap: 12px; margin-top: 32px; flex-wrap: wrap; }
.dash-new-btn { padding: 14px 22px; }
.dash-new-btn .dash-plus { font-size: 18px; line-height: 1; }
.dash-all-btn { padding: 14px 22px; }
.dash-stat {
  margin-top: 64px; display: flex; align-items: baseline; gap: 14px;
  border-top: 1px solid rgba(var(--base-rgb), 0.10); padding-top: 22px;
}
.dash-stat-num { font-size: 56px; letter-spacing: -0.04em; color: var(--ink); }

/* Right column */
.dash-right { position: relative; }
.dash-hero { position: relative; height: 280px; }
.dash-orb {
  position: absolute; right: 30px; top: 0;
  width: 240px; height: 240px;
  animation: ay-float 5.5s ease-in-out infinite;
}
.dash-pill {
  position: absolute;
  background: rgba(var(--base-rgb), 0.05);
  border: 1px solid rgba(var(--base-rgb), 0.12);
  border-radius: 10px;
  backdrop-filter: blur(16px);
}
.dash-pill--status {
  left: 0; top: 130px; padding: 10px 14px; cursor: pointer;
  display: flex; align-items: center; gap: 10px;
}

.dash-recent { margin-top: 32px; }
.dash-recent-head {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 16px;
}
.dash-recent-all { color: var(--ink-faint); cursor: pointer; }
.dash-recent-list { display: flex; flex-direction: column; }
.dash-recent-card {
  display: grid; grid-template-columns: 1fr auto auto; gap: 16px;
  align-items: center; padding: 16px 0;
  border-bottom: 1px solid rgba(var(--base-rgb), 0.10);
  cursor: pointer; transition: transform .15s;
}
.dash-recent-card:first-child { border-top: 1px solid rgba(var(--base-rgb), 0.10); }
.dash-recent-card:hover { transform: translateX(4px); }
.dash-rc-body { min-width: 0; }
.dash-rc-name {
  font-weight: 500; font-size: 15px; color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dash-rc-meta {
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--ink-faint); margin-top: 2px;
}
.dash-rc-date {
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.06em;
  color: var(--ink-faint); min-width: 80px; text-align: right;
}

@media (max-width: 900px) {
  .dash-layout { grid-template-columns: 1fr; gap: 40px; }
}

/* ── Projects page ── */
#projectsPage {
  display: none; position: fixed; inset: 0;
  background: var(--bg); z-index: 50;
  opacity: 0; transition: opacity 0.4s ease; overflow-y: auto;
}
#projectsPage.active { display: block; opacity: 1; }
.proj-inner {
  position: relative; z-index: 1;
  padding: 92px 60px 72px 60px;
}
.proj-header {
  display: flex; align-items: flex-end; justify-content: space-between;
  margin-bottom: 36px;
}
.proj-back-btn {
  font-family: var(--mono); font-size: 13px;
  letter-spacing: 0.06em; color: var(--ink-faint); text-transform: uppercase;
  background: none; border: none; cursor: pointer; padding: 0;
  margin-bottom: 10px; display: block; transition: color 0.15s;
}
.proj-back-btn:hover { color: var(--ink-mute); }
.proj-title {
  font-family: var(--display); font-size: 76px; font-weight: 700;
  color: var(--ink); letter-spacing: -0.045em; line-height: 0.95;
}
.proj-title .proj-count {
  font-family: var(--serif); font-style: italic; font-weight: 400;
  font-size: 42px; letter-spacing: -0.01em;
  color: var(--ink-mute); vertical-align: middle; margin-left: 12px;
}
.proj-new-btn {
  font-family: var(--body); font-size: 14px; font-weight: 500;
  color: #fff; background: var(--molten);
  border: none; border-radius: 999px;
  padding: 11px 20px; cursor: pointer; letter-spacing: 0;
  box-shadow: 0 8px 24px -8px var(--molten);
  transition: transform 0.15s;
}
.proj-new-btn:hover { transform: translateY(-1px); }
.proj-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px;
}
.project-card {
  position: relative; overflow: hidden;
  background: rgba(var(--base-rgb), 0.04);
  border: 1px solid rgba(var(--base-rgb), 0.08);
  border-radius: 16px; padding: 22px; cursor: pointer;
  min-height: 200px;
  display: flex; flex-direction: column;
  box-shadow: var(--shadow-card);
  transition: background 0.15s, border-color 0.15s, transform 0.15s;
}
.dark .project-card { backdrop-filter: blur(20px); }
.project-card:hover {
  background: rgba(var(--base-rgb), 0.06);
  border-color: rgba(var(--base-rgb), 0.18);
  transform: translateY(-2px);
}
.pc-title {
  font-family: var(--display); font-size: 30px; font-weight: 700;
  letter-spacing: -0.02em; color: var(--ink); line-height: 1.0;
  margin: 8px 0 0; word-break: break-word;
}
.pc-sub {
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--ink-faint); margin-top: 6px;
}
.pc-footer {
  display: flex; align-items: center; gap: 16px; margin-top: auto;
  padding-top: 16px;
}
.pc-meta {
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.06em;
  color: var(--ink-faint);
}
.pc-open-btn {
  font-family: var(--mono); font-size: 13px; letter-spacing: 0.06em;
  color: var(--molten-glow); margin-left: auto;
  background: none; border: none; cursor: pointer; padding: 0;
  transition: opacity 0.15s;
}
.pc-open-btn:hover { opacity: 0.7; }

/* ── Upload page transition ── */
#uploadPage {
  transition: opacity 0.5s ease, transform 0.5s ease;
}
#uploadPage.hidden {
  opacity: 0;
  transform: translateY(-50px);
  pointer-events: none;
}

/* ── Loading overlay (shown over upload page while processing) ── */
#loading {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 50;
  background: var(--overlay-bg);
  backdrop-filter: blur(20px);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
}
#loading.visible { display: flex; }
#loadingStatus {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--ink-mute);
}
.progress-bar-wrap {
  width: 220px;
  height: 3px;
  background: rgba(var(--base-rgb), 0.12);
  border-radius: 2px;
  overflow: hidden;
}
#progressFill {
  height: 100%;
  width: 0%;
  background: var(--molten);
  transition: width 0.3s ease;
  border-radius: 2px;
}

/* ── Message area ── */
#messageArea {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 60;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.message {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  letter-spacing: 0.06em;
  padding: 8px 14px;
  border-radius: 4px;
  pointer-events: auto;
}
.message.error   { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.message.success { background: #dcfce7; color: #166534; border: 1px solid #86efac; }
.message.warning { background: #fef9c3; color: #854d0e; border: 1px solid #fde047; }

/* ── Viewport page ── */
#viewportPage {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 100;
  opacity: 0;
  transition: opacity 0.5s ease;
  background: var(--bg);
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 48px 48px;
}
#viewportPage.active {
  display: block;
  opacity: 1;
}
#canvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* ── Viewer toolbar ── */
#toolbar {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 110;
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--overlay-bg);
  border: 1px solid rgba(var(--base-rgb), 0.10);
  border-radius: 999px;
  padding: 6px 10px;
  backdrop-filter: blur(20px);
}
.toolbar-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  font-family: var(--body);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  color: var(--ink-mute);
  text-transform: capitalize;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.toolbar-btn:hover { background: rgba(var(--base-rgb), 0.06); color: var(--ink); }
.toolbar-btn.active { background: rgba(var(--base-rgb), 0.08); border-color: rgba(var(--base-rgb), 0.14); color: var(--ink); }
.pip {
  width: 7px; height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.toolbar-sep { width: 1px; height: 18px; background: rgba(var(--base-rgb), 0.12); margin: 0 4px; }
.toolbar-action {
  padding: 6px 14px;
  border: 1px solid rgba(var(--base-rgb), 0.12);
  border-radius: 999px;
  background: transparent;
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.03em;
  cursor: pointer;
  color: var(--ink-mute);
  transition: background 0.15s, color 0.15s;
}
.toolbar-action:hover:not(:disabled) { background: rgba(var(--base-rgb), 0.06); color: var(--ink); }
.toolbar-action:disabled { opacity: 0.35; cursor: default; }

/* ── New Project Modal ── */
#projModal {
  display: none;
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,0.35);
  backdrop-filter: blur(4px);
  align-items: center; justify-content: center;
}
#projModal.open { display: flex; }
.proj-modal-box {
  background: var(--paper-card);
  border: 1px solid rgba(var(--base-rgb), 0.12);
  border-radius: var(--radius-lg);
  padding: 40px 44px 36px;
  width: 420px;
  box-shadow: var(--shadow-lift);
}
.dark .proj-modal-box { background: var(--paper-warm); backdrop-filter: blur(20px); }
.proj-modal-label {
  font-family: var(--mono); font-weight: 500;
  font-size: 13px; letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--ink-mute);
  margin-bottom: 14px;
}
.proj-modal-title {
  font-family: var(--display);
  font-size: 30px; font-weight: 700; letter-spacing: -0.03em;
  color: var(--ink); margin-bottom: 28px;
}
.proj-modal-input {
  width: 100%; padding: 12px 14px;
  font-family: var(--body); font-size: 16px; font-weight: 500;
  color: var(--ink);
  background: rgba(var(--base-rgb), 0.04);
  border: 1px solid rgba(var(--base-rgb), 0.14);
  border-radius: var(--radius-sm); outline: none;
  transition: border-color 0.2s;
  margin-bottom: 28px;
}
.proj-modal-input:focus { border-color: var(--molten); }
.proj-modal-actions { display: flex; gap: 10px; justify-content: flex-end; }
.proj-modal-cancel {
  font-family: var(--mono); font-size: 11px;
  letter-spacing: 0.06em; color: var(--ink-mute); text-transform: uppercase;
  background: none; border: 1px solid rgba(var(--base-rgb), 0.14);
  border-radius: 999px;
  padding: 10px 18px; cursor: pointer; transition: color 0.15s, border-color 0.15s;
}
.proj-modal-cancel:hover { color: var(--ink); border-color: rgba(var(--base-rgb), 0.28); }
.proj-modal-create {
  font-family: var(--body); font-size: 14px; font-weight: 500;
  color: #fff; background: var(--molten);
  border: none; border-radius: 999px;
  padding: 11px 24px; cursor: pointer;
  box-shadow: 0 8px 24px -8px var(--molten);
  transition: transform 0.15s;
}
.proj-modal-create:hover { transform: translateY(-1px); }
.proj-modal-create:disabled { opacity: 0.4; cursor: default; box-shadow: none; }

/* ── Live Solver Monitor page ── */
#monitorPage {
  display: none; position: fixed; inset: 0;
  background: var(--bg); z-index: 60;
  opacity: 0; transition: opacity 0.4s ease;
  /* The hero is min-height:100vh, so without this the solver diagnostics
     below it are clipped by the fixed container and cannot be reached. */
  overflow-y: auto; overflow-x: hidden;
}
#monitorPage.active { display: block; opacity: 1; }

/* ───────── Live hero (the dark-running design ported to vanilla) ───────── */
.mon-hero {
  position: relative; z-index: 1;
  min-height: 100vh; box-sizing: border-box;
  display: flex; flex-direction: column;
  padding: 70px 56px 32px 100px;
  gap: 28px;
}
.mon-hero::before {
  /* the ambient molten glow behind the orb */
  content: ''; position: absolute; pointer-events: none;
  right: 8%; top: 50%; width: 900px; height: 900px;
  transform: translate(0, -50%);
  background: radial-gradient(circle, rgba(255,104,64,0.18) 0%, transparent 70%);
  animation: monOrbGlow 6s ease-in-out infinite;
  z-index: 0;
}
@keyframes monOrbGlow { 0%,100% { transform: translate(0,-50%) scale(1); } 50% { transform: translate(0,-50%) scale(1.05); } }

.mon-hero-topbar { display: flex; justify-content: space-between; align-items: center;
  padding-bottom: 16px; border-bottom: 1px solid rgba(var(--base-rgb), 0.06); position: relative; z-index: 1; }
.mon-hero-topbar-left { display: flex; gap: 14px; align-items: baseline; }
.mon-hero-section { font-family: var(--display); font-weight: 700; font-size: 17px; letter-spacing: -0.02em; }
.mon-hero-crumb { font-family: var(--mono); font-size: 12px; color: var(--ink-mute); }
.mon-hero-topbar-right { display: flex; gap: 12px; align-items: center; }
.mon-hero-ghost { background: transparent; border: 1px solid rgba(var(--base-rgb), 0.12); color: var(--ink-mute);
  font-family: var(--body); font-size: 12px; padding: 6px 12px; border-radius: 6px; cursor: pointer;
  transition: color 0.15s, border-color 0.15s; }
.mon-hero-ghost:hover { color: var(--ink); border-color: rgba(var(--base-rgb), 0.25); }

.mon-status-live { color: var(--molten); font-family: var(--mono); font-size: 11px;
  letter-spacing: 0.06em; text-transform: uppercase; display: inline-flex; align-items: center; gap: 8px; }
.mon-status-live::before { content: ''; width: 8px; height: 8px; border-radius: 50%;
  background: var(--molten); animation: monPulse 1.6s ease-out infinite;
  box-shadow: 0 0 14px var(--molten); }
.mon-demo-badge { font-family: var(--mono); font-size: 12px; letter-spacing: 0.10em;
  text-transform: uppercase; color: var(--signal); padding: 4px 10px;
  border: 1px solid var(--signal); border-radius: 4px;
  background: rgba(240,160,32,0.08); }

.mon-hero-main { flex: 1; display: grid; grid-template-columns: 1.1fr 1fr; gap: 48px;
  align-items: center; position: relative; z-index: 1; }
.mon-hero-eyebrow { font-family: var(--mono); font-size: 13px; letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--molten-glow); display: block; }
.mon-hero-headline { font-family: var(--display); font-weight: 700; font-size: 92px;
  line-height: 0.86; margin: 12px 0 0; letter-spacing: -0.045em; }
.mon-hero-pct-sign { font-size: 56px; color: var(--ink-faint); }
.mon-hero-stage { font-family: var(--serif); font-style: italic; font-weight: 400;
  font-size: 58px; color: var(--molten-glow); display: block; }

.mon-hero-stats { margin-top: 24px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.mon-hero-stat-label { font-family: var(--mono); font-size: 12px; letter-spacing: 0.03em;
  text-transform: uppercase; color: var(--ink-mute); display: block; }
.mon-hero-stat-value { font-family: var(--display); font-size: 28px; letter-spacing: -0.02em;
  margin-top: 2px; display: block; color: var(--ink); }

.mon-hero-progress { margin-top: 22px; }
.mon-hero-progress-meta { display: flex; justify-content: space-between; }
.mon-hero-bar { margin-top: 8px; height: 6px; border-radius: 3px;
  background: rgba(var(--base-rgb), 0.08); overflow: hidden; position: relative; }
.mon-hero-bar-fill { height: 100%; background: linear-gradient(to right, #ffb38a, #ff6840);
  transition: width 0.2s ease-out; position: relative; }
.mon-hero-bar-fill::after { content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
  animation: monShimmer 2.2s linear infinite; }
@keyframes monShimmer { 0% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }

.mon-stages { margin-top: 10px; display: flex; gap: 4px; }
.mon-stage { flex: 1; }
.mon-stage-bar { height: 3px; border-radius: 1.5px;
  background: rgba(var(--base-rgb), 0.08); overflow: hidden; }
.mon-stage-bar > i { display: block; height: 100%; background: var(--molten);
  transition: width 0.2s ease-out; }
.mon-stage-label { font-family: var(--mono); font-size: 12px; color: var(--ink-mute);
  margin-top: 4px; display: block; }

.mon-hero-right { position: relative; display: flex; justify-content: center;
  align-items: center; min-height: 360px; }
.mon-hero-orb { width: 300px; height: 300px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff5e8 0%, #ffb38a 14%, #e8542a 35%, #b8391e 60%, #4a1810 100%);
  box-shadow: inset -20px -30px 60px rgba(0,0,0,0.45),
              inset 12px 8px 30px rgba(255,255,255,0.35),
              0 20px 60px -20px rgba(232,84,42,0.5);
  animation: monOrbFloat 5s ease-in-out infinite; }
@keyframes monOrbFloat { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
.mon-hero-ring { position: absolute; inset: 0; margin: auto; width: 340px; height: 340px; }

.mon-hero-footer { margin-top: auto; padding-top: 18px;
  border-top: 1px solid rgba(var(--base-rgb), 0.06);
  display: flex; justify-content: space-between; align-items: center;
  position: relative; z-index: 1; }
.mon-hero-status-line { font-family: var(--mono); font-size: 11px; color: var(--ink-faint); }
.mon-hero-console-link { font-family: var(--mono); font-size: 11px;
  color: var(--molten-glow); cursor: pointer; text-decoration: none; }
.mon-hero-console-link:hover { color: var(--molten); }

@keyframes monPulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

/* ── Analysis page (dashing card, sibling of the live monitor hero) ── */
#analysisPage {
  display: none; position: fixed; inset: 0;
  background: var(--bg); z-index: 60;
  opacity: 0; transition: opacity 0.4s ease;
  overflow-y: auto;
}
#analysisPage.active { display: block; opacity: 1; }
.an-hero-status.active { color: var(--molten); }
.an-hero-status.active::before {
  background: var(--molten); box-shadow: 0 0 14px var(--molten);
  animation: monPulse 1.6s ease-out infinite;
}
.an-hero-status.done { color: var(--jade); }
.an-hero-status.done::before { background: var(--jade); }
.an-hero-status.error { color: var(--signal); }
.an-hero-status.error::before { background: var(--signal); }

/* ── Analysis cards (structured Claude output) ─────────────────────────────
   The Claude prompt returns three numbered markdown sections; each becomes
   its own bordered card with a number rail, icon, eyebrow, and body. Adds
   a leading serif pull-quote when Claude opens with a TL;DR paragraph. */

.an-body .an-pull {
  font-family: var(--body); font-weight: 400;
  font-size: 15px; line-height: 1.65; color: var(--ink-mute);
  padding: 0 0 0 14px;
  border-left: 1px solid rgba(var(--base-rgb), 0.14);
  margin: 4px 0 24px;
}

/* Bullets: minimal hyphen marker, no glow. */
.an-bullet {
  display: grid; grid-template-columns: 14px 1fr; gap: 6px;
  align-items: baseline; margin: 4px 0;
}

/* Inline metric: tabular numbers, no pill background. */
.an-metric {
  display: inline; padding: 0;
  background: transparent; border: none;
  font-family: var(--mono); font-size: 12.5px;
  color: var(--ink);
  white-space: nowrap;
  margin: 0;
}

/* Defect highlight: subtle underline, no pill. */
.an-chip {
  display: inline; padding: 0;
  font-family: inherit; font-size: inherit; letter-spacing: 0;
  border-radius: 0; white-space: normal;
  border: none; margin: 0;
  vertical-align: baseline;
}
#gatingLoader.is-open { display: flex; pointer-events: auto; }
.gl-step.is-active { color: var(--molten-glow); }
.gl-step.is-active .gl-step-dot {
  background: var(--molten);
  box-shadow: 0 0 10px rgba(255,104,64,0.8);
}
.gl-step.is-done { color: rgba(245,241,234,0.78); }
.gl-step.is-done .gl-step-dot { background: var(--molten-glow); }

@keyframes glFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes glRise { to { opacity: 1; transform: translateY(0); } }
@keyframes glPulse {
  0%, 100% { transform: scale(1); opacity: 0.95; }
  50%      { transform: scale(1.08); opacity: 1; }
}
@keyframes glOrbWobble {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.04); }
}
@keyframes glRingExpand {
  0%   { transform: scale(0.55); opacity: 0; border-width: 2px; }
  20%  { opacity: 0.8; }
  100% { transform: scale(1.6); opacity: 0; border-width: 1px; }
}
@keyframes glSpark {
  0%, 100% { opacity: 0; transform: translate(0,0) scale(0.6); }
  20%      { opacity: 1; }
  50%      { opacity: 0.9; transform: translate(0,-6px) scale(1); }
  80%      { opacity: 0; transform: translate(0,-14px) scale(0.4); }
}
@keyframes glShimmer {
  0%   { left: -40%; }
  100% { left: 100%; }
}

/* Error state — quench the molten orb to a cool grey, swap palette to signal red. */
#gatingLoader.is-error .gl-orb-core {
  background: radial-gradient(circle at 35% 30%, #ffb4a0 0%, #d35442 30%, #7a1d10 100%);
  animation: none;
}
#gatingLoader.is-error .gl-orb-glow,
#gatingLoader.is-error .gl-orb-ring,
#gatingLoader.is-error .gl-spark,
#gatingLoader.is-error .gl-bar-fill { animation: none; opacity: 0.25; }
#gatingLoader.is-error .gl-eyebrow { color: #ff8a6a; }
#gatingLoader.is-error .gl-title   { color: #ffd0c2; }


/* ══════════════════════════════════════════════════════════════════════
   Report (05) — ported from the Ayrton demo's report screen.
   The demo's palette is redeclared here scoped to .report so the report
   keeps its printed-document look without leaking into the rest of the app.
   ══════════════════════════════════════════════════════════════════════ */
.report {
  --paper:   #f0ece3;
  --paper-2: #e9e4d9;
  --ink:     #120e0d;
  --ink-2:   #1d2127;
  --muted:   #5a616b;
  --rule:    #d8d3c8;
  --accent:  #ff6a2c;
  --pass:    #1a7a3e;
  --pass-bg: #e4f2e8;
  --warn:    #b8551a;
  --warn-bg: #fbeadf;
  --bar:     62px;
  --r-mono:  var(--mono);
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
}
#reportPage {
  display: none; position: fixed; inset: 0; z-index: 100;
  overflow-y: auto; opacity: 0; transition: opacity 0.5s ease;
  background: #f0ece3;
}
/* Clear the fixed 52px sidenav rail so the report's own margins hold. */
body.sim-mode #reportPage { left: 52px; }
#reportPage.active { display: block; opacity: 1; }
/* ── report ─────────────────────────────────────────────────────────── */
.report { padding-bottom: 40px; }

.r-section { max-width: 1240px; margin: 0 auto; padding: 78px 32px; border-bottom: 1px solid var(--rule); }
.r-head { display: flex; justify-content: space-between; align-items: baseline; gap: 24px; }
.r-head .kicker + .kicker { color: var(--accent); }
.r-title { margin-top: 18px; font-size: clamp(30px, 3.6vw, 44px); font-weight: 700; letter-spacing: -0.02em; }

/* cover */
.r-cover {
  position: relative;
  min-height: calc(100vh - var(--bar));
  display: grid;
  align-content: center;
  max-width: none;
  padding: 80px 6vw;
  border-bottom: 1px solid var(--rule);
  overflow: hidden;
}
.r-cover-img {
  /* The deck's cover art is already a faint ghost of the part — keep it as is. */
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
}
.r-cover-body { position: relative; max-width: 640px; }
.r-cover h1 {
  margin-top: 20px;
  font-size: clamp(46px, 7vw, 92px);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 0.94;
}
.r-cover p.sub { margin-top: 22px; max-width: 34ch; font-size: 17px; line-height: 1.55; color: var(--muted); }
.r-headline { position: relative; margin-top: 52px; display: flex; flex-wrap: wrap; gap: 56px; }
.r-headline div span {
  display: block;
  font-family: var(--r-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  color: var(--muted);
}
.r-headline div strong { display: block; margin-top: 8px; font-size: 26px; font-weight: 700; }

/* verdict */
.r-verdict {
  margin-top: 34px;
  display: inline-flex;
  align-items: center;
  gap: 26px;
  padding: 16px 26px;
  border: 1px solid var(--ink-2);
  background: var(--rule);
  font-family: var(--r-mono);
  font-size: 14px;
  letter-spacing: 0.08em;
}
.r-verdict b { font-weight: 500; }
.r-verdict span { color: var(--muted); }

.r-tiles {
  margin-top: 30px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
}
.r-tile { padding: 20px 22px; border: 1px solid var(--ink-2); }
.r-tile[data-state="monitor"] { border-color: var(--accent); }
.r-tile span {
  font-family: var(--r-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  color: var(--muted);
}
.r-tile strong { display: block; margin-top: 10px; font-size: 21px; font-weight: 700; }
.r-tile[data-state="monitor"] strong { color: var(--accent); }

.r-panels { margin-top: 22px; display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 22px; }
.r-panel { padding: 28px 30px; border: 1px solid var(--ink-2); background: var(--rule); }
.r-panel span { font-family: var(--r-mono); font-size: 10px; letter-spacing: 0.16em; color: var(--muted); }
.r-panel p { margin-top: 14px; font-size: 16px; line-height: 1.6; }

/* inputs */
.r-inputs { margin-top: 34px; display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 46px; }
.r-inputs table { width: 100%; border-collapse: collapse; }
.r-inputs th {
  padding: 0 0 14px;
  text-align: left;
  font-size: 20px;
  font-weight: 700;
  border-bottom: 1px solid var(--ink-2);
}
.r-inputs th .card-key { display: inline-grid; margin-right: 10px; vertical-align: middle; }
.r-inputs td {
  padding: 12px 0;
  border-bottom: 1px solid var(--rule);
  font-family: var(--r-mono);
  font-size: 12.5px;
}
.r-inputs td:first-child { color: var(--muted); }
.r-inputs td:last-child { text-align: right; }

/* phase divider */
.r-phase {
  position: relative;
  max-width: none;
  padding: 130px 6vw;
  background: var(--ink);
  color: var(--paper);
  overflow: hidden;
  border: none;
}
.r-phase-glow {
  /* The glow art is a black plate with an orange bloom — screen it onto the ink. */
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  mix-blend-mode: screen;
  pointer-events: none;
}
.r-phase .kicker { color: var(--accent); position: relative; }
.r-phase h2 {
  position: relative;
  margin-top: 16px;
  font-size: clamp(44px, 6vw, 78px);
  font-weight: 700;
  letter-spacing: -0.03em;
}
.r-phase p { position: relative; margin-top: 22px; max-width: 46ch; font-size: 17px; line-height: 1.6; color: rgba(240,236,227,0.66); }

/* checks */
.r-check {
  max-width: 1400px;
  margin: 0 auto;
  padding: 70px 32px;
  border-bottom: 1px solid var(--rule);
  display: grid;
  grid-template-columns: minmax(300px, 400px) 1fr;
  gap: 56px;
  align-items: start;
}
.r-check-meta { display: flex; gap: 22px; }
.r-check-meta .grp { font-family: var(--r-mono); font-size: 12px; letter-spacing: 0.16em; color: var(--muted); }
.r-check-meta .chk { font-family: var(--r-mono); font-size: 12px; letter-spacing: 0.16em; color: var(--accent); font-weight: 500; }
.r-check h3 { margin-top: 16px; font-size: 30px; font-weight: 700; letter-spacing: -0.015em; }

.badge {
  display: inline-block;
  margin-top: 20px;
  padding: 7px 15px;
  border: 1px solid var(--pass);
  background: var(--pass-bg);
  color: var(--pass);
  font-family: var(--r-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
}
.badge[data-state="monitor"] { border-color: var(--accent); background: var(--warn-bg); color: var(--warn); }

.r-check .hr { margin: 26px 0; height: 1px; background: var(--rule); }
.r-label { font-family: var(--r-mono); font-size: 11px; letter-spacing: 0.16em; color: var(--muted); }
.r-headlinetxt { margin-top: 10px; font-size: 22px; font-weight: 700; letter-spacing: -0.01em; }
.r-body { margin-top: 18px; font-size: 15.5px; line-height: 1.65; color: var(--muted); }

.r-big { margin-top: 10px; display: flex; align-items: baseline; gap: 10px; }
.r-big b { font-size: 66px; font-weight: 700; letter-spacing: -0.04em; line-height: 1; }
.r-big i { font-style: normal; font-size: 20px; color: var(--muted); }
.r-limit { margin-top: 14px; display: flex; justify-content: space-between; gap: 20px; max-width: 340px; font-family: var(--r-mono); font-size: 11px; letter-spacing: 0.08em; color: var(--muted); }
.r-limit b { font-weight: 500; color: var(--ink); }

.r-metric { margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--rule); }
.r-metric-top { display: flex; justify-content: space-between; gap: 20px; max-width: 340px; }
.r-metric-top .st { font-family: var(--r-mono); font-size: 11px; letter-spacing: 0.14em; color: var(--pass); }
.r-metric-top .st[data-state="monitor"] { color: var(--warn); }
.r-metric b { display: block; margin-top: 8px; font-size: 30px; font-weight: 700; letter-spacing: -0.02em; }
.r-note { margin-top: 14px; font-family: var(--r-mono); font-size: 11px; line-height: 1.65; color: var(--muted); }

.r-pairs { margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--rule); display: grid; gap: 16px; }
.r-pairs div span { display: block; font-family: var(--r-mono); font-size: 10px; letter-spacing: 0.16em; color: var(--muted); }
.r-pairs div b { display: block; margin-top: 6px; font-size: 15px; font-weight: 700; }

/* media */
.r-media { position: relative; background: var(--paper-2); border: 1px solid var(--ink-2); overflow: hidden; }
.r-media video, .r-media img { display: block; width: 100%; height: auto; }
.r-media-tag {
  position: absolute;
  top: 14px;
  left: 14px;
  padding: 5px 10px;
  background: rgba(18,14,13,0.72);
  color: rgba(240,236,227,0.9);
  font-family: var(--r-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  pointer-events: none;
}

/* findings */
.r-table { margin-top: 34px; width: 100%; border-collapse: collapse; }
.r-table th {
  padding: 0 14px 12px 0;
  text-align: left;
  border-bottom: 1px solid var(--ink-2);
  font-family: var(--r-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.16em;
  color: var(--muted);
}
.r-table td { padding: 16px 14px 16px 0; border-bottom: 1px solid var(--rule); font-size: 15px; vertical-align: top; }
.r-table td.n, .r-table td.v { font-family: var(--r-mono); font-size: 12px; letter-spacing: 0.08em; white-space: nowrap; }
.r-table td.n { color: var(--muted); }
.r-table td.v { color: var(--pass); }
.r-table td.v[data-state="monitor"] { color: var(--warn); }
.r-table td.c { font-weight: 700; }
.r-table td.rm { color: var(--muted); }

.r-tablenote {
  margin-top: 26px;
  padding: 18px 20px;
  border-left: 2px solid var(--accent);
  background: rgba(255,106,44,0.06);
  font-family: var(--r-mono);
  font-size: 11.5px;
  line-height: 1.7;
  color: var(--muted);
}

/* closing */
.r-close { max-width: none; padding: 120px 6vw; background: var(--ink); color: var(--paper); border: none; }
.r-close h2 { font-size: clamp(38px, 5vw, 64px); font-weight: 700; letter-spacing: -0.03em; }
.r-close p { margin-top: 20px; max-width: 44ch; font-size: 17px; line-height: 1.6; color: rgba(240,236,227,0.62); }
.r-close-meta { margin-top: 60px; display: flex; flex-wrap: wrap; gap: 56px; }
.r-close-meta div span { display: block; font-family: var(--r-mono); font-size: 10px; letter-spacing: 0.18em; color: rgba(240,236,227,0.45); }
.r-close-meta div b { display: block; margin-top: 8px; font-family: var(--r-mono); font-size: 14px; font-weight: 400; }

.r-actions { max-width: 1240px; margin: 0 auto; padding: 34px 32px 60px; display: flex; gap: 12px; }

/* Shared atoms the report markup relies on */
.report .kicker {
  font-family: var(--r-mono); font-size: 12px; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--muted);
}
.report .card-key {
  width: 24px; height: 24px; display: grid; place-items: center;
  background: var(--ink-2); color: var(--paper);
  font-family: var(--r-mono); font-size: 12px;
}

@media (max-width: 720px) {
  .r-section, .r-check { padding-left: 20px; padding-right: 20px; }
}


/* ── Solver diagnostics panel (foam-monitor.js) ─────────────────────────── */
.mon-diag {
  margin: 28px auto 40px;
  max-width: 1180px;
  padding: 0 clamp(16px, 4vw, 48px);
}
.mon-diag-head {
  display: flex; align-items: center; gap: 12px;
  padding-bottom: 10px; border-bottom: 1px solid var(--line);
}
.mon-diag-title {
  font-family: var(--mono); font-size: 11px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--ink-mute);
}
/* class names are set by foam-monitor.js _setStatus(): mon-status-dot + state */
.mon-status-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--ink-trace); transition: background .25s ease; flex: none;
}
.mon-status-dot.active  { background: var(--molten); box-shadow: 0 0 8px var(--molten-glow); }
.mon-status-dot.waiting { background: var(--orange); }
.mon-status-dot.error   { background: var(--orange); opacity: .55; }
.mon-diag-status {
  font-family: var(--mono); font-size: 11px; color: var(--ink-mute);
}
.mon-diag-select, .mon-diag-btn {
  font-family: var(--mono); font-size: 11px; color: var(--ink-soft);
  background: transparent; border: 1px solid var(--line);
  border-radius: 3px; padding: 4px 8px;
}
.mon-diag-btn { cursor: pointer; margin-left: auto; }
.mon-diag-btn:hover { border-color: var(--line-hi); color: var(--ink); }
.mon-diag-charts { display: grid; gap: 14px; margin-top: 16px; }
.mon-diag-chart { min-height: 220px; width: 100%; }
@media (min-width: 900px) {
  .mon-diag-charts { grid-template-columns: 1fr 1fr; }
  .mon-diag-chart:first-child { grid-column: 1 / -1; }
}

/* Signed in but no credits yet: says why Run will refuse. */
.account-notice {
  position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%);
  z-index: 50; max-width: calc(100vw - 32px);
  padding: 10px 16px; border-radius: var(--radius-sm);
  background: var(--ink-soft); color: var(--paper);
  font-size: 12px; letter-spacing: .02em; box-shadow: 0 6px 24px rgba(0,0,0,.25);
}
#authPage .auth-submit { display: flex; align-items: center; justify-content: center; text-decoration: none; }
#authPage a.auth-toggle-btn { text-decoration: none; }

/* ═════════════════════ Info pages: Credits and Preparing your model ═════ */
.info-page {
  display: none; position: fixed; inset: 0;
  /* Above the sidenav (300), below the sign-in gate (400): these open as
     overlays over whatever page is showing, so Back returns there. */
  background: var(--bg); z-index: 350;
  opacity: 0; transition: opacity 0.4s ease; overflow-y: auto;
}
.info-page.active { display: block; opacity: 1; }
.info-inner {
  position: relative; z-index: 1;
  max-width: 1080px; margin: 0 auto;
  padding: 92px 60px 96px;
}
.info-back { margin-bottom: 10px; }
.info-h2 {
  font-family: var(--display); font-size: 24px; font-weight: 700;
  letter-spacing: -0.02em; color: var(--ink); margin: 0 0 14px; text-wrap: balance;
}
.info-block { margin-top: 48px; }
.info-cols { display: grid; grid-template-columns: 1.4fr 1fr; gap: 48px; }
.info-list { margin: 0; padding-left: 20px; color: var(--ink-soft); line-height: 1.6; }
.info-list li { margin: 8px 0; max-width: 62ch; }
.info-list b, .guide-lede b, .req b, .guide-p b { color: var(--ink); font-weight: 600; }

/* credits */
.acct-summary {
  display: grid; grid-template-columns: auto 1fr; gap: 48px; align-items: center;
  margin-top: 36px; padding: 32px 36px; border-radius: 20px;
  background: rgba(var(--base-rgb), 0.04); border: 1px solid rgba(var(--base-rgb), 0.08);
  box-shadow: var(--shadow-card);
}
.acct-balance { display: flex; flex-direction: column; gap: 4px; }
.acct-num { font-size: 96px; line-height: 0.9; letter-spacing: -0.05em; color: var(--ink); }
.acct-num-label { color: var(--ink-mute); }
.acct-badge {
  display: inline-block; font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em;
  text-transform: uppercase; padding: 4px 10px; border-radius: 999px; border: 1px solid currentColor;
}
.acct-badge.ok { color: var(--jade); }
.acct-badge.pending { color: var(--molten); }
.acct-status-text { margin: 12px 0 0; color: var(--ink-soft); max-width: 52ch; line-height: 1.55; }
.acct-contact { margin: 8px 0 0; color: var(--ink-mute); font-size: 14px; }
.acct-contact a { color: var(--molten-glow); }
.acct-facts { display: grid; grid-template-columns: auto 1fr; gap: 10px 20px; margin: 0; }
.acct-facts dt { color: var(--ink-faint); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; padding-top: 3px; }
.acct-facts dd { margin: 0; color: var(--ink); overflow-wrap: anywhere; }
.acct-table-wrap { overflow-x: auto; }
.acct-table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 480px; }
.acct-table th {
  text-align: left; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ink-faint); font-weight: 500; padding: 10px 12px;
  border-bottom: 1px solid rgba(var(--base-rgb), 0.12);
}
.acct-table td { padding: 12px; border-bottom: 1px solid rgba(var(--base-rgb), 0.08); color: var(--ink-soft); vertical-align: top; }
.acct-table .num { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
.acct-table .plus { color: var(--jade); }
.acct-table .minus { color: var(--ink); }
.acct-table .what b { color: var(--ink); font-weight: 600; }
.acct-table .what span { display: block; color: var(--ink-faint); font-size: 12px; }
.acct-empty { color: var(--ink-faint); text-align: center; padding: 28px 12px !important; }

/* dashboard entry points */
.dash-credits { font-variant-numeric: tabular-nums; }
.dash-credits.empty { border-color: var(--molten); color: var(--molten); }
.dash-guide-link {
  display: inline-block; margin-top: 18px; background: none; border: 0; padding: 0; cursor: pointer;
  font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-mute);
}
.dash-guide-link:hover { color: var(--molten-glow); }
.account-notice { cursor: pointer; }

/* guide */
.guide-accent { color: var(--molten-glow); font-weight: 400; }
.guide-lede { margin: 24px 0 0; font-size: 18px; line-height: 1.6; color: var(--ink-soft); max-width: 64ch; }
.guide-p { color: var(--ink-soft); line-height: 1.6; max-width: 66ch; margin: 0; }
.guide-p code, .req code { font-family: var(--mono); font-size: 0.86em; }
.guide-std {
  display: grid; grid-template-columns: 1.6fr 1fr; gap: 36px; align-items: center;
  margin-top: 40px; padding: 28px; border-radius: 20px;
  background: rgba(var(--base-rgb), 0.04); border: 1px solid rgba(var(--base-rgb), 0.08);
}
.guide-figure { margin: 0; min-width: 0; }
.guide-figure figcaption { margin-top: 10px; font-size: 11px; letter-spacing: 0.06em; color: var(--ink-faint); text-transform: uppercase; }
.std-svg { width: 100%; height: auto; display: block; overflow: visible; }
.std-svg rect { stroke-width: 1; }
.std-gating rect { fill: rgba(var(--base-rgb), 0.10); stroke: var(--ink-mute); }
.std-casting rect { fill: rgba(var(--base-rgb), 0.22); stroke: var(--ink); }
.std-riser { fill: rgba(var(--base-rgb), 0.16); stroke: var(--ink-mute); stroke-dasharray: 3 2; }
.std-inlet { stroke: var(--molten); stroke-width: 4; stroke-linecap: round; }
.std-ground { stroke: rgba(var(--base-rgb), 0.18); stroke-width: 0.8; stroke-dasharray: 2 3; }
.std-labels path { stroke: var(--ink-faint); stroke-width: 0.6; fill: none; }
.std-labels text { font-family: var(--mono); font-size: 10.5px; fill: var(--ink-soft); }
.std-labels .std-sub { font-size: 8px; fill: var(--ink-faint); }
.std-labels .std-hot { fill: var(--molten-glow); }
.guide-download p { color: var(--ink-soft); line-height: 1.55; margin: 0 0 20px; }
.guide-dl-btn { display: inline-flex; text-decoration: none; padding: 13px 20px; }
.guide-h2 { margin-top: 56px; }
.guide-reqs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.req {
  padding: 22px; border-radius: 16px;
  background: rgba(var(--base-rgb), 0.03); border: 1px solid rgba(var(--base-rgb), 0.08);
}
.req h3 { font-family: var(--display); font-size: 19px; font-weight: 700; letter-spacing: -0.01em; color: var(--ink); margin: 0 0 8px; }
.req p { margin: 0; color: var(--ink-soft); font-size: 14.5px; line-height: 1.55; }
.guide-table td:first-child { color: var(--ink); width: 42%; }
.guide-steps li { padding-left: 4px; }

/* upload page: requirements beside the drop zone */
.upload-reqs {
  position: fixed; right: 44px; top: 50%; transform: translateY(-50%); z-index: 5;
  width: 300px; padding: 20px 22px; border-radius: 16px;
  background: rgba(var(--base-rgb), 0.04); border: 1px solid rgba(var(--base-rgb), 0.10);
  box-shadow: var(--shadow-card); font-size: 13.5px; color: var(--ink-soft);
  opacity: 0; animation: fadeIn 0.5s 0.3s ease forwards;
}
.dark .upload-reqs { backdrop-filter: blur(20px); }
.upload-reqs-kicker { margin: 0 0 10px; font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-faint); }
.upload-reqs ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
.upload-reqs li { line-height: 1.4; padding-left: 14px; position: relative; }
.upload-reqs li::before { content: ""; position: absolute; left: 0; top: 7px; width: 5px; height: 5px; border-radius: 1px; background: var(--molten); }
.upload-reqs b { color: var(--ink); font-weight: 600; }
.upload-reqs-links { display: flex; justify-content: space-between; gap: 12px; margin-top: 16px; padding-top: 14px; border-top: 1px solid rgba(var(--base-rgb), 0.10); }
.upload-reqs-links a, .upload-reqs-links button {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.05em; text-transform: uppercase;
  color: var(--molten-glow); background: none; border: 0; padding: 0; cursor: pointer; text-decoration: none;
  white-space: nowrap;
}
.upload-reqs-links a:hover, .upload-reqs-links button:hover { text-decoration: underline; }
#uploadPage.hidden .upload-reqs { display: none; }

@media (max-width: 1180px) {
  .upload-reqs { position: static; transform: none; width: auto; max-width: 420px; margin: -18vh auto 40px; }
}
/* Phones: clear the 52px step sidebar on the left. */
@media (max-width: 600px) {
  body.sim-mode .upload-reqs { margin: -18vh 16px 40px 68px; }
}
@media (max-width: 900px) {
  .info-inner { padding: 84px 20px 72px; }
  .info-cols, .acct-summary, .guide-std { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .guide-reqs { grid-template-columns: minmax(0, 1fr); }
  .acct-summary { padding: 24px; }
  .acct-num { font-size: 72px; }
}
@media (min-width: 901px) and (max-width: 1100px) {
  .guide-reqs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
