/*!
 * Gate Zero Signal Core(TM) - Web OS shell.
 * Copyright (c) 2026 Spark Fire Technologies. All rights reserved.
 * PROPRIETARY AND CONFIDENTIAL. PATENTS PENDING. See LICENSE.
 */
:root {
  --bg: #05080d;
  --panel: #0b1119;
  --panel-2: #0f1721;
  --line: #1b2634;
  --ink: #e6edf5;
  --dim: #8598ad;
  --faint: #5b6b7d;
  --accent: #00e08a;
  --accent-dim: #0b7d51;
  --warn: #ffb340;
  --bad: #ff5c6c;
  --lock: #00e08a;
  --bar: 34px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 13.5px/1.5 ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  overflow: hidden;
  user-select: none;
}
code, .mono { font-family: ui-monospace, "Cascadia Code", "SF Mono", Menlo, monospace; }

/* --- desktop ------------------------------------------------------------- */

#desktop {
  position: absolute;
  inset: 0 0 var(--bar) 0;
  background-image:
    radial-gradient(circle at 15% 0%, #0d1e2b 0%, transparent 45%),
    radial-gradient(circle at 90% 100%, #0b2018 0%, transparent 45%);
}

.window {
  position: absolute;
  display: flex;
  flex-direction: column;
  min-width: 260px;
  min-height: 140px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 9px;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.55);
  overflow: hidden;
}
.window.focused { border-color: #2b4256; box-shadow: 0 22px 54px rgba(0, 0, 0, 0.68); }
.window.minimised { display: none; }

.titlebar {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 30px;
  padding: 0 8px 0 11px;
  background: var(--panel-2);
  border-bottom: 1px solid var(--line);
  cursor: grab;
  flex: none;
}
.titlebar:active { cursor: grabbing; }
.titlebar .name { font-size: 12px; font-weight: 600; letter-spacing: 0.02em; }
.titlebar .badge {
  font-size: 10px; padding: 1px 6px; border-radius: 20px;
  background: rgba(255, 179, 64, 0.14); color: var(--warn); border: 1px solid rgba(255, 179, 64, 0.3);
}
.titlebar .spacer { flex: 1; }
.titlebar button {
  width: 18px; height: 18px; padding: 0; border: 0; border-radius: 4px;
  background: #1a2531; color: var(--dim); cursor: pointer; font-size: 12px; line-height: 1;
}
.titlebar button:hover { background: #24344a; color: var(--ink); }

.content { flex: 1; overflow: auto; padding: 12px 13px; }
.content.flush { padding: 0; }

.resize {
  position: absolute; right: 0; bottom: 0; width: 15px; height: 15px;
  cursor: nwse-resize;
  background: linear-gradient(135deg, transparent 50%, var(--line) 50%, var(--line) 68%, transparent 68%);
}

/* --- taskbar ------------------------------------------------------------- */

#taskbar {
  position: absolute; left: 0; right: 0; bottom: 0; height: var(--bar);
  display: flex; align-items: center; gap: 7px; padding: 0 10px;
  background: #080d14; border-top: 1px solid var(--line);
}
#taskbar .logo { display: flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 650; padding-right: 6px; }
#taskbar button {
  height: 22px; padding: 0 10px; border: 1px solid var(--line); border-radius: 5px;
  background: #0e1620; color: var(--dim); font-size: 11.5px; cursor: pointer; font-family: inherit;
}
#taskbar button:hover { color: var(--ink); border-color: #2b4256; }
#taskbar button.active { color: var(--accent); border-color: var(--accent-dim); }
#taskbar .grow { flex: 1; }
#status-strip { display: flex; gap: 14px; align-items: center; font-size: 11.5px; color: var(--dim); }
#status-strip b { color: var(--ink); font-weight: 600; }

/* --- shared bits --------------------------------------------------------- */

.pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 8px; border-radius: 20px; font-size: 11px; font-weight: 600;
  border: 1px solid transparent;
}
.pill.ok { background: rgba(0, 224, 138, 0.1); color: var(--accent); border-color: rgba(0, 224, 138, 0.28); }
.pill.warn { background: rgba(255, 179, 64, 0.11); color: var(--warn); border-color: rgba(255, 179, 64, 0.3); }
.pill.bad { background: rgba(255, 92, 108, 0.11); color: var(--bad); border-color: rgba(255, 92, 108, 0.3); }
.pill.neutral { background: #131c27; color: var(--dim); border-color: var(--line); }

.dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

.kv { display: grid; grid-template-columns: auto 1fr; gap: 5px 12px; font-size: 12.5px; }
.kv dt { color: var(--dim); }
.kv dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }

table { width: 100%; border-collapse: collapse; font-size: 12px; }
th { text-align: left; color: var(--faint); font-weight: 600; font-size: 10.5px;
     text-transform: uppercase; letter-spacing: 0.06em; padding: 4px 6px; border-bottom: 1px solid var(--line); }
td { padding: 5px 6px; border-bottom: 1px solid #131b25; font-variant-numeric: tabular-nums; }
tr:last-child td { border-bottom: 0; }

.muted { color: var(--dim); }
.small { font-size: 11.5px; }
h3 { font-size: 12px; text-transform: uppercase; letter-spacing: 0.07em; color: var(--faint); margin: 0 0 8px; }
h3 + * { margin-top: 0; }
hr { border: 0; border-top: 1px solid var(--line); margin: 13px 0; }

.row { display: flex; gap: 8px; align-items: center; }
.row + .row { margin-top: 8px; }
input[type="text"], input[type="number"], select {
  background: #070c12; border: 1px solid var(--line); color: var(--ink);
  border-radius: 6px; padding: 5px 8px; font-size: 12.5px; font-family: inherit; min-width: 0;
}
.btn {
  border: 1px solid var(--line); background: #101a25; color: var(--ink);
  border-radius: 6px; padding: 5px 11px; font-size: 12px; cursor: pointer; font-family: inherit;
}
.btn:hover { border-color: #2b4256; }
.btn.primary { background: var(--accent); color: #04140d; border-color: var(--accent); font-weight: 640; }
.btn.primary:hover { filter: brightness(1.08); }

/* --- spectrum ------------------------------------------------------------ */

#waterfall-wrap { position: relative; width: 100%; height: 100%; background: #03060a; }
#waterfall { display: block; width: 100%; height: 100%; image-rendering: pixelated; }
#spectrum-overlay {
  position: absolute; inset: 0; pointer-events: none;
  font: 10.5px ui-monospace, Menlo, monospace; color: var(--dim);
}
.axis-label { position: absolute; bottom: 3px; transform: translateX(-50%); text-shadow: 0 1px 3px #000; }
.lock-flag {
  position: absolute; top: 0; bottom: 0; width: 0; border-left: 1.5px dashed var(--lock);
  opacity: 0.85;
}
.lock-flag span {
  position: absolute; top: 4px; left: 5px; white-space: nowrap;
  color: var(--lock); background: rgba(3, 6, 10, 0.75); padding: 1px 5px; border-radius: 3px;
}

.provenance-banner {
  padding: 5px 11px; font-size: 11.5px;
  background: rgba(255, 179, 64, 0.1); color: var(--warn);
  border-bottom: 1px solid rgba(255, 179, 64, 0.25);
}

.log { font-family: ui-monospace, Menlo, monospace; font-size: 11px; line-height: 1.65; }
.log div { white-space: pre-wrap; word-break: break-word; }
.log .t { color: var(--faint); }
.log .ok { color: var(--accent); }
.log .warn { color: var(--warn); }
.log .bad { color: var(--bad); }

.bars { display: grid; gap: 3px; }
.bar-row { display: grid; grid-template-columns: 52px 1fr 40px; gap: 8px; align-items: center; font-size: 11.5px; }
.bar { height: 7px; background: #131c27; border-radius: 4px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--accent); border-radius: 4px; transition: width 0.18s ease-out; }

::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #1c2836; border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: #2a3c50; }

/* --- virtual antenna ------------------------------------------------------ */

#antenna-plot-wrap {
  display: flex;
  justify-content: center;
  background: #03060a;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 6px;
}
#antenna-plot { max-width: 100%; height: auto; }
input[type="range"] {
  -webkit-appearance: none; appearance: none;
  height: 4px; background: #1a2531; border-radius: 3px; outline: none;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 13px; height: 13px; border-radius: 50%;
  background: var(--accent); cursor: pointer; border: 0;
}
input[type="range"]::-moz-range-thumb {
  width: 13px; height: 13px; border-radius: 50%;
  background: var(--accent); cursor: pointer; border: 0;
}
