/* NeuroCrypt - public document edge
   Void field - cyan emission only - print discipline - no costume */

:root {
  --bg: #000000;
  --surface: #070707;
  --surface-2: #0c0c0c;
  --border: #1a1a1a;
  --border-hi: #2a2a2a;
  --fg: #c8c8c8;
  --muted: #8a8a8a;
  --dim: #5c5c5c;
  --dim-text: #757575;
  --cyan: #00e5ff;
  --cyan-dim: #008593;
  --cyan-soft: rgba(0, 229, 255, 0.12);
  --green: #22c55e;
  --green-dim: #166534;
  --amber: #c9a227;
  --amber-dim: #6b5a1e;
  --red: #c45c5c;
  --red-dim: #6b2e2e;
  --paper: #e8e4d9;

  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", "SF Mono", "Segoe UI Mono", Menlo, Consolas, monospace;

  --measure: 40rem;
  --page: 48rem;
  --nav-pad: 1.5rem;
  --radius: 2px;

  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

body {
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  color: var(--cyan);
}

::selection {
  background: var(--cyan-dim);
  color: #000;
}

input::placeholder {
  color: var(--dim);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ── Top bar ── */
.topbar {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(100% - 2 * var(--nav-pad), var(--page));
  margin: 0 auto;
  padding: 1.5rem 0 0.85rem;
}

.topbar .side {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.01em;
}

.topbar a {
  color: var(--muted);
  transition: color 0.15s ease;
}

.topbar a:hover {
  color: var(--fg);
}

.topbar .brand {
  display: inline-flex;
  align-items: center;
  color: var(--cyan) !important;
}

.topbar .brand img {
  height: 22px;
  width: auto;
  display: block;
}

/* ── Doc meta line ── */
.classbar {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: baseline;
  gap: 0.85rem;
  width: min(100% - 2 * var(--nav-pad), var(--page));
  margin: 0 auto;
  padding: 0.65rem 0 0.55rem;
  border-bottom: 1px solid var(--border);
  font-family: var(--mono);
  font-size: 0.625rem;
  letter-spacing: 0.08em;
  color: var(--dim);
}

.classbar .tag {
  color: var(--muted);
  font-weight: 500;
  flex: none;
  font-variant-numeric: tabular-nums;
  text-transform: none;
  letter-spacing: 0.04em;
}

.classbar .text {
  flex: 1;
  color: var(--dim);
  text-align: left;
  text-transform: none;
  letter-spacing: 0.02em;
  font-size: 0.625rem;
}

.classbar .code {
  flex: none;
  color: var(--dim);
  font-variant-numeric: tabular-nums;
  text-transform: none;
}

/* ── Letterhead ── */
.letterhead {
  position: relative;
  z-index: 2;
  width: min(100% - 2 * var(--nav-pad), var(--page));
  margin: 0 auto;
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 1.25rem 0 0;
}

.letterhead img {
  display: none;
}

.letterhead .lines {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.letterhead .office {
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.04em;
  color: var(--muted);
  text-transform: none;
}

.letterhead .division {
  font-family: var(--mono);
  font-size: 0.625rem;
  letter-spacing: 0.03em;
  color: var(--dim);
  text-transform: none;
}

/* ── Shell / content ── */
.shell {
  position: relative;
  z-index: 2;
  width: min(100% - 2 * var(--nav-pad), var(--page));
  margin: 0 auto;
  min-height: calc(100vh - 120px);
  display: flex;
  flex-direction: column;
}

.content {
  position: relative;
  flex: 1;
  padding: 2.75rem 0 4rem;
  max-width: var(--measure);
}

/* Wide holdings */
body[data-doc="NC-REG-0001"] .content--register,
body[data-doc="NC-REG-0002"] .content,
body[data-doc="NC-ARC-INDEX"] .content,
body[data-doc="NC-INC-INDEX"] .content,
body[data-doc="NC-HR-0001"] .content {
  max-width: min(58rem, 100%);
}

/* ── Register page ── */
body.page-register .letterhead,
body.page-quantities .letterhead {
  display: none;
}

body.page-register .shell--register,
body.page-quantities .shell--register {
  width: min(100% - 2 * var(--nav-pad), 58rem);
}

body.page-quantities .reg-head__tools .register-count,
.register-count.quant-meta {
  padding-left: 0;
}

.reg-head {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(14rem, 0.9fr);
  gap: 1.75rem 2.5rem;
  align-items: end;
  margin: 0 0 1.25rem;
  padding-bottom: 1.15rem;
  border-bottom: 1px solid var(--border);
}

@media (max-width: 780px) {
  .reg-head {
    grid-template-columns: 1fr;
    gap: 1.15rem;
  }
}

.reg-head h1 {
  margin: 0 0 0.55rem;
  padding: 0;
  border: none;
  font-size: 1.35rem;
}

.reg-head__lede {
  margin: 0;
  max-width: 36rem;
  font-size: 0.875rem;
  line-height: 1.55;
  color: var(--muted);
}

.reg-head__tools {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.reg-field {
  display: grid;
  grid-template-columns: 2.75rem 1fr;
  gap: 0.5rem;
  align-items: center;
}

.reg-field span {
  font-family: var(--mono);
  font-size: 0.625rem;
  letter-spacing: 0.06em;
  color: var(--dim);
  text-transform: uppercase;
}

.reg-field input,
.reg-field select {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border-hi);
  border-radius: 0;
  color: var(--fg);
  font-family: var(--mono);
  font-size: 0.75rem;
  padding: 0.4rem 0;
  outline: none;
}

.reg-field select {
  cursor: pointer;
  color: var(--muted);
}

.reg-field input:focus,
.reg-field select:focus {
  border-bottom-color: var(--cyan-dim);
  color: var(--fg);
}

.reg-field input::placeholder {
  color: var(--dim);
}

.register-count {
  margin: 0.15rem 0 0;
  font-family: var(--mono);
  font-size: 0.625rem;
  color: var(--dim);
  letter-spacing: 0.03em;
  padding-left: 3.25rem;
}

.register-scroll {
  overflow-x: auto;
  margin: 0 0 1rem;
  -webkit-overflow-scrolling: touch;
}

.reg-table {
  width: 100%;
  min-width: 38rem;
  border-collapse: collapse;
  font-family: var(--mono);
  font-size: 0.6875rem;
  line-height: 1.4;
}

.reg-table thead th {
  text-align: left;
  font-size: 0.5625rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--dim);
  padding: 0.45rem 0.65rem 0.55rem 0;
  border-bottom: 1px solid var(--border-hi);
  white-space: nowrap;
}

.reg-table td {
  padding: 0.48rem 0.65rem 0.48rem 0;
  border-bottom: 1px solid var(--border);
  color: var(--fg);
  vertical-align: baseline;
}

.reg-table .col-id {
  width: 8.5rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.reg-table .col-rev {
  width: 3.5rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.reg-table .col-date {
  width: 6.5rem;
  color: var(--dim-text);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.reg-table .col-st {
  width: 6.5rem;
  color: var(--muted);
  text-align: right;
  padding-right: 0;
  white-space: nowrap;
}

.reg-table .col-st--lim {
  color: var(--amber);
}

.reg-table .col-st--off {
  color: var(--dim);
}

.reg-table a {
  color: var(--cyan-dim);
  text-decoration: none;
}

.reg-table a:hover {
  color: var(--cyan);
}

.reg-table .col-title a {
  color: var(--fg);
}

.reg-table .col-title a:hover {
  color: var(--cyan);
}

.reg-table tr.is-withheld td {
  color: var(--dim-text);
}

.reg-table tr.is-withheld .col-title {
  color: var(--dim-text);
}

.reg-table tr.reg-section td,
.reg-table tr.reg-section th {
  padding: 1.1rem 0 0.4rem;
  border-bottom: 1px solid var(--border);
  color: var(--dim);
  font-size: 0.5625rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 500;
}

.reg-note {
  color: var(--dim);
  font-size: 0.9em;
}

.reg-foot-note {
  margin: 0 0 1.25rem;
  font-family: var(--mono);
  font-size: 0.625rem;
  line-height: 1.55;
  color: var(--dim);
  max-width: 44rem;
}

.reg-details {
  margin: 1.5rem 0 0;
  border-top: 1px solid var(--border);
  padding-top: 0.85rem;
}

.reg-details summary {
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--dim-text);
  cursor: pointer;
  list-style: none;
}

.reg-details summary::-webkit-details-marker {
  display: none;
}

.reg-details summary:hover {
  color: var(--muted);
}

.reg-details[open] summary {
  color: var(--muted);
  margin-bottom: 0.75rem;
}

.reg-details .prose {
  max-width: 36rem;
}

.dim-note {
  color: var(--dim);
  font-size: 0.9em;
}

.ring-schematic {
  margin: 1.5rem 0 1.75rem;
  max-width: 22rem;
}

.ring-schematic svg {
  display: block;
  width: 100%;
  height: auto;
}

.ring-schematic figcaption {
  margin-top: 0.5rem;
  font-family: var(--mono);
  font-size: 0.625rem;
  line-height: 1.5;
  color: var(--dim);
}

.ring-schematic figcaption a {
  color: var(--cyan-dim);
}

.content h1 {
  font-family: var(--font);
  font-size: 1.5rem;
  font-weight: 500;
  letter-spacing: -0.02em;
  text-transform: none;
  color: var(--fg);
  margin: 0 0 1.75rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
  line-height: 1.25;
}

.prose p {
  font-size: 0.9375rem;
  line-height: 1.7;
  color: var(--fg);
  max-width: 38rem;
  margin: 0 0 1.15rem;
}

.prose p.muted {
  color: var(--muted);
  font-size: 0.875rem;
}

.prose p strong {
  color: #e4e4e4;
  font-weight: 600;
}

.prose em {
  font-style: italic;
  color: var(--fg);
}

.prose a,
.notice a,
.qa .a a,
.abstract a,
.refs a,
.deflist .def a,
.docfigure figcaption a {
  color: var(--cyan-dim);
  text-decoration: underline;
  text-decoration-color: rgba(0, 122, 136, 0.45);
  text-underline-offset: 0.15em;
}

.prose a:hover,
.notice a:hover,
.qa .a a:hover,
.abstract a:hover,
.refs a:hover,
.deflist .def a:hover,
.docfigure figcaption a:hover {
  color: var(--cyan);
  text-decoration-color: var(--cyan);
}

/* ── Document figure ── */
.docfigure {
  margin: 1.9rem 0 1.6rem;
  max-width: var(--page);
}

.docfigure img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--border);
  background: var(--bg);
}

.docfigure figcaption {
  font-size: 0.8125rem;
  line-height: 1.55;
  color: var(--muted);
  margin-top: 0.65rem;
  max-width: var(--measure);
}

/* ── Section heads ── */
.dochead {
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 2.25rem 0 0.9rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
  font-weight: 500;
}

.dochead .num {
  color: var(--dim);
  margin-right: 0.65rem;
  font-variant-numeric: tabular-nums;
}

/* ── Tables ── */
.datatable {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--mono);
  font-size: 0.75rem;
  margin: 0.5rem 0 1.25rem;
  line-height: 1.45;
}

.datatable th {
  text-align: left;
  font-size: 0.625rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--dim-text);
  font-weight: 500;
  padding: 0.55rem 0.65rem;
  border-bottom: 1px solid var(--border-hi);
}

.datatable td {
  padding: 0.65rem;
  border-bottom: 1px solid var(--border);
  color: var(--fg);
  vertical-align: top;
}

.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0 0 1.25rem;
}

.table-scroll .datatable {
  margin-bottom: 0;
}

.eqn {
  font-family: var(--mono);
  font-size: 0.8125rem;
  line-height: 1.6;
  color: var(--fg);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 0.85rem 1rem;
  margin: 1.25rem 0;
  max-width: 38rem;
  overflow-x: auto;
}

.table-note {
  color: var(--dim-text);
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.03em;
}

.datatable tr.denied td {
  color: var(--dim);
}

.datatable tr:hover td {
  background: rgba(255, 255, 255, 0.015);
}

.datatable .tag-ok {
  color: var(--green);
  font-size: 0.625rem;
  letter-spacing: 0.05em;
}

.datatable .tag-denied {
  color: var(--dim);
  font-size: 0.625rem;
  letter-spacing: 0.05em;
}

.datatable .tag-warn {
  color: var(--amber);
  font-size: 0.625rem;
  letter-spacing: 0.05em;
}

.datatable a.doclink {
  color: var(--cyan-dim);
  text-decoration: none;
}

.datatable a.doclink:hover {
  color: var(--cyan);
}

/* ── Program / incident list (not product cards) ── */
.cardlist {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 0.5rem 0 2rem;
  border-top: 1px solid var(--border);
}

.cardlist a.card {
  display: block;
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--border);
  background: transparent;
  border-left: none;
  border-right: none;
  border-top: none;
  color: var(--fg);
  transition: color 0.15s ease;
}

.cardlist a.card:hover {
  border-color: var(--border-hi);
  background: transparent;
}

.cardlist a.card .code {
  font-family: var(--mono);
  font-size: 0.625rem;
  letter-spacing: 0.1em;
  color: var(--dim);
  text-transform: uppercase;
}

.cardlist a.card .title {
  font-family: var(--font);
  font-size: 0.9375rem;
  font-weight: 500;
  margin: 0.35rem 0 0.4rem;
  color: var(--fg);
  letter-spacing: -0.01em;
}

.cardlist a.card:hover .title {
  color: var(--cyan);
}

.cardlist a.card .desc {
  font-size: 0.8125rem;
  color: var(--muted);
  line-height: 1.55;
  max-width: 36rem;
}

.cardlist a.card .meta {
  margin-top: 0.5rem;
  font-family: var(--mono);
  font-size: 0.625rem;
  color: var(--dim);
  letter-spacing: 0.04em;
}

/* Compact metrics - secondary to NC-REG-0002 */
.scale-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr));
  gap: 0;
  margin: 1.5rem 0 1.75rem;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: transparent;
}

.scale-strip .stat {
  background: transparent;
  padding: 0.85rem 0.75rem 0.85rem 0;
  border-right: 1px solid var(--border);
  border-bottom: none;
}

.scale-strip .stat:last-child {
  border-right: none;
  padding-right: 0;
}

.scale-strip .stat .n {
  font-family: var(--mono);
  font-size: 0.8125rem;
  color: var(--fg);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.scale-strip .stat .l {
  font-family: var(--mono);
  font-size: 0.5625rem;
  color: var(--dim);
  letter-spacing: 0.03em;
  text-transform: none;
  margin-top: 0.3rem;
  line-height: 1.4;
}

/* ── Cross-refs ── */
.xref {
  margin: 2.5rem 0 0.5rem;
  padding-top: 1.15rem;
  border-top: 1px solid var(--border);
}

.xref .xtitle {
  font-family: var(--mono);
  font-size: 0.625rem;
  letter-spacing: 0.12em;
  color: var(--dim);
  text-transform: uppercase;
  margin-bottom: 0.85rem;
}

.xref ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.xref li {
  display: flex;
  gap: 0.85rem;
  align-items: baseline;
  font-size: 0.8125rem;
}

.xref li .n {
  flex: none;
  width: 7.25rem;
  font-family: var(--mono);
  color: var(--dim);
  font-size: 0.6875rem;
  letter-spacing: 0.04em;
}

.xref li a {
  color: var(--cyan-dim);
  text-decoration: none;
}

.xref li a:hover {
  color: var(--cyan);
}

.xref li.sealed {
  color: var(--dim);
}

.xref li.sealed .s {
  color: var(--dim);
  font-family: var(--mono);
  font-size: 0.6875rem;
}

/* ── Notices ── */
.notice {
  border: 1px solid var(--border);
  border-left: 2px solid var(--amber-dim);
  background: transparent;
  padding: 0.85rem 1rem;
  margin: 1.5rem 0;
  font-size: 0.8125rem;
  line-height: 1.65;
  color: var(--muted);
  max-width: 36rem;
}

.notice .h {
  display: block;
  font-family: var(--mono);
  font-size: 0.625rem;
  letter-spacing: 0.1em;
  color: var(--amber);
  text-transform: uppercase;
  margin-bottom: 0.4rem;
}

.notice.severe {
  border-left-color: var(--red-dim);
}

.notice.severe .h {
  color: var(--red);
}

/* ── Definitions ── */
.deflist {
  display: flex;
  flex-direction: column;
  gap: 1.35rem;
  max-width: 36rem;
  margin-bottom: 0.75rem;
}

.deflist .term {
  font-size: 0.875rem;
  color: var(--fg);
  font-weight: 500;
  letter-spacing: 0.01em;
}

.deflist .term .alt {
  color: var(--dim);
  font-weight: 400;
  font-family: var(--mono);
  font-size: 0.6875rem;
  margin-left: 0.5rem;
  letter-spacing: 0.04em;
}

.deflist .def {
  font-size: 0.875rem;
  color: var(--muted);
  line-height: 1.65;
  margin: 0.3rem 0 0;
}

/* ── Log / abstract / meta ── */
.logblock {
  border: 1px solid var(--border);
  background: var(--surface);
  padding: 1rem 1.1rem;
  font-family: var(--mono);
  font-size: 0.75rem;
  line-height: 1.75;
  color: var(--muted);
  overflow-x: auto;
  margin: 1.25rem 0;
  white-space: pre-wrap;
  word-break: break-word;
}

.logblock .ok {
  color: var(--green);
}

.logblock .warn {
  color: var(--amber);
}

.logblock .bad {
  color: var(--red);
}

.logblock .em {
  color: var(--fg);
}

.denied-block {
  border: 1px solid var(--border-hi);
  background: var(--surface);
  padding: 1.25rem 1rem;
  text-align: left;
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.08em;
  color: var(--dim);
  text-transform: uppercase;
  margin: 1.25rem 0;
  max-width: 36rem;
}

.denied-block small {
  display: block;
  margin-top: 0.45rem;
  color: var(--dim);
  letter-spacing: 0.03em;
  text-transform: none;
  font-size: 0.6875rem;
  line-height: 1.5;
}

.pub-meta {
  display: grid;
  grid-template-columns: 7rem 1fr;
  gap: 0.4rem 0.85rem;
  font-family: var(--mono);
  font-size: 0.75rem;
  margin: 0 0 1.5rem;
  max-width: 36rem;
}

.pub-meta dt {
  color: var(--dim);
  letter-spacing: 0.04em;
}

.pub-meta dd {
  margin: 0;
  color: var(--muted);
}

.pub-meta dd b {
  color: var(--fg);
  font-weight: 500;
}

.pub-meta .dim-note {
  color: var(--dim);
}

.abstract {
  border: 1px solid var(--border);
  padding: 1rem 1.1rem;
  margin: 0 0 1.75rem;
  max-width: 38rem;
  background: var(--surface);
}

.abstract .h {
  font-family: var(--mono);
  font-size: 0.625rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--dim);
  margin-bottom: 0.55rem;
}

.abstract p {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.65;
  color: var(--muted);
}

.refs {
  font-size: 0.8125rem;
  color: var(--muted);
  line-height: 1.7;
  max-width: 38rem;
}

.refs ol {
  margin: 0.5rem 0 0;
  padding-left: 1.25rem;
}

.spec-strip {
  margin-top: 2.25rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--dim);
  letter-spacing: 0.02em;
  max-width: 36rem;
}

.spec-strip span {
  color: var(--muted);
}

.qa {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  max-width: 36rem;
}

.qa .q {
  font-size: 0.875rem;
  color: var(--fg);
  font-weight: 500;
  margin-bottom: 0.35rem;
}

.qa .q::before {
  content: none;
}

.qa .a {
  font-size: 0.875rem;
  color: var(--muted);
  line-height: 1.65;
}

.qa .a::before {
  content: none;
}

.diagram {
  display: flex;
  align-items: center;
  gap: 0;
  margin: 1.75rem 0 2rem;
  max-width: 36rem;
}

.diagram .node {
  border: 1px solid var(--border-hi);
  background: var(--surface);
  padding: 0.65rem 0.85rem;
  font-family: var(--mono);
  font-size: 0.625rem;
  letter-spacing: 0.08em;
  color: var(--muted);
  text-transform: uppercase;
  white-space: nowrap;
}

.diagram .link {
  flex: 1;
  height: 1px;
  min-width: 1.25rem;
  background: var(--border-hi);
}

.redact {
  display: inline-block;
  background: #1a1a1a;
  box-shadow: inset 0 0 0 1px #2a2a2a;
  color: transparent;
  border-radius: 0;
  padding: 0 0.2rem;
  user-select: none;
  -webkit-user-select: none;
  vertical-align: baseline;
}

/* ── Footer ── */
.doc-footer {
  position: relative;
  z-index: 2;
  width: min(100% - 2 * var(--nav-pad), var(--page));
  margin: 0 auto;
  padding: 1.15rem 0 2.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.1rem;
  font-family: var(--mono);
  font-size: 0.5625rem;
  letter-spacing: 0.05em;
  color: var(--dim);
  border-top: 1px solid var(--border);
}

.doc-footer b {
  color: var(--dim);
  font-weight: 500;
}

.metric-note {
  font-family: var(--mono);
  font-size: 0.625rem;
  color: var(--dim);
  margin: 0.35rem 0 1.5rem;
  line-height: 1.5;
}

.metric-note a {
  color: var(--cyan-dim);
}

/* ── Gate: pure aperture ── */
body[data-doc="NC-GATE-0000"] {
  min-height: 100vh;
  background: #000;
}

body[data-doc="NC-GATE-0000"] .gate {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1rem 1.5rem 3rem;
  width: 100%;
  margin: 0;
  gap: 0;
}

.sync-instrument {
  width: min(100%, 20rem);
  display: flex;
  flex-direction: column;
  align-items: center;
  border: none;
  background: transparent;
  padding: 0;
}

.instrument-head,
.instrument-state,
.instrument-foot,
.instrument-mark p {
  display: none;
}

.instrument-body {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.instrument-mark {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 2.75rem;
}

.instrument-mark img {
  width: 168px;
  height: auto;
  display: block;
}

.instrument-controls {
  width: 100%;
}

.gate-form {
  width: 100%;
  display: flex;
  flex-direction: column;
}

.gate-form.shake {
  animation: shake 0.4s ease;
}

@keyframes shake {
  10%,
  90% {
    transform: translateX(-1px);
  }
  20%,
  80% {
    transform: translateX(2px);
  }
  30%,
  50%,
  70% {
    transform: translateX(-3px);
  }
  40%,
  60% {
    transform: translateX(3px);
  }
}

.field {
  margin-bottom: 1rem;
}

.field label {
  display: block;
  font-family: var(--mono);
  font-size: 0.625rem;
  letter-spacing: 0.12em;
  color: var(--dim-text);
  margin-bottom: 0.4rem;
  text-transform: uppercase;
}

.field label span {
  color: var(--dim);
  margin-right: 0.45rem;
  opacity: 0.7;
}

.field input {
  width: 100%;
  background: #0a0a0a;
  border: 1px solid #2a2a2a;
  color: var(--fg);
  font-family: var(--font);
  font-size: 0.8125rem;
  padding: 0.7rem 0.85rem;
  border-radius: 999px;
  outline: none;
  letter-spacing: 0.02em;
  transition: border-color 0.15s ease;
}

.field input:focus {
  border-color: #3a3a3a;
}

#syncBtn {
  position: relative;
  overflow: hidden;
  margin-top: 0.35rem;
  width: 100%;
  background: #141414;
  border: 1px solid #2a2a2a;
  color: var(--muted);
  font-family: var(--font);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 0.75rem;
  border-radius: 999px;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}

#syncBtn:hover {
  border-color: #3a3a3a;
  color: var(--fg);
}

#syncBtn::before {
  content: "";
  position: absolute;
  inset: 0;
  width: 100%;
  background: rgba(0, 229, 255, 0.12);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 5s linear;
}

#syncBtn.holding::before {
  transform: scaleX(1);
}

#syncBtn.no-transition::before {
  transition: none !important;
}

#syncBtn.unlocked {
  border-color: var(--green-dim);
  color: var(--green);
}

#syncBtn.unlocked::before {
  background: rgba(34, 197, 94, 0.12);
}

#syncBtn span {
  position: relative;
  z-index: 1;
}

.errorlog {
  margin-top: 1rem;
  font-family: var(--mono);
  font-size: 0.6875rem;
  color: var(--red);
  letter-spacing: 0.02em;
  text-align: center;
  min-height: 1rem;
  line-height: 1.5;
}

.errorlog .ts {
  display: block;
  margin-top: 0.25rem;
  color: var(--dim);
  font-size: 0.625rem;
}

.gate-privacy {
  margin: 0.65rem 0 0;
  color: var(--dim);
  font-family: var(--mono);
  font-size: 0.5625rem;
  line-height: 1.5;
  letter-spacing: 0.03em;
  text-align: center;
}

.edge-links {
  position: absolute;
  bottom: 1.75rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem 1.5rem;
  font-family: var(--mono);
  font-size: 0.5625rem;
  letter-spacing: 0.08em;
}

.edge-links a {
  color: var(--dim-text);
  opacity: 1;
  transition: opacity 0.15s ease, color 0.15s ease;
}

.edge-links a:hover {
  color: var(--muted);
  opacity: 1;
}

.edge-links a span {
  color: var(--dim);
  margin-right: 0.45rem;
}

/* ── Print ── */
@media print {
  body {
    background: #fff !important;
    color: #111 !important;
    font-size: 11pt;
  }

  .topbar,
  .recordrail,
  .edge-links {
    display: none !important;
  }

  .classbar,
  .letterhead,
  .shell,
  .doc-footer,

  .classbar {
    border-color: #999;
    color: #333;
  }

  .content h1,
  .prose p,
  .prose p strong,
  .datatable td,
  .doc-footer b {
    color: #111 !important;
  }

  .prose p.muted,
  .datatable th,
  .doc-footer {
    color: #444 !important;
  }

  a {
    color: #000 !important;
    text-decoration: underline;
  }

  .shell {
    min-height: 0;
  }

  .doc-footer::before {
    content: "CONTROLLED DOCUMENT - TIER 0 EXTRACT";
    display: block;
    flex-basis: 100%;
    margin-bottom: 0.5rem;
    font-size: 8pt;
    letter-spacing: 0.12em;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  #syncBtn::before {
    transition: none !important;
  }
}

@media (max-width: 560px) {
  :root {
    --nav-pad: 1.1rem;
  }

  .content {
    padding-top: 1.5rem;
  }

  .content h1 {
    font-size: 1.25rem;
  }

  .xref li {
    flex-direction: column;
    gap: 0.15rem;
  }

  .xref li .n {
    width: auto;
  }

  .field input,
  #syncBtn {
    border-radius: 8px;
  }
}
