:root {
  --bg: #0d1117;
  --panel: #161b22;
  --panel-2: #1c2330;
  --border: #2a3340;
  --text: #e6edf3;
  --muted: #9aa7b4;
  --accent: #58a6ff;
  --good: #3fb950;
  --bad: #f85149;
  --warn: #d29922;
  --radius: 12px;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --sans: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

h1 { font-size: 1.25rem; margin: 0; letter-spacing: 0.2px; }
h2 { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin: 0 0 0.75rem; }

code { font-family: var(--mono); background: var(--panel-2); padding: 0.1em 0.35em; border-radius: 6px; }

/* ---------- Lock screen ---------- */
.lock {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
}
.lock-card {
  width: 100%;
  max-width: 360px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  text-align: center;
}
.tagline { color: var(--muted); font-size: 0.85rem; margin: 0.25rem 0 1.5rem; }
.lock form { display: flex; flex-direction: column; gap: 0.6rem; text-align: left; }
.lock label { font-size: 0.8rem; color: var(--muted); }
input[type="password"] {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  padding: 0.6rem 0.7rem;
  font-size: 1rem;
  font-family: var(--mono);
}
input[type="password"]:focus { outline: 2px solid var(--accent); border-color: var(--accent); }
button {
  cursor: pointer;
  border: none;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.6rem 0.9rem;
  background: var(--accent);
  color: #04101f;
}
button:hover { filter: brightness(1.08); }
button.ghost { background: transparent; border: 1px solid var(--border); color: var(--muted); font-weight: 500; }
.lock-note { color: var(--muted); font-size: 0.72rem; margin: 1.25rem 0 0; }
.error { color: var(--bad); font-size: 0.8rem; margin: 0.2rem 0 0; }

/* ---------- Dashboard ---------- */
#dashboard { max-width: 1040px; margin: 0 auto; padding: 1.5rem 1.25rem 3rem; }
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.25rem;
}
.topbar-right { display: flex; align-items: center; gap: 0.75rem; }
.meta { color: var(--muted); font-size: 0.78rem; margin: 0.2rem 0 0; font-family: var(--mono); }
.badge {
  text-transform: uppercase;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 0.25rem 0.5rem;
  border-radius: 999px;
  background: rgba(88, 166, 255, 0.15);
  color: var(--accent);
  border: 1px solid rgba(88, 166, 255, 0.35);
}
.badge.live { background: rgba(248, 81, 73, 0.15); color: var(--bad); border-color: rgba(248, 81, 73, 0.4); }

.banner {
  background: rgba(210, 153, 34, 0.12);
  border: 1px solid rgba(210, 153, 34, 0.35);
  color: var(--warn);
  padding: 0.6rem 0.85rem;
  border-radius: 8px;
  font-size: 0.82rem;
  margin-bottom: 1.25rem;
}
.banner-halt {
  background: rgba(248, 81, 73, 0.14);
  border-color: rgba(248, 81, 73, 0.45);
  color: var(--bad);
  font-weight: 600;
}

.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem;
}
.span-2 { grid-column: span 2; }
@media (max-width: 720px) { .grid { grid-template-columns: 1fr; } .span-2 { grid-column: span 1; } }

.outlook { font-size: 1.02rem; margin: 0; }

/* directions */
.directions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.85rem; }
@media (max-width: 720px) { .directions { grid-template-columns: 1fr; } }
.horizon h3 {
  font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--accent); margin: 0 0 0.5rem; padding-bottom: 0.35rem; border-bottom: 1px solid var(--border);
}
.thesis { background: var(--panel-2); border: 1px solid var(--border); border-radius: 8px; padding: 0.6rem 0.7rem; margin-bottom: 0.55rem; }
.thesis .claim { font-size: 0.86rem; }
.thesis .sub { font-size: 0.72rem; color: var(--muted); margin-top: 0.35rem; font-family: var(--mono); }
.conf { display: inline-block; font-family: var(--mono); font-size: 0.72rem; color: var(--accent); font-weight: 700; }
.muted { color: var(--muted); font-size: 0.82rem; }

/* tables / rows */
.row { display: flex; justify-content: space-between; gap: 0.75rem; padding: 0.32rem 0; border-bottom: 1px solid rgba(42, 51, 64, 0.5); font-size: 0.85rem; }
.row:last-child { border-bottom: none; }
.row .k { color: var(--muted); }
.row .v { font-family: var(--mono); }
.num { font-family: var(--mono); }
.pos { color: var(--good); }
.neg { color: var(--bad); }
.kpi { display: flex; gap: 1.5rem; margin-bottom: 0.6rem; flex-wrap: wrap; }
.kpi .big { font-size: 1.4rem; font-family: var(--mono); }
.kpi .lbl { font-size: 0.7rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }

.spark-wrap { display: flex; align-items: center; gap: 0.6rem; margin: 0.1rem 0 0.7rem; }
.spark-label { font-size: 0.68rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; white-space: nowrap; }
.spark { display: block; max-width: 100%; }

.event { display: flex; gap: 0.75rem; padding: 0.4rem 0; border-bottom: 1px solid rgba(42, 51, 64, 0.5); font-size: 0.82rem; }
.event:last-child { border-bottom: none; }
.event .ts { font-family: var(--mono); color: var(--muted); white-space: nowrap; }
.event .trig {
  font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.04em;
  padding: 0.05rem 0.4rem; border-radius: 999px; border: 1px solid var(--border); color: var(--muted); height: fit-content;
}

/* notifications + messages */
.sub-h { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin: 0.7rem 0 0.4rem; }
.sub-h:first-child { margin-top: 0; }
.note { display: flex; align-items: baseline; gap: 0.6rem; padding: 0.35rem 0.55rem; border-radius: 7px; font-size: 0.82rem; margin-bottom: 0.35rem; border-left: 3px solid var(--border); background: var(--panel-2); }
.note .ts { margin-left: auto; font-family: var(--mono); color: var(--muted); font-size: 0.72rem; white-space: nowrap; }
.note-event { font-family: var(--mono); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.03em; color: var(--muted); }
.note-info { border-left-color: var(--accent); }
.note-success { border-left-color: var(--good); }
.note-warning { border-left-color: var(--warn); }
.note-critical { border-left-color: var(--bad); }
.msg { display: flex; align-items: baseline; gap: 0.6rem; padding: 0.4rem 0.6rem; border-radius: 8px; font-size: 0.85rem; margin-bottom: 0.4rem; max-width: 88%; }
.msg .ts { margin-left: auto; font-family: var(--mono); color: var(--muted); font-size: 0.7rem; white-space: nowrap; }
.msg-outbound { background: var(--panel-2); border: 1px solid var(--border); }
.msg-inbound { background: rgba(88, 166, 255, 0.12); border: 1px solid rgba(88, 166, 255, 0.3); margin-left: auto; }

/* pending approvals (HITL) */
.card-approvals { border-color: rgba(210, 153, 34, 0.5); background: linear-gradient(180deg, rgba(210, 153, 34, 0.08), var(--panel) 60%); }
.card-approvals h2 { color: var(--warn); }
.approval { background: var(--panel-2); border: 1px solid var(--border); border-radius: 8px; padding: 0.6rem 0.75rem; margin-top: 0.6rem; }
.approval-head { display: flex; align-items: baseline; justify-content: space-between; gap: 0.6rem; }
.approval-title { font-size: 0.9rem; }
.approval-id { font-family: var(--mono); font-size: 0.72rem; color: var(--muted); }
.approval-side { display: inline-block; font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; padding: 0.05rem 0.4rem; border-radius: 999px; }
.approval-buy { background: rgba(63, 185, 80, 0.16); color: var(--good); border: 1px solid rgba(63, 185, 80, 0.35); }
.approval-sell { background: rgba(248, 81, 73, 0.16); color: var(--bad); border: 1px solid rgba(248, 81, 73, 0.35); }
.approval .sub { font-size: 0.72rem; color: var(--muted); margin-top: 0.3rem; font-family: var(--mono); }
.approval-rationale { font-size: 0.8rem; color: var(--text); margin-top: 0.4rem; }

/* deposits (hot-wallet balances) */
.deposit { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; padding: 0.45rem 0; border-bottom: 1px solid rgba(42, 51, 64, 0.5); }
.deposit:last-of-type { border-bottom: none; }
.deposit-main { display: flex; align-items: baseline; gap: 0.6rem; }
.deposit-amt { font-family: var(--mono); font-size: 0.92rem; }
.deposit-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 0.45rem; vertical-align: middle; }
.deposit-dot.funded { background: var(--good); }
.deposit-dot.empty { background: var(--border); }
.deposit-chain { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.04em; padding: 0.05rem 0.4rem; border-radius: 999px; border: 1px solid var(--border); color: var(--muted); }
.deposit-addr { font-size: 0.72rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; max-width: 52%; white-space: nowrap; }
.deposit-foot { margin: 0.6rem 0 0; }

.footer { margin-top: 1.5rem; padding-top: 1rem; border-top: 1px solid var(--border); color: var(--muted); font-size: 0.78rem; font-family: var(--mono); }
.chips { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.chip { font-size: 0.72rem; font-family: var(--mono); color: var(--muted); background: var(--panel-2); border: 1px solid var(--border); border-radius: 6px; padding: 0.2rem 0.45rem; }
