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

:root {
  --paper: #f3f4f7;
  --surface: #ffffff;
  --sunken: #ebedf1;
  --ink: #15181d;
  --ink-2: #596170;
  --ink-3: #868d99;
  --line: #dde1e7;
  --line-strong: #c5cbd4;
  --blue: #1d4ed8;
  --blue-ink: #ffffff;
  --blue-soft: #e4ebfd;
  --signal: #9a6400;
  --signal-soft: #fcefd2;
  --ok: #1d7249;
  --ok-soft: #dff2e7;
  --bad: #b3261e;
  --bad-soft: #fbe3e1;
  --radius-s: 6px;
  --radius-m: 10px;
  --sans: ui-sans-serif, -apple-system, "SF Pro Text", "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: #0f1217;
    --surface: #161a21;
    --sunken: #1d222b;
    --ink: #e6e9ef;
    --ink-2: #9ba3b1;
    --ink-3: #6f7784;
    --line: #262c36;
    --line-strong: #353c48;
    --blue: #7c9dff;
    --blue-ink: #0f1217;
    --blue-soft: #1b2540;
    --signal: #f0bd52;
    --signal-soft: #2e2615;
    --ok: #62c793;
    --ok-soft: #15291f;
    --bad: #ff8a7d;
    --bad-soft: #33191a;
    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;
}

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

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

.rail {
  display: flex; flex-direction: column; gap: 12px;
  padding: 16px 12px; min-height: 0;
  background: var(--surface); 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;
  background: var(--surface); border-left: 1px solid var(--line);
}

@media (max-width: 1180px) {
  .app, .app.no-console { grid-template-columns: 232px 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; border-right: 0; border-bottom: 1px solid var(--line); }
  .entries { max-height: 220px; }
  .console { grid-column: 1; }
}

/* --- rail ----------------------------------------------------------------------------- */

.brand { display: flex; gap: 10px; align-items: center; padding: 0 6px 4px; }
.brand strong { display: block; font-size: 15px; letter-spacing: -0.01em; }
.brand span { display: block; font-size: 12px; color: var(--ink-2); }
.mark { width: 26px; height: 26px; flex-shrink: 0; fill: var(--blue); stroke: var(--blue-ink); stroke-width: 2; stroke-linecap: round; }

.sections { display: grid; gap: 1px; }
.sections a {
  display: flex; justify-content: space-between; align-items: center;
  padding: 7px 10px; border-radius: var(--radius-s);
  color: var(--ink); text-decoration: none; font-weight: 500;
}
.sections a:hover { background: var(--sunken); }
.sections a[aria-current="page"] { background: var(--blue-soft); color: var(--blue); }
.count { font-size: 12px; font-weight: 400; color: var(--ink-3); }
.sections a[aria-current="page"] .count { color: inherit; }

.rail-tools { display: flex; gap: 6px; padding-top: 12px; border-top: 1px solid var(--line); }
.entries {
  list-style: none; margin: 0; padding: 0;
  flex: 1; min-height: 60px; 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: 7px 10px; border-radius: var(--radius-s); cursor: pointer;
}
.entries button:hover { background: var(--sunken); }
.entries button[aria-current="true"] { background: var(--sunken); box-shadow: inset 2px 0 0 var(--blue); }
.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: 8px 10px; font-size: 13px; color: var(--ink-2); }

.rail-foot { display: grid; gap: 6px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 12px; color: var(--ink-2); }

/* --- 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: 6px; padding: 1px 9px 1px 7px;
  font-size: 12.5px; font-weight: 500; white-space: nowrap;
  color: var(--ink-2); background: var(--sunken); border-radius: 999px;
}
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status.queued, .status.running { color: var(--signal); background: var(--signal-soft); }
.status.running::before { animation: pulse 1.2s ease-in-out infinite; }
.status.succeeded { 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); }

.me { display: grid; font-size: 13px; color: var(--ink); }
.me span { font-size: 12px; color: var(--ink-2); }
.rail-foot .inline { gap: 4px 10px; }
.rail-foot .push { margin-left: auto; }

.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); }

/* Studio: a calm library, focused editor, and visible execution workspace. */
:root {
  --paper: #f6f7f5;
  --sunken: #eef1ed;
  --ink: #202c28;
  --ink-2: #5e6b65;
  --ink-3: #748078;
  --line: #dfe5df;
  --line-strong: #c7d1c8;
  --blue: #24634b;
  --blue-soft: #e5efe6;
  --radius-m: 12px;
}
@media (prefers-color-scheme: dark) {
  :root { --paper: #131a17; --surface: #1b2420; --sunken: #242e28; --ink: #e9efe9; --ink-2: #a8b7ae; --ink-3: #91a098; --line: #303d34; --line-strong: #48594c; --blue: #a7d7b5; --blue-soft: #2a3d30; --blue-ink: #132419; }
}
.brand { padding: 10px 8px 22px; }
.brand strong { font-size: 18px; letter-spacing: -.6px; }
.brand .mark { width: 34px; height: 34px; }
.brand span { margin-top: 3px; }
.sections { gap: 5px; }
.sections a { padding: 9px 12px; }
.rail { padding: 16px; background: var(--paper); }
.rail-tools input { width: 0; flex: 1; }
.rail-foot { margin-top: auto; }
.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; }
.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 (min-width: 1181px) { .app { grid-template-columns: 230px minmax(0, 1fr) minmax(340px, 390px); } .app.no-console { grid-template-columns: 230px minmax(0, 1fr); } }
@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; } .brand { padding-bottom: 12px; } .sections { grid-template-columns: repeat(2, minmax(0, 1fr)); } .rail-foot .me { display: none; } .rail-tools { padding-top: 8px; } .entries { max-height: 100px; min-height: 0; } .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; }
.mobile-menu, .jump-playground { display: none; }
@media (max-width: 1180px) { .jump-playground { display: inline-flex; } }
@media (max-width: 760px) {
  .mobile-menu { display: inline-flex; margin-left: auto; }
  .rail { gap: 0; padding: 12px 16px; }
  .brand { padding: 4px 0; }
  .rail:not(.nav-open) .sections, .rail:not(.nav-open) .rail-tools,
  .rail:not(.nav-open) .entries, .rail:not(.nav-open) .rail-foot { display: none; }
  .rail.nav-open { gap: 12px; }
}

.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; } }
.conversation-call-nodes { display: flex; flex-wrap: wrap; gap: 16px; }
.conversation-call-nodes button { cursor: pointer; text-align: left; flex: 1 1 180px; }

/* 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; }
