:root {
  --tactical-black: #02060a;
  --tactical-ink: #e9f8ff;
  --tactical-cyan: #63e8ff;
  --tactical-red: #ff4d68;
  --tactical-amber: #ffb547;
  --tactical-green: #55f6a5;
  --tactical-line: rgba(99, 232, 255, .24);
  --tactical-dim: #668092;
  --tactical-panel: rgba(4, 13, 20, .94);
  --tactical-panel-2: #071923;
}

.tactical-command-surface {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  margin-top: 18px;
  padding: 0;
  border: 1px solid var(--tactical-line);
  background: var(--tactical-black);
  box-shadow: 0 0 0 1px rgba(99, 232, 255, .05), 0 28px 80px rgba(0, 0, 0, .68), inset 0 0 70px rgba(99, 232, 255, .045);
}

.tactical-command-surface::before,
.tactical-command-surface::after {
  position: absolute;
  z-index: -1;
  inset: 0;
  pointer-events: none;
  content: "";
}

.tactical-command-surface::before {
  opacity: .34;
  background: linear-gradient(90deg, transparent 0, rgba(99, 232, 255, .08) 50%, transparent 100%), repeating-linear-gradient(0deg, transparent 0 4px, rgba(99, 232, 255, .035) 5px 6px);
  background-size: 160% 100%, 100% 6px;
  animation: tactical-scan 9s linear infinite;
}

.tactical-command-surface::after {
  background: linear-gradient(135deg, rgba(99, 232, 255, .07), transparent 27%, transparent 72%, rgba(255, 77, 104, .06));
}

@keyframes tactical-scan {
  from { background-position: -140% 0, 0 0; }
  to { background-position: 140% 0, 0 0; }
}

.tactical-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 24px 18px;
  border-bottom: 1px solid var(--tactical-line);
  background: linear-gradient(90deg, rgba(7, 25, 35, .98), rgba(2, 8, 13, .8));
}

.tactical-head h2 { margin: 4px 0 5px; color: var(--tactical-ink); font-size: clamp(18px, 3vw, 27px); letter-spacing: -.03em; }
.tactical-head p:not(.eyebrow) { max-width: 700px; margin: 0; color: var(--tactical-dim); font-size: 11px; line-height: 1.55; }
.tactical-badge,
.tactical-state,
.tactical-rail-label,
.tactical-readout-label,
.tactical-log-label,
.tactical-boot-label { font: 800 9px/1.2 "SFMono-Regular", Consolas, monospace; letter-spacing: .14em; }
.tactical-badge { flex: 0 0 auto; padding: 9px 11px; border: 1px solid var(--tactical-cyan); color: var(--tactical-cyan); box-shadow: 0 0 18px rgba(99, 232, 255, .16); }
.tactical-badge[data-state="alert"] { border-color: var(--tactical-red); color: var(--tactical-red); }

.tactical-layout { display: grid; grid-template-columns: 158px minmax(0, 1fr) 245px; min-height: 440px; }
.tactical-rail { padding: 18px 12px; border-right: 1px solid var(--tactical-line); background: rgba(2, 8, 13, .7); }
.tactical-rail-label { display: block; margin: 0 8px 13px; color: var(--tactical-dim); }
.tactical-view { width: 100%; min-height: 42px; margin: 3px 0; padding: 10px 9px; border: 1px solid transparent; border-left: 2px solid transparent; color: var(--tactical-dim); background: transparent; cursor: pointer; text-align: left; font: 800 10px/1.2 "SFMono-Regular", Consolas, monospace; letter-spacing: .04em; transition: .18s ease; }
.tactical-view:hover, .tactical-view:focus-visible { border-color: var(--tactical-line); color: var(--tactical-ink); background: rgba(99, 232, 255, .06); }
.tactical-view.is-active { border-color: var(--tactical-cyan); border-left-color: var(--tactical-amber); color: var(--tactical-cyan); background: rgba(99, 232, 255, .1); box-shadow: inset 10px 0 20px rgba(99, 232, 255, .06); }
.tactical-rail-meta { display: grid; gap: 8px; margin: 28px 8px 0; padding-top: 14px; border-top: 1px solid var(--tactical-line); }
.tactical-rail-meta span { display: block; color: var(--tactical-dim); font: 8px/1.3 "SFMono-Regular", Consolas, monospace; }
.tactical-rail-meta strong { display: block; margin-top: 3px; color: var(--tactical-green); font: 800 11px/1.2 "SFMono-Regular", Consolas, monospace; }

.tactical-field-wrap { position: relative; min-width: 0; background: radial-gradient(circle at 50% 48%, rgba(99, 232, 255, .09), transparent 47%), #02080d; }
#tactical-canvas { display: block; width: 100%; height: 100%; min-height: 440px; cursor: crosshair; }
.tactical-corner-readout { position: absolute; z-index: 1; padding: 6px 8px; border-left: 2px solid var(--tactical-cyan); color: var(--tactical-dim); background: rgba(2, 8, 13, .72); font: 8px/1.3 "SFMono-Regular", Consolas, monospace; letter-spacing: .08em; pointer-events: none; }
.tactical-corner-readout strong { color: var(--tactical-ink); }
.tactical-corner-readout.top-left { top: 13px; left: 15px; }
.tactical-corner-readout.top-right { top: 13px; right: 15px; border-left: 0; border-right: 2px solid var(--tactical-amber); text-align: right; }
.tactical-corner-readout.bottom-left { bottom: 13px; left: 15px; border-left-color: var(--tactical-red); }

.tactical-telemetry { padding: 18px 16px; border-left: 1px solid var(--tactical-line); background: rgba(5, 15, 22, .88); }
.tactical-telemetry h3 { margin: 0 0 15px; color: var(--tactical-ink); font-size: 11px; letter-spacing: .1em; }
.tactical-readouts { display: grid; gap: 10px; }
.tactical-readout { padding: 10px; border: 1px solid rgba(99, 232, 255, .14); background: rgba(7, 25, 35, .7); }
.tactical-readout-label { display: block; color: var(--tactical-dim); }
.tactical-readout strong { display: block; margin-top: 5px; color: var(--tactical-cyan); font: 800 clamp(14px, 2vw, 19px)/1.1 "SFMono-Regular", Consolas, monospace; letter-spacing: -.03em; }
.tactical-readout strong[data-tone="amber"] { color: var(--tactical-amber); }
.tactical-readout strong[data-tone="red"] { color: var(--tactical-red); }
.tactical-readout strong[data-tone="green"] { color: var(--tactical-green); }
.tactical-meter { height: 3px; margin-top: 9px; overflow: hidden; background: rgba(99, 232, 255, .1); }
.tactical-meter span { display: block; width: 68%; height: 100%; background: var(--tactical-cyan); box-shadow: 0 0 10px var(--tactical-cyan); transition: width .25s ease; }
.tactical-readout[data-readout="thermal"] .tactical-meter span { background: var(--tactical-amber); box-shadow: 0 0 10px var(--tactical-amber); }
.tactical-telemetry-note { margin: 16px 0 0; color: var(--tactical-dim); font: 9px/1.55 "SFMono-Regular", Consolas, monospace; }

.tactical-lower { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 18px; padding: 15px 18px 18px; border-top: 1px solid var(--tactical-line); background: rgba(2, 8, 13, .9); }
.tactical-log-label { display: block; margin-bottom: 8px; color: var(--tactical-dim); }
.tactical-log { display: grid; gap: 4px; min-height: 54px; margin: 0; padding: 0; list-style: none; color: var(--tactical-ink); font: 10px/1.45 "SFMono-Regular", Consolas, monospace; }
.tactical-log li { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tactical-log li::before { margin-right: 8px; color: var(--tactical-cyan); content: ">"; }
.tactical-log li[data-severity="warn"]::before { color: var(--tactical-amber); content: "!"; }
.tactical-log li[data-severity="alert"]::before { color: var(--tactical-red); content: "×"; }
.tactical-actions { display: flex; align-items: flex-end; justify-content: flex-end; flex-wrap: wrap; gap: 8px; max-width: 390px; }
.tactical-action { min-height: 40px; padding: 9px 12px; border: 1px solid var(--tactical-line); color: var(--tactical-cyan); background: transparent; cursor: pointer; font: 800 9px/1.2 "SFMono-Regular", Consolas, monospace; letter-spacing: .06em; transition: .18s ease; }
.tactical-action:hover, .tactical-action:focus-visible { border-color: var(--tactical-cyan); color: var(--tactical-black); background: var(--tactical-cyan); box-shadow: 0 0 18px rgba(99, 232, 255, .22); }
.tactical-action[data-tactical-action="burst"] { border-color: rgba(255, 181, 71, .46); color: var(--tactical-amber); }
.tactical-action[data-tactical-action="scan"] { border-color: rgba(255, 77, 104, .46); color: var(--tactical-red); }
.tactical-feedback { grid-column: 1 / -1; min-height: 16px; margin: 0; color: var(--tactical-dim); font: 9px/1.4 "SFMono-Regular", Consolas, monospace; }

.tactical-boot { position: absolute; z-index: 5; inset: 0; display: grid; place-items: center; background: rgba(2, 6, 10, .96); transition: opacity .3s ease, visibility .3s ease; }
.tactical-boot[hidden] { display: grid !important; visibility: hidden; opacity: 0; pointer-events: none; }
.tactical-boot-inner { width: min(440px, calc(100% - 44px)); padding: 20px; border: 1px solid var(--tactical-cyan); background: var(--tactical-panel); box-shadow: 0 0 40px rgba(99, 232, 255, .16); }
.tactical-boot-label { color: var(--tactical-cyan); }
.tactical-boot h3 { margin: 9px 0 5px; color: var(--tactical-ink); font-size: 18px; }
.tactical-boot p { margin: 0; color: var(--tactical-dim); font: 10px/1.5 "SFMono-Regular", Consolas, monospace; }
.tactical-boot-bar { height: 5px; margin-top: 18px; overflow: hidden; background: rgba(99, 232, 255, .13); }
.tactical-boot-bar span { display: block; width: 0; height: 100%; background: var(--tactical-cyan); box-shadow: 0 0 15px var(--tactical-cyan); transition: width .85s cubic-bezier(.2, .8, .2, 1); }

.syntax-page .terminal-panel { border-top: 2px solid var(--tactical-cyan); box-shadow: 0 24px 80px rgba(0, 0, 0, .62), inset 0 18px 0 rgba(99, 232, 255, .025); }
.syntax-page .terminal-window { border-width: 2px; box-shadow: inset 0 0 45px rgba(99, 232, 255, .055), 0 0 32px rgba(99, 232, 255, .09); }
.syntax-page .terminal-input-line { border-color: rgba(99, 232, 255, .4); background: rgba(99, 232, 255, .035); }
.syntax-page .terminal-status { border-left: 2px solid var(--tactical-green); }

@media (max-width: 900px) {
  .tactical-layout { grid-template-columns: 126px minmax(0, 1fr); }
  .tactical-telemetry { grid-column: 1 / -1; display: grid; grid-template-columns: auto 1fr; gap: 14px; border-top: 1px solid var(--tactical-line); border-left: 0; }
  .tactical-telemetry h3 { margin: 0; }
  .tactical-readouts { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .tactical-telemetry-note { grid-column: 1 / -1; margin: 0; }
}

@media (max-width: 650px) {
  .tactical-head { display: block; padding: 18px; }
  .tactical-badge { display: inline-block; margin-top: 14px; }
  .tactical-layout { display: block; }
  .tactical-rail { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; padding: 10px; border-right: 0; border-bottom: 1px solid var(--tactical-line); }
  .tactical-rail-label, .tactical-rail-meta { display: none; }
  .tactical-view { min-height: 38px; margin: 0; padding: 8px 6px; text-align: center; font-size: 8px; }
  #tactical-canvas { min-height: 320px; }
  .tactical-telemetry { display: block; padding: 14px; }
  .tactical-telemetry h3 { margin-bottom: 10px; }
  .tactical-readouts { grid-template-columns: repeat(2, 1fr); }
  .tactical-telemetry-note { margin-top: 12px; }
  .tactical-lower { display: block; padding: 14px; }
  .tactical-actions { justify-content: flex-start; margin-top: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  .tactical-command-surface::before { animation: none; }
  .tactical-boot-bar span { transition: none; }
}
