/* ═══════════════════════════════════════════════════════════════
   SuperEgo Systems · Design System
   ═══════════════════════════════════════════════════════════════ */

:root {
  --ivory: #faf8f3;
  --paper: #fffdfa;
  --sage: #dfeae1;
  --sage-2: #b6cbbf;
  --forest: #16362c;
  --forest-2: #244a3d;
  --slate: #11181d;
  --slate-2: #52615d;
  --lavender: #e8e3ff;
  --lavender-2: #9a8cf1;
  --line: #e6e3dc;
  --danger: #d25b57;
  --warning: #b89742;
  --success: #2f7d58;
  --shadow: 0 20px 60px rgba(17, 24, 29, 0.08);
  --radius: 8px;
  color: var(--slate);
  background: var(--ivory);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  min-width: 320px;
  margin: 0;
  background:
    radial-gradient(circle at 76% 2%, rgba(232, 227, 255, 0.42), transparent 32rem),
    linear-gradient(180deg, #fffdf9, var(--ivory));
}

.landing-page {
  background:
    radial-gradient(circle at 70% 6%, rgba(223, 234, 225, 0.72), transparent 28rem),
    linear-gradient(180deg, #fffdf9, var(--ivory));
}

button, input, textarea, select { font: inherit; }
button, a, select { touch-action: manipulation; }
a { color: inherit; text-decoration: none; }

/* ─── Shell / sidebar ─── */

.shell {
  display: grid;
  grid-template-columns: 14.5rem minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  height: 100vh;
  padding: 1.2rem;
  border-right: 1px solid var(--line);
  background: rgba(255, 253, 250, 0.84);
  backdrop-filter: blur(20px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
  letter-spacing: 0.16rem;
}

.brand strong {
  display: block;
  font-size: 0.74rem;
  line-height: 1.1;
}

.brand small {
  display: block;
  margin-top: 0.22rem;
  color: var(--slate-2);
  font-size: 0.56rem;
  letter-spacing: 0.12rem;
  text-transform: uppercase;
}

.brand-mark {
  position: relative;
  width: 2rem;
  height: 2rem;
  flex: 0 0 auto;
  border: 1.5px solid var(--slate);
  border-radius: 50%;
}

.brand-mark::after {
  position: absolute;
  inset: 0.28rem;
  border: 1.5px solid var(--slate);
  border-top-color: transparent;
  border-left-color: transparent;
  border-radius: 50%;
  content: "";
  transform: rotate(33deg);
}

.nav-list {
  display: grid;
  gap: 0.2rem;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-height: 2.25rem;
  padding: 0 0.7rem;
  border-radius: var(--radius);
  color: var(--slate-2);
  font-size: 0.82rem;
  font-weight: 650;
  transition: background 0.15s, color 0.15s;
}

.nav-link span {
  width: 1rem;
  color: var(--forest);
  text-align: center;
  font-size: 0.9rem;
}

.nav-link:hover,
.nav-link.active {
  background: color-mix(in srgb, var(--sage) 72%, white);
  color: var(--slate);
}

.health-card {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-top: auto;
  padding: 0.85rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(223, 234, 225, 0.72), rgba(255, 255, 255, 0.76));
}

.health-card strong,
.health-card small { display: block; }
.health-card strong { font-size: 0.78rem; }
.health-card small { margin-top: 0.15rem; color: var(--slate-2); font-size: 0.68rem; }

.pulse, .status-dot {
  width: 0.6rem;
  height: 0.6rem;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 0 rgba(47, 125, 88, 0.35);
  animation: pulse 2.4s infinite;
}

.status-dot.warning { background: var(--warning); animation: none; }

/* ─── Topbar ─── */

main { min-width: 0; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 1.5rem;
  border-bottom: 1px solid var(--line);
  background: rgba(250, 248, 243, 0.82);
  backdrop-filter: blur(20px);
}

.search-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: min(26rem, 40vw);
  height: 2.15rem;
  padding: 0 0.7rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.7);
  color: var(--slate-2);
  font-size: 0.84rem;
}

.search-wrap input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--slate);
}

.top-actions, .button-row, .filter-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.button-row.compact { gap: 0.4rem; }

/* ─── Buttons ─── */

.primary-button, .secondary-button, .ghost-button, .icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.25rem;
  border-radius: var(--radius);
  cursor: pointer;
  font-weight: 700;
  font-size: 0.82rem;
  transition: background 0.15s, border-color 0.15s;
}

.primary-button {
  padding: 0 0.9rem;
  border: 1px solid color-mix(in srgb, var(--forest) 75%, black);
  background: linear-gradient(180deg, var(--forest-2), var(--forest));
  color: white;
  box-shadow: 0 6px 16px rgba(22, 54, 44, 0.15);
}

.secondary-button, .ghost-button {
  padding: 0 0.8rem;
  border: 1px solid #cad2cc;
  background: rgba(255, 255, 255, 0.75);
  color: var(--forest);
}

.ghost-button { background: transparent; }

.icon-button {
  width: 2rem;
  height: 2rem;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.7);
  color: var(--forest);
}

.small-button {
  display: inline-flex;
  align-items: center;
  min-height: 1.65rem;
  padding: 0 0.55rem;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.7);
  color: var(--forest);
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
}

.small-button:hover { background: var(--sage); }
.small-button.danger { color: var(--danger); border-color: rgba(210, 91, 87, 0.3); }
.small-button.danger:hover { background: #fdf0ef; }
.small-button.restore { color: var(--success); border-color: rgba(47, 125, 88, 0.3); }
.small-button.restore:hover { background: #eef7f1; }

.action-buttons { display: flex; gap: 0.35rem; }

/* ─── Sections / pages ─── */

.section, .page {
  padding: 2rem clamp(1rem, 2.5vw, 2.5rem);
}

.page-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.eyebrow {
  margin: 0 0 0.5rem;
  color: color-mix(in srgb, var(--forest) 75%, var(--slate));
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.12rem;
  text-transform: uppercase;
}

h1, h2, h3, h4, p { margin-top: 0; }

h2 {
  margin-bottom: 0.4rem;
  font-size: 1.9rem;
  line-height: 1.1;
  font-weight: 640;
}

h3 { margin-bottom: 0.3rem; font-size: 1rem; }
h4 { margin: 1rem 0 0.5rem; font-size: 0.85rem; color: var(--slate-2); }

.last-updated {
  color: var(--slate-2);
  font-size: 0.72rem;
}

/* ─── Metrics ─── */

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.7rem;
  margin-bottom: 0.7rem;
}

.metric-card, .panel, .product-card, .process-strip,
.lifecycle article, dialog form {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 253, 250, 0.78);
  box-shadow: 0 8px 24px rgba(17, 24, 29, 0.05);
}

.metric-card { padding: 0.85rem; }
.metric-card small, .metric-card span, .panel p {
  color: var(--slate-2);
  font-size: 0.72rem;
}

.metric-card strong {
  display: block;
  margin: 0.2rem 0;
  font-size: 1.8rem;
  line-height: 1;
}

.metric-card.accent {
  background: linear-gradient(135deg, rgba(232, 227, 255, 0.65), rgba(255, 253, 250, 0.8));
}

.status-text { font-size: 1.1rem !important; }
.status-text.healthy { color: var(--success); }
.status-text.degraded { color: var(--warning); }

/* ─── Console grid ─── */

.console-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(18rem, 0.7fr);
  gap: 0.7rem;
}

.panel {
  position: relative;
  min-width: 0;
  padding: 0.85rem;
  overflow: hidden;
}

.panel-large { min-height: 24rem; }
.panel-wide { grid-column: 1 / -1; }

.panel-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.panel-head h3, .panel-head p { margin-bottom: 0; }

/* ─── Forms and inputs ─── */

select, input, textarea {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.76);
  color: var(--slate);
  font-size: 0.84rem;
}

select, input { min-height: 2.15rem; padding: 0 0.6rem; }

textarea {
  width: 100%;
  min-height: 18rem;
  padding: 0.85rem;
  resize: vertical;
  color: var(--forest);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.82rem;
  line-height: 1.65;
}

label {
  display: grid;
  gap: 0.3rem;
  color: var(--slate-2);
  font-size: 0.72rem;
  font-weight: 700;
}

.permit-form { display: grid; gap: 0.65rem; }

.permit-output, .simulation {
  min-height: 2.8rem;
  padding: 0.65rem 0.8rem;
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--sage) 50%, white);
  color: var(--forest);
  font-size: 0.8rem;
  margin-top: 0.65rem;
}

.permit-output {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.simulation strong { display: block; margin-bottom: 0.25rem; font-size: 0.78rem; }
.simulation p { margin-bottom: 0; font-size: 0.78rem; }
.sim-pass { background: color-mix(in srgb, var(--sage) 65%, white); }
.sim-warn { background: #fdf5e6; color: #7a5c00; }

.policy-builder {
  display: grid;
  align-content: start;
  gap: 0.4rem;
}

.policy-builder button {
  min-height: 2rem;
  padding: 0 0.6rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.72);
  cursor: pointer;
  color: var(--forest);
  font-weight: 700;
  font-size: 0.78rem;
  text-align: left;
  transition: background 0.15s;
}

.policy-builder button:hover { background: var(--sage); }

/* ─── Tables ─── */

.table-wrap { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; }

th, td {
  padding: 0.6rem 0.5rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-size: 0.78rem;
}

th {
  color: var(--slate-2);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06rem;
  text-transform: uppercase;
}

td code {
  font-size: 0.74rem;
  color: var(--forest);
  background: color-mix(in srgb, var(--sage) 40%, white);
  padding: 0.12rem 0.35rem;
  border-radius: 4px;
}

.detail-cell {
  max-width: 24rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Agent cell */
.agent-cell {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.agent-cell strong, .agent-cell small { display: block; }
.agent-cell small { color: var(--slate-2); font-size: 0.68rem; }

.status-indicator {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  flex: 0 0 auto;
}

.status-indicator.healthy { background: var(--success); }
.status-indicator.degraded { background: var(--warning); }
.status-indicator.quarantined { background: var(--danger); }
.status-indicator.offline { background: var(--slate-2); }

/* ─── Badges ─── */

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 1.3rem;
  padding: 0 0.45rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: capitalize;
  white-space: nowrap;
}

.badge.approved, .badge.healthy, .badge.active { background: var(--sage); color: var(--forest); }
.badge.passed, .badge.compliant { background: color-mix(in srgb, var(--sage) 60%, white); color: var(--forest); }
.badge.revoked, .badge.quarantined, .badge.violation { background: #f8ddd8; color: #9d302b; }
.badge.denied { background: #f8ddd8; color: #9d302b; }
.badge.warning { background: #fdf5e6; color: #7a5c00; }
.badge.expired { background: var(--line); color: var(--slate-2); }
.badge.degraded { background: #fdf5e6; color: #7a5c00; }

.kind-badge {
  display: inline-flex;
  min-height: 1.3rem;
  padding: 0 0.4rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--slate-2);
}

.tier-badge {
  display: inline-flex;
  min-height: 1.3rem;
  padding: 0 0.4rem;
  border-radius: 4px;
  font-size: 0.68rem;
  font-weight: 700;
}

.tier-sandbox { background: #f0f0f0; color: #666; }
.tier-low { background: color-mix(in srgb, var(--sage) 50%, white); color: var(--forest); }
.tier-business { background: var(--sage); color: var(--forest); }
.tier-regulated { background: var(--lavender); color: #4b3db6; }
.tier-safety-critical { background: #f8ddd8; color: #9d302b; }

.type-badge {
  display: inline-flex;
  min-height: 1.3rem;
  padding: 0 0.4rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--slate-2);
}

/* ─── Events list ─── */

.event-list { display: grid; gap: 0.4rem; }

.event-row {
  display: grid;
  grid-template-columns: 1.5rem 1fr auto;
  align-items: center;
  gap: 0.55rem;
  padding: 0.5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.54);
  transition: background 0.15s;
}

.event-row:hover { background: rgba(255, 255, 255, 0.85); }

.event-icon {
  display: grid;
  place-items: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  font-size: 0.68rem;
  font-weight: 800;
}

.event-icon.approved { background: var(--sage); color: var(--forest); }
.event-icon.passed { background: var(--lavender); color: #4b3db6; }
.event-icon.denied, .event-icon.revoked { background: #f8ddd8; color: #9d302b; }
.event-icon.expired { background: var(--line); color: var(--slate-2); }
.event-icon.quarantined { background: #f8ddd8; color: #9d302b; }

.event-row strong, .event-row small { display: block; }
.event-row strong { font-size: 0.78rem; }
.event-row small { color: var(--slate-2); font-size: 0.68rem; }
.event-row time { color: var(--slate-2); font-size: 0.68rem; }

/* ─── Alpha evidence ─── */

.proof-list,
.prep-list {
  display: grid;
  gap: 0.45rem;
}

.proof-row,
.prep-row {
  display: grid;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
  padding: 0.55rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.54);
}

.proof-row {
  grid-template-columns: 1.55rem minmax(0, 1fr) auto;
}

.prep-row {
  grid-template-columns: minmax(0, 1fr) auto;
}

.prep-list.compact {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0 0 0.75rem;
}

.prep-row.compact {
  min-height: 4rem;
}

.prep-row strong,
.prep-row small,
.proof-row strong {
  display: block;
  min-width: 0;
}

.prep-row strong,
.proof-row strong {
  overflow-wrap: anywhere;
  font-size: 0.78rem;
}

.prep-row small {
  margin-top: 0.18rem;
  color: var(--slate-2);
  font-size: 0.68rem;
  line-height: 1.45;
}

.proof-icon {
  display: grid;
  place-items: center;
  width: 1.55rem;
  height: 1.55rem;
  border-radius: 50%;
  font-size: 0.68rem;
  font-weight: 800;
}

.proof-icon.approved { background: var(--sage); color: var(--forest); }
.proof-icon.denied { background: #f8ddd8; color: #9d302b; }

.alpha-evidence-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem;
  margin-bottom: 0.75rem;
}

.alpha-summary {
  display: grid;
  gap: 0.18rem;
  min-width: 0;
  padding: 0.65rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.54);
}

.alpha-summary strong,
.alpha-summary span,
.alpha-summary small {
  min-width: 0;
  overflow-wrap: anywhere;
}

.alpha-summary strong { font-size: 0.76rem; }
.alpha-summary span { color: var(--forest); font-size: 0.82rem; font-weight: 760; }
.alpha-summary small { color: var(--slate-2); font-size: 0.68rem; }

/* ─── Agent detail drawer ─── */

.detail-drawer {
  margin-top: 0.7rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 253, 250, 0.92);
  box-shadow: var(--shadow);
}

.drawer-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.drawer-header small { color: var(--slate-2); font-size: 0.72rem; display: block; }
.drawer-header strong { font-size: 1.1rem; }

.drawer-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.4rem;
  margin: 0 0 0.75rem;
}

.drawer-stats div {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.35rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 5px;
  font-size: 0.74rem;
}

.drawer-stats dt { color: var(--slate-2); }
.drawer-stats dd { margin: 0; font-weight: 700; }

.drawer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.76rem;
}

.drawer-row:last-child { border-bottom: 0; }
.muted { color: var(--slate-2); font-size: 0.76rem; }

/* ─── Topology ─── */

.topology-panel {
  background: radial-gradient(circle at 50% 40%, rgba(47, 125, 88, 0.12), transparent 28rem), var(--slate);
  color: #f7faf6;
}

.topology-panel .panel-head p,
.topology-panel select { color: #cad7cf; }

.topology-panel select {
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.08);
  color: #f7faf6;
}

canvas { display: block; max-width: 100%; }

/* ─── Toast notifications ─── */

.toast-container {
  position: fixed;
  top: 4rem;
  right: 1rem;
  z-index: 100;
  display: grid;
  gap: 0.4rem;
  pointer-events: none;
}

.toast {
  padding: 0.6rem 1rem;
  border-radius: var(--radius);
  background: var(--slate);
  color: white;
  font-size: 0.78rem;
  font-weight: 600;
  opacity: 0;
  transform: translateX(1rem);
  transition: opacity 0.3s, transform 0.3s;
  pointer-events: auto;
}

.toast.show { opacity: 1; transform: translateX(0); }
.toast-success { background: var(--forest); }
.toast-warning { background: #7a5c00; }
.toast-error { background: var(--danger); }

/* ─── Footer (portal) ─── */

footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.5rem clamp(1rem, 2.5vw, 2.5rem);
  color: var(--slate-2);
  font-size: 0.76rem;
}

footer a { font-weight: 700; }
footer div { display: flex; gap: 1rem; font-weight: 700; }

.hidden { display: none !important; }

/* ═══════════════════════════════════════════════════════════════
   LANDING PAGE
   ═══════════════════════════════════════════════════════════════ */

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  padding: 1.2rem clamp(1rem, 4vw, 4.2rem);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 253, 250, 0.82);
  backdrop-filter: blur(20px);
}

.site-nav, .site-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.site-actions { justify-content: flex-end; }

.site-nav a {
  color: var(--slate-2);
  font-size: 0.84rem;
  font-weight: 700;
}

.site-nav a:hover { color: var(--forest); }

.landing-hero {
  display: grid;
  grid-template-columns: minmax(24rem, 0.9fr) minmax(30rem, 1.1fr);
  align-items: center;
  gap: 2rem;
  min-height: clamp(38rem, calc(100svh - 9rem), 46rem);
  padding: 2rem clamp(1rem, 4vw, 4.2rem);
  border-bottom: 1px solid var(--line);
}

.landing-copy h1 { max-width: 16ch; }

h1 {
  max-width: 16ch;
  margin-bottom: 1.25rem;
  font-size: 4.25rem;
  line-height: 1;
  font-weight: 650;
}

.hero-kicker {
  margin-bottom: 0.95rem;
  color: var(--forest) !important;
  font-size: 1.05rem;
  font-weight: 850;
}

.landing-copy p:not(.eyebrow) {
  max-width: 40rem;
  color: var(--slate-2);
  line-height: 1.75;
}

.landing-visual {
  position: relative;
  min-height: 30rem;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.78), rgba(223, 234, 225, 0.22));
  box-shadow: var(--shadow);
}

.landing-visual canvas { width: 100%; height: 100%; min-height: 30rem; }

.assurance-list {
  position: absolute;
  right: 1.2rem;
  top: 1.2rem;
  display: grid;
  gap: 0.75rem;
  width: min(23rem, calc(100% - 2.4rem));
}

.assurance-list article {
  display: grid;
  grid-template-columns: 2.4rem 1fr;
  gap: 0 0.85rem;
  padding: 0.9rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.76);
  backdrop-filter: blur(14px);
}

.assurance-list span {
  grid-row: span 2;
  display: grid;
  place-items: center;
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 50%;
  background: var(--sage);
  color: var(--forest);
}

.assurance-list small { color: var(--slate-2); }

.trust-strip {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.2rem clamp(1rem, 4vw, 4.2rem);
  border-bottom: 1px solid var(--line);
  color: var(--slate-2);
  font-size: 0.8rem;
  font-weight: 650;
  letter-spacing: 0.04rem;
  text-align: center;
}

.positioning-strip {
  padding: 1.6rem clamp(1rem, 4vw, 4.2rem);
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--sage) 34%, white);
}

.positioning-strip p {
  max-width: 64rem;
  margin: 0 auto;
  color: var(--forest);
  font-size: clamp(0.95rem, 1.35vw, 1.12rem);
  line-height: 1.75;
  text-align: center;
}

.landing-section { padding-inline: clamp(1rem, 4vw, 4.2rem); }

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.section-heading.centered {
  display: block;
  text-align: center;
}

.section-heading.centered h2,
.section-heading.centered p { margin-inline: auto; }

.section-heading.centered > p:not(.eyebrow) {
  max-width: 48rem;
  color: var(--slate-2);
  line-height: 1.7;
}

.section-heading p, .split p {
  max-width: 42rem;
  color: var(--slate-2);
  line-height: 1.7;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 2rem;
}

.product-card { padding: 2rem; }

.product-card .orb {
  display: grid;
  place-items: center;
  width: 3.5rem;
  height: 3.5rem;
  margin-bottom: 1.5rem;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--sage);
  color: var(--forest);
  font-weight: 820;
}

.product-card.compass .orb { background: color-mix(in srgb, var(--sage) 70%, white); }
.product-card.host .orb { background: var(--lavender); }

.product-card p, .product-card li { color: var(--slate-2); line-height: 1.6; }

.product-card ul { display: grid; gap: 0.55rem; margin: 1.3rem 0 0; padding: 0; list-style: none; }
.product-card li::before { margin-right: 0.5rem; color: var(--success); content: "✓"; }

.process-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1rem;
  padding: 1rem 1.2rem;
  color: var(--forest);
  font-weight: 760;
}

.house-authority {
  display: grid;
  grid-template-columns: minmax(16rem, 0.72fr) minmax(20rem, 1.28fr);
  gap: 1rem;
  align-items: center;
  margin-top: 1rem;
  padding: 1.4rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 253, 250, 0.78);
  box-shadow: var(--shadow);
}

.house-authority h3 {
  max-width: 28rem;
  margin-bottom: 0;
}

.house-authority p:not(.eyebrow) {
  margin: 0;
  color: var(--slate-2);
  line-height: 1.7;
}

.evidence-band {
  display: grid;
  grid-template-columns: minmax(20rem, 0.7fr) minmax(30rem, 1.3fr);
  gap: 2rem;
  align-items: center;
  background: rgba(255, 253, 250, 0.62);
}

.evidence-band > div:first-child p:not(.eyebrow) {
  max-width: 34rem;
  color: var(--slate-2);
  line-height: 1.7;
}

.evidence-card {
  min-width: 0;
  padding: 1.1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 253, 250, 0.85);
  box-shadow: var(--shadow);
  overflow-x: auto;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}

.feature-grid article, .landing-cta {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 253, 250, 0.78);
  box-shadow: var(--shadow);
}

.feature-grid article { padding: 1.35rem; }

.feature-grid span {
  display: grid;
  place-items: center;
  width: 2.45rem;
  height: 2.45rem;
  margin-bottom: 1rem;
  border-radius: 50%;
  background: var(--sage);
  color: var(--forest);
}

.feature-grid p { color: var(--slate-2); line-height: 1.6; }

.split {
  display: grid;
  grid-template-columns: minmax(20rem, 0.8fr) minmax(24rem, 1.2fr);
  gap: 2rem;
  align-items: center;
}

.lifecycle {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.8rem;
}

.lifecycle article { padding: 1rem; }

.lifecycle span {
  display: inline-grid;
  place-items: center;
  width: 2.2rem;
  height: 2.2rem;
  margin-bottom: 1rem;
  border-radius: 50%;
  background: var(--forest);
  color: white;
  font-size: 0.76rem;
}

.lifecycle strong, .lifecycle small { display: block; }
.lifecycle small { margin-top: 0.35rem; color: var(--slate-2); }

.landing-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  margin: 0 clamp(1rem, 4vw, 4.2rem) 4rem;
  padding: 2rem;
}

.landing-cta p { color: var(--slate-2); }

.contact-lines {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.85rem;
  margin-top: 0.85rem;
}

.contact-lines a {
  color: var(--forest);
  font-size: 0.84rem;
  font-weight: 760;
  overflow-wrap: anywhere;
}

/* Landing dialog */
dialog {
  width: min(30rem, calc(100vw - 2rem));
  padding: 0;
  border: 0;
  background: transparent;
}

dialog::backdrop {
  background: rgba(17, 24, 29, 0.42);
  backdrop-filter: blur(6px);
}

dialog form {
  position: relative;
  display: grid;
  gap: 0.85rem;
  padding: 1.35rem;
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
}

/* ═══════════════════════════════════════════════════════════════
   DARK MODE
   ═══════════════════════════════════════════════════════════════ */

.dark-mode {
  --ivory: #101817;
  --paper: #12201d;
  --sage: #213c33;
  --sage-2: #5f8572;
  --forest: #dfeae1;
  --forest-2: #b6cbbf;
  --slate: #f7faf6;
  --slate-2: #b9c7c0;
  --lavender: #292640;
  --line: rgba(255, 255, 255, 0.11);
  color: var(--slate);
  background: #101817;
}

.dark-mode body {
  background:
    radial-gradient(circle at 76% 2%, rgba(41, 38, 64, 0.36), transparent 32rem),
    linear-gradient(180deg, #101817, #0d1413);
}

.dark-mode .sidebar,
.dark-mode .topbar,
.dark-mode .metric-card,
.dark-mode .panel,
.dark-mode .product-card,
.dark-mode .process-strip,
.dark-mode .lifecycle article,
.dark-mode dialog form,
.dark-mode .detail-drawer {
  background: rgba(18, 32, 29, 0.82);
}

.dark-mode input,
.dark-mode select,
.dark-mode textarea,
.dark-mode .secondary-button,
.dark-mode .ghost-button,
.dark-mode .icon-button,
.dark-mode .small-button,
.dark-mode .event-row,
.dark-mode .proof-row,
.dark-mode .prep-row,
.dark-mode .alpha-summary,
.dark-mode .policy-builder button {
  background: rgba(255, 255, 255, 0.05);
  color: var(--slate);
}

.dark-mode .small-button.danger:hover { background: rgba(210, 91, 87, 0.15); }
.dark-mode .small-button.restore:hover { background: rgba(47, 125, 88, 0.15); }
.dark-mode td code { background: rgba(255, 255, 255, 0.06); }
.dark-mode .kind-badge, .dark-mode .type-badge { border-color: rgba(255, 255, 255, 0.1); }
.dark-mode .toast { background: #1a2e28; border: 1px solid rgba(255, 255, 255, 0.1); }

.dark-mode .landing-visual {
  background: linear-gradient(145deg, rgba(18, 32, 29, 0.95), rgba(33, 60, 51, 0.46));
}

.dark-mode .assurance-list article,
.dark-mode .hero-callouts article,
.dark-mode .house-authority {
  background: rgba(18, 32, 29, 0.78);
}

/* ═══════════════════════════════════════════════════════════════
   ANIMATIONS
   ═══════════════════════════════════════════════════════════════ */

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(47, 125, 88, 0.35); }
  70% { box-shadow: 0 0 0 0.55rem rgba(47, 125, 88, 0); }
  100% { box-shadow: 0 0 0 0 rgba(47, 125, 88, 0); }
}

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════ */

@media (max-width: 1080px) {
  .shell { grid-template-columns: 1fr; }

  .sidebar {
    position: static;
    height: auto;
    flex-direction: row;
    align-items: center;
    overflow-x: auto;
    padding: 0.85rem;
  }

  .nav-list { display: flex; min-width: max-content; }
  .health-card { min-width: 10rem; margin-top: 0; }

  .landing-hero, .evidence-band, .split, .house-authority { grid-template-columns: 1fr; }
  .metrics-grid, .product-grid, .lifecycle { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .console-grid { grid-template-columns: 1fr; }
  .drawer-stats { grid-template-columns: repeat(2, 1fr); }

  .site-header { align-items: stretch; flex-wrap: wrap; }
  .site-nav { order: 3; width: 100%; overflow-x: auto; }
  .site-actions { margin-left: auto; }
  .feature-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .alpha-evidence-grid { grid-template-columns: 1fr; }
  .prep-list.compact { grid-template-columns: 1fr; }
  h1 { font-size: 3.7rem; }
}

@media (max-width: 680px) {
  .topbar, .page-heading, footer {
    align-items: stretch;
    flex-direction: column;
  }

  .search-wrap { width: 100%; }

  .metrics-grid, .product-grid, .lifecycle, .feature-grid {
    grid-template-columns: 1fr;
  }

  .site-actions {
    width: 100%;
    justify-content: stretch;
  }

  .site-actions a,
  .button-row a,
  .landing-cta > a {
    width: 100%;
  }

  h1 { font-size: 3rem; }
  h2 { font-size: 1.55rem; }

  .landing-visual, .landing-visual canvas { min-height: 39rem; }
  .process-strip, .landing-cta { align-items: start; flex-direction: column; }
  .positioning-strip p { text-align: left; }
  .drawer-stats { grid-template-columns: 1fr; }
  .proof-row,
  .prep-row {
    grid-template-columns: 1fr;
    align-items: start;
  }
  .filter-row { flex-direction: column; align-items: stretch; }
}
