/* OUTTHINK — shared interface primitives. Brand layouts in outthink.css. */

:root {
  --bg: #060809;
  --bg-2: #0b1011;
  --haze: #1b2b21;
  --panel: #11161b;
  --panel-2: #172023;
  --line: rgba(255, 255, 255, 0.06);
  --line-2: rgba(255, 255, 255, 0.1);
  --text: #f3f7f2;
  --muted: #8d98a3;
  --faint: #7d8986;
  --accent: #a3ff3f;
  --accent-2: #72f5b0;
  --accent-3: #d4f5bc;
  --steel: #b5c2bb;
  --accent-dim: rgba(163, 255, 63, 0.5);
  --glow: rgba(163, 255, 63, 0.08);
  --card-grad: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.008));
  --up: #72f5b0;
  --down: #f17d78;
  --warn: #e5c66b;
  --danger: var(--down);
  --font: "Sora", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "Geist Mono", "IBM Plex Mono", "Fragment Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --header-h: 80px;
  --radius: 10px;
  --radius-sm: 5px;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
}

body {
  margin: 0;
  background:
    radial-gradient(1150px 520px at 84% -12%, rgba(30, 47, 35, 0.5), transparent 62%),
    radial-gradient(880px 440px at -12% 30%, rgba(30, 47, 35, 0.38), transparent 56%),
    radial-gradient(1400px 900px at 50% 110%, rgba(163, 255, 63, 0.05), transparent 60%),
    var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--accent); color: var(--bg); }

a { color: var(--accent-2); text-decoration: none; }
a:hover { color: var(--accent); }
a:focus-visible, button:focus-visible, input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

code, pre, .mono { font-family: var(--mono); }

/* Geometric headings and controls; monospace stays on data and code. */
h1, h2, h3, h4, .brand, .kicker, .btn, .btn-text, .badge, .tag, caption,
th, .nav-links a, .toc, .steps h4, .stat, .file-btn, .dropzone,
.footer-brand, .dash-topbar h1, .hero-badges, .callout-title, .panel > header {
  font-family: var(--font);
}

.container {
  width: min(1180px, 100% - 48px);
  margin-inline: auto;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: var(--bg);
  padding: 8px 16px;
  z-index: 200;
  font-weight: 700;
}
.skip-link:focus { left: 8px; }

/* --------------------------------------------------------------------------
   Header / nav
   -------------------------------------------------------------------------- */

.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  height: var(--header-h);
  background: rgba(6, 8, 9, 0.88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  z-index: 100;
}

.nav {
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 20px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 0.88rem;
  white-space: nowrap;
}
.brand img {
  width: 30px;
  height: 30px;
  display: block;
  /* no drop-shadow here: filter + .site-header backdrop-filter triggers a
     Chrome compositing bug that paints the img's transparent pixels black */
}
.brand:hover { color: var(--accent-2); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: auto;
  list-style: none;
  padding: 0;
}

.nav-links a {
  display: block;
  padding: 8px 11px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border-bottom: 1px solid transparent;
}
.nav-links a:hover { color: var(--text); }
.nav-links a.active {
  color: var(--accent-2);
  border-bottom-color: var(--accent);
}

.nav-cta {
  margin-left: 8px;
  padding: 9px 18px !important;
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  line-height: 1;
  background: linear-gradient(180deg, var(--accent-2), var(--accent));
  color: var(--bg) !important;
  font-weight: 700;
  border-radius: 999px;
  border-bottom: none !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 2px 10px rgba(163, 255, 63, 0.25);
  transition: box-shadow 0.18s ease, background 0.18s ease;
}
.nav-cta:hover {
  background: linear-gradient(180deg, #c1ff83, var(--accent-2));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45), 0 0 18px rgba(163, 255, 63, 0.45);
}

.nav-toggle {
  display: none;
  margin-left: auto;
  background: none;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  color: var(--accent-2);
  width: 42px;
  height: 38px;
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
}

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */

.hero {
  padding: calc(var(--header-h) + 84px) 0 72px;
  position: relative;
  overflow: hidden;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: 48px;
  align-items: center;
}

.kicker {
  display: inline-block;
  color: var(--steel);
  font-size: 0.74rem;
  font-weight: 500;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  margin-bottom: 14px;
}

.hero h1 {
  font-size: clamp(2.6rem, 6.5vw, 4.6rem);
  line-height: 0.98;
  margin: 0 0 18px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  font-weight: 800;
  background: linear-gradient(180deg, #f3f7f2 30%, var(--accent-3) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 34px rgba(163, 255, 63, 0.35));
}
.hero h1 .accent {
  background: linear-gradient(180deg, var(--accent-3), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.tagline {
  font-size: 1.25rem;
  color: var(--muted);
  margin: 0 0 8px;
  font-style: italic;
}

.hero-sub {
  color: var(--muted);
  max-width: 56ch;
  margin: 0 0 28px;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
}

.btn {
  display: inline-block;
  padding: 14px 26px;
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border-radius: var(--radius-sm);
  transition: transform 0.08s ease, box-shadow 0.18s ease, background 0.18s ease;
}
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: linear-gradient(180deg, var(--accent-2), var(--accent));
  color: var(--bg);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 4px 18px rgba(163, 255, 63, 0.28);
}
.btn-primary:hover {
  background: linear-gradient(180deg, #c1ff83, var(--accent-2));
  color: var(--bg);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45), 0 6px 26px rgba(163, 255, 63, 0.42);
}

.btn-ghost {
  background: var(--card-grad);
  color: var(--accent-2);
  box-shadow: inset 0 0 0 1px var(--accent-dim);
}
.btn-ghost:hover { box-shadow: inset 0 0 0 1px var(--accent), 0 0 18px rgba(163, 255, 63, 0.22); color: var(--accent-2); }

.btn-text {
  color: var(--muted);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 500;
}
.btn-text:hover { color: var(--accent-2); }

.hero-mark {
  display: flex;
  justify-content: center;
}
.hero-mark img {
  width: min(300px, 60vw);
  filter: drop-shadow(0 0 34px rgba(163, 255, 63, 0.3));
}

.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 30px;
  padding: 0;
  list-style: none;
}
.hero-badges li {
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: var(--card-grad);
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 5px 13px;
  font-weight: 500;
}

/* Table of contents chips */
.toc {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.015), rgba(255, 255, 255, 0.005)), rgba(17, 22, 27, 0.6);
  backdrop-filter: blur(6px);
  padding: 12px 0;
}
.toc ol {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: toc;
  font-size: 0.78rem;
}
.toc a { color: var(--muted); }
.toc a:hover { color: var(--accent-2); }
.toc li::before {
  counter-increment: toc;
  content: counter(toc, decimal-leading-zero) " /";
  color: var(--faint);
  margin-right: 5px;
  font-size: 0.72rem;
}

/* --------------------------------------------------------------------------
   Sections
   -------------------------------------------------------------------------- */

.section { padding: 64px 0 8px; }

.sec-head { margin-bottom: 26px; }
.sec-head h2 {
  margin: 0;
  font-size: clamp(1.4rem, 3vw, 2rem);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 14px;
}
.sec-head h2::before {
  content: "";
  width: 20px;
  height: 20px;
  background: linear-gradient(180deg, var(--accent-3), var(--accent));
  box-shadow: 0 0 16px rgba(163, 255, 63, 0.5);
  border-radius: 6px;
  flex: none;
}
.sec-head .sub { color: var(--muted); margin: 8px 0 0; max-width: 72ch; }

h3 {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.95rem;
  margin: 34px 0 10px;
  color: var(--accent-2);
  font-weight: 700;
}

p { margin: 0 0 14px; }
ul, ol { padding-left: 22px; }
li { margin-bottom: 6px; }

/* Cards */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }

.card {
  background: var(--card-grad), var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: inset 0 -10px 34px -3.5px var(--glow), 0 2px 12px rgba(0, 0, 0, 0.25);
  padding: 22px 22px 18px;
  position: relative;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.card:hover {
  border-color: var(--line-2);
  transform: translateY(-2px);
  box-shadow: inset 0 -10px 34px -3.5px var(--glow), 0 8px 28px rgba(0, 0, 0, 0.4), 0 0 24px rgba(163, 255, 63, 0.1);
}
.card h3 { margin-top: 0; }
.card h4 {
  margin: 0 0 10px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.82rem;
  color: var(--accent-2);
}

/* Checklists */
.checklist { list-style: none; padding: 0; margin: 0; }
.checklist li {
  padding: 9px 0 9px 34px;
  position: relative;
  border-bottom: 1px dashed var(--line);
  margin: 0;
  color: var(--text);
}
.checklist li:last-child { border-bottom: 0; }
.checklist li::before {
  position: absolute;
  left: 4px;
  top: 9px;
  font-family: var(--mono);
  font-weight: 700;
}
.checklist.do li::before { content: "\2713"; color: var(--accent-2); }
.checklist.never li::before { content: "\00d7"; color: var(--down); }
.checklist.never li { color: var(--muted); }

/* Callouts */
.callout {
  border: 1px solid var(--line);
  border-left: 2px solid var(--accent);
  border-radius: var(--radius-sm);
  background: var(--card-grad), var(--panel);
  box-shadow: inset 0 -10px 34px -3.5px var(--glow);
  padding: 16px 20px;
  margin: 20px 0;
}
.callout-danger { border-left-color: var(--down); }
.callout-warn { border-left-color: var(--warn); }
.callout .callout-title {
  display: block;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.76rem;
  margin-bottom: 6px;
  color: var(--accent-2);
}
.callout-danger .callout-title { color: var(--down); }
.callout-warn .callout-title { color: var(--warn); }
.callout p:last-child { margin-bottom: 0; }

/* Code blocks */
pre {
  background: #0b1011;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 18px 20px;
  overflow-x: auto;
  font-size: 0.84rem;
  line-height: 1.55;
  color: #b9c3dd;
  margin: 14px 0;
}
pre.ascii { color: var(--steel); font-size: 0.78rem; line-height: 1.4; }
pre .c { color: var(--faint); }
code.inline, p code, li code, td code {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 1px 6px;
  font-size: 0.86em;
  color: var(--accent-2);
}

/* Tables */
.table-wrap { overflow-x: auto; margin: 14px 0 22px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--card-grad), var(--panel); }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}
caption {
  text-align: left;
  padding: 10px 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.74rem;
  color: var(--accent-2);
  background: var(--panel-2);
  border-bottom: 1px solid var(--line);
}
th, td {
  text-align: left;
  padding: 9px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
th {
  background: var(--panel-2);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--muted);
  white-space: nowrap;
}
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: rgba(163, 255, 63, 0.05); }
td.num, th.num { text-align: right; font-family: var(--mono); }
td .mono, td code { white-space: nowrap; }

/* Steps */
.steps { counter-reset: step; list-style: none; padding: 0; }
.steps > li {
  counter-increment: step;
  position: relative;
  padding: 0 0 26px 58px;
  border-left: 1px solid var(--line-2);
  margin-left: 16px;
}
.steps > li:last-child { padding-bottom: 4px; }
.steps > li::before {
  content: counter(step, decimal-leading-zero);
  position: absolute;
  left: -17px;
  top: 0;
  width: 33px;
  height: 33px;
  display: grid;
  place-items: center;
  background: var(--bg);
  border: 1px solid var(--accent-dim);
  border-radius: 10px;
  color: var(--accent-2);
  font-family: var(--mono);
  font-weight: 700;
  font-size: 0.85rem;
  box-shadow: 0 0 12px rgba(163, 255, 63, 0.15);
}
.steps h4 { margin: 2px 0 6px; text-transform: uppercase; letter-spacing: 0.1em; font-size: 0.88rem; }
.steps p { color: var(--muted); margin-bottom: 8px; }

/* Badges */
.badge {
  display: inline-block;
  padding: 3px 10px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  color: var(--muted);
  font-family: var(--mono);
}
.badge-mode {
  color: var(--bg);
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 14px rgba(163, 255, 63, 0.35);
}
.badge-halt, .badge-cb {
  color: #fff;
  background: var(--down);
  border-color: var(--down);
  animation: pulse 1.4s ease-in-out infinite;
}
.badge-ok { color: var(--accent-2); border-color: var(--accent-dim); }
.badge-warn { color: var(--warn); border-color: var(--warn); }
.badge-source { color: var(--steel); border-color: var(--accent-dim); }
@keyframes pulse { 50% { opacity: 0.55; } }

/* FAQ */
.faq details {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--card-grad), var(--panel);
  box-shadow: inset 0 -10px 34px -3.5px var(--glow);
  margin-bottom: 10px;
  overflow: hidden;
}
.faq summary {
  cursor: pointer;
  padding: 14px 18px;
  font-weight: 600;
  font-family: var(--mono);
  font-size: 0.9rem;
  list-style: none;
  position: relative;
  padding-right: 44px;
}
.faq summary::after {
  content: "+";
  position: absolute;
  right: 16px;
  top: 12px;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 1.1rem;
}
.faq details[open] summary::after { content: "\2212"; }
.faq details[open] summary { border-bottom: 1px solid var(--line); color: var(--accent-2); }
.faq details > div { padding: 12px 18px 16px; color: var(--muted); }
.faq details > div p:last-child { margin-bottom: 0; }

/* Footer */
.site-footer {
  margin-top: 80px;
  border-top: 1px solid var(--line);
  background: rgba(11, 16, 17, 0.7);
  padding: 40px 0 30px;
}
.footer-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
  align-items: center;
  justify-content: space-between;
}
.footer-brand { display: flex; align-items: center; gap: 12px; color: var(--text); font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; }
.footer-brand img { width: 34px; height: 34px; filter: drop-shadow(0 0 8px rgba(163, 255, 63, 0.45)); }
.footer-note { color: var(--faint); font-size: 0.85rem; margin-top: 18px; }
.footer-links { display: flex; gap: 18px; list-style: none; padding: 0; margin: 0; font-size: 0.85rem; }
.footer-links a { color: var(--muted); text-transform: uppercase; letter-spacing: 0.1em; font-size: 0.74rem; font-weight: 500; font-family: var(--mono); }
.footer-links a:hover { color: var(--accent-2); }

/* --------------------------------------------------------------------------
   Dashboard
   -------------------------------------------------------------------------- */

.dash-main { padding-top: calc(var(--header-h) + 22px); }

.dash-topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}
.dash-topbar h1 {
  font-size: 1.25rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin: 0 12px 0 0;
  font-weight: 700;
  color: #fff;
}
.dash-meta { margin-left: auto; color: var(--faint); font-size: 0.78rem; font-family: var(--mono); }

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: stretch;
  margin-bottom: 22px;
}
.file-btn {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: var(--card-grad), var(--panel);
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-weight: 500;
  font-size: 0.76rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.file-btn:hover { border-color: var(--accent); color: var(--accent-2); box-shadow: 0 0 16px rgba(163, 255, 63, 0.2); }
.file-btn input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}
.file-btn.loaded { border-color: var(--accent-dim); color: var(--accent-2); }

.dropzone {
  flex: 1 1 260px;
  border: 1px dashed var(--line-2);
  border-radius: var(--radius-sm);
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  font-size: 0.78rem;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  min-height: 44px;
}
.dropzone.drag-over { border-color: var(--accent); color: var(--accent-2); background: rgba(163, 255, 63, 0.06); }

.status-line {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--muted);
  margin: -8px 0 20px;
  min-height: 1.2em;
}
.status-line .err { color: var(--down); }
.status-line .ok { color: var(--accent-2); }
.poll-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  background: var(--accent);
  margin-right: 6px;
  animation: pulse 1.4s ease-in-out infinite;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 14px;
  margin-bottom: 18px;
}
.stat {
  background: var(--card-grad), var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: inset 0 -10px 34px -3.5px var(--glow);
  padding: 14px 16px 12px;
  position: relative;
}
.stat::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 2px;
  height: 100%;
  border-radius: 2px;
  background: var(--line-2);
}
.stat.accent::before { background: var(--accent); box-shadow: 0 0 12px rgba(163, 255, 63, 0.6); }
.stat .label {
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--muted);
  margin-bottom: 6px;
}
.stat .value {
  font-family: var(--mono);
  font-size: 1.3rem;
  font-weight: 700;
  line-height: 1.1;
  word-break: break-word;
}
.stat .sub { font-size: 0.72rem; color: var(--faint); margin-top: 4px; font-family: var(--mono); }

.bar {
  height: 8px;
  background: var(--bg);
  border: 1px solid var(--line-2);
  border-radius: 999px;
  margin-top: 8px;
  position: relative;
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  border-radius: 999px;
  width: 0%;
  transition: width 0.4s ease;
}
.bar-fill.warn { background: var(--warn); }
.bar-fill.danger { background: var(--down); }

.panel {
  background: var(--card-grad), var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: inset 0 -10px 34px -3.5px var(--glow), 0 2px 12px rgba(0, 0, 0, 0.25);
  margin-bottom: 18px;
  overflow: hidden;
}
.panel > header {
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.02);
}
.panel > header h2 {
  margin: 0;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--accent-2);
  font-weight: 700;
}
.panel > header .hint { margin-left: auto; color: var(--faint); font-size: 0.72rem; font-family: var(--mono); }
.panel .panel-body { padding: 16px 18px; }
.panel .table-wrap { margin: 0; border: 0; }

.dash-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.dash-grid .panel { margin-bottom: 0; }

.metric-list { list-style: none; padding: 0; margin: 0; }
.metric-list li {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 7px 0;
  border-bottom: 1px dashed var(--line);
  font-size: 0.88rem;
}
.metric-list li:last-child { border-bottom: 0; }
.metric-list .k { color: var(--muted); }
.metric-list .v { font-family: var(--mono); text-align: right; }

.lessons { list-style: none; padding: 0; margin: 0; }
.lessons li {
  padding: 10px 0 10px 26px;
  border-bottom: 1px dashed var(--line);
  position: relative;
  color: var(--text);
  font-size: 0.9rem;
}
.lessons li:last-child { border-bottom: 0; }
.lessons li::before {
  content: "\25B8";
  position: absolute;
  left: 4px;
  color: var(--accent);
}
.lesson-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.tag {
  font-family: var(--mono);
  font-size: 0.68rem;
  padding: 3px 9px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

canvas#sparkline {
  width: 100%;
  height: 260px;
  display: block;
}

canvas#equity-chart {
  width: 100%;
  height: 200px;
  display: block;
}

canvas#balance-chart {
  width: 100%;
  height: 320px;
  display: block;
}

/* Gateway-fed sections (order history / performance) */
.gateway-hint {
  margin: 16px 18px;
  padding: 14px 16px;
  border: 1px dashed var(--line-2);
  border-radius: var(--radius-sm);
  color: var(--faint);
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.03em;
}
.gateway-hint code {
  background: var(--panel-2);
  border: 1px solid var(--line);
  padding: 1px 6px;
  color: var(--accent-2);
}

.perf-grid { margin-bottom: 22px; }

.perf-split {
  display: grid;
  grid-template-columns: 2fr 3fr;
  gap: 24px;
  align-items: start;
}

.panel-sub {
  margin: 0 0 12px;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--muted);
  font-weight: 500;
}

.symbol-bars { display: grid; gap: 10px; }
.symbol-bar-row {
  display: grid;
  grid-template-columns: 56px 1fr 96px;
  align-items: center;
  gap: 12px;
  font-family: var(--mono);
  font-size: 0.8rem;
}
.symbol-bar-label { color: var(--text); text-transform: uppercase; letter-spacing: 0.08em; }
.symbol-bar-track {
  height: 10px;
  background: var(--bg);
  border: 1px solid var(--line-2);
  border-radius: 999px;
  position: relative;
  overflow: hidden;
}
.symbol-bar-fill {
  height: 100%;
  background: var(--accent);
  min-width: 1px;
}
.symbol-bar-fill.pos { background: var(--up); }
.symbol-bar-fill.neg { background: var(--down); }
.symbol-bar-value { text-align: right; }

@media (max-width: 880px) {
  .perf-split { grid-template-columns: 1fr; }
}

/* Trading semantics — the only place semantic colors appear */
.side-long { color: var(--up); font-weight: 700; text-transform: uppercase; }
.side-short { color: var(--down); font-weight: 700; text-transform: uppercase; }
.side-wait { color: var(--faint); text-transform: uppercase; }
.pnl-pos { color: var(--up); font-family: var(--mono); }
.pnl-neg { color: var(--down); font-family: var(--mono); }
.pnl-zero { color: var(--faint); font-family: var(--mono); }
.outcome-win { color: var(--up); }
.outcome-loss { color: var(--down); }
.outcome-breakeven { color: var(--warn); }

.log-table td { font-size: 0.8rem; }
.log-scroll { max-height: 480px; overflow-y: auto; }
.log-scroll thead th { position: sticky; top: 0; z-index: 1; }

.empty-state {
  border: 1px dashed var(--line-2);
  border-radius: var(--radius);
  box-shadow: inset 0 -10px 34px -3.5px var(--glow);
  padding: 44px 24px;
  text-align: center;
  color: var(--muted);
  margin-bottom: 20px;
}
.empty-state h2 { color: var(--text); text-transform: uppercase; letter-spacing: 0.14em; font-size: 1rem; font-family: var(--mono); }
.empty-state p { max-width: 64ch; margin: 8px auto 18px; font-size: 0.92rem; }

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 1020px) {
  .stat-grid { grid-template-columns: repeat(3, 1fr); }
  .hero-grid { grid-template-columns: 1fr; }
  .hero-mark { order: -1; }
  .hero-mark img { width: 150px; }
}

@media (max-width: 880px) {
  .nav-toggle { display: block; }
  .nav-links {
    display: none;
    position: absolute;
    top: var(--header-h);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    background: var(--bg-2);
    border-bottom: 1px solid var(--line);
    padding: 10px 20px 16px;
    gap: 0;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 12px 4px; border-bottom: 1px solid var(--line); }
  .nav-links a.active { border-bottom: 1px solid var(--line); color: var(--accent-2); }
  .nav-cta { margin: 10px 0 0; text-align: center; }
  .grid-2, .grid-3, .dash-grid { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .section { padding: 44px 0 4px; }
}

@media (max-width: 520px) {
  .stat-grid { grid-template-columns: 1fr; }
  .container { width: calc(100% - 32px); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .badge-halt, .badge-cb, .poll-dot { animation: none; }
  .bar-fill { transition: none; }
  .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
  .card { transition: none; }
}

/* connected agents status dots */
.agent-status { display: inline-flex; align-items: center; gap: 0.45rem; font-family: var(--mono); font-size: 0.78rem; }
.agent-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }
.agent-dot.online { background: var(--accent-2); box-shadow: 0 0 6px var(--accent); }
.agent-dot.idle { background: var(--warn); }
.agent-dot.offline { background: var(--faint); }
/* disconnected but still holding open positions — needs attention NOW */
.agent-dot.stranded {
  background: var(--down);
  box-shadow: 0 0 8px var(--down);
  animation: pulse 1.1s ease-in-out infinite;
}
tr.agent-stranded td {
  background: rgba(241, 125, 120, 0.07);
  box-shadow: inset 2px 0 0 var(--down);
}
tr.agent-stranded .agent-status { color: var(--down); font-weight: 700; }

/* agent id link → per-agent stats page */
.agent-link {
  color: var(--accent-3);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.agent-link:hover { color: var(--accent-2); border-bottom-color: var(--accent-dim); }
.agent-link::after { content: " ↗"; color: var(--faint); font-size: 0.85em; }

/* balance chart: unrealized/realized toggle + per-model legend */
.equity-toggle { display: inline-flex; gap: 4px; margin: 0 10px; }
.equity-toggle-btn {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 12px;
  border-radius: 999px;
  border: 1px solid var(--line-strong, rgba(255, 255, 255, 0.12));
  background: transparent;
  color: var(--faint);
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
.equity-toggle-btn:hover { color: var(--accent-2); border-color: var(--accent-dim); }
.equity-toggle-btn.active {
  color: var(--accent-3);
  border-color: var(--accent-dim);
  background: var(--accent-glow, rgba(163, 255, 63, 0.12));
}
.equity-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-bottom: 10px;
}
.equity-chip { display: inline-flex; align-items: center; gap: 7px; font-size: 0.82rem; }
.equity-chip .mono { color: var(--steel); }
.equity-swatch { width: 10px; height: 10px; border-radius: 3px; flex: none; }

/* arena leaderboard: winner callout + per-agent equity bars */
.lb-wrap { display: flex; gap: 18px; padding: 16px 18px; align-items: stretch; }
.lb-winner {
  flex: none;
  width: 220px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
}
.lb-winner-label {
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
  margin-top: 8px;
}
.lb-winner-label:first-child { margin-top: 0; }
.lb-winner-name { font-size: 1.15rem; font-weight: 600; }
.lb-winner-equity { font-family: var(--mono); font-size: 1.3rem; font-weight: 700; }
.lb-bars {
  flex: 1;
  display: flex;
  gap: 22px;
  overflow-x: auto;
  padding: 4px 2px;
  min-width: 0;
}
.lb-col {
  flex: 1 0 88px;
  min-width: 88px;
  max-width: 130px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.lb-value { font-size: 0.85rem; font-weight: 700; color: var(--steel); }
.lb-track {
  width: 100%;
  height: 180px;
  display: flex;
  align-items: flex-end;
  border-bottom: 1px solid var(--line);
}
.lb-bar {
  width: 100%;
  border-radius: 4px 4px 0 0;
  opacity: 0.92;
  transition: height 0.4s ease;
}
.lb-name {
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lb-sub { font-size: 0.72rem; }
@media (max-width: 880px) {
  .lb-wrap { flex-direction: column; }
  .lb-winner { width: auto; }
}

/* --------------------------------------------------------------------------
   Per-agent page (agent.html)
   -------------------------------------------------------------------------- */

.agent-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin: 26px 0 6px;
}
.agent-hero-id { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.agent-hero-id h1 { margin: 0; }
.agent-hero-id .agent-dot { width: 12px; height: 12px; }
.agent-hero-sub { color: var(--faint); font-size: 0.8rem; }
.agent-hero-badges { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

canvas.agent-chart {
  width: 100%;
  height: 220px;
  display: block;
}

.exit-plan {
  max-width: 260px;
  white-space: normal;
  font-size: 0.74rem;
  color: var(--steel);
}

.reasoning-list { list-style: none; margin: 0; padding: 0; }
.reasoning-item {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.reasoning-item:last-child { border-bottom: 0; }
.reasoning-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 6px;
  color: var(--faint);
  font-size: 0.76rem;
}
.reasoning-tag {
  color: var(--accent-2);
  border: 1px solid var(--accent-dim);
  border-radius: 999px;
  padding: 1px 9px;
  font-size: 0.7rem;
}
.reasoning-text {
  margin: 0;
  color: var(--steel);
  font-size: 0.86rem;
  line-height: 1.6;
}

/* --------------------------------------------------------------------------
   Quant engine — formula blocks
   -------------------------------------------------------------------------- */

.formula {
  font-family: var(--mono);
  background: #0b1011;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  margin: 12px 0;
  font-size: 0.88rem;
  line-height: 1.9;
  color: var(--accent-3);
  overflow-x: auto;
  white-space: nowrap;
}
.formula .op { color: var(--steel); }
.formula .var { color: var(--accent-2); font-style: italic; }
.formula .const { color: var(--warn); }
.formula .note { color: var(--faint); font-size: 0.78rem; }
.formula sub, .formula sup { font-size: 0.68em; }

.quant-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 880px) { .quant-grid { grid-template-columns: 1fr; } }
.quant-grid .card { display: flex; flex-direction: column; }
.quant-grid .formula { margin-top: auto; }

/* Scroll reveal (app.js adds .reveal; .in when intersecting) */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}
.reveal.in { opacity: 1; transform: none; }

/* ==========================================================================
   SPA additions — agent modal + arena board (same palette tokens)
   ========================================================================== */

/* Agent statistics modal (opened in place — no page redirect) */
.agent-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(6, 8, 9, 0.78);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  overflow-y: auto;
  padding: 40px 16px 64px;
  animation: modal-fade 0.18s ease;
}
.agent-modal {
  position: relative;
  max-width: 1120px;
  margin: 0 auto;
  background:
    radial-gradient(900px 320px at 80% -10%, rgba(30, 47, 35, 0.42), transparent 60%),
    var(--bg-2);
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55), 0 0 0 1px var(--glow);
  padding: 26px 26px 34px;
  animation: modal-pop 0.22s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}
.agent-modal-close {
  position: sticky;
  top: 0;
  float: right;
  z-index: 5;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--line-2);
  background: var(--panel-2);
  color: var(--steel);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}
.agent-modal-close:hover {
  color: var(--accent-2);
  border-color: var(--accent-dim);
  transform: rotate(90deg);
}
@keyframes modal-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes modal-pop {
  from { opacity: 0; transform: translateY(14px) scale(0.985); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .agent-modal-overlay, .agent-modal { animation: none; }
}
@media (max-width: 640px) {
  .agent-modal-overlay { padding: 16px 8px 40px; }
  .agent-modal { padding: 18px 14px 26px; }
}

/* Arena board styles (ported from the old arena page, unchanged look) */
.ticker { display: flex; gap: 22px; overflow-x: auto; padding: 10px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); font-family: var(--mono); font-size: 0.85rem; }
.ticker span { white-space: nowrap; color: var(--muted); }
.ticker b { color: var(--text); font-weight: 600; }
.arena-grid { display: grid; grid-template-columns: 3fr 2fr; gap: 18px; }
@media (max-width: 960px) { .arena-grid { grid-template-columns: 1fr; } }
.legend { display: flex; flex-wrap: wrap; gap: 12px; font-family: var(--mono); font-size: 0.78rem; color: var(--muted); margin-top: 8px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; }
.chat-feed { max-height: 520px; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; }
.chat-item { border: 1px solid var(--line); border-left: 3px solid var(--accent-dim); padding: 10px 12px; border-radius: 4px; }
.chat-item .chat-meta { font-family: var(--mono); font-size: 0.72rem; color: var(--muted); display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.chat-item .chat-meta .chat-model { font-weight: 700; }
.chat-item p { margin: 0; font-size: 0.85rem; color: var(--text); white-space: pre-wrap; }
.chat-item .chat-exit { color: var(--muted); font-size: 0.78rem; margin-top: 6px; }
canvas#arena-equity-chart { width: 100%; height: 320px; display: block; }
.pill { font-family: var(--mono); font-size: 0.7rem; padding: 1px 7px; border: 1px solid var(--line-2); border-radius: 99px; }
.pill-bad { color: var(--down); border-color: var(--down); }
.pill-ok { color: var(--up); border-color: var(--up); }
.num-up { color: var(--up); }
.num-down { color: var(--down); }

.btn-disabled { opacity: 0.55; pointer-events: none; cursor: default; }

/* toast (landing "Get Skill" while ClawHub review pending) */
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--accent-dim);
  border-radius: var(--radius-sm);
  padding: 12px 22px;
  font-family: var(--mono);
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5), 0 0 18px rgba(163, 255, 63, 0.2);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
  z-index: 300;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* contract-address strip (landing hero) */
.ca-strip {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
  padding: 9px 14px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  background: var(--panel);
  width: fit-content;
  max-width: 100%;
}
.ca-label {
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: var(--accent-2);
  text-transform: uppercase;
}
.ca-addr {
  font-size: 0.78rem;
  color: var(--muted);
  overflow-wrap: anywhere;
}
.ca-copy {
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-2);
  background: none;
  border: 1px solid var(--accent-dim);
  border-radius: 6px;
  padding: 4px 12px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.ca-copy:hover { background: var(--accent); color: var(--bg); border-color: var(--accent); }
.ca-copy.copied { background: var(--accent); color: var(--bg); border-color: var(--accent); }
