/* cga-infra shared theme — Dr. Strong University design language (drop-in upgrade).
   Same class + variable names as before, so every page (PP/LP/Arena/Ledger/X-Org) and the engine
   session page restyle with ZERO markup changes. Each entity keeps its own --accent on <body>. */
:root {
  --bg: #0e1116; --panel: #171c23; --panel2: #1e2530; --panel3: #252e3b; --line: #2a3240; --line-strong: #3a4553;
  --txt: #eef3f8; --muted: #9fb0c0; --faint: #6d7c8c;
  --pass: #3fb950; --partial: #e0a63c; --fail: #f0606a; --info: #58a6ff;
  --accent: #e5484d;            /* default = Strong crimson (PP/LP/session self-set their own) */
  --radius: 14px; --radius-sm: 10px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
body.arena  { --accent: #e5484d; }   /* certification = high-stakes crimson */
body.ledger { --accent: #58a6ff; }   /* audit blue */
body.xorg   { --accent: #2dd4bf; }   /* data teal */

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { margin: 0; }
body {
  font: 17px/1.55 var(--font);
  background: var(--bg); color: var(--txt); min-height: 100vh;
  display: flex; flex-direction: column; -webkit-font-smoothing: antialiased;
}

/* single column: content on top, activity log STACKED at the bottom (matches the Gym) */
.split { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.main { flex: 1 0 auto; }
.side { width: auto; flex-shrink: 0; border-top: 1px solid var(--line); background: rgba(10,13,18,.4); display: flex; flex-direction: column; }
.side-hd { padding: 14px 18px; font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); border-bottom: 1px solid var(--line); }
.side #log { max-height: 34vh; }
a { color: var(--info); }

/* header */
header {
  display: flex; align-items: center; gap: 12px; padding: 13px clamp(14px,4vw,24px);
  border-bottom: 1px solid var(--line); background: rgba(14,17,22,.9); backdrop-filter: blur(10px);
  position: sticky; top: 0; z-index: 5; flex-wrap: wrap;
}
header .brand { font-weight: 800; font-size: 17px; letter-spacing: -.01em; }
header .brand b { color: var(--accent); }
header .sub { color: var(--muted); font-size: 13px; }
header .spacer { flex: 1; }
header .who { font-size: 13px; color: var(--muted); border: 1px solid var(--line-strong); border-radius: 999px; padding: 6px 13px; background: var(--panel2); max-width: 46vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
header .who b { color: var(--accent); font-family: var(--mono); }
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: 12.5px; text-decoration: none; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 5px 11px; }
header .xlink:hover { color: var(--txt); border-color: var(--accent); }
header .xlink b { color: var(--accent); font-weight: 600; }

.wrap { max-width: 760px; margin: 0 auto; padding: clamp(16px,4vw,26px) clamp(14px,4vw,24px) 70px; }
.lead { color: var(--muted); margin: 2px 0 22px; font-size: 16px; line-height: 1.6; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px clamp(16px,4vw,22px); margin: 0 0 16px; }
.card h2 { margin: 0 0 6px; font-size: 18px; font-weight: 700; letter-spacing: -.01em; }
.card h2 .n { display: inline-grid; place-items: center; width: 26px; height: 26px; margin-right: 9px; border-radius: 50%; background: var(--accent); color: #0b0b0b; font-size: 13px; font-weight: 800; vertical-align: 2px; }
.card .desc { color: var(--muted); margin: 0 0 14px; font-size: 15px; line-height: 1.55; }
.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: var(--radius-sm); padding: 12px 18px; font-size: 16px; font-weight: 600;
  min-height: 46px; background: var(--accent); color: #0b0b0b; border: 1px solid var(--accent);
  transition: filter .12s, transform .05s;
}
button:hover:not(:disabled) { filter: brightness(1.08); }
button:active:not(:disabled) { transform: scale(.985); }
button.ghost { background: var(--panel2); color: var(--txt); border-color: var(--line-strong); }
button.ghost:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); filter: none; }
button:disabled { opacity: .42; cursor: not-allowed; filter: none; }
button.sm { padding: 8px 13px; font-size: 14px; min-height: 38px; }
button:focus-visible { outline: 2px solid var(--info); outline-offset: 2px; }

input[type=text], input[type=file], input[type=email], input:not([type]) {
  font: inherit; background: var(--panel2); color: var(--txt); border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm); padding: 12px 14px; font-size: 16px;
}
input[type=text] { min-width: 240px; }
input:focus { outline: 2px solid var(--info); outline-offset: 1px; }
label.fld { display: block; color: var(--muted); font-size: 13px; margin: 0 0 6px; }

.pill { display: inline-block; font-family: var(--mono); font-size: 13px; background: var(--panel2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 5px 11px; color: var(--accent); word-break: break-all; }
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700; border-radius: 999px; padding: 4px 12px; 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); background: color-mix(in srgb, var(--pass) 12%, transparent); }
.badge.pending { color: var(--partial); border-color: color-mix(in srgb, var(--partial) 40%, transparent); background: color-mix(in srgb, var(--partial) 12%, transparent); }
.badge.fail { color: var(--fail); border-color: color-mix(in srgb, var(--fail) 40%, transparent); background: color-mix(in srgb, var(--fail) 12%, transparent); }
.badge.info { color: var(--info); border-color: color-mix(in srgb, var(--info) 40%, transparent); background: color-mix(in srgb, var(--info) 12%, transparent); }

pre.token, pre.hide { background: #090c11; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 13px 15px; font-family: var(--mono); font-size: 12.5px; color: #b9c2d0; white-space: pre-wrap; word-break: break-all; max-height: 260px; overflow: auto; margin: 12px 0 0; }

.drop { border: 1.5px dashed var(--line-strong); border-radius: var(--radius); padding: 22px; text-align: center; color: var(--muted); background: var(--panel2); cursor: pointer; transition: border-color .12s, color .12s; font-size: 15px; }
.drop:hover, .drop.over { border-color: var(--accent); color: var(--accent); }

#log { font-family: var(--mono); font-size: 13px; background: #090c11; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 11px 13px; max-height: 240px; overflow: auto; }
.side #log { flex: 1; max-height: none; border: none; border-radius: 0; background: transparent; padding: 12px 16px; }
#log .e { padding: 2px 0; color: #93a0b3; line-height: 1.45; }
#log .e.ok { color: var(--pass); } #log .e.warn { color: var(--partial); } #log .e.err { color: var(--fail); }
#log .e .t { color: var(--faint); margin-right: 7px; font-variant-numeric: tabular-nums; }

.timeline .item { border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: var(--radius-sm); padding: 12px 15px; 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: 12.5px; margin-top: 4px; font-family: var(--mono); word-break: break-all; }

footer { color: var(--faint); font-size: 12.5px; text-align: center; padding: 20px; border-top: 1px solid var(--line); }
.hide { display: none !important; }
