/* Agent Studio 2. System fonts only: no third-party font requests from a GDPR-bound server. */

:root {
  --paper: #fafaf9;
  --surface: #ffffff;
  --sunken: #f5f5f4;
  --ink: #1c1917;
  --ink-2: #57534e;
  --ink-3: #736c66;  /* WCAG AA (4.5:1) on paper, surface and sunken */
  --line: #e7e5e4;
  --line-2: #f0efed;
  --line-strong: #d6d3d1;
  --blue: #2f5d50;   /* the accent; the name predates the green palette */
  --blue-ink: #ffffff;
  --blue-soft: #e8f0ec;
  --signal: #a15c07;
  --signal-soft: #fdf3e2;
  --ok: #2f7d4f;
  --ok-soft: #e7f4ec;
  --bad: #b42318;
  --bad-soft: #fdecea;
  --run: #2563eb;
  --run-soft: #e8efff;
  --accent: var(--blue);
  --accent-soft: var(--blue-soft);
  --muted: var(--ink-2);
  --bg: var(--paper);
  --panel: var(--surface);
  --radius-s: 6px;
  --radius-m: 8px;
  --radius-l: 12px;
  --shadow: 0 1px 2px rgba(28, 25, 23, 0.06), 0 4px 16px rgba(28, 25, 23, 0.05);
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI Variable Text", "Segoe UI", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #161412;
    --surface: #1e1b19;
    --sunken: #1a1816;
    --ink: #ece9e6;
    --ink-2: #b2aba5;
    --ink-3: #958d87;
    --line: #2e2a27;
    --line-2: #262321;
    --line-strong: #403b37;
    --blue: #8fc3b0;
    --blue-ink: #10201b;
    --blue-soft: #20302b;
    --signal: #f0bd52;
    --signal-soft: #2e2615;
    --ok: #74c996;
    --ok-soft: #16291e;
    --bad: #ff8a7d;
    --bad-soft: #33191a;
    --run: #8fb0ff;
    --run-soft: #1b2540;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 4px 16px rgba(0, 0, 0, 0.25);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 14px/1.5 var(--sans);
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--blue); }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
.icon {
  width: 16px; height: 16px; flex: none;
  stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}
[data-icon], .icon-wrap { display: inline-grid; place-items: center; flex: none; }
kbd {
  font: 11px var(--mono); padding: 0 4px; color: var(--ink-2); background: var(--surface);
  border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px;
}

/* --- frame ---------------------------------------------------------------------------- */

.app {
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr) minmax(340px, 400px);
  height: 100vh;
}
.app.no-console { grid-template-columns: 232px minmax(0, 1fr); }

.rail {
  display: flex; flex-direction: column; min-height: 0;
  padding: 14px 10px; background: var(--sunken); border-right: 1px solid var(--line);
}
.stage { overflow-y: auto; min-width: 0; min-height: 0; }
.stage:focus { outline: none; }
.console {
  display: flex; flex-direction: column; min-height: 0; overflow-y: auto;
  background: var(--surface); border-left: 1px solid var(--line);
}

@media (max-width: 1180px) {
  .app, .app.no-console { grid-template-columns: 220px minmax(0, 1fr); height: auto; min-height: 100vh; }
  .rail { position: sticky; top: 0; height: 100vh; }
  .stage { overflow: visible; }
  .console { grid-column: 2; border-left: 0; border-top: 1px solid var(--line); }
  .transcript { max-height: 70vh; }
}
@media (max-width: 760px) {
  .app, .app.no-console { grid-template-columns: minmax(0, 1fr); }
  .stage-head, .panel { padding-left: 16px; padding-right: 16px; }
  .rail { position: static; height: auto; padding: 10px 14px; border-right: 0; border-bottom: 1px solid var(--line); }
  .console { grid-column: 1; }
}

/* --- sidebar -------------------------------------------------------------------------- */

.brand { display: flex; gap: 9px; align-items: center; padding: 4px 8px 14px; }
.brand strong { display: block; font-size: 14px; font-weight: 600; }
.brand span#envLine { display: block; font-size: 12px; color: var(--ink-3); }
.brand-mark, .avatar {
  width: 28px; height: 28px; border-radius: 7px; display: grid; place-items: center; flex: none;
  color: var(--blue); background: var(--blue-soft);
}
.mark { width: 26px; height: 26px; flex-shrink: 0; fill: var(--blue); stroke: var(--blue-ink); stroke-width: 2; stroke-linecap: round; }

.rail-body { display: flex; flex-direction: column; flex: 1; min-height: 0; overflow-y: auto; gap: 2px; }
.btn.new-agent { justify-content: center; margin: 0 4px 6px; }
.btn.new-agent[aria-current="page"] { border-color: var(--blue); color: var(--blue); }

.sections, .nav-group { display: grid; gap: 2px; }
.nav-label {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 14px 8px 4px; font-size: 11px; font-weight: 600; letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--ink-3);
}
.sections a, .agent-link {
  display: flex; align-items: center; gap: 9px; min-width: 0;
  padding: 6px 8px; border-radius: var(--radius-s);
  color: var(--ink-2); text-decoration: none;
}
.sections a:hover, .agent-link:hover { background: var(--line); color: var(--ink); }
.sections a[aria-current="page"], .agent-link[aria-current="page"] {
  background: var(--surface); color: var(--ink); box-shadow: var(--shadow); font-weight: 500;
}
.count { margin-left: auto; font-size: 12px; font-weight: 400; color: var(--ink-3); }
.agent-nav { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.agent-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
input.nav-filter { margin: 0 0 4px; padding: 4px 8px; font-size: 13px; }

.section-list { display: grid; gap: 4px; margin: 2px 0 6px 16px; padding-left: 8px; border-left: 1px solid var(--line-strong); }
.rail-tools { display: flex; gap: 6px; }
.rail-tools input { width: 0; flex: 1; padding: 4px 8px; font-size: 13px; }
.entries {
  list-style: none; margin: 0; padding: 0; max-height: 42vh; overflow-y: auto;
  display: grid; grid-template-columns: minmax(0, 1fr); align-content: start; gap: 1px;
}
.entries button {
  all: unset; box-sizing: border-box; display: block; width: 100%;
  padding: 5px 8px; border-radius: var(--radius-s); cursor: pointer; font-size: 13px;
}
.entries button:hover { background: var(--line); }
.entries button[aria-current="true"] { background: var(--surface); box-shadow: var(--shadow); }
.entries button:focus-visible { outline: 2px solid var(--blue); outline-offset: -2px; }
.entry-title { display: flex; align-items: center; gap: 6px; font-weight: 500; min-width: 0; }
.entry-title b { font-weight: inherit; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.entry-sub { display: block; font-size: 12px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.empty-note { padding: 6px 8px; font-size: 13px; color: var(--ink-3); list-style: none; }

.rail-foot { display: grid; gap: 4px; margin-top: auto; padding-top: 10px; border-top: 1px solid var(--line); }
.me-row { display: flex; align-items: center; gap: 4px; }
a.me { display: grid; flex: 1; min-width: 0; padding: 5px 8px; border-radius: var(--radius-s); color: var(--ink); text-decoration: none; font-size: 13px; }
a.me:hover, a.me[aria-current="page"] { background: var(--line); }
.me strong, .me span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me strong { font-weight: 500; }
.me span { font-size: 12px; color: var(--ink-3); }

.mobile-menu { display: none; }
@media (max-width: 760px) {
  .mobile-menu { display: inline-flex; margin-left: auto; }
  .brand { padding: 2px 0; }
  .rail:not(.nav-open) .rail-body { display: none; }
  .rail.nav-open .rail-body { padding-top: 10px; }
  .entries { max-height: 30vh; }
}

/* --- controls ------------------------------------------------------------------------- */

input:not([type]), input[type=text], input[type=search], input[type=password], input[type=number], input[type=email],
input[type=date], input[type=url], select, textarea {
  font: inherit; color: inherit; width: 100%; min-width: 0;
  background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: var(--radius-s); padding: 7px 10px;
}
input:hover, select:hover, textarea:hover { border-color: var(--ink-3); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
input:disabled { background: var(--sunken); color: var(--ink-2); }
textarea { resize: vertical; }
.code, textarea.code { font-family: var(--mono); font-size: 12.5px; }
input[type=checkbox], input[type=radio] { accent-color: var(--blue); width: 15px; height: 15px; margin: 0; flex-shrink: 0; }
input[type=file] { font: inherit; font-size: 13px; color: var(--ink-2); max-width: 100%; }
input[type=file]::file-selector-button {
  font: inherit; margin-right: 10px; padding: 5px 10px; cursor: pointer;
  color: var(--ink); background: var(--surface);
  border: 1px solid var(--line-strong); border-radius: var(--radius-s);
}

.btn {
  font: inherit; font-weight: 500; white-space: nowrap; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px;
  color: var(--ink); background: var(--surface);
  border: 1px solid var(--line-strong); border-radius: var(--radius-s);
}
.btn:hover { background: var(--sunken); }
.btn.primary { color: var(--blue-ink); background: var(--blue); border-color: var(--blue); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--sunken); }
.btn.danger { color: var(--bad); }
.btn.small { padding: 3px 8px; font-size: 12.5px; }
.btn:disabled { opacity: 0.55; cursor: default; filter: none; }

.segmented {
  display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 2px;
  background: var(--sunken); border: 1px solid var(--line); border-radius: var(--radius-s);
}
.segmented label {
  position: relative; display: flex; align-items: center; cursor: pointer;
  padding: 5px 12px; border-radius: 4px; font-size: 13px; font-weight: 500; color: var(--ink-2);
}
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented label:has(input:checked) { background: var(--surface); color: var(--ink); box-shadow: 0 0 0 1px var(--line-strong); }
.segmented label:has(input:focus-visible) { outline: 2px solid var(--blue); }

.check { display: flex; align-items: center; gap: 7px; font-size: 13px; cursor: pointer; }
.check.off { opacity: 0.5; cursor: default; }

.tag {
  display: inline-block; font-size: 11px; font-weight: 500; line-height: 1.6;
  padding: 0 7px; border-radius: 999px; white-space: nowrap;
  background: var(--sunken); color: var(--ink-2);
}
.tag.ok { background: var(--ok-soft); color: var(--ok); }
.tag.bad { background: var(--bad-soft); color: var(--bad); }
.tag.warn { background: var(--signal-soft); color: var(--signal); }

/* --- stage ---------------------------------------------------------------------------- */

.loading { padding: 40px 32px; color: var(--ink-2); }

.stage-head {
  position: sticky; top: 0; z-index: 5; padding: 18px 32px 0;
  background: color-mix(in srgb, var(--paper) 90%, transparent);
  backdrop-filter: blur(8px); border-bottom: 1px solid var(--line);
}
.head-row { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 12px 16px; }
.head-title { flex: 1; min-width: 240px; }
input.title-input {
  font-size: 22px; font-weight: 600; letter-spacing: -0.015em;
  padding: 1px 6px; margin-left: -7px;
  background: transparent; border-color: transparent;
}
input.title-input:hover { border-color: var(--line-strong); }
input.title-input:focus { background: var(--surface); }
.head-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 2px; font-size: 12.5px; color: var(--ink-2); }
.head-meta code { font-family: var(--mono); font-size: 12px; }
.head-actions { display: flex; align-items: center; gap: 8px; }
.dirty { font-size: 12.5px; font-weight: 500; color: var(--signal); }

.subtabs { display: flex; gap: 4px; margin-top: 10px; overflow-x: auto; }
.subtabs button {
  all: unset; cursor: pointer; white-space: nowrap;
  padding: 8px 10px; font-weight: 500; color: var(--ink-2);
  border-bottom: 2px solid transparent;
}
.subtabs button:hover { color: var(--ink); }
.subtabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--blue); }
.subtabs button:focus-visible { outline: 2px solid var(--blue); outline-offset: -2px; }

.panel { padding: 8px 32px 72px; max-width: 900px; }
.group { padding: 22px 0; border-top: 1px solid var(--line); }
.group:first-child { border-top: 0; }
.group > h3 { margin: 0 0 2px; font-size: 15px; font-weight: 600; }
.group > .lead { margin: 0 0 14px; max-width: 70ch; font-size: 13px; color: var(--ink-2); }

.field { display: grid; align-content: start; gap: 5px; margin-bottom: 14px; min-width: 0; }
.field > span { font-size: 13px; font-weight: 500; }
.help { font-size: 12.5px; color: var(--ink-2); }
.help code, .lead code { font-family: var(--mono); font-size: 12px; }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 16px; }
.cols.narrow { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.inline { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

.toolgroups { display: grid; gap: 10px; margin-top: 14px; }
.toolgroup { display: grid; grid-template-columns: 110px 1fr; gap: 10px; align-items: start; }
.toolgroup > span { padding-top: 4px; font-size: 12.5px; color: var(--ink-2); }
@media (max-width: 620px) { .toolgroup { grid-template-columns: 1fr; gap: 4px; } }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  position: relative; display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; font-size: 13px; cursor: pointer; user-select: none;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: 999px;
}
.chip:hover { border-color: var(--ink-3); }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip:has(input:checked) { color: var(--blue); background: var(--blue-soft); border-color: var(--blue); }
.chip:has(input:focus-visible) { outline: 2px solid var(--blue); outline-offset: 2px; }

.picklist { max-height: 320px; overflow-y: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); }
.picklist label {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 0 10px; align-items: center;
  padding: 8px 12px; border-top: 1px solid var(--line); cursor: pointer;
}
.picklist label:first-child { border-top: 0; }
.picklist label:hover { background: var(--sunken); }
.picklist .name { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.picklist .desc { grid-column: 2 / 4; font-size: 12.5px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.picklist .none { padding: 12px; color: var(--ink-2); font-size: 13px; }

.callout {
  margin: 0 0 14px; padding: 10px 12px; font-size: 13px;
  background: var(--signal-soft); border-left: 3px solid var(--signal);
  border-radius: 0 var(--radius-s) var(--radius-s) 0;
}
.callout.bad { background: var(--bad-soft); border-color: var(--bad); }

pre.snippet {
  margin: 0 0 12px; padding: 12px 14px; overflow-x: auto; white-space: pre;
  font-family: var(--mono); font-size: 12.5px; line-height: 1.55;
  background: var(--sunken); border: 1px solid var(--line); border-radius: var(--radius-m);
}

.tablewrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th { text-align: left; font-size: 12.5px; font-weight: 500; color: var(--ink-2); padding: 7px 12px; border-bottom: 1px solid var(--line); }
.table td { padding: 7px 12px; border-top: 1px solid var(--line); }
.table tr:first-child td { border-top: 0; }
.table td.num { text-align: right; white-space: nowrap; color: var(--ink-2); }
.table td.act { text-align: right; white-space: nowrap; }
.table .path { font-family: var(--mono); font-size: 12.5px; word-break: break-all; }

.dropzone {
  display: grid; gap: 8px; justify-items: center; margin-bottom: 12px; padding: 18px;
  text-align: center; font-size: 13px; color: var(--ink-2);
  border: 1.5px dashed var(--line-strong); border-radius: var(--radius-m);
}
.dropzone.hot { color: var(--blue); background: var(--blue-soft); border-color: var(--blue); }

.empty { max-width: 520px; padding: 72px 32px; }
.empty h2 { margin: 0 0 6px; font-size: 20px; letter-spacing: -0.01em; }
.empty p { margin: 0 0 16px; color: var(--ink-2); }

/* --- run console ---------------------------------------------------------------------- */

.console-head { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.console-head h2 { margin: 0; font-size: 15px; }
.run-state { flex: 1; }

.composer { display: grid; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.composer-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.inline-field { display: flex; flex: 1; align-items: center; gap: 8px; min-width: 200px; font-size: 13px; color: var(--ink-2); }
.more > summary { cursor: pointer; font-size: 13px; color: var(--ink-2); }
.more[open] > summary { margin-bottom: 8px; }
.more .field > span { font-weight: 400; color: var(--ink-2); }
.composer-actions { display: flex; justify-content: flex-end; align-items: center; gap: 10px; }
.kbd { font-size: 12px; color: var(--ink-3); }

.status {
  display: inline-flex; align-items: center; gap: 5px; padding: 1px 8px;
  font-size: 12px; font-weight: 500; white-space: nowrap;
  color: var(--ink-2); background: var(--sunken); border-radius: 999px;
}
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status.queued, .status.running { color: var(--run); background: var(--run-soft); }
.status.running::before { animation: pulse 1.2s ease-in-out infinite; }
.status.succeeded, .status.ok { color: var(--ok); background: var(--ok-soft); }
.status.failed { color: var(--bad); background: var(--bad-soft); }
@keyframes pulse { 50% { opacity: 0.3; } }
@media (prefers-reduced-motion: reduce) { .status.running::before { animation: none; } }

/* The transcript is a timeline: one node per thing the agent did. */
.transcript { flex: 1; min-height: 180px; overflow-y: auto; padding: 16px 18px 6px; }
.transcript:empty::before {
  content: "The agent's work appears here as it happens: what it says, every tool it calls, and the result it returns.";
  display: block; max-width: 40ch; font-size: 13px; color: var(--ink-3);
}
.tl { position: relative; margin: 0; padding: 0 0 12px 24px; min-width: 0; }
.tl::before { content: ""; position: absolute; left: 6px; top: 16px; bottom: 0; width: 1px; background: var(--line-strong); }
.tl:last-child::before { display: none; }
.tl::after {
  content: ""; position: absolute; left: 2px; top: 6px; width: 9px; height: 9px;
  background: var(--surface); border: 2px solid var(--line-strong); border-radius: 50%;
}
.tl.say::after { background: var(--ink); border-color: var(--ink); }
.tl.tool::after { border-color: var(--blue); border-radius: 2px; }
.tl.tool.err::after { border-color: var(--bad); }
.tl.done::after { background: var(--ok); border-color: var(--ok); }
.tl.fail::after { background: var(--bad); border-color: var(--bad); }
.tl.sub { margin-left: 14px; }
.say-text { font-size: 13.5px; white-space: pre-wrap; word-break: break-word; }
.tl.meta { font-size: 12.5px; color: var(--ink-2); }
.tl.meta > details > summary { cursor: pointer; }

.tool-call > summary {
  display: flex; align-items: baseline; gap: 8px; min-width: 0;
  list-style: none; cursor: pointer; font-size: 13px;
}
.tool-call > summary::-webkit-details-marker { display: none; }
.tool-name { font-family: var(--mono); font-size: 12.5px; font-weight: 600; color: var(--blue); white-space: nowrap; }
.tool-arg { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--mono); font-size: 12px; color: var(--ink-2); }
.tool-res { font-size: 12px; white-space: nowrap; color: var(--ink-3); }
.tool-res.err { color: var(--bad); }
.tl pre {
  margin: 6px 0 0; padding: 8px 10px; max-height: 280px; overflow: auto;
  font-family: var(--mono); font-size: 12px; white-space: pre-wrap; word-break: break-word;
  background: var(--sunken); border-radius: var(--radius-s);
}
.tl pre + pre { margin-top: 4px; }
.result-card { padding: 10px 12px; background: var(--ok-soft); border-radius: var(--radius-m); }
.result-card.fail { background: var(--bad-soft); }
.result-card h4 { margin: 0 0 2px; font-size: 13px; }
.result-card p { margin: 0; font-size: 12.5px; color: var(--ink-2); }
.result-card pre { background: var(--surface); }

.history { max-height: 30vh; overflow-y: auto; padding: 10px 18px 14px; border-top: 1px solid var(--line); }
.history h3 { margin: 0 0 4px; font-size: 13px; font-weight: 500; color: var(--ink-2); }
.history ul { list-style: none; margin: 0; padding: 0; }
.history button {
  all: unset; box-sizing: border-box; width: 100%; cursor: pointer;
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 10px; align-items: center;
  padding: 6px 8px; border-radius: var(--radius-s);
}
.history button:hover, .history button[aria-current="true"] { background: var(--sunken); }
.history button:focus-visible { outline: 2px solid var(--blue); outline-offset: -2px; }
.history .task { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.history .when { grid-column: 1 / -1; font-size: 12px; color: var(--ink-2); }

.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 50; display: grid; gap: 8px; max-width: min(420px, calc(100vw - 32px)); }
.toast {
  padding: 10px 14px; font-size: 13px; white-space: pre-wrap;
  color: var(--paper); background: var(--ink); border-radius: var(--radius-m);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}
.toast.bad { color: #fff; background: var(--bad); }

.title-static { margin: 2px 0 0; font-size: 22px; font-weight: 600; letter-spacing: -0.015em; overflow-wrap: anywhere; }
.linkrow { cursor: pointer; }
.linkrow:hover td { background: var(--sunken); }
.linkrow:focus-visible { outline: 2px solid var(--blue); outline-offset: -2px; }
.task-cell { max-width: 360px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.empty code { font-family: var(--mono); font-size: 12.5px; }

/* --- access ---------------------------------------------------------------------------- */

.gate { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: 16px; background: var(--paper); }
.gate-card {
  display: grid; gap: 4px; width: min(400px, 100%); padding: 28px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m);
}
.gate-card .mark { width: 32px; height: 32px; margin-bottom: 6px; }
.gate-card h1 { margin: 0; font-size: 20px; letter-spacing: -0.01em; }
.gate-card .lead { margin: 0 0 12px; color: var(--ink-2); }
.gate-card .btn { justify-content: center; margin-top: 4px; }
.gate-card .snippet { margin: 8px 0; white-space: pre-wrap; }
.gate-error { margin: 0 0 4px; font-size: 13px; color: var(--bad); }


.secret {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0 0 14px; padding: 12px 14px;
  background: var(--ok-soft); border: 1px solid var(--ok); border-radius: var(--radius-m);
}
.secret code { flex: 1; min-width: 0; font-family: var(--mono); font-size: 13px; word-break: break-all; }
.scope-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 8px 16px; }
.scope-grid .check { align-items: flex-start; }
.scope-grid .check input { margin-top: 3px; }
.scope-grid small { display: block; font-size: 12px; color: var(--ink-2); }
.table tr.inactive td { color: var(--ink-3); }
.audit-detail { font-family: var(--mono); font-size: 12px; color: var(--ink-2); word-break: break-word; }
.composer-locked { margin: 0; padding: 12px 18px; border-bottom: 1px solid var(--line); }

/* Pages: one calm layout for every section. */
.studio-page { padding: 46px clamp(22px, 4vw, 64px); max-width: 1440px; margin: 0 auto; }
.studio-header { display: flex; gap: 24px; align-items: center; justify-content: space-between; margin-bottom: 34px; }
.eyebrow { font-size: 10px; letter-spacing: 2px; font-weight: 700; color: var(--blue); margin: 0 0 14px; }
.studio-header h1 { margin: 0 0 12px; font-size: clamp(26px, 2.8vw, 40px); font-weight: 550; letter-spacing: -1.5px; line-height: 1.15; }
.studio-header .lead { margin: 0; color: var(--ink-2); max-width: 55ch; }
a.btn { text-decoration: none; }
.studio-metrics { display: grid; grid-template-columns: repeat(3, 1fr); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 24px 0; margin-bottom: 38px; }
.studio-metrics > * { display: grid; gap: 6px; padding: 0 28px; border-right: 1px solid var(--line); color: inherit; text-decoration: none; }
.studio-metrics > :last-child { border: 0; }
.studio-metrics strong { font-size: 29px; line-height: 1; font-weight: 550; letter-spacing: -1px; }
.studio-metrics small { font-size: 16px; color: var(--ink-3); }
.studio-metrics span { font-size: 12px; color: var(--ink-2); }
.studio-section { margin-bottom: 38px; }
.section-heading { display: flex; gap: 14px; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.section-heading h2 { margin: 0; font-size: 17px; letter-spacing: -.4px; font-weight: 600; }
.starter-grid, .agent-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.starter-card { font: inherit; text-align: left; display: grid; align-content: start; gap: 9px; padding: 22px; background: transparent; color: var(--ink); border: 1px solid var(--line-strong); border-radius: var(--radius-m); cursor: pointer; transition: border-color .15s, background .15s; }
.starter-card:hover { background: var(--blue-soft); border-color: var(--blue); }
.starter-card > span:not(.starter-icon) { font-size: 12.5px; color: var(--ink-2); }
.starter-card .starter-link { color: var(--blue) !important; font-weight: 500; margin-top: 8px; }
.starter-icon { font-family: var(--mono); width: 36px; height: 36px; display: grid; place-items: center; color: var(--blue); background: var(--blue-soft); border-radius: 9px; font-size: 19px; margin-bottom: 10px; }
.agent-card { display: flex; flex-direction: column; color: inherit; text-decoration: none; padding: 22px; min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); transition: border-color .15s, box-shadow .15s; }
.agent-card:hover { border-color: var(--blue); box-shadow: 0 4px 14px #193b2510; }
.card-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 20px; }
.agent-avatar { display: grid; place-items: center; background: var(--sunken); border-radius: 10px; width: 38px; height: 38px; font-size: 18px; font-weight: 500; }
.provider-badge { font-size: 10px; font-weight: 500; padding: 3px 8px; border-radius: 5px; background: var(--sunken); color: var(--ink-2); white-space: nowrap; }
.provider-badge.azure { background: var(--blue-soft); color: var(--blue); }
.agent-card h3 { font-size: 16px; letter-spacing: -.3px; margin: 0 0 8px; overflow-wrap: anywhere; }
.agent-card p { margin: 0 0 22px; font-size: 13px; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-bottom { display: flex; justify-content: space-between; gap: 12px; padding-top: 15px; border-top: 1px solid var(--line); font-size: 11px; color: var(--ink-2); margin-top: auto; }
.card-bottom span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.library-empty { padding: 28px; border: 1px dashed var(--line-strong); border-radius: var(--radius-m); grid-column: 1 / -1; color: var(--ink-2); }
.library-empty h3 { margin: 0 0 8px; color: var(--ink); }
.library-empty p { margin: 0; }
.library-footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; font-size: 11px; color: var(--ink-2); padding-top: 24px; border-top: 1px solid var(--line); }
.provider-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.decision-question { padding: 16px; margin: 0 0 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); }
.decision-answers td { vertical-align: top; }
.provider-card { min-width: 0; padding: 26px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); }
.provider-card h2 { font-size: 20px; letter-spacing: -.5px; margin: 0 0 12px; }
.provider-card h3 { font-size: 13px; margin: 26px 0 12px; }
.provider-card p { font-size: 13px; color: var(--ink-2); }
.provider-card .callout { margin-top: 22px; margin-bottom: 0; }
.provider-card pre { font-size: 11px; }
.run-table td { padding: 16px 12px; }
.run-table td:first-child strong { display: block; max-width: 350px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-weight: 500; }
.run-table td:first-child .help { display: block; margin-top: 3px; }
.run-table td:not(:first-child) { white-space: nowrap; }
.breadcrumb { display: inline-block; font-size: 12px; color: var(--ink-2); text-decoration: none; margin: 0 0 18px; }
.stage-head { padding-top: 24px; }
.panel { padding-top: 16px; }
.group > h3 { margin-bottom: 14px; }
.advanced { margin-top: 16px; }
.advanced summary { cursor: pointer; font-size: 12px; color: var(--ink-2); margin-bottom: 16px; }
.playground-empty { padding: 30px 12px; text-align: center; color: var(--ink-2); }
.playground-empty > span { font-size: 32px; color: var(--blue); }
.playground-empty h3 { font-size: 14px; color: var(--ink); margin: 12px 0 6px; }
.playground-empty p { font-size: 12px; max-width: 30ch; margin: 0 auto; }
.composer > .help { margin: 0; font-size: 12px; }
.console { overflow-y: auto; }
.console-head { padding: 24px 18px; }
.result-card .help { margin-top: 10px; }
.result-card .section-heading { margin-bottom: 6px; }
@media (max-width: 1050px) { .starter-grid, .agent-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .provider-grid { grid-template-columns: minmax(0, 1fr); } .studio-header { align-items: flex-start; flex-direction: column; gap: 18px; } }
@media (max-width: 760px) { .studio-page { padding: 28px 18px; } .stage-head { position: static; } .head-title { min-width: 180px; } .studio-metrics > * { padding: 0 15px; } }
@media (max-width: 460px) { .starter-grid, .agent-grid { grid-template-columns: minmax(0, 1fr); } .studio-metrics strong { font-size: 24px; } .studio-metrics span { font-size: 11px; } .studio-metrics > * { padding: 0 10px; } .head-actions { flex-wrap: wrap; } .subtabs { font-size: 12px; } .cols { grid-template-columns: minmax(0, 1fr); } }
@media (prefers-reduced-motion: reduce) { .starter-card, .agent-card { transition: none; } }
.artifact-list { list-style: none; margin: 12px 0; padding: 0; }
.artifact-list li { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; }
.artifact-list a { overflow-wrap: anywhere; }
.artifact-list span { white-space: nowrap; }
.toast { display: flex; align-items: flex-start; gap: 14px; }
.toast button { border: 0; background: transparent; color: inherit; font: inherit; font-size: 20px; line-height: 1; cursor: pointer; padding: 0; }
.jump-playground { display: none; }
@media (max-width: 1180px) { .jump-playground { display: inline-flex; } }

.connection-builder { margin: 20px 0; }
.connection-row { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:12px 0; border-bottom:1px solid var(--line, #ddd); flex-wrap:wrap; }
.connection-row p { margin:4px 0; overflow-wrap:anywhere; }
.connection-builder details, .evaluation-case { padding:16px; margin:12px 0; border:1px solid var(--line, #ddd); border-radius:12px; }
.advanced-config { margin:12px 0; }
.evaluation-case { background:var(--panel, #fff); }
.version-list { max-height:300px; overflow:auto; margin-bottom:24px; }

#localConnection .actions { display: flex; flex-wrap: wrap; gap: 8px; }
#localConnection .check { margin-bottom: 16px; }

.docs-page { max-width: 1120px; }
.docs-nav { display: flex; flex-wrap: wrap; gap: 8px; padding-bottom: 24px; border-bottom: 1px solid var(--line); margin-bottom: 28px; }
.docs-nav a { padding: 7px 11px; border-radius: 6px; background: var(--paper); }
.docs-nav a[aria-current=page] { background: #e3efe7; color: #176344; }
.docs-article { max-width: 900px; line-height: 1.65; }
.docs-article h2, #apiReference h2 { margin-top: 32px; }
.docs-article li { margin: 10px 0; }
.docs-article pre, #apiReference pre { overflow: auto; max-height: 560px; }
.api-operation { border: 1px solid var(--line); border-radius: 7px; padding: 12px; margin: 8px 0; }
.api-operation summary { cursor: pointer; overflow-wrap: anywhere; }
#apiReference { margin-top: 40px; }
#apiReference details details { margin: 14px; }

/* Run inspector keeps execution details separate from configuration. */
.run-monitor { max-width: 1700px; }
.monitor-actions { flex-wrap: wrap; gap: 8px; }
.monitor-metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; margin: 24px 0 12px; }
.monitor-metrics > div { padding: 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); min-width: 0; }
.monitor-metrics strong { display: block; font-size: 22px; overflow-wrap: anywhere; }
.monitor-metrics span { display: block; font-size: 12px; color: var(--muted); margin-top: 6px; }
.monitor-filters { display: flex; align-items: end; flex-wrap: wrap; gap: 16px; margin: 20px 0; }
.monitor-filters .field { margin: 0; flex: 1; min-width: 160px; }
.monitor-explorer { display: grid; grid-template-columns: minmax(240px, 0.8fr) minmax(0, 1.4fr); gap: 20px; align-items: start; }
.monitor-steps { display: grid; gap: 8px; max-height: 70vh; overflow-y: auto; padding: 2px; }
.monitor-step { display: grid; gap: 5px; text-align: left; padding: 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: inherit; min-width: 0; overflow-wrap: anywhere; cursor: pointer; }
.monitor-step[aria-pressed=true] { border-color: var(--accent); box-shadow: inset 3px 0 var(--accent); }
.monitor-step.has-error { border-color: #c75454; }
.monitor-step-kind { font-size: 10px; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); }
.monitor-detail { border: 1px solid var(--line); border-radius: 12px; padding: 22px; min-width: 0; max-height: 80vh; overflow: auto; }
.monitor-detail h2 { overflow-wrap: anywhere; }
.run-monitor pre { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 55vh; overflow: auto; }
.run-monitor [data-monitor-panel] { padding-top: 20px; }
.run-monitor .subtabs { flex-wrap: wrap; }
.run-monitor .subtabs [aria-pressed=true] { background: var(--surface); box-shadow: inset 0 -2px var(--accent); }
.chip:has(input:disabled) { opacity: .55; cursor: not-allowed; }
@media (max-width: 900px) { .monitor-explorer { grid-template-columns: minmax(0, 1fr); } .monitor-steps { max-height: 38vh; } .monitor-detail { max-height: none; } }

.inference-composer { border: 1px solid var(--line); border-radius: 14px; padding: 24px; margin: 20px 0; background: var(--surface); }
.inference-composer .composer-actions { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-top: 18px; }
.inference-composer .composer-actions .help { max-width: 70%; }
.inference-response { border-left: 3px solid var(--accent); padding: 0 20px; margin: 28px 0; }
.inference-response pre { white-space: pre-wrap; overflow-wrap: anywhere; font-family: inherit; line-height: 1.6; max-height: 45vh; overflow: auto; }
.inference-empty { padding: 32px 0; color: var(--muted); }
#inferenceFileNames { overflow-wrap: anywhere; min-width: 0; }
@media (max-width: 760px) { .inference-composer { padding: 16px; } .inference-composer .composer-actions { align-items: stretch; flex-direction: column; } .inference-composer .composer-actions .help { max-width: none; } }

.conversation-graph { margin: 24px 0; }
.conversation-tree { max-height: 320px; overflow: auto; padding: 4px; }
.conversation-branch { margin-left: calc(var(--depth) * 22px); padding: 0 0 12px 16px; border-left: 2px solid var(--line); position: relative; }
.conversation-branch::before { content: ''; position: absolute; left: 0; top: 24px; width: 16px; border-top: 2px solid var(--line); }
.conversation-node { display: grid; gap: 8px; padding: 14px 18px; border: 1px solid var(--line); border-radius: 10px; color: inherit; background: var(--surface); text-decoration: none; overflow-wrap: anywhere; }
.conversation-node[aria-current=step] { border-color: var(--accent); box-shadow: inset 3px 0 var(--accent); }
.conversation-node .inline { flex-wrap: wrap; }
.context-measurement { margin: 24px 0; padding: 20px; border: 1px solid var(--line); border-radius: 12px; }
.context-measurement h2 { font-size: 18px; }
.context-measurement progress { width: 100%; accent-color: var(--accent); }
.context-categories { display: flex; flex-wrap: wrap; gap: 8px; }
@media (max-width: 760px) { .conversation-branch { margin-left: calc(var(--depth) * 10px); padding-left: 8px; } .conversation-branch::before { width: 8px; } }
.run-activity { margin: 24px 0; }
.activity-list { list-style: none; padding: 0; margin: 18px 0; display: grid; gap: 0; }
.activity-item { border-bottom: 1px solid var(--line); }
.activity-action { display: grid; grid-template-columns: 28px minmax(0,1fr) auto 16px; align-items: start; gap: 14px; width: 100%; padding: 16px 8px; color: inherit; background: transparent; border: 0; text-align: left; cursor: pointer; font: inherit; }
.activity-action:hover, .activity-action:focus-visible { background: var(--surface); outline: 2px solid var(--blue); outline-offset: -2px; border-radius: 8px; }
.activity-number { display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; width: 26px; height: 26px; color: var(--ink-2); font-size: 12px; }
.activity-body { display: grid; gap: 5px; min-width: 0; }
.activity-body strong { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.activity-description, .activity-error { font-size: 13px; overflow-wrap: anywhere; }
.activity-description { color: var(--ink-2); }
.activity-error, .activity-item.has-error .activity-number { color: var(--bad); }
.activity-status { font-size: 12px; white-space: nowrap; color: var(--ink-2); }
.activity-status small { display: block; margin-top: 5px; }
.activity-outcome { display: grid; gap: 8px; padding: 18px 20px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; overflow-wrap: anywhere; }
.activity-outcome.has-error { border-left: 3px solid var(--bad); }
.activity-outcome span { font-size: 14px; }
.usage-details { margin: 24px 0; }
@media (max-width: 600px) {
  .activity-action { grid-template-columns: 26px minmax(0,1fr) 12px; gap: 10px; }
  .activity-action > span:last-child { grid-column: 3; grid-row: 1; }
  .activity-status { grid-column: 2; white-space: normal; }
  .activity-status small { display: inline; margin-left: 8px; }
}

 .activity-status.err { color: var(--bad); }

/* Inference puts the answer first; diagnostics remain available on demand. */
.run-monitor .studio-header { margin-bottom: 20px; }
.run-monitor .studio-header h1 { font-size: 28px; }
.conversation-transcript { position: relative; max-height: 62vh; overflow: auto; scroll-margin-top: 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.conversation-transcript:focus-visible, .answer-content:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.inference-response { margin: 0; padding: 22px; border: 0; }
.conversation-message { padding: 22px; border-bottom: 1px solid var(--line); }
.conversation-message h3 { font-size: 13px; color: var(--ink-2); }
.conversation-task { white-space: pre-wrap; overflow-wrap: anywhere; margin-top: 0; }
.answer-content { overflow-wrap: anywhere; line-height: 1.65; }
.answer-content > :first-child { margin-top: 0; }
.answer-content h3 { font-size: 20px; }
.answer-content p { margin: 0 0 12px; white-space: pre-wrap; }
.answer-content pre, .run-monitor .answer-content pre { max-height: none; white-space: pre-wrap; margin: 0 0 12px; }
.answer-content pre code { display: block; background: var(--bg); padding: 14px; border-radius: 8px; }
.answer-content blockquote { border-left: 3px solid var(--line); padding-left: 16px; margin-left: 0; }
.answer-content.has-error { color: #9f2929; }
.answer-actions { margin-top: 14px; }
.composer-settings summary { cursor: pointer; margin-bottom: 12px; }
.inference-composer { padding: 18px; margin: 16px 0; }
.inference-composer .section-heading { margin-bottom: 12px; }
.execution-details { margin: 24px 0; border-top: 1px solid var(--line); padding-top: 16px; }
.execution-details > summary { cursor: pointer; font-size: 16px; font-weight: 600; padding: 10px 0; }
.inspector-actions { margin: 16px 0; }
.history-filters { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; margin: 24px 0; }
.history-filters .field { flex: 1 1 150px; margin-bottom: 0; }
.history-pagination { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 18px; }
.run-error-summary { color: #9f2929; max-width: 280px; white-space: normal; overflow-wrap: anywhere; }
@media (max-width: 760px) {
  .run-monitor.studio-page { padding: 18px 12px; }
  .run-monitor .studio-header { gap: 10px; }
  .run-monitor .studio-header h1 { font-size: 24px; }
  .run-monitor .studio-header .help { overflow-wrap: anywhere; }
  .inference-response, .conversation-message { padding: 16px; }
  .conversation-transcript { max-height: 60vh; }
  .inference-composer { padding: 14px; }
  .inference-composer .section-heading { flex-wrap: wrap; }
}

.conversation-transcript.expanded { max-height: none; }
#expandConversation { margin-top: 8px; }

.answer-warning { margin: 0 0 .6rem; padding: .5rem .75rem; border-left: 3px solid #c58a00; background: #fff8e1; color: #5c4300; font-size: .9rem; }
.exfil-warning { margin: 0 0 .8rem; padding: .5rem .75rem; border-left: 3px solid #c58a00; background: #fff8e1; color: #5c4300; font-size: .9rem; }
.exfil-warning ul { margin: .25rem 0 .25rem; padding-left: 1.2rem; overflow-wrap: anywhere; }
.link-host { color: var(--ink-3); font-size: .85em; overflow-wrap: anywhere; }
.link-host.mismatch { color: var(--bad); font-weight: 600; }
.answer-warning ul { margin: .25rem 0 0; padding-left: 1.2rem; }
.status.warn { color: #5c4300; background: #fff8e1; }
.err, .result-card.fail p { white-space: pre-line; }
.answer-usage { margin-top: .6rem; }
.cost-table { max-width: 32rem; margin-top: .75rem; }
.cost-table caption { text-align: left; font-weight: 600; padding-bottom: .25rem; }
.result-fields { display: grid; grid-template-columns: minmax(8rem, max-content) 1fr; gap: .25rem .9rem; margin: 0; }
.result-fields dt { font-weight: 600; text-transform: capitalize; color: var(--muted, #555); }
.result-fields dd { margin: 0; overflow-wrap: anywhere; }
.result-list { margin: 0; padding-left: 1.2rem; }
.result-list > li + li { margin-top: .5rem; padding-top: .5rem; border-top: 1px solid #eee; }
.result-table td { vertical-align: top; overflow-wrap: anywhere; }
.result-table th { text-transform: capitalize; }
.absent { color: #999; }

details.thinking > summary { cursor: pointer; color: var(--muted, #666); font-size: .85rem; }
details.thinking .say-text { color: var(--muted, #555); font-style: italic; white-space: pre-wrap; }
.finding-status { display: inline-block; padding: 0 .45rem; border-radius: 999px; font-size: .8rem; background: #eef1f4; }
.finding-status.found { background: var(--ok-soft); color: var(--ok); }
.finding-status.not_readable, .finding-status.not_checked { background: #fff8e1; color: #5c4300; }
.breadcrumb a { color: inherit; text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.run-activity { margin: 18px 0; }

/* Golden sets and evaluations (Versions & tests). */
.panel[data-panel="quality"] { max-width: 1180px; }
.evaluations { margin-top: 8px; padding-top: 18px; border-top: 1px solid var(--line); }
.evaluations > h3 { margin: 0 0 2px; font-size: 15px; font-weight: 600; }
.eval-rule { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 10px 0 4px; padding: 10px 12px; font-size: 13px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); }
.eval-part { padding: 18px 0 6px; }
.eval-part + .eval-part { border-top: 1px solid var(--line); }
.eval-part-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin-bottom: 10px; }
.eval-part-head h4 { margin: 0; font-size: 14px; font-weight: 600; }
.eval-report h5 { margin: 18px 0 8px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.eval-import { position: relative; cursor: pointer; }
.eval-import:focus-within { outline: 2px solid var(--blue); outline-offset: 2px; }
.eval-editor { margin-top: 14px; padding: 16px; background: var(--sunken); border-radius: var(--radius-m); }
.eval-editor .evaluation-case { margin: 8px 0; padding: 0; background: var(--surface); }
.evaluation-case > summary { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 14px; cursor: pointer; }
.evaluation-case[open] > summary { border-bottom: 1px solid var(--line); }
.eval-case-title { font-weight: 500; overflow-wrap: anywhere; }
.eval-case-body { padding: 14px; }
.eval-case-tools { margin: 6px 0; }
.eval-editor-actions { margin-top: 12px; }
.eval-editor-actions .push, .eval-case-tools .help:first-child { margin-right: auto; }
.eval-files { list-style: none; margin: 4px 0 0; padding: 0; font-size: 13px; }
.eval-files li { display: flex; align-items: center; gap: 8px; }
.field-error { color: var(--bad); font-size: 12.5px; }
p.err { margin: 6px 0; color: var(--bad); font-size: 13px; overflow-wrap: anywhere; }
textarea[aria-invalid="true"] { border-color: var(--bad); }
.eval-versions { border: 0; padding: 0; margin: 0 0 14px; display: grid; gap: 6px; }
.eval-versions legend { padding: 0; margin-bottom: 4px; font-size: 13px; font-weight: 500; }
.eval-version-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.table tr.eval-current td { background: var(--blue-soft); }
.eval-matrix td { vertical-align: top; }
.eval-cell { display: grid; justify-items: start; gap: 3px; width: 100%; padding: 6px 8px; font: inherit; text-align: left; color: inherit; background: transparent; border: 1px solid transparent; border-radius: var(--radius-s); cursor: pointer; }
.eval-cell:hover { background: var(--sunken); }
.eval-cell[aria-pressed="true"] { border-color: var(--blue); background: var(--blue-soft); }
.eval-drill { margin-top: 16px; padding: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); }
.eval-runs { font-size: 13px; }
.eval-fields .eval-val { max-width: 260px; font-family: var(--mono); font-size: 12px; overflow-wrap: anywhere; }
.eval-field.sev-row-critical td:first-child { box-shadow: inset 3px 0 0 var(--bad); }
.eval-field.sev-row-major td:first-child { box-shadow: inset 3px 0 0 var(--signal); }
.sev { display: inline-block; padding: 1px 7px; font-size: 11.5px; font-weight: 500; border-radius: 999px; color: var(--ink-2); background: var(--sunken); }
.sev-critical { color: var(--bad); background: var(--bad-soft); }
.sev-major { color: var(--signal); background: var(--signal-soft); }

/* Bedrock connection test */
.connection-result { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 4px 14px; margin: 8px 0; font-size: 13px; }
.connection-result dt { color: var(--ink-2); }
.connection-result dd { margin: 0; overflow-wrap: anywhere; }
.connection-note .status { margin-right: 6px; }
.eval-marker { margin-left: 2px; }

/* Output fields form */
.output-builder { display: grid; gap: 10px; margin: 8px 0 12px; }
.of-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.of-field { border: 1px solid var(--line); border-radius: var(--radius-s); padding: 10px 12px; background: var(--surface); }
.of-row { display: flex; flex-wrap: wrap; align-items: end; gap: 8px 14px; }
.of-row .field { margin: 0; min-width: 0; flex: 1 1 160px; }
.of-row .check { margin: 0 0 8px; white-space: nowrap; }
.of-row [data-of-remove] { margin: 0 0 4px auto; }
.of-description { margin: 8px 0 0; }
.of-children { margin: 10px 0 0 6px; padding-left: 12px; border-left: 2px solid var(--line); display: grid; gap: 8px; justify-items: start; }
.of-children .of-list { width: 100%; }
.output-builder > .btn { justify-self: start; }

.execution-where h3 { font-size: 14px; margin: 12px 0 6px; }
.execution-facts { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; margin: 0 0 8px; font-size: 13px; }
.execution-facts dt { color: var(--ink-2); }
.execution-facts dd { margin: 0; overflow-wrap: anywhere; }

/* --- pages ----------------------------------------------------------------------------- */

.btn.mobile-menu { display: none; }
@media (max-width: 760px) { .btn.mobile-menu { display: inline-flex; } }
.brand span#envLine { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.page { padding: 28px clamp(18px, 3vw, 40px) 64px; max-width: 1180px; }
.page.narrow { max-width: 920px; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px 16px; margin-bottom: 22px; }
.page-head h1 { margin: 0 0 4px; font-size: 22px; font-weight: 600; letter-spacing: -0.01em; }
.page-head .lead { margin: 0; color: var(--ink-2); max-width: 70ch; }
.page-foot { margin-top: 24px; }
.help.block, .block { display: block; }
.row-title { font-weight: 500; color: var(--ink); text-decoration: none; }
.row-title:hover { text-decoration: underline; }
.empty-card { padding: 28px; text-align: center; color: var(--ink-2); background: var(--surface); border: 1px dashed var(--line-strong); border-radius: var(--radius-m); }
.empty-card h2 { margin: 0 0 6px; font-size: 16px; color: var(--ink); }
.empty-card p { margin: 0 0 12px; }
.starter-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.starter-card { gap: 4px; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); }
.starter-card:hover { background: var(--surface); border-color: var(--blue); box-shadow: var(--shadow); }
.starter-icon { width: 30px; height: 30px; margin-bottom: 8px; border-radius: 7px; font-size: inherit; }
.starter-card.blank .starter-icon { color: var(--ink-2); background: var(--sunken); }

/* --- workbench: conversation centre, run facts and history on the right ---------------- */

.stage:has(> .workbench) { overflow: hidden; }
.workbench { display: grid; grid-template-columns: minmax(0, 1fr) 340px; height: 100vh; min-height: 0; }
.wb-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.wb-head {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; padding: 12px 24px;
  background: var(--surface); border-bottom: 1px solid var(--line);
}
.wb-title { min-width: 0; flex: 1 1 200px; }
.wb-title h1 { margin: 0; font-size: 15px; font-weight: 600; overflow-wrap: anywhere; }
.wb-title .help { margin: 0; font-size: 12px; color: var(--ink-3); overflow-wrap: anywhere; }
.wb-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.wb-actions .btn { padding: 5px 10px; }
.wb-scroll { flex: 1; min-height: 0; overflow-y: auto; }
.wb-thread { max-width: 820px; margin: 0 auto; padding: 22px 24px 12px; display: grid; gap: 10px; align-content: start; }
.wb-dock { padding: 0 24px 18px; }
.wb-dock > div { max-width: 820px; margin: 0 auto; }

.avatar .icon { width: 15px; height: 15px; }
.avatar.you { font-size: 10px; font-weight: 600; color: var(--ink-2); background: var(--line); }
.avatar.large { width: 44px; height: 44px; border-radius: 11px; margin: 0 auto 12px; }
.avatar.large .icon { width: 22px; height: 22px; }
.wb-empty { padding: 12vh 12px 24px; text-align: center; }
.wb-empty h2 { margin: 0 0 6px; font-size: 17px; font-weight: 600; }
.wb-empty p { margin: 0 auto; max-width: 52ch; }

.conversation-transcript { border: 0; background: transparent; max-height: none; overflow: visible; border-radius: 0; }
.conversation-transcript.expanded { max-height: none; }
.wb-turn, #conversationMessages { display: grid; gap: 14px; }
#conversationMessages:not(:empty) { margin-bottom: 14px; }
.wb-msg { display: flex; gap: 12px; align-items: flex-start; min-width: 0; }
.wb-msg .bubble { flex: 1; min-width: 0; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); }
.wb-msg.me .bubble { background: var(--blue-soft); border-color: transparent; }
.wb-msg.me .conversation-task { margin: 0; }
.inference-response.bubble { margin: 0; padding: 12px 14px; border-left: 1px solid var(--line); }
.wb-progress { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 6px; font-size: 12px; }
.wb-progress .help { font-size: 12px; color: var(--ink-3); }
.conversation-message { padding: 0; border: 0; }
#expandConversation { justify-self: start; margin: 0; }
.wb-thread:has(#conversationMessages:empty) #expandConversation { display: none; }
.conversation-transcript:not(.expanded) #conversationMessages { max-height: 38vh; overflow-y: auto; }
.run-activity, .execution-details { margin: 6px 0; }
.execution-details { padding-top: 12px; }
.execution-details > summary { font-size: 14px; }

.inference-composer {
  position: relative; margin: 0; padding: 10px 12px 8px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l); box-shadow: var(--shadow);
}
.inference-composer #inferenceTask { border: 0; box-shadow: none; padding: 4px 2px; resize: none; min-height: 48px; background: transparent; }
.inference-composer #inferenceTask:focus { box-shadow: none; }
.inference-composer:focus-within { border-color: var(--line-strong); }
.composer-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
.composer-bar #inferenceSend { margin-left: 0; }
.composer-keys { margin-left: auto; white-space: nowrap; }
.composer-pop > summary { list-style: none; color: var(--ink-2); font-weight: 400; }
.composer-pop > summary::-webkit-details-marker { display: none; }
.composer-pop[open] > summary { background: var(--sunken); color: var(--ink); }
.composer-pop-body {
  position: absolute; left: 8px; right: 8px; bottom: calc(100% + 6px); z-index: 10;
  display: grid; gap: 0 14px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  padding: 14px 14px 4px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); box-shadow: var(--shadow);
}
.composer-pop-body > .help { grid-column: 1 / -1; margin: 0 0 10px; }
.composer-files { display: flex; align-items: center; gap: 6px; padding: 2px 2px 6px; color: var(--ink-2); }
.composer-foot { display: flex; flex-wrap: wrap; gap: 2px 8px; margin: 6px 2px 0; font-size: 12px; }
.composer-foot .help { font-size: 12px; color: var(--ink-3); }
.composer-foot .help:empty { display: none; }
.composer-locked { margin: 0; text-align: center; }

.wb-side { min-height: 0; overflow-y: auto; padding-bottom: 24px; background: var(--surface); border-left: 1px solid var(--line); }
.wb-side-title { display: flex; align-items: baseline; gap: 8px; margin: 18px 18px 8px; font-size: 12px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-3); }
.wb-side-title .count { margin-left: 0; }
.wb-facts { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px 14px; margin: 0; padding: 0 18px; font-size: 13px; }
.wb-facts dt { color: var(--ink-3); }
.wb-facts dd { margin: 0; overflow-wrap: anywhere; }
.wb-run-id { margin: 8px 18px 0; font-size: 12px; overflow-wrap: anywhere; }
.wb-facts .err { color: var(--bad); }
.wb-connection { margin: 4px 18px 0; font-size: 12px; color: var(--ink-3); overflow-wrap: anywhere; }
.wb-connection.alert { padding: 8px 10px; color: var(--ink); background: var(--sunken); border-left: 3px solid var(--bad); border-radius: var(--radius-s); }
.wb-connection .btn { margin-top: 6px; }
/* centre copy of the trace alert: only where the run panel stacks below the composer */
.wb-trace-alert { margin: 8px 0 0; }
@media (min-width: 1181px) { .wb-trace-alert { display: none; } }
/* What happened, compact for the run panel */
.wb-more .run-activity { margin: 8px 0 0; }
.wb-more .activity-list { margin: 8px 0 12px; }
.wb-more .activity-action { grid-template-columns: 22px minmax(0, 1fr) auto; gap: 8px; padding: 9px 4px; }
.wb-more .activity-number { width: 22px; height: 22px; font-size: 11px; }
.wb-more .activity-open { display: none; }
.wb-more .activity-body { gap: 2px; }
.wb-more .activity-status small { margin-top: 2px; }
.wb-more .activity-outcome { gap: 4px; padding: 10px 12px; }
.wb-more .activity-outcome span { font-size: 13px; }
#activityCount { font-weight: 400; }
.wb-more { margin: 12px 18px 0; padding-top: 10px; border-top: 1px solid var(--line-2); font-size: 13px; }
.wb-more > summary { cursor: pointer; font-weight: 500; color: var(--ink-2); }
.wb-more .execution-facts { grid-template-columns: max-content minmax(0, 1fr); font-size: 12.5px; }
.wb-more .monitor-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 12px 0; }
.wb-more .monitor-metrics > div { padding: 10px; border-radius: var(--radius-m); }
.wb-more .monitor-metrics strong { font-size: 15px; }
.wb-more .context-measurement { margin: 12px 0; padding: 12px; }
.wb-more .context-measurement h2 { font-size: 14px; }
.wb-history { list-style: none; margin: 0; padding: 0; }
.wb-run { display: grid; gap: 2px; padding: 9px 18px; color: inherit; text-decoration: none; border-bottom: 1px solid var(--line-2); }
.wb-run:hover { background: var(--paper); }
.wb-run[aria-current="page"] { background: var(--blue-soft); box-shadow: inset 2px 0 0 var(--blue); }
.wb-run-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.wb-run-top .help { font-size: 12px; color: var(--ink-3); }
.wb-run-task { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.wb-history .empty-note { padding: 8px 18px; }
.wb-all-runs { padding: 10px 18px; font-size: 13px; }

@media (max-width: 1180px) {
  .stage:has(> .workbench) { overflow: visible; }
  .workbench { grid-template-columns: minmax(0, 1fr); height: auto; }
  .wb-scroll { overflow: visible; }
  .wb-side { border-left: 0; border-top: 1px solid var(--line); }
}
@media (max-width: 760px) {
  .wb-head { padding: 10px 14px; }
  .wb-thread { padding: 14px 14px 8px; }
  .wb-dock { padding: 0 14px 14px; }
  .wb-msg { gap: 8px; }
  .wb-msg > .avatar { display: none; }
  .composer-keys { display: none; }
  .composer-bar #inferenceSend { margin-left: auto; }
  .wb-empty { padding-top: 6vh; }
}
#monitorWhere > h3:first-child { display: none; }

/* --- calm page headers everywhere (runs, providers, documentation, skills, editors) ---- */

.studio-page { padding: 28px clamp(18px, 3vw, 40px) 64px; max-width: 1180px; margin: 0; }
.studio-header { align-items: flex-start; gap: 12px 16px; margin-bottom: 22px; }
.studio-header .eyebrow, .run-monitor .eyebrow { display: none; }
.studio-header h1, .run-monitor .studio-header h1 { margin: 0 0 4px; font-size: 22px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.3; }
.studio-header .lead { font-size: 14px; max-width: 70ch; }
.section-heading h2 { font-size: 15px; letter-spacing: 0; }
.stage-head { padding: 18px 32px 0; background: var(--surface); backdrop-filter: none; }
.stage-head .breadcrumb { margin-bottom: 8px; }
input.title-input, .title-static { font-size: 20px; }
.subtabs button[aria-selected="true"] { border-bottom-color: var(--blue); }
.panel { padding: 8px 32px 72px; }
.group { border-top-color: var(--line-2); }
.provider-grid { gap: 16px; }
.provider-card { padding: 20px; border-radius: var(--radius-m); }
.provider-card h2 { font-size: 16px; letter-spacing: 0; margin-bottom: 8px; }
.provider-card .starter-icon { width: 28px; height: 28px; margin-bottom: 0; }
.tablewrap { border-radius: var(--radius-m); }
.table th { font-size: 12px; color: var(--ink-3); background: #fcfcfb; }
.table td { border-top-color: var(--line-2); }
.run-table td { padding: 11px 12px; }
.history-filters { margin: 0 0 16px; }
.docs-nav { gap: 4px; padding-bottom: 16px; margin-bottom: 22px; }
.docs-nav a { padding: 4px 10px; border-radius: var(--radius-s); background: transparent; color: var(--ink-2); text-decoration: none; }
.docs-nav a:hover { background: var(--line); color: var(--ink); }
.docs-nav a[aria-current=page] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); font-weight: 500; }
.docs-article { font-size: 14px; }
.empty { padding: 56px 32px; }
.monitor-metrics > div, .monitor-detail, .monitor-step, .conversation-node, .context-measurement, .activity-outcome { border-radius: var(--radius-m); }
.toast { border-radius: var(--radius-m); }
.gate-card { border-radius: var(--radius-l); box-shadow: var(--shadow); }
.gate-card .brand-mark { width: 36px; height: 36px; margin-bottom: 8px; }
.playground-empty .avatar { margin: 0 auto; }
.console-head { padding: 14px 18px; }
@media (prefers-color-scheme: dark) { .table th { background: var(--sunken); } }
@media (max-width: 760px) {
  .studio-page, .page { padding: 18px 14px 48px; }
  .stage-head { padding: 14px 16px 0; }
  .panel { padding: 8px 16px 56px; }
}

/* organization and project (tenancy.js) */
.org-bar { display: grid; gap: 6px; margin: 0 0 12px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; }
.org-name { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.org-project select { width: 100%; padding: 4px 8px; font-size: 13px; }
.checks { display: grid; gap: 6px; margin-bottom: 12px; }
.tablewrap + form { margin-top: 14px; }
