/* QuanticTrade — observatory theme */
:root {
  --bg: #07090f;
  --bg-2: #0c1018;
  --panel: rgba(16, 22, 34, 0.86);
  --panel-2: rgba(22, 30, 46, 0.9);
  --line: rgba(130, 160, 210, 0.14);
  --line-2: rgba(130, 160, 210, 0.28);
  --text: #e6edf7;
  --muted: #8b9bb4;
  --dim: #5c6b84;
  --accent: #4fd1ff;
  --accent-2: #8f7bff;
  --up: #37d399;
  --down: #ff5c7a;
  --warn: #ffb347;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --radius: 14px;
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: radial-gradient(1200px 600px at 20% -10%, rgba(79, 209, 255, 0.10), transparent 60%),
              radial-gradient(900px 500px at 100% 0%, rgba(143, 123, 255, 0.12), transparent 55%), var(--bg);
  color: var(--text); font-family: var(--sans); font-size: 14.5px; line-height: 1.45; -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0 0 .5rem; font-weight: 600; letter-spacing: -0.01em; }
h1 { font-size: 1.6rem; } h2 { font-size: 1.15rem; } h3 { font-size: .95rem; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; font-weight: 600; }
p { margin: 0 0 .75rem; }
code, .mono, .num, td.num, .tick { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); } .dim { color: var(--dim); } .small { font-size: .82rem; } .tiny { font-size: .74rem; }
.up { color: var(--up); } .down { color: var(--down); } .warn { color: var(--warn); } .accent { color: var(--accent); }

/* layout */
.shell { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }
.sidebar { border-right: 1px solid var(--line); padding: 20px 16px; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 18px; background: rgba(7, 9, 15, 0.7); backdrop-filter: blur(10px); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: -.02em; font-size: 1.05rem; }
.brand .orb { width: 26px; height: 26px; border-radius: 50%; background: conic-gradient(from 200deg, var(--accent), var(--accent-2), var(--up), var(--accent)); box-shadow: 0 0 18px rgba(79, 209, 255, .5); }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { color: var(--muted); padding: 9px 12px; border-radius: 10px; display: flex; align-items: center; gap: 10px; font-weight: 500; }
.nav a:hover { color: var(--text); background: rgba(255,255,255,.04); text-decoration: none; }
.nav a.active { color: var(--text); background: linear-gradient(90deg, rgba(79,209,255,.16), rgba(79,209,255,.03)); box-shadow: inset 2px 0 0 var(--accent); }
.nav .ico { width: 18px; text-align: center; opacity: .8; }
.sidebar .foot { margin-top: auto; font-size: .78rem; color: var(--dim); }
#engine-pill .pill { white-space: normal; line-height: 1.3; }
.main { padding: 26px 32px 60px; min-width: 0; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.topbar .title h1 { margin: 0; } .topbar .title p { margin: 2px 0 0; color: var(--muted); }
.status-strip { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* cards & grids */
.grid { display: grid; gap: 16px; }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.main-side { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
@media (max-width: 1100px) { .grid.cols-4 { grid-template-columns: repeat(2, 1fr); } .grid.cols-3 { grid-template-columns: repeat(2, 1fr);} .grid.main-side { grid-template-columns: 1fr; } }
@media (max-width: 760px) { .shell { grid-template-columns: 1fr; } .sidebar { position: relative; height: auto; flex-direction: row; flex-wrap: wrap; } .sidebar .foot { display: none; } .nav { flex-direction: row; flex-wrap: wrap; } .main { padding: 18px 16px 40px; } .grid.cols-2, .grid.cols-3, .grid.cols-4 { grid-template-columns: 1fr; } }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); position: relative; overflow: hidden; }
.card.flat { box-shadow: none; }
.card .card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 12px; }
.card .card-head h2 { margin: 0; }
.stat { display: flex; flex-direction: column; gap: 4px; }
.stat .label { color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; }
.stat .value { font-family: var(--mono); font-size: 1.55rem; font-weight: 600; letter-spacing: -.02em; }
.stat .sub { color: var(--dim); font-size: .8rem; }

/* pills & badges */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: .75rem; font-weight: 600; letter-spacing: .04em; border: 1px solid var(--line-2); color: var(--muted); background: rgba(255,255,255,.03); white-space: nowrap; }
.pill.ok { color: var(--up); border-color: rgba(55,211,153,.4); background: rgba(55,211,153,.08); }
.pill.bad { color: var(--down); border-color: rgba(255,92,122,.4); background: rgba(255,92,122,.08); }
.pill.warn { color: var(--warn); border-color: rgba(255,179,71,.4); background: rgba(255,179,71,.08); }
.pill.accent { color: var(--accent); border-color: rgba(79,209,255,.4); background: rgba(79,209,255,.08); }
.pill.violet { color: #b9adff; border-color: rgba(143,123,255,.45); background: rgba(143,123,255,.1); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--dim); display: inline-block; }
.dot.live { background: var(--up); box-shadow: 0 0 0 4px rgba(55,211,153,.18); animation: pulse 2s infinite; }
.dot.dead { background: var(--down); }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(55,211,153,.4);} 70% { box-shadow: 0 0 0 8px rgba(55,211,153,0);} 100% { box-shadow: 0 0 0 0 rgba(55,211,153,0);} }

/* tables */
table { width: 100%; border-collapse: collapse; font-size: .86rem; }
th { text-align: left; color: var(--muted); font-weight: 600; font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; padding: 8px 8px; border-bottom: 1px solid var(--line-2); }
td { padding: 8px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: none; }
td.num, th.num { text-align: right; }
tbody tr:hover td { background: rgba(255,255,255,.025); }
.table-wrap { overflow-x: auto; }
.empty { color: var(--dim); padding: 18px; text-align: center; font-style: italic; }

/* forms */
.input, .select, textarea.input { width: 100%; background: rgba(5, 8, 14, .7); border: 1px solid var(--line-2); color: var(--text); border-radius: 10px; padding: 10px 12px; font: inherit; outline: none; }
.input:focus, .select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(79,209,255,.15); }
.select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 32px; }
label { display: block; font-size: .8rem; color: var(--muted); margin-bottom: 6px; font-weight: 500; }
.field { margin-bottom: 14px; }
.field .help { color: var(--dim); font-size: .76rem; margin-top: 4px; }
.field .errorlist { color: var(--down); font-size: .8rem; margin: 4px 0 0; padding-left: 16px; }
.range { width: 100%; accent-color: var(--accent); }
.range-row { display: flex; align-items: center; gap: 12px; }
.range-row output { font-family: var(--mono); min-width: 60px; text-align: right; color: var(--accent); }
.switch-row { display: flex; align-items: center; gap: 10px; }
.switch-row input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--accent); }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 10px; border: 1px solid var(--line-2); background: rgba(255,255,255,.04); color: var(--text); font-weight: 600; cursor: pointer; font: inherit; }
.btn:hover { background: rgba(255,255,255,.08); text-decoration: none; }
.btn.primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #06101a; border: none; box-shadow: 0 8px 24px rgba(79,209,255,.25); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { border-color: rgba(255,92,122,.5); color: var(--down); }
.btn.small { padding: 6px 10px; font-size: .8rem; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.messages { list-style: none; padding: 0; margin: 0 0 16px; display: flex; flex-direction: column; gap: 8px; }
.messages li { padding: 10px 14px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--panel-2); font-size: .88rem; }
.messages li.success { border-color: rgba(55,211,153,.4); } .messages li.error { border-color: rgba(255,92,122,.5); } .messages li.info { border-color: rgba(79,209,255,.4); }

/* org chart */
.org { display: flex; flex-direction: column; gap: 14px; }
.org .tier { display: grid; grid-template-columns: 120px 1fr; gap: 14px; align-items: start; }
.org .tier .label { color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; padding-top: 12px; }
.org .tier .label b { display: block; color: var(--text); font-size: 1rem; letter-spacing: 0; text-transform: none; }
.org .nodes { display: flex; flex-wrap: wrap; gap: 10px; }
.node { background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 12px; padding: 10px 12px; min-width: 200px; max-width: 280px; flex: 1 1 200px; }
.node .name { font-weight: 600; display: flex; justify-content: space-between; gap: 6px; align-items: center; flex-wrap: wrap; }
.node .name .pill { font-size: .64rem; padding: 2px 7px; }
.node .name a { color: var(--text); }
.node .meta { color: var(--muted); font-size: .76rem; margin-top: 4px; }
.node .fit { font-family: var(--mono); font-size: .76rem; margin-top: 6px; display: flex; gap: 10px; flex-wrap: wrap; }
.node.core { border-color: rgba(55,211,153,.5); box-shadow: inset 0 0 0 1px rgba(55,211,153,.15); }
.node.suspended { opacity: .6; border-style: dashed; }
.node.incubating { border-color: rgba(143,123,255,.5); }

/* feed */
.feed { display: flex; flex-direction: column; gap: 8px; max-height: 560px; overflow: auto; padding-right: 4px; }
.msg { border-left: 3px solid var(--line-2); padding: 6px 10px; background: rgba(255,255,255,.02); border-radius: 0 10px 10px 0; }
.msg .who { font-size: .74rem; color: var(--muted); display: flex; justify-content: space-between; gap: 8px; }
.msg .subject { font-weight: 600; font-size: .86rem; }
.msg .body { color: var(--muted); font-size: .8rem; white-space: pre-wrap; margin-top: 2px; }
.msg.DIRECTIVE { border-color: var(--accent); } .msg.VETO { border-color: var(--down); } .msg.ALERT { border-color: var(--warn); }
.msg.RESEARCH { border-color: var(--accent-2); } .msg.REPORT { border-color: var(--up); } .msg.SIGNAL { border-color: var(--dim); }

/* news */
.news-item { padding: 10px 0; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 54px 1fr; gap: 12px; }
.news-item:last-child { border-bottom: none; }
.sent { font-family: var(--mono); font-weight: 700; text-align: center; border-radius: 8px; padding: 6px 0; font-size: .8rem; }
.sent.pos { background: rgba(55,211,153,.12); color: var(--up); } .sent.neg { background: rgba(255,92,122,.12); color: var(--down); } .sent.neu { background: rgba(255,255,255,.05); color: var(--muted); }
.tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.tag { font-size: .68rem; padding: 2px 7px; border-radius: 6px; background: rgba(79,209,255,.1); color: var(--accent); letter-spacing: .04em; }
.tag.macro { background: rgba(255,179,71,.12); color: var(--warn); }
.tag.tk { background: rgba(143,123,255,.14); color: #b9adff; font-family: var(--mono); }

/* bars */
.wbar { height: 8px; background: rgba(255,255,255,.06); border-radius: 6px; overflow: hidden; }
.wbar > span { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; font-size: .84rem; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; font-family: var(--mono); }
.chart-box { position: relative; height: 260px; }
.chart-box.tall { height: 340px; }
.card.col { display: flex; flex-direction: column; }
.chart-box.grow { flex: 1 1 auto; min-height: 320px; }
.card-head.wrap { flex-wrap: wrap; gap: 8px; }
.range-btns { display: flex; align-items: center; gap: 4px; margin: 2px 0 10px; }
.range-btn { background: transparent; border: 1px solid var(--line); color: var(--muted); border-radius: 6px; padding: 3px 9px; font: inherit; font-size: 0.75rem; letter-spacing: 0.04em; cursor: pointer; }
.range-btn:hover { color: var(--text); border-color: var(--text); }
.range-btn.active { background: var(--accent-soft, rgba(99, 140, 255, 0.18)); color: var(--text); border-color: var(--accent); }
.range-btns .tiny { margin-left: auto; }
.book-btn.active { border-color: var(--accent); color: var(--text); }
.book-btn.ghost { opacity: 0.75; }
#postures td { vertical-align: top; }
#postures td.mono { white-space: nowrap; }
.pname { display: flex; align-items: center; gap: 8px; }
.agg { width: 9px; height: 9px; border-radius: 50%; display: inline-block; background: var(--up); flex: none; }
.agg.a0 { background: #5aa9ff; } .agg.a1 { background: var(--up); } .agg.a2 { background: #c9d36a; } .agg.a3 { background: var(--warn); } .agg.a4 { background: var(--down); }
tr.mine td { background: rgba(99, 140, 255, 0.06); }
.pill.tiny { font-size: 0.62rem; padding: 1px 6px; }
canvas { max-width: 100%; }

/* landing */
.hero { max-width: 1100px; margin: 0 auto; padding: 70px 24px 40px; }
.hero .eyebrow { color: var(--accent); letter-spacing: .18em; text-transform: uppercase; font-size: .75rem; font-weight: 700; }
.hero h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); line-height: 1.05; margin: 14px 0 18px; letter-spacing: -.03em; }
.hero h1 span { background: linear-gradient(90deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p.lead { font-size: 1.1rem; color: var(--muted); max-width: 640px; }
.hero-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 36px; }
@media (max-width: 800px) { .hero-grid { grid-template-columns: 1fr; } }
.topnav { display: flex; justify-content: space-between; align-items: center; padding: 18px 32px; border-bottom: 1px solid var(--line); }
.auth-box { max-width: 440px; margin: 60px auto; }
.disclaimer { font-size: .78rem; color: var(--dim); border-top: 1px solid var(--line); padding-top: 14px; margin-top: 30px; }
.ticker-row { display: flex; gap: 8px; flex-wrap: wrap; }
.ticker-row .tick { background: rgba(255,255,255,.04); padding: 3px 8px; border-radius: 6px; font-size: .78rem; }
details summary { cursor: pointer; color: var(--muted); }
.spark { height: 36px; width: 120px; }

/* posture picker */
.posture-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; }
.posture-opt { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; cursor: pointer; background: rgba(255,255,255,0.015); transition: border-color 0.15s, background 0.15s; }
.posture-opt:hover { border-color: var(--muted); }
.posture-opt.selected { border-color: var(--accent); background: rgba(79, 209, 255, 0.06); }
.posture-opt input[type=radio] { margin-top: 4px; accent-color: var(--accent); }
.posture-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.posture-title { display: flex; align-items: center; gap: 8px; }
.posture-stats { margin-top: 2px; }
