/**
 * CommandUI — FIDNT Sovereign Operator Surface, v3.0
 * ════════════════════════════════════════════════════════════════════
 *
 * Full-viewport command surface. 2026 design language.
 * Same class API as ProtocolUI v1 and HarmonicUI v2 — hot-swap.
 *
 * Visual language:
 *   · Full-width, edge-to-edge data tables
 *   · KPI row: large tabular numerals, gold-glow first card
 *   · Tabs: 48px, underline indicator, gold active state
 *   · Glassmorphism topbar + tabbar
 *   · Inspector: collapsible right drawer (not a permanent column)
 *   · Surface transitions: 200ms fade + lift
 *   · Status pills: small, rounded, coloured backgrounds
 *   · Live pulse on status dot
 *
 * @version 3.0.0
 * @license LicenseRef-SovereignProtocol-1.0
 */

/* ─────────────────────────────────────────────────────────────────
 * RESET
 * ───────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: .9375rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* ─────────────────────────────────────────────────────────────────
 * EXTRA TOKENS (layer on top of fidnt-tokens.css)
 * ───────────────────────────────────────────────────────────────── */
:where(:root) {
  --surface-1:    rgba(255,255,255,.028);
  --surface-2:    rgba(255,255,255,.055);
  --surface-3:    rgba(255,255,255,.085);
  --hairline:     rgba(255,255,255,.09);
  --hairline-gold:rgba(201,169,97,.22);
  --gold-glow:    rgba(201,169,97,.12);
  --pad:          clamp(1.25rem, 3vw, 2.5rem);
  --col:          1400px;
  --r-card:       10px;
  --r-pill:       999px;
}
[data-theme="light"] :where(:root) {
  --surface-1:    rgba(11,21,56,.032);
  --surface-2:    rgba(11,21,56,.065);
  --surface-3:    rgba(11,21,56,.10);
  --hairline:     rgba(11,21,56,.10);
  --hairline-gold:rgba(201,169,97,.28);
  --gold-glow:    rgba(201,169,97,.10);
}

/* ─────────────────────────────────────────────────────────────────
 * TOPBAR — 56 px, sticky, glassmorphism
 * ───────────────────────────────────────────────────────────────── */
.op-topbar {
  position: sticky; top: 0; z-index: 100;
  height: 56px;
  background: rgba(11,21,56,.93);
  backdrop-filter: blur(20px) saturate(1.5);
  -webkit-backdrop-filter: blur(20px) saturate(1.5);
  border-bottom: 1px solid var(--hairline);
  display: flex; align-items: center;
  padding: 0 var(--pad);
  gap: 1.25rem;
}

.op-topbar .crest {
  font-family: var(--serif);
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  letter-spacing: -.01em;
  flex-shrink: 0;
}
.op-topbar .crest em {
  font-style: italic;
  color: var(--gold);
  font-weight: 400;
}

.op-topbar .breadcrumbs {
  flex: 1; min-width: 0;
  display: flex; align-items: center; gap: .4rem;
  font-family: var(--mono);
  font-size: .635rem;
  color: var(--text-dim);
  letter-spacing: .1em;
  text-transform: uppercase;
  overflow: hidden;
  white-space: nowrap;
}
.op-topbar .breadcrumbs .sep { opacity: .28; }
.op-topbar .breadcrumbs .here { color: var(--gold); }

.op-topbar .topbar-actions {
  display: flex; align-items: center; gap: .35rem; flex-shrink: 0;
}
.op-topbar .pill-action {
  font-family: var(--sans);
  font-size: .74rem;
  font-weight: 500;
  padding: .38rem .85rem;
  border-radius: var(--r-pill);
  border: 1px solid var(--hairline);
  color: var(--text-muted);
  background: transparent;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex; align-items: center; gap: .3rem;
  transition: color .15s, border-color .15s, background .15s;
  white-space: nowrap;
}
.op-topbar .pill-action:hover {
  color: var(--text);
  border-color: rgba(255,255,255,.18);
  background: var(--surface-1);
}
.op-topbar .pill-action.primary {
  background: var(--gold);
  color: var(--bg);
  border-color: transparent;
  font-weight: 600;
}
.op-topbar .pill-action.primary:hover { filter: brightness(1.1); }

/* ─────────────────────────────────────────────────────────────────
 * COMMAND BAR — 44 px search strip
 * ───────────────────────────────────────────────────────────────── */
.cmd-bar {
  display: flex; align-items: center; gap: .75rem;
  height: 44px;
  padding: 0 var(--pad);
  background: var(--surface-1);
  border-bottom: 1px solid var(--hairline);
  flex-shrink: 0;
}
.cmd-bar .prompt {
  font-family: var(--mono);
  font-size: .68rem;
  color: var(--gold-dim, #9C8047);
  letter-spacing: .06em;
  user-select: none;
  flex-shrink: 0;
}
.cmd-bar input[type="text"] {
  flex: 1; min-width: 0;
  background: transparent; border: none;
  color: var(--text);
  font-family: var(--sans);
  font-size: .875rem;
  outline: none; padding: 0;
}
.cmd-bar input::placeholder {
  color: var(--text-dim);
  font-style: italic;
}
.cmd-bar .hint {
  font-family: var(--mono);
  font-size: .63rem;
  color: var(--text-dim);
  letter-spacing: .05em;
  flex-shrink: 0;
}

/* ─────────────────────────────────────────────────────────────────
 * TAB STRIP — 48 px, underline indicator
 * ───────────────────────────────────────────────────────────────── */
.op-tabs {
  position: sticky; top: 56px; z-index: 90;
  display: flex; gap: 0;
  height: 48px;
  background: rgba(11,21,56,.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--hairline);
  padding: 0 var(--pad);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.op-tabs::-webkit-scrollbar { display: none; }

.op-tab {
  flex: 0 0 auto;
  padding: 0 1.1rem;
  height: 48px;
  font-family: var(--sans);
  font-size: .8rem;
  font-weight: 500;
  letter-spacing: .01em;
  color: var(--text-dim);
  background: transparent; border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex; align-items: center; gap: .45rem;
  transition: color .15s;
}
.op-tab:hover { color: var(--text-muted); }
.op-tab.active {
  color: var(--gold);
  border-bottom-color: var(--gold);
}
.op-tab .badge {
  min-width: 18px; height: 16px; padding: 0 5px;
  font-family: var(--mono); font-size: .58rem;
  background: var(--surface-2); color: var(--text-dim);
  border-radius: var(--r-pill);
  display: inline-flex; align-items: center; justify-content: center;
}
.op-tab.active .badge { background: var(--gold-glow); color: var(--gold); }

/* ─────────────────────────────────────────────────────────────────
 * BODY — full-width, max 1400 px
 * ───────────────────────────────────────────────────────────────── */
.op-shell { min-height: 100vh; }

.op-body,
.op-body.with-side {
  display: block;
  max-width: var(--col);
  margin: 0 auto;
  padding: 2.25rem var(--pad) 5rem;
}

.op-pane {
  background: transparent;
  border: none;
  padding: 0;
}
/* Inspector is now a drawer — hide the old column */
.op-pane.inspector { display: none; }

/* ─────────────────────────────────────────────────────────────────
 * PAGE HEADER
 * ───────────────────────────────────────────────────────────────── */
.pane-eyebrow {
  font-family: var(--mono);
  font-size: .63rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--gold);
  opacity: .85;
  margin-bottom: .5rem;
  display: flex; align-items: center; gap: .5rem;
}
.pane-eyebrow::before {
  content: '';
  display: inline-block;
  width: 18px; height: 1px;
  background: currentColor;
  opacity: .6;
  flex-shrink: 0;
}

.op-pane h1 {
  font-family: var(--serif);
  font-size: clamp(2.2rem, 4vw, 3.2rem);
  font-weight: 500;
  color: var(--text);
  letter-spacing: -.04em;
  line-height: 1;
  margin: 0 0 2rem;
}
.op-pane h1 em { font-style: italic; color: var(--gold); }

.op-pane h2 {
  font-family: var(--mono);
  font-size: .68rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 1.75rem 0 .75rem;
  padding-bottom: .5rem;
  border-bottom: 1px solid var(--hairline);
}

.op-pane p {
  font-size: .9rem;
  color: var(--text-muted);
  line-height: 1.7;
  max-width: 680px;
  margin: 0 0 1.5rem;
}

/* ─────────────────────────────────────────────────────────────────
 * KPI GRID — joined cards, full row
 * ───────────────────────────────────────────────────────────────── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1px;
  background: var(--hairline);
  border: 1px solid var(--hairline);
  border-radius: var(--r-card);
  overflow: hidden;
  margin-bottom: 2.5rem;
}

.kpi {
  background: var(--surface-1);
  padding: 1.5rem 1.75rem;
  display: flex; flex-direction: column; gap: .4rem;
  transition: background .15s;
  position: relative;
}
.kpi::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity .15s;
  background: radial-gradient(ellipse at 30% 40%, rgba(255,255,255,.04), transparent 70%);
}
.kpi:hover { background: var(--surface-2); }
.kpi:hover::after { opacity: 1; }

.kpi:first-child {
  background: linear-gradient(140deg,
    rgba(201,169,97,.10) 0%,
    var(--surface-1) 60%);
}

.kpi .label {
  font-family: var(--mono);
  font-size: .62rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.kpi .value {
  font-family: var(--serif);
  font-size: clamp(1.5rem, 3vw, 2.6rem);
  font-weight: 500;
  color: var(--text);
  letter-spacing: -.03em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  word-break: break-word;
  overflow-wrap: break-word;
}
.kpi .value.gold { color: var(--gold); }
.kpi .delta {
  font-family: var(--mono);
  font-size: .63rem;
  color: var(--text-dim);
  letter-spacing: .04em;
}

/* ─────────────────────────────────────────────────────────────────
 * SECTION HEADER — seg
 * ───────────────────────────────────────────────────────────────── */
.seg {
  display: flex; align-items: center; justify-content: space-between;
  margin: 2rem 0 .75rem;
  padding-bottom: .5rem;
  border-bottom: 1px solid var(--hairline);
}
.seg > span:first-child {
  font-family: var(--mono);
  font-size: .63rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.seg .count {
  font-family: var(--mono);
  font-size: .62rem;
  color: var(--gold);
  background: var(--gold-glow);
  padding: .15rem .5rem;
  border-radius: var(--r-pill);
}

/* ─────────────────────────────────────────────────────────────────
 * TABLES
 * ───────────────────────────────────────────────────────────────── */
table.dt {
  width: 100%;
  border-collapse: collapse;
  font-size: .875rem;
  margin-bottom: 2rem;
}
table.dt thead tr { border-bottom: 1px solid var(--hairline); }
table.dt thead th {
  font-family: var(--mono);
  font-size: .6rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-dim);
  padding: .6rem 1rem;
  text-align: left;
  font-weight: 400;
  white-space: nowrap;
}
table.dt thead th.right { text-align: right; }
table.dt tbody tr {
  border-bottom: 1px solid var(--hairline);
  transition: background .1s;
}
table.dt tbody tr:hover { background: var(--surface-1); }
table.dt tbody tr.empty td {
  color: var(--text-dim);
  font-size: .82rem;
  font-style: italic;
  padding: 2.5rem 1rem;
  text-align: center;
}
table.dt td {
  padding: .875rem 1rem;
  color: var(--text);
  vertical-align: middle;
  line-height: 1.4;
}
table.dt td.code {
  font-family: var(--mono);
  font-size: .78rem;
  color: var(--text-muted);
  letter-spacing: .02em;
}
table.dt td.code.gold { color: var(--gold); }
table.dt td.muted { color: var(--text-muted); font-size: .82rem; }
table.dt td.num  { font-family: var(--mono); text-align: right; }
table.dt td.right { text-align: right; }
table.dt.dense td,
table.dt.dense th { padding: .6rem 1rem; }

/* ─────────────────────────────────────────────────────────────────
 * STATUS PILLS
 * ───────────────────────────────────────────────────────────────── */
.s-pill {
  display: inline-flex; align-items: center;
  padding: .2rem .6rem;
  border-radius: var(--r-pill);
  font-family: var(--mono);
  font-size: .62rem;
  letter-spacing: .07em;
  text-transform: uppercase;
  font-weight: 500;
  white-space: nowrap;
  border: 1px solid transparent;
}
.s-pill.ok      { color: #68c98a; background: rgba(58,122,82,.14); border-color: rgba(58,122,82,.28); }
.s-pill.fail    { color: #d97474; background: rgba(122,58,58,.14); border-color: rgba(122,58,58,.28); }
.s-pill.warn,
.s-pill.pending { color: #d4a84b; background: rgba(176,138,60,.12); border-color: rgba(176,138,60,.24); }
.s-pill.gold    { color: var(--gold); background: var(--gold-glow); border-color: var(--hairline-gold); }
.s-pill.muted   { color: var(--text-dim); background: var(--surface-2); border-color: var(--hairline); }
.s-pill.rail    { color: #74a8d9; background: rgba(58,82,122,.14); border-color: rgba(58,82,122,.28); }
.s-pill.observation { color: var(--text-dim); background: var(--surface-2); border-color: var(--hairline); }
.s-pill.active  { color: #68c98a; background: rgba(58,122,82,.14); border-color: rgba(58,122,82,.28); }
.s-pill.ready   { color: #68c98a; background: rgba(58,122,82,.14); border-color: rgba(58,122,82,.28); }
.s-pill.idle    { color: var(--text-dim); background: var(--surface-2); border-color: var(--hairline); }
.s-pill.enforcement { color: #d4a84b; background: rgba(176,138,60,.12); border-color: rgba(176,138,60,.24); }

/* ─────────────────────────────────────────────────────────────────
 * BUTTONS
 * ───────────────────────────────────────────────────────────────── */
.btn {
  font-family: var(--sans);
  font-size: .8rem;
  font-weight: 500;
  padding: .5rem 1rem;
  border-radius: 6px;
  border: 1px solid var(--hairline);
  color: var(--text-muted);
  background: var(--surface-1);
  cursor: pointer;
  transition: all .15s;
  display: inline-flex; align-items: center; gap: .4rem;
}
.btn:hover { background: var(--surface-2); color: var(--text); border-color: rgba(255,255,255,.15); }
.btn.btn-gold { background: var(--gold); color: var(--bg); border-color: transparent; font-weight: 600; }
.btn.btn-gold:hover { filter: brightness(1.08); }
.btn.btn-outline { background: transparent; border-color: var(--hairline-gold); color: var(--gold); }
.btn.btn-outline:hover { background: var(--gold-glow); }
.btn.btn-ghost { background: transparent; border-color: transparent; color: var(--text-dim); }
.btn.btn-ghost:hover { background: var(--surface-1); color: var(--text-muted); }

/* ─────────────────────────────────────────────────────────────────
 * INFO BLOCK
 * ───────────────────────────────────────────────────────────────── */
.info-block {
  background: var(--surface-1);
  border: 1px solid var(--hairline);
  border-left: 3px solid var(--gold);
  border-radius: 0 6px 6px 0;
  padding: 1rem 1.25rem;
  font-size: .875rem;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 1.75rem;
}

/* ─────────────────────────────────────────────────────────────────
 * KV GRID (detail lists)
 * ───────────────────────────────────────────────────────────────── */
.kv {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: .45rem 1.25rem;
  margin: 0;
}
.kv dt {
  font-family: var(--mono);
  font-size: .6rem;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--text-dim);
  padding-top: .1rem;
  white-space: nowrap;
  align-self: baseline;
}
.kv dd {
  color: var(--text-muted);
  margin: 0;
  font-size: .8125rem;
  word-break: break-word;
}
.kv dd.code, .kv dd code {
  font-family: var(--mono);
  font-size: .7rem;
  color: var(--gold);
  word-break: break-all;
  overflow-wrap: anywhere;
}
.kv dd.gold { color: var(--gold); }

/* ─────────────────────────────────────────────────────────────────
 * INSPECTOR DRAWER — fixed right slide-in
 * ───────────────────────────────────────────────────────────────── */
.inspector-drawer {
  position: fixed;
  top: 56px; right: 0; bottom: 0;
  width: 280px;
  background: rgba(7,13,38,.97);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-left: 1px solid var(--hairline);
  padding: 1.5rem;
  overflow-y: auto;
  z-index: 80;
  transform: translateX(100%);
  transition: transform .22s cubic-bezier(.4,0,.2,1);
  scrollbar-width: thin;
  scrollbar-color: var(--hairline) transparent;
}
body.inspector-open .inspector-drawer { transform: translateX(0); }

.inspector-drawer .pane-eyebrow { margin-bottom: .75rem; }
.inspector-drawer h1 {
  font-family: var(--serif);
  font-size: 1.45rem;
  font-weight: 500;
  color: var(--text);
  margin: 0 0 .25rem;
  letter-spacing: -.025em;
}
.inspector-drawer h2 {
  font-family: var(--mono);
  font-size: .6rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 1.5rem 0 .75rem;
  padding-bottom: .5rem;
  border-bottom: 1px solid var(--hairline);
}
.inspector-drawer p {
  font-family: var(--mono);
  font-size: .68rem;
  color: var(--text-muted);
  margin: 0 0 .75rem;
  line-height: 1.5;
}
.inspector-drawer hr.op {
  border: none;
  border-top: 1px solid var(--hairline);
  margin: 1.25rem 0;
}
.inspector-drawer .actions {
  display: flex; flex-direction: column; gap: .35rem;
  margin-top: .75rem;
}

/* ─────────────────────────────────────────────────────────────────
 * REFUSAL BLOCK
 * ───────────────────────────────────────────────────────────────── */
.refusal {
  background: var(--surface-1);
  border: 1px solid rgba(122,58,58,.28);
  border-radius: var(--r-card);
  padding: 1.5rem 1.75rem;
  margin-bottom: 1rem;
}
.refusal-code {
  font-family: var(--serif);
  font-size: 2.2rem;
  color: #d97474;
  line-height: 1;
  font-weight: 500;
  letter-spacing: -.02em;
  margin-bottom: .25rem;
}
.refusal-name {
  font-family: var(--mono);
  font-size: .68rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-dim);
}

/* ─────────────────────────────────────────────────────────────────
 * OP-FOOT — in-flow status strip
 * ───────────────────────────────────────────────────────────────── */
.op-foot {
  max-width: var(--col);
  margin: 0 auto;
  border-top: 1px solid var(--hairline);
  padding: .875rem var(--pad) 1.5rem;
  display: flex; flex-wrap: wrap; align-items: center; gap: 1.5rem;
  font-family: var(--mono);
  font-size: .6rem;
  letter-spacing: .08em;
  color: var(--text-dim);
}
.op-foot .indicator { display: inline-flex; align-items: center; gap: .35rem; }
.op-foot .dot { width: 5px; height: 5px; border-radius: 50%; flex-shrink: 0; }
.op-foot .dot.live {
  background: var(--ok, #3a7a52);
  box-shadow: 0 0 5px var(--ok, #3a7a52);
  animation: live-pulse 2.5s ease infinite;
}
@keyframes live-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: .35; }
}

/* ─────────────────────────────────────────────────────────────────
 * SURFACE TRANSITIONS
 * ───────────────────────────────────────────────────────────────── */
.surface-section { display: none; }
.surface-section.active {
  display: block;
  animation: surface-in .22s cubic-bezier(.4,0,.2,1) both;
}
@keyframes surface-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ─────────────────────────────────────────────────────────────────
 * RESPONSIVE
 * ───────────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .op-topbar { padding: 0 1rem; gap: .75rem; }
  .op-topbar .breadcrumbs { display: none; }
  .op-body, .op-body.with-side { padding: 1.5rem 1rem 4rem; }
  .op-tabs { padding: 0 1rem; }
  .op-foot { padding: .75rem 1rem 1.25rem; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .inspector-drawer { width: 100%; }
}
@media (max-width: 480px) {
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .op-tab { padding: 0 .75rem; font-size: .75rem; }
}

/* ══════════════════════════════════════════════════════════════════════
 * PEOPLE & ENTITIES — Instrument Header · CommandUI v3.0
 * ─────────────────────────────────────────────────────────────────────
 * 88px total header — 2-row instrument panel, always sticky:
 *   Row A · .screen-subnav  (48px) — screen nav left  + .cmd-rail right
 *   Row B · .id-tab-bar     (40px) — content tabs left + actions right
 *   Content · .screen-scroll       — scrolls freely (no collapse)
 *
 * Palette: #080810 void · #0F0F1A surface · #16162A card
 *          #4F6EF7 indigo · #22D3A5 trust teal
 * ══════════════════════════════════════════════════════════════════════ */

/* ── 1. Variable re-skin — FIDNT native palette */
#screen-identity, #screen-agency, #screen-govern {
  --bg:             #080810;
  --bg-primary:     #080810;
  --bg-secondary:   #0F0F1A;
  --bg-tertiary:    #16162A;
  --bg-card:        #16162A;
  --bg-hover:       #1E1E35;
  --bg-active:      #252540;
  --border:         rgba(79,110,247,.18);
  --border-subtle:  rgba(79,110,247,.08);
  --accent:         #4F6EF7;
  --accent-soft:    #3A56E0;
  --accent-muted:   rgba(79,110,247,.12);
  --accent-glow:    rgba(79,110,247,.22);
  --trust:          #22D3A5;
  --trust-soft:     rgba(34,211,165,.12);
  --warn:           #f59e0b;
  --danger:         #ef4444;
  --text-primary:   #F0EFFF;
  --text-secondary: rgba(240,239,255,.70);
  --text-muted:     rgba(240,239,255,.40);
  --text-accent:    #4F6EF7;
  --radius-sm: 0px;  --radius: 0px;
  --radius-lg: 0px;  --radius-xl: 0px;
  background: #080810;
}

/* ── 2. Kill legacy hero/context rows */
.sov-hero,
.id-anchor-card { display: none !important; }

/* ── 3. Row A: .screen-subnav — 48px command bar */
.screen-subnav {
  height: 48px;
  display: flex !important;
  align-items: stretch;
  justify-content: space-between;
  background: #0F0F1A !important;
  border-bottom: 1px solid rgba(79,110,247,.14) !important;
  padding: 0 clamp(1rem, 2.5vw, 2rem) !important;
  position: sticky; top: 0; z-index: 20;
  flex-shrink: 0; gap: 0 !important;
  overflow: hidden;
}

.subnav-tab {
  height: 48px; padding: 0 1.1rem !important;
  border: none !important; background: transparent !important;
  border-bottom: 2px solid transparent !important;
  color: rgba(240,239,255,.40) !important;
  font-family: var(--mono, 'JetBrains Mono', monospace) !important;
  font-size: .68rem !important; font-weight: 500 !important;
  letter-spacing: .08em !important; text-transform: uppercase !important;
  cursor: pointer; display: inline-flex; align-items: center;
  gap: .35rem; white-space: nowrap; border-radius: 0 !important;
  transition: color .15s, border-color .15s, background .15s;
  flex-shrink: 0;
}
.subnav-tab:hover {
  color: #F0EFFF !important;
  background: rgba(79,110,247,.06) !important;
}
.subnav-tab.active {
  color: #4F6EF7 !important;
  border-bottom-color: #4F6EF7 !important;
  background: transparent !important;
}
.subnav-icon { width: 13px; height: 13px; flex-shrink: 0; }

/* ── 4. .cmd-rail — right identity status strip inside Row A */
.cmd-rail {
  display: flex; align-items: center; gap: .4rem;
  flex-shrink: 0; margin-left: auto; padding-left: .75rem;
}
.cmd-rail-avatar {
  width: 24px; height: 24px; flex-shrink: 0;
  background: linear-gradient(135deg, #4F6EF7 0%, #22D3A5 100%);
  color: #080810; font-weight: 700; font-size: .58rem;
  display: flex; align-items: center; justify-content: center;
  letter-spacing: .03em; border-radius: 0 !important;
  border: 1px solid rgba(79,110,247,.45);
}
.cmd-rail-handle {
  font-family: var(--mono, 'JetBrains Mono', monospace) !important;
  font-size: .67rem !important; font-weight: 500 !important;
  color: rgba(240,239,255,.78) !important;
  letter-spacing: .03em; white-space: nowrap;
}
.cmd-rail-pill {
  background: rgba(79,110,247,.11) !important;
  border: 1px solid rgba(79,110,247,.28) !important;
  color: #4F6EF7 !important;
  font-family: var(--mono, 'JetBrains Mono', monospace) !important;
  font-size: .48rem !important; padding: 1px 5px !important;
  border-radius: 0 !important; letter-spacing: .08em !important;
  text-transform: uppercase !important; white-space: nowrap;
}
.cmd-rail-score {
  font-family: var(--mono, 'JetBrains Mono', monospace) !important;
  font-size: .62rem !important; font-weight: 600 !important;
  color: #22D3A5 !important; letter-spacing: .04em;
}
.cmd-rail-dot {
  width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0;
  background: #22D3A5;
  box-shadow: 0 0 5px rgba(34,211,165,.55);
}
.cmd-rail-dot.offline { background: rgba(240,239,255,.22); box-shadow: none; }
.cmd-rail-dot.pending { background: #f59e0b; box-shadow: 0 0 5px rgba(245,158,11,.5); }
.cmd-rail-badge {
  background: rgba(34,211,165,.09) !important;
  border: 1px solid rgba(34,211,165,.24) !important;
  color: #22D3A5 !important;
  font-family: var(--mono, 'JetBrains Mono', monospace) !important;
  font-size: .48rem !important; padding: 1px 5px !important;
  border-radius: 0 !important; letter-spacing: .08em !important;
  text-transform: uppercase !important; white-space: nowrap;
}
.cmd-rail-stat {
  display: flex; flex-direction: column; align-items: flex-end; gap: 0;
}
.cmd-rail-stat .v {
  font-family: var(--mono, 'JetBrains Mono', monospace) !important;
  font-size: .64rem !important; font-weight: 600 !important;
  color: #4F6EF7 !important; line-height: 1.15;
}
.cmd-rail-stat .l {
  font-family: var(--mono, 'JetBrains Mono', monospace) !important;
  font-size: .46rem !important; letter-spacing: .08em !important;
  text-transform: uppercase !important; color: rgba(240,239,255,.34) !important;
  line-height: 1.15;
}
.cmd-rail-sep {
  width: 1px; height: 14px;
  background: rgba(79,110,247,.2); flex-shrink: 0;
}

/* ── 5. Row B: .id-tab-bar — 40px content tabs */
.id-tab-bar {
  display: flex !important; align-items: stretch;
  height: 40px !important;
  background: #080810 !important;
  border-bottom: 1px solid rgba(79,110,247,.10) !important;
  padding: 0 clamp(1rem, 2.5vw, 2rem) !important;
  gap: 0 !important; flex-shrink: 0; overflow: hidden;
  position: sticky; top: 48px; z-index: 19;
}
.id-tab-left {
  display: flex; align-items: stretch;
  overflow-x: auto; scrollbar-width: none; gap: 0;
}
.id-tab-left::-webkit-scrollbar { display: none; }
.id-tab-right {
  display: flex; align-items: center; gap: .4rem;
  flex-shrink: 0; margin-left: auto; padding-left: .5rem;
}
.id-tab-btn {
  height: 40px !important; padding: 0 .9rem !important;
  border: none !important; background: transparent !important;
  border-bottom: 2px solid transparent !important;
  color: rgba(240,239,255,.36) !important;
  font-family: var(--mono, 'JetBrains Mono', monospace) !important;
  font-size: .62rem !important; font-weight: 500 !important;
  letter-spacing: .07em !important; text-transform: uppercase !important;
  cursor: pointer; white-space: nowrap; border-radius: 0 !important;
  transition: color .15s, border-color .15s; flex-shrink: 0;
}
.id-tab-btn:hover { color: #F0EFFF !important; background: rgba(79,110,247,.04) !important; }
.id-tab-btn.active { color: #22D3A5 !important; border-bottom-color: #22D3A5 !important; background: transparent !important; }

.id-action-btn {
  background: transparent !important;
  border: 1px solid rgba(79,110,247,.2) !important;
  color: rgba(240,239,255,.44) !important;
  width: 26px; height: 26px; cursor: pointer; border-radius: 0 !important;
  display: flex; align-items: center; justify-content: center;
  font-size: .75rem; flex-shrink: 0;
  transition: border-color .15s, color .15s;
}
.id-action-btn:hover { border-color: #4F6EF7 !important; color: #4F6EF7 !important; }

/* ── 6. Panels & scroll areas */
.id-panel { display: none; flex: 1; overflow-y: auto; background: #080810; }
.id-panel.active { display: block !important; }
.screen-scroll { background: #080810 !important; }

/* ── 7. Section typography */
.section-header {
  display: flex !important; align-items: baseline !important;
  justify-content: space-between !important; margin-bottom: .65rem !important;
}
.section-title {
  font-family: var(--serif, 'Cormorant Garamond', Georgia, serif) !important;
  font-size: 1.05rem !important; font-weight: 500 !important;
  color: #F0EFFF !important; letter-spacing: -.01em !important;
}
.id-field-label {
  font-family: var(--mono, 'JetBrains Mono', monospace) !important;
  font-size: .57rem !important; letter-spacing: .12em !important;
  text-transform: uppercase !important; color: rgba(240,239,255,.38) !important;
  margin-bottom: .25rem !important;
}

/* ── 8. Contact & stream rows */
.id-contact-row {
  display: flex !important; align-items: center !important; gap: .5rem !important;
  padding: .45rem 0 !important;
  border-bottom: 1px solid rgba(79,110,247,.08) !important;
  font-size: .875rem !important; color: #F0EFFF !important;
}
.id-contact-icon { color: rgba(240,239,255,.36) !important; width: 1.25rem; text-align: center; }
.id-copy-btn {
  margin-left: auto !important; background: transparent !important;
  border: 1px solid rgba(79,110,247,.18) !important;
  color: rgba(240,239,255,.34) !important;
  padding: 2px 6px !important; font-size: .65rem !important;
  cursor: pointer; border-radius: 0 !important;
}
.id-copy-btn:hover { border-color: #4F6EF7 !important; color: #4F6EF7 !important; }
.id-fid-handle {
  font-family: var(--serif, 'Cormorant Garamond', Georgia, serif) !important;
  font-size: 1.35rem !important; font-weight: 500 !important; color: #4F6EF7 !important;
  display: flex !important; align-items: center !important; gap: .5rem !important;
}
.id-stream-row {
  display: flex !important; align-items: center !important; gap: .75rem !important;
  padding: .45rem 0 !important; border-bottom: 1px solid rgba(79,110,247,.06) !important;
}
.id-stream-sym { color: #22D3A5 !important; font-size: .8rem !important; }
.id-stream-rate {
  font-family: var(--mono, 'JetBrains Mono', monospace) !important;
  font-size: .68rem !important; color: rgba(240,239,255,.44) !important;
}

/* ── 9. Square-cornered cards */
#screen-agency [style*="border-radius:12px"] {
  border-radius: 0 !important;
  background: #16162A !important;
  border: 1px solid rgba(79,110,247,.15) !important;
}
#screen-agency [style*="border-radius:12px"] > div:first-child {
  border-bottom: 1px solid rgba(79,110,247,.1) !important;
  background: transparent !important;
}
#screen-govern [style*="background:var(--bg-card)"],
#screen-govern [style*="background:var(--bg-secondary)"] {
  background: #16162A !important;
  border-color: rgba(79,110,247,.15) !important;
}

/* ── 10. Inner content columns */
#screen-agency > div > div {
  max-width: var(--col, 1400px) !important;
  padding-left:  clamp(1rem, 2.5vw, 2rem) !important;
  padding-right: clamp(1rem, 2.5vw, 2rem) !important;
}

/* ── 11. Inputs */
#screen-identity input, #screen-identity select, #screen-identity textarea,
#screen-agency   input, #screen-agency   select, #screen-agency   textarea,
#screen-govern   input, #screen-govern   select, #screen-govern   textarea {
  border-radius: 0 !important;
  background: #080810 !important;
  border-color: rgba(79,110,247,.22) !important;
  color: #F0EFFF !important;
}
#screen-identity input:focus, #screen-agency input:focus, #screen-govern input:focus {
  border-color: #4F6EF7 !important;
  outline: none !important;
  box-shadow: 0 0 0 2px rgba(79,110,247,.12) !important;
}

/* ── 13. x-badge pills */
.x-badge {
  font-family: var(--mono, 'JetBrains Mono', monospace) !important;
  font-size: .58rem !important; letter-spacing: .08em !important;
  padding: 2px 8px !important;
  background: rgba(79,110,247,.10) !important;
  border: 1px solid rgba(79,110,247,.26) !important;
  color: #4F6EF7 !important; border-radius: 0 !important;
}

/* ── 14. id-tier-pill re-skin */
.id-tier-pill {
  background: rgba(79,110,247,.12) !important;
  border: 1px solid rgba(79,110,247,.3) !important;
  color: #4F6EF7 !important;
  font-family: var(--mono, 'JetBrains Mono', monospace) !important;
  font-size: .5rem !important; padding: 1px 5px !important;
  border-radius: 0 !important; letter-spacing: .06em !important;
}

/* ── 15. Responsive */
@media (max-width: 768px) {
  .screen-subnav { padding: 0 .75rem !important; }
  .id-tab-bar    { padding: 0 .75rem !important; }
  .cmd-rail-handle,
  .cmd-rail-stat  { display: none !important; }
}

/* ── 16. Mobile — icon-only subnav */
@media (max-width: 480px) {
  .topbar-title { display: none !important; }
  .subnav-tab { padding: 0 .55rem !important; }
  .subnav-tab > :not(.subnav-icon) { display: none !important; }
  .subnav-icon { width: 15px; height: 15px; }
  .cmd-rail-handle,
  .cmd-rail-stat,
  .cmd-rail-sep { display: none !important; }
}
}
