/* Studio (SPEC §9) — reuses the chat look (tlist / conv / msgs / composer); only Studio-specific bits live here. */
.sb-nav { padding: 0 8px 4px; }
.sb-link { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 9px; color: var(--sb-ink); text-decoration: none; font-weight: 600; border: 1px solid transparent; }
.sb-link svg { width: 16px; height: 16px; color: var(--mint); }
.sb-link:hover { background: var(--sb-2); }
.sb-link.on { background: var(--sb-3); border-color: var(--sb-line); }

.studio-page { padding-top: 14px; }
.studio { display: grid; grid-template-columns: 320px 1fr; background: var(--card); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; height: calc(100vh - 96px); min-height: 520px; width: 100%; box-shadow: var(--sh); }
.st-list .tlist-head h2 { font-size: 16px; }
.st-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #cbd5e1; margin-inline-end: 5px; vertical-align: 1px; }
.st-dot.on { background: #22c55e; box-shadow: 0 0 0 3px #dcfce7; }
.st-starters { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 12px 4px; }
.st-starters label.qchip { display: inline-flex; align-items: center; gap: 4px; }
.st-msgs .msg { max-width: 980px; }
.st-sys { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.st-sys .msg-sys { white-space: normal; text-align: start; }

/* change cards */
.st-card { align-self: stretch; max-width: 980px; border: 1px solid var(--line); border-inline-start: 4px solid var(--amber); border-radius: 12px; background: #fff; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; box-shadow: var(--sh); }
.st-card.s-applied, .st-card.s-deployed { border-inline-start-color: var(--green); }
.st-card.s-rejected, .st-card.s-rolled_back { border-inline-start-color: #94a3b8; opacity: .92; }
.st-card.s-failed, .st-card.s-checks_failed, .st-card.s-deploy_failed { border-inline-start-color: var(--red); }
.st-card.s-checking, .st-card.s-deploying, .st-card.s-rolling_back, .st-card.s-approved { border-inline-start-color: var(--blue); }
.st-card > header { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.st-card-kind { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.st-card-sum { margin: 0; font-weight: 600; }
.st-card > footer { display: flex; gap: 8px; flex-wrap: wrap; border-top: 1px solid var(--line-2); padding-top: 8px; }
.st-agent { display: flex; gap: 14px; align-items: flex-start; }
.st-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 18px; margin: 0; flex: 1; min-width: 0; }
.st-fields > div { min-width: 0; }
.st-fields dt { font-size: 11.5px; color: var(--muted); font-weight: 600; }
.st-fields dd { margin: 0; font-size: 13.5px; overflow-wrap: anywhere; }
.st-verb { display: inline-block; background: var(--accent-soft); color: var(--accent-ink); border-radius: 5px; padding: 0 5px; margin: 1px 3px 1px 0; font-size: 12px; }
.st-json, .st-diff pre { background: #0f172a; color: #e2e8f0; border-radius: 8px; padding: 8px 10px; font-size: 12px; overflow: auto; max-height: 260px; margin: 4px 0 0; white-space: pre; text-align: left; }
.st-diff summary { cursor: pointer; font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.st-tests { margin: 0; display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; }
.st-tests svg { width: 15px; height: 15px; }
.st-tests.ok { color: var(--green); } .st-tests.bad { color: var(--red); }
.st-shots { display: flex; flex-wrap: wrap; gap: 8px; }
.st-shots a { display: block; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #f8faf9; }
.st-shots img { display: block; width: 300px; max-width: 100%; height: auto; }
.msg .st-shots img { width: 220px; }
.st-thumb { width: 22px; height: 22px; object-fit: cover; border-radius: 4px; }

/* live run */
.st-runbar { gap: 6px; max-height: 40vh; overflow: auto; }
.st-run { display: flex; flex-direction: column; gap: 4px; }
.st-run .runrow { flex-wrap: wrap; }
.st-step { flex: 1; min-width: 0; font-family: ui-monospace, monospace; font-size: 12px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-files { display: flex; flex-wrap: wrap; gap: 4px; }
.st-files code { font-size: 11.5px; background: #fff; border: 1px solid var(--line); border-radius: 5px; padding: 0 5px; }
.st-steps summary { cursor: pointer; font-size: 12px; color: var(--muted); }
.st-steps ol { margin: 4px 0 0; padding-inline-start: 18px; font-size: 12px; font-family: ui-monospace, monospace; color: var(--ink-2); text-align: left; }
.st-steps time { color: var(--muted); }
.st-drop { outline: 2px dashed var(--accent); outline-offset: -6px; }

@media (max-width: 760px) {
  .studio { grid-template-columns: 1fr; height: calc(100vh - 80px); }
  .studio .st-list { display: flex; } .studio .conv { display: none; }
  .studio.show-conv .st-list { display: none; } .studio.show-conv .conv { display: flex; }
  .studio .conv-back { display: inline-flex; }
  .st-fields { grid-template-columns: 1fr; }
  .st-agent { flex-direction: column; }
}

/* The sessions list (tlist/threads/thread/t-*) used to live in styles.css; the side-tabs shell moved the chat's session list
   into the sidebar and dropped those rules, so Studio carries its own copy. */
.tlist { border-inline-end: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; background: #fbfcfb; min-width: 0; }
.tlist-head { display: flex; justify-content: space-between; align-items: center; padding: 12px; border-bottom: 1px solid var(--line); gap: 8px; }
.tlist-body { overflow-y: auto; flex: 1; }
.threads { list-style: none; margin: 0; padding: 6px; }
.thread { display: flex; gap: 10px; padding: 10px; border-radius: 10px; text-decoration: none; color: var(--ink); }
.thread:hover { background: var(--hover); }
.thread.on { background: var(--accent-soft); }
.t-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.t-row { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.t-title { font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.t-time { font-size: 11.5px; color: var(--muted); flex: none; }
.t-last { font-size: 12.5px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.t-last b { color: var(--ink-2); font-weight: 600; }
.t-working { color: var(--blue); }
