/* ============================================================ */
/* Finality Group — Institutional Design System v5.0            */
/* Premium black / gold / ivory brand system                    */
/* ============================================================ */

/* Design tokens */
:root {
  /* Backgrounds */
  --bg-ivory:       #f4f0e5;
  --bg-ivory-soft:  #faf7f0;
  --bg-dark:        #0d0b08;
  --bg-dark-2:      #131008;
  --bg-dark-panel:  #1a1610;
  --bg-dark-raised: #211d15;

  /* Text */
  --text-dark:      #1a1610;
  --text-muted-dk:  #7a6f60;
  --text-faint-dk:  #a8997e;
  --text-ivory:     #f0ead8;
  --text-ivory-dim: #c8bfa4;
  --text-muted-lt:  #9a9080;

  /* Gold accent system */
  --gold:           #c9973a;
  --gold-soft:      #d4a843;
  --gold-bright:    #e0b84a;
  --gold-deep:      #a07828;
  --gold-dim:       rgba(201, 151, 58, 0.22);
  --gold-border:    rgba(201, 151, 58, 0.45);
  --gold-border-strong: rgba(201, 151, 58, 0.75);

  /* Status / functional colors */
  --green:   #4caf7d;
  --red:     #c05050;
  --orange:  #d08040;
  --cyan:    #5a9fc8;
  --blue:    #6080b0;
  --magenta: #a06080;

  /* Borders */
  --line-ivory:   rgba(120, 100, 70, 0.18);
  --line-ivory-s: rgba(120, 100, 70, 0.32);
  --line-dark:    rgba(201, 151, 58, 0.18);
  --line-dark-s:  rgba(201, 151, 58, 0.30);

  /* Shadows */
  --shadow-sm:      0 2px 12px rgba(0,0,0,0.10);
  --shadow:         0 8px 32px rgba(0,0,0,0.14);
  --shadow-dark-sm: 0 4px 20px rgba(0,0,0,0.40);
  --shadow-dark:    0 16px 60px rgba(0,0,0,0.50);
  --shadow-gold:    0 0 0 1px var(--gold-border), 0 8px 32px rgba(0,0,0,0.20);

  /* Radii */
  --radius:    6px;
  --radius-sm: 4px;
  --radius-lg: 10px;
  --radius-xl: 16px;

  /* Layout */
  --container: 1480px;

  /* Typography */
  --serif: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --sans:  'Inter', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ──────────────────────────── Reset ──────────────────────────── */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; overflow-x: clip; }
body { margin: 0; min-width: 320px; font-family: var(--sans); font-size: 16px; line-height: 1.6; overflow-x: clip; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { color: inherit; }
img, svg { max-width: 100%; }
code, pre { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
::selection { background: rgba(201, 151, 58, .28); color: inherit; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
[hidden] { display: none !important; }
.sr-only { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0,0,0,0) !important; white-space: nowrap !important; border: 0 !important; }

/* ──────────────────────────── Shell variants ──────────────────────────── */
.public-shell {
  color: var(--text-dark);
  background: var(--bg-ivory);
}
.private-shell {
  color: var(--text-ivory);
  background: var(--bg-dark);
}

/* Skip link */
.skip-link { position: fixed; left: 1rem; top: 1rem; z-index: 2000; transform: translateY(-200%); background: var(--gold); color: #0d0b08; padding: .75rem 1rem; border-radius: var(--radius); font-weight: 800; }
.skip-link:focus { transform: none; }

/* ──────────────────────────── Constitutional bar ──────────────────────────── */
.constitutional-bar {
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .38rem 1rem;
  background: #0a0805;
  border-bottom: 1px solid rgba(201,151,58,.25);
  color: var(--text-ivory-dim);
  font-size: .72rem;
  letter-spacing: .015em;
  text-align: center;
}
.constitutional-bar strong { color: var(--gold-soft); }
.constitutional-bar a { margin-left: .6rem; color: var(--gold); font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: #4caf7d; box-shadow: 0 0 10px rgba(76,175,125,.7); flex: none; }

/* ──────────────────────────── Header ──────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #0a0805;
  border-bottom: 1px solid rgba(201,151,58,.25);
  backdrop-filter: blur(12px);
}
.header-inner {
  max-width: var(--container);
  min-height: 76px;
  padding: 0 2.5rem;
  margin: auto;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 2rem;
}
.brand { display: inline-flex; align-items: center; gap: .72rem; color: var(--gold); min-width: max-content; }
.brand:hover { color: var(--gold-bright); }
.brand-mark { width: 32px; height: 38px; flex: none; }
.brand > span { display: grid; line-height: 1; }
.brand strong { font-family: var(--sans); letter-spacing: .2em; font-size: .9rem; color: var(--text-ivory); }
.brand small { margin-top: .3rem; color: var(--gold); letter-spacing: .5em; font-size: .42rem; }
.primary-nav { justify-self: center; display: flex; align-items: center; gap: 2rem; }
.primary-nav a { position: relative; color: var(--text-ivory-dim); font-size: .8rem; font-weight: 600; letter-spacing: .04em; padding: 1.6rem 0; transition: color .15s ease; }
.primary-nav a::after { content: ''; position: absolute; left: 0; right: 100%; bottom: 1.1rem; height: 1px; background: var(--gold); transition: right .2s ease; }
.primary-nav a:hover { color: var(--text-ivory); }
.primary-nav a:hover::after, .primary-nav a[aria-current='page']::after { right: 0; }
.primary-nav a[aria-current='page'] { color: var(--gold-soft); }
.header-actions { display: flex; align-items: center; gap: .5rem; }
.inline-form { display: inline; }
.nav-toggle { display: none; border: 1px solid var(--line-dark); background: var(--bg-dark-panel); width: 44px; height: 44px; border-radius: var(--radius); padding: 10px; cursor: pointer; }
.nav-toggle span:not(.sr-only) { display: block; height: 1px; background: var(--text-ivory-dim); margin: 5px 0; }

/* Console sub-nav */
.console-nav { border-top: 1px solid rgba(201,151,58,.15); background: #0a0805; }
.console-nav-inner { max-width: var(--container); margin: auto; padding: .2rem 2.5rem; display: flex; flex-wrap: wrap; gap: 0 .15rem; min-width: 0; }
.console-nav a { padding: .55rem .7rem; color: var(--text-ivory-dim); font-size: .68rem; font-weight: 700; letter-spacing: .04em; white-space: nowrap; border-bottom: 2px solid transparent; transition: color .15s, border-color .15s; }
.console-nav a:hover, .console-nav a[aria-current='page'] { color: var(--gold-soft); border-color: var(--gold); }

/* ──────────────────────────── Buttons ──────────────────────────── */
.button {
  appearance: none;
  border: 1px solid transparent;
  border-radius: var(--radius);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  min-height: 42px;
  padding: .65rem 1.25rem;
  font-weight: 700;
  font-size: .78rem;
  letter-spacing: .06em;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease, border-color .15s ease, color .15s ease;
  white-space: nowrap;
}
.button:hover { transform: translateY(-1px); }
.button:disabled { opacity: .5; cursor: not-allowed; transform: none; }

/* Primary: dark fill + gold border */
.button-gold {
  color: var(--text-ivory);
  background: var(--bg-dark);
  border-color: var(--gold-border-strong);
  box-shadow: inset 0 0 0 0 transparent;
}
.button-gold:hover {
  color: var(--gold-bright);
  border-color: var(--gold);
  background: var(--bg-dark-2);
  box-shadow: var(--shadow-dark-sm);
}

/* Secondary: ivory fill + dark border */
.button-ghost {
  color: var(--text-dark);
  background: var(--bg-ivory-soft);
  border-color: rgba(26,22,16,.35);
}
.button-ghost:hover {
  background: #fff;
  border-color: var(--gold-border);
  color: var(--text-dark);
}

/* On dark surfaces — ghost becomes outline */
.private-shell .button-ghost,
.site-header .button-ghost {
  color: var(--text-ivory-dim);
  background: transparent;
  border-color: var(--line-dark-s);
}
.private-shell .button-ghost:hover,
.site-header .button-ghost:hover {
  color: var(--text-ivory);
  border-color: var(--gold-border);
  background: rgba(201,151,58,.06);
}

.button-quiet {
  color: var(--text-muted-dk);
  background: transparent;
  border-color: var(--line-ivory);
}
.button-quiet:hover { color: var(--text-dark); border-color: var(--line-ivory-s); }

.private-shell .button-quiet {
  color: var(--text-ivory-dim);
  border-color: var(--line-dark);
}
.private-shell .button-quiet:hover { color: var(--text-ivory); border-color: var(--line-dark-s); }

.button-warning { color: #241507; background: var(--orange); border-color: rgba(255,195,109,.55); }
.button-small { min-height: 34px; padding: .42rem .85rem; font-size: .7rem; border-radius: var(--radius-sm); }
.button-full { width: 100%; }
.icon-button { width: 40px; height: 40px; display: inline-grid; place-items: center; border: 1px solid var(--line-dark); border-radius: var(--radius); background: transparent; cursor: pointer; font-size: 1.15rem; color: var(--text-ivory-dim); transition: border-color .15s, color .15s; }
.icon-button:hover { border-color: var(--gold-border); color: var(--gold); }
.text-link { display: inline-block; margin-top: 1rem; color: var(--gold); font-size: .82rem; font-weight: 700; }
.back-link { color: var(--text-muted-dk); font-size: .8rem; font-weight: 700; }

/* "Buyer Evaluation" header CTA pill */
.button-eval {
  color: var(--gold);
  background: transparent;
  border: 1px solid var(--gold-border-strong);
  letter-spacing: .08em;
  font-size: .72rem;
  font-weight: 700;
  padding: .5rem 1rem;
  border-radius: var(--radius-sm);
  transition: background .15s, color .15s;
}
.button-eval:hover { background: rgba(201,151,58,.12); color: var(--gold-bright); }
.button-eval::after { content: ' ↗'; font-size: .7em; }

/* ──────────────────────────── Layout primitives ──────────────────────────── */
main { min-height: 60vh; }
.section, .section-narrow, .console-page { width: min(var(--container), calc(100% - 5rem)); margin-inline: auto; }
.section { padding-block: 6rem; }
.section-narrow { padding-block: 2rem; }

/* Typography */
h1, h2, h3, p { overflow-wrap: anywhere; }
h1, h2 { font-family: var(--serif); font-weight: 700; line-height: 1.06; letter-spacing: -.02em; }
h1 { margin: 0; font-size: clamp(3rem, 6vw, 6.4rem); }
h2 { margin: 0; font-size: clamp(2rem, 3.5vw, 3.5rem); }
h3 { margin: 0; line-height: 1.25; font-size: 1rem; }
h1 em, h2 em { color: var(--gold); font-style: italic; }

.public-shell h1, .public-shell h2 { color: var(--text-dark); }
.public-shell h3 { color: var(--text-dark); }
.private-shell h1, .private-shell h2 { color: var(--text-ivory); }
.private-shell h3 { color: var(--text-ivory); }

.eyebrow {
  margin: 0 0 1rem;
  color: var(--gold);
  font-family: var(--sans);
  font-size: .64rem;
  font-weight: 800;
  letter-spacing: .22em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: .75rem;
}
.eyebrow::before { content: ''; display: inline-block; width: 28px; height: 1px; background: var(--gold); flex: none; }
.lead { max-width: 680px; font-size: clamp(.95rem, 1.3vw, 1.18rem); line-height: 1.7; }
.public-shell .lead { color: var(--text-muted-dk); }
.private-shell .lead { color: var(--text-ivory-dim); }

/* ──────────────────────────── Hero section ──────────────────────────── */
.page-hero {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--line-ivory);
}
.public-shell .page-hero { background: var(--bg-ivory); }
.private-shell .page-hero { background: var(--bg-dark); border-bottom-color: var(--line-dark); }

/* Subtle decorative element — reference image radial glow on dark */
.page-hero::after {
  content: '';
  position: absolute;
  width: 600px;
  height: 600px;
  right: -200px;
  top: -200px;
  border: 1px solid var(--gold-dim);
  border-radius: 50%;
  pointer-events: none;
  opacity: .5;
}

.page-hero-inner {
  width: min(var(--container), calc(100% - 5rem));
  min-height: 640px;
  margin: auto;
  padding: 7rem 0;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(380px, .9fr);
  align-items: center;
  gap: 5rem;
  position: relative;
  z-index: 1;
}
.page-hero-compact .page-hero-inner { min-height: 400px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 2.5rem; }
.hero-aside { min-width: 0; }

/* ──────────────────────────── Orbit diagram ──────────────────────────── */
.orbit { position: relative; width: min(100%, 590px); aspect-ratio: 1; margin: auto; }
.orbit-ring { position: absolute; inset: 10%; border: 1px solid rgba(201,151,58,.2); border-radius: 50%; }
.orbit-ring.ring-two { inset: 24%; border-color: rgba(201,151,58,.32); }
.orbit-core {
  position: absolute; inset: 37%;
  display: grid; place-items: center; align-content: center;
  border: 1px solid var(--gold-border);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(201,151,58,.15), rgba(13,11,8,.96) 68%);
  box-shadow: 0 0 40px rgba(201,151,58,.1);
}
.orbit-core strong { color: var(--gold-soft); font-family: var(--serif); font-size: 1rem; letter-spacing: .1em; }
.orbit-core span { margin-top: .4rem; color: var(--text-ivory-dim); font-size: .5rem; letter-spacing: .12em; }
.orbit-node {
  position: absolute; min-width: 148px; padding: .75rem .95rem;
  display: grid;
  background: rgba(13,11,8,.95);
  border: 1px solid var(--line-dark-s);
  border-radius: var(--radius);
  box-shadow: var(--shadow-dark-sm);
}
.orbit-node strong { font-family: var(--serif); font-weight: 700; color: var(--text-ivory); font-size: .88rem; }
.orbit-node span { color: var(--text-ivory-dim); font-size: .62rem; margin-top: .2rem; }
.node-mz { left: 0; top: 12%; border-color: var(--gold-border); }
.node-fk { right: 0; top: 12%; border-color: var(--gold-border); }
.node-vf { right: 0; bottom: 16%; border-color: var(--gold-border); }
.node-ai { left: 0; bottom: 16%; border-color: rgba(201,151,58,.3); }
.node-cf { left: 50%; bottom: 0; transform: translateX(-50%); border-color: rgba(201,151,58,.3); }

/* ──────────────────────────── Metric rail ──────────────────────────── */
.metric-rail {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  border: 1px solid var(--gold-border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-top: -32px;
  position: relative;
  z-index: 3;
  box-shadow: var(--shadow);
}
.public-shell .metric-rail { background: var(--bg-ivory-soft); }
.private-shell .metric-rail { background: var(--bg-dark-panel); }
.metric-rail > div {
  min-height: 104px;
  display: grid;
  place-content: center;
  padding: 1.2rem;
  border-right: 1px solid var(--gold-border);
  text-align: center;
}
.metric-rail > div:last-child { border-right: 0; }
.metric-rail strong { color: var(--gold-soft); font-family: var(--serif); font-size: 1.9rem; font-weight: 700; }
.metric-rail span { color: var(--text-muted-lt); font-size: .58rem; letter-spacing: .12em; text-transform: uppercase; margin-top: .3rem; display: block; }

/* ──────────────────────────── Section layout helpers ──────────────────────────── */
.section-split { display: grid; grid-template-columns: 1fr 1fr; align-items: end; gap: 5rem; padding-bottom: 2rem; }
.section-lead { max-width: 600px; font-size: 1rem; line-height: 1.7; }
.public-shell .section-lead { color: var(--text-muted-dk); }
.private-shell .section-lead { color: var(--text-ivory-dim); }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 2rem; margin-bottom: 2rem; }
.section-head h2 { max-width: 860px; }

/* ──────────────────────────── Proof chain grid ──────────────────────────── */
.proof-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: .65rem; }
.proof-grid article {
  min-height: 195px; padding: 1.3rem;
  border-radius: var(--radius);
  position: relative;
  transition: border-color .2s;
}
.public-shell .proof-grid article {
  border: 1px solid var(--line-ivory-s);
  background: var(--bg-ivory-soft);
}
.public-shell .proof-grid article:hover { border-color: var(--gold-border); }
.private-shell .proof-grid article {
  border: 1px solid var(--line-dark);
  background: var(--bg-dark-panel);
}
.private-shell .proof-grid article:hover { border-color: var(--gold-border); }
.proof-grid article > span { position: absolute; right: 1rem; top: .8rem; color: var(--gold-dim); font-family: var(--serif); font-size: 1.1rem; opacity: .6; }
.proof-grid h3 { margin: 1.6rem 0 .5rem; color: var(--gold-soft); font-family: var(--serif); font-size: 1rem; font-weight: 700; }
.proof-grid p { margin: 0; font-size: .78rem; line-height: 1.6; }
.public-shell .proof-grid p { color: var(--text-muted-dk); }
.private-shell .proof-grid p { color: var(--text-ivory-dim); }

/* ──────────────────────────── System / company cards ──────────────────────────── */
.system-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .85rem; }
.system-grid-all { grid-template-columns: repeat(4, 1fr); }
.system-card {
  min-height: 310px;
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
  background: var(--bg-dark);
  border: 1px solid var(--line-dark);
  border-radius: var(--radius);
  position: relative;
  overflow: hidden;
  transition: border-color .2s ease, box-shadow .2s ease;
  color: var(--text-ivory);
}
.system-card::before { content: ''; position: absolute; inset: 0 auto auto 0; width: 100%; height: 2px; opacity: .65; }
.accent-gold::before { background: var(--gold); }
.accent-magenta::before { background: #a06080; }
.accent-cyan::before { background: #5a9fc8; }
.accent-blue::before { background: #6080b0; }
.accent-green::before { background: #4caf7d; }
.accent-slate::before { background: #7a8890; }
.system-card:hover { border-color: var(--gold-border); box-shadow: var(--shadow-gold); transform: translateY(-2px); }
.system-card-head { display: flex; justify-content: space-between; align-items: center; gap: .8rem; }
.system-code { width: 42px; height: 42px; border: 1px solid var(--gold-border); border-radius: 50%; display: grid; place-items: center; color: var(--gold-soft); font-family: var(--serif); font-weight: 700; font-size: .78rem; }
.system-code.large { width: 72px; height: 72px; font-size: 1.35rem; }
.layer-label { color: var(--text-muted-lt); font-size: .5rem; letter-spacing: .15em; text-transform: uppercase; text-align: right; }
.system-card h2 { margin-top: 1rem; font-size: 1.65rem; color: var(--text-ivory); }
.system-domain { margin: .1rem 0 .6rem; color: var(--gold); font-size: .76rem; font-weight: 600; }
.system-card > p:not(.system-domain) { color: var(--text-ivory-dim); font-size: .82rem; }
.system-card-foot { margin-top: auto; padding-top: 1rem; display: flex; align-items: end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.system-card-foot a { font-size: .74rem; font-weight: 700; color: var(--gold-soft); }
.maturity { display: inline-flex; align-items: center; gap: .32rem; color: var(--text-muted-lt); font-size: .56rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.maturity i { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 7px rgba(76,175,125,.7); flex: none; }
.maturity-e2 i { background: var(--cyan); box-shadow: 0 0 7px rgba(90,159,200,.7); }
.maturity-e3-plus { color: var(--gold-soft); }
.maturity-e3-plus i { background: var(--gold); box-shadow: 0 0 7px rgba(201,151,58,.7); }

/* ──────────────────────────── Architecture strip ──────────────────────────── */
.architecture-strip {
  display: grid;
  grid-template-columns: .85fr 1.15fr;
  align-items: center;
  gap: 4rem;
  border-top: 1px solid var(--line-ivory);
  border-bottom: 1px solid var(--line-ivory);
}
.private-shell .architecture-strip { border-color: var(--line-dark); }
.architecture-copy p:not(.eyebrow) { font-size: 1rem; line-height: 1.7; }
.public-shell .architecture-copy p:not(.eyebrow) { color: var(--text-muted-dk); }
.private-shell .architecture-copy p:not(.eyebrow) { color: var(--text-ivory-dim); }
.architecture-preview, .architecture-canvas {
  position: relative;
  padding: 1rem;
  border: 1px solid var(--gold-border);
  border-radius: var(--radius-lg);
  overflow: auto;
  background: var(--bg-dark);
}
.architecture-preview img, .architecture-canvas img { display: block; width: 100%; height: auto; }
.image-expand {
  position: absolute;
  right: 1.2rem;
  bottom: 1.2rem;
  border: 1px solid var(--line-dark-s);
  background: rgba(13,11,8,.9);
  color: var(--text-ivory-dim);
  border-radius: var(--radius-sm);
  padding: .55rem .75rem;
  cursor: pointer;
  font-size: .74rem;
  font-weight: 700;
}
.image-expand:hover { color: var(--gold); border-color: var(--gold-border); }
.architecture-full { position: relative; padding-top: 4rem; }
.architecture-full > img { display: block; width: 100%; height: auto; }
.architecture-canvas { max-height: 80vh; }

/* ──────────────────────────── Invariant grids ──────────────────────────── */
.invariant-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .75rem; }
.invariant-grid article { padding: 1.4rem; border-radius: var(--radius); }
.public-shell .invariant-grid article { border: 1px solid var(--line-ivory-s); background: var(--bg-ivory-soft); }
.private-shell .invariant-grid article { border: 1px solid var(--line-dark); background: var(--bg-dark-panel); }
.invariant-grid h3 { color: var(--gold-soft); font-family: var(--serif); font-weight: 700; font-size: 1rem; }
.invariant-grid p { color: var(--text-muted-dk); font-size: .8rem; }
.private-shell .invariant-grid p { color: var(--text-ivory-dim); }
.invariant-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: .65rem; }
.invariant-list article { display: grid; grid-template-columns: 36px 1fr; gap: .75rem; padding: 1rem; border-radius: var(--radius); }
.public-shell .invariant-list article { border: 1px solid var(--line-ivory-s); background: var(--bg-ivory-soft); }
.private-shell .invariant-list article { border: 1px solid var(--line-dark); background: var(--bg-dark-panel); }
.invariant-list article > span { color: var(--gold-deep); font-family: var(--serif); font-size: 1.2rem; }
.invariant-list h3 { font-size: .9rem; color: var(--gold-soft); }
.invariant-list p { margin: .3rem 0 0; font-size: .72rem; }
.public-shell .invariant-list p { color: var(--text-muted-dk); }
.private-shell .invariant-list p { color: var(--text-ivory-dim); }
.count-seal { color: var(--green); border: 1px solid rgba(76,175,125,.3); border-radius: 99px; padding: .5rem .75rem; font-size: .62rem; font-weight: 800; }

/* ──────────────────────────── CTA panel ──────────────────────────── */
.cta-panel {
  width: min(1240px, calc(100% - 5rem));
  margin-block: 5rem;
  padding: 4rem;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 3rem;
  border: 1px solid var(--gold-border);
  border-radius: var(--radius-xl);
}
.public-shell .cta-panel {
  background: var(--bg-dark);
  box-shadow: var(--shadow-dark);
  color: var(--text-ivory);
}
.private-shell .cta-panel {
  background: var(--bg-dark-2);
  box-shadow: var(--shadow-dark);
}
.cta-panel h2 { max-width: 760px; color: var(--text-ivory); }
.cta-panel p:not(.eyebrow) { max-width: 680px; color: var(--text-ivory-dim); }

/* ──────────────────────────── Portfolio map / topology ──────────────────────────── */
.hero-portfolio-map { width: 100%; border: 1px solid var(--gold-border); border-radius: var(--radius-lg); box-shadow: var(--shadow-dark); }
.portfolio-controls { padding-top: 3rem; padding-bottom: 0; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.filter-row { display: flex; flex-wrap: wrap; gap: .4rem; }
.filter-button {
  border-radius: 99px;
  padding: .48rem .75rem;
  font-size: .68rem;
  font-weight: 700;
  cursor: pointer;
  transition: border-color .15s, color .15s, background .15s;
  letter-spacing: .04em;
}
.public-shell .filter-button { border: 1px solid var(--line-ivory-s); background: var(--bg-ivory-soft); color: var(--text-muted-dk); }
.private-shell .filter-button { border: 1px solid var(--line-dark); background: var(--bg-dark-panel); color: var(--text-ivory-dim); }
.filter-button span { color: var(--gold); margin-left: .25rem; }
.filter-button.is-active, .filter-button:hover { border-color: var(--gold-border); color: var(--gold-soft); background: rgba(201,151,58,.08); }
.portfolio-search input { min-width: 260px; }
.no-results { padding: 4rem; text-align: center; }
.layer-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: .75rem; }
.layer-grid article { padding: 1.4rem; border-radius: var(--radius); }
.public-shell .layer-grid article { border: 1px solid var(--line-ivory-s); }
.private-shell .layer-grid article { border: 1px solid var(--line-dark); background: var(--bg-dark-panel); }
.layer-grid article > span { color: var(--gold); font-family: var(--serif); font-size: 1.5rem; }
.layer-grid h3 { margin-top: .85rem; }
.layer-grid p { font-size: .8rem; }
.public-shell .layer-grid p { color: var(--text-muted-dk); }
.private-shell .layer-grid p { color: var(--text-ivory-dim); }

/* ──────────────────────────── System hero card ──────────────────────────── */
.system-hero-card {
  padding: 2rem;
  border: 1px solid var(--gold-border);
  border-radius: var(--radius-lg);
  background: var(--bg-dark);
  box-shadow: var(--shadow-dark);
  color: var(--text-ivory);
}
.system-hero-card > .maturity { margin-left: 1rem; }
.system-hero-card > p { margin: 1.8rem 0; color: var(--text-ivory-dim); font-size: 1rem; }
.system-hero-card dl { margin: 0; }
.system-hero-card dl div { padding: .75rem 0; border-top: 1px solid var(--line-dark); }
.system-hero-card dt { color: var(--text-muted-lt); font-size: .58rem; text-transform: uppercase; letter-spacing: .1em; }
.system-hero-card dd { margin: .3rem 0 0; font-size: .82rem; color: var(--text-ivory); }
.system-story { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.system-story article { padding: 2.5rem; border-radius: var(--radius-lg); }
.public-shell .system-story article { border: 1px solid var(--line-ivory-s); background: var(--bg-ivory-soft); }
.private-shell .system-story article { border: 1px solid var(--line-dark); background: var(--bg-dark-panel); }
.system-story h2 { font-size: clamp(1.6rem, 2.5vw, 2.5rem); }
.workflow-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: .75rem; counter-reset: workflow; }
.workflow-steps li { min-height: 140px; padding: 1.2rem; border-radius: var(--radius); }
.public-shell .workflow-steps li { border: 1px solid var(--line-ivory-s); background: var(--bg-ivory-soft); }
.private-shell .workflow-steps li { border: 1px solid var(--line-dark); background: var(--bg-dark-panel); }
.workflow-steps li span { color: var(--gold-deep); font-family: var(--serif); font-size: 1.1rem; font-weight: 700; }
.workflow-steps li p { margin: .9rem 0 0; font-size: .84rem; }
.public-shell .workflow-steps li p { color: var(--text-muted-dk); }
.private-shell .workflow-steps li p { color: var(--text-ivory-dim); }
.three-column { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.three-column article { padding: 2rem; border-radius: var(--radius-lg); }
.public-shell .three-column article { border: 1px solid var(--line-ivory-s); }
.private-shell .three-column article { border: 1px solid var(--line-dark); background: var(--bg-dark-panel); }
.three-column h2 { font-size: 1.9rem; }
.feature-list { margin: 1rem 0 0; padding: 0; list-style: none; }
.feature-list li { position: relative; padding: .6rem 0 .6rem 1.4rem; border-bottom: 1px solid; font-size: .84rem; }
.public-shell .feature-list li { border-color: var(--line-ivory); color: var(--text-muted-dk); }
.private-shell .feature-list li { border-color: var(--line-dark); color: var(--text-ivory-dim); }
.feature-list li::before { content: '◇'; position: absolute; left: 0; color: var(--gold); font-size: .7rem; top: .75rem; }
.truth-panel { display: grid; grid-template-columns: 1fr .85fr; gap: 3rem; align-items: center; border-top: 1px solid; border-bottom: 1px solid; }
.public-shell .truth-panel { border-color: var(--line-ivory); }
.private-shell .truth-panel { border-color: var(--line-dark); }
.truth-panel > div > p:not(.eyebrow) { font-size: 1rem; line-height: 1.7; }
.public-shell .truth-panel > div > p:not(.eyebrow) { color: var(--text-muted-dk); }
.private-shell .truth-panel > div > p:not(.eyebrow) { color: var(--text-ivory-dim); }

/* Callout / info boxes */
.callout {
  padding: 1.4rem;
  border-radius: var(--radius);
  display: grid;
  gap: .4rem;
}
.callout strong { font-size: .72rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.callout p { font-size: .84rem; margin: 0; line-height: 1.6; }
.callout-info { border: 1px solid rgba(201,151,58,.3); background: rgba(201,151,58,.06); }
.callout-info strong { color: var(--gold); }
.callout-info p { color: var(--text-ivory-dim); }
.callout-warning { border: 1px solid rgba(201,151,58,.3); background: rgba(201,151,58,.06); }
.callout-warning strong { color: var(--gold); }
.callout-warning p { color: var(--text-ivory-dim); }
.public-shell .callout { border-color: var(--line-ivory-s); background: var(--bg-dark); }
.public-shell .callout strong { color: var(--gold); }
.public-shell .callout p { color: var(--text-ivory-dim); }

/* ──────────────────────────── Fabric rule ──────────────────────────── */
.fabric-rule { padding: 2rem; border: 1px solid var(--gold-border); border-radius: var(--radius-lg); background: var(--bg-dark-panel); }
.fabric-rule span { color: var(--gold); font-size: .65rem; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; }
.fabric-rule strong { display: block; margin: 1rem 0; color: var(--gold-soft); font-family: var(--serif); font-size: 2rem; font-weight: 700; }
.fabric-rule p { color: var(--text-ivory-dim); }

/* ──────────────────────────── Plane grid ──────────────────────────── */
.plane-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: .75rem; }
.plane-grid article { min-height: 270px; padding: 1.4rem; border-radius: var(--radius); position: relative; overflow: hidden; }
.public-shell .plane-grid article { border: 1px solid var(--line-ivory-s); }
.private-shell .plane-grid article { border: 1px solid var(--line-dark); background: var(--bg-dark-panel); }
.plane-grid article > span { width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--gold-border); display: grid; place-items: center; color: var(--gold); font-family: var(--serif); font-weight: 700; }
.plane-grid h3 { margin-top: 1rem; font-family: var(--serif); font-size: 1.5rem; font-weight: 700; }
.public-shell .plane-grid h3 { color: var(--text-dark); }
.private-shell .plane-grid h3 { color: var(--text-ivory); }
.plane-grid p:not(.system-domain) { font-size: .78rem; }
.public-shell .plane-grid p:not(.system-domain) { color: var(--text-muted-dk); }
.private-shell .plane-grid p:not(.system-domain) { color: var(--text-ivory-dim); }
.plane-grid a { display: inline-block; margin-top: 1rem; color: var(--gold); font-size: .74rem; font-weight: 700; }

/* ──────────────────────────── Timeline ──────────────────────────── */
.timeline { display: grid; grid-template-columns: repeat(6, 1fr); border-top: 1px solid var(--gold-deep); }
.timeline article { position: relative; padding: 2rem 1rem 0; }
.timeline article::before { content: ''; position: absolute; top: -5px; left: 1rem; width: 9px; height: 9px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 12px var(--gold); }
.timeline article > span { color: var(--gold); font-family: var(--serif); font-size: 1.2rem; font-weight: 700; }
.timeline h3 { margin: .6rem 0; font-size: .9rem; }
.timeline p { font-size: .72rem; }
.public-shell .timeline h3 { color: var(--text-dark); }
.private-shell .timeline h3 { color: var(--text-ivory); }
.public-shell .timeline p { color: var(--text-muted-dk); }
.private-shell .timeline p { color: var(--text-ivory-dim); }

/* ──────────────────────────── Operating / gate grids ──────────────────────────── */
.operating-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .8rem; }
.operating-grid article { padding: 1.6rem; border-radius: var(--radius); }
.public-shell .operating-grid article { border: 1px solid var(--line-ivory-s); background: var(--bg-ivory-soft); }
.private-shell .operating-grid article { border: 1px solid var(--line-dark); background: var(--bg-dark-panel); }
.operating-grid h3 { color: var(--gold-soft); font-family: var(--serif); font-size: 1.35rem; font-weight: 700; }
.operating-grid p { font-size: .84rem; }
.public-shell .operating-grid p { color: var(--text-muted-dk); }
.private-shell .operating-grid p { color: var(--text-ivory-dim); }

.evidence-ladder { display: grid; gap: .6rem; }
.evidence-ladder article { display: grid; grid-template-columns: 80px 1fr; align-items: center; gap: 1.2rem; padding: 1.1rem 1.4rem; border-radius: var(--radius); }
.public-shell .evidence-ladder article { border: 1px solid var(--line-ivory-s); background: var(--bg-ivory-soft); }
.private-shell .evidence-ladder article { border: 1px solid var(--line-dark); background: var(--bg-dark-panel); }
.evidence-ladder article > span { color: var(--gold); font-family: var(--serif); font-size: 1.8rem; font-weight: 700; }
.evidence-ladder h3 { }
.public-shell .evidence-ladder h3 { color: var(--text-dark); }
.private-shell .evidence-ladder h3 { color: var(--text-ivory); }
.evidence-ladder p { margin: .3rem 0 0; font-size: .83rem; }
.public-shell .evidence-ladder p { color: var(--text-muted-dk); }
.private-shell .evidence-ladder p { color: var(--text-ivory-dim); }

.gate-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .75rem; }
.gate-grid article { display: flex; gap: .8rem; padding: 1.2rem; border-radius: var(--radius); }
.public-shell .gate-grid article { border: 1px solid var(--line-ivory-s); }
.private-shell .gate-grid article { border: 1px solid var(--line-dark); background: var(--bg-dark-panel); }
.gate-grid article span { color: var(--gold); font-size: 1.1rem; }
.gate-grid p { margin: 0; font-size: .84rem; }
.public-shell .gate-grid p { color: var(--text-muted-dk); }
.private-shell .gate-grid p { color: var(--text-ivory-dim); }

.release-state { display: grid; grid-template-columns: 1.3fr .7fr; gap: 1rem; }
.release-state > article { padding: 2rem; border-radius: var(--radius-lg); }
.public-shell .release-state > article { border: 1px solid var(--line-ivory-s); }
.private-shell .release-state > article { border: 1px solid var(--line-dark); background: var(--bg-dark-panel); }
.release-state > article p:not(.eyebrow) { font-size: .9rem; }
.public-shell .release-state > article p:not(.eyebrow) { color: var(--text-muted-dk); }
.private-shell .release-state > article p:not(.eyebrow) { color: var(--text-ivory-dim); }
.release-state dl div { display: flex; justify-content: space-between; gap: 1rem; padding: .75rem 0; border-bottom: 1px solid; }
.public-shell .release-state dl div { border-color: var(--line-ivory); }
.private-shell .release-state dl div { border-color: var(--line-dark); }
.release-state dt { font-size: .75rem; }
.public-shell .release-state dt { color: var(--text-muted-dk); }
.private-shell .release-state dt { color: var(--text-ivory-dim); }
.release-state dd { margin: 0; text-align: right; font-size: .82rem; }

.test-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .75rem; }
.test-grid article { padding: 1.4rem; border-radius: var(--radius); }
.public-shell .test-grid article { border: 1px solid var(--line-ivory-s); }
.private-shell .test-grid article { border: 1px solid var(--line-dark); background: var(--bg-dark-panel); }
.test-grid h3 { margin-top: 1rem; }
.test-grid p { font-size: .82rem; }
.public-shell .test-grid p { color: var(--text-muted-dk); }
.private-shell .test-grid p { color: var(--text-ivory-dim); }
.test-grid dl { margin: 0; }
.test-grid dl div { display: flex; justify-content: space-between; padding: .5rem 0; font-size: .72rem; border-top: 1px solid; }
.public-shell .test-grid dl div { border-color: var(--line-ivory); }
.private-shell .test-grid dl div { border-color: var(--line-dark); }
.test-grid dd { margin: 0; }
.code-block { margin: 0; padding: 1.5rem; overflow-x: auto; color: var(--green); background: var(--bg-dark); border: 1px solid var(--line-dark); border-radius: var(--radius); }

/* ──────────────────────────── Forms ──────────────────────────── */
.form-layout { display: grid; grid-template-columns: .75fr 1.25fr; gap: 4rem; align-items: start; }
.form-layout > div > p:not(.eyebrow) { font-size: 1rem; }
.public-shell .form-layout > div > p:not(.eyebrow) { color: var(--text-muted-dk); }
.private-shell .form-layout > div > p:not(.eyebrow) { color: var(--text-ivory-dim); }
.institutional-form { display: grid; gap: 1rem; }
.institutional-form.panel { padding: 2rem; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.field-full { grid-column: 1 / -1; }
label { display: grid; gap: .4rem; }
label > span { font-size: .7rem; font-weight: 800; letter-spacing: .04em; }
.public-shell label > span { color: var(--text-muted-dk); }
.private-shell label > span { color: var(--text-ivory-dim); }
input, select, textarea {
  width: 100%;
  border-radius: var(--radius);
  padding: .75rem .85rem;
  font-size: .9rem;
  transition: border-color .15s;
}
.public-shell input, .public-shell select, .public-shell textarea {
  color: var(--text-dark);
  background: var(--bg-ivory-soft);
  border: 1px solid var(--line-ivory-s);
}
.public-shell input:hover, .public-shell select:hover, .public-shell textarea:hover { border-color: var(--gold-border); }
.private-shell input, .private-shell select, .private-shell textarea {
  color: var(--text-ivory);
  background: var(--bg-dark-raised);
  border: 1px solid var(--line-dark);
}
.private-shell input:hover, .private-shell select:hover, .private-shell textarea:hover { border-color: var(--gold-border); }
input, select { min-height: 44px; }
textarea { resize: vertical; min-height: 100px; }
input::placeholder, textarea::placeholder { color: var(--text-muted-lt); }
input:invalid:not(:placeholder-shown), textarea:invalid:not(:placeholder-shown) { border-color: rgba(192,80,80,.65); }
.check-field { display: flex; align-items: flex-start; gap: .75rem; }
.check-field input { width: 18px; height: 18px; min-height: 0; margin-top: .1rem; flex: none; }
.check-field span { font-size: .84rem; }
.public-shell .check-field span { color: var(--text-muted-dk); }
.private-shell .check-field span { color: var(--text-ivory-dim); }
.form-actions { display: flex; gap: .75rem; }
.form-error { padding: .8rem 1rem; color: #ffd0d0; background: rgba(192,80,80,.08); border: 1px solid rgba(192,80,80,.35); border-radius: var(--radius); font-size: .84rem; }
.compact-form { gap: .8rem; }
.compact-form textarea { min-height: 80px; }
.form-note { font-size: .76rem; line-height: 1.6; }
.public-shell .form-note { color: var(--text-muted-dk); }
.private-shell .form-note { color: var(--text-ivory-dim); }
.form-help { font-size: .86rem; max-width: 72ch; }
.public-shell .form-help { color: var(--text-muted-dk); }
.private-shell .form-help { color: var(--text-ivory-dim); }
.honeypot { position: absolute; opacity: 0; pointer-events: none; }

/* ──────────────────────────── Auth page ──────────────────────────── */
.auth-page { width: min(1120px, calc(100% - 4rem)); min-height: 720px; margin: auto; padding: 7rem 0; display: grid; grid-template-columns: 1fr 440px; align-items: start; gap: 6rem; }
.auth-copy h1 { font-size: clamp(2.8rem, 5vw, 5.5rem); }
.auth-copy > p:not(.eyebrow) { max-width: 600px; font-size: 1.05rem; }
.public-shell .auth-copy > p:not(.eyebrow) { color: var(--text-muted-dk); }
.auth-panel { display: grid; gap: 1rem; }
.auth-panel > form, .demo-credentials {
  padding: 1.8rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-dark);
}
.auth-panel > form { background: var(--bg-dark); border: 1px solid var(--gold-border); }
.demo-credentials { background: var(--bg-dark-panel); border: 1px solid var(--line-dark); box-shadow: none; }
.auth-panel h2 { font-size: 1.9rem; color: var(--text-ivory); }
.demo-credentials > p:not(.eyebrow) { color: var(--text-ivory-dim); font-size: .78rem; }
.demo-credentials dl { margin: 0; }
.demo-credentials dl div { padding: .55rem 0; border-top: 1px solid var(--line-dark); }
.demo-credentials dt { color: var(--gold); font-size: .65rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.demo-credentials dd { margin: .2rem 0 0; color: var(--text-ivory-dim); font-size: .7rem; overflow-wrap: anywhere; }

/* Signin card */
.signin-shell { padding-block: 4rem; }
.signin-card { max-width: 440px; margin: auto; display: grid; gap: 1rem; padding: 2rem; border: 1px solid var(--gold-border); border-radius: var(--radius-lg); background: var(--bg-dark); box-shadow: var(--shadow-dark); }
.public-shell .signin-card label > span { color: var(--text-ivory-dim); }

/* ──────────────────────────── Status / incident ──────────────────────────── */
.status-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: .8rem; }
.status-summary article { display: flex; align-items: center; gap: 1.2rem; padding: 2rem; border-radius: var(--radius-lg); }
.public-shell .status-summary article { border: 1px solid var(--line-ivory-s); background: var(--bg-ivory-soft); }
.private-shell .status-summary article { border: 1px solid var(--line-dark); background: var(--bg-dark-panel); }
.status-light { width: 16px; height: 16px; border-radius: 50%; background: var(--red); box-shadow: 0 0 14px rgba(192,80,80,.45); flex: none; }
.status-light.is-live { background: var(--green); box-shadow: 0 0 14px rgba(76,175,125,.55); }
.status-summary h2 { font-size: 1.9rem; }
.status-summary p { margin: .2rem 0 0; font-size: .78rem; }
.public-shell .status-summary p { color: var(--text-muted-dk); }
.private-shell .status-summary p { color: var(--text-ivory-dim); }
.incident-list { display: grid; gap: .75rem; }
.incident-list article { padding: 1.4rem; border-radius: var(--radius); }
.public-shell .incident-list article { border: 1px solid var(--line-ivory-s); }
.private-shell .incident-list article { border: 1px solid var(--line-dark); }
.incident-list p { font-size: .9rem; }
.public-shell .incident-list p { color: var(--text-muted-dk); }
.private-shell .incident-list p { color: var(--text-ivory-dim); }
.incident-list > article > span { font-size: .72rem; }
.public-shell .incident-list > article > span { color: var(--text-muted-dk); }
.private-shell .incident-list > article > span { color: var(--text-ivory-dim); }
.document-sections { display: grid; gap: 1rem; max-width: 1000px; }
.document-sections article { padding: 2rem; border-radius: var(--radius-lg); }
.public-shell .document-sections article { border: 1px solid var(--line-ivory-s); background: var(--bg-ivory-soft); }
.private-shell .document-sections article { border: 1px solid var(--line-dark); background: var(--bg-dark-panel); }
.document-sections h2 { font-size: 2.1rem; }
.document-sections p { font-size: 1rem; }
.public-shell .document-sections p { color: var(--text-muted-dk); }
.private-shell .document-sections p { color: var(--text-ivory-dim); }

/* ──────────────────────────── Flash / Toast ──────────────────────────── */
.flash { width: min(430px, calc(100% - 3rem)); margin: 1rem 1.5rem 0 auto; display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; padding: 1rem; border-radius: var(--radius); box-shadow: var(--shadow); background: var(--bg-dark-panel); border: 1px solid var(--line-dark-s); color: var(--text-ivory); }
.flash-success { border-color: rgba(76,175,125,.45); }
.flash-error { border-color: rgba(192,80,80,.55); }
.flash button { min-width: 32px; min-height: 32px; display: grid; place-items: center; border: 0; background: transparent; cursor: pointer; font-size: 1.2rem; color: var(--text-ivory-dim); }
.toast-region { position: fixed; right: 1rem; bottom: 1rem; z-index: 500; display: grid; gap: .5rem; }
.toast { max-width: 420px; padding: 1rem; border: 1px solid var(--line-dark-s); border-radius: var(--radius); background: var(--bg-dark-panel); box-shadow: var(--shadow-dark); color: var(--text-ivory); }
.toast-error { border-color: var(--red); }

/* ──────────────────────────── Command palette ──────────────────────────── */
.command-palette {
  width: min(720px, calc(100% - 2rem));
  max-height: 80vh;
  padding: 0;
  color: var(--text-ivory);
  background: var(--bg-dark);
  border: 1px solid var(--gold-border);
  border-radius: var(--radius-lg);
  box-shadow: 0 40px 120px rgba(0,0,0,.7);
}
.command-palette::backdrop, .image-viewer::backdrop { background: rgba(10,8,5,.8); backdrop-filter: blur(6px); }
.command-head { display: flex; align-items: center; justify-content: space-between; padding: 1.2rem 1.4rem; border-bottom: 1px solid var(--line-dark); }
.command-head h2 { font-size: 1.65rem; color: var(--text-ivory); }
.command-head .eyebrow { margin-bottom: .3rem; }
.search-field { padding: 1rem 1.4rem; }
.search-field input { min-height: 52px; background: var(--bg-dark-raised); border-color: var(--line-dark-s); color: var(--text-ivory); }
.command-results { max-height: 50vh; overflow-y: auto; padding: .4rem; }
.command-results a { display: grid; padding: .8rem 1rem; border-radius: var(--radius); }
.command-results a strong { color: var(--text-ivory); }
.command-results a span { color: var(--text-ivory-dim); font-size: .72rem; }
.command-results a.is-active, .command-results a:hover { background: rgba(201,151,58,.07); }
.command-results a:hover strong { color: var(--gold-soft); }
.command-help { margin: 0; padding: .75rem 1.4rem; color: var(--text-ivory-dim); border-top: 1px solid var(--line-dark); font-size: .66rem; }
kbd { padding: .12rem .32rem; background: var(--bg-dark-raised); border: 1px solid var(--line-dark); border-radius: 3px; color: var(--text-ivory-dim); }
.image-viewer { width: 96vw; max-width: none; height: 92vh; padding: 0; color: var(--text-ivory); background: var(--bg-dark); border: 1px solid var(--line-dark-s); border-radius: var(--radius-lg); }
.image-viewer-head { height: 60px; display: flex; align-items: center; justify-content: space-between; padding: 0 1rem; border-bottom: 1px solid var(--line-dark); }
.image-viewer-stage { height: calc(100% - 60px); overflow: auto; }
.image-viewer-stage img { min-width: 1200px; display: block; }

/* ──────────────────────────── Footer ──────────────────────────── */
.site-footer {
  background: #0a0805;
  border-top: 1px solid rgba(201,151,58,.2);
  color: var(--text-ivory);
}
.footer-grid {
  width: min(var(--container), calc(100% - 5rem));
  margin: auto;
  padding: 5rem 0 3rem;
  display: grid;
  grid-template-columns: 2fr repeat(3, 1fr);
  gap: 3rem;
}
.footer-brand { display: flex; gap: 1rem; }
.footer-brand .brand-mark { color: var(--gold); }
.footer-brand strong { color: var(--gold-soft); font-family: var(--serif); letter-spacing: .1em; font-size: 1rem; }
.footer-brand p { max-width: 360px; color: var(--text-ivory-dim); font-size: .78rem; line-height: 1.65; margin-top: .5rem; }
.footer-grid h2 { margin-bottom: 1rem; color: var(--text-muted-lt); font-family: var(--sans); font-size: .58rem; font-weight: 900; letter-spacing: .16em; text-transform: uppercase; }
.footer-grid > div:not(.footer-brand) { display: flex; flex-direction: column; gap: .6rem; }
.footer-grid a { color: var(--text-ivory-dim); font-size: .75rem; transition: color .15s; }
.footer-grid a:hover { color: var(--gold-soft); }
.micro-badges { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .75rem; }
.micro-badges span { padding: .2rem .38rem; border: 1px solid rgba(201,151,58,.28); border-radius: 3px; color: var(--text-muted-lt); font-size: .48rem; letter-spacing: .1em; }
.footer-bottom {
  width: min(var(--container), calc(100% - 5rem));
  margin: auto;
  padding: 1.5rem 0 2rem;
  display: flex;
  justify-content: space-between;
  gap: 2rem;
  border-top: 1px solid rgba(201,151,58,.15);
  color: var(--text-muted-lt);
  font-size: .6rem;
  letter-spacing: .04em;
}

/* Institutional footer proof strip (evaluation pages) */
.eval-footer-strip {
  width: 100%;
  padding: 2.5rem 0;
  border-top: 1px solid rgba(201,151,58,.2);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}
.eval-footer-stat { display: flex; align-items: center; gap: 1.2rem; padding: 0 2rem; }
.eval-footer-stat + .eval-footer-stat { border-left: 1px solid rgba(201,151,58,.2); }
.eval-footer-stat > span.seal { width: 48px; height: 48px; display: grid; place-items: center; border: 2px solid var(--gold-border); border-radius: 50%; color: var(--gold); font-size: 1.1rem; flex: none; }
.eval-footer-stat > div > strong { color: var(--gold-soft); font-family: var(--serif); font-size: 1.9rem; font-weight: 700; display: block; line-height: 1; }
.eval-footer-stat > div > span { color: var(--text-ivory-dim); font-size: .58rem; letter-spacing: .14em; text-transform: uppercase; margin-top: .25rem; display: block; }

/* ──────────────────────────── Console ──────────────────────────── */
.console-page { padding-block: 3.5rem 7rem; }
.console-page-narrow { max-width: 1040px; }
.console-page-head { display: flex; align-items: end; justify-content: space-between; gap: 2rem; margin-bottom: 2rem; }
.console-page-head h1, .case-header h1 { font-size: clamp(2.6rem, 4vw, 4.2rem); }
.console-page-head p:not(.eyebrow), .case-title-row p:not(.eyebrow) { color: var(--text-ivory-dim); }
.console-metrics { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: .65rem; margin-bottom: .8rem; }
.console-metrics.compact { grid-template-columns: repeat(6, 1fr); margin: 0; }
.console-metric { min-height: 124px; padding: 1.2rem; display: flex; flex-direction: column; border: 1px solid var(--line-dark); border-radius: var(--radius); background: var(--bg-dark-panel); transition: border-color .2s; }
.console-metric:hover { border-color: var(--gold-border); }
.console-metric > span { color: var(--text-muted-lt); font-size: .58rem; font-weight: 800; text-transform: uppercase; letter-spacing: .1em; line-height: 1.35; }
.console-metric strong { margin: .6rem 0; color: var(--gold-soft); font-family: var(--serif); font-size: 1.85rem; font-weight: 700; }
.console-metric small { margin-top: auto; color: var(--text-ivory-dim); font-size: .68rem; }

.metric-card { min-width: 0; min-height: 124px; padding: 1.2rem; display: flex; flex-direction: column; justify-content: flex-start; border: 1px solid var(--line-dark); border-radius: var(--radius); background: var(--bg-dark-panel); transition: border-color .2s; }
.metric-card:hover { border-color: var(--gold-border); }
.metric-card > span { color: var(--text-muted-lt); font-size: .6rem; font-weight: 850; letter-spacing: .1em; line-height: 1.35; text-transform: uppercase; }
.metric-card > strong { margin: .55rem 0 .25rem; color: var(--gold-soft); font-family: var(--serif); font-size: clamp(1.45rem, 2.2vw, 2rem); font-weight: 700; line-height: 1.05; overflow-wrap: anywhere; }
.metric-card > small { margin-top: auto; color: var(--text-ivory-dim); font-size: .68rem; line-height: 1.45; }
.metric-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: .75rem; }

.console-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(320px, 1fr); gap: .8rem; margin-top: .8rem; }
.console-grid-main { grid-template-columns: minmax(0, 2.2fr) minmax(350px, .8fr); }
.panel { min-width: 0; padding: 1.4rem; border: 1px solid var(--line-dark); border-radius: var(--radius); background: var(--bg-dark-panel); }
.panel-wide { min-height: 360px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin: -.1rem 0 1.2rem; }
.panel-head h2 { font-size: 1.4rem; color: var(--text-ivory); }
.panel-head > span { color: var(--text-ivory-dim); font-size: .72rem; }
.panel-head > a { color: var(--gold); font-size: .72rem; font-weight: 700; }

/* Two-column + other layout helpers */
.two-column { display: grid; grid-template-columns: 1fr 1fr; gap: .85rem; }
.form-shell { max-width: 860px; }

/* Tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 700px; }
th { padding: .7rem; color: var(--text-muted-lt); border-bottom: 1px solid var(--line-dark-s); font-size: .55rem; letter-spacing: .1em; text-transform: uppercase; text-align: left; }
td { padding: .85rem .7rem; border-bottom: 1px solid var(--line-dark); color: var(--text-ivory-dim); font-size: .76rem; vertical-align: top; }
td > span { display: block; margin-top: .2rem; color: var(--text-muted-lt); font-size: .65rem; }
.table-title { color: var(--text-ivory); font-weight: 700; }
td .progress-wrap { min-width: 110px; }

/* Progress bars */
.progress-wrap { display: grid; gap: .32rem; }
.progress-label { display: flex; justify-content: space-between; color: var(--text-ivory-dim); font-size: .6rem; }
.progress-label strong { color: var(--text-ivory); }
.progress { height: 6px; overflow: hidden; border-radius: 99px; background: var(--bg-dark); border: 1px solid rgba(201,151,58,.12); }
.progress span { display: block; height: 100%; background: linear-gradient(90deg, var(--gold-deep), var(--gold-soft)); border-radius: inherit; }
.progress-value-0{width:0%} .progress-value-1{width:1%} .progress-value-2{width:2%} .progress-value-3{width:3%} .progress-value-4{width:4%} .progress-value-5{width:5%} .progress-value-6{width:6%} .progress-value-7{width:7%} .progress-value-8{width:8%} .progress-value-9{width:9%} .progress-value-10{width:10%} .progress-value-11{width:11%} .progress-value-12{width:12%} .progress-value-13{width:13%} .progress-value-14{width:14%} .progress-value-15{width:15%} .progress-value-16{width:16%} .progress-value-17{width:17%} .progress-value-18{width:18%} .progress-value-19{width:19%} .progress-value-20{width:20%} .progress-value-21{width:21%} .progress-value-22{width:22%} .progress-value-23{width:23%} .progress-value-24{width:24%} .progress-value-25{width:25%} .progress-value-26{width:26%} .progress-value-27{width:27%} .progress-value-28{width:28%} .progress-value-29{width:29%} .progress-value-30{width:30%} .progress-value-31{width:31%} .progress-value-32{width:32%} .progress-value-33{width:33%} .progress-value-34{width:34%} .progress-value-35{width:35%} .progress-value-36{width:36%} .progress-value-37{width:37%} .progress-value-38{width:38%} .progress-value-39{width:39%} .progress-value-40{width:40%} .progress-value-41{width:41%} .progress-value-42{width:42%} .progress-value-43{width:43%} .progress-value-44{width:44%} .progress-value-45{width:45%} .progress-value-46{width:46%} .progress-value-47{width:47%} .progress-value-48{width:48%} .progress-value-49{width:49%} .progress-value-50{width:50%} .progress-value-51{width:51%} .progress-value-52{width:52%} .progress-value-53{width:53%} .progress-value-54{width:54%} .progress-value-55{width:55%} .progress-value-56{width:56%} .progress-value-57{width:57%} .progress-value-58{width:58%} .progress-value-59{width:59%} .progress-value-60{width:60%} .progress-value-61{width:61%} .progress-value-62{width:62%} .progress-value-63{width:63%} .progress-value-64{width:64%} .progress-value-65{width:65%} .progress-value-66{width:66%} .progress-value-67{width:67%} .progress-value-68{width:68%} .progress-value-69{width:69%} .progress-value-70{width:70%} .progress-value-71{width:71%} .progress-value-72{width:72%} .progress-value-73{width:73%} .progress-value-74{width:74%} .progress-value-75{width:75%} .progress-value-76{width:76%} .progress-value-77{width:77%} .progress-value-78{width:78%} .progress-value-79{width:79%} .progress-value-80{width:80%} .progress-value-81{width:81%} .progress-value-82{width:82%} .progress-value-83{width:83%} .progress-value-84{width:84%} .progress-value-85{width:85%} .progress-value-86{width:86%} .progress-value-87{width:87%} .progress-value-88{width:88%} .progress-value-89{width:89%} .progress-value-90{width:90%} .progress-value-91{width:91%} .progress-value-92{width:92%} .progress-value-93{width:93%} .progress-value-94{width:94%} .progress-value-95{width:95%} .progress-value-96{width:96%} .progress-value-97{width:97%} .progress-value-98{width:98%} .progress-value-99{width:99%} .progress-value-100{width:100%}

/* Status badges */
.status { display: inline-flex; align-items: center; gap: .28rem; padding: .24rem .42rem; border: 1px solid; border-radius: 99px; font-size: .52rem; font-weight: 900; letter-spacing: .05em; text-transform: uppercase; white-space: nowrap; background: transparent; }
.status::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: currentColor; flex: none; }
.status-neutral { color: var(--text-muted-lt); border-color: rgba(154,144,128,.25); }
.status-success { color: var(--green); border-color: rgba(76,175,125,.3); background: rgba(76,175,125,.06); }
.status-danger { color: var(--red); border-color: rgba(192,80,80,.3); background: rgba(192,80,80,.06); }
.status-warning { color: var(--gold); border-color: var(--gold-border); background: rgba(201,151,58,.06); }

/* Audit trail */
.audit-timeline { display: grid; gap: .2rem; }
.audit-timeline article { position: relative; display: grid; grid-template-columns: 14px 1fr; gap: .65rem; padding: .5rem 0; }
.audit-timeline article::after { content: ''; position: absolute; left: 6px; top: 20px; bottom: -8px; width: 1px; background: var(--line-dark); }
.audit-timeline article:last-child::after { display: none; }
.audit-node { width: 11px; height: 11px; margin-top: .2rem; border-radius: 50%; background: var(--gold); box-shadow: 0 0 8px rgba(201,151,58,.4); }
.audit-timeline strong { font-size: .7rem; text-transform: uppercase; color: var(--text-ivory); }
.audit-timeline p { margin: .18rem 0; color: var(--text-ivory-dim); font-size: .63rem; }
.audit-timeline code { display: block; color: var(--gold-deep); font-size: .54rem; overflow: hidden; text-overflow: ellipsis; }
.audit-stream { display: grid; gap: .2rem; }

/* Record list */
.record-list { display: grid; gap: .5rem; }
.record-list > a, .record-list > article { display: flex; justify-content: space-between; gap: 1rem; padding: .85rem; border: 1px solid var(--line-dark); border-radius: var(--radius); }
.record-list > a:hover { border-color: var(--gold-border); }
.record-list strong { display: block; color: var(--text-ivory); font-size: .84rem; }
.record-list span { display: block; margin-top: .2rem; color: var(--text-ivory-dim); font-size: .68rem; }
.record-list.plain > div { display: flex; justify-content: space-between; gap: 1rem; padding: .75rem .85rem; border: 1px solid var(--line-dark); border-radius: var(--radius); }

/* Control state */
.control-state { margin: 0; }
.control-state div { display: flex; justify-content: space-between; gap: 1rem; padding: .65rem 0; border-bottom: 1px solid var(--line-dark); }
.control-state dt { color: var(--text-ivory-dim); font-size: .7rem; }
.control-state dd { margin: 0; color: var(--green); font-size: .65rem; font-weight: 800; text-align: right; }

/* Empty state */
.empty-state { min-height: 220px; padding: 2rem; display: grid; place-content: center; justify-items: center; text-align: center; }
.empty-state h2 { font-size: 1.45rem; color: var(--text-ivory); }
.empty-state p { max-width: 440px; color: var(--text-ivory-dim); }
.empty-icon { width: 46px; height: 46px; display: grid; place-items: center; border: 1px solid var(--gold-border); border-radius: 50%; color: var(--gold); font-size: 1.3rem; margin-bottom: 1rem; }

/* Filter panel */
.filter-panel { margin-bottom: .8rem; padding: 1rem; display: grid; grid-template-columns: 1.2fr .8fr 1fr auto auto; align-items: end; gap: .65rem; border: 1px solid var(--line-dark); border-radius: var(--radius); background: var(--bg-dark-panel); }
.filter-panel label span { font-size: .6rem; color: var(--text-muted-lt); }

/* ──────────────────────────── Case detail ──────────────────────────── */
.case-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 2rem; margin-bottom: 1.4rem; }
.case-title-row { margin-top: 1rem; display: flex; justify-content: space-between; gap: 3rem; }
.case-title-row > div:first-child { max-width: 920px; }
.case-status { display: flex; align-items: flex-start; flex-wrap: wrap; gap: .4rem; }
.closure-seal { padding: .32rem .52rem; border: 1px solid rgba(76,175,125,.3); border-radius: 99px; color: var(--green); font-size: .56rem; font-weight: 900; text-transform: uppercase; }
.case-overview { display: grid; grid-template-columns: .7fr 1.3fr; gap: 3rem; align-items: center; }
.overview-grid { margin: 0; display: grid; grid-template-columns: repeat(4, 1fr); }
.overview-grid div { padding: .75rem; border-left: 1px solid var(--line-dark); border-bottom: 1px solid var(--line-dark); }
.overview-grid dt { color: var(--text-muted-lt); font-size: .54rem; text-transform: uppercase; letter-spacing: .08em; }
.overview-grid dd { margin: .28rem 0 0; font-size: .74rem; color: var(--text-ivory); }
.case-stepper { margin: .8rem 0; display: grid; grid-template-columns: repeat(10, 1fr); gap: .32rem; }
.case-stepper article { min-height: 110px; padding: .6rem; border: 1px solid var(--line-dark); border-radius: var(--radius-sm); background: var(--bg-dark-panel); opacity: .5; }
.case-stepper article.is-complete { opacity: 1; border-color: rgba(76,175,125,.22); }
.case-stepper article.is-current { opacity: 1; border-color: var(--gold-deep); }
.case-stepper article > span { color: var(--gold-deep); font-family: var(--serif); font-weight: 700; }
.case-stepper strong { display: block; margin-top: .45rem; font-size: .65rem; color: var(--text-ivory); }
.case-stepper p { display: none; }
.case-layout { display: grid; grid-template-columns: minmax(0, 1.8fr) minmax(300px, .7fr); gap: .8rem; }
.case-main, .case-aside { display: grid; align-content: start; gap: .8rem; }
.sticky-panel { position: sticky; top: 145px; }
.case-actions { display: grid; gap: .55rem; }
.case-actions .section-head { margin-bottom: .5rem; }
.case-actions h2 { font-size: 1.75rem; }
.action-panel { border: 1px solid var(--line-dark); border-radius: var(--radius); background: var(--bg-dark-panel); overflow: hidden; }
.action-panel summary, .action-panel-static { list-style: none; display: grid; grid-template-columns: 40px 1fr; gap: .75rem; align-items: center; padding: 1rem 1.2rem; cursor: pointer; }
.action-panel summary::-webkit-details-marker { display: none; }
.action-panel summary > span, .action-panel-static > span { color: var(--gold); font-family: var(--serif); font-weight: 700; font-size: 1.1rem; }
.action-panel summary strong, .action-panel-static strong { display: block; color: var(--text-ivory); font-size: .88rem; }
.action-panel summary small, .action-panel-static small { color: var(--text-ivory-dim); font-size: .72rem; }
.action-panel > form, .action-panel-open > form { padding: 1.2rem; border-top: 1px solid var(--line-dark); }
.action-panel-open { border: 1px solid var(--line-dark); border-radius: var(--radius); background: var(--bg-dark-panel); }
.evidence-add { margin-top: 1rem; border-top: 1px solid var(--line-dark); }
.evidence-add summary { padding: 1rem 0; color: var(--gold); cursor: pointer; font-weight: 700; font-size: .84rem; }
.evidence-add form { padding-top: .5rem; }
.passport-card { text-align: center; }
.passport-seal { width: 58px; height: 68px; margin: auto; display: grid; place-items: center; color: var(--gold); border: 2px solid var(--gold-border-strong); border-radius: 30% 30% 45% 45%; font-family: var(--serif); font-size: 1.7rem; }
.passport-card h3 { font-family: var(--serif); font-size: 1.25rem; color: var(--text-ivory); }
.passport-card p { color: var(--text-ivory-dim); font-size: .72rem; }
.passport-card code { display: block; margin: .75rem 0; padding: .55rem; color: var(--gold); background: var(--bg-dark); border-radius: var(--radius-sm); font-size: .54rem; overflow-wrap: anywhere; }
.mini-record { padding: .75rem 0; border-bottom: 1px solid var(--line-dark); }
.mini-record > div { display: flex; justify-content: space-between; }
.mini-record strong { display: block; margin: .45rem 0; font-size: .78rem; color: var(--text-ivory); }
.mini-record small { color: var(--text-muted-lt); font-size: .65rem; }
.scope-grid { margin-top: 1.5rem; display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; }
.scope-grid article { padding: 1rem; border: 1px solid var(--line-dark); border-radius: var(--radius-sm); }
.scope-grid h3 { color: var(--gold-soft); font-size: .85rem; }
.scope-grid ul { padding-left: 1rem; color: var(--text-ivory-dim); font-size: .72rem; }
.scope-grid p { color: var(--text-ivory-dim); font-size: .72rem; }
.permit-record { align-items: flex-start; }
.permit-record code { display: block; margin: .32rem 0; color: var(--gold-deep); font-size: .58rem; overflow-wrap: anywhere; }
.permit-record small { color: var(--text-muted-lt); font-size: .65rem; }
.permit-record > div:last-child { display: grid; justify-items: end; gap: .5rem; }
.permit-consume { display: grid; gap: .4rem; }
.authority-zero, .raw-local { padding: .5rem .75rem; border-radius: 99px; font-size: .65rem; font-weight: 900; letter-spacing: .08em; }
.authority-zero { color: var(--gold); border: 1px solid var(--gold-border); }
.authority-zero.small { padding: .18rem .38rem; font-size: .5rem; }
.raw-local { color: var(--text-ivory-dim); border: 1px solid var(--line-dark-s); }
.plan-record { align-items: flex-start; }
.plan-record > div:last-child { display: grid; justify-items: end; gap: .5rem; }
.learning-list { display: grid; gap: .65rem; }
.learning-list > article { padding: 1rem; border: 1px solid var(--line-dark); border-radius: var(--radius); }
.learning-head { display: flex; justify-content: space-between; gap: 1rem; }
.learning-head strong, .learning-head span { display: block; }
.learning-head strong { color: var(--text-ivory); }
.learning-head span { color: var(--text-ivory-dim); font-size: .7rem; }
.learning-list dl { display: grid; grid-template-columns: repeat(6, 1fr); margin: 1rem 0; }
.learning-list dl div { padding: .55rem; border: 1px solid var(--line-dark); }
.learning-list dt { color: var(--text-muted-lt); font-size: .52rem; }
.learning-list dd { margin: .28rem 0 0; font-size: .74rem; color: var(--text-ivory); }
.learning-list small { color: var(--text-muted-lt); font-size: .65rem; }
.record-actions { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .8rem; }
.audit-verification dl { display: grid; grid-template-columns: 1fr 160px 2fr; gap: 1rem; margin: 0; }
.audit-verification div { padding: .8rem; border-right: 1px solid var(--line-dark); }
.audit-verification dt { color: var(--text-muted-lt); font-size: .58rem; text-transform: uppercase; }
.audit-verification dd { margin: .35rem 0 0; color: var(--text-ivory); font-size: .8rem; }
.audit-verification code { font-size: .6rem; color: var(--gold-deep); overflow-wrap: anywhere; }
.access-list { display: grid; gap: .65rem; }
.access-list article { padding: 1.2rem; border: 1px solid var(--line-dark); border-radius: var(--radius); }
.access-head { display: flex; justify-content: space-between; gap: 1rem; }
.access-head strong, .access-head span { display: block; }
.access-head strong { color: var(--text-ivory); }
.access-head span, .access-list small { color: var(--text-ivory-dim); font-size: .7rem; }
.access-list p { color: var(--text-ivory-dim); font-size: .84rem; }

/* ──────────────────────────── Mobile nav ──────────────────────────── */
.mobile-nav-head, .mobile-nav-actions, .mobile-nav-backdrop { display: none; }
.console-context {
  width: min(100% - 2rem, var(--container));
  margin: 0 auto;
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  color: var(--text-ivory-dim);
  font-size: .7rem;
  border-bottom: 1px solid rgba(201,151,58,.12);
  padding-bottom: .5rem;
}
.console-context strong { color: var(--text-ivory); }
.console-context span { color: var(--gold); }
.console-context > div { min-width: 0; display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.console-context > div strong, .console-context > div span { display: inline-block; }
.console-context > div strong::after { content: '·'; margin-left: .5rem; color: var(--text-muted-lt); }
.console-context > a { color: var(--gold); font-size: .68rem; font-weight: 700; white-space: nowrap; }

/* ──────────────────────────── Workspace grids ──────────────────────────── */
.workspace-compact-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: .6rem; }
.workspace-chip {
  min-width: 0; padding: .85rem;
  display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: .65rem; align-items: center;
  border: 1px solid var(--line-dark); border-radius: var(--radius);
  background: var(--bg-dark-panel);
  transition: border-color .2s, background .2s;
}
.workspace-chip:hover { border-color: var(--gold-border); background: var(--bg-dark-raised); }
.workspace-chip > span:first-child { width: 32px; height: 32px; display: grid; place-items: center; border: 1px solid var(--gold-border); border-radius: 50%; color: var(--gold); font-family: var(--serif); font-size: .68rem; font-weight: 700; }
.workspace-chip strong, .workspace-chip small { display: block; overflow: hidden; text-overflow: ellipsis; }
.workspace-chip strong { color: var(--text-ivory); font-size: .74rem; white-space: nowrap; }
.workspace-chip small { margin-top: .18rem; color: var(--text-ivory-dim); font-size: .56rem; white-space: nowrap; }
.workspace-chip .maturity { grid-column: 1 / -1; justify-self: start; }

.workspace-hero-grid, .score-grid, .integration-grid, .plan-grid { display: grid; gap: .8rem; }
.workspace-hero-grid { grid-template-columns: 1.3fr .7fr; }
.integration-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.plan-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.score-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.integration-card, .work-item, .plan-card, .score-card, .user-record, .access-record {
  border: 1px solid var(--line-dark);
  border-radius: var(--radius);
  background: var(--bg-dark-raised);
}
.integration-card { padding: 1rem; }
.integration-card header, .work-item > header, .plan-card > div:first-child, .user-record, .access-record {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem;
}
.integration-card h3, .work-item h3, .plan-card h3 { margin: 0; font-size: .96rem; color: var(--text-ivory); }
.integration-card p, .work-item p, .plan-card p { color: var(--text-ivory-dim); font-size: .76rem; }
.integration-card code, .work-item code, .plan-card code { color: var(--gold-deep); overflow-wrap: anywhere; font-size: .62rem; }
.integration-card form { margin-top: .9rem; }

.work-item { padding: 1rem; }
.work-item + .work-item { margin-top: .6rem; }
.work-item .record-actions { margin-top: .8rem; }
.work-item dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; margin: .75rem 0 0; }
.work-item dl div { padding: .5rem; border: 1px solid var(--line-dark); border-radius: var(--radius-sm); }
.work-item dt { color: var(--text-muted-lt); font-size: .52rem; text-transform: uppercase; }
.work-item dd { margin: .18rem 0 0; font-size: .7rem; color: var(--text-ivory); }

.score-card { min-height: 140px; padding: 1.1rem; display: grid; align-content: space-between; }
.score-card > span { color: var(--text-muted-lt); font-size: .64rem; text-transform: uppercase; letter-spacing: .08em; }
.score-card > strong { font-family: var(--serif); font-size: 2.2rem; color: var(--gold-soft); font-weight: 700; }
.score-card-primary { border-color: var(--gold-deep); background: linear-gradient(145deg, rgba(160,120,40,.15), var(--bg-dark-raised)); }
.score-bar { height: 5px; overflow: hidden; border-radius: 99px; background: var(--bg-dark); }
.score-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold-deep), var(--gold-soft)); }

/* Proof gate strip */
.proof-gate-strip { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: .4rem; }
.proof-gate-strip article { min-height: 88px; padding: .6rem; border: 1px solid var(--line-dark); border-radius: var(--radius-sm); background: var(--bg-dark-panel); }
.proof-gate-strip article.is-complete { border-color: rgba(76,175,125,.3); }
.proof-gate-strip span { color: var(--gold); font-family: var(--serif); font-weight: 700; }
.proof-gate-strip strong { display: block; margin-top: .32rem; font-size: .62rem; color: var(--text-ivory); }

.plan-card { padding: 1rem; }
.plan-card > ol { margin: 1rem 0; padding: 0; list-style: none; display: grid; gap: .5rem; }
.plan-card > ol li { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; align-items: center; gap: .6rem; padding: .6rem; border: 1px solid var(--line-dark); border-radius: var(--radius-sm); }
.plan-card > ol li > span { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: rgba(201,151,58,.1); color: var(--gold); font-family: var(--serif); font-weight: 700; }
.plan-card > ol strong, .plan-card > ol small { display: block; }
.plan-card > ol strong { color: var(--text-ivory); font-size: .84rem; }
.plan-card > ol small { color: var(--text-ivory-dim); font-size: .62rem; }

.user-record, .access-record { padding: 1rem; }
.user-record strong, .user-record span, .access-record strong, .access-record span { display: block; }
.user-record strong, .access-record strong { color: var(--text-ivory); }
.user-record span, .access-record span { margin-top: .18rem; color: var(--text-ivory-dim); font-size: .68rem; }
.access-record p { color: var(--text-ivory-dim); font-size: .84rem; }

.system-card-actions { align-items: center; flex-wrap: wrap; gap: .55rem; }
.system-card-actions .workspace-link { color: var(--gold); }
.system-grid-all { align-items: stretch; }

.evidence-json { max-height: 520px; margin: 0; padding: 1rem; overflow: auto; border: 1px solid var(--line-dark); border-radius: var(--radius); background: var(--bg-dark); color: var(--gold-deep); font-size: .66rem; line-height: 1.65; white-space: pre-wrap; overflow-wrap: anywhere; }

/* Definition list */
.definition-list { margin: 0; }
.definition-list div { padding: .7rem 0; border-bottom: 1px solid var(--line-dark); display: grid; grid-template-columns: 180px 1fr; gap: 1rem; }
.definition-list dt { color: var(--text-muted-lt); font-size: .65rem; text-transform: uppercase; letter-spacing: .08em; padding-top: .1rem; }
.definition-list dd { margin: 0; color: var(--text-ivory); font-size: .84rem; }

/* Network / case footnotes */
.audit-stream .audit-node { background: var(--gold); }
.form-note { font-size: .72rem; color: var(--text-ivory-dim); margin-top: .5rem; }
.inline-details[open] { padding: .75rem; border: 1px solid var(--line-dark); border-radius: var(--radius); background: var(--bg-dark-raised); }
.inline-details .institutional-form { margin-top: .65rem; }
.permit-reconcile > summary, .inline-details > summary { cursor: pointer; color: var(--gold); font-weight: 700; font-size: .84rem; }
button:disabled { opacity: .42; cursor: not-allowed; filter: none; box-shadow: none; }

/* ──────────────────────────── Portfolio topology ──────────────────────────── */
.portfolio-topology { width: 100%; padding: 1.1rem; border: 1px solid var(--gold-border); border-radius: var(--radius-lg); background: var(--bg-dark); box-shadow: var(--shadow-dark); }
.portfolio-topology-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; padding: .3rem .2rem 1rem; border-bottom: 1px solid var(--line-dark-s); }
.portfolio-topology-head > span { color: var(--gold-soft); font-family: var(--serif); font-size: 1.2rem; font-weight: 700; }
.portfolio-topology-head > strong { max-width: 11rem; color: var(--green); font-size: .6rem; line-height: 1.45; letter-spacing: .09em; text-align: right; text-transform: uppercase; }
.portfolio-topology section { display: grid; grid-template-columns: minmax(140px, .72fr) minmax(0, 1.28fr); gap: .75rem; padding: .7rem .2rem; border-bottom: 1px solid rgba(201,151,58,.1); }
.portfolio-topology section > div { display: grid; align-content: start; gap: .12rem; }
.portfolio-topology section > div > span { color: var(--text-muted-lt); font-size: .65rem; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.portfolio-topology section > div > small { color: var(--text-ivory-dim); font-size: .56rem; }
.portfolio-topology ul { display: flex; flex-wrap: wrap; gap: .32rem; margin: 0; padding: 0; list-style: none; }
.portfolio-topology li a { display: inline-flex; min-height: 30px; align-items: center; padding: .3rem .5rem; border: 1px solid var(--line-dark); border-radius: var(--radius-sm); color: var(--text-ivory-dim); font-size: .63rem; font-weight: 750; transition: border-color .15s, color .15s; }
.portfolio-topology li a:hover { border-color: var(--gold-border); color: var(--gold-soft); }
.portfolio-topology > p { margin: .85rem .2rem .12rem; color: var(--text-muted-lt); font-size: .62rem; line-height: 1.55; }

/* Context card */
.context-card { width: min(100%, 420px); margin-left: auto; padding: 1.2rem 1.3rem; display: grid; gap: .25rem; border: 1px solid var(--gold-border); border-radius: var(--radius); background: var(--bg-dark-panel); box-shadow: var(--shadow-dark-sm); }
.context-card > span { color: var(--text-muted-lt); font-size: .58rem; font-weight: 850; letter-spacing: .11em; text-transform: uppercase; }
.context-card > strong { color: var(--text-ivory); font-family: var(--serif); font-size: 1.4rem; font-weight: 700; line-height: 1.2; }
.context-card > small { color: var(--gold); font-size: .7rem; letter-spacing: .03em; }

.private-shell .section { padding-block: 2.25rem; }
.private-shell .page-hero-compact .page-hero-inner { min-height: 340px; padding-block: 3.5rem; }

/* ──────────────────────────── Responsive ──────────────────────────── */
@media (max-width: 1400px) {
  .workspace-compact-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .integration-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .console-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 1220px) {
  .primary-nav { gap: 1.2rem; }
  .primary-nav a { font-size: .74rem; }
  .page-hero-inner { grid-template-columns: 1fr 400px; gap: 2.5rem; }
  .system-grid-all { grid-template-columns: repeat(3, 1fr); }
  .proof-grid { grid-template-columns: repeat(4, 1fr); }
  .plane-grid { grid-template-columns: repeat(3, 1fr); }
  .timeline { grid-template-columns: repeat(3, 1fr); row-gap: 2rem; }
  .case-stepper { grid-template-columns: repeat(5, 1fr); }
  .overview-grid { grid-template-columns: repeat(2, 1fr); }
  .console-metrics.compact { grid-template-columns: repeat(3, 1fr); }
  .learning-list dl { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 980px) {
  .site-header { z-index: 1200; }
  body.nav-open { overflow: hidden; }
  .header-inner { grid-template-columns: auto auto 1fr; gap: 1rem; padding: 0 1.25rem; }
  .nav-toggle { display: block; }
  .mobile-nav-backdrop[hidden] { display: none; }
  .mobile-nav-backdrop:not([hidden]) {
    display: block; position: fixed; inset: 0; z-index: 1198;
    background: rgba(10,8,5,.82); backdrop-filter: blur(7px);
  }
  .primary-nav {
    display: flex; position: fixed;
    inset: 0 0 0 auto;
    width: min(92vw, 400px); height: 100dvh;
    padding: max(1rem, env(safe-area-inset-top)) 1.25rem max(1.25rem, env(safe-area-inset-bottom));
    z-index: 1199; flex-direction: column; align-items: stretch; gap: .2rem;
    overflow-y: auto; overscroll-behavior: contain;
    background: #0a0805;
    border-left: 1px solid rgba(201,151,58,.3);
    box-shadow: -24px 0 60px rgba(0,0,0,.6);
    transform: translateX(105%); visibility: hidden; pointer-events: none;
    transition: transform .22s ease, visibility .22s step-end;
  }
  .primary-nav.is-open { transform: translateX(0); visibility: visible; pointer-events: auto; transition: transform .22s ease, visibility 0s; }
  .primary-nav > a { padding: .85rem .75rem; border-bottom: 1px solid var(--line-dark); color: var(--text-ivory-dim); font-size: .9rem; }
  .mobile-nav-head { display: flex; min-height: 50px; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: .35rem; padding-bottom: .75rem; border-bottom: 1px solid var(--line-dark-s); color: var(--gold-soft); font-family: var(--serif); font-size: 1rem; font-weight: 700; }
  .mobile-nav-head .icon-button { display: grid; font-size: 1.6rem; }
  .mobile-nav-actions { display: grid; gap: .6rem; margin-top: auto; padding-top: 1.25rem; }
  .mobile-nav-actions .button { width: 100%; justify-content: center; padding: .85rem 1rem; }
  .mobile-nav-actions .button-gold { color: var(--text-ivory); }
  .header-actions { justify-self: end; }
  .header-actions .icon-button, .header-actions .button-quiet { display: none; }
  .page-hero-inner { min-height: auto; grid-template-columns: 1fr; padding: 5rem 0; }
  .hero-aside { max-width: 640px; width: 100%; }
  .metric-rail { grid-template-columns: repeat(3, 1fr); margin-top: 1rem; }
  .metric-rail > div:nth-child(3) { border-right: 0; }
  .metric-rail > div:nth-child(-n+3) { border-bottom: 1px solid var(--gold-border); }
  .section-split, .architecture-strip, .truth-panel, .system-story, .release-state, .form-layout { grid-template-columns: 1fr; gap: 2rem; }
  .system-grid, .system-grid-all { grid-template-columns: repeat(2, 1fr); }
  .proof-grid { grid-template-columns: repeat(2, 1fr); }
  .invariant-grid, .invariant-list, .gate-grid, .test-grid, .operating-grid { grid-template-columns: repeat(2, 1fr); }
  .layer-grid { grid-template-columns: repeat(2, 1fr); }
  .workflow-steps { grid-template-columns: repeat(2, 1fr); }
  .three-column { grid-template-columns: 1fr; }
  .plane-grid { grid-template-columns: repeat(2, 1fr); }
  .cta-panel { grid-template-columns: 1fr; padding: 2.5rem; }
  .footer-grid { grid-template-columns: 2fr 1fr 1fr; }
  .footer-grid > div:last-child { grid-column: 2 / 4; }
  .auth-page { grid-template-columns: 1fr; gap: 3rem; }
  .auth-panel { max-width: 580px; }
  .console-grid, .console-grid-main, .case-layout, .case-overview { grid-template-columns: 1fr; }
  .sticky-panel { position: static; }
  .case-stepper { grid-template-columns: repeat(5, 1fr); }
  .filter-panel { grid-template-columns: 1fr 1fr; }
  .scope-grid { grid-template-columns: repeat(2, 1fr); }
  .audit-verification dl { grid-template-columns: 1fr; }
  .audit-verification div { border-right: 0; border-bottom: 1px solid var(--line-dark); }
  .console-nav { overflow-x: auto; scrollbar-color: var(--gold-deep) var(--bg-dark); }
  .console-nav-inner { min-width: max-content; flex-wrap: nowrap; padding-inline: 1rem; }
  .workspace-hero-grid, .score-grid, .plan-grid { grid-template-columns: 1fr 1fr; }
  .proof-gate-strip { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .orbit { width: min(100%, 480px); }
  .context-card { margin-left: 0; }
  .two-column { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .workspace-compact-grid, .integration-grid, .workspace-hero-grid, .score-grid, .plan-grid { grid-template-columns: 1fr; }
  .proof-gate-strip { display: flex; overflow-x: auto; padding-bottom: .5rem; }
  .proof-gate-strip article { flex: 0 0 130px; }
  .work-item dl { grid-template-columns: 1fr; }
  .console-context { align-items: flex-start; flex-direction: column; padding: .6rem 0; }
  .console-context > div strong::after { content: none; }
  .plan-card > ol li { grid-template-columns: 28px minmax(0, 1fr); }
  .plan-card > ol li .status { grid-column: 2; justify-self: start; }
}

@media (max-width: 680px) {
  body { font-size: 15px; }
  .section, .section-narrow, .console-page, .page-hero-inner, .footer-grid, .footer-bottom, .cta-panel, .auth-page { width: min(100% - 2rem, var(--container)); }
  .header-inner { min-height: 66px; padding: 0 1rem; }
  .brand strong { font-size: .78rem; }
  .brand small { display: none; }
  .brand-mark { width: 28px; }
  .header-actions .button-gold { display: none; }
  .primary-nav { top: 0; }
  .section { padding-block: 4rem; }
  .page-hero-inner { padding: 3rem 0; }
  h1 { font-size: clamp(2.7rem, 14vw, 4.5rem); }
  h2 { font-size: clamp(1.9rem, 9vw, 3rem); }
  .orbit { transform: scale(.93); }
  .orbit-node { min-width: 115px; padding: .55rem .65rem; }
  .orbit-node strong { font-size: .78rem; }
  .metric-rail { grid-template-columns: repeat(2, 1fr); }
  .metric-rail > div { border-right: 1px solid var(--gold-border) !important; border-bottom: 1px solid var(--gold-border); }
  .metric-rail > div:nth-child(even) { border-right: 0 !important; }
  .metric-rail > div:last-child { grid-column: 1 / -1; border-bottom: 0; border-right: 0 !important; }
  .system-grid, .system-grid-all, .proof-grid, .invariant-grid, .invariant-list, .gate-grid, .test-grid, .operating-grid, .plane-grid, .status-summary, .layer-grid { grid-template-columns: 1fr; }
  .proof-grid article { min-height: 155px; }
  .system-card { min-height: 270px; }
  .portfolio-controls { align-items: stretch; flex-direction: column; }
  .portfolio-search input { min-width: 0; }
  .workflow-steps { grid-template-columns: 1fr; }
  .timeline { grid-template-columns: 1fr; border-top: 0; border-left: 1px solid var(--gold-deep); }
  .timeline article { padding: .65rem 0 1rem 1.5rem; }
  .timeline article::before { top: 1rem; left: -5px; }
  .field-grid { grid-template-columns: 1fr; }
  .field-full { grid-column: auto; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 2rem; }
  .footer-brand { grid-column: 1 / -1; }
  .footer-grid > div:last-child { grid-column: auto; }
  .footer-bottom { flex-direction: column; }
  .console-page { padding-top: 2rem; }
  .console-page-head, .case-header, .case-title-row, .section-head, .access-head, .learning-head { align-items: flex-start; flex-direction: column; display: flex; }
  .console-metrics, .console-metrics.compact { grid-template-columns: repeat(2, 1fr); }
  .console-metric { min-height: 108px; }
  .filter-panel { grid-template-columns: 1fr; }
  .case-stepper { display: flex; overflow-x: auto; padding-bottom: .5rem; }
  .case-stepper article { flex: 0 0 125px; }
  .overview-grid { grid-template-columns: 1fr; }
  .case-overview { gap: 1.5rem; }
  .scope-grid { grid-template-columns: 1fr; }
  .learning-list dl { grid-template-columns: repeat(2, 1fr); }
  .flash { width: calc(100% - 2rem); margin: 1rem; }
  .eval-footer-strip { grid-template-columns: 1fr; }
  .eval-footer-stat + .eval-footer-stat { border-left: 0; border-top: 1px solid rgba(201,151,58,.2); }
}

@media (max-width: 480px) {
  .orbit { width: min(100%, 320px); }
  .orbit-node { min-width: 102px; padding: .44rem .52rem; }
  .console-metrics { grid-template-columns: 1fr 1fr; }
  .metric-card { min-height: 108px; padding: .95rem; }
  .private-shell .page-hero-compact .page-hero-inner { min-height: auto; padding-block: 2.5rem; }
  .context-card { width: 100%; }
  .orbit-node strong { font-size: .72rem; }
  .orbit-node span { font-size: .52rem; }
  .orbit-core strong { font-size: .78rem; }
  .orbit-core span { font-size: .4rem; text-align: center; }
}

@media (max-width: 520px) {
  .portfolio-topology-head { flex-direction: column; }
  .portfolio-topology-head > strong { max-width: none; text-align: left; }
  .portfolio-topology section { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}

@media print {
  .constitutional-bar, .site-header, .site-footer, .command-palette, .toast-region, .hero-actions, .button, .filter-panel { display: none !important; }
  body { color: #111; background: #fff; }
  .section, .console-page { width: 100%; padding: 1rem; }
  .panel, .system-card, .action-panel { break-inside: avoid; border-color: #999; background: #fff; }
  h1, h2, h3, p, td, th, dt, dd { color: #111 !important; }
}
