/* Null Breach layer. Builds only on the shellproof.css tokens: no new palette,
   no new fonts. Adds the NULL TERMINAL search panel, technical figures,
   equations and the light code highlighter used on research pages. */

/* ---------- announcement bar + calm tag (project notice, not an advisory) ---------- */
.incident-bar .dot.dot-calm { background: var(--ok); box-shadow: none; animation: none; }
.pill .tag.tag-calm { background: var(--sev-info-bg); color: var(--fg); }
.brand .ticker { font: 500 11px/1 var(--font-mono); letter-spacing: 0.02em; color: var(--fg-faint); margin-left: 2px; }
.brand { white-space: nowrap; }
.brand-logo { width: 28px; height: 28px; object-fit: contain; flex: none; }
:root[data-theme="dark"] .brand-logo { filter: invert(1); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .brand-logo { filter: invert(1); }
}
@media (max-width: 480px) {
  .brand .ticker { display: none; }
}
.sysid { display: inline-block; font: 500 12px/1.3 var(--font-mono); color: var(--fg-muted); letter-spacing: 0.04em; margin-bottom: 18px; }

/* ---------- NULL TERMINAL ---------- */
.nt { display: flex; flex-direction: column; position: relative; }
.nt .terminal-bar { flex-wrap: wrap; row-gap: 6px; }
.nt .terminal-bar span { margin-left: 0; }
.nt-title { margin-left: 8px !important; color: var(--term-fg); font-weight: 700; letter-spacing: 0.06em; }
.nt-provider { color: var(--term-muted); }
.nt-provider::before { content: "\00b7"; margin: 0 8px; color: #3a3a40; }
.nt-provider[data-state="off"] { color: var(--term-amber); }
.nt-tools { margin-left: auto !important; display: inline-flex; gap: 6px; }
.nt-btn {
  display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 11px; border-radius: var(--radius-pill);
  border: 1px solid #2a2a2f; background: #141417; color: var(--term-fg); font: 500 12px/1 var(--font-sans); cursor: pointer;
  transition: border-color 0.15s, color 0.15s; white-space: nowrap;
}
.nt-btn:hover { border-color: #4a4a52; }
.nt-btn:focus-visible, .nt-link:focus-visible, .nt-out:focus-visible { outline: 2px solid var(--term-fg); outline-offset: 2px; }
.nt-btn[disabled] { opacity: 0.45; pointer-events: none; }
.nt-btn svg { width: 13px; height: 13px; }
.nt-out {
  height: clamp(280px, 46vh, 520px); overflow-y: auto; overscroll-behavior: contain; position: relative;
  padding: 16px 20px 8px; font-size: 12.5px; line-height: 1.65;
}
.nt[data-compact] .nt-out { height: 330px; }
.nt-line { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.nt-block + .nt-block { margin-top: 14px; padding-top: 12px; border-top: 1px dashed #1f1f23; }
.nt-echo { color: var(--term-fg); }
.nt-echo b { color: var(--term-green); font-weight: 400; }
.nt-meta { color: var(--term-muted); }
.nt-err { color: var(--term-red); }
.nt-warn { color: var(--term-amber); }
.nt-pending { color: var(--term-muted); }
.nt-pending::after { content: "_"; margin-left: 2px; animation: ntBlink 1s steps(1) infinite; }
@keyframes ntBlink { 50% { opacity: 0; } }
.nt-list { list-style: none; margin: 8px 0 0; padding: 0; }
.nt-item { display: grid; grid-template-columns: 5ch minmax(0, 1fr); margin: 0 0 12px; }
.nt-idx { color: var(--term-muted); }
.nt-body { min-width: 0; overflow-wrap: anywhere; }
.nt-link { color: #fff; font-weight: 700; text-decoration: underline; text-decoration-color: #3a3a40; text-underline-offset: 3px; }
.nt-link:hover { color: var(--term-blue); text-decoration-color: currentColor; }
.nt-url { display: block; color: var(--term-green); opacity: 0.85; }
.nt-desc { display: block; color: #a1a1aa; }
.nt-more { margin: 2px 0 6px 5ch; }
.nt-form { display: flex; align-items: center; gap: 10px; padding: 10px 12px 10px 20px; border-top: 1px solid #1c1c20; }
.nt-form:focus-within { box-shadow: inset 0 0 0 1px #3a3a40; }
.nt-prompt { color: var(--term-green); flex: none; }
.nt-input {
  flex: 1; min-width: 0; height: 32px; background: transparent; border: 0; outline: none; color: var(--term-fg);
  font: 13px/1.4 var(--font-mono); caret-color: var(--term-green);
}
.nt-input::placeholder { color: #55555d; }
.nt-privacy { margin: 12px 0 0; }
.nt[data-busy] .nt-form .nt-prompt { opacity: 0.6; }
.nt.nt-expanded { position: fixed; inset: 0; z-index: 300; border-radius: 0; border: 0; }
.nt.nt-expanded .nt-out { height: auto; flex: 1; max-height: none; }
body.nt-lock { overflow: hidden; }
@media (max-width: 640px) {
  .nt-out { padding: 14px 14px 6px; height: 60vh; }
  .nt[data-compact] .nt-out { height: 300px; }
  .nt-form { padding-left: 14px; }
  .nt-item { grid-template-columns: 4.5ch minmax(0, 1fr); }
  .nt-more { margin-left: 4.5ch; }
}
@media (prefers-reduced-motion: reduce) { .nt-pending::after { animation: none; } }

/* ---------- figures ---------- */
.fig { margin: 28px 0 32px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--bg-subtle); overflow: hidden; }
.fig-head { display: flex; justify-content: space-between; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--border); font: 500 12px/1.3 var(--font-mono); color: var(--fg-muted); letter-spacing: 0.04em; }
.fig-scroll { padding: 18px 16px 10px; min-width: 0; }
.fig svg { width: 100%; min-width: 0; max-width: 100%; height: auto; }
.fig figcaption { padding: 0 16px 14px; font-size: 13.5px; color: var(--fg-muted); line-height: 1.55; }
.fig .bx { fill: var(--bg); stroke: var(--border-strong); stroke-width: 1.2; }
.fig .bx-strong { stroke: var(--fg); stroke-width: 1.5; }
.fig .bx-dash { fill: transparent; stroke: var(--fg-faint); stroke-dasharray: 5 4; }
.fig .bx-ok { stroke: var(--ok); }
.fig .bx-bad { stroke: var(--sev-critical); }
.fig .tx { font: 500 12.5px var(--font-mono); fill: var(--fg); }
.fig .ts { font: 11px var(--font-mono); fill: var(--fg-muted); }
.fig .tl { font: 600 10.5px var(--font-sans); letter-spacing: 0.08em; fill: var(--fg-faint); }
.fig .ln { fill: none; stroke: var(--fg-muted); stroke-width: 1.3; }
.fig .ln-dash { stroke-dasharray: 4 4; }
.fig .bd { stroke: var(--sev-critical); stroke-width: 1.2; stroke-dasharray: 6 5; fill: none; }
.fig marker path { fill: var(--fg-muted); }
@media (max-width: 640px) { .fig-scroll { padding: 14px 8px 10px; } }

/* ---------- equations ---------- */
.eq {
  margin: 18px 0 22px; padding: 16px 20px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--bg); font: 16px/1.6 var(--font-mono); color: var(--fg); overflow-x: auto; text-align: center; white-space: nowrap;
}
.eq sub { font-size: 0.72em; }
.eq .op { color: var(--fg-muted); margin: 0 0.35em; }
.eq-tag { display: block; font: 600 10.5px/1 var(--font-sans); letter-spacing: 0.08em; text-transform: uppercase; color: var(--fg-faint); margin-bottom: 8px; text-align: left; }
.defs { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 18px; margin: 0 0 1.2em; font-size: 15px; }
.defs dt { font-family: var(--font-mono); color: var(--fg); }
.defs dd { margin: 0; }
.prop { border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; margin: 0 0 1.2em; background: var(--bg); }
.prop > .label { display: block; margin-bottom: 8px; }
.prop p:last-child { margin-bottom: 0; }

/* ---------- contract list ---------- */
.contract { list-style: none; counter-reset: c; padding: 0 !important; margin: 0 0 1.4em; border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.contract li { counter-increment: c; position: relative; padding: 16px 18px 16px 64px !important; margin: 0 !important; border-bottom: 1px solid var(--border); background: var(--bg); }
.contract li:last-child { border-bottom: 0; }
.contract li::before { content: "C" counter(c); position: absolute; left: 18px; top: 16px; font: 600 13px/1.6 var(--font-mono); color: var(--fg-faint); }

/* ---------- light highlighter (same token colours as the old code browser) ---------- */
.t-com { color: var(--fg-faint); font-style: italic; }
.t-str { color: var(--ok); }
.t-num { color: var(--sev-low); }
.t-kw  { color: var(--sev-critical); }
.t-lit { color: var(--sev-medium); }
.code .code-tag { font: 500 11px/1 var(--font-mono); color: var(--fg-faint); margin-left: 10px; }
.code-head > span:first-child { display: inline-flex; align-items: center; }

/* ---------- notes page ---------- */
.note-block { padding: 8px 0 28px; }
.note-block + .note-block { border-top: 1px solid var(--border); padding-top: 36px; }
.note-block .h3 { margin-bottom: 0; }
.search-notes { max-width: 860px; margin-top: 40px; }
.redirect-page { padding: 120px 0; text-align: center; }
