/* ── governments.php ── */
/* Nav + polity tabs sit in normal page flow (like other public pages) and scroll away. */
.governments-page .gov-shell {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px 80px;
}
.gov-empty {
  margin-top: 40px;
  padding: 28px 22px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text-dim);
  font: .84em/1.55 "Share Tech Mono", monospace;
}
.gov-migrate-note {
  margin: 20px 0 0;
  padding: 10px 12px;
  border: 1px dashed rgba(232, 160, 32, .35);
  background: rgba(232, 160, 32, .06);
  color: var(--text-dim);
  font: .72em/1.5 "Share Tech Mono", monospace;
}
.gov-migrate-note code {
  color: var(--gold, #e8a020);
}
.gov-tabs-wrap {
  position: relative;
  z-index: 1;
  background: rgba(7, 8, 15, .96);
  border-bottom: 1px solid var(--border);
}
.gov-tabs {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(var(--gov-tab-cols, 5), minmax(0, 1fr));
  gap: 4px 6px;
  padding: 10px 16px 0;
}
.gov-tab {
  min-width: 0;
  padding: 12px 8px 14px;
  font-family: "Rajdhani", sans-serif;
  font-size: .75em;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--muted);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: color .2s ease, border-color .2s ease, background .2s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  border-radius: 4px 4px 0 0;
}
.gov-tab:hover {
  color: var(--text);
  background: rgba(136, 96, 208, .06);
}
.gov-tab.active {
  border-bottom-color: var(--tab-color, var(--purple));
  background: color-mix(in srgb, var(--tab-color, var(--purple)) 10%, transparent);
}
.gov-tab-seal {
  width: 28px;
  height: 28px;
  object-fit: contain;
  opacity: .9;
}
.gov-tab-icon { font-size: 1.15em; opacity: .7; }
.gov-tab-label {
  font-size: .9em;
  line-height: 1.25;
  text-align: center;
  text-wrap: balance;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
  max-width: 100%;
}
.gov-tab-tier {
  margin-top: 2px;
  padding: 3px 8px;
  border: 1px solid color-mix(in srgb, var(--tab-color, #8aa0b8) 45%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--tab-color, #8aa0b8) 18%, rgba(10, 12, 22, .92));
  font-family: "Rajdhani", sans-serif;
  font-size: .72em;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #e8eef6;
  line-height: 1.2;
  text-align: center;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.gov-tab.active .gov-tab-tier {
  border-color: color-mix(in srgb, var(--tab-color, #c0a0f8) 70%, transparent);
  background: color-mix(in srgb, var(--tab-color, #c0a0f8) 28%, rgba(10, 12, 22, .95));
  color: #fff;
}
.gov-tab:not(.active) .gov-tab-tier {
  color: #c5d2e0;
  border-color: rgba(138, 160, 184, .35);
  background: rgba(20, 24, 36, .9);
}
.gov-panel {
  display: none;
  padding-top: 40px;
}
.gov-panel.active { display: block; }
.gov-intro-compact {
  padding: 14px 18px;
  margin-bottom: 12px;
  gap: 14px;
}
.gov-intro-compact .gov-intro-seal {
  width: 52px;
  height: 52px;
}
.gov-intro-compact h2 {
  font-size: 1.15em;
  margin-bottom: 2px;
}
.gov-intro-compact .gov-summary {
  margin: 0;
  font-size: .78em;
}
.gov-intro {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 22px 24px;
  position: relative;
  margin-bottom: 28px;
}
.gov-intro::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--intro-color, var(--purple)), transparent);
}
.gov-intro-seal {
  flex: 0 0 64px;
  width: 64px;
  height: 64px;
  border-radius: 4px;
  border: 1px solid;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  color: var(--intro-color, var(--purple-hi));
  font-size: 1.4em;
}
.gov-intro-seal img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.gov-intro-text h2 {
  margin: 0 0 10px;
  font-family: "Rajdhani", sans-serif;
  font-size: 1.35em;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  text-wrap: balance;
}
.gov-power-tier {
  display: inline-block;
  margin: -2px 0 14px;
  padding: 4px 10px;
  border: 1px solid color-mix(in srgb, var(--intro-color, #c0a0f8) 55%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--intro-color, #c0a0f8) 22%, rgba(10, 12, 22, .95));
  font-family: "Rajdhani", sans-serif;
  font-size: .9em;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #f2f6fb;
}
.gov-summary {
  margin: 0;
  max-width: 70ch;
  color: var(--text-dim);
  font: .84em/1.65 "Share Tech Mono", monospace;
}
.gov-summary-muted { opacity: .72; font-style: italic; }
.gov-body-block,
.gov-institutions,
.gov-relations,
.gov-governance {
  margin-bottom: 32px;
}
.gov-body-block {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 22px 24px;
}
.gov-governance-stub {
  padding: 20px 18px;
  border: 1px dashed var(--border);
  border-radius: 6px;
  background: rgba(255,255,255,.02);
  text-align: center;
}
.gov-governance-stub strong {
  display: block;
  font-family: "Rajdhani", sans-serif;
  font-size: .95em;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--silver-hi);
  margin-bottom: 8px;
}
.gov-governance-stub p {
  margin: 0;
  color: var(--text-dim);
  font: .8em/1.65 "Share Tech Mono", monospace;
}
.gov-lead-status {
  display: inline-block;
  margin-top: 8px;
  font-family: "Rajdhani", sans-serif;
  font-size: .72em;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}
.gov-lead-status.tone-teal { color: var(--teal); }
.gov-lead-status.tone-gold { color: var(--gold-hi, #f0c060); }
.gov-lead-status.tone-amber { color: var(--gold, #e8a020); }
.gov-lead-status.tone-muted { color: var(--muted); }
.gov-block-label {
  font-family: "Rajdhani", sans-serif;
  font-size: .68em;
  font-weight: 700;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.gov-body-prose {
  max-width: 72ch;
  color: var(--text-dim);
  font: .82em/1.75 "Share Tech Mono", monospace;
}
.gov-body-prose p { margin: 0 0 14px; }
.gov-body-prose p:last-child { margin-bottom: 0; }
.gov-body-prose h3,
.gov-body-prose h4,
.gov-body-prose h5 {
  margin: 22px 0 10px;
  font-family: "Rajdhani", sans-serif;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text);
  line-height: 1.3;
}
.gov-body-prose h3 { font-size: 1.15em; }
.gov-body-prose h4 { font-size: 1.05em; letter-spacing: 2.5px; color: var(--purple-hi); }
.gov-body-prose h5 { font-size: .95em; color: var(--text-dim); }
.gov-body-prose h3:first-child,
.gov-body-prose h4:first-child,
.gov-body-prose h5:first-child { margin-top: 0; }
.gov-body-prose ul {
  margin: 0 0 14px;
  padding-left: 1.2em;
}
.gov-body-prose li { margin: 0 0 6px; }
.rt-size-sm { font-size: 0.85em; }
.rt-size-md { font-size: 1em; }
.rt-size-lg { font-size: 1.2em; }
.rt-size-xl { font-size: 1.45em; line-height: 1.35; }

.gov-dossier {
  padding: 18px 20px 22px;
}
.gov-dossier-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin: 4px 0 0;
  padding: 0;
  border-bottom: 1px solid var(--border);
}
.gov-dossier-tab {
  appearance: none;
  position: relative;
  margin: 0 0 -1px;
  padding: 12px 14px 11px;
  border: none;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  font-family: "Rajdhani", sans-serif;
  font-size: .74em;
  font-weight: 700;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  cursor: pointer;
  transition: color .18s ease, border-color .18s ease, background .18s ease;
}
.gov-dossier-tab:hover {
  color: var(--silver-hi, #d8e4f0);
  background: rgba(136, 96, 208, .05);
}
.gov-dossier-tab:focus-visible {
  outline: 1px solid color-mix(in srgb, var(--intro-color, #c0a0f8) 70%, transparent);
  outline-offset: 2px;
}
.gov-dossier-tab.active {
  color: var(--intro-color, var(--purple-hi));
  border-bottom-color: var(--intro-color, var(--purple-hi));
  background: color-mix(in srgb, var(--intro-color, #c0a0f8) 8%, transparent);
}
.gov-dossier-panels { margin-top: 0; }
.gov-dossier-panel {
  display: none;
  padding: 26px 2px 8px;
}
.gov-dossier-panel.active {
  display: block;
  animation: gov-dossier-in .22s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes gov-dossier-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .gov-dossier-panel.active { animation: none; }
  .gov-dossier-tab { transition: none; }
}

/* Masthead — lore-style section chrome */
.gov-dossier-mast {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin: 0 0 28px;
}
.gov-dossier-mast-index {
  flex: 0 0 auto;
  font-family: "Rajdhani", sans-serif;
  font-size: 1.7em;
  font-weight: 700;
  letter-spacing: .08em;
  line-height: 1;
  color: color-mix(in srgb, var(--intro-color, #c0a0f8) 80%, #fff);
}
.gov-dossier-mast-copy { min-width: 0; padding-top: 2px; }
.gov-dossier-mast-eyebrow {
  margin: 0 0 6px;
  font-family: "Rajdhani", sans-serif;
  font-size: .58em;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--purple, #8860d0);
}
.gov-dossier-mast-title {
  margin: 0 0 10px;
  font-family: "Cinzel", serif;
  font-size: clamp(1.05em, 2.4vw, 1.35em);
  font-weight: 600;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--silver-hi, #d8e4f0);
  text-wrap: balance;
  line-height: 1.2;
}
.gov-dossier-mast-rule {
  width: 50px;
  height: 2px;
  background: linear-gradient(90deg, var(--intro-color, var(--purple-mid, #5030a0)), transparent);
}

/* Prose — match about/lore, no nested boxes */
.gov-dossier-prose {
  max-width: 68ch;
  margin-top: 22px;
}
.gov-dossier-prose.prose p {
  font-size: .84em;
  color: var(--text-dim);
  line-height: 2;
  margin: 0 0 14px;
}
.gov-dossier-prose.prose p:last-child { margin-bottom: 0; }
.gov-dossier-prose-lead p {
  color: var(--silver-hi, #d8e4f0);
  font-size: .9em;
  line-height: 1.9;
}
.gov-dossier-prose strong { color: var(--intro-color, var(--purple-hi)); font-weight: 600; }

.gov-dossier-fact-label {
  margin: 0 0 8px;
  font-family: "Rajdhani", sans-serif;
  font-size: .58em;
  font-weight: 700;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--purple, #8860d0);
}
.gov-dossier-fact-body {
  margin: 0;
  font: .8em/1.75 "Share Tech Mono", monospace;
  color: var(--text-dim);
}

/* Creed / pull statement */
.gov-dossier-creed {
  text-align: center;
  padding: 28px 20px 26px;
  margin: 0 0 24px;
  border: 1px solid var(--border-purple, #5a4890);
  border-radius: 6px;
  background: rgba(136, 96, 208, .05);
  position: relative;
  overflow: hidden;
}
.gov-dossier-creed::before,
.gov-dossier-creed::after {
  content: "";
  position: absolute;
  left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--intro-color, #8860d0), transparent);
}
.gov-dossier-creed::before { top: 0; }
.gov-dossier-creed::after { bottom: 0; }
.gov-dossier-creed-line {
  margin: 0 0 10px;
  font-family: "Cinzel", serif;
  font-size: clamp(.95em, 2.2vw, 1.2em);
  font-weight: 400;
  letter-spacing: 2px;
  color: var(--silver-hi, #d8e4f0);
  line-height: 1.55;
  text-wrap: balance;
}
.gov-dossier-creed-sub {
  margin: 0 auto;
  max-width: 42ch;
  font: .72em/1.8 "Share Tech Mono", monospace;
  color: var(--text-dim);
}
.gov-dossier-creed-closing {
  border-color: color-mix(in srgb, var(--intro-color, #8860d0) 45%, var(--border));
}

/* Treaty vs polity split */
.gov-dossier-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin: 0 0 8px;
}
.gov-dossier-split-col {
  padding: 18px 18px 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 4px;
  position: relative;
}
.gov-dossier-split-col::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--intro-color, var(--purple)), transparent);
}

.gov-dossier-glance { margin: 0 0 8px; }

/* Authority layout */
.gov-dossier-authority {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 16px;
  margin: 0 0 8px;
}
.gov-dossier-authority-axiom {
  padding: 22px 22px 20px;
  background: var(--card);
  border: 1px solid var(--border-purple, #5a4890);
  border-radius: 4px;
  position: relative;
  overflow: hidden;
}
.gov-dossier-authority-axiom::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--intro-color, var(--purple-mid)), var(--intro-color, var(--purple)));
}
.gov-dossier-authority-name {
  margin: 0 0 12px;
  font-family: "Cinzel", serif;
  font-size: 1.25em;
  font-weight: 600;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--intro-color, var(--purple-hi));
}
.gov-dossier-authority-side {
  display: grid;
  gap: 12px;
}
.gov-dossier-authority-chip {
  padding: 16px 16px 14px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 4px;
}
.gov-dossier-chip-title {
  margin: 0 0 8px;
  font-family: "Rajdhani", sans-serif;
  font-size: .95em;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--silver-hi, #d8e4f0);
}

/* Arrival steps */
.gov-dossier-steps {
  list-style: none;
  margin: 0 0 8px;
  padding: 0;
  display: grid;
  gap: 0;
}
.gov-dossier-step {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 14px;
  align-items: start;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
  position: relative;
}
.gov-dossier-step:last-child { border-bottom: none; }
.gov-dossier-step-num {
  font-family: "Rajdhani", sans-serif;
  font-size: 1.35em;
  font-weight: 700;
  letter-spacing: .06em;
  color: var(--intro-color, var(--purple-hi));
  line-height: 1.1;
}
.gov-dossier-step-title {
  margin: 0 0 6px;
  font-family: "Rajdhani", sans-serif;
  font-size: .88em;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--silver-hi, #d8e4f0);
}

/* Twilight Order */
.gov-dossier-note {
  margin: 0 0 18px;
  font: .78em/1.7 "Share Tech Mono", monospace;
  color: var(--text-dim);
}
.gov-dossier-note strong { color: var(--intro-color, var(--purple-hi)); font-weight: 600; }
.gov-dossier-ranks {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  margin: 0 0 20px;
  padding: 14px 16px;
  background: rgba(136, 96, 208, .05);
  border: 1px solid var(--border);
  border-radius: 4px;
}
.gov-dossier-rank {
  font-family: "Rajdhani", sans-serif;
  font-size: .82em;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--silver-hi, #d8e4f0);
  padding: 6px 10px;
  border: 1px solid color-mix(in srgb, var(--intro-color, #8860d0) 35%, var(--border));
  border-radius: 3px;
  background: color-mix(in srgb, var(--intro-color, #8860d0) 10%, transparent);
}
.gov-dossier-rank-arrow {
  color: var(--muted);
  font-size: .85em;
}
.gov-dossier-schools {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin: 0 0 8px;
}
.gov-dossier-school {
  padding: 20px 18px 18px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 4px;
  position: relative;
  overflow: hidden;
}
.gov-dossier-school::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
}
.gov-dossier-school-dusk::before {
  background: linear-gradient(90deg, #6a4a9e, transparent);
}
.gov-dossier-school-dawn::before {
  background: linear-gradient(90deg, #c0a060, transparent);
}
.gov-dossier-school-name {
  margin: 0 0 10px;
  font-family: "Cinzel", serif;
  font-size: 1.15em;
  font-weight: 600;
  letter-spacing: 3px;
  text-transform: uppercase;
}
.gov-dossier-school-dusk .gov-dossier-school-name { color: #c0a0f8; }
.gov-dossier-school-dawn .gov-dossier-school-name { color: #f0c060; }

/* Founders */
.gov-dossier-founders {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 0 0 18px;
}
.gov-dossier-founder {
  text-align: center;
  padding: 22px 14px 18px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 4px;
  position: relative;
  overflow: hidden;
}
.gov-dossier-founder::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--intro-color, var(--purple-mid)), transparent);
}
.gov-dossier-founder-icon {
  display: block;
  margin-bottom: 10px;
  color: var(--intro-color, var(--purple-hi));
  font-size: 1.1em;
  opacity: .85;
}
.gov-dossier-founder-name {
  margin: 0 0 8px;
  font-family: "Rajdhani", sans-serif;
  font-size: .9em;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--silver-hi, #d8e4f0);
}

.gov-dossier-callout {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin: 0 0 8px;
  padding: 16px 18px;
  background: rgba(136, 96, 208, .06);
  border: 1px solid var(--border-purple, #5a4890);
  border-radius: 4px;
}
.gov-dossier-callout-icon {
  flex-shrink: 0;
  color: var(--intro-color, var(--purple));
  margin-top: 2px;
}
.gov-dossier-callout p {
  margin: 0;
  font: .78em/1.8 "Share Tech Mono", monospace;
  color: var(--text-dim);
  font-style: italic;
}
.gov-institutions-lead {
  margin: -4px 0 16px;
  max-width: 56ch;
  font: .8em/1.65 "Share Tech Mono", monospace;
  color: var(--text-dim);
}

@media (max-width: 800px) {
  .gov-dossier-split,
  .gov-dossier-authority,
  .gov-dossier-schools { grid-template-columns: 1fr; }
  .gov-dossier-founders { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .gov-dossier { padding: 14px 14px 18px; }
  .gov-dossier-tab { padding: 10px 10px 9px; letter-spacing: 1.2px; font-size: .68em; }
  .gov-dossier-mast { gap: 12px; margin-bottom: 22px; }
  .gov-dossier-mast-index { font-size: 1.35em; }
  .gov-dossier-step { grid-template-columns: 40px 1fr; }
}

.gov-empty-inline {
  margin: 0;
  color: var(--muted);
  font: .8em/1.5 "Share Tech Mono", monospace;
}
.gov-inst-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}
.gov-inst-card {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  gap: 4px 14px;
  padding: 16px 16px 14px;
  text-decoration: none;
  color: inherit;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 4px;
  position: relative;
  transition: border-color .2s ease, background .2s ease;
}
.gov-inst-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--inst-color, var(--purple)), transparent);
}
.gov-inst-card:hover {
  border-color: color-mix(in srgb, var(--inst-color, var(--purple)) 45%, var(--border));
  background: rgba(15, 18, 32, .92);
}
.gov-inst-icon {
  grid-row: 1 / span 2;
  align-self: start;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  border: 1px solid color-mix(in srgb, var(--inst-color, var(--purple)) 40%, transparent);
  background: color-mix(in srgb, var(--inst-color, var(--purple)) 12%, transparent);
  color: var(--inst-color, var(--purple-hi));
  font-size: 1em;
}
.gov-inst-name {
  display: block;
  font-family: "Rajdhani", sans-serif;
  font-size: .92em;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--inst-color, var(--silver-hi));
}
.gov-inst-desc {
  display: block;
  margin-top: 4px;
  color: var(--text-dim);
  font: .74em/1.5 "Share Tech Mono", monospace;
}
.gov-inst-cta {
  grid-column: 2;
  margin-top: 8px;
  font-family: "Rajdhani", sans-serif;
  font-size: .62em;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--purple-hi, #c0a0f8);
}
.gov-rel-groups {
  display: grid;
  gap: 14px;
}
.gov-rel-group {
  padding: 12px 14px;
  border: 1px solid color-mix(in srgb, var(--rel-color, var(--purple)) 35%, var(--border));
  border-radius: 4px;
  background: color-mix(in srgb, var(--rel-color, var(--purple)) 8%, transparent);
  position: relative;
}
.gov-rel-group::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--rel-color, var(--purple)), transparent);
}
.gov-rel-group-label {
  font-family: "Rajdhani", sans-serif;
  font-size: .72em;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--rel-color, var(--purple-hi));
  margin-bottom: 8px;
}
.gov-rel-partners {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}
.gov-rel-partners a {
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
}
.gov-rel-partners a:hover { color: var(--purple-hi, #c0a0f8); }
.gov-rel-note {
  display: block;
  margin-top: 2px;
  font-size: .78em;
  color: var(--muted);
  line-height: 1.4;
}
.gov-codex-cta { margin-bottom: 28px; }
.gov-codex-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 14px;
  padding: 16px;
  text-decoration: none;
  color: inherit;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 4px;
  position: relative;
  transition: border-color .2s ease, background .2s ease;
}
.gov-codex-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--inst-color, var(--purple)), transparent);
}
.gov-codex-card:hover {
  border-color: color-mix(in srgb, var(--inst-color, var(--purple)) 45%, var(--border));
}
.gov-codex-card .gov-inst-cta { grid-column: 2; }
.gov-codex-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px 16px;
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.gov-codex-back {
  font-family: "Rajdhani", sans-serif;
  font-size: .72em;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--purple-hi, #c0a0f8);
  text-decoration: none;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}
.gov-codex-back:hover { color: var(--relay-cyan-bright, #9ad4f0); }
.gov-codex-title {
  font-family: "Rajdhani", sans-serif;
  font-size: .92em;
  font-weight: 700;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--silver-hi);
}
.gov-codex-meta {
  color: var(--muted);
  font: .68em/1.4 "Share Tech Mono", monospace;
}
.governments-page.is-codex-view .gov-shell {
  max-width: 1100px;
}
.governments-page.is-faction-view .gov-ranks-pane {
  min-height: 40vh;
}
.governments-page .gov-ranks-pane[hidden],
.governments-page .gov-overview[hidden] {
  display: none !important;
}
.governments-page.is-faction-view .gov-faction-bar {
  margin-top: 0;
}
/* Ranks UI fades rely on JS .visible — never leave an empty black panel if JS lags. */
.governments-page.is-faction-view .fade-in,
.governments-page.is-faction-view .fade-in.visible {
  opacity: 1;
  transform: none;
}
/* Institution tabs scroll with the ranks content (no sticky). */
.governments-page.is-faction-view .faction-tabs-wrap {
  position: relative;
  top: auto;
  z-index: 1;
}
.governments-page .government-codex {
  margin-top: 4px;
}
.codex-wrap-simple {
  display: block;
  max-width: 780px;
  margin: 0 auto;
}
.codex-md-body {
  padding: 8px 4px 40px;
  color: var(--text-dim);
  font: .88em/1.7 "Share Tech Mono", monospace;
}
.codex-md-body h3,
.codex-md-body h4,
.codex-md-body h5 {
  font-family: "Rajdhani", sans-serif;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--silver-hi);
  margin: 1.4em 0 .5em;
}
.codex-md-body p { margin: 0 0 1em; max-width: 68ch; }
.codex-md-body ul { margin: 0 0 1em; padding-left: 1.2em; max-width: 68ch; }
.codex-md-body li { margin-bottom: .35em; }
.codex-stub {
  padding: 28px 8px 40px;
  border: 1px dashed rgba(138, 160, 184, .28);
  border-radius: 4px;
  max-width: 62ch;
}
.codex-stub-title {
  margin: 0 0 10px;
  font-family: "Rajdhani", sans-serif;
  font-size: .95em;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--silver-hi);
}
.codex-stub p { margin: 0 0 .75em; color: var(--text-dim); font: .82em/1.6 "Share Tech Mono", monospace; }
.codex-stub-hint { color: var(--muted) !important; font-size: .75em !important; }
#codexBackToTop {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 140;
  width: 40px;
  height: 40px;
  background: var(--card);
  border: 1px solid var(--border-purple, var(--border));
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--purple-hi, #c0a0f8);
  font-size: .8em;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s, transform .25s;
  transform: translateY(8px);
}
#codexBackToTop.visible {
  opacity: 1;
  pointer-events: all;
  transform: translateY(0);
}
@media (max-width: 640px) {
  .gov-intro { flex-direction: column; }
  .gov-tabs {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    padding: 4px 8px 0;
  }
  .gov-tab { padding: 6px 4px 8px; }
}
@media (prefers-reduced-motion: reduce) {
  .gov-tab,
  .gov-inst-card,
  .gov-codex-card,
  #codexBackToTop { transition: none; }
}
