/* ───────────────────────────────────────────────────────────────────────────
   Operator Console — an in-browser readonly terminal that runs real fleet commands
   tinyblue.dev · Liquid Glass terminal emulator
   Reuses landing.css tokens (--ink, --bg, --tb-blue, --radius-*, --ease, term-*).
   Self-contained; only depends on the site's existing :root variables.
   ─────────────────────────────────────────────────────────────────────────── */

:root {
  --oc-phosphor: #6ea0e8;
  --oc-glow: rgba(110, 160, 232, 0.35);
  --oc-pane: rgba(10, 11, 14, 0.78);
  --oc-pane-solid: #0b0b0d;
  --oc-edge: rgba(255, 255, 255, 0.10);
  --oc-edge-spec: rgba(255, 255, 255, 0.22);
}

/* ────────── Launch button (nav) ────────── */
.oc-launch {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  padding: 0 13px;
  border: 1px solid var(--rule-strong, rgba(0,0,0,.14));
  border-radius: 999px;
  background: color-mix(in oklab, var(--bg-elev, #fff) 88%, transparent);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  backdrop-filter: blur(14px) saturate(160%);
  color: var(--ink);
  font: 600 12.5px/1 var(--font-sans);
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: transform 200ms var(--ease), border-color 200ms var(--ease), box-shadow 200ms var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.oc-launch:hover {
  transform: translateY(-1px);
  border-color: var(--tb-blue-ring, rgba(31,78,138,.25));
  box-shadow: 0 6px 22px -8px var(--oc-glow);
}
.oc-launch:active { transform: translateY(0); }
.oc-launch__dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: #28c840;
  box-shadow: 0 0 0 0 rgba(40,200,64,.55);
  animation: oc-pulse 2.4s var(--ease) infinite;
}
.oc-launch__kbd {
  font: 600 10.5px/1 var(--font-mono);
  color: var(--ink-mute);
  padding: 2px 5px;
  border-radius: 5px;
  border: 1px solid var(--rule, rgba(0,0,0,.08));
  background: color-mix(in oklab, var(--ink) 5%, transparent);
}
@keyframes oc-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(40,200,64,.5); }
  70%  { box-shadow: 0 0 0 7px rgba(40,200,64,0); }
  100% { box-shadow: 0 0 0 0 rgba(40,200,64,0); }
}
@media (max-width: 720px) { .oc-launch__kbd { display: none; } }

/* ────────── Overlay scrim ────────── */
.oc-overlay {
  position: fixed;
  inset: 0;
  z-index: 1400;            /* above nav (50), below the bottom network-bar's own modals */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(12px, 3vw, 40px);
  background: rgba(8, 9, 12, 0.46);
  -webkit-backdrop-filter: blur(10px) saturate(120%);
  backdrop-filter: blur(10px) saturate(120%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 280ms var(--ease);
}
.oc-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

/* ────────── The glass console pane ────────── */
.oc-pane {
  position: relative;
  width: min(960px, 100%);
  height: min(76vh, 720px);
  display: flex;
  flex-direction: column;
  border-radius: 18px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(20,22,28,.62), rgba(8,9,12,.82)),
    var(--oc-pane);
  -webkit-backdrop-filter: blur(30px) saturate(180%);
  backdrop-filter: blur(30px) saturate(180%);
  border: 1px solid var(--oc-edge);
  box-shadow:
    0 1px 0 0 var(--oc-edge-spec) inset,           /* specular top edge */
    0 0 0 1px rgba(0,0,0,.5),
    0 40px 120px -30px rgba(0,0,0,.7);
  transform: scale(.965) translateY(10px);
  opacity: 0;
  transition: transform 320ms var(--ease), opacity 280ms var(--ease);
}
.oc-overlay.is-open .oc-pane {
  transform: scale(1) translateY(0);
  opacity: 1;
}
/* subtle scanline / phosphor glow film */
.oc-pane::after {
  content: "";
  position: absolute; inset: 0;
  pointer-events: none;
  background:
    repeating-linear-gradient(180deg, rgba(255,255,255,.012) 0 1px, transparent 1px 3px),
    radial-gradient(120% 80% at 50% -10%, var(--oc-glow), transparent 60%);
  mix-blend-mode: screen;
  opacity: .5;
}

/* ────────── Title bar ────────── */
.oc-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 16px;
  background: rgba(255,255,255,.035);
  border-bottom: 1px solid rgba(255,255,255,.07);
  flex: 0 0 auto;
  z-index: 2;
}
.oc-dot { width: 11px; height: 11px; border-radius: 50%; background: #3a3a3f; }
.oc-dot--r { background: #ff5f57; }
.oc-dot--y { background: #febc2e; }
.oc-dot--g { background: #28c840; }
.oc-bar__title {
  margin-left: 8px;
  font: 500 12px/1 var(--font-mono);
  color: #9a9aa0;
  letter-spacing: .04em;
}
.oc-bar__live {
  margin-left: auto;
  display: inline-flex; align-items: center; gap: 6px;
  font: 600 10.5px/1 var(--font-mono);
  color: #57d28a;
  letter-spacing: .08em;
}
.oc-bar__live i {
  width: 6px; height: 6px; border-radius: 50%;
  background: #57d28a; box-shadow: 0 0 8px #57d28a;
  animation: oc-pulse-g 2s var(--ease) infinite;
}
@keyframes oc-pulse-g { 50% { opacity: .35; } }
.oc-bar__close {
  margin-left: 12px;
  width: 26px; height: 26px;
  display: grid; place-items: center;
  border: none; border-radius: 7px;
  background: rgba(255,255,255,.06);
  color: #c8c8cf; cursor: pointer;
  font: 400 16px/1 var(--font-sans);
  transition: background 160ms var(--ease), color 160ms var(--ease);
}
.oc-bar__close:hover { background: rgba(255,95,87,.22); color: #ff8b85; }

/* ────────── Output area ────────── */
.oc-body {
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 16px 18px 8px;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.62;
  color: #e8e8ec;
  font-variant-numeric: tabular-nums;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.18) transparent;
  z-index: 1;
}
.oc-body::-webkit-scrollbar { width: 9px; }
.oc-body::-webkit-scrollbar-thumb { background: rgba(255,255,255,.16); border-radius: 6px; }

.oc-row { white-space: pre-wrap; word-break: break-word; }
.oc-row--cmd { color: #f5f5f7; margin-top: 6px; }
.oc-row--cmd .oc-ps { color: var(--oc-phosphor); margin-right: 8px; }
.oc-block {
  margin: 4px 0 10px;
  animation: oc-fade-in 300ms var(--ease) both;
}
@keyframes oc-fade-in { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: none; } }

/* coloured tokens (mirror landing.css term-*) */
.oc-out  { color: #a1a1a6; }
.oc-ok   { color: #57d28a; }
.oc-warn { color: #ffd07b; }
.oc-err  { color: #ff8b85; }
.oc-key  { color: #b39df3; }
.oc-cmd  { color: #f5f5f7; }
.oc-dim  { color: #6e6e73; }
.oc-accent { color: var(--oc-phosphor); }
.oc-strong { color: #f5f5f7; font-weight: 600; }

/* monospace tables */
.oc-table { display: table; width: 100%; border-collapse: collapse; }
.oc-tr { display: table-row; }
.oc-td { display: table-cell; padding: 1px 12px 1px 0; white-space: nowrap; }
.oc-td--bar { width: 100%; }

/* sparkbar (block-element gauges) */
.oc-spark { letter-spacing: .5px; }
.oc-sb-fill { color: var(--oc-phosphor); }
.oc-sb-empty { color: rgba(255,255,255,.12); }

/* freshness pips */
.oc-pip { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 3px; vertical-align: middle; }
.oc-pip--fresh { background: #57d28a; box-shadow: 0 0 6px rgba(87,210,138,.6); }
.oc-pip--aging { background: #ffd07b; box-shadow: 0 0 6px rgba(255,208,123,.5); }
.oc-pip--stale { background: #ff8b85; }

/* AI streaming cursor */
.oc-stream-cursor {
  display: inline-block;
  width: 7px; height: 1.05em;
  vertical-align: -0.16em;
  background: var(--oc-phosphor);
  margin-left: 1px;
  animation: oc-blink 1s steps(1) infinite;
}
@keyframes oc-blink { 50% { opacity: 0; } }

/* hyperlinks inside output */
.oc-link { color: var(--oc-phosphor); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.oc-link:hover { color: #9cc0f2; }

/* ────────── Command chips ────────── */
.oc-chips {
  display: flex;
  gap: 6px;
  flex-wrap: nowrap;
  overflow-x: auto;
  padding: 8px 16px;
  border-top: 1px solid rgba(255,255,255,.06);
  scrollbar-width: none;
  flex: 0 0 auto;
  z-index: 2;
}
.oc-chips::-webkit-scrollbar { display: none; }
.oc-chip {
  flex: 0 0 auto;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.05);
  color: #c8c8cf;
  font: 500 11.5px/1 var(--font-mono);
  cursor: pointer;
  white-space: nowrap;
  transition: background 160ms var(--ease), border-color 160ms var(--ease), color 160ms var(--ease), transform 160ms var(--ease);
}
.oc-chip:hover {
  background: rgba(110,160,232,.18);
  border-color: var(--oc-phosphor);
  color: #fff;
  transform: translateY(-1px);
}

/* ────────── Prompt input ────────── */
.oc-prompt {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px 14px;
  border-top: 1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.025);
  flex: 0 0 auto;
  z-index: 2;
}
.oc-prompt__ps {
  font: 600 14px/1 var(--font-mono);
  color: var(--oc-phosphor);
  flex: 0 0 auto;
}
.oc-prompt__input {
  flex: 1 1 auto;
  min-width: 0;
  background: transparent;
  border: none;
  outline: none;
  color: #f5f5f7;
  font: 400 14px/1.4 var(--font-mono);
  caret-color: var(--oc-phosphor);
  letter-spacing: .01em;
}
.oc-prompt__input::placeholder { color: #5a5a60; }
.oc-prompt__hint {
  flex: 0 0 auto;
  font: 500 10.5px/1 var(--font-mono);
  color: #5a5a60;
  letter-spacing: .03em;
}

/* ────────── Inline (hero) mount differs from overlay ────────── */
.oc-overlay--inline {
  position: static;
  inset: auto;
  padding: 0;
  background: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  opacity: 1;
  pointer-events: auto;
}
.oc-overlay--inline .oc-pane {
  width: 100%;
  height: 460px;
  transform: none;
  opacity: 1;
}

/* ────────── Light theme tuning (pane stays dark — it's a terminal — but soften scrim) ────────── */
:root[data-theme="light"] .oc-overlay,
:root:not([data-theme="dark"]) .oc-overlay {
  background: rgba(20, 22, 28, 0.34);
}

/* ────────── Reduced motion ────────── */
@media (prefers-reduced-motion: reduce) {
  .oc-overlay, .oc-pane, .oc-block, .oc-launch { transition: opacity 120ms linear; animation: none !important; }
  .oc-pane { transform: none; }
  .oc-launch__dot, .oc-bar__live i, .oc-stream-cursor { animation: none !important; }
  .oc-pane::after { display: none; }
}

/* ────────── Small screens ────────── */
@media (max-width: 600px) {
  .oc-pane { height: 88vh; width: 100%; border-radius: 14px; }
  .oc-body { font-size: 12px; }
  .oc-bar__title { display: none; }
}
