:root {
  color-scheme: dark;
  --bg: #03080d;
  --grid: rgba(40, 225, 190, .035);
  --surface: #07111a;
  --surface-2: #0a1722;
  --surface-3: #0e1e2b;
  --line: #173747;
  --line-hot: #1e6d72;
  --text: #edf8f6;
  --muted: #78929d;
  --dim: #4e6874;
  --teal: #28e1bd;
  --teal-2: #0aa98d;
  --amber: #ffc857;
  --red: #ff6577;
  --blue: #5ea8ff;
  --radius: 3px;
  --shadow: 0 22px 70px rgba(0, 0, 0, .42);
  font-family: Inter, "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: 17px;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; margin: 0; background: var(--bg); color: var(--text); }
body {
  overflow-x: hidden;
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 42px 42px;
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.ambient { position: fixed; pointer-events: none; opacity: .42; filter: blur(110px); }
.ambient-a { width: 470px; height: 250px; right: 10%; top: -140px; background: rgba(0, 210, 175, .1); }
.ambient-b { width: 420px; height: 260px; left: 20%; bottom: -170px; background: rgba(35, 100, 150, .09); }

.eyebrow, .card-kicker {
  color: var(--teal);
  font: 700 12px/1.2 Consolas, "Courier New", monospace;
  letter-spacing: .2em;
}
.muted { color: var(--muted); line-height: 1.65; }
.micro { color: var(--dim); font-size: 13px; line-height: 1.6; }
.micro span { color: var(--line-hot); padding: 0 5px; }
.pulse { width: 7px; height: 7px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 0 5px rgba(40,225,189,.08), 0 0 16px rgba(40,225,189,.75); }

/* Owner authentication */
.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(620px, 1fr) minmax(460px, 570px);
  gap: clamp(55px, 8vw, 150px);
  align-items: center;
  padding: clamp(42px, 6vw, 110px);
}
.brand-panel { max-width: 860px; }
.brand-lockup { display: flex; align-items: center; gap: 28px; }
.brand-panel h1 { margin: 10px 0 0; font-size: clamp(48px, 5.2vw, 82px); font-weight: 280; letter-spacing: .2em; line-height: .9; }
.brand-subtitle { margin: 18px 0 0; color: #b8cbd0; font: 500 15px/1 Consolas, monospace; letter-spacing: .5em; }
.brand-copy { max-width: 680px; margin: 28px 0 0; color: var(--muted); font-size: 16px; line-height: 1.8; }
.brand-mark { flex: 0 0 auto; width: 82px; height: 82px; display: grid; place-items: center; filter: drop-shadow(0 0 18px rgba(211,168,72,.14)); }
.brand-mark img { display: block; width: 100%; height: 100%; object-fit: contain; }
.brand-mark.small { width: 46px; height: 46px; margin: 0 10px 0 0; }
.auth-route { margin-top: 70px; border: 1px solid var(--line); background: rgba(5,15,23,.78); box-shadow: var(--shadow); }
.route-label, .route-readout { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; font: 700 11px/1 Consolas, monospace; letter-spacing: .14em; }
.route-label { color: var(--dim); border-bottom: 1px solid var(--line); }
.route-label strong { color: #8ba5ad; }
.route-flow { display: grid; grid-template-columns: 1fr 42px 1fr 42px 1fr; align-items: center; padding: 19px 15px; }
.route-node { border-left: 2px solid #315362; padding: 5px 10px; display: grid; gap: 4px; }
.route-node.server { border-color: var(--teal); background: linear-gradient(90deg, rgba(40,225,189,.07), transparent); }
.route-node span, .route-node small { color: var(--dim); font: 600 11px/1 Consolas, monospace; }
.route-node strong { font: 700 14px/1 Consolas, monospace; letter-spacing: .06em; }
.route-link { height: 1px; background: var(--line-hot); position: relative; }
.route-link::after { content: ""; position: absolute; right: -1px; top: -3px; border-left: 5px solid var(--line-hot); border-top: 3px solid transparent; border-bottom: 3px solid transparent; }
.route-readout { border-top: 1px solid var(--line); color: var(--dim); }
.route-readout span:first-child { color: var(--teal); display: flex; align-items: center; gap: 10px; }

.auth-card { position: relative; background: linear-gradient(145deg, rgba(10,24,35,.97), rgba(5,13,20,.98)); border: 1px solid var(--line); border-top: 2px solid var(--teal-2); border-radius: var(--radius); padding: 46px; box-shadow: var(--shadow); }
.auth-card-head { display: flex; align-items: center; gap: 12px; margin-bottom: 40px; color: var(--dim); font: 700 11px/1 Consolas, monospace; letter-spacing: .13em; }
.auth-card-head i { height: 1px; flex: 1; background: linear-gradient(90deg, var(--line-hot), transparent); }
.auth-card h2 { margin: 14px 0 11px; font-size: 36px; font-weight: 540; letter-spacing: -.02em; }
.auth-card .micro { margin: 18px 0 0; }

form label, dialog label { display: block; margin: 23px 0 10px; color: #9fb5bc; font: 700 12px/1 Consolas, monospace; letter-spacing: .1em; }
input, select, textarea { width: 100%; min-height: 50px; padding: 13px 15px; outline: none; border: 1px solid #1c3b4c; border-radius: var(--radius); background: #07131f; color: var(--text); font-size: 15px; transition: border-color .18s, box-shadow .18s; }
input:focus, select:focus, textarea:focus { border-color: var(--teal-2); box-shadow: 0 0 0 3px rgba(40,225,189,.08); }
textarea { min-height: 100px; resize: vertical; }
.password-wrap { position: relative; }
.password-wrap input { padding-right: 66px; }
.reveal-button { position: absolute; right: 8px; top: 8px; height: 34px; border: 0; background: transparent; color: var(--teal); font: 700 11px/1 Consolas, monospace; letter-spacing: .08em; }
.primary, .ghost, .text-button { min-height: 46px; border-radius: var(--radius); padding: 0 19px; font: 700 12px/1 Consolas, monospace; letter-spacing: .08em; }
.primary { border: 1px solid #2df0c9; background: linear-gradient(90deg, #24ddb8, #0ead91); color: #02100e; }
.primary:hover { filter: brightness(1.07); }
.ghost { border: 1px solid #285064; background: #081622; color: #bdd0d5; }
.ghost:hover { border-color: var(--teal-2); color: var(--teal); }
.text-button { border: 0; background: transparent; color: var(--dim); }
.wide { width: 100%; }
.auth-card .primary.wide { margin-top: 24px; }
.form-message { min-height: 21px; margin-top: 17px; color: var(--red); font-size: 14px; }

/* Console */
.console-shell { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 5; width: 280px; display: flex; flex-direction: column; padding: 28px 21px 22px; border-right: 1px solid var(--line); background: rgba(4,12,18,.97); }
.sidebar-brand { display: flex; align-items: center; min-height: 72px; padding-bottom: 24px; border-bottom: 1px solid var(--line); }
.sidebar-brand strong { display: block; font-size: 16px; letter-spacing: .2em; }
.sidebar-brand small { display: block; margin-top: 6px; color: var(--teal); font: 700 10px/1 Consolas, monospace; letter-spacing: .1em; }
.sidebar nav { display: grid; gap: 7px; margin-top: 24px; }
.nav-button { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 56px; padding: 0 16px; border: 1px solid transparent; border-radius: var(--radius); background: transparent; color: #6f8894; text-align: left; font-size: 14px; }
.nav-button span { color: #43616e; font: 700 11px/1 Consolas, monospace; }
.nav-button.active { color: var(--text); border-color: #15544f; background: rgba(21,91,80,.22); }
.nav-button.active span { color: var(--teal); }
.sidebar-footer { display: grid; gap: 12px; margin-top: auto; }
.connection-card { display: flex; align-items: center; gap: 12px; min-height: 58px; padding: 12px; border: 1px solid var(--line); background: var(--surface); }
.connection-card small, .connection-card strong { display: block; font: 700 11px/1.5 Consolas, monospace; letter-spacing: .08em; }
.connection-card small { color: var(--dim); }
.connection-card strong { color: #a8bcc3; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--red); }
.status-dot.online { background: var(--teal); box-shadow: 0 0 12px rgba(40,225,189,.7); }
.status-dot.checking { background: var(--amber); }
.hub-link { display: flex; justify-content: space-between; align-items: center; min-height: 46px; padding: 0 15px; border: 1px solid #285064; color: #bdd0d5; text-decoration: none; font: 700 11px/1 Consolas, monospace; letter-spacing: .08em; }
.hub-link:hover { color: var(--teal); border-color: var(--teal-2); }

.workspace { min-height: 100vh; margin-left: 280px; padding: 0 clamp(30px, 3vw, 62px) 62px; }
.topbar { min-height: 118px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.topbar h2 { margin: 10px 0 0; font-size: 31px; font-weight: 560; }
.topbar-right { display: flex; align-items: center; gap: 26px; }
#clock { color: #58737e; font: 12px/1 Consolas, monospace; }
.owner-chip { display: flex; align-items: center; gap: 11px; }
.owner-chip > span { width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid #17655e; border-radius: 50%; color: var(--teal); font: 700 12px/1 Consolas, monospace; }
.owner-chip strong, .owner-chip small { display: block; font: 700 11px/1.5 Consolas, monospace; letter-spacing: .1em; }
.owner-chip small { color: var(--dim); font-size: 10px; }
.view-panel { padding-top: 34px; }
.global-message { margin-top: 18px; padding: 15px 17px; border-left: 3px solid var(--amber); background: rgba(255,200,87,.06); color: #d8c08a; font-size: 14px; }
.global-message.success { border-color: var(--teal); color: #9ee7d6; background: rgba(40,225,189,.06); }
.global-message.error { border-color: var(--red); color: #ff9eaa; background: rgba(255,101,119,.06); }
.form-message.success { color: var(--teal); }

.dashboard-heading, .section-heading { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.dashboard-heading { padding: 0 0 24px; }
.dashboard-heading h3, .section-heading h3 { margin: 9px 0 6px; font-size: 34px; font-weight: 540; }
.dashboard-heading p, .section-heading p { margin: 0; color: var(--muted); font-size: 15px; }
.panel-card { border: 1px solid var(--line); border-radius: var(--radius); background: rgba(7,17,26,.94); box-shadow: 0 14px 42px rgba(0,0,0,.18); }
.operations-grid { display: grid; grid-template-columns: 1.25fr 1fr .8fr; gap: 14px; }
.operations-grid .panel-card { min-height: 285px; padding: 23px; }
.card-topline { display: flex; align-items: center; justify-content: space-between; padding-bottom: 16px; border-bottom: 1px solid var(--line); color: #abc1c7; font: 700 11px/1 Consolas, monospace; letter-spacing: .13em; }
.card-topline small { color: var(--dim); }
.health-layout { display: grid; grid-template-columns: 142px 1fr; gap: 25px; align-items: center; padding-top: 23px; }
.health-ring { --health: 0deg; width: 132px; height: 132px; display: grid; place-items: center; border-radius: 50%; background: conic-gradient(var(--teal) var(--health), #112934 0); position: relative; }
.health-ring::after { content: ""; position: absolute; inset: 9px; border-radius: 50%; background: var(--surface); border: 1px solid #163342; }
.health-ring div { z-index: 1; text-align: center; }
.health-ring strong { display: block; font: 500 28px/1 Consolas, monospace; }
.health-ring span { display: block; margin-top: 7px; color: var(--dim); font: 700 11px/1 Consolas, monospace; letter-spacing: .12em; }
.health-metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.health-metrics div { min-height: 67px; padding: 12px; border-left: 2px solid #234453; background: #09151f; }
.health-metrics span { display: block; color: var(--dim); font: 700 11px/1.3 Consolas, monospace; }
.health-metrics strong { display: block; margin-top: 9px; font: 500 21px/1 Consolas, monospace; }
.account-mix-card { display: flex; flex-direction: column; }
.mix-row { margin-top: 23px; }
.mix-row > div:first-child { display: flex; justify-content: space-between; margin-bottom: 9px; color: #819ba5; font: 700 11px/1 Consolas, monospace; }
.mix-row strong { color: var(--text); }
.mix-track { height: 7px; background: #112732; overflow: hidden; }
.mix-track i { display: block; width: 0; height: 100%; transition: width .35s ease; }
.mix-track .active { background: var(--teal); }
.mix-track .pending { background: var(--amber); }
.mix-track .restricted { background: var(--red); }
.mix-axis { display: flex; justify-content: space-between; margin-top: auto; padding-top: 20px; color: var(--dim); font: 700 11px/1 Consolas, monospace; }
.owner-queue-card { position: relative; overflow: hidden; }
.owner-queue-card::after { content: ""; position: absolute; width: 100px; height: 100px; right: -55px; bottom: -55px; border: 1px solid rgba(40,225,189,.2); transform: rotate(45deg); }
.queue-value { display: block; margin-top: 28px; color: var(--teal); font: 500 45px/1 Consolas, monospace; }
.owner-queue-card h4 { margin: 15px 0 8px; font-size: 18px; }
.owner-queue-card p { min-height: 52px; margin: 0 0 18px; color: var(--muted); font-size: 14px; line-height: 1.6; }
.recent-card { margin-top: 14px; padding: 23px; }
.recent-card .section-heading h3 { font-size: 23px; }
.recent-list { margin-top: 18px; border-top: 1px solid var(--line); }
.recent-row { display: grid; grid-template-columns: 1.3fr .7fr .7fr .8fr; gap: 18px; align-items: center; min-height: 66px; padding: 11px 6px; border-bottom: 1px solid #102631; color: #8fa6ae; font-size: 13px; }
.recent-row strong { color: var(--text); }

/* Forms and registry */
.section-heading.main { align-items: flex-end; margin-bottom: 22px; }
.section-heading.compact h4 { margin: 8px 0 0; font-size: 17px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; padding: 24px; }
.field small { display: block; margin-top: 8px; color: var(--dim); font-size: 12px; }
.span-2 { grid-column: 1 / -1; }
.account-section { margin: 26px 0 10px; padding: 23px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.account-row { display: grid; grid-template-columns: 1fr 1.5fr auto; gap: 11px; margin-top: 10px; }
.account-row button { width: 42px; border: 1px solid #4d2a35; background: #180f15; color: var(--red); }
.form-actions { display: flex; justify-content: flex-end; gap: 11px; margin-top: 24px; }
.directory-heading { align-items: flex-end; }
.directory-actions { display: flex; align-items: center; gap: 10px; }
.directory-actions input { width: min(340px, 30vw); }
.table-shell { overflow-x: auto; }
table { width: 100%; min-width: 1120px; border-collapse: collapse; }
th { padding: 16px 14px; border-bottom: 1px solid var(--line); background: #081722; color: #718a95; text-align: left; font: 700 11px/1 Consolas, monospace; letter-spacing: .09em; }
td { padding: 17px 14px; border-bottom: 1px solid #102631; color: #abc0c6; font-size: 13px; vertical-align: top; }
tbody tr:hover { background: rgba(40,225,189,.025); }
.user-primary { color: var(--text); font-weight: 650; font-size: 14px; }
.user-secondary { display: block; margin-top: 6px; color: var(--dim); font: 11px/1.35 Consolas, monospace; }
.badge { display: inline-flex; padding: 6px 9px; border: 1px solid #2d4c58; border-radius: 999px; background: #0d1c26; color: #8ca5ad; white-space: nowrap; font: 700 11px/1 Consolas, monospace; letter-spacing: .05em; }
.badge.active { color: var(--teal); border-color: rgba(40,225,189,.35); background: rgba(40,225,189,.07); }
.badge.pending { color: var(--amber); border-color: rgba(255,200,87,.35); background: rgba(255,200,87,.07); }
.badge.restricted { color: var(--red); border-color: rgba(255,101,119,.35); background: rgba(255,101,119,.07); }
.binding-line { display: block; margin-bottom: 5px; white-space: nowrap; }
.binding-line small { color: var(--dim); }
.code-cell { min-width: 155px; }
.masked-code { color: #6e858e; font: 12px/1 Consolas, monospace; }
.action-stack { display: flex; flex-wrap: wrap; gap: 6px; }
.mini-button { padding: 8px 10px; border: 1px solid #294c5c; border-radius: var(--radius); background: #0a1923; color: #9ab0b7; font: 700 11px/1 Consolas, monospace; letter-spacing: .05em; }
.mini-button:hover { color: var(--teal); border-color: var(--teal-2); }
.mini-button.danger:hover { color: var(--red); border-color: var(--red); }
.protected-label { padding: 8px 0; color: var(--dim); white-space: nowrap; font: 700 11px/1 Consolas, monospace; }
.empty-state { padding: 36px; color: var(--dim); text-align: center; font-size: 14px; }

/* Dialogs */
dialog { width: calc(100% - 32px); max-width: 590px; padding: 0; border: 0; background: transparent; color: var(--text); }
.wide-dialog { max-width: 860px; }
.wide-dialog .dialog-card { max-height: calc(100vh - 40px); overflow-y: auto; }
dialog::backdrop { background: rgba(0,4,8,.82); backdrop-filter: blur(5px); }
.dialog-card { position: relative; padding: 34px; border: 1px solid #245064; border-top: 2px solid var(--teal-2); border-radius: var(--radius); background: linear-gradient(145deg, #0c1c29, #061019); box-shadow: var(--shadow); }
.dialog-card h2 { margin: 10px 0 5px; }
.dialog-close { position: absolute; top: 12px; right: 12px; width: 32px; height: 32px; border: 0; background: transparent; color: #69808a; font-size: 24px; }
.dialog-icon { width: 45px; height: 45px; display: grid; place-items: center; margin-bottom: 20px; border: 1px solid rgba(40,225,189,.45); color: var(--teal); }
.result-code { display: flex; align-items: center; gap: 10px; padding: 10px; border: 1px solid #244657; background: #06111a; }
.result-code code { flex: 1; color: var(--teal); font-size: 14px; overflow-wrap: anywhere; }
.result-meta { display: grid; grid-template-columns: 110px minmax(0,1fr); gap: 10px 14px; margin: 22px 0 5px; font-size: 12px; }
.result-meta span { color: var(--dim); }
.result-meta code, .result-meta strong { color: #9db2b9; overflow-wrap: anywhere; font-weight: 500; }
.recovery-codes { margin: 18px 0; padding: 18px; border: 1px solid #244657; background: #06111a; color: var(--teal); font: 13px/1.8 Consolas, monospace; white-space: pre-wrap; user-select: all; }
.identity-line { overflow-wrap: anywhere; font: 12px/1.55 Consolas, monospace; }

@media (max-width: 1180px) {
  .operations-grid { grid-template-columns: 1fr 1fr; }
  .owner-queue-card { grid-column: 1 / -1; min-height: 220px !important; }
  .auth-shell { grid-template-columns: 1fr 500px; gap: 45px; padding: 50px; }
}
@media (max-width: 900px) {
  .auth-shell { grid-template-columns: 1fr; }
  .brand-panel { display: none; }
  .sidebar { position: static; width: 100%; min-height: auto; flex-direction: row; align-items: center; padding: 12px 14px; border-right: 0; border-bottom: 1px solid var(--line); }
  .sidebar-brand { min-height: auto; padding: 0; border: 0; }
  .sidebar nav { display: flex; margin: 0 0 0 auto; }
  .nav-button { width: auto; min-height: 42px; }
  .sidebar-footer { display: none; }
  .workspace { margin-left: 0; padding: 0 18px 35px; }
  .topbar { min-height: 90px; }
  .topbar-right { display: none; }
}
@media (max-width: 680px) {
  .auth-shell { padding: 18px; }
  .auth-card { padding: 28px 22px; }
  .operations-grid { grid-template-columns: 1fr; }
  .owner-queue-card { grid-column: auto; }
  .health-layout { grid-template-columns: 1fr; justify-items: center; }
  .health-metrics { width: 100%; }
  .dashboard-heading, .section-heading.main { align-items: flex-start; flex-direction: column; }
  .dashboard-heading .primary { width: 100%; }
  .form-grid { grid-template-columns: 1fr; }
  .span-2 { grid-column: 1; }
  .account-row { grid-template-columns: 1fr; }
  .account-row button { width: 100%; height: 38px; }
  .directory-actions { width: 100%; }
  .directory-actions input { width: 100%; }
  .recent-row { grid-template-columns: 1fr 90px; }
  .recent-row > :nth-child(3), .recent-row > :nth-child(4) { display: none; }
  .sidebar-brand { display: none; }
  .sidebar nav { margin: 0; width: 100%; justify-content: space-between; }
  .nav-button { gap: 6px; padding: 0 8px; font-size: 10px; }
}

/* v0.3.3 device access manager */
.device-section { margin: 8px 0 18px; padding: 23px 0; border-bottom: 1px solid var(--line); }
.compact-action { min-height: 34px; padding: 0 12px; }
.device-list { display: grid; gap: 8px; margin-top: 14px; }
.device-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 11px 12px; border: 1px solid #183847; border-radius: var(--radius); background: #07131d; }
.device-copy { min-width: 0; display: grid; gap: 3px; }
.device-id { color: var(--teal); font: 700 12px/1.3 Consolas, monospace; letter-spacing: .06em; }
.device-binding { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #d4e0e3; font-size: 12px; }
.device-meta { color: var(--dim); font: 11px/1.4 Consolas, monospace; }

/* v0.3.4 — M.O.R.P.H. Command Nexus visual identity */
.auth-shell::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 22% 38%, rgba(40,225,189,.055), transparent 30%),
    linear-gradient(115deg, transparent 0 43%, rgba(40,225,189,.018) 43% 43.25%, transparent 43.25% 100%);
}
.brand-panel { position: relative; }
.brand-panel::after {
  content: "COMMAND NEXUS / MASTER CONTROL ENVIRONMENT";
  display: block;
  width: max-content;
  max-width: 100%;
  margin-top: 34px;
  padding-top: 15px;
  border-top: 1px solid rgba(40,225,189,.18);
  color: #395863;
  font: 700 10px/1 Consolas, monospace;
  letter-spacing: .22em;
}
.auth-card { overflow: hidden; }
.auth-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 2px;
  background: linear-gradient(180deg, transparent, rgba(40,225,189,.78), transparent);
  transform: translateY(-100%);
  animation: nexus-auth-sweep 4.8s ease-in-out infinite;
  opacity: .55;
}
@keyframes nexus-auth-sweep {
  0%, 62% { transform: translateY(-100%); opacity: 0; }
  72% { opacity: .55; }
  100% { transform: translateY(100%); opacity: 0; }
}
.sidebar-brand small { color: #66efd3; letter-spacing: .16em; }
.topbar { position: relative; }
.topbar::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  width: 120px;
  height: 1px;
  background: linear-gradient(90deg, var(--teal), transparent);
  box-shadow: 0 0 12px rgba(40,225,189,.2);
}
.owner-chip > span {
  border-radius: 2px;
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
  background: rgba(40,225,189,.04);
}

/* Authenticated ingress. Pure presentation: no extra server requests. */
.nexus-ingress {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    radial-gradient(circle at center, rgba(9,39,47,.88) 0, rgba(3,13,19,.97) 31%, #02070b 70%),
    #02070b;
  opacity: 1;
  transition: opacity .24s ease;
}
.nexus-ingress::before,
.nexus-ingress::after {
  content: "";
  position: absolute;
  inset: -20%;
  pointer-events: none;
}
.nexus-ingress::before {
  background-image:
    linear-gradient(rgba(40,225,190,.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(40,225,190,.055) 1px, transparent 1px);
  background-size: 46px 46px;
  transform: perspective(680px) rotateX(64deg) translateY(27%);
  transform-origin: center bottom;
  opacity: .45;
}
.nexus-ingress::after {
  background: repeating-linear-gradient(0deg, transparent 0 3px, rgba(255,255,255,.018) 3px 4px);
  mix-blend-mode: screen;
  opacity: .35;
}
.nexus-ingress.leaving { opacity: 0; }
.nexus-scan {
  position: absolute;
  z-index: 1;
  left: 0;
  right: 0;
  top: -6px;
  height: 1px;
  background: linear-gradient(90deg, transparent 10%, rgba(40,225,189,.08), rgba(40,225,189,.9), rgba(40,225,189,.08), transparent 90%);
  box-shadow: 0 0 18px rgba(40,225,189,.45);
}
.nexus-ingress.active .nexus-scan { animation: nexus-scan-pass 1.45s cubic-bezier(.25,.7,.2,1) .06s both; }
@keyframes nexus-scan-pass { from { top: 5%; opacity: 0; } 12% { opacity: 1; } to { top: 95%; opacity: 0; } }
.nexus-orbit {
  position: absolute;
  z-index: 0;
  width: min(72vw, 860px);
  aspect-ratio: 1;
  border: 1px solid rgba(40,225,189,.09);
  border-radius: 50%;
}
.nexus-orbit::before,
.nexus-orbit::after {
  content: "";
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 18px rgba(40,225,189,.75);
}
.nexus-orbit::before { left: 50%; top: -3px; }
.nexus-orbit::after { right: 8%; bottom: 19%; }
.orbit-a { transform: scale(.74); }
.orbit-b { opacity: .55; transform: scale(1.04) rotate(41deg); }
.nexus-ingress.active .orbit-a { animation: nexus-orbit-a 3.8s linear infinite; }
.nexus-ingress.active .orbit-b { animation: nexus-orbit-b 5.2s linear infinite reverse; }
@keyframes nexus-orbit-a { to { transform: scale(.74) rotate(360deg); } }
@keyframes nexus-orbit-b { to { transform: scale(1.04) rotate(401deg); } }
.nexus-gate {
  position: relative;
  z-index: 3;
  width: min(620px, calc(100vw - 44px));
  padding: 46px 48px 34px;
  border: 1px solid rgba(40,225,189,.2);
  border-top-color: rgba(40,225,189,.7);
  background: linear-gradient(145deg, rgba(7,22,31,.92), rgba(3,10,15,.86));
  box-shadow: 0 28px 90px rgba(0,0,0,.55), inset 0 0 45px rgba(40,225,189,.025);
  clip-path: polygon(18px 0, 100% 0, 100% calc(100% - 18px), calc(100% - 18px) 100%, 0 100%, 0 18px);
  text-align: center;
  opacity: 0;
  transform: scale(.965) translateY(8px);
}
.nexus-ingress.active .nexus-gate { animation: nexus-gate-in .34s ease-out .05s forwards; }
@keyframes nexus-gate-in { to { opacity: 1; transform: scale(1) translateY(0); } }
.nexus-gate-mark {
  width: 76px;
  height: 76px;
  margin: 0 auto 18px;
  display: grid;
  place-items: center;
  position: relative;
}
.nexus-gate-mark::before,
.nexus-gate-mark::after {
  content: "";
  position: absolute;
  inset: -9px;
  border: 1px solid rgba(40,225,189,.28);
  transform: rotate(45deg);
}
.nexus-gate-mark::after { inset: -17px; border-color: rgba(40,225,189,.09); }
.nexus-gate-mark img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 0 16px rgba(40,225,189,.12)); }
.nexus-gate-kicker {
  color: var(--teal);
  font: 700 10px/1.2 Consolas, monospace;
  letter-spacing: .3em;
}
.nexus-gate-title {
  margin-top: 10px;
  color: #ecf9f6;
  font-size: clamp(30px, 5vw, 46px);
  font-weight: 280;
  letter-spacing: .18em;
  white-space: nowrap;
}
.nexus-sequence {
  display: grid;
  gap: 9px;
  width: min(370px, 100%);
  margin: 30px auto 24px;
  text-align: left;
}
.nexus-sequence span {
  display: flex;
  align-items: center;
  gap: 11px;
  color: #66828c;
  font: 700 10px/1.25 Consolas, monospace;
  letter-spacing: .11em;
  opacity: 0;
  transform: translateX(-8px);
}
.nexus-sequence i {
  width: 6px;
  height: 6px;
  flex: 0 0 auto;
  border: 1px solid #315864;
  transform: rotate(45deg);
}
.nexus-ingress.active .nexus-sequence span { animation: nexus-seq-in .18s ease-out forwards; }
.nexus-ingress.active .nexus-sequence .seq-1 { animation-delay: .28s; }
.nexus-ingress.active .nexus-sequence .seq-2 { animation-delay: .54s; }
.nexus-ingress.active .nexus-sequence .seq-3 { animation-delay: .82s; }
.nexus-ingress.active .nexus-sequence .seq-4 { animation-delay: 1.11s; color: #bff5e8; }
.nexus-ingress.active .nexus-sequence .seq-4 i { border-color: var(--teal); background: var(--teal); box-shadow: 0 0 14px rgba(40,225,189,.7); }
@keyframes nexus-seq-in { to { opacity: 1; transform: translateX(0); } }
.nexus-progress {
  height: 2px;
  overflow: hidden;
  background: #102b34;
}
.nexus-progress i {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, #0a806f, var(--teal), #a8fff0);
  box-shadow: 0 0 12px rgba(40,225,189,.55);
}
.nexus-ingress.active .nexus-progress i { animation: nexus-progress 1.46s cubic-bezier(.22,.68,.15,1) .12s forwards; }
@keyframes nexus-progress { to { width: 100%; } }
.nexus-gate-meta {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  margin-top: 14px;
  color: #3e606b;
  font: 700 9px/1 Consolas, monospace;
  letter-spacing: .1em;
}

@media (prefers-reduced-motion: reduce) {
  .auth-card::before,
  .nexus-ingress.active .nexus-scan,
  .nexus-ingress.active .nexus-orbit,
  .nexus-ingress.active .nexus-gate,
  .nexus-ingress.active .nexus-sequence span,
  .nexus-ingress.active .nexus-progress i { animation: none !important; }
  .nexus-gate, .nexus-sequence span { opacity: 1; transform: none; }
  .nexus-progress i { width: 100%; }
}

@media (max-width: 680px) {
  .nexus-gate { padding: 38px 24px 28px; }
  .nexus-gate-title { letter-spacing: .11em; }
  .nexus-gate-meta { flex-direction: column; }
}

/* v0.3.5 — biometric/passkey channel */
.auth-divider{display:flex;align-items:center;gap:12px;margin:14px 0;color:#748296;font-size:10px;letter-spacing:.12em}.auth-divider:before,.auth-divider:after{content:"";height:1px;flex:1;background:rgba(119,138,163,.2)}
.passkey-primary{margin:18px 0 4px;position:relative;overflow:hidden}.passkey-primary:after{content:"";position:absolute;inset:-120% -30%;background:linear-gradient(100deg,transparent,rgba(255,255,255,.12),transparent);transform:translateX(-60%);animation:passkeySweep 3.2s linear infinite}@keyframes passkeySweep{to{transform:translateX(60%)}}
.security-access-card{margin-top:18px}.passkey-list{display:grid;gap:10px;margin-top:14px}.passkey-row{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:13px 15px;border:1px solid rgba(90,111,139,.22);background:rgba(7,13,22,.5)}.passkey-row strong{display:block}.passkey-row small{display:block;color:#7f8ea2;margin-top:4px}.passkey-badge{font-size:10px;letter-spacing:.12em;color:#70e4cf;border:1px solid rgba(56,189,168,.25);padding:4px 7px}

/* v0.3.7 — mobile logout + protected view + one-time action guard */
.mobile-lock { display: none; }
.sensitive-dialog { width: min(94vw, 590px); }
.sensitive-gate-card { padding: 36px; }
.sensitive-gate-card .passkey-primary { margin: 22px 0 6px; }
.sensitive-actions { display: grid; grid-template-columns: minmax(120px,.7fr) minmax(220px,1.3fr); gap: 10px; margin-top: 24px; }

@media (max-width: 900px) {
  .topbar { gap: 12px; }
  .mobile-lock { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; min-height: 40px; padding: 0 13px; }
}

@media (max-width: 520px) {
  .workspace { padding-left: 12px; padding-right: 12px; }
  .topbar h2 { font-size: 25px; }
  .mobile-lock { font-size: 10px; padding: 0 10px; }
  .sensitive-gate-card { padding: 28px 20px; }
  .sensitive-actions { grid-template-columns: 1fr; }
}
.addon-approval-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}.addon-approval-grid label{display:flex;align-items:center;gap:8px;border:1px solid var(--line,#293746);padding:10px;border-radius:8px;margin:0}.addon-approval-grid input{width:auto}.queue-item{display:grid;grid-template-columns:minmax(180px,1.2fr) minmax(160px,1fr) auto;gap:14px;align-items:center;padding:14px 0;border-bottom:1px solid rgba(255,255,255,.08)}.queue-item:last-child{border-bottom:0}.queue-item small{display:block;color:#8194a6;margin-top:4px}.queue-actions{display:flex;gap:8px}.queue-actions button{white-space:nowrap}@media(max-width:900px){.queue-item{grid-template-columns:1fr}.addon-approval-grid{grid-template-columns:1fr}}
.entitlement-list{padding:0 22px 22px}.entitlement-card{border:1px solid rgba(255,255,255,.09);border-radius:10px;padding:14px;margin:10px 0;display:grid;grid-template-columns:1fr auto;gap:10px;align-items:center}.entitlement-card small{display:block;color:#8194a6;margin-top:5px}.entitlement-card button{align-self:center}.edit-dialog .account-row{margin-bottom:8px}
.entitlement-list + .edit-grid .device-row{display:grid;grid-template-columns:1fr auto;gap:12px;align-items:center;padding:10px 0;border-bottom:1px solid rgba(255,255,255,.07)}.entitlement-list + .edit-grid .device-row:last-child{border-bottom:0}.entitlement-list + .edit-grid .device-row small{display:block;color:#8194a6;margin-top:4px}@media(max-width:700px){.entitlement-list + .edit-grid .device-row{grid-template-columns:1fr}}

/* v0.4.1: one current authority surface. */
.legacy-control-hidden{display:none!important}
.access-handoff{display:flex;align-items:center;justify-content:space-between;gap:22px;border:1px solid #1f6c63;background:linear-gradient(135deg,rgba(20,67,65,.42),rgba(8,22,31,.72));padding:18px;border-radius:12px}
.access-handoff h4{margin:5px 0 4px}.access-handoff p{margin:0;color:var(--muted);max-width:620px}.compact-action{width:auto!important;margin:0!important;white-space:nowrap;padding:11px 18px!important}

.entitlement-toolbar{display:flex;justify-content:space-between;align-items:center;gap:18px;margin:6px 0 14px;padding:10px 2px}.entitlement-toolbar .ghost{white-space:nowrap}

/* v0.4.3 authoritative access summary + account-number-only binding UI */
.binding-count{display:block;margin-bottom:9px;color:var(--teal);font:700 10px/1 Consolas,monospace;letter-spacing:.08em}.binding-line{line-height:1.45}.auto-server{min-height:42px;padding:8px 11px;border:1px solid #183847;border-radius:var(--radius);background:#07131d;overflow:hidden}.auto-server span{display:block;color:var(--dim);font:700 9px/1 Consolas,monospace;letter-spacing:.08em}.auto-server b{display:block;margin-top:5px;color:#a9bdc4;font-size:11px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.entitlement-card{padding:17px 18px}.wide-dialog .dialog-card{padding:36px}.edit-dialog .account-row{gap:10px}


/* v0.4.3 final layout hardening: no clipped controls / no horizontal dialog scroll */
.edit-dialog{width:min(94vw,920px);max-width:920px;max-height:calc(100vh - 30px);padding:0;overflow:hidden;background:#071019;border:1px solid #245064;border-radius:12px;color:var(--text)}
.edit-dialog::backdrop{background:rgba(0,5,9,.78);backdrop-filter:blur(5px)}
.edit-dialog .dialog-head{padding:22px 28px 18px;display:flex;align-items:flex-start;justify-content:space-between;gap:20px;border-bottom:1px solid rgba(66,142,154,.28);background:#091620}
.edit-dialog .dialog-head h3{margin:5px 0 0}.edit-dialog .edit-grid{padding:22px 28px 28px;max-height:calc(100vh - 125px);overflow-y:auto;overflow-x:hidden;align-items:start}
.edit-dialog .field{min-width:0}.edit-dialog input,.edit-dialog select,.edit-dialog textarea{min-width:0;width:100%;padding:12px 14px}
.edit-dialog .account-section,.edit-dialog .device-section{min-width:0;overflow:hidden;padding:18px 0 4px}
.edit-dialog .account-row{grid-template-columns:minmax(145px,.85fr) minmax(220px,1.45fr) minmax(82px,auto);gap:10px;width:100%;min-width:0;align-items:stretch}
.edit-dialog .account-row>*{min-width:0}.edit-dialog .account-row button{width:auto;min-width:82px;padding:0 12px;white-space:nowrap}
.edit-dialog .auto-server{width:100%;min-width:0}.edit-dialog .auto-server b{max-width:100%}
.entitlement-toolbar{padding:16px 28px 6px;margin:0;min-width:0}.entitlement-toolbar .micro{line-height:1.55}.entitlement-list{padding:8px 28px 24px}
.request-groups{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}.request-card{min-width:0;padding:22px}.queue-item{min-width:0}.approval-note{border-left:2px solid var(--teal-2);background:rgba(28,103,94,.18);padding:13px 15px;color:#a9bdc4;line-height:1.55}
.binding-count{margin-bottom:7px}.binding-line{display:block;max-width:360px;overflow-wrap:anywhere}.binding-line small{color:var(--dim)}
#accountRows .account-row{grid-template-columns:minmax(180px,.85fr) minmax(260px,1.45fr) minmax(82px,auto)}#accountRows .account-row button{width:auto;padding:0 12px;white-space:nowrap}
@media(max-width:980px){.request-groups{grid-template-columns:1fr}.edit-dialog{width:min(96vw,920px)}}
@media(max-width:720px){.edit-dialog .dialog-head{padding:18px}.edit-dialog .edit-grid{padding:18px;grid-template-columns:1fr}.edit-dialog .span-2{grid-column:auto}.edit-dialog .account-row,#accountRows .account-row{grid-template-columns:1fr}.edit-dialog .account-row button,#accountRows .account-row button{height:40px;width:100%}.entitlement-toolbar{padding:14px 18px;align-items:flex-start;flex-direction:column}.entitlement-list{padding:4px 18px 18px}}

/* v0.4.4 Registry auditability */
#userTableBody td:nth-child(4){min-width:280px}.binding-count{position:sticky;top:0;background:transparent}.binding-line{padding:2px 0;white-space:normal}.binding-line small{display:inline;line-height:1.45}.edit-dialog .account-row{overflow:visible}
