:root {
  --bg: #0B0D10;
  --bg-2: #0F1217;
  --surface: #14181F;
  --surface-2: #1A1F28;
  --hover: #1E242E;
  --line: #262D38;
  --line-2: #1D232C;
  --text: #F4F6FA;
  --text-2: #AEB7C6;
  --text-3: #6C7585;
  --accent: #C6FF3D;          /* electric lime — the Surge-style pop */
  --accent-ink: #0B0D10;
  --accent-2: #7C5CFF;        /* violet secondary */
  --cyan: #3DE0FF;
  --pink: #FF5CA8;
  --c-indian: #FF8A3D;
  --c-frontier: #7C5CFF;
  --c-reference: #6C7585;
  --term: #2DD4A7; --term-soft: #0F2A22;
  --vision: #7C5CFF; --vision-soft: #1C1636;
  --pass: #2DD4A7; --pass-soft: #0F2A22;
  --fail: #FF6B6B; --fail-soft: #2E1618;
  --warn: #FFC24B; --warn-soft: #2E2410;
  --gold: #FFD43B; --silver: #C7D0DC; --bronze: #E8975A;
  --radius: 14px; --radius-s: 10px;
  --display: "Space Grotesk", system-ui, sans-serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  --shadow: 0 20px 50px -24px rgba(0,0,0,.8), 0 4px 12px rgba(0,0,0,.35);
  --glow: 0 0 0 1px rgba(198,255,61,.35), 0 8px 30px -8px rgba(198,255,61,.25);
  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
*, *::before, *::after { box-sizing: inherit; }
html, body { margin: 0; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; } }
body { background: var(--bg); color: var(--text); font-family: var(--sans); font-size: 15px; line-height: 1.55; -webkit-font-smoothing: antialiased;
  background-image: radial-gradient(900px 500px at 88% -10%, rgba(124,92,255,.14), transparent 60%), radial-gradient(800px 460px at -5% 0%, rgba(198,255,61,.07), transparent 55%); background-attachment: fixed; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.num { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--mono); font-size: .9em; }
[hidden] { display: none !important; }
.wrap { max-width: 1300px; margin: 0 auto; padding: 0 30px; }
@media (max-width: 640px) { .wrap { padding: 0 16px; } }
.muted { color: var(--text-3); }
.small { font-size: 13px; }
h1, h2, h3 { font-family: var(--display); letter-spacing: -0.02em; }

/* ---------------- Top bar ---------------- */
.topbar { position: sticky; top: 0; z-index: 40; background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); padding-top: env(safe-area-inset-top, 0px); }
.topbar .wrap { display: flex; align-items: center; gap: 26px; height: 60px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-family: var(--display); font-weight: 700; font-size: 18px; letter-spacing: -0.03em; }
.brand:hover { text-decoration: none; }
.brand .logo { width: 30px; height: 30px; border-radius: 9px; background: var(--accent); display: grid; place-items: center; box-shadow: 0 0 22px -4px rgba(198,255,61,.6); }
.brand .logo svg { width: 19px; height: 19px; }
.brand span { color: var(--text-3); font-weight: 500; }
.nav { display: flex; gap: 3px; }
.nav a { color: var(--text-2); font-weight: 500; font-size: 14.5px; padding: 7px 13px; border-radius: 9px; }
.nav a:hover { background: var(--hover); color: var(--text); text-decoration: none; }
.nav a.active { color: var(--accent-ink); background: var(--accent); }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.menu { position: relative; }
.menu-btn { display: flex; align-items: center; gap: 9px; padding: 3px 10px 3px 3px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; }
.menu-btn:hover { border-color: var(--text-3); }
.menu-btn b { font-weight: 500; font-size: 14px; }
.menu-pop { position: absolute; right: 0; top: calc(100% + 8px); min-width: 230px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 7px; }
.menu-pop .who { padding: 9px 11px 11px; border-bottom: 1px solid var(--line-2); margin-bottom: 5px; }
.menu-pop .who b { display: block; font-family: var(--display); }
.menu-pop a, .menu-pop button { display: block; width: 100%; text-align: left; padding: 9px 11px; border-radius: 8px; color: var(--text); background: none; border: 0; cursor: pointer; font-size: 14px; }
.menu-pop a:hover, .menu-pop button:hover { background: var(--hover); text-decoration: none; }
@media (max-width: 720px) { .menu-btn b { display: none; } .topbar .wrap { gap: 12px; } .nav a { padding: 7px 9px; } }

/* ---------------- Page ---------------- */
main { padding: 36px 0 90px; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 18px 24px; margin-bottom: 26px; }
.page-head h1 { margin: 0; font-size: 34px; line-height: 1.08; font-weight: 700; }
.page-head p { margin: 9px 0 0; color: var(--text-2); max-width: 72ch; }
.crumb { display: inline-flex; gap: 6px; align-items: center; color: var(--text-3); font-size: 14px; margin-bottom: 12px; font-weight: 500; }
.crumb:hover { color: var(--accent); text-decoration: none; }
.meta-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-top: 12px; color: var(--text-2); font-size: 14px; }
.actions { display: flex; gap: 9px; align-items: center; flex-wrap: wrap; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.card-pad { padding: 22px; }
.card h2 { margin: 0 0 4px; font-size: 18px; font-weight: 600; }
.card .sub { margin: 0 0 18px; color: var(--text-3); font-size: 13.5px; }
.grid-run { display: grid; grid-template-columns: 370px minmax(0, 1fr); gap: 22px; align-items: start; }
@media (max-width: 1000px) { .grid-run { grid-template-columns: 1fr; } }
.stack { display: grid; gap: 18px; }
.empty { padding: 56px 20px; text-align: center; color: var(--text-2); }
.empty h3 { margin: 0 0 8px; color: var(--text); font-size: 19px; font-weight: 600; }
.empty p { margin: 0 auto; max-width: 52ch; }

/* ---------------- Buttons & inputs ---------------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; padding: 0 16px; border-radius: 10px; font-weight: 600; font-size: 14.5px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text); cursor: pointer; white-space: nowrap; transition: transform .08s, background .15s, border-color .15s; }
.btn:hover:not(:disabled) { background: var(--hover); text-decoration: none; border-color: var(--text-3); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover:not(:disabled) { background: #d4ff5c; border-color: #d4ff5c; box-shadow: var(--glow); }
.btn-danger { color: var(--fail); }
.btn-block { width: 100%; height: 44px; font-size: 15px; }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13.5px; border-radius: 8px; }
.field { display: grid; gap: 7px; margin-bottom: 15px; }
.field > label, .field > .label { font-weight: 600; font-size: 13px; color: var(--text); text-transform: uppercase; letter-spacing: .03em; }
.field .hint { font-size: 12.5px; color: var(--text-3); line-height: 1.45; }
.input, select, textarea { width: 100%; min-height: 40px; padding: 9px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg-2); color: var(--text); font-size: 14.5px; }
textarea { resize: vertical; }
select { appearance: none; padding-right: 34px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236C7585' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
.input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(198,255,61,.16); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
.prefix { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 10px; background: var(--bg-2); }
.prefix span { padding: 0 2px 0 12px; color: var(--text-3); }
.prefix input { border: 0; height: 40px; flex: 1; background: transparent; outline: none; padding-right: 12px; }
.prefix:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(198,255,61,.16); }
.stepper { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; justify-self: start; }
.stepper button { width: 40px; height: 40px; border: 0; background: var(--surface-2); cursor: pointer; color: var(--text-2); font-size: 18px; }
.stepper button:hover { background: var(--hover); color: var(--text); }
.stepper input { width: 56px; text-align: center; border: 0; border-left: 1px solid var(--line); border-right: 1px solid var(--line); background: var(--bg-2); }
.notice { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 10px; font-size: 14px; margin-top: 12px; }
.notice.error { background: var(--fail-soft); color: var(--fail); }
.notice.ok { background: var(--pass-soft); color: var(--pass); }
.notice.info { background: rgba(124,92,255,.14); color: #b3a0ff; }
.notice.warn { background: var(--warn-soft); color: var(--warn); }

/* ---------------- Badges & chips ---------------- */
.badge { display: inline-flex; align-items: center; gap: 6px; height: 23px; padding: 0 9px; border-radius: 7px; font-size: 12px; font-weight: 600; background: var(--surface-2); color: var(--text-2); white-space: nowrap; border: 1px solid var(--line); }
.badge.domain { background: rgba(61,224,255,.1); color: var(--cyan); border-color: rgba(61,224,255,.2); }
.badge.group-terminal { background: var(--term-soft); color: var(--term); border-color: rgba(45,212,167,.25); }
.badge.group-vision { background: var(--vision-soft); color: #b3a0ff; border-color: rgba(124,92,255,.3); }
.badge.group-api { background: #2E1A10; color: #FFA266; border-color: rgba(255,138,61,.3); }
.cat { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-2); white-space: nowrap; }
.cat i { width: 8px; height: 8px; border-radius: 3px; display: inline-block; }
.chips { display: flex; gap: 7px; flex-wrap: wrap; }
.chip { height: 34px; padding: 0 15px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--text-2); cursor: pointer; font-size: 13.5px; font-weight: 600; white-space: nowrap; transition: all .12s; }
.chip:hover { background: var(--hover); color: var(--text); border-color: var(--text-3); }
.chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.seg { display: inline-flex; padding: 4px; gap: 3px; border-radius: 11px; background: var(--surface-2); border: 1px solid var(--line); }
.seg button { border: 0; background: transparent; padding: 7px 14px; border-radius: 8px; cursor: pointer; font-size: 13.5px; font-weight: 600; color: var(--text-2); }
.seg button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
.pill { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.pill.pass { background: var(--pass-soft); color: var(--pass); }
.pill.fail, .pill.error { background: var(--fail-soft); color: var(--fail); }
.pill.run { background: rgba(124,92,255,.14); color: #b3a0ff; }
.pill.idle { background: var(--surface-2); color: var(--text-3); }
.spin { width: 10px; height: 10px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.user-tag { display: inline-flex; align-items: center; gap: 7px; color: var(--text-2); font-size: 13.5px; white-space: nowrap; }
.av { border-radius: 50%; object-fit: cover; flex: none; display: inline-grid; place-items: center; background: var(--accent-2); color: #fff; font-weight: 700; font-family: var(--display); }

/* ---------------- Tables ---------------- */
.table-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.table-scroll { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
.t th { text-align: left; font-weight: 600; font-size: 11.5px; letter-spacing: .05em; text-transform: uppercase; color: var(--text-3); padding: 13px 16px; border-bottom: 1px solid var(--line); background: var(--bg-2); white-space: nowrap; }
.t th.r, .t td.r { text-align: right; }
.t th.c, .t td.c { text-align: center; }
.t td { padding: 14px 16px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.t tbody tr:last-child td { border-bottom: 0; }
.t tbody tr.link { cursor: pointer; transition: background .1s; }
.t tbody tr.link:hover { background: var(--hover); }
.cell-title { font-weight: 600; color: var(--text); }
.cell-sub { font-size: 12.5px; color: var(--text-3); margin-top: 2px; }
.rank { width: 56px; }
.rank b { font-family: var(--display); font-size: 20px; font-weight: 700; color: var(--text-2); }
.medal { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; font-family: var(--display); font-weight: 700; font-size: 15px; color: var(--accent-ink); }
.medal.g1 { background: var(--gold); } .medal.g2 { background: var(--silver); } .medal.g3 { background: var(--bronze); }
.scorebar { display: flex; align-items: center; gap: 12px; min-width: 170px; }
.scorebar b { width: 50px; text-align: right; font-family: var(--display); font-weight: 700; font-size: 17px; font-variant-numeric: tabular-nums; }
.bar { flex: 1; height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; min-width: 64px; }
.bar i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--accent-2), var(--accent)); }
.heat { display: inline-block; min-width: 72px; padding: 7px 10px; border-radius: 9px; font-family: var(--display); font-weight: 700; font-variant-numeric: tabular-nums; color: var(--text); }
.heat small { display: block; font-family: var(--sans); font-weight: 400; font-size: 11px; opacity: .7; }
.mini-bar { display: inline-flex; width: 60px; height: 6px; border-radius: 999px; background: var(--surface-2); overflow: hidden; vertical-align: middle; margin-right: 7px; }
.mini-bar i { display: block; height: 100%; }

/* ---------------- Toolbar & tabs ---------------- */
.toolbar { display: flex; flex-wrap: wrap; gap: 11px 14px; align-items: center; margin-bottom: 16px; }
.tabs { display: flex; gap: 3px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tabs button { border: 0; background: none; padding: 11px 14px; cursor: pointer; color: var(--text-2); font-weight: 600; font-size: 14.5px; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs button:hover { color: var(--text); }
.tabs button[aria-selected="true"] { color: var(--accent); border-bottom-color: var(--accent); }
.search { position: relative; }
.search input { padding-left: 34px; width: 240px; }
.search svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--text-3); }

/* ---------------- Metrics ---------------- */
.metrics { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 13px; margin-bottom: 22px; }
@media (max-width: 1150px) { .metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 640px) { .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.metric { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 15px 17px; min-width: 0; }
.metric small { display: block; color: var(--text-3); font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }
.metric b { display: block; font-family: var(--display); font-size: 25px; font-weight: 700; margin: 4px 0 2px; font-variant-numeric: tabular-nums; }
.metric > span { font-size: 12.5px; color: var(--text-2); }
.stackbar { display: flex; height: 7px; border-radius: 999px; overflow: hidden; background: var(--surface-2); margin-top: 9px; }
.stackbar i { display: block; height: 100%; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 7px; font-size: 11px; color: var(--text-3); }
.legend span { display: inline-flex; align-items: center; gap: 4px; }
.legend i { width: 7px; height: 7px; border-radius: 2px; }

/* ---------------- Cards grid (datasets, domains) ---------------- */
.cardgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.dcard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; cursor: pointer; transition: transform .1s, border-color .15s, box-shadow .15s; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.dcard:hover { transform: translateY(-3px); border-color: var(--text-3); box-shadow: var(--shadow); }
.dcard h3 { margin: 0; font-size: 18px; font-weight: 600; }
.dcard p { margin: 0; color: var(--text-2); font-size: 14px; flex: 1; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.dcard .stats { display: flex; gap: 16px; padding-top: 12px; border-top: 1px solid var(--line-2); font-size: 13px; color: var(--text-3); }
.dcard .stats b { font-family: var(--display); color: var(--text); font-size: 16px; font-weight: 700; display: block; }
.domhead { display: flex; align-items: center; gap: 10px; margin: 26px 0 14px; }
.domhead h2 { margin: 0; font-size: 20px; font-weight: 600; }
.domhead .count { color: var(--text-3); font-size: 14px; }
.domhead .ico { width: 34px; height: 34px; border-radius: 10px; background: rgba(61,224,255,.1); color: var(--cyan); display: grid; place-items: center; }

/* ---------------- Trajectory ---------------- */
.timeline { display: grid; gap: 13px; }
.step { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.step-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 11px 15px; background: var(--bg-2); border-bottom: 1px solid var(--line-2); }
.step-no { min-width: 28px; height: 24px; padding: 0 7px; border-radius: 8px; background: var(--accent); color: var(--accent-ink); font-family: var(--display); font-weight: 700; font-size: 13px; display: grid; place-items: center; }
.step-head b { font-weight: 600; font-size: 14px; }
.step-meta { margin-left: auto; display: flex; gap: 12px; color: var(--text-3); font-size: 12.5px; flex-wrap: wrap; }
.step-body { padding: 15px; display: grid; gap: 11px; }
.thought { white-space: pre-wrap; color: var(--text-2); font-size: 14px; }
.step.err .step-head { background: var(--fail-soft); }
.parse-err { color: var(--fail); font-size: 14px; }
.act { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.act-head { display: flex; align-items: flex-start; gap: 8px; padding: 9px 13px; background: #0A0C10; color: #fff; font-family: var(--mono); font-size: 13px; }
.act-head .tool { flex: none; padding: 1px 8px; border-radius: 6px; background: rgba(124,92,255,.2); color: #b3a0ff; font-size: 12px; }
.act-head .tool.search { background: rgba(61,224,255,.18); color: var(--cyan); }
.act-head .tool.img { background: rgba(255,92,168,.18); color: var(--pink); }
.act-head code { flex: 1; white-space: pre-wrap; word-break: break-word; color: #EAF0FB; }
.act-head .exit { flex: none; font-size: 11.5px; padding: 1px 8px; border-radius: 999px; background: rgba(45,212,167,.18); color: var(--term); }
.act-head .exit.bad { background: rgba(255,107,107,.18); color: var(--fail); }
.act-out { margin: 0; padding: 11px 13px; background: #07090C; color: #cdd6e4; font-family: var(--mono); font-size: 12.5px; line-height: 1.5; white-space: pre-wrap; word-break: break-word; max-height: 340px; overflow: auto; }
.act-out:empty::before { content: "(no output)"; color: var(--text-3); }
details.raw summary { cursor: pointer; color: var(--text-3); font-size: 13px; }
details.raw pre { margin: 8px 0 0; padding: 11px 13px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 9px; font-family: var(--mono); font-size: 12px; white-space: pre-wrap; word-break: break-word; max-height: 300px; overflow: auto; }
.logs pre { margin: 0; padding: 13px; background: #07090C; color: #cdd6e4; border-radius: 10px; font-family: var(--mono); font-size: 12.5px; white-space: pre-wrap; word-break: break-word; max-height: 440px; overflow: auto; }
.logs h3 { font-size: 14px; font-weight: 600; margin: 0 0 9px; }

/* ---------------- Tests & rubric ---------------- */
.check-list { list-style: none; margin: 0; padding: 0; }
.check-list li { border-bottom: 1px solid var(--line-2); }
.check-list li:last-child { border-bottom: 0; }
.check-row { display: flex; align-items: flex-start; gap: 11px; padding: 12px 2px; width: 100%; border: 0; background: none; text-align: left; }
.check-row.exp { cursor: pointer; }
.ticon { width: 22px; height: 22px; border-radius: 7px; display: grid; place-items: center; flex: none; color: var(--accent-ink); font-size: 12px; font-weight: 700; margin-top: 1px; }
.ticon.ok { background: var(--pass); } .ticon.no { background: var(--fail); color: #fff; } .ticon.skip { background: var(--text-3); }
.check-main { flex: 1; min-width: 0; }
.check-name { font-family: var(--mono); font-size: 13px; word-break: break-all; }
.check-text { font-size: 14px; }
.check-reason { font-size: 13px; color: var(--text-2); margin-top: 4px; }
.check-side { color: var(--text-3); font-size: 12.5px; white-space: nowrap; }
.fail-msg { margin: 0 0 12px 33px; padding: 11px 13px; background: #07090C; color: #ffb3b3; border-radius: 9px; font-family: var(--mono); font-size: 12px; white-space: pre-wrap; overflow-x: auto; }

/* ---------------- Markdown / docs ---------------- */
.md { font-size: 15px; line-height: 1.7; color: var(--text); overflow-wrap: anywhere; }
.md h1 { font-size: 30px; margin: 0 0 14px; font-weight: 700; line-height: 1.15; }
.md h2 { font-size: 21px; margin: 34px 0 11px; font-weight: 600; }
.md h3 { font-size: 17px; margin: 24px 0 8px; font-weight: 600; }
.md p { margin: 0 0 13px; }
.md ul, .md ol { margin: 0 0 13px; padding-left: 22px; }
.md li { margin-bottom: 5px; }
.md code { font-family: var(--mono); font-size: .86em; background: var(--surface-2); padding: 2px 6px; border-radius: 6px; color: var(--accent); }
.md td code, .md th code { white-space: nowrap; }
.md pre { background: #07090C; color: #cdd6e4; padding: 15px 17px; border-radius: 11px; overflow-x: auto; font-size: 13px; line-height: 1.55; margin: 0 0 15px; border: 1px solid var(--line); }
.md pre code { background: none; padding: 0; color: inherit; }
.md table { width: 100%; border-collapse: collapse; margin: 0 0 16px; font-size: 14px; display: block; overflow-x: auto; }
.md th, .md td { text-align: left; padding: 9px 13px; border: 1px solid var(--line); vertical-align: top; }
.md th { background: var(--bg-2); font-weight: 600; }
.md strong { font-weight: 600; color: var(--text); }
.md a { color: var(--accent); }
.docs-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 34px; align-items: start; }
@media (max-width: 860px) { .docs-layout { grid-template-columns: 1fr; } }
.docs-nav { position: sticky; top: 80px; display: grid; gap: 2px; }
.docs-nav .group { font-size: 11.5px; letter-spacing: .05em; text-transform: uppercase; color: var(--text-3); margin: 16px 11px 5px; font-weight: 700; }
.docs-nav a { padding: 7px 11px; border-radius: 9px; color: var(--text-2); font-size: 14px; }
.docs-nav a:hover { background: var(--hover); color: var(--text); text-decoration: none; }
.docs-nav a.active { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.docs-body { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 34px 42px; max-width: 900px; }
@media (max-width: 640px) { .docs-body { padding: 22px 18px; } .docs-nav { position: static; } }

/* ---------------- Files ---------------- */
.files { list-style: none; margin: 0; padding: 0; font-size: 14px; }
.files li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line-2); }
.files li:last-child { border-bottom: 0; }
.files a { font-family: var(--mono); font-size: 13px; word-break: break-all; }

/* ---------------- Modal ---------------- */
.modal-back { position: fixed; inset: 0; background: rgba(0,0,0,.6); backdrop-filter: blur(3px); display: grid; place-items: center; z-index: 60; padding: 20px; }
.modal { width: min(540px, 100%); background: var(--surface); border-radius: 16px; box-shadow: var(--shadow); border: 1px solid var(--line); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 20px 22px 0; }
.modal-head h2 { margin: 0; font-size: 20px; font-weight: 600; }
.modal-body { padding: 18px 22px 22px; }
.drop { position: relative; display: grid; place-items: center; gap: 5px; text-align: center; padding: 28px 16px; border: 1.5px dashed var(--line); border-radius: 11px; background: var(--bg-2); cursor: pointer; margin-bottom: 15px; }
.drop:hover, .drop.over { border-color: var(--accent); background: rgba(198,255,61,.06); }
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.drop b { font-weight: 600; }
.drop small { color: var(--text-3); }
.icon-btn { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 9px; border: 1px solid var(--line); background: var(--surface); color: var(--text-2); cursor: pointer; }
.icon-btn:hover { background: var(--hover); color: var(--text); }

/* ---------------- Login / onboarding ---------------- */
.center-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth-card { width: min(440px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 36px; box-shadow: var(--shadow); }
.auth-card .brand { margin-bottom: 28px; }
.auth-card h1 { margin: 0 0 8px; font-size: 25px; font-weight: 700; }
.auth-card > p { margin: 0 0 24px; color: var(--text-2); }
.gbtn { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; height: 46px; border-radius: 11px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text); font-weight: 600; }
.gbtn:hover { background: var(--hover); text-decoration: none; border-color: var(--text-3); }
.auth-foot { margin-top: 20px; font-size: 13px; color: var(--text-3); text-align: center; }
.photo-opts { display: grid; gap: 9px; }
.photo-opt { display: flex; align-items: center; gap: 13px; padding: 11px 13px; border: 1px solid var(--line); border-radius: 11px; cursor: pointer; }
.photo-opt:has(input:checked) { border-color: var(--accent); background: rgba(198,255,61,.06); }
.photo-opt input { margin: 0; accent-color: var(--accent); }

.toast { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%); background: var(--accent); color: var(--accent-ink); padding: 11px 18px; border-radius: 11px; box-shadow: var(--shadow); z-index: 80; font-size: 14px; font-weight: 600; max-width: calc(100% - 32px); }

@media (max-width: 560px) {
  .brand span { display: none; }
  .page-head h1 { font-size: 27px; }
  .search input { width: 100%; }
  .search, .search input { width: 100%; }
}

/* phone top bar: logo mark only, tabs may scroll sideways instead of pushing the page wider */
.nav { min-width: 0; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
@media (max-width: 560px) {
  .topbar .wrap { gap: 8px; }
  .brand { font-size: 0; gap: 0; }
  .brand .logo { font-size: 15px; }
  .nav a { padding: 7px 8px; font-size: 14px; }
  .menu-btn { padding: 3px; }
}

/* ---------------- Navigation: breadcrumbs ---------------- */
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-bottom: 14px; font-size: 14px; }
.crumbs a { color: var(--text-2); font-weight: 500; padding: 3px 6px; margin: 0 -6px; border-radius: 6px; }
.crumbs a:hover { color: var(--text); background: var(--hover); text-decoration: none; }
.crumbs .sep { color: var(--text-3); }
.crumbs b { color: var(--text); font-weight: 600; }

/* ---------------- Run settings as cards ---------------- */
.setgrid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: -6px 0 22px; }
@media (max-width: 1000px) { .setgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.setcard { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; min-width: 0; }
.setcard small { display: block; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); font-weight: 600; margin-bottom: 6px; }
.setcard > div { font-weight: 600; font-size: 14.5px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; overflow-wrap: anywhere; }
.setcard a { color: var(--text); text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; }
.setcard a:hover { text-decoration-color: var(--accent); }
.inl { display: inline-flex; align-items: center; gap: 8px; }
.onoff { display: inline-flex; align-items: center; gap: 7px; font-weight: 600; }
.onoff::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--text-3); }
.onoff.on { color: var(--pass); } .onoff.on::before { background: var(--pass); }
.onoff.off { color: var(--text-2); }

/* ---------------- Model logos ---------------- */
.mlogo { display: inline-grid; place-items: center; flex: none; border-radius: 6px; background: #3A4250; color: #fff; font: 700 11px var(--display); }
.mlogo { position: relative; overflow: hidden; }
.mlogo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; padding: 3px; background: #fff; box-sizing: border-box; }

/* ---------------- Exceptions, stop, publish switch ---------------- */
.pill.exc { background: var(--warn-soft); color: var(--warn); }
.stopbtn { height: 24px; padding: 0 9px; font-size: 12px; margin-left: 4px; }
.pubswitch { display: inline-flex; align-items: center; gap: 9px; height: 38px; padding: 0 14px 0 8px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text-2); font-weight: 600; font-size: 13.5px; cursor: pointer; }
.pubswitch i { width: 34px; height: 20px; border-radius: 999px; background: var(--line); position: relative; transition: background .15s; }
.pubswitch i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: var(--text-2); transition: transform .15s, background .15s; }
.pubswitch[aria-checked="true"] { color: var(--accent); border-color: rgba(198,255,61,.35); }
.pubswitch[aria-checked="true"] i { background: rgba(198,255,61,.25); }
.pubswitch[aria-checked="true"] i::after { transform: translateX(14px); background: var(--accent); }
.pubswitch:hover { border-color: var(--text-3); }

/* ---------------- Trajectory: tool calls ---------------- */
.tc { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #0A0C10; }
.tc.flagged { border-color: rgba(255,194,75,.45); }
.tc-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 13px; background: var(--bg-2); border-bottom: 1px solid var(--line-2); font-family: var(--mono); font-size: 12.5px; }
.tc-label { font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); }
.tc-head .tool { padding: 2px 9px; border-radius: 6px; background: rgba(124,92,255,.2); color: #b3a0ff; font-size: 12.5px; font-weight: 500; }
.tc-head .tool.search { background: rgba(61,224,255,.18); color: var(--cyan); }
.tc-head .tool.img { background: rgba(255,92,168,.18); color: var(--pink); }
.tc-id { color: var(--text-3); font-size: 11.5px; }
.tc-flag { padding: 2px 9px; border-radius: 999px; background: var(--warn-soft); color: var(--warn); font-family: var(--sans); font-size: 11.5px; font-weight: 600; }
.tc-head .exit { margin-left: auto; padding: 1px 9px; border-radius: 999px; background: rgba(45,212,167,.16); color: var(--term); font-size: 11.5px; }
.tc-head .exit.bad { background: rgba(255,107,107,.16); color: var(--fail); }
.tc-args { padding: 10px 13px; display: grid; gap: 6px; border-bottom: 1px solid var(--line-2); }
.tc-arg { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 10px; align-items: start; }
.tc-key { font-family: var(--mono); font-size: 12px; color: var(--text-3); padding-top: 3px; overflow-wrap: anywhere; }
.tc-val { font-family: var(--mono); font-size: 12.5px; color: #EAF0FB; background: var(--surface-2); padding: 2px 7px; border-radius: 6px; justify-self: start; overflow-wrap: anywhere; }
.tc-code { margin: 0; font-family: var(--mono); font-size: 12.5px; color: #EAF0FB; background: var(--surface-2); padding: 8px 10px; border-radius: 8px; white-space: pre-wrap; word-break: break-word; max-height: 260px; overflow: auto; }
.tc-res { padding: 10px 13px 13px; display: grid; gap: 8px; }
.tc-res .act-out { margin: 0; border-radius: 8px; max-height: 300px; }
.tc-img { display: inline-flex; flex-direction: column; gap: 6px; justify-self: start; max-width: min(520px, 100%); text-decoration: none; }
.tc-img img { max-width: 100%; max-height: 320px; border-radius: 8px; border: 1px solid var(--line); background: #fff; object-fit: contain; }
.tc-img span { font-size: 12px; color: var(--pink); }
.tc-img:hover span { text-decoration: underline; }
.tc-note { font-family: var(--mono); font-size: 12px; color: var(--pink); }
@media (max-width: 560px) { .tc-arg { grid-template-columns: 1fr; gap: 3px; } }

/* ---------------- Trajectory: conversation sections ---------------- */
.sec-label { font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); }
.sec-sub { font-size: 12px; color: var(--text-3); margin-left: 8px; }
.sec-title { display: flex; align-items: center; gap: 8px; margin: 2px 0 -2px; }
details.sec > summary { cursor: pointer; list-style: none; display: flex; align-items: center; padding: 2px 0; }
details.sec > summary::-webkit-details-marker { display: none; }
details.sec > summary::before { content: "▸"; color: var(--text-3); margin-right: 8px; font-size: 11px; transition: transform .15s; }
details.sec[open] > summary::before { transform: rotate(90deg); }
.sent { border: 1px solid var(--line-2); border-radius: 12px; padding: 10px 13px; background: var(--bg-2); }
.sent-msg { margin-top: 10px; }
.sent-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 6px; }
.role { font-size: 11.5px; font-weight: 600; padding: 2px 9px; border-radius: 999px; background: var(--surface-2); color: var(--text-2); font-family: var(--mono); }
.role-tool { background: rgba(124,92,255,.16); color: #b3a0ff; }
.role-user { background: rgba(61,224,255,.12); color: var(--cyan); }
.sent-img { font-size: 12px; color: var(--pink); }
.sent-text { margin: 0; font-family: var(--mono); font-size: 12.5px; line-height: 1.5; color: #cdd6e4; background: #07090C; padding: 10px 12px; border-radius: 8px; white-space: pre-wrap; word-break: break-word; max-height: 260px; overflow: auto; }
.reasoning { border-radius: 12px; padding: 10px 14px; background: rgba(124,92,255,.08); border: 1px solid rgba(124,92,255,.28); }
.reasoning .sec-label { color: #b3a0ff; }
.reason-text { margin-top: 8px; white-space: pre-wrap; font-size: 14px; line-height: 1.6; color: var(--text-2); font-style: italic; max-height: 360px; overflow: auto; }
.resp-text { margin: 6px 0 0; font-family: var(--mono); font-size: 13px; line-height: 1.55; color: var(--text); background: var(--surface-2); border: 1px solid var(--line); padding: 11px 13px; border-radius: 10px; white-space: pre-wrap; word-break: break-word; max-height: 360px; overflow: auto; }

/* ---------------- Typography: Google Sans Flex for the interface ---------------- */
:root { --sans: "Google Sans Flex", "Google Sans", "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }

/* ---------------- Run panel ---------------- */
.grid-run { grid-template-columns: 430px minmax(0, 1fr); }
@media (max-width: 1100px) { .grid-run { grid-template-columns: 1fr; } }
.runpanel { padding: 22px; font-family: var(--sans); background: linear-gradient(180deg, #161B23, var(--surface) 140px); }
.rp-top { display: flex; justify-content: space-between; align-items: start; gap: 10px; margin-bottom: 6px; }
.rp-top h2 { margin: 0 0 4px; font-size: 19px; }
.rp-step { padding: 16px 0 4px; border-top: 1px solid var(--line-2); margin-top: 12px; }
.rp-label { display: flex; align-items: center; gap: 9px; font-weight: 600; font-size: 14.5px; margin-bottom: 11px; letter-spacing: -.005em; }
.rp-n { width: 22px; height: 22px; border-radius: 7px; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--line); color: var(--accent); font: 700 12px var(--mono); }
.rp-hint { font-weight: 400; font-size: 12.5px; color: var(--text-3); }
.rp-groups { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.rp-group, .rp-h, .rp-m, .rp-chip { font-family: var(--sans); color: var(--text); text-align: left; cursor: pointer; background: var(--bg-2); border: 1px solid var(--line); transition: border-color .15s, background .15s, transform .08s, box-shadow .15s; }
.rp-group:hover, .rp-h:hover, .rp-m:hover:not(:disabled), .rp-chip:hover { border-color: var(--text-3); }
.rp-group:active, .rp-h:active, .rp-m:active:not(:disabled) { transform: translateY(1px); }
.rp-group { position: relative; display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: start; padding: 13px; border-radius: 14px; }
.rp-gicon { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; font: 700 15px var(--mono); }
.g-terminal .rp-gicon { background: var(--term-soft); color: var(--term); }
.g-vision .rp-gicon { background: var(--vision-soft); color: #b3a0ff; }
.g-api .rp-gicon { background: #2E1A10; color: #FFA266; }
.rp-gtext b { display: block; font-size: 14px; }
.rp-gtext small { display: block; font-size: 12px; color: var(--text-3); line-height: 1.4; margin-top: 2px; }
.rp-gcount { position: absolute; top: 10px; right: 11px; font: 600 11px var(--mono); color: var(--text-3); }
.rp-group[aria-pressed="true"] { border-color: var(--accent); background: rgba(198,255,61,.06); box-shadow: 0 0 0 1px rgba(198,255,61,.35) inset; }
.rp-harnesses { display: grid; gap: 8px; }
.rp-h { display: grid; gap: 6px; padding: 12px 14px; border-radius: 12px; }
.rp-hhead { display: flex; align-items: center; gap: 8px; }
.rp-hhead b { font-size: 15px; }
.rp-h small { color: var(--text-3); font-size: 12.5px; line-height: 1.45; }
.rp-h[aria-pressed="true"] { border-color: var(--accent); background: rgba(198,255,61,.06); }
.tchips { display: flex; flex-wrap: wrap; gap: 4px; }
.tchip { font: 500 11px var(--mono); padding: 2px 7px; border-radius: 6px; background: var(--surface-2); color: var(--text-2); }
.rp-h[aria-pressed="true"] .tchip { background: rgba(198,255,61,.1); color: var(--accent); }
.cap { font: 600 10.5px var(--sans); padding: 2px 7px; border-radius: 999px; background: var(--surface-2); color: var(--text-2); letter-spacing: .02em; }
.rp-models { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.rp-m { display: flex; gap: 10px; align-items: center; padding: 10px; border-radius: 12px; min-width: 0; }
.rp-m .mlogo { border-radius: 9px; font-size: 13px; }
.rp-mtext { min-width: 0; display: grid; gap: 1px; }
.rp-mtext b { font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rp-mtext small { font-size: 11.5px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rp-mtext .caps { display: flex; gap: 4px; margin-top: 3px; }
.rp-m[aria-pressed="true"] { border-color: var(--accent); background: rgba(198,255,61,.06); box-shadow: 0 0 0 1px rgba(198,255,61,.35) inset; }
.rp-m:disabled { opacity: .45; cursor: not-allowed; }
.rp-m:disabled small { color: var(--warn); }
.rp-m.oracle { border-style: dashed; }
.rp-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.rp-chip { display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px 6px 7px; border-radius: 999px; font-size: 13px; font-weight: 500; }
.rp-chip .mlogo { border-radius: 50%; }
.rp-chip[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); background: rgba(198,255,61,.06); }
.rp-toggle, .rp-count { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; cursor: pointer; }
.rp-toggle + .rp-toggle, .rp-count { border-top: 1px dashed var(--line-2); }
.rp-toggle b, .rp-count b { display: block; font-size: 14px; font-weight: 600; }
.rp-toggle small, .rp-count small { display: block; font-size: 12px; color: var(--text-3); }
.rp-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.rp-toggle i { flex: none; width: 40px; height: 23px; border-radius: 999px; background: var(--line); position: relative; transition: background .15s; }
.rp-toggle i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 17px; height: 17px; border-radius: 50%; background: var(--text-2); transition: transform .15s, background .15s; }
.rp-toggle input:checked + i { background: rgba(198,255,61,.3); }
.rp-toggle input:checked + i::after { transform: translateX(17px); background: var(--accent); }
.rp-toggle input:focus-visible + i { outline: 2px solid var(--accent); outline-offset: 2px; }
.rp-toggle input:disabled + i { opacity: .4; }
.rp-count { cursor: default; }
.rp-summary { margin: 14px 0 10px; padding: 11px 13px; border-radius: 12px; background: var(--bg-2); border: 1px solid var(--line); font-size: 13.5px; min-height: 44px; display: flex; align-items: center; }
.rp-sum { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.rp-miss { color: var(--warn); font-weight: 500; }
.rp-run { height: 48px; font-size: 15.5px; border-radius: 12px; }
@media (max-width: 560px) { .rp-groups, .rp-models { grid-template-columns: 1fr; } }
.rfields { margin-top: 6px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); padding: 4px 13px; }
.rfield { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line-2); }
.rfield:last-child { border-bottom: 0; }
.rkey { font: 500 11px var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); padding-top: 2px; }
.rval { font-size: 14px; color: var(--text); white-space: pre-wrap; overflow-wrap: anywhere; }
.rp-gcount { font-size: 10.5px; }
@media (max-width: 560px) { .rfield { grid-template-columns: 1fr; gap: 2px; } }
.rerunbtn { color: var(--accent); border-color: rgba(198,255,61,.35); }
.bulk-errs { margin: 10px 0 0; padding-left: 18px; max-height: 220px; overflow: auto; font-size: 13px; color: var(--text-2); }
.bulk-errs li { margin-bottom: 5px; overflow-wrap: anywhere; }
.tc-flag.tc-check { background: rgba(124,92,255,.16); color: #b3a0ff; }

/* task picker: filterable combobox */
.taskpick { position: relative; width: 380px; max-width: 100%; }
.taskpick .input { width: 100%; padding-right: 84px; background: var(--bg-2); color: var(--text); caret-color: var(--accent); }
.taskpick .input::placeholder { color: var(--text-3); }
.tp-count { position: absolute; right: 12px; top: 20px; transform: translateY(-50%); font-size: 12px; color: var(--text-3); pointer-events: none; }
.tp-list { position: absolute; z-index: 40; left: 0; right: 0; top: calc(100% + 6px); max-height: 340px; overflow-y: auto; padding: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); }
.tp-item { padding: 8px 10px; border-radius: 8px; cursor: pointer; font-size: 14px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tp-item.on { background: var(--hover); color: var(--text); }
.tp-item.cur { color: var(--accent); }
.tp-item mark { background: transparent; color: var(--accent); font-weight: 600; }
.tp-run { margin-left: 8px; font-size: 11.5px; color: var(--warn); }
.tp-empty { padding: 10px; font-size: 13.5px; color: var(--text-3); }
