/* GOMO — observatory skin: deep space blue-black, glassy hairline cards,
   light display numerals, aurora gradient identity (teal→periwinkle→violet),
   PULSE as a living iris. green/red reserved for p&l and flow. */
:root {
  --bg: #0a0c10;
  --ink: #e3e5ec;
  --hi: #f6f7fa;
  --dim: #8d93a5;
  --dim2: #5a5f6e;
  --card: rgba(255, 255, 255, 0.024);
  --card2: rgba(255, 255, 255, 0.014);
  --edge: rgba(255, 255, 255, 0.07);
  --edge2: rgba(255, 255, 255, 0.12);
  --hair: rgba(255, 255, 255, 0.05);
  --up: #35d488;
  --dn: #ff5f6b;
  --acc: #7a8bff;
  --teal: #45e3c9;
  --violet: #d478ff;
  --aurora: linear-gradient(90deg, #45e3c9, #7a8bff, #d478ff);
  --sans: "Segoe UI", Inter, system-ui, -apple-system, sans-serif;
  --mono: Consolas, "Cascadia Mono", ui-monospace, monospace;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { color-scheme: dark; }
body {
  background:
    radial-gradient(1100px 480px at 50% -120px, rgba(122, 139, 255, 0.09), transparent 65%),
    radial-gradient(900px 400px at 85% 10%, rgba(69, 227, 201, 0.04), transparent 60%),
    var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 13.5px;
  line-height: 1.55;
  min-height: 100vh;
}
a { color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--dim2); }
a:hover { color: var(--hi); border-bottom-color: var(--acc); }
.k { color: var(--dim2); font-size: 10px; font-weight: 600; letter-spacing: 2px; text-transform: uppercase; }
.empty { color: var(--dim2); padding: 6px 0; font-style: italic; }
/* an empty card centers its message instead of orphaning it at the top */
.grid .panel > div:last-child > .empty:only-child,
.grid-bottom .panel > div:last-child > .empty:only-child {
  height: 100%; margin: 0; padding: 0;
  display: flex; align-items: center; justify-content: center; text-align: center;
}
.up { color: var(--up); }
.dn { color: var(--dn); }
.dim { color: var(--dim); }
main { max-width: 1240px; margin: 0 auto; padding: 0 22px 64px; }

/* ── top bar ────────────────────────────────────────── */
.top {
  max-width: 1240px; margin: 0 auto; padding: 18px 22px 14px;
  display: flex; align-items: center; gap: 12px;
}
.brand { display: flex; align-items: center; gap: 11px; min-width: 0; }
/* the logo art carries its own dark padding — mask it round and scale in so the
   ring and bolt fill the mark */
.mark {
  width: 32px; height: 32px; flex: none; display: block;
  border-radius: 50%; overflow: hidden; background: #0d0a1a;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.07);
}
.mark img { display: block; width: 100%; height: 100%; object-fit: cover; transform: scale(1.5); }
.brand-name { font-size: 21px; font-weight: 700; letter-spacing: 3px; color: var(--hi); }
.brand-sub { color: var(--dim); font-size: 12px; padding-left: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.pill {
  font-size: 10px; font-weight: 600; letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--dim); border: 1px solid var(--edge); border-radius: 999px;
  padding: 4px 11px; background: var(--card);
}
.pill.amber { color: #ffc46b; border-color: rgba(255, 196, 107, 0.25); background: rgba(255, 196, 107, 0.06); }
.pill.violet { color: var(--violet); border-color: rgba(212, 120, 255, 0.3); background: rgba(212, 120, 255, 0.07); }
.pill.livemode { color: #06110b; background: var(--up); border-color: transparent; font-weight: 800; }
.lamp i {
  display: block; width: 8px; height: 8px; border-radius: 50%;
  background: var(--up); box-shadow: 0 0 8px rgba(53, 212, 136, 0.7);
  animation: blink 2.4s ease-in-out infinite;
}
.lamp.dead i { background: var(--dn); box-shadow: 0 0 8px rgba(255, 95, 107, 0.7); animation: none; }
@keyframes blink { 50% { opacity: 0.3; } }

/* ── cards ──────────────────────────────────────────── */
.card {
  background: linear-gradient(180deg, var(--card), var(--card2));
  border: 1px solid var(--edge);
  border-radius: 13px;
}

/* ── hero ───────────────────────────────────────────── */
.hero { padding: 22px 24px 0; overflow: hidden; }
.hero-main { display: flex; gap: 24px; align-items: flex-start; }
.hero-left { min-width: 0; }
.hero-eq {
  font-size: 58px; font-weight: 300; letter-spacing: -1px; line-height: 1.05;
  color: var(--hi); font-variant-numeric: tabular-nums; margin-top: 4px;
}
.hero-deltas { display: flex; gap: 16px; margin-top: 8px; flex-wrap: wrap; }
.delta { font-size: 13px; font-variant-numeric: tabular-nums; }
.delta .k { margin-left: 6px; letter-spacing: 1.5px; }
.hero-iris { margin-left: auto; text-align: center; flex: none; }
.iris { width: 92px; height: 92px; display: block; animation: breathe 6s ease-in-out infinite; }
@keyframes breathe { 50% { transform: scale(1.035); } }
.hero-iris.scanning .iris { animation-duration: 3s; }
.hero-iris.thinking .iris { animation-duration: 1.4s; }
.iris-label { margin-top: 6px; display: flex; gap: 7px; justify-content: center; align-items: baseline; }
.iris-label b { color: var(--hi); font-weight: 600; font-size: 14px; }
.hero-stats {
  display: flex; gap: 34px; flex-wrap: wrap;
  margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--hair);
}
.hstat .k { display: block; margin-bottom: 1px; }
.hstat .v { font-size: 15px; font-variant-numeric: tabular-nums; }
.hero-spark { height: 48px; margin: 10px -24px 0; }
.hero-spark svg { width: 100%; height: 100%; display: block; }

.keybar {
  border: 1px solid rgba(255, 196, 107, 0.25); background: rgba(255, 196, 107, 0.05);
  color: #ffc46b; border-radius: 13px; padding: 12px 16px; margin-top: 14px; font-size: 12.5px;
}

/* ── tabs ───────────────────────────────────────────── */
.tabs { display: flex; gap: 2px; margin: 20px 0 14px; border-bottom: 1px solid var(--hair); }
.tabs button {
  position: relative; background: none; border: none; color: var(--dim);
  font: inherit; font-size: 12.5px; font-weight: 600; letter-spacing: 1px;
  text-transform: uppercase; padding: 9px 16px 11px; cursor: pointer;
}
.tabs button:hover { color: var(--ink); }
.tabs button.on { color: var(--hi); }
.tabs button.on::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: -1px;
  height: 2px; border-radius: 2px; background: var(--aurora);
}

/* ── now line ───────────────────────────────────────── */
.nowline { display: flex; gap: 14px; align-items: baseline; padding: 12px 18px; margin-bottom: 14px; }
.now-k {
  font-size: 10px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase;
  background: var(--aurora); -webkit-background-clip: text; background-clip: text; color: transparent;
  flex: none;
}
#now { font-size: 14px; color: var(--hi); }

/* ── scanner bar ────────────────────────────────────── */
.scanbar { padding: 10px 16px 0; margin-bottom: 14px; overflow: hidden; position: relative; }
.sb-top { display: flex; align-items: baseline; gap: 12px; }
.sb-phase { display: flex; align-items: center; gap: 7px; flex: none; }
.sb-phase b {
  font-size: 10px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; color: var(--dim);
}
.sb-phase i { width: 7px; height: 7px; border-radius: 50%; background: var(--dim2); flex: none; }
.sb-phase.scanning i { background: var(--teal); animation: ping 1s ease-out infinite; }
.sb-phase.scanning b { color: var(--teal); }
.sb-phase.thinking i { background: var(--violet); animation: ping 0.7s ease-out infinite; }
.sb-phase.thinking b { color: var(--violet); }
.sb-phase.idle i { background: var(--dim2); }
@keyframes ping {
  0% { box-shadow: 0 0 0 0 currentColor; opacity: 1; }
  70% { box-shadow: 0 0 0 7px rgba(0, 0, 0, 0); opacity: 0.85; }
  100% { box-shadow: 0 0 0 0 rgba(0, 0, 0, 0); opacity: 1; }
}
.sb-line { font-family: var(--mono); font-size: 12px; color: var(--ink); min-width: 0; flex: 1;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-line.bump { animation: bump 0.5s ease-out; }
@keyframes bump { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.sb-next { flex: none; font-family: var(--mono); font-size: 11px; color: var(--dim2); }
.sb-feed { display: flex; gap: 18px; margin: 5px 0 8px; font-family: var(--mono); font-size: 10.5px; color: var(--dim2); overflow: hidden; white-space: nowrap; }
.sb-feed span { flex: none; }
.sb-feed .up { color: rgba(53, 212, 136, 0.75); }
.sb-feed .down { color: rgba(255, 95, 107, 0.75); }
.sb-progress { height: 2px; background: rgba(255, 255, 255, 0.05); margin: 0 -16px; }
.sb-progress i { display: block; height: 100%; background: var(--aurora); transition: width 1s linear; }

/* a value that just changed flashes once */
@keyframes flashUp { from { background: rgba(53, 212, 136, 0.22); } to { background: transparent; } }
@keyframes flashDn { from { background: rgba(255, 95, 107, 0.22); } to { background: transparent; } }
.fl-up { animation: flashUp 1.1s ease-out; }
.fl-dn { animation: flashDn 1.1s ease-out; }

/* ── layout / panels ────────────────────────────────── */
/* the live tab is one fixed-height dashboard: both columns share an exact
   height, every card fills its cell, overflow scrolls inside the card.
   nothing is sized by whatever its content happens to be. */
.grid {
  display: grid; grid-template-columns: 1.42fr 1fr; gap: 14px;
  align-items: stretch;
  height: clamp(560px, calc(100vh - 208px), 900px);
}
.colA {
  display: flex; flex-direction: column; gap: 14px;
  min-width: 0; min-height: 0; overflow-y: auto; padding-right: 3px;
  scrollbar-width: thin; scrollbar-color: var(--edge2) transparent;
}
.colA > .panel { flex: none; }

/* right column: telemetry on top, how-it-decided below — exact equal halves */
.colB {
  min-width: 0; min-height: 0;
  display: grid; grid-template-rows: 1fr 1fr; gap: 14px;
}

/* full-width row under the grid: theses | tape, matched heights */
.grid-bottom {
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px;
  margin-top: 14px; align-items: stretch;
  height: 380px;
}
#tape, #history { overflow-x: auto; }

/* every panel is a column whose last child is the scrollable content area */
.panel { padding: 16px 18px; display: flex; flex-direction: column; min-height: 0; }
.panel > *:last-child { min-height: 0; }
.grid .panel > div:last-child,
.grid-bottom .panel > div:last-child {
  flex: 1; overflow-y: auto;
  scrollbar-width: thin; scrollbar-color: var(--edge2) transparent;
}
.grid .stream { max-height: none; }
.panel h2 {
  font-size: 11px; font-weight: 700; letter-spacing: 2.5px; text-transform: uppercase;
  color: var(--dim); margin-bottom: 12px; display: flex; align-items: center; gap: 9px;
}
.panel h2::before {
  content: ""; width: 15px; height: 2px; border-radius: 2px;
  background: var(--aurora); flex: none;
}
.hclock { margin-left: auto; color: var(--dim2); font-family: var(--mono); font-size: 11px; font-weight: 400; letter-spacing: 0; }

/* ── viewport ───────────────────────────────────────── */
.viewport {
  position: relative; border: 1px solid var(--edge); border-radius: 10px;
  background: var(--card2); padding: 16px 16px 14px; overflow: hidden;
}
.viewport::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: var(--aurora); opacity: 0.85;
}
.vp-row1 { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.vp-sym { font-size: 22px; font-weight: 700; letter-spacing: 0.5px; color: var(--hi); }
.vp-flag {
  font-size: 9px; font-weight: 700; letter-spacing: 1.5px; border-radius: 999px;
  color: var(--violet); border: 1px solid rgba(212, 120, 255, 0.3); background: rgba(212, 120, 255, 0.07);
  padding: 2px 8px;
}
.vp-age { color: var(--dim); font-size: 11.5px; }
.vp-px { margin-left: auto; font-size: 22px; font-weight: 300; color: var(--hi); font-variant-numeric: tabular-nums; }
.vp-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--hair); border-radius: 8px; overflow: hidden; margin: 12px 0;
}
.vp-cell { border-right: 1px solid var(--hair); padding: 6px 10px; background: rgba(255, 255, 255, 0.01); font-variant-numeric: tabular-nums; }
.vp-cell:last-child { border-right: none; }
.vp-cell .k { display: block; }
.vp-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; font-size: 11px; color: var(--dim); }
.vp-stats b { display: block; color: var(--ink); font-weight: 400; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.bs { display: flex; height: 7px; border-radius: 999px; overflow: hidden; margin: 12px 0 6px; background: rgba(255, 255, 255, 0.05); }
.bs i { display: block; height: 100%; }
.bs .b { background: var(--up); }
.bs .s { background: var(--dn); opacity: 0.75; }
.vp-tx { color: var(--dim); font-size: 11.5px; }
.vp-caption { color: var(--dim); font-style: italic; margin-top: 10px; border-left: 2px solid var(--acc); padding-left: 10px; }

/* ── tables ─────────────────────────────────────────── */
table { width: 100%; border-collapse: collapse; font-size: 12.5px; font-family: var(--mono); }
th {
  text-align: left; color: var(--dim2); font-family: var(--sans); font-weight: 600;
  font-size: 9.5px; text-transform: uppercase; letter-spacing: 1.5px; padding: 2px 10px 7px 0;
}
td { padding: 6px 10px 6px 0; border-top: 1px solid var(--hair); vertical-align: top; font-variant-numeric: tabular-nums; }
td.r, th.r { text-align: right; padding-right: 0; }
.sym { color: var(--hi); font-weight: 600; }
td a.sym { border-bottom-color: transparent; }
td a.sym:hover { border-bottom-color: var(--acc); }
.boost { color: var(--violet); }

/* ── watchlist ──────────────────────────────────────── */
.wl-row { border-top: 1px solid var(--hair); padding: 10px 0; }
.wl-row:first-child { border-top: none; padding-top: 2px; }
.wl-head { display: flex; gap: 12px; align-items: baseline; }
.conv { letter-spacing: 2px; font-size: 11px; color: var(--acc); }
.wl-thesis { margin: 4px 0 2px; }
.wl-cond { color: var(--dim); font-size: 11.5px; }
.wl-cond b { color: var(--ink); font-weight: 400; }

/* ── stream / chips ─────────────────────────────────── */
.stream { display: flex; flex-direction: column; max-height: 850px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--edge2) transparent; }
.line { display: flex; gap: 10px; align-items: baseline; padding: 4.5px 0; border-top: 1px solid var(--hair); }
.line:first-child { border-top: none; }
.line time { color: var(--dim2); font-family: var(--mono); font-size: 10px; flex: none; width: 56px; }
.line > span:last-child { min-width: 0; }
.chip {
  flex: none; font-size: 8.5px; font-weight: 700; letter-spacing: 1.5px;
  text-transform: uppercase; padding: 1.5px 8px; border-radius: 999px;
  border: 1px solid transparent; color: var(--dim);
}
.chip.thought { color: var(--dim2); }
.chip.read { color: #9aa8ff; background: rgba(122, 139, 255, 0.1); }
.chip.did { color: var(--teal); background: rgba(69, 227, 201, 0.09); }
.chip.fill { color: #06110b; background: var(--up); }
.chip.refused { color: var(--dn); background: rgba(255, 95, 107, 0.1); text-decoration: line-through; text-decoration-thickness: 1px; }
.chip.system { color: var(--dim); border-color: var(--edge); border-style: dashed; }
.chip.closed { color: var(--dim); border-color: var(--edge); }

/* ── verdicts ───────────────────────────────────────── */
.verdict { border-top: 1px solid var(--hair); padding: 10px 0; }
.verdict:first-child { border-top: none; padding-top: 2px; }
.v-head { display: flex; gap: 12px; align-items: baseline; }
.v-time { color: var(--dim2); font-family: var(--mono); font-size: 10px; margin-left: auto; }
.v-chip {
  font-size: 8.5px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase;
  padding: 1.5px 9px; border-radius: 999px; border: 1px solid transparent;
}
.v-chip.pass { color: var(--dim); background: rgba(255, 255, 255, 0.05); }
.v-chip.stalking { color: var(--acc); background: rgba(122, 139, 255, 0.11); }
.v-chip.enter { color: #06110b; background: var(--up); }
.v-reasons { margin: 5px 0 0; padding: 0; list-style: none; color: var(--dim); }
.v-reasons li::before { content: "— "; color: var(--dim2); }
.v-cond { color: var(--dim); font-size: 11.5px; margin-top: 3px; }
.v-cond b { color: var(--ink); font-weight: 400; }

/* ── theses ─────────────────────────────────────────── */
.thesis { border-top: 1px solid var(--hair); padding: 10px 0; }
.thesis:first-child { border-top: none; padding-top: 2px; }
.th-head { display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap; }
.th-age { color: var(--dim2); font-size: 11px; margin-left: auto; }
.th-nums { font-size: 11.5px; color: var(--dim); margin-top: 2px; font-variant-numeric: tabular-nums; }
.th-nums b { font-weight: 400; }
.th-text { margin-top: 5px; border-left: 2px solid var(--acc); padding-left: 10px; }

/* ── memory ─────────────────────────────────────────── */
.mem-row { border-top: 1px solid var(--hair); padding: 9px 0; }
.mem-row:first-child { border-top: none; }
.mem-head { display: flex; gap: 11px; align-items: baseline; }
.mem-key { font-weight: 700; font-size: 11.5px; letter-spacing: 1px; color: var(--hi); }
.mem-count {
  color: var(--acc); background: rgba(122, 139, 255, 0.11);
  font-weight: 700; font-size: 10px; padding: 0 7px; border-radius: 999px;
}
.mem-age { color: var(--dim2); font-size: 11px; margin-left: auto; }
.mem-text { color: var(--dim); }

/* ── tab badge ──────────────────────────────────────── */
.tab-badge {
  display: inline-block; min-width: 16px; text-align: center;
  font-size: 10px; font-weight: 700; line-height: 16px; padding: 0 4px;
  border-radius: 999px; color: #06110b; background: var(--teal); margin-left: 2px;
  vertical-align: middle;
}

/* ── outbox ─────────────────────────────────────────── */
.ob { border: 1px solid var(--edge); border-radius: 11px; background: var(--card2); padding: 13px 15px; margin-bottom: 12px; }
.ob-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.ob-time { color: var(--dim2); font-family: var(--mono); font-size: 10px; margin-left: auto; }
.ob-body { display: grid; grid-template-columns: 1fr; gap: 12px; }
.ob-ch { border: 1px solid var(--hair); border-radius: 9px; padding: 10px 11px; background: rgba(255, 255, 255, 0.012); display: flex; flex-direction: column; }
.ob-ch-h { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.ob-done { color: var(--up); font-size: 10px; font-weight: 700; letter-spacing: 0.5px; }
.ob-err { color: var(--dn); font-size: 10px; font-weight: 700; }
.ob-noapi { color: var(--dim2); font-size: 10px; font-style: italic; }
.ob-text { font-size: 12.5px; color: var(--ink); line-height: 1.5; flex: 1; word-break: break-word; }
.ob-acts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.btn {
  font-family: var(--sans); font-size: 11px; font-weight: 600; letter-spacing: 0.3px;
  color: var(--ink); background: rgba(255, 255, 255, 0.04); border: 1px solid var(--edge);
  border-radius: 7px; padding: 5px 11px; cursor: pointer; text-decoration: none; line-height: 1.4;
}
.btn:hover { border-color: var(--edge2); background: rgba(255, 255, 255, 0.07); color: var(--hi); }
.btn.primary { color: #06110b; background: var(--up); border-color: transparent; }
.btn.primary:hover { filter: brightness(1.08); color: #06110b; }
.btn.ghost { color: var(--dim); background: none; }
.btn.ghost:hover { color: var(--ink); }
.btn:disabled { opacity: 0.5; cursor: default; }

.foot { color: var(--dim2); font-size: 11.5px; margin-top: 12px; }
footer { margin-top: 26px; color: var(--dim2); font-size: 11.5px; padding: 14px 2px 0; border-top: 1px solid var(--hair); }

/* ── responsive ─────────────────────────────────────── */
@media (max-width: 940px) {
  .grid { grid-template-columns: 1fr; height: auto; }
  .grid-bottom { grid-template-columns: 1fr; height: auto; }
  .colA { overflow: visible; padding-right: 0; }
  .colB { grid-template-rows: auto auto; }
  .grid .panel > div:last-child,
  .grid-bottom .panel > div:last-child { max-height: 430px; }
  .stream { max-height: 430px; }
  .hero-eq { font-size: 42px; }
  .iris { width: 72px; height: 72px; }
  .hero-stats { gap: 22px; }
  .brand-sub { display: none; }
  .tabs { overflow-x: auto; }
}
