:root {
  --bg: #09090b; --bg2: #0f0f12; --bg3: #131318; --border: #1e1e26; --border2: #2a2a36;
  --text: #ededef; --text2: #b0b0ba; --text3: #8a8a96;
  --v2: #22d3ee; --ctrl: #a3e635;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { background: var(--bg); color: var(--text); font-family: system-ui, -apple-system, sans-serif; line-height: 1.55; }
body { max-width: 1280px; margin: 0 auto; padding: 0 1.25rem; }

header { display: flex; align-items: center; justify-content: space-between; padding: 1rem 0; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: rgba(9,9,11,0.92); backdrop-filter: blur(8px); z-index: 10; }
.brand { display: flex; align-items: center; gap: 0.5rem; }
.logo { width: 22px; height: 22px; background: #3b82f6; border-radius: 5px; }
.logo-text { font-family: monospace; font-weight: 600; }
nav a { color: var(--text2); text-decoration: none; margin-left: 1.25rem; font-size: 14px; }
nav a:hover, nav a.nav-active { color: var(--text); }

.hero { padding: 2.5rem 0 1.5rem; border-bottom: 1px solid var(--border); }
.hero h1 { font-size: 1.7rem; margin-bottom: 0.5rem; letter-spacing: -0.02em; }
.hero .tag { color: var(--text2); max-width: 760px; }
.hero a { color: #60a5fa; text-decoration: none; }
.hero a:hover { text-decoration: underline; }

.dual { display: grid; grid-template-columns: 1.4fr 1fr; gap: 1.5rem; margin-top: 2rem; }
@media (max-width: 900px) { .dual { grid-template-columns: 1fr; } }
.agent-col h2 { font-size: 1.2rem; margin-bottom: 0.75rem; }

.overview { background: var(--bg2); border: 1px solid var(--border); border-radius: 8px; padding: 0.75rem 1rem; margin-bottom: 1rem; font-size: 13px; }
.overview-row { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.badge { display: inline-block; font-family: monospace; font-size: 10px; color: var(--text3); border: 1px solid var(--border); padding: 1px 6px; border-radius: 3px; text-transform: uppercase; }
.badge + strong, .badge + * { margin-right: 0.5rem; }

.panels { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.75rem; }
.panel { background: var(--bg2); border: 1px solid var(--border); border-radius: 8px; padding: 0.85rem 1rem; min-height: 80px; }
.panel h3 { font-size: 13px; color: var(--text3); margin-bottom: 0.45rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }
.panel pre { font-family: monospace; font-size: 12px; color: var(--text2); white-space: pre-wrap; word-break: break-word; max-height: 180px; overflow: auto; }
.panel.notice { color: var(--text3); font-style: italic; font-size: 13px; }

.chart-section { margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid var(--border); }
.chart-section h2 { font-size: 1.2rem; margin-bottom: 0.4rem; }
.chart-section .muted { color: var(--text3); font-size: 13px; margin-bottom: 0.75rem; }
canvas { width: 100%; height: auto; max-width: 900px; background: var(--bg2); border: 1px solid var(--border); border-radius: 8px; }
.spectrum { margin-top: 1rem; display: grid; grid-template-columns: 100px 1fr 100px; align-items: center; gap: 0.75rem; font-family: monospace; font-size: 12px; color: var(--text3); }
.spectrum-bar { position: relative; height: 8px; background: linear-gradient(to right, #ef4444, #facc15 50%, #22c55e); border-radius: 4px; }
.spectrum-marker { position: absolute; top: -4px; width: 4px; height: 16px; background: var(--text); border-radius: 2px; transform: translateX(-50%); }
#current-score { margin-top: 0.5rem; font-family: monospace; font-size: 12px; }

.transcript-section { margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid var(--border); }
.transcript-section h2 { font-size: 1.2rem; margin-bottom: 0.4rem; }
.transcript-section .muted { color: var(--text3); font-size: 13px; margin-bottom: 0.75rem; }
.transcript { font-family: monospace; font-size: 12px; color: var(--text2); background: #050507; border: 1px solid var(--border); border-radius: 8px; padding: 1rem; max-height: 360px; overflow: auto; white-space: pre-wrap; word-break: break-word; }

footer { margin-top: 4rem; padding: 1.5rem 0; border-top: 1px solid var(--border); color: var(--text3); font-size: 13px; text-align: center; }
footer a { color: var(--text2); text-decoration: none; }
footer a:hover { color: var(--text); }

/* ── Transcript feed ── */
.transcript-controls { display: flex; align-items: center; gap: 1rem; margin: 0.75rem 0 1rem; font-size: 13px; color: var(--text3); }
.transcript-controls label { display: flex; align-items: center; gap: 0.4rem; cursor: pointer; }
.transcript { max-height: 720px; overflow-y: auto; padding: 1rem; background: #050507; border: 1px solid var(--border); border-radius: 10px; display: flex; flex-direction: column; gap: 0.85rem; }

.t-entry { background: var(--bg2); border: 1px solid var(--border); border-left: 3px solid var(--text3); border-radius: 8px; padding: 0.85rem 1rem; }
.t-v2 { border-left-color: var(--v2); }
.t-control { border-left-color: var(--ctrl); }

.t-head { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; font-family: monospace; font-size: 11px; color: var(--text3); padding-bottom: 0.6rem; border-bottom: 1px solid var(--border); margin-bottom: 0.6rem; }
.t-tag { display: inline-block; padding: 1px 7px; border-radius: 3px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; font-size: 10px; }
.t-tag-v2 { background: rgba(34,211,238,0.15); color: var(--v2); }
.t-tag-control { background: rgba(163,230,53,0.15); color: var(--ctrl); }
.t-tag-action { background: rgba(245,158,11,0.15); color: var(--accent-warm, #f59e0b); }
.t-cycle { font-weight: 600; color: var(--text); }
.t-status { padding: 1px 6px; border-radius: 3px; }
.t-status-complete { color: var(--ctrl); }
.t-status-failed, .t-status-terminated { color: #ef4444; }
.t-status-running { color: var(--v2); }
.t-cost { color: var(--text2); }
.t-time { margin-left: auto; }

.t-decision { margin-bottom: 0.7rem; }
.t-d-meta { font-family: monospace; font-size: 10.5px; color: var(--text3); margin-bottom: 0.4rem; }
.t-d-output { color: var(--text2); font-size: 14px; line-height: 1.55; }
.t-d-output > *:first-child { margin-top: 0; }
.t-d-output > *:last-child { margin-bottom: 0; }
.t-d-output p { margin: 0.45rem 0; }
.t-d-output ul, .t-d-output ol { margin: 0.45rem 0; padding-left: 1.5rem; }
.t-d-output li { margin: 0.2rem 0; }
.t-d-output h1, .t-d-output h2, .t-d-output h3, .t-d-output h4 { color: var(--text); margin: 0.6rem 0 0.3rem; font-weight: 600; }
.t-d-output h1 { font-size: 1.05rem; } .t-d-output h2 { font-size: 1rem; } .t-d-output h3 { font-size: 0.95rem; }
.t-d-output strong { color: var(--text); }
.t-d-output em { color: var(--text2); }
.t-d-output code { background: #0a0a0c; border: 1px solid var(--border); padding: 0 4px; border-radius: 3px; font-size: 12px; color: #c4b5fd; }
.t-d-output pre { background: #0a0a0c; border: 1px solid var(--border); border-radius: 6px; padding: 0.6rem 0.85rem; overflow-x: auto; margin: 0.5rem 0; }
.t-d-output pre code { background: transparent; border: 0; padding: 0; color: var(--text2); font-size: 12px; line-height: 1.5; }
.t-d-output blockquote { border-left: 2px solid var(--border-hover, #2a2a36); padding-left: 0.75rem; color: var(--text3); margin: 0.5rem 0; }
.t-d-output a { color: #60a5fa; text-decoration: none; }
.t-d-output a:hover { text-decoration: underline; }
.t-d-output hr { border: 0; border-top: 1px solid var(--border); margin: 0.7rem 0; }
.t-d-output table { border-collapse: collapse; margin: 0.5rem 0; font-size: 12px; }
.t-d-output th, .t-d-output td { border: 1px solid var(--border); padding: 0.3rem 0.6rem; }
.t-d-output th { background: var(--bg2); color: var(--text3); }

.t-action { font-family: monospace; font-size: 12px; color: var(--text2); padding: 0.35rem 0; }
.t-payload { background: #0a0a0c; border: 1px solid var(--border); padding: 1px 6px; border-radius: 3px; color: var(--text3); font-size: 11px; }
