/* Eval trace viewer only. Standalone rather than app.css + Tailwind: this view is
   unlinked, internal, and shares no component with the chat UI. */
:root {
  --lexer: #00beb7; --lexer-dark: #009d97; --lexer-light: #e0fafa;
  --bg: #f8f9fa; --ink: #111827; --muted: #6b7280; --line: #e5e7eb; --line-soft: #f3f4f6;
  --fail: #dc2626; --fail-bg: #fef2f2; --pass: #059669; --pass-bg: #ecfdf5;
  --warn: #b45309; --warn-bg: #fffbeb;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased; font-size: 14px;
}
code, pre, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.hidden { display: none !important; }
button { font: inherit; cursor: pointer; }

/* --- header --------------------------------------------------------------- */
header {
  display: flex; align-items: center; gap: .85rem; padding: .7rem 1.25rem;
  background: rgba(255,255,255,.92); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 10; backdrop-filter: blur(12px);
}
header .mark { width: 22px; height: 22px; flex: none; }
header .title h1 { font-size: 15px; font-weight: 600; margin: 0; line-height: 1.2; }
header .title p { margin: .1rem 0 0; font-size: 12px; color: var(--muted); }
header .spacer { flex: 1; }
header .who { font-size: 12px; color: var(--muted); white-space: nowrap; }

.pill {
  font-size: 11px; font-weight: 600; padding: .15rem .5rem; border-radius: 999px;
  background: var(--lexer-light); color: var(--lexer-dark); letter-spacing: .02em;
  white-space: nowrap;
}
.pill.grey { background: var(--line-soft); color: var(--muted); }
.pill.fail { background: var(--fail-bg); color: var(--fail); }
.pill.pass { background: var(--pass-bg); color: var(--pass); }
.pill.warn { background: var(--warn-bg); color: var(--warn); }

.gate { min-height: 60vh; display: flex; align-items: center; justify-content: center; }
.gate .card { text-align: center; max-width: 380px; }

/* --- list ----------------------------------------------------------------- */
.layout { display: grid; grid-template-columns: 340px 1fr; min-height: calc(100vh - 56px); }
.list { border-right: 1px solid var(--line); background: #fff; }
.list-head { padding: .85rem .9rem .5rem; display: flex; flex-direction: column; gap: .5rem; }
.list-head h2 { font-size: 13px; font-weight: 600; margin: 0; display: flex; gap: .4rem; align-items: baseline; }
.list-head .count { font-weight: 500; color: var(--muted); font-size: 12px; }
.filters { padding: 0 .9rem .7rem; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 1fr 1fr; gap: .4rem; }
.filters select, .list-head input {
  font: inherit; font-size: 12px; padding: .35rem .5rem; width: 100%;
  border: 1px solid var(--line); border-radius: .5rem; background: #fff; color: var(--ink);
}
.row {
  padding: .7rem .9rem; border-bottom: 1px solid var(--line-soft); cursor: pointer;
  display: flex; flex-direction: column; gap: .35rem;
}
.row:hover { background: #fafafa; }
.row.active { background: var(--lexer-light); box-shadow: inset 3px 0 0 var(--lexer); }
.row .q { font-weight: 500; line-height: 1.35; }
.row .meta { display: flex; gap: .3rem; align-items: center; flex-wrap: wrap; }
.row .when { font-size: 11px; color: var(--muted); }

/* --- detail --------------------------------------------------------------- */
main { padding: 1.25rem 1.5rem 3rem; max-width: 920px; }
h2 { font-size: 17px; margin: 0 0 .35rem; }
.sub { color: var(--muted); font-size: 12px; margin-bottom: 1rem; }
.card {
  background: #fff; border: 1px solid rgba(0,0,0,.06); border-radius: .85rem;
  box-shadow: 0 1px 3px rgba(0,0,0,.04); padding: 1rem; margin-bottom: .75rem;
}
.gate .card { padding: 1.5rem; }

.detail-head { margin-bottom: 1rem; }
.detail-head h2 { font-size: 18px; line-height: 1.3; }
.facts { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; margin-top: .5rem; }
.facts .pill.plain { background: transparent; color: var(--muted); font-weight: 500; padding-left: 0; }
.toolbar { display: flex; gap: .75rem; align-items: center; margin: .9rem 0 .5rem; font-size: 12px; color: var(--muted); }
.toolbar button { background: none; border: 0; padding: 0; color: var(--lexer-dark); font-size: 12px; font-weight: 500; }
.toolbar button:hover { text-decoration: underline; }

/* Collapsible sections. The summary line carries enough to skim past a closed one. */
details.section { padding: 0; }
details.section > summary {
  list-style: none; cursor: pointer; padding: .8rem 1rem;
  display: flex; align-items: center; gap: .6rem; user-select: none;
}
details.section > summary::-webkit-details-marker { display: none; }
details.section > summary::before {
  content: ''; width: 6px; height: 6px; flex: none; margin-left: 2px;
  border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted);
  transform: rotate(-45deg); transition: transform .15s;
}
details.section[open] > summary::before { transform: rotate(45deg); }
details.section > summary h3 { font-size: 13px; font-weight: 600; margin: 0; }
details.section > summary .gist { font-size: 12px; color: var(--muted); display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; }
details.section > summary .spacer { flex: 1; }
details.section > .inner { padding: 0 1rem 1rem; border-top: 1px solid var(--line-soft); }
details.section > .inner > .hint { font-size: 12px; color: var(--muted); margin: .7rem 0 .8rem; line-height: 1.45; }

.kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px,1fr)); gap: .6rem; }
.kv div span { display: block; font-size: 11px; color: var(--muted); }
.kv div b { font-weight: 500; font-size: 13px; word-break: break-all; }

.turn { display: flex; gap: .75rem; padding: .55rem 0; border-top: 1px solid var(--line-soft); }
.turn:first-of-type { border-top: 0; }
.turn .who {
  flex: none; width: 64px; font-size: 11px; font-weight: 600; color: var(--muted);
  text-transform: uppercase; letter-spacing: .05em; padding-top: .2rem;
}
.turn.user .who { color: var(--lexer-dark); }
.turn .body { white-space: pre-wrap; line-height: 1.5; min-width: 0; flex: 1; }
.turn .body.md { white-space: normal; font-size: 13.5px; }
.turn .body.md .tags { display: flex; gap: .35rem; flex-wrap: wrap; margin-bottom: .5rem; }
.turn .body.md > :first-child:not(.tags), .turn .body.md .tags + * { margin-top: 0; }
.turn .body.md > :last-child { margin-bottom: 0; }
.turn .body.md h1, .turn .body.md h2, .turn .body.md h3 { font-weight: 600; margin: 1em 0 .35em; }
.turn .body.md h1 { font-size: 15px; }
.turn .body.md h2 { font-size: 14px; }
.turn .body.md h3 { font-size: 13.5px; }
.turn .body.md p { margin: 0 0 .6em; }
.turn .body.md ul, .turn .body.md ol { padding-left: 1.25em; margin: 0 0 .6em; }
.turn .body.md li { margin-bottom: .2em; }
.turn .body.md hr { border: 0; border-top: 1px solid var(--line); margin: .8em 0; }
.turn .body.md code { background: var(--line-soft); padding: .1em .35em; border-radius: 4px; font-size: .85em; }
.turn .body.md pre { background: var(--line-soft); padding: .6em .8em; border-radius: .5rem; overflow-x: auto; }
.turn .body.md pre code { background: none; padding: 0; }
.turn .body.md a { color: var(--lexer-dark); }
.turn .body.md blockquote { margin: 0 0 .6em; padding-left: .8em; border-left: 3px solid var(--line); color: var(--muted); }
.prose { white-space: pre-wrap; line-height: 1.5; font-size: 13px; }

.failures {
  background: var(--fail-bg); border: 1px solid #fecaca; border-radius: .6rem;
  padding: .6rem .8rem; margin-bottom: .8rem; font-size: 12.5px; line-height: 1.45;
}
.failures b { color: var(--fail); font-weight: 600; }
.failures ul { margin: .3rem 0 0; padding-left: 1.1rem; }
.failures li { margin-top: .15rem; }
.failures .mono { font-size: 12px; }

.check { border-top: 1px solid var(--line-soft); padding: .55rem 0; }
.check:first-of-type { border-top: 0; padding-top: 0; }
.check .head { display: flex; gap: .45rem; align-items: baseline; flex-wrap: wrap; }
.check .head b { font-weight: 500; }
.check .head span.desc { font-size: 12px; color: var(--muted); }
.check .why { font-size: 12.5px; margin: .25rem 0 0 3rem; line-height: 1.45; color: #374151; }

.note { border-top: 1px solid var(--line-soft); padding: .6rem 0; }
.note:first-child { border-top: 0; padding-top: 0; }
.note .head { display: flex; gap: .4rem; align-items: center; font-size: 11px; color: var(--muted); }
.note .body { white-space: pre-wrap; line-height: 1.5; margin-top: .3rem; }
.note-form { display: flex; flex-direction: column; gap: .5rem; margin-top: .9rem; }
.note-form textarea, .note-form input {
  font: inherit; font-size: 13px; padding: .45rem .55rem;
  border: 1px solid var(--line); border-radius: .5rem; background: #fff; width: 100%;
}
.note-form textarea { min-height: 62px; resize: vertical; }
.note-form .actions { display: flex; gap: .5rem; align-items: center; }
.note-form button, .btn {
  font-size: 12px; font-weight: 600; padding: .4rem .8rem;
  border: 0; border-radius: .5rem; background: var(--lexer); color: #fff;
}
.note-form button[disabled], .btn[disabled] { opacity: .55; cursor: default; }
.codes { display: flex; flex-wrap: wrap; gap: .35rem; margin-bottom: .75rem; }
.codes .pill { cursor: pointer; border: 0; font-family: inherit; }
.codes .pill.active { background: var(--lexer); color: #fff; }

table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
th {
  text-align: left; font-weight: 600; color: var(--muted); font-size: 11px;
  text-transform: uppercase; letter-spacing: .05em; padding: .35rem .5rem;
  border-bottom: 1px solid var(--line);
}
td { padding: .45rem .5rem; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
tr.empty td { background: var(--fail-bg); }
td .mono { font-size: 12px; color: #374151; word-break: break-all; }
.agent { font-weight: 600; }
.warning { font-size: 12px; color: var(--fail); margin: .75rem 0 0; }

.guide { max-width: 560px; }
.guide h2 { margin-bottom: .5rem; }
.guide ol { margin: .75rem 0 0; padding-left: 1.25rem; line-height: 1.55; }
.guide li { margin-bottom: .35rem; }
.guide li b { font-weight: 600; }
