/* Cartograph MK-IV — Capture Zone Registry (Variante 2).
   A diegetic amber-phosphor terminal in the World Atlas design family.
   Scoped to #capture-terminal; consumes only the :root tokens. */

#capture-terminal,
#capture-terminal * { box-sizing: border-box; }
#capture-terminal {
  color-scheme: dark;
  --ct-amber: var(--yellow);
  --ct-amber-hi: var(--yellow-2);
  --ct-amber-dim: rgba(245, 178, 27, 0.55);
  --ct-amber-soft: rgba(245, 178, 27, 0.25);
  --ct-amber-faint: rgba(245, 178, 27, 0.12);
  --ct-screen: #0a0703;
  --ct-mono: "Cascadia Mono", Consolas, "Courier New", monospace;
}
#capture-terminal [hidden] { display: none !important; }
#capture-terminal img { display: block; max-width: 100%; }
#capture-terminal button { color: inherit; font: inherit; }

#capture-terminal a:focus-visible,
#capture-terminal button:focus-visible {
  outline: 2px solid var(--ct-amber-hi);
  outline-offset: 2px;
}

/* ===== Atlas mode switch (page-level composition; v026 module untouched) ===== */

#atlas .atlas-mode-switch {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 26px;
  padding: 10px 12px;
  border: 1px solid rgba(245, 178, 27, 0.38);
  border-bottom: 0;
  background: rgba(5, 5, 5, 0.82);
}
#atlas .atlas-mode-switch button {
  min-height: 44px;
  padding: 8px 18px;
  border: 1px solid var(--line-soft);
  border-radius: 0;
  background: rgba(17, 17, 20, 0.9);
  color: var(--paper-dim);
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.055em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}
#atlas .atlas-mode-switch button:hover { color: var(--text); border-color: var(--line); }
#atlas .atlas-mode-switch button[aria-pressed="true"] {
  color: #050505;
  background: var(--yellow);
  border-color: var(--yellow);
}
#atlas .atlas-mode-switch button[disabled] { opacity: 0.45; cursor: not-allowed; }
#atlas .atlas-mode-switch .atlas-full {
  margin-left: auto;
  border-color: rgba(245, 178, 27, 0.4);
  color: var(--yellow);
}
#atlas .atlas-mode-switch .atlas-full[aria-pressed="true"] {
  color: #050505;
  background: var(--yellow);
  border-color: var(--yellow);
}
#atlas .atlas-mode-switch button:focus-visible {
  outline: 2px solid var(--yellow-2);
  outline-offset: 2px;
}
#atlas .atlas-mode-panel > .atlas-window { margin-top: 0; }
#atlas .atlas-mode-panel #capture-terminal { margin-top: 0; }
/* without JavaScript both instruments render stacked; give the second air */
#atlas .atlas-mode-panel[data-atlas-mode-panel="capture"]:not([hidden]) { margin-top: 0; }

/* ===== Casing ===== */

#capture-terminal {
  position: relative;
  margin-top: 30px;
  border: 1px solid rgba(245, 178, 27, 0.38);
  background: linear-gradient(155deg, rgba(18, 18, 21, 0.98), rgba(7, 7, 9, 0.98));
  box-shadow: 0 18px 54px rgba(0, 0, 0, 0.28);
}

/* ===== Top bar ===== */

#capture-terminal .capterm-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 54px;
  padding: 7px 16px;
  border-bottom: 1px solid var(--line-soft);
  background: rgba(5, 5, 5, 0.82);
}
#capture-terminal .capterm-toolbar-label {
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ct-amber);
}

/* Atlas world-context header band */
#capture-terminal .capterm-context {
  padding: 16px 20px;
  border-bottom: 1px solid var(--line-soft);
  background: linear-gradient(145deg, rgba(23, 23, 25, 0.82), rgba(10, 10, 10, 0.76));
}
#capture-terminal .capterm-context-id {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}
#capture-terminal .capterm-kicker {
  display: block;
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ct-amber);
}
#capture-terminal .capterm-context-id strong {
  display: block;
  font-family: var(--mono);
  font-size: clamp(1.7rem, 2.8vw, 2.6rem);
  font-weight: 900;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  color: var(--ct-amber);
  line-height: 0.98;
}

/* ===== Screen ===== */

#capture-terminal .capterm-screen {
  position: relative;
  margin: 14px;
  border: 1px solid var(--ct-amber-soft);
  background:
    radial-gradient(120% 95% at 50% 38%, #150e04 0%, var(--ct-screen) 52%, #050301 100%);
  overflow: hidden;
}
/* phosphor bloom + scanlines + vignette above the content, below nothing interactive */
#capture-terminal .capterm-screen::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 5;
  background:
    repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.16) 0 1px, transparent 1px 3px);
  box-shadow:
    inset 0 0 110px rgba(0, 0, 0, 0.55),
    inset 0 0 34px rgba(245, 178, 27, 0.05);
}

#capture-terminal .capterm-stage {
  display: flex;
  align-items: stretch;
  height: clamp(500px, 62vh, 640px);
}

/* ===== Radar map ===== */

#capture-terminal .capterm-map {
  position: relative;
  flex: none;
  height: 100%;
  aspect-ratio: 1 / 1;
  max-width: 56%;
  border-right: 1px solid var(--ct-amber-faint);
}
#capture-terminal .capterm-map svg {
  display: block;
  width: 100%;
  height: 100%;
  cursor: crosshair;
}
#capture-terminal .capterm-sector { cursor: crosshair; }
#capture-terminal .capterm-grid path {
  stroke: rgba(245, 178, 27, 0.1);
  stroke-width: 1;
  fill: none;
}
#capture-terminal .capterm-ring {
  fill: none;
  stroke: var(--ct-amber-soft);
  stroke-width: 1;
}
#capture-terminal .capterm-known {
  fill: none;
  stroke: var(--ct-amber-dim);
  stroke-width: 1.4;
}
#capture-terminal .capterm-home-arc {
  fill: none;
  stroke: rgba(245, 178, 27, 0.35);
  stroke-width: 7;
}
#capture-terminal .capterm-home-arc-vachar { stroke-dasharray: 2 7; }
#capture-terminal .capterm-home-arc-noricum { stroke-dasharray: 12 7; }
#capture-terminal .capterm-home-label {
  fill: rgba(245, 178, 27, 0.55);
  font-family: var(--ct-mono);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-anchor: middle;
}
#capture-terminal .capterm-nebula circle {
  fill: rgba(245, 178, 27, 0.07);
  stroke: var(--ct-amber-dim);
  stroke-width: 1.1;
}
#capture-terminal .capterm-nebula text {
  fill: var(--ct-amber);
  font-family: var(--ct-mono);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-anchor: middle;
}
#capture-terminal .capterm-world circle {
  fill: rgba(245, 178, 27, 0.16);
  stroke: rgba(245, 178, 27, 0.85);
  stroke-width: 1.8;
}
#capture-terminal .capterm-world text {
  fill: var(--ct-amber-dim);
  font-family: var(--ct-mono);
  font-size: 16px;
  letter-spacing: 0.07em;
  text-anchor: middle;
  text-transform: uppercase;
}
#capture-terminal .capterm-sector polygon {
  fill: rgba(245, 178, 27, 0.03);
  stroke: rgba(245, 178, 27, 0.38);
  stroke-width: 1.1;
  transition: fill 0.18s ease, stroke 0.18s ease;
}
#capture-terminal .capterm-sector text {
  fill: rgba(245, 178, 27, 0.78);
  font-family: var(--ct-mono);
  font-size: 27px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-anchor: middle;
  pointer-events: none;
}
#capture-terminal .capterm-sector:hover polygon,
#capture-terminal .capterm-sector:focus polygon {
  fill: rgba(245, 178, 27, 0.14);
  stroke: var(--ct-amber);
}
#capture-terminal .capterm-sector:focus { outline: none; }
#capture-terminal .capterm-sector:focus-visible polygon {
  stroke: var(--ct-amber-hi);
  stroke-width: 2.6;
}
#capture-terminal .capterm-sector[aria-current="true"] polygon {
  fill: rgba(245, 178, 27, 0.2);
  stroke: var(--ct-amber-hi);
  stroke-width: 2;
  filter: drop-shadow(0 0 7px rgba(245, 178, 27, 0.55));
}
#capture-terminal .capterm-sector[aria-current="true"] text {
  fill: #ffd75a;
  font-weight: 900;
}

/* Decorative ambient contacts (positions are random fiction).
   Each blip shares the sweep's 9s cycle; its animation-delay encodes its
   polar angle and its clock is synced to the sweep by the script, so it
   paints exactly when the beam crosses it and then decays like phosphor. */
#capture-terminal .capterm-blips { pointer-events: none; }
#capture-terminal .capterm-blip {
  fill: #ffd75a;
  opacity: 0;
  filter: drop-shadow(0 0 5px rgba(255, 215, 90, 0.75));
  animation: capterm-blip-flash 9s linear infinite;
}
@keyframes capterm-blip-flash {
  0% { opacity: 1; }
  2% { opacity: 0.85; }
  24% { opacity: 0; }
  100% { opacity: 0; }
}

/* target reticle and one-shot selection ping */
#capture-terminal .capterm-reticle { pointer-events: none; }
#capture-terminal .capterm-reticle path {
  stroke: #ffd75a;
  stroke-width: 2.2;
  fill: none;
  transform-box: fill-box;
  transform-origin: center;
  animation: capterm-retpulse 2.6s ease-in-out infinite;
}
@keyframes capterm-retpulse { 50% { opacity: 0.45; } }
#capture-terminal .capterm-reticle.is-lock path {
  animation:
    capterm-lock 0.45s cubic-bezier(0.2, 0.8, 0.2, 1) both,
    capterm-retpulse 2.6s ease-in-out 0.45s infinite;
}
@keyframes capterm-lock {
  0% { transform: scale(2.6); opacity: 0; }
  60% { opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}
#capture-terminal .capterm-lockring {
  fill: none;
  stroke: #ffd75a;
  stroke-width: 1.6;
  stroke-dasharray: 12 38;
  opacity: 0;
  transform-box: fill-box;
  transform-origin: center;
}
#capture-terminal .capterm-reticle.is-lock .capterm-lockring {
  animation: capterm-lockspin 0.7s ease-out both;
}
@keyframes capterm-lockspin {
  0% { opacity: 0.9; transform: rotate(150deg) scale(1.7); }
  70% { opacity: 0.55; transform: rotate(0deg) scale(1); }
  100% { opacity: 0; transform: rotate(0deg) scale(1); }
}
#capture-terminal .capterm-ping {
  fill: none;
  stroke: #ffd75a;
  stroke-width: 2;
  opacity: 0;
  pointer-events: none;
  transform-box: fill-box;
  transform-origin: center;
}
#capture-terminal .capterm-ping.is-ping { animation: capterm-ping 0.7s ease-out; }
@keyframes capterm-ping {
  0% { opacity: 0.9; transform: scale(0.35); }
  100% { opacity: 0; transform: scale(2.4); }
}

/* radar sweep (decorative) */
#capture-terminal .capterm-sweep {
  pointer-events: none;
  transform-box: view-box;
  transform-origin: 500px 500px;
  animation: capterm-sweep 9s linear infinite;
}
#capture-terminal .capterm-sweep path { fill: url(#capterm-sweep-grad); }
#capture-terminal .capterm-sweep line {
  stroke: rgba(255, 215, 90, 0.7);
  stroke-width: 1.6;
}
@keyframes capterm-sweep { to { transform: rotate(360deg); } }

/* Atlas monitor treatment over the radar plot */
#capture-terminal .capterm-monitor {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  background:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.045) 0 1px, transparent 1px 3px),
    linear-gradient(180deg, rgba(120, 247, 255, 0.02), rgba(245, 178, 27, 0.028) 55%, rgba(0, 0, 0, 0) 100%);
  box-shadow: inset 0 0 90px rgba(0, 0, 0, 0.6);
  overflow: hidden;
}
#capture-terminal .capterm-monitor::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -12%;
  height: 10%;
  background: linear-gradient(180deg, transparent, rgba(245, 178, 27, 0.07), transparent);
  animation: capterm-scanbar 13s ease-in-out infinite;
}
@keyframes capterm-scanbar {
  0% { top: -12%; }
  55% { top: 104%; }
  100% { top: 104%; }
}
#capture-terminal .capterm-monitor::after {
  content: "";
  position: absolute;
  inset: 9px;
  opacity: 0.4;
  background-image:
    linear-gradient(var(--ct-amber), var(--ct-amber)), linear-gradient(var(--ct-amber), var(--ct-amber)),
    linear-gradient(var(--ct-amber), var(--ct-amber)), linear-gradient(var(--ct-amber), var(--ct-amber)),
    linear-gradient(var(--ct-amber), var(--ct-amber)), linear-gradient(var(--ct-amber), var(--ct-amber)),
    linear-gradient(var(--ct-amber), var(--ct-amber)), linear-gradient(var(--ct-amber), var(--ct-amber));
  background-repeat: no-repeat;
  background-size: 22px 1px, 1px 22px, 22px 1px, 1px 22px, 22px 1px, 1px 22px, 22px 1px, 1px 22px;
  background-position: left top, left top, right top, right top, left bottom, left bottom, right bottom, right bottom;
}

/* map corner readouts */
#capture-terminal .capterm-map-corner {
  position: absolute;
  z-index: 3;
  font-family: var(--ct-mono);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ct-amber-dim);
  pointer-events: none;
}
#capture-terminal .capterm-map-corner-tl { top: 10px; left: 12px; }
#capture-terminal .capterm-map-corner-tr { top: 10px; right: 12px; }
#capture-terminal .capterm-map-corner-bl { bottom: 10px; left: 12px; }
#capture-terminal .capterm-map-readout {
  position: absolute;
  z-index: 3;
  right: 12px;
  bottom: 10px;
  margin: 0;
  padding: 5px 9px;
  border: 1px solid var(--ct-amber-soft);
  background: rgba(5, 3, 1, 0.8);
  font-family: var(--ct-mono);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ct-amber);
}

/* Return surface over the exposed radar strip (expanded state only) */
#capture-terminal .capterm-map-return {
  position: absolute;
  inset: 0;
  z-index: 4;
  border: 0;
  border-radius: 0;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  padding: 14px;
}
#capture-terminal .capterm-map-return:hover { background: rgba(245, 178, 27, 0.05); }
#capture-terminal .capterm-map-return span {
  padding: 6px 10px;
  border: 1px solid var(--ct-amber-dim);
  background: rgba(5, 3, 1, 0.85);
  font-family: var(--ct-mono);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ct-amber);
  white-space: nowrap;
}

/* ===== Record readout ===== */

#capture-terminal .capterm-dossier {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: 16px 20px 14px;
}
#capture-terminal .capterm-dossier-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--ct-amber-faint);
}
#capture-terminal .capterm-dossier-bar button {
  flex: none;
  width: 44px;
  height: 44px;
  border: 1px solid var(--ct-amber-soft);
  border-radius: 0;
  background: rgba(10, 7, 3, 0.8);
  color: var(--ct-amber);
  font-family: var(--ct-mono);
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}
#capture-terminal .capterm-dossier-bar button:hover {
  background: var(--ct-amber);
  border-color: var(--ct-amber);
  color: #050301;
}
#capture-terminal .capterm-dossier-bar button[disabled] { opacity: 0.4; cursor: not-allowed; }
#capture-terminal .capterm-counter {
  flex: 1 1 auto;
  margin: 0;
  text-align: center;
  font-family: var(--ct-mono);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ct-amber);
}

/* Without JavaScript the console is a stacked archive at every width: the
   stage grows with its content and the plot sits above the full record list */
#capture-terminal:not([data-capterm-enhanced]) .capterm-stage {
  flex-direction: column;
  height: auto;
}
#capture-terminal:not([data-capterm-enhanced]) .capterm-map {
  width: 100%;
  max-width: min(72vw, 560px);
  height: auto;
  max-height: min(72vw, 560px);
  margin: 0 auto;
  border-right: 0;
  border-bottom: 1px solid var(--ct-amber-faint);
}
#capture-terminal:not([data-capterm-enhanced]) .capterm-scan {
  flex: none;
  height: clamp(150px, 22vw, 260px);
  min-height: 0;
}

#capture-terminal .capterm-records {
  flex: 1 1 auto;
  min-height: 0;
  position: relative;
}
#capture-terminal .capterm-record {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 6px;
}
#capture-terminal[data-capterm-enhanced] .capterm-record { position: absolute; inset: 6px 0 0 0; height: auto; padding-top: 0; }

#capture-terminal .capterm-rec-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
}
#capture-terminal .capterm-rec-code span {
  display: block;
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--ct-amber-dim);
}
#capture-terminal .capterm-rec-code strong {
  display: block;
  font-family: var(--ct-mono);
  font-size: clamp(2.3rem, 3.6vw, 3.2rem);
  font-weight: 700;
  line-height: 0.95;
  letter-spacing: 0.03em;
  color: var(--ct-amber);
  text-shadow: 0 0 18px rgba(245, 178, 27, 0.4);
}
#capture-terminal .capterm-rec-sector {
  margin: 0;
  font-family: var(--ct-mono);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--paper-dim);
}
#capture-terminal .capterm-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 9px;
  border: 1px solid var(--ct-amber-soft);
  font-family: var(--ct-mono);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ct-amber);
  white-space: nowrap;
}
#capture-terminal .capterm-status i {
  width: 9px;
  height: 9px;
  border: 1px solid var(--ct-amber);
}
#capture-terminal .capterm-status[data-status="published"] i {
  background: var(--ct-amber);
  box-shadow: 0 0 7px rgba(245, 178, 27, 0.7);
}

#capture-terminal .capterm-scan {
  position: relative;
  margin: 0;
  /* flexible middle: the scan absorbs leftover height so the fact rows and
     the survey log always stay visible inside the one-screen stage */
  flex: 1 1 auto;
  min-height: 96px;
  border: 1px solid var(--ct-amber-soft);
  background: #050301;
  overflow: hidden;
}
#capture-terminal .capterm-scan img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: sepia(0.35) hue-rotate(-12deg) saturate(1.25) contrast(1.02) brightness(0.94);
}
#capture-terminal .capterm-scan::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.18) 0 1px, transparent 1px 3px),
    linear-gradient(180deg, rgba(245, 178, 27, 0.05), transparent 30%);
}
#capture-terminal .capterm-scan figcaption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 5px 10px;
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.88));
  font-family: var(--ct-mono);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ct-amber);
}

#capture-terminal .capterm-facts { margin: 0; }
#capture-terminal .capterm-facts > div {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 4px 0;
}
#capture-terminal .capterm-facts dt {
  flex: none;
  font-family: var(--ct-mono);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--ct-amber-dim);
}
#capture-terminal .capterm-dots {
  flex: 1 1 auto;
  min-width: 20px;
  border-bottom: 1px dotted var(--ct-amber-soft);
  transform: translateY(-3px);
}
#capture-terminal .capterm-facts dd {
  flex: none;
  max-width: 60%;
  margin: 0;
  text-align: right;
  font-family: var(--ct-mono);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--paper);
  overflow-wrap: anywhere;
}

#capture-terminal .capterm-log-stack {
  margin: 0;
  flex: none;
  padding-top: 8px;
  border-top: 1px solid var(--ct-amber-faint);
}
#capture-terminal .capterm-log-stack .capterm-log { border-top: 0; padding-top: 0; }
#capture-terminal .capterm-log-stack .capterm-log + .capterm-log { margin-top: 7px; }
#capture-terminal .capterm-log-slot { display: none; }
#capture-terminal:not([data-capterm-enhanced]) .capterm-log-slot { display: block; }
#capture-terminal[data-capterm-expanded] .capterm-log-slot {
  display: block;
  animation: capterm-in 0.3s ease both;
}
#capture-terminal[data-capterm-expanded] .capterm-log-slot:nth-of-type(2) { animation-delay: 0.08s; }
#capture-terminal[data-capterm-expanded] .capterm-log-slot:nth-of-type(3) { animation-delay: 0.16s; }
#capture-terminal[data-capterm-expanded] .capterm-log-slot:nth-of-type(4) { animation-delay: 0.24s; }

#capture-terminal .capterm-log {
  margin: 0;
  flex: none;
  padding-top: 8px;
  border-top: 1px solid var(--ct-amber-faint);
  font-family: var(--ct-mono);
  font-size: 0.76rem;
  line-height: 1.5;
  color: var(--paper-dim);
}
#capture-terminal .capterm-log span {
  color: var(--ct-amber);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
#capture-terminal .capterm-cursor {
  display: inline-block;
  width: 0.55em;
  height: 0.95em;
  margin-left: 4px;
  vertical-align: text-bottom;
  background: var(--ct-amber-hi);
  animation: capterm-blink 1.15s steps(1) infinite;
}
@keyframes capterm-blink { 50% { opacity: 0; } }

/* record switch reveal (enhanced only) */
#capture-terminal[data-capterm-enhanced] .capterm-record.is-fresh > * {
  animation: capterm-in 0.3s ease both;
}
#capture-terminal[data-capterm-enhanced] .capterm-record.is-fresh > :nth-child(2) { animation-delay: 0.06s; }
#capture-terminal[data-capterm-enhanced] .capterm-record.is-fresh > :nth-child(3) { animation-delay: 0.12s; }
#capture-terminal[data-capterm-enhanced] .capterm-record.is-fresh > :nth-child(4) { animation-delay: 0.18s; }
#capture-terminal[data-capterm-enhanced] .capterm-record.is-fresh > :nth-child(5) { animation-delay: 0.24s; }
@keyframes capterm-in {
  from { opacity: 0; transform: translateY(7px); }
  to { opacity: 1; transform: translateY(0); }
}
#capture-terminal[data-capterm-enhanced] .capterm-record.is-fresh .capterm-scan img {
  animation: capterm-scanin 0.5s ease both 0.1s;
}
@keyframes capterm-scanin {
  from { clip-path: inset(0 0 100% 0); }
  to { clip-path: inset(0); }
}

#capture-terminal .capterm-noscript {
  margin: 0 14px 14px;
  padding: 10px 14px;
  border: 1px solid var(--line-soft);
  border-left: 3px solid var(--ct-amber);
  font-size: 0.84rem;
  color: var(--paper-dim);
}

/* ===== Power-on boot sequence ===== */

#capture-terminal .capterm-boot {
  position: absolute;
  inset: 0;
  z-index: 4;
  border: 0;
  border-radius: 0;
  padding: 26px;
  background: #050301;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 7px;
  cursor: pointer;
  text-align: left;
  animation: capterm-boot-out 0.45s ease 3.4s both;
}
#capture-terminal .capterm-boot::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 2px;
  background: var(--ct-amber-hi);
  box-shadow: 0 0 26px rgba(255, 204, 39, 0.85);
  animation: capterm-crt-on 0.6s ease-out both;
}
@keyframes capterm-crt-on {
  0% { transform: scaleX(0); opacity: 1; }
  45% { transform: scaleX(1); opacity: 1; }
  100% { transform: scaleX(1) scaleY(240); opacity: 0; }
}
#capture-terminal .capterm-boot-line {
  display: block;
  max-width: 100%;
  overflow: hidden;
  white-space: nowrap;
  width: 0;
  font-family: var(--ct-mono);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ct-amber);
  animation: capterm-type 0.55s steps(26, end) forwards;
}
#capture-terminal .capterm-boot-line:nth-child(1) { animation-delay: 0.75s; }
#capture-terminal .capterm-boot-line:nth-child(2) { animation-delay: 1.35s; }
#capture-terminal .capterm-boot-line:nth-child(3) { animation-delay: 1.95s; }
#capture-terminal .capterm-boot-line:nth-child(4) { animation-delay: 2.55s; }
@keyframes capterm-type { to { width: 100%; } }
@keyframes capterm-boot-out { to { opacity: 0; visibility: hidden; } }

/* the plot rebuild spans ~1.5s measured from the moment the overlay clears;
   the whole booting visual state exists only when motion is allowed, so a
   stuck class can never blank the plot under prefers-reduced-motion */
@media (prefers-reduced-motion: no-preference) {
  #capture-terminal.capterm-booting .capterm-ring,
  #capture-terminal.capterm-booting .capterm-known {
    stroke-dasharray: 100;
    stroke-dashoffset: 100;
    animation: capterm-draw 1.5s ease 3.6s forwards;
  }
  #capture-terminal.capterm-booting .capterm-sector polygon {
    fill: transparent;
    stroke-dasharray: 100;
    stroke-dashoffset: 100;
    animation: capterm-draw 1.5s ease 3.85s forwards;
  }
  #capture-terminal.capterm-booting .capterm-sector text,
  #capture-terminal.capterm-booting .capterm-world,
  #capture-terminal.capterm-booting .capterm-nebula,
  #capture-terminal.capterm-booting .capterm-home-arc,
  #capture-terminal.capterm-booting .capterm-home-label,
  #capture-terminal.capterm-booting .capterm-blips {
    opacity: 0;
    animation: capterm-fadein 0.6s ease 4.9s forwards;
  }
}
@keyframes capterm-draw { to { stroke-dashoffset: 0; } }
@keyframes capterm-fadein { to { opacity: 1; } }

/* ===== Expandable record panel (desktop two-depth composition) ===== */

@media (min-width: 1081px) {
  #capture-terminal .capterm-stage { position: relative; }
  #capture-terminal .capterm-map { border-right: 0; }
  #capture-terminal[data-capterm-enhanced] .capterm-dossier {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: min(clamp(500px, 62vh, 640px), 56%);
    z-index: 4;
    border-left: 1px solid var(--ct-amber-faint);
    background: linear-gradient(155deg, rgba(21, 14, 4, 0.97), rgba(8, 6, 2, 0.985));
    transition: left 0.45s cubic-bezier(0.3, 0.75, 0.2, 1);
  }
  #capture-terminal[data-capterm-expanded] .capterm-dossier { left: 22%; }
  #capture-terminal .capterm-map svg,
  #capture-terminal .capterm-map-corner,
  #capture-terminal .capterm-map-readout {
    transition: opacity 0.45s ease, filter 0.45s ease;
  }
  #capture-terminal[data-capterm-expanded] .capterm-map svg {
    opacity: 0.45;
    filter: brightness(0.72) saturate(0.8);
  }
  #capture-terminal[data-capterm-expanded] .capterm-map-corner,
  #capture-terminal[data-capterm-expanded] .capterm-map-readout {
    opacity: 0.4;
  }
  #capture-terminal[data-capterm-expanded] .capterm-record {
    display: grid;
    grid-template-areas:
      "log head"
      "log sector"
      "log scan"
      "log facts";
    grid-template-columns: minmax(0, 1fr) minmax(0, 56%);
    grid-template-rows: auto auto minmax(0, 1fr) auto;
    gap: 8px 22px;
  }
  #capture-terminal[data-capterm-expanded] .capterm-rec-head { grid-area: head; }
  #capture-terminal[data-capterm-expanded] .capterm-rec-sector { grid-area: sector; }
  #capture-terminal[data-capterm-expanded] .capterm-scan { grid-area: scan; }
  #capture-terminal[data-capterm-expanded] .capterm-facts { grid-area: facts; }
  #capture-terminal[data-capterm-expanded] .capterm-log-stack {
    grid-area: log;
    min-height: 0;
    overflow-y: auto;
    padding-top: 0;
    padding-right: 8px;
    border-top: 0;
    border-right: 1px solid var(--ct-amber-faint);
  }
}

/* ===== Fullscreen presentation (whole console: Worlds and Capture Zones) ===== */

#atlas [data-atlas-console]:fullscreen {
  display: flex;
  flex-direction: column;
  padding: 12px;
  background: #050505;
  overflow: auto;
}
#atlas [data-atlas-console]:fullscreen .atlas-mode-panel {
  flex: 1 1 auto;
  min-height: 0;
}
@media (min-width: 1081px) {
  #atlas [data-atlas-console]:fullscreen #capture-terminal {
    display: flex;
    flex-direction: column;
    height: 100%;
    margin-top: 0;
  }
  #atlas [data-atlas-console]:fullscreen .capterm-screen {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
  }
  #atlas [data-atlas-console]:fullscreen .capterm-stage {
    flex: 1 1 auto;
    height: calc(100vh - 290px);
  }
  #atlas [data-atlas-console]:fullscreen .capterm-dossier {
    left: min(calc(100vh - 290px), 56%);
  }
  #atlas [data-atlas-console]:fullscreen #capture-terminal[data-capterm-expanded] .capterm-dossier { left: 22%; }
}

/* ===== Responsive ===== */

@media (max-width: 1080px) {
  #capture-terminal .capterm-stage {
    flex-direction: column;
    height: auto;
  }
  #capture-terminal .capterm-scan { flex: none; height: clamp(150px, 32vw, 240px); min-height: 0; }
  #capture-terminal .capterm-map {
    width: 100%;
    max-width: none;
    height: auto;
    max-height: min(72vw, 480px);
    aspect-ratio: 1 / 1;
    margin: 0 auto;
    border-right: 0;
    border-bottom: 1px solid var(--ct-amber-faint);
  }
  #capture-terminal .capterm-record { height: auto; }
  #capture-terminal[data-capterm-enhanced] .capterm-record { position: static; inset: auto; }
  #capture-terminal .capterm-log { margin-top: 4px; }
}

@media (max-width: 680px) {
  #capture-terminal .capterm-map-corner-bl { display: none; }
  #capture-terminal .capterm-map-corner-tr { top: 30px; right: auto; left: 12px; }
  #capture-terminal .capterm-screen { margin: 10px; }
  #capture-terminal .capterm-dossier { padding: 14px 12px 12px; }
  #capture-terminal .capterm-facts dd { max-width: 55%; }
}


/* ===== Reduced motion ===== */

@media (prefers-reduced-motion: reduce) {
  #capture-terminal *,
  #capture-terminal *::before,
  #capture-terminal *::after {
    transition-duration: 0.01ms !important;
    animation: none !important;
  }
  #capture-terminal .capterm-sweep { display: none; }
  #capture-terminal .capterm-monitor::before { display: none; }
  #capture-terminal .capterm-boot { display: none; }
  #capture-terminal .capterm-blips { display: none; }
  #capture-terminal .capterm-ping { display: none; }
  #capture-terminal .capterm-cursor { opacity: 1; }
}
