/* cga-infra — shared theme, mirrors the cga PoC dark style. Each entity sets --accent on <body>. */
:root {
  --bg: #0f1115; --panel: #171a21; --panel2: #1e222b; --line: #2a2f3a;
  --txt: #e6e9ef; --muted: #9aa3b2;
  --pass: #43c98a; --partial: #e3b341; --fail: #f0606a; --info: #4ea1ff;
  --accent: #2dd4bf;            /* gym */
  --radius: 10px;
}
body.arena  { --accent: #f0606a; }   /* arena = high-stakes crimson */
body.ledger { --accent: #4ea1ff; }   /* ledger = audit blue */

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font: 16px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: radial-gradient(1200px 600px at 70% -10%, #16202b 0%, var(--bg) 55%) fixed;
  color: var(--txt); height: 100vh; display: flex; flex-direction: column; overflow: hidden;
}

/* split layout: content left, activity log pinned right (cga PoC style) */
.split { flex: 1; display: flex; min-height: 0; }
.main { flex: 1; overflow-y: auto; }
.side {
  width: 380px; flex-shrink: 0; border-left: 1px solid var(--line);
  background: rgba(14,18,24,.5); display: flex; flex-direction: column;
}
.side-hd { padding: 13px 18px; font-size: 13.5px; font-weight: 700; color: var(--muted); border-bottom: 1px solid var(--line); }
@media (max-width: 820px) {
  body { overflow: auto; height: auto; }
  .split { flex-direction: column; }
  .side { width: auto; border-left: none; border-top: 1px solid var(--line); max-height: 40vh; }
}
a { color: var(--accent); }

header {
  display: flex; align-items: center; gap: 14px; padding: 14px 22px;
  border-bottom: 1px solid var(--line); background: rgba(23,26,33,.7); backdrop-filter: blur(6px);
  position: sticky; top: 0; z-index: 5;
}
header .brand { font-weight: 800; font-size: 15px; letter-spacing: .2px; }
header .brand b { color: var(--accent); }
header .sub { color: var(--muted); font-size: 12.5px; }
header .spacer { flex: 1; }
header .who {
  font-size: 12.5px; color: var(--muted); border: 1px solid var(--line);
  border-radius: 999px; padding: 4px 12px; background: var(--panel2);
}
header .who b { color: var(--accent); font-family: ui-monospace, Menlo, Consolas, monospace; }
header .xlinks { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
header .xlink {
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  font-size: 12px; text-decoration: none; color: var(--muted);
  border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px;
}
header .xlink:hover { color: var(--txt); border-color: var(--accent); }
header .xlink b { color: var(--accent); font-weight: 600; }

.wrap { max-width: 880px; margin: 0 auto; padding: 26px 22px 70px; }
.lead { color: var(--muted); margin: 2px 0 22px; font-size: 16px; }

.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 20px; margin: 0 0 16px;
}
.card h2 { margin: 0 0 4px; font-size: 16px; }
.card h2 .n {
  display: inline-grid; place-items: center; width: 22px; height: 22px; margin-right: 8px;
  border-radius: 50%; background: var(--accent); color: #06121a; font-size: 12.5px; font-weight: 800; vertical-align: 2px;
}
.card .desc { color: var(--muted); margin: 0 0 14px; font-size: 14.5px; }
.card.done { border-color: color-mix(in srgb, var(--pass) 45%, var(--line)); }
.card.locked { opacity: .5; }

.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 620px) { .grid2 { grid-template-columns: 1fr; } }

button {
  font: inherit; cursor: pointer; border-radius: 8px; padding: 9px 16px; font-weight: 600;
  background: var(--accent); color: #06121a; border: 1px solid var(--accent); transition: filter .12s, opacity .12s;
}
button:hover { filter: brightness(1.08); }
button.ghost { background: transparent; color: var(--txt); border-color: var(--line); }
button.ghost:hover { border-color: var(--accent); color: var(--accent); filter: none; }
button:disabled { opacity: .4; cursor: not-allowed; filter: none; }
button.sm { padding: 6px 12px; font-size: 13px; }

input[type=text], input[type=file] {
  font: inherit; background: var(--panel2); color: var(--txt);
  border: 1px solid var(--line); border-radius: 8px; padding: 9px 12px;
}
input[type=text] { min-width: 280px; font-family: ui-monospace, Menlo, Consolas, monospace; }
label.fld { display: block; color: var(--muted); font-size: 12.5px; margin: 0 0 5px; }

.pill {
  display: inline-block; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px;
  background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; padding: 4px 10px; color: var(--accent);
  word-break: break-all;
}
.badge {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700;
  border-radius: 999px; padding: 3px 11px; border: 1px solid;
}
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge.pass { color: var(--pass); border-color: color-mix(in srgb, var(--pass) 40%, transparent); }
.badge.pending { color: var(--partial); border-color: color-mix(in srgb, var(--partial) 40%, transparent); }
.badge.fail { color: var(--fail); border-color: color-mix(in srgb, var(--fail) 40%, transparent); }
.badge.info { color: var(--info); border-color: color-mix(in srgb, var(--info) 40%, transparent); }

pre.token {
  background: #0b0e13; border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px;
  font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; color: #b9c2d0;
  white-space: pre-wrap; word-break: break-all; max-height: 230px; overflow: auto; margin: 12px 0 0;
}

.drop {
  border: 1.5px dashed var(--line); border-radius: var(--radius); padding: 20px; text-align: center;
  color: var(--muted); background: var(--panel2); cursor: pointer; transition: border-color .12s, color .12s;
}
.drop:hover, .drop.over { border-color: var(--accent); color: var(--accent); }

#log {
  font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; background: #0b0e13;
  border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; max-height: 220px; overflow: auto;
}
.side #log { flex: 1; max-height: none; border: none; border-radius: 0; background: transparent; padding: 12px 16px; }
#log .e { padding: 1px 0; color: #93a0b3; }
#log .e.ok { color: var(--pass); } #log .e.warn { color: var(--partial); } #log .e.err { color: var(--fail); }
#log .e .t { color: #5a6577; margin-right: 6px; }

.timeline .item {
  border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 8px;
  padding: 10px 14px; margin: 0 0 9px; background: var(--panel2);
}
.timeline .item .hd { display: flex; justify-content: space-between; gap: 10px; font-weight: 600; }
.timeline .item .meta { color: var(--muted); font-size: 12px; margin-top: 4px; font-family: ui-monospace, monospace; word-break: break-all; }

footer { color: var(--muted); font-size: 12px; text-align: center; padding: 18px; border-top: 1px solid var(--line); }
.hide { display: none !important; }
