/* ───────────── CDO-02 Operations Console — mission control ───────────── */

:root {
  --space: #060b14;
  --space-2: #0a1220;
  --panel: #0c1524;
  --line: #16283e;
  --line-bright: #2a4a6b;
  --cyan: #62d9e8;
  --cyan-dim: #3b8fa3;
  --green: #7ee787;
  --amber: #ffb454;
  --red: #ff5c5c;
  --text: #cfe3ea;
  --muted: #5f7a8a;
  --disp: "Chakra Petch", sans-serif;
  --mono: "IBM Plex Mono", monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { background: var(--space); }
body {
  font-family: var(--mono); font-size: 13px; color: var(--text);
  background:
    radial-gradient(900px 500px at 75% -10%, rgba(98,217,232,.05), transparent 60%),
    var(--space);
  min-height: 100vh; padding-bottom: 30px;
}
::selection { background: var(--cyan); color: var(--space); }

.scanlines {
  position: fixed; inset: 0; pointer-events: none; z-index: 50; opacity: .35;
  background: repeating-linear-gradient(0deg, transparent 0 3px, rgba(0,0,0,.12) 3px 4px);
}

/* ───────── top bar ───────── */
.topbar {
  display: flex; align-items: center; gap: 28px; flex-wrap: wrap;
  padding: 14px 22px; border-bottom: 1px solid var(--line-bright);
  background: linear-gradient(180deg, var(--space-2), var(--space));
  position: sticky; top: 0; z-index: 40;
}
.brand { display: flex; align-items: center; gap: 14px; }
.sigil { color: var(--cyan); font-size: 22px; text-shadow: 0 0 12px var(--cyan); animation: blink 4s infinite; }
@keyframes blink { 0%, 92%, 100% { opacity: 1; } 96% { opacity: .3; } }
.title { font-family: var(--disp); font-weight: 700; font-size: 16px; letter-spacing: .12em; color: #fff; }
.subtitle { font-size: 10px; letter-spacing: .18em; color: var(--muted); margin-top: 2px; }
.topstats { display: flex; gap: 22px; margin-left: auto; }
.tick { display: flex; flex-direction: column; gap: 2px; }
.tick .k { font-size: 9px; letter-spacing: .2em; color: var(--muted); }
.tick .v { font-family: var(--disp); font-weight: 600; font-size: 17px; color: var(--cyan); font-variant-numeric: tabular-nums; }
.tick .v.amber { color: var(--amber); }
.tick .v.red { color: var(--red); }
.led { color: var(--green); text-shadow: 0 0 10px var(--green); }
.led.bad { color: var(--red); text-shadow: 0 0 10px var(--red); }
.clockbox { text-align: right; }
.clock { font-family: var(--disp); font-weight: 700; font-size: 24px; color: #fff;
  letter-spacing: .08em; font-variant-numeric: tabular-nums; }
.clock-sub { font-size: 9px; letter-spacing: .16em; color: var(--muted); }
.backlink {
  font-size: 10px; letter-spacing: .2em; color: var(--amber); text-decoration: none;
  border: 1px solid rgba(255,180,84,.4); padding: 8px 14px; border-radius: 2px;
  transition: all .2s;
}
.backlink:hover { background: rgba(255,180,84,.12); box-shadow: 0 0 14px rgba(255,180,84,.25); }

/* ───────── filters ───────── */
.filters {
  display: flex; gap: 28px; align-items: flex-end; flex-wrap: wrap;
  padding: 14px 22px; border-bottom: 1px solid var(--line);
  background: var(--space-2);
}
.f { display: flex; flex-direction: column; gap: 7px; min-width: 180px; }
.f label { font-size: 9px; letter-spacing: .22em; color: var(--muted);
  display: flex; justify-content: space-between; }
.f output { color: var(--cyan); font-weight: 600; }
input[type=range] { -webkit-appearance: none; appearance: none; height: 3px; border-radius: 2px;
  background: linear-gradient(90deg, var(--cyan), var(--line-bright)); outline: none; }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 13px; height: 13px;
  border-radius: 2px; background: var(--space); border: 2px solid var(--cyan);
  box-shadow: 0 0 8px rgba(98,217,232,.6); cursor: pointer; }
input[type=range]::-moz-range-thumb { width: 11px; height: 11px; border-radius: 2px;
  background: var(--space); border: 2px solid var(--cyan); cursor: pointer; }
.seg { display: flex; border: 1px solid var(--line-bright); border-radius: 2px; overflow: hidden; }
.seg button {
  font-family: var(--mono); font-size: 11px; letter-spacing: .1em; color: var(--muted);
  background: transparent; border: 0; padding: 7px 14px; cursor: pointer;
  border-right: 1px solid var(--line);
}
.seg button:last-child { border-right: 0; }
.seg button.on { background: rgba(98,217,232,.14); color: var(--cyan); }
#f-type {
  font-family: var(--mono); font-size: 13px; color: var(--cyan); text-transform: uppercase;
  background: transparent; border: 1px solid var(--line-bright); border-radius: 2px;
  padding: 7px 10px; outline: none; width: 130px; letter-spacing: .1em;
}
#f-type:focus { border-color: var(--cyan); box-shadow: 0 0 10px rgba(98,217,232,.25); }
#f-type::placeholder { color: #33495c; text-transform: none; }
.f-status { justify-content: flex-end; margin-left: auto; min-width: 0; }
#f-result { font-size: 11px; letter-spacing: .12em; color: var(--green); }

/* ───────── grid + panels ───────── */
.grid {
  display: grid; gap: 14px;
  grid-template-columns: repeat(12, 1fr);
  padding: 16px 22px;
  max-width: 1640px; margin: 0 auto;
}
.span4 { grid-column: span 4; }
.span8 { grid-column: span 8; }
.span12 { grid-column: span 12; }
@media (max-width: 1100px) { .span4, .span8 { grid-column: span 12; } }

.panel {
  position: relative; background: var(--panel);
  border: 1px solid var(--line); padding: 16px 16px 14px;
  min-height: 120px;
}
/* corner brackets */
.panel::before, .panel::after,
.panel h2::before, .panel h2::after {
  content: ""; position: absolute; width: 10px; height: 10px; pointer-events: none;
}
.panel::before { top: -1px; left: -1px; border-top: 2px solid var(--cyan-dim); border-left: 2px solid var(--cyan-dim); }
.panel::after { top: -1px; right: -1px; border-top: 2px solid var(--cyan-dim); border-right: 2px solid var(--cyan-dim); }
.panel h2::before { bottom: -1px; left: -1px; border-bottom: 2px solid var(--cyan-dim); border-left: 2px solid var(--cyan-dim); }
.panel h2::after { bottom: -1px; right: -1px; border-bottom: 2px solid var(--cyan-dim); border-right: 2px solid var(--cyan-dim); }
.panel h2 { position: static; }
.panel:hover { border-color: var(--line-bright); }
.panel h2 {
  font-family: var(--disp); font-weight: 600; font-size: 11px; letter-spacing: .22em;
  color: var(--cyan); margin-bottom: 12px;
}
.panel h2 .hint { font-family: var(--mono); font-weight: 400; font-size: 9px;
  letter-spacing: .14em; color: var(--muted); margin-left: 10px; }
.panel.tall { min-height: 420px; }
.panel canvas { display: block; width: 100%; }
#plan-canvas, #clock-canvas { height: 370px; }
#profile-canvas { height: 230px; }
#gauge-canvas { height: 150px; }
.chart-box { position: relative; height: 220px; }
#p-weekly .chart-box { height: 180px; }

.gauge-row { display: flex; justify-content: space-around; margin-top: 8px; }

/* ───────── rare birds ───────── */
.rare-list { list-style: none; max-height: 228px; overflow-y: auto; }
.rare-list li {
  display: grid; grid-template-columns: 58px 1fr auto; gap: 10px; align-items: baseline;
  padding: 6px 4px; border-bottom: 1px dashed var(--line);
  font-size: 12px;
}
.rare-list li:last-child { border-bottom: 0; }
.rare-list .code { font-family: var(--disp); font-weight: 600; color: var(--amber); letter-spacing: .08em; }
.rare-list .name { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rare-list .meta { color: var(--muted); font-size: 10px; letter-spacing: .08em; text-align: right; }
.rare-list .n1 .code { color: var(--red); text-shadow: 0 0 8px rgba(255,92,92,.5); }

/* ───────── mission log ───────── */
.log { display: grid; grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); gap: 8px 26px; }
.log .entry {
  display: flex; gap: 10px; padding: 7px 4px; font-size: 12px; line-height: 1.55;
  border-bottom: 1px dashed var(--line);
}
.log .entry::before { content: "▸"; color: var(--green); }
.log .entry b { color: var(--cyan); font-weight: 600; }
.log .entry .hl { color: var(--amber); font-weight: 600; }

.confooter {
  text-align: center; font-size: 9px; letter-spacing: .2em; color: var(--muted);
  padding: 18px 22px 6px;
}

/* scrollbar, console-flavored */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--line-bright); border-radius: 4px; }
::-webkit-scrollbar-track { background: var(--space-2); }

@media (prefers-reduced-motion: reduce) {
  .sigil { animation: none; }
}
