/* ==========================================================================
   AmrAI Institutional Design System — Black / Metallic Gold / Crisp Ivory
   Shared across public editorial dossier (index.html) & encrypted portal
   ========================================================================== */

:root {
  /* Core Surfaces */
  --bg-void: #09090B;
  --bg-obsidian: #0D0D10;
  --bg-surface: #121216;
  --bg-elevated: #18181E;
  --bg-hover: #202028;

  /* Metallic Gold Accent System */
  --gold-primary: #D4AF37;
  --gold-bright: #E5C158;
  --gold-muted: #9E7B1C;
  --gold-tint: rgba(212, 175, 55, 0.10);
  --gold-tint-strong: rgba(212, 175, 55, 0.18);
  --gold-border: rgba(212, 175, 55, 0.30);
  --gold-border-strong: rgba(229, 193, 88, 0.55);

  /* Crisp White / Ivory Typography */
  --ink-primary: #FAFAFA;
  --ink-ivory: #F4F4F0;
  --ink-secondary: #C2C2CC;
  --ink-muted: #868694;
  --ink-dim: #5E5E6B;

  /* Hairline Borders */
  --border-subtle: rgba(250, 250, 250, 0.09);
  --border-medium: rgba(250, 250, 250, 0.16);
  --border-strong: rgba(250, 250, 250, 0.26);

  /* Semantic Statuses (Restrained Institutional Tones) */
  --status-compliant: #34D399;
  --status-compliant-bg: rgba(52, 211, 153, 0.10);
  --status-compliant-border: rgba(52, 211, 153, 0.28);

  --status-caution: #E5C158;
  --status-caution-bg: rgba(229, 193, 88, 0.12);
  --status-caution-border: rgba(229, 193, 88, 0.34);

  --status-danger: #F87171;
  --status-danger-bg: rgba(248, 113, 113, 0.10);
  --status-danger-border: rgba(248, 113, 113, 0.30);

  /* Typography */
  --font-display: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  /* Radii & Shadows */
  --radius-xs: 2px;
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 10px;
  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.5), 0 12px 32px rgba(0, 0, 0, 0.45);
  --shadow-modal: 0 24px 64px rgba(0, 0, 0, 0.85);

  /* Layout */
  --container-max: 1320px;
  --header-height: 68px;
}

/* Reset & Base */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background-color: var(--bg-void);
  color: var(--ink-primary);
  font-size: 16px;
}

body {
  margin: 0;
  padding: 0;
  background-color: var(--bg-void);
  color: var(--ink-primary);
  font-family: var(--font-sans);
  line-height: 1.6;
  overflow-x: hidden;
}

::selection {
  background: var(--gold-primary);
  color: var(--bg-void);
}

a {
  color: var(--gold-bright);
  text-decoration: none;
  transition: color 0.15s ease, border-color 0.15s ease;
}

a:hover {
  color: var(--ink-primary);
}

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

h1, h2, h3, h4 {
  margin: 0;
  font-weight: 600;
  color: var(--ink-ivory);
  letter-spacing: -0.015em;
}

p {
  margin: 0 0 1rem;
  color: var(--ink-secondary);
}

.font-display { font-family: var(--font-display); }
.font-sans { font-family: var(--font-sans); }
.font-mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ==========================================================================
   Shared Header & Navigation
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-height);
  background: rgba(9, 9, 11, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-subtle);
}

.site-header::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(212, 175, 55, 0.35), transparent);
  pointer-events: none;
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  height: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--ink-primary);
  flex-shrink: 0;
}

.brand-emblem {
  width: 34px;
  height: 34px;
  border: 1px solid var(--gold-border-strong);
  border-radius: var(--radius-sm);
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, rgba(212, 175, 55, 0.16), rgba(9, 9, 11, 0.9));
  color: var(--gold-bright);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.brand-name {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--ink-ivory);
}

.brand-domain {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--gold-primary);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  overflow-x: auto;
  scrollbar-width: none;
}

.nav-links::-webkit-scrollbar {
  display: none;
}

.nav-link {
  padding: 0.42rem 0.7rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--ink-secondary);
  white-space: nowrap;
  border-radius: var(--radius-sm);
  transition: color 0.15s ease, background-color 0.15s ease;
}

.nav-link:hover,
.nav-link.active {
  color: var(--gold-bright);
  background: var(--gold-tint);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  flex-shrink: 0;
}

.nav-mobile-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--border-medium);
  color: var(--ink-primary);
  border-radius: var(--radius-sm);
  padding: 0.45rem 0.65rem;
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: 0.8125rem;
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.56rem 1.05rem;
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.25;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease, transform 0.12s ease;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: linear-gradient(135deg, var(--gold-bright), var(--gold-primary));
  color: var(--bg-void);
  border-color: var(--gold-bright);
}

.btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #F0CF6B, var(--gold-bright));
  color: var(--bg-void);
}

.btn-outline {
  background: transparent;
  color: var(--ink-ivory);
  border-color: var(--gold-border);
}

.btn-outline:hover:not(:disabled) {
  background: var(--gold-tint);
  border-color: var(--gold-bright);
  color: var(--gold-bright);
}

.btn-ghost {
  background: transparent;
  color: var(--ink-secondary);
  border-color: var(--border-subtle);
}

.btn-ghost:hover:not(:disabled) {
  background: var(--bg-hover);
  color: var(--ink-primary);
  border-color: var(--border-medium);
}

.btn-danger {
  background: var(--status-danger-bg);
  color: var(--status-danger);
  border-color: var(--status-danger-border);
}

.btn-danger:hover:not(:disabled) {
  background: rgba(248, 113, 113, 0.18);
}

.btn-sm {
  padding: 0.36rem 0.72rem;
  font-size: 0.75rem;
}

.btn-lg {
  padding: 0.72rem 1.35rem;
  font-size: 0.875rem;
}

/* ==========================================================================
   Cards & Badges
   ========================================================================== */
.card {
  background: var(--bg-obsidian);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
}

.card-gold {
  border-color: var(--gold-border);
  background: linear-gradient(180deg, rgba(212, 175, 55, 0.05) 0%, var(--bg-obsidian) 42%);
}

.card-header {
  padding: 1.15rem 1.35rem;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.card-body {
  padding: 1.35rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-xs);
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border: 1px solid transparent;
  line-height: 1.35;
}

.badge-gold {
  background: var(--gold-tint);
  color: var(--gold-bright);
  border-color: var(--gold-border);
}

.badge-compliant {
  background: var(--status-compliant-bg);
  color: var(--status-compliant);
  border-color: var(--status-compliant-border);
}

.badge-caution {
  background: var(--status-caution-bg);
  color: var(--status-caution);
  border-color: var(--status-caution-border);
}

.badge-danger {
  background: var(--status-danger-bg);
  color: var(--status-danger);
  border-color: var(--status-danger-border);
}

.badge-neutral {
  background: rgba(250, 250, 250, 0.05);
  color: var(--ink-secondary);
  border-color: var(--border-subtle);
}

/* ==========================================================================
   Form Controls (Shared with Portal)
   ========================================================================== */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-secondary);
}

.input,
.select,
.textarea {
  width: 100%;
  background: var(--bg-surface);
  color: var(--ink-primary);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-sm);
  padding: 0.56rem 0.8rem;
  font-family: var(--font-sans);
  font-size: 0.875rem;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.input-mono {
  font-family: var(--font-mono);
}

.input:hover,
.select:hover,
.textarea:hover {
  border-color: var(--border-strong);
}

.input:focus,
.select:focus,
.textarea:focus {
  border-color: var(--gold-primary);
  background: var(--bg-elevated);
  outline: none;
}

.input::placeholder,
.textarea::placeholder {
  color: var(--ink-dim);
}

/* ==========================================================================
   Segmented Pill Tabs
   ========================================================================== */
.pill-tabs {
  display: inline-flex;
  align-items: center;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 2px;
  gap: 2px;
}

.pill-tab {
  background: transparent;
  border: none;
  color: var(--ink-muted);
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.36rem 0.78rem;
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
  white-space: nowrap;
}

.pill-tab:hover {
  color: var(--ink-primary);
}

.pill-tab.active {
  background: var(--gold-primary);
  color: var(--bg-void);
}

/* ==========================================================================
   Institutional Tables
   ========================================================================== */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--bg-obsidian);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.835rem;
  text-align: left;
}

.data-table thead th {
  position: sticky;
  top: 0;
  background: var(--bg-surface);
  color: var(--gold-bright);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  padding: 0.85rem 0.9rem;
  border-bottom: 1px solid var(--gold-border);
  white-space: nowrap;
  vertical-align: bottom;
}

.data-table thead th.sortable {
  cursor: pointer;
  user-select: none;
}

.data-table thead th.sortable:hover {
  color: var(--ink-primary);
  background: var(--bg-elevated);
}

.data-table tbody td {
  padding: 0.82rem 0.9rem;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--ink-secondary);
  vertical-align: top;
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

.data-table tbody tr:hover td {
  background: rgba(250, 250, 250, 0.025);
}

.data-table tbody tr.row-highlight td {
  background: rgba(212, 175, 55, 0.07);
}

.data-table tbody tr.row-blocked td {
  background: rgba(248, 113, 113, 0.035);
}

.num-col {
  text-align: right !important;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.cell-strong {
  color: var(--ink-ivory);
  font-weight: 600;
}

.cell-sub {
  display: block;
  font-size: 0.75rem;
  color: var(--ink-muted);
  margin-top: 0.2rem;
}

/* ==========================================================================
   Modals & Drawers (Shared with Portal)
   ========================================================================== */
.modal-backdrop,
.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 900;
  background: rgba(4, 4, 6, 0.82);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}

.modal-backdrop[hidden],
.drawer-backdrop[hidden] {
  display: none;
}

.modal {
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  background: var(--bg-obsidian);
  border: 1px solid var(--gold-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-modal);
  overflow: hidden;
}

.modal-header {
  padding: 1.1rem 1.35rem;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: var(--bg-surface);
}

.modal-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: var(--ink-ivory);
}

.modal-body {
  padding: 1.35rem;
  overflow-y: auto;
}

.modal-footer {
  padding: 1rem 1.35rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  background: var(--bg-surface);
}

.drawer-backdrop {
  justify-content: flex-end;
  padding: 0;
}

.drawer {
  width: 100%;
  max-width: 640px;
  height: 100vh;
  background: var(--bg-obsidian);
  border-left: 1px solid var(--gold-border);
  box-shadow: var(--shadow-modal);
  display: flex;
  flex-direction: column;
}

/* ==========================================================================
   Editorial Dossier Layout (index.html)
   ========================================================================== */
.hero-dossier {
  position: relative;
  padding: 4rem 0 3rem;
  border-bottom: 1px solid var(--border-subtle);
  background:
    linear-gradient(180deg, rgba(212, 175, 55, 0.04) 0%, rgba(9, 9, 11, 0) 65%),
    var(--bg-void);
}

.dossier-eyebrow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.35rem;
}

.dossier-tag {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold-bright);
  padding: 0.25rem 0.65rem;
  border: 1px solid var(--gold-border);
  background: var(--gold-tint);
  border-radius: var(--radius-xs);
}

.dossier-meta-line {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--ink-muted);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 0.9fr);
  gap: 2.5rem;
  align-items: start;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 3.6vw, 3.15rem);
  line-height: 1.12;
  font-weight: 700;
  color: var(--ink-ivory);
  margin-bottom: 1.25rem;
}

.hero-lead {
  font-size: 1.03rem;
  line-height: 1.72;
  color: var(--ink-secondary);
  max-width: 72ch;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.75rem;
}

.hero-brief-box {
  background: var(--bg-obsidian);
  border: 1px solid var(--gold-border);
  border-radius: var(--radius-md);
  padding: 1.35rem;
}

.hero-brief-title {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--gold-bright);
  padding-bottom: 0.75rem;
  margin-bottom: 0.9rem;
  border-bottom: 1px solid var(--border-subtle);
}

.brief-stat-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 0.84rem;
}

.brief-stat-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.brief-stat-label {
  color: var(--ink-muted);
}

.brief-stat-val {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--ink-ivory);
  text-align: right;
}

/* KPI Strip */
.kpi-strip {
  padding: 2rem 0;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-obsidian);
}

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

.kpi-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-top: 2px solid var(--gold-muted);
  border-radius: var(--radius-sm);
  padding: 1.05rem 1.1rem;
}

.kpi-card.kpi-featured {
  border-top-color: var(--gold-bright);
  background: linear-gradient(180deg, rgba(212, 175, 55, 0.08), var(--bg-surface) 55%);
}

.kpi-label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-muted);
  margin-bottom: 0.45rem;
}

.kpi-value {
  font-family: var(--font-mono);
  font-size: 1.42rem;
  font-weight: 700;
  color: var(--ink-ivory);
  line-height: 1.2;
}

.kpi-value.gold { color: var(--gold-bright); }
.kpi-value.green { color: var(--status-compliant); }

.kpi-sub {
  margin-top: 0.4rem;
  font-size: 0.76rem;
  color: var(--ink-secondary);
  line-height: 1.4;
}

/* Section Scaffolding */
.report-section {
  padding: 3.75rem 0;
  border-bottom: 1px solid var(--border-subtle);
}

.report-section.alt-bg {
  background: var(--bg-obsidian);
}

.section-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.section-kicker {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--gold-primary);
  margin-bottom: 0.45rem;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.55rem, 2.5vw, 2.15rem);
  color: var(--ink-ivory);
  line-height: 1.18;
}

.section-subtitle {
  max-width: 72ch;
  margin-top: 0.65rem;
  color: var(--ink-secondary);
  font-size: 0.94rem;
}

/* Editorial Prose & Callout Grids */
.editorial-two-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.editorial-three-col {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.prose-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.35rem;
}

.prose-panel h3 {
  font-family: var(--font-display);
  font-size: 1.18rem;
  color: var(--gold-bright);
  margin-bottom: 0.75rem;
}

.prose-panel p {
  font-size: 0.89rem;
  line-height: 1.68;
  margin-bottom: 0.75rem;
}

.prose-panel p:last-child {
  margin-bottom: 0;
}

.metric-inline {
  font-family: var(--font-mono);
  color: var(--ink-ivory);
  font-weight: 600;
}

/* Toolbar & Controls */
.table-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  margin-bottom: 1rem;
}

.table-search-wrap {
  position: relative;
  min-width: 240px;
  flex: 1 1 260px;
  max-width: 380px;
}

.toolbar-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
}

/* Simulator Controls */
.sim-controls-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 1rem;
  padding: 1.25rem;
  background: var(--bg-surface);
  border: 1px solid var(--gold-border);
  border-radius: var(--radius-md);
  margin-bottom: 1.5rem;
}

.sim-cap-banner {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.cap-stat {
  background: var(--bg-obsidian);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.9rem 1rem;
}

.cap-stat-label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-muted);
}

.cap-stat-value {
  font-family: var(--font-mono);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--gold-bright);
  margin-top: 0.25rem;
}

/* SVG Chart Containers */
.chart-card {
  background: var(--bg-obsidian);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.35rem;
  margin-bottom: 2rem;
}

.chart-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid var(--border-subtle);
}

.chart-title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: var(--ink-ivory);
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.76rem;
  color: var(--ink-secondary);
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.legend-swatch {
  width: 11px;
  height: 11px;
  border-radius: 2px;
  display: inline-block;
}

.chart-svg-wrap {
  width: 100%;
  overflow-x: auto;
}

.chart-svg {
  display: block;
  width: 100%;
  min-width: 720px;
  height: auto;
}

/* Risk Matrix & Clause Cards */
.clause-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.15rem;
}

.clause-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-left: 3px solid var(--gold-primary);
  border-radius: var(--radius-sm);
  padding: 1.2rem 1.3rem;
}

.clause-num {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--gold-bright);
  margin-bottom: 0.35rem;
}

.clause-title {
  font-family: var(--font-display);
  font-size: 1.08rem;
  color: var(--ink-ivory);
  margin-bottom: 0.5rem;
}

.clause-text {
  font-size: 0.86rem;
  color: var(--ink-secondary);
  line-height: 1.62;
  margin: 0;
}

/* Roadmap Steps */
.roadmap-list {
  display: grid;
  gap: 1rem;
}

.roadmap-item {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 1.25rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.25rem;
}

.roadmap-phase {
  border-right: 1px solid var(--border-subtle);
  padding-right: 1rem;
}

.roadmap-step-num {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--gold-bright);
}

.roadmap-window {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--ink-ivory);
  margin-top: 0.25rem;
}

/* Footer */
.site-footer {
  padding: 2.5rem 0 3rem;
  background: var(--bg-void);
  color: var(--ink-muted);
  font-size: 0.82rem;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1.25rem;
}

/* Citations Drawer */
.citation-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.citation-item {
  padding: 0.85rem 1rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
}

.citation-id {
  font-family: var(--font-mono);
  color: var(--gold-bright);
  font-weight: 600;
  margin-right: 0.45rem;
}

.citation-url {
  display: block;
  margin-top: 0.35rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--ink-muted);
  word-break: break-all;
}

.citation-url:hover {
  color: var(--gold-bright);
}

/* Tooltip / Notice Note */
.editorial-note {
  font-size: 0.79rem;
  color: var(--ink-muted);
  margin-top: 0.85rem;
  line-height: 1.55;
}

.tradeoff-banner {
  background: linear-gradient(90deg, rgba(212, 175, 55, 0.1), rgba(18, 18, 22, 0.95));
  border: 1px solid var(--gold-border);
  border-radius: var(--radius-md);
  padding: 1.2rem 1.35rem;
  margin-top: 1.5rem;
  font-size: 0.89rem;
  color: var(--ink-secondary);
}

.tradeoff-banner strong {
  color: var(--gold-bright);
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */
@media (max-width: 1120px) {
  .kpi-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .sim-controls-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .hero-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .nav-links {
    display: none;
  }
  .nav-links.open {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    background: rgba(9, 9, 11, 0.98);
    border-bottom: 1px solid var(--gold-border);
    padding: 0.85rem 1.5rem 1.25rem;
    z-index: 99;
  }
  .nav-mobile-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
  }
  .editorial-two-col,
  .editorial-three-col,
  .clause-grid,
  .sim-cap-banner {
    grid-template-columns: 1fr;
  }
  .roadmap-item {
    grid-template-columns: 1fr;
  }
  .roadmap-phase {
    border-right: none;
    border-bottom: 1px solid var(--border-subtle);
    padding-right: 0;
    padding-bottom: 0.75rem;
  }
}

@media (max-width: 640px) {
  .kpi-grid,
  .sim-controls-grid {
    grid-template-columns: 1fr;
  }
  .nav-actions .hide-sm {
    display: none;
  }
  .container,
  .nav-inner {
    padding: 0 1rem;
  }
}
