/* =========================================================================
   Atlassian Cloud RL — Trajectory Playground
   Three-panel IDE layout (navigator · detail · live observer), inspired by a
   dense agent-environment console — rendered in a light/white W&B + LangSmith
   theme. Zero external dependencies (system font stacks only).
   ========================================================================= */

:root {
  --bg:          #eef0f4;
  --panel:       #ffffff;
  --panel-soft:  #f7f8fa;
  --observer-bg: #f4f5f8;
  --surface:     #ffffff;
  --surface2:    #f7f8fa;
  --border:      #e6e8ec;
  --border2:     #d6d9df;

  --text:        #14171a;
  --text2:       #4b5563;
  --text3:       #8a93a2;

  --indigo:      #4f46e5;
  --indigo2:     #7c6df2;
  --indigo-soft: #eef0fe;
  --indigo-glow: rgba(79,70,229,.18);

  --pass:        #15a34a;
  --pass-soft:   #e7f6ec;
  --partial:     #c77700;
  --partial-soft:#fbf0dd;
  --fail:        #dc2626;
  --fail-soft:   #fbe9e9;
  --neutral:     #64748b;
  --neutral-soft:#eef1f4;

  --jira:        #2563eb;
  --confluence:  #7c3aed;
  --mixed:       #0d9488;

  --shadow-sm: 0 1px 2px rgba(16,24,40,.06);
  --shadow-md: 0 6px 20px rgba(16,24,40,.10);

  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  --header-h: 56px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
/* faint grid backdrop */
body::before {
  content: "";
  position: fixed; inset: 0;
  background-image:
    linear-gradient(rgba(79,70,229,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(79,70,229,.035) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none; z-index: 0;
}

h1,h2,h3,h4 { font-weight: 650; letter-spacing: -.01em; }
.mono { font-family: var(--mono); }
.muted { color: var(--text3); }
.tabnum { font-variant-numeric: tabular-nums; }
.hidden { display: none !important; }

/* ============================ app bar ============================ */
.appbar {
  position: relative; z-index: 20;
  height: var(--header-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px; gap: 20px;
  background: rgba(255,255,255,.9);
  backdrop-filter: saturate(160%) blur(8px);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 11px; min-width: 0; }
.brand-mark {
  width: 30px; height: 30px; border-radius: 8px; flex: none;
  background: linear-gradient(135deg, var(--indigo), var(--indigo2));
  color: #fff; font-size: 15px; display: grid; place-items: center;
  box-shadow: var(--shadow-sm);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.brand-title { font-size: 14px; font-weight: 700; }
.brand-sub { font-family: var(--mono); font-size: 10.5px; color: var(--text3); }

.appbar-right { display: flex; align-items: center; gap: 14px; }
.statstrip { display: flex; gap: 16px; font-family: var(--mono); }
.statstrip .stat { display: flex; align-items: baseline; gap: 5px; }
.statstrip .stat .num { font-size: 14px; font-weight: 700; color: var(--text); }
.statstrip .stat .lab { font-size: 9.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--text3); }
.hbtn {
  font-family: var(--mono); font-size: 11px; font-weight: 600; letter-spacing: .03em;
  padding: 7px 13px; border-radius: 8px; cursor: pointer;
  border: 1px solid var(--border2); background: var(--surface); color: var(--text2);
  transition: all .12s ease;
}
.hbtn:hover { border-color: var(--indigo); color: var(--indigo); }
.hbtn.active { background: var(--indigo); border-color: var(--indigo); color: #fff; }

/* ============================ layout ============================ */
.main {
  position: relative; z-index: 1;
  display: grid;
  grid-template-columns: 312px minmax(0,1fr) 392px;
  height: calc(100vh - var(--header-h));
}
.panel {
  display: flex; flex-direction: column; min-width: 0;
  border-right: 1px solid var(--border);
  background: var(--panel);
  overflow: hidden;
}
.panel:last-child { border-right: none; }
#panel-left { background: var(--panel-soft); }
#panel-right { background: var(--observer-bg); }

.panel-header {
  flex: none;
  padding: 11px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--panel);
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.panel-title { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.panel-title > span:first-child { font-size: 12px; font-weight: 700; letter-spacing: .02em; text-transform: uppercase; color: var(--text); }
.panel-def { font-size: 10.5px; color: var(--text3); }
.panel-count { font-family: var(--mono); font-size: 11px; color: var(--indigo); font-weight: 600; flex: none; }

.panel-sub { flex: none; padding: 10px 12px; border-bottom: 1px solid var(--border); background: var(--panel); display: flex; flex-direction: column; gap: 8px; }
.panel-body { flex: 1; min-height: 0; overflow-y: auto; padding: 12px; }

/* scrollbars */
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: #d3d7df; border-radius: 6px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: #b9bec9; background-clip: padding-box; }

/* ============================ filters ============================ */
#task-search {
  font-family: var(--sans); font-size: 13px; padding: 7px 11px;
  border: 1px solid var(--border2); border-radius: 8px;
  background: var(--surface); color: var(--text); width: 100%;
}
#task-search:focus { outline: 2px solid var(--indigo-soft); border-color: var(--indigo); }
.chip-row { display: flex; gap: 5px; flex-wrap: wrap; }
.fchip {
  font-size: 11px; padding: 4px 10px; border-radius: 16px; cursor: pointer; user-select: none;
  border: 1px solid var(--border2); background: var(--surface); color: var(--text2);
  text-transform: capitalize; transition: all .12s ease;
}
.fchip:hover { border-color: var(--indigo); }
.fchip.active { background: var(--indigo); border-color: var(--indigo); color: #fff; }

/* ============================ legend (left) ============================ */
.legend { margin-bottom: 10px; }
.legend-head {
  display: flex; align-items: center; gap: 7px; cursor: pointer;
  font-family: var(--mono); font-size: 9.5px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--text3); padding: 2px 2px 8px;
}
.legend-head .tg { color: var(--indigo); font-weight: 700; }
.legend-cards { display: grid; gap: 5px; }
.legend-card { background: var(--surface); border: 1px solid var(--border); border-radius: 7px; padding: 7px 9px; }
.legend-card .lc-term { font-size: 11px; font-weight: 700; color: var(--text); display: flex; align-items: center; gap: 6px; }
.legend-card .lc-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.legend-card .lc-def { font-size: 10.5px; color: var(--text2); line-height: 1.4; margin-top: 2px; }

.group-label {
  font-family: var(--mono); font-size: 9.5px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--text3); padding: 12px 2px 6px; display: flex; align-items: center; gap: 7px;
}
.group-label .gl-dot { width: 7px; height: 7px; border-radius: 50%; }
.group-label .gl-n { color: var(--text3); font-weight: 600; }

/* ============================ task cards (left) ============================ */
.task-card {
  position: relative; overflow: hidden;
  border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface); padding: 10px 12px 10px 13px;
  margin-bottom: 6px; cursor: pointer; transition: all .12s ease;
}
.task-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: transparent; transition: background .12s ease; }
.task-card:hover { border-color: var(--border2); background: var(--panel-soft); }
.task-card:hover::before { background: var(--border2); }
.task-card.active { border-color: var(--indigo); background: var(--indigo-soft); }
.task-card.active::before { background: var(--indigo); box-shadow: 0 0 10px var(--indigo-glow); }
.tc-id { font-family: var(--mono); font-size: 9.5px; letter-spacing: .04em; color: var(--text3); margin-bottom: 3px; }
.tc-title { font-size: 12.5px; font-weight: 600; color: var(--text); line-height: 1.35; margin-bottom: 7px; }
.tc-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

/* ============================ badges / chips ============================ */
.badge { font-size: 10px; font-weight: 650; padding: 2px 8px; border-radius: 16px; text-transform: capitalize; white-space: nowrap; }
.badge.prod-jira { background: #e7efff; color: var(--jira); }
.badge.prod-confluence { background: #f1eafe; color: var(--confluence); }
.badge.prod-mixed { background: #e3f6f3; color: var(--mixed); }
.badge.diff-easy { background: var(--pass-soft); color: var(--pass); }
.badge.diff-medium { background: var(--partial-soft); color: var(--partial); }
.badge.diff-hard { background: var(--fail-soft); color: var(--fail); }

.model-dots { display: inline-flex; gap: 3px; align-items: center; }
.model-dots .d { width: 8px; height: 8px; border-radius: 50%; }
.cell-reward { font-family: var(--mono); font-weight: 700; font-size: 10.5px; border-radius: 5px; padding: 2px 6px; display: inline-block; min-width: 32px; text-align: center; }
.tc-goldonly { font-family: var(--mono); font-size: 9.5px; color: var(--text3); }

/* ============================ leaderboard (middle) ============================ */
.lb-wrap { margin-bottom: 14px; }
.lb-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-sm); overflow: hidden; }
.lb-cardhead {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 11px 15px; border-bottom: 1px solid var(--border); background: var(--panel-soft); cursor: pointer;
}
.lb-cardhead h3 { font-size: 12.5px; }
.lb-cardhead .lb-hint { font-size: 11px; color: var(--text3); }
.lb-cardbody { padding: 13px 15px; }

.lb-row { display: grid; grid-template-columns: 168px 1fr auto; align-items: center; gap: 12px; padding: 7px 0; border-bottom: 1px dashed var(--border); }
.lb-row:last-child { border-bottom: none; }
.lb-model { display: flex; align-items: center; gap: 7px; font-weight: 600; font-size: 12.5px; }
.lb-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.lb-tag { font-size: 9px; padding: 1px 6px; border-radius: 5px; background: var(--neutral-soft); color: var(--neutral); font-weight: 700; text-transform: uppercase; letter-spacing: .03em; }
.lb-track { height: 8px; background: var(--neutral-soft); border-radius: 6px; overflow: hidden; }
.lb-fill { height: 100%; border-radius: 6px; }
.lb-meta { text-align: right; white-space: nowrap; }
.lb-mean { font-family: var(--mono); font-weight: 700; font-size: 13px; }
.lb-pass { font-size: 11px; color: var(--text3); margin-left: 4px; }
.lb-note { margin-top: 11px; font-size: 11px; color: var(--text2); background: var(--panel-soft); border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; line-height: 1.5; }

.lb-matrix { margin-top: 13px; overflow-x: auto; }
.lb-matrix table { width: 100%; border-collapse: collapse; font-size: 10px; }
.lb-matrix th, .lb-matrix td { padding: 4px 3px; text-align: center; border-bottom: 1px solid var(--border); white-space: nowrap; }
.lb-matrix th:first-child, .lb-matrix td:first-child { text-align: left; position: sticky; left: 0; background: var(--surface); padding-left: 0; }
.lb-matrix thead th:first-child { z-index: 1; }
.lb-matrix th { color: var(--text3); font-weight: 600; }
.lb-matrix .cell-reward { min-width: 28px; font-size: 9.5px; padding: 2px 3px; }
.lb-matrix .lb-dot { width: 7px; height: 7px; }
.lb-matrix tbody tr { cursor: pointer; }
.lb-matrix tbody tr:hover td { background: var(--panel-soft); }
.lb-matrix tbody tr.sel td { background: var(--indigo-soft); }
.lb-matrix td:first-child { font-weight: 600; color: var(--text); }

.lb-explain { margin-top: 13px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 1200px) { .lb-explain { grid-template-columns: 1fr; } }
.lb-explain .ex-box { background: var(--panel-soft); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; }
.lb-explain h4 { font-size: 11.5px; margin-bottom: 4px; }
.lb-explain p { font-size: 11px; color: var(--text2); line-height: 1.5; }
.caps { display: flex; gap: 8px; margin-top: 8px; }
.cap-box { flex: 1; background: var(--surface); border: 1px solid var(--border); border-radius: 7px; padding: 6px 8px; text-align: center; }
.cap-box .v { font-family: var(--mono); font-weight: 700; font-size: 15px; }
.cap-box .k { font-size: 9.5px; color: var(--text3); line-height: 1.3; margin-top: 1px; }
.pill-row { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.pill { font-family: var(--mono); font-size: 10.5px; padding: 3px 8px; border-radius: 6px; border: 1px solid var(--border); background: var(--surface); }
.pill b { font-weight: 700; }

/* ============================ task detail (middle) ============================ */
.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; min-height: 180px; gap: 8px; color: var(--text3); font-family: var(--mono); font-size: 12px; text-align: center; }
.empty-icon { font-size: 26px; opacity: .4; }
.empty-hint { color: var(--text3); font-size: 11px; }

.t-head { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-sm); padding: 16px 18px; margin-bottom: 14px; }
.t-head .t-label { font-family: var(--mono); font-size: 9px; letter-spacing: .18em; text-transform: uppercase; color: var(--text3); margin-bottom: 6px; }
.t-head h2 { font-size: 17px; line-height: 1.3; margin-bottom: 10px; }
.t-head .t-badges { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.t-prompt { font-family: var(--mono); font-size: 12.5px; color: var(--text2); line-height: 1.6; background: var(--panel-soft); border-left: 3px solid var(--indigo); border-radius: 0 7px 7px 0; padding: 11px 13px; }
.t-prompt .tp-label { font-family: var(--sans); font-size: 9.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--text3); margin-bottom: 5px; }

.meta-pills { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 16px; }
.mp { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px; font-size: 11px; }
.mp .mk { color: var(--text3); text-transform: uppercase; letter-spacing: .05em; font-size: 9px; }
.mp .mv { font-family: var(--mono); color: var(--text); font-weight: 600; }

.sec-title {
  font-family: var(--mono); font-size: 9.5px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--text3); margin: 0 0 9px; display: flex; align-items: center; gap: 8px;
}
.sec-title::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.sec { margin-bottom: 18px; }

/* run tabs */
.run-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.run-tab {
  display: inline-flex; align-items: center; gap: 7px; cursor: pointer;
  border: 1px solid var(--border2); background: var(--surface); color: var(--text2);
  border-radius: 18px; padding: 5px 12px; font-size: 12px; font-weight: 600; transition: all .12s ease;
}
.run-tab:hover { border-color: var(--indigo); }
.run-tab .rt-dot { width: 8px; height: 8px; border-radius: 50%; }
.run-tab .rt-rew { font-family: var(--mono); font-size: 10.5px; padding: 1px 5px; border-radius: 4px; font-weight: 700; }
.run-tab.active { color: #fff; border-color: transparent; }

/* reward structure: gauge + verdict */
.rs-top { display: flex; align-items: center; gap: 18px; margin-bottom: 14px; flex-wrap: wrap; }
.gauge { --val: 0; --col: var(--neutral); position: relative; width: 86px; height: 86px; flex: none; }
.gauge .ring {
  width: 100%; height: 100%; border-radius: 50%;
  background: conic-gradient(var(--col) calc(var(--val) * 1turn), var(--neutral-soft) 0);
  -webkit-mask: radial-gradient(circle 31px at 50% 50%, transparent 98%, #000 100%);
          mask: radial-gradient(circle 31px at 50% 50%, transparent 98%, #000 100%);
}
.gauge .lbl { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; }
.gauge .lbl b { font-size: 20px; font-variant-numeric: tabular-nums; line-height: 1; }
.rs-facts { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.verdict { font-size: 11px; font-weight: 700; padding: 3px 11px; border-radius: 16px; display: inline-block; }
.verdict.pass { background: var(--pass-soft); color: var(--pass); }
.verdict.fail { background: var(--fail-soft); color: var(--fail); }
.verdict.partial { background: var(--partial-soft); color: var(--partial); }
.rs-line { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.rs-cap { font-size: 11px; color: var(--text3); }
.rs-meta { font-family: var(--mono); font-size: 11px; color: var(--text2); }
.run-note { font-size: 11.5px; color: var(--partial); background: var(--partial-soft); border: 1px solid #f0d9a8; border-radius: 8px; padding: 8px 11px; margin-bottom: 14px; line-height: 1.5; }

.rubric-desc { font-family: var(--mono); font-size: 11px; color: var(--text2); line-height: 1.55; white-space: pre-wrap; background: var(--panel-soft); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; margin-bottom: 11px; }
.comp { border: 1px solid var(--border); border-radius: 9px; padding: 9px 12px; margin-bottom: 7px; background: var(--surface); }
.comp.gate { border-style: dashed; background: var(--panel-soft); }
.comp-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.comp-name { font-weight: 650; font-size: 12.5px; display: flex; align-items: center; gap: 7px; }
.gate-tag { font-size: 8.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--indigo); background: var(--indigo-soft); padding: 1px 6px; border-radius: 4px; }
.comp-score { display: flex; align-items: center; gap: 8px; }
.comp-weight { font-family: var(--mono); font-size: 10px; color: var(--text3); }
.score-chip { font-family: var(--mono); font-size: 10.5px; font-weight: 700; padding: 2px 7px; border-radius: 5px; }
.tick { font-weight: 800; font-size: 13px; }
.tick.ok { color: var(--pass); } .tick.no { color: var(--fail); }
.comp-detail { font-family: var(--mono); font-size: 10.5px; color: var(--text2); margin-top: 5px; line-height: 1.45; }

/* workflow chain (gold plan) */
.collapse-head { display: flex; align-items: center; gap: 7px; cursor: pointer; }
.collapse-head .tg { color: var(--indigo); font-weight: 700; font-size: 11px; }
.workflow-chain { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; background: var(--surface); border: 1px solid var(--border); border-radius: 9px; padding: 10px 12px; margin-bottom: 9px; }
.wf-tool { font-family: var(--mono); font-size: 10.5px; color: var(--indigo); background: var(--indigo-soft); border: 1px solid #cdd0fb; border-radius: 5px; padding: 3px 8px; }
.wf-arrow { color: var(--text3); font-size: 10px; }
.notes { font-family: var(--mono); font-size: 11px; color: var(--text2); background: var(--panel-soft); border: 1px dashed var(--border2); border-radius: 8px; padding: 9px 11px; line-height: 1.5; }
.tool-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.tool-chip { font-family: var(--mono); font-size: 10.5px; background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: 3px 7px; color: var(--text2); }

/* ============================ observer (right) ============================ */
.obs-runhead { display: flex; align-items: center; gap: 8px; padding: 9px 11px; background: var(--surface); border: 1px solid var(--border); border-radius: 9px; margin-bottom: 9px; }
.obs-runhead .rh-dot { width: 9px; height: 9px; border-radius: 50%; }
.obs-runhead .rh-label { font-size: 12px; font-weight: 700; }
.obs-runhead .rh-rew { margin-left: auto; font-family: var(--mono); font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 5px; }

.sysrow { border: 1px solid var(--border); border-radius: 9px; background: var(--surface); margin-bottom: 9px; overflow: hidden; }
.sysrow-head { display: flex; align-items: center; gap: 8px; padding: 9px 11px; cursor: pointer; font-size: 11.5px; font-weight: 600; }
.sysrow-head .tg { color: var(--indigo); font-weight: 700; }
.sysrow-head .sys-def { font-weight: 400; color: var(--text3); font-size: 10.5px; }
.sysrow-body { padding: 0 11px 11px; }

.obs-toolbar { display: flex; align-items: center; gap: 7px; margin-bottom: 9px; flex-wrap: wrap; }
.btn-mini { font-family: var(--mono); font-size: 10.5px; padding: 4px 9px; border-radius: 6px; border: 1px solid var(--border2); background: var(--surface); cursor: pointer; color: var(--text2); }
.btn-mini:hover { border-color: var(--indigo); color: var(--indigo); }
.obs-hint { font-size: 10px; color: var(--text3); }

.timeline { display: flex; gap: 3px; align-items: flex-end; height: 30px; margin-bottom: 11px; padding: 4px 0; }
.tl-seg { flex: 1; border-radius: 3px 3px 0 0; min-height: 4px; }

.obs-entry { border: 1px solid var(--border); border-radius: 9px; background: var(--surface); margin-bottom: 7px; overflow: hidden; }
.obs-head { display: grid; grid-template-columns: auto 1fr auto auto auto; gap: 8px; align-items: center; padding: 8px 10px; cursor: pointer; }
.obs-head:hover { background: var(--panel-soft); }
.obs-step { font-family: var(--mono); font-size: 9px; color: var(--text3); background: var(--neutral-soft); padding: 1px 5px; border-radius: 3px; flex: none; }
.obs-tool { font-family: var(--mono); font-size: 11.5px; font-weight: 600; color: var(--text); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.status-badge { font-family: var(--mono); font-size: 10px; font-weight: 700; padding: 2px 6px; border-radius: 4px; white-space: nowrap; }
.status-2xx { background: var(--pass-soft); color: var(--pass); }
.status-4xx, .status-5xx { background: var(--fail-soft); color: var(--fail); }
.status-na { background: var(--neutral-soft); color: var(--neutral); }
.shape-chip { font-family: var(--mono); font-size: 10px; font-weight: 700; padding: 2px 6px; border-radius: 4px; white-space: nowrap; min-width: 44px; text-align: center; }
.obs-caret { color: var(--text3); font-size: 9px; transition: transform .15s ease; }
.obs-entry.open .obs-caret { transform: rotate(90deg); }
.obs-argline { padding: 0 10px 8px; font-family: var(--mono); font-size: 10.5px; color: var(--text2); word-break: break-word; line-height: 1.5; }
.obs-argline .ak { color: var(--text3); }
.obs-argline .av { color: var(--partial); }
.obs-body { display: none; padding: 0 10px 10px; }
.obs-entry.open .obs-body { display: block; }
.io-label { font-family: var(--mono); font-size: 9px; text-transform: uppercase; letter-spacing: .05em; color: var(--text3); margin: 6px 0 4px; }

pre.code {
  margin: 0; background: #0f1117; color: #d7dce5; border-radius: 7px;
  padding: 10px 12px; font-family: var(--mono); font-size: 11px; line-height: 1.55;
  overflow: auto; max-height: 320px; white-space: pre; tab-size: 2;
}
pre.code.sys { white-space: pre-wrap; word-break: break-word; max-height: 260px; }
pre.code .tok-key { color: #79b8ff; }
pre.code .tok-str { color: #9ecbff; }
pre.code .tok-num { color: #f0a36b; }
pre.code .tok-bool, pre.code .tok-null { color: #c792ea; }

.obs-emptyrun { text-align: center; font-family: var(--mono); font-size: 11px; color: var(--text3); padding: 24px 12px; border: 1px dashed var(--border2); border-radius: 9px; background: var(--surface); }

/* model reasoning / messages inline in the trace */
.obs-think { background: var(--indigo-soft); border: 1px solid #d9dcfb; border-left: 3px solid var(--indigo); border-radius: 8px; padding: 8px 10px; margin-bottom: 7px; }
.think-row { display: flex; gap: 8px; align-items: flex-start; }
.think-row + .think-row { margin-top: 6px; padding-top: 6px; border-top: 1px dashed #d9dcfb; }
.think-tag { flex: none; font-family: var(--mono); font-size: 8.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--indigo); background: #fff; border: 1px solid #d9dcfb; border-radius: 4px; padding: 1px 5px; margin-top: 1px; }
.think-tag.msg { color: var(--text2); }
.think-tag.final { color: var(--pass); border-color: #bfe6cd; }
.think-text { font-size: 11.5px; color: var(--text2); line-height: 1.5; white-space: pre-wrap; word-break: break-word; max-height: 150px; overflow-y: auto; flex: 1; min-width: 0; }
.think-text.msg { color: var(--text); }
.obs-final { background: var(--pass-soft); border: 1px solid #bfe6cd; border-left: 3px solid var(--pass); border-radius: 8px; padding: 8px 10px; margin-top: 9px; display: flex; gap: 8px; align-items: flex-start; }

/* score footer (right) */
.score-footer { flex: none; border-top: 1px solid var(--border); background: var(--panel); padding: 11px 14px; display: flex; align-items: center; gap: 12px; }
.score-footer .sf-block { display: flex; flex-direction: column; gap: 1px; flex: none; }
.score-footer .sf-label { font-family: var(--mono); font-size: 8.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--text3); }
.score-footer .sf-value { font-family: var(--mono); font-size: 21px; font-weight: 700; line-height: 1; }
.score-footer .sf-mid { flex: 1; min-width: 0; }
.score-footer .sf-bar { height: 5px; background: var(--neutral-soft); border-radius: 3px; overflow: hidden; }
.score-footer .sf-fill { height: 100%; border-radius: 3px; transition: width .4s ease; }
.score-footer .sf-sub { font-size: 9.5px; color: var(--text3); margin-top: 5px; }
.score-footer .sf-shape { font-family: var(--mono); font-size: 10px; color: var(--text3); text-align: right; flex: none; }
.score-footer .sf-shape b { color: var(--text2); }

/* ============================ responsive ============================ */
@media (max-width: 1080px) {
  body { overflow: auto; }
  .main { grid-template-columns: 1fr; height: auto; }
  .panel { border-right: none; border-bottom: 1px solid var(--border); }
  .panel-body { overflow: visible; max-height: none; }
  #panel-left .panel-body { max-height: 460px; overflow-y: auto; }
  #panel-right .panel-body { max-height: 620px; overflow-y: auto; }
  .appbar { flex-wrap: wrap; height: auto; padding: 10px 16px; gap: 10px; }
  .statstrip { gap: 12px; }
}

/* ============================ simulation (right) ============================ */
.sim-controls { position: sticky; top: 0; z-index: 5; background: var(--observer-bg); padding-bottom: 9px; margin-bottom: 6px; display: flex; flex-direction: column; gap: 7px; border-bottom: 1px solid var(--border); }
.sim-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sim-select { flex: 1; min-width: 0; font-family: var(--sans); font-size: 12.5px; font-weight: 600; color: var(--text); background: var(--surface); border: 1px solid var(--border2); border-radius: 8px; padding: 7px 9px; cursor: pointer; }
.sim-select:focus { outline: 2px solid var(--indigo-soft); border-color: var(--indigo); }
.btn-sim { font-family: var(--sans); font-size: 12.5px; font-weight: 700; color: #fff; background: var(--indigo); border: 1px solid var(--indigo); border-radius: 8px; padding: 7px 14px; cursor: pointer; transition: filter .12s ease; }
.btn-sim:hover { filter: brightness(1.08); }
.btn-sim:disabled { opacity: .55; cursor: default; }
.sim-speed { display: inline-flex; gap: 3px; margin-left: auto; }
.sp-chip { font-family: var(--mono); font-size: 10px; padding: 3px 7px; border-radius: 6px; border: 1px solid var(--border2); background: var(--surface); color: var(--text3); cursor: pointer; }
.sp-chip.active { background: var(--indigo-soft); border-color: var(--indigo); color: var(--indigo); font-weight: 700; }

.sim-stage { min-height: 80px; }
.sim-ready { text-align: center; color: var(--text2); font-size: 12.5px; line-height: 1.6; padding: 26px 16px; border: 1px dashed var(--border2); border-radius: 10px; background: var(--surface); }
.sim-ready-ic { width: 34px; height: 34px; border-radius: 50%; margin: 0 auto 10px; display: grid; place-items: center; color: #fff; background: var(--indigo); font-size: 14px; }
.sim-tl { min-height: 30px; }

@keyframes simIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.sim-in { animation: simIn .32s ease both; }

.run-spin { width: 12px; height: 12px; border: 2px solid var(--border2); border-top-color: var(--indigo); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.obs-entry.running { border-color: var(--indigo); box-shadow: 0 0 0 1px var(--indigo-soft); }

.sim-cursor { display: flex; gap: 5px; padding: 8px 4px; }
.sim-cursor span { width: 7px; height: 7px; border-radius: 50%; background: var(--indigo); opacity: .35; animation: curp 1s infinite ease-in-out; }
.sim-cursor span:nth-child(2) { animation-delay: .18s; }
.sim-cursor span:nth-child(3) { animation-delay: .36s; }
@keyframes curp { 0%,100% { opacity: .25; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-3px); } }

.result-card { border: 1px solid var(--border); border-radius: 10px; background: var(--panel-soft); padding: 11px 12px; margin-top: 11px; }
.rc-head { display: flex; align-items: center; gap: 9px; margin-bottom: 8px; }
.rc-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--text3); }
.rc-reward { margin-left: auto; font-family: var(--mono); font-size: 18px; font-weight: 800; }
.rc-comp { display: flex; align-items: center; gap: 8px; padding: 4px 0; border-top: 1px dashed var(--border); font-size: 11.5px; }
.rc-comp:first-of-type { border-top: none; }
.rc-name { flex: 1; min-width: 0; color: var(--text); }

/* rich (markdown / html / latex) rendered model text */
.think-text.md { white-space: normal; }
.think-text.md > :first-child { margin-top: 0; }
.think-text.md > :last-child { margin-bottom: 0; }
.think-text.md p { margin: 0 0 6px; }
.think-text.md ul, .think-text.md ol { margin: 4px 0 6px; padding-left: 18px; }
.think-text.md li { margin: 1px 0; }
.think-text.md h1, .think-text.md h2, .think-text.md h3, .think-text.md h4 { font-size: 12.5px; margin: 8px 0 4px; font-weight: 700; }
.think-text.md code { font-family: var(--mono); font-size: 10.5px; background: rgba(79,70,229,.08); border: 1px solid #d9dcfb; border-radius: 4px; padding: 0 3px; }
.think-text.md pre { background: #0f1117; color: #d7dce5; border-radius: 7px; padding: 8px 10px; overflow: auto; margin: 6px 0; }
.think-text.md pre code { background: none; border: none; color: inherit; font-size: 10.5px; padding: 0; }
.think-text.md a { color: var(--indigo); }
.think-text.md blockquote { margin: 4px 0; padding-left: 9px; border-left: 2px solid var(--border2); color: var(--text2); }
.think-text.md table { border-collapse: collapse; margin: 6px 0; font-size: 10.5px; }
.think-text.md th, .think-text.md td { border: 1px solid var(--border); padding: 2px 6px; }
.think-text.md img { max-width: 100%; }
.think-text.md hr { border: none; border-top: 1px solid var(--border); margin: 8px 0; }
.katex { font-size: 1em; }
.katex-display { margin: 6px 0; overflow-x: auto; overflow-y: hidden; }
