/* Strata web app - layout on top of tokens.css + components.css (the Strata UI kit). Colours, type, radii and
   shadows come only from the kit's tokens. */
[hidden] { display: none !important; }
html, body { height: 100%; }
body { display: flex; flex-direction: column; overflow: hidden; }
main { flex: 1; min-height: 0; display: flex; }
.view { flex: 1; min-height: 0; min-width: 0; display: flex; flex-direction: column; }
.view[hidden] { display: none; }
.muted { color: var(--st-ink-muted); }
.small { font-size: var(--st-fs-xs); }
.card-title { font-weight: var(--st-fw-bold); font-size: var(--st-fs-base); color: var(--st-ink); }
.st-header { position: relative; z-index: 2; flex: none; }
.st-header .st-tabs { margin-left: var(--st-s-4); }

/* ---------------------------------------------------------------- chat */
.chat-scroll { flex: 1; min-height: 0; overflow-y: auto; }
.chat { max-width: none; margin: 0; padding: var(--st-s-8) var(--st-s-6) var(--st-s-6); display: flex;
        flex-direction: column; gap: calc(var(--st-s-6) / 2); }
.chat-empty { margin: 12vh auto 0; text-align: center; }
.chat-empty__title { font-weight: var(--st-fw-black); font-size: var(--st-fs-display); line-height: var(--st-lh-tight);
                     letter-spacing: -.02em; }
.chat-empty__sub { margin-top: var(--st-s-3); color: var(--st-ink-muted); }
.st-msg { width: 95%; max-width: none; min-width: 0; }
.st-msg--assistant { align-self: flex-start; }
.st-msg .st-bubble { width: 100%; min-width: 0; }
.st-msg--user .st-bubble { white-space: pre-wrap; overflow-wrap: anywhere; }
.st-bubble > :first-child { margin-top: 0; }
.st-bubble > :last-child { margin-bottom: 0; }
.st-bubble p, .st-bubble ul, .st-bubble ol { margin: 0 0 var(--st-s-3); }
.st-bubble ul, .st-bubble ol { padding-left: var(--st-s-6); }
.st-bubble li + li { margin-top: var(--st-s-1); }
.st-bubble h3 { font-size: var(--st-fs-lg); margin: var(--st-s-4) 0 var(--st-s-2); color: var(--st-ink); }
.st-bubble h4 { font-size: var(--st-fs-base); margin: var(--st-s-3) 0 var(--st-s-2); color: var(--st-ink); }
.st-bubble code.inline { font: 400 .9em var(--st-font-mono); background: var(--st-surface-2); border: 1px solid var(--st-line-soft);
                         border-radius: 6px; padding: 1px 5px; }
.st-bubble .st-code { margin: var(--st-s-3) 0; }
.st-bubble blockquote { margin: 0 0 var(--st-s-3); padding-left: var(--st-s-3); border-left: 3px solid var(--st-line);
                        color: var(--st-ink-muted); }
.st-bubble hr { border: 0; border-top: 1px solid var(--st-line); margin: var(--st-s-4) 0; }
.st-bubble table { border-collapse: collapse; margin: 0 0 var(--st-s-3); font-size: var(--st-fs-md); }
.st-bubble th, .st-bubble td { border: 1px solid var(--st-line); padding: 6px 10px; text-align: left; }
.msg-images { display: flex; flex-wrap: wrap; gap: var(--st-s-2); justify-content: flex-end; }
.msg-images img { max-width: 220px; max-height: 180px; border-radius: var(--st-r-md); border: 1px solid var(--st-line); }
.st-msg .st-collapse { width: 100%; }
.st-collapse__body.thinking { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 420px; overflow-y: auto; }
.st-msg__meta .st-btn--icon { width: 28px; height: 28px; }
.st-msg__meta .st-btn--icon .st-icon { width: 16px; height: 16px; }
.cursor::after { content: ""; display: inline-block; width: 8px; height: 1.1em; margin-left: 2px; vertical-align: -3px;
                 border-radius: 2px; background: var(--st-accent); animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.msg-error { color: var(--st-danger-text); background: var(--st-danger-tint); border-radius: var(--st-r-md); padding: 10px 14px;
             font-size: var(--st-fs-md); }
/* MCP tool calls inside an answer: one compact collapsible block per call */
.st-bubble .tool-call { margin: var(--st-s-3) 0; }
.tool-call > summary { min-width: 0; padding: 8px 12px; overflow: hidden; }
.tool-call__name { font: 500 var(--st-fs-sm)/1.2 var(--st-font-mono); color: var(--st-ink); white-space: nowrap;
                   min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.tool-call__preview { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--st-fs-xs); }
.tool-call .st-badge, .tool-call summary .small { flex: none; }
.tool-call[data-state="error"] { border-color: color-mix(in srgb, var(--st-danger) 35%, var(--st-line)); }
.tool-call[data-state="running"] .st-badge::before, .tool-call[data-state="writing"] .st-badge::before { animation: blink 1s steps(2) infinite; }
.tool-call__label { font-size: var(--st-fs-xs); font-weight: var(--st-fw-medium); color: var(--st-ink-muted); margin: var(--st-s-2) 0 var(--st-s-1); }
.tool-call__pre { margin: 0; padding: 10px 12px; max-height: 320px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere;
                  font: 400 12.5px/1.5 var(--st-font-mono); color: var(--st-ink-soft); background: var(--st-surface);
                  border: 1px solid var(--st-line-soft); border-radius: var(--st-r-sm); }

.composer-wrap { flex: none; padding: 0 var(--st-s-6) var(--st-s-6); }
.st-composer { width: 100%; max-width: none; margin: 0; }
.st-composer textarea { max-height: 40vh; }
.st-btn--send { width: 42px; padding: 0; }
.composer-hint { font-size: var(--st-fs-xs); color: var(--st-ink-muted); margin-right: var(--st-s-2); font-variant-numeric: tabular-nums; }
.attachments { display: flex; flex-wrap: wrap; gap: var(--st-s-2); padding: 2px 4px 0; }
.st-composer.dragging { outline: 2px dashed var(--st-accent); outline-offset: 3px; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 6px 0 10px; border-radius: var(--st-r-pill);
        background: var(--st-surface-2); border: 1px solid var(--st-line); font-size: var(--st-fs-xs); color: var(--st-ink-soft); }
.chip .st-btn--icon { width: 22px; height: 22px; border-radius: 50%; }
.chip .st-btn--icon .st-icon { width: 14px; height: 14px; }

/* ---------------------------------------------------------------- monitor */
.view--about { overflow-y: auto; }
.view--monitor { flex-direction: row; overflow: hidden; }
.monitor-main { flex: 1; min-width: 0; min-height: 0; overflow-y: auto; }
.monitor, .about { max-width: 1240px; width: 100%; margin: 0 auto; padding: var(--st-s-6); display: flex; flex-direction: column;
                   gap: var(--st-s-5); }
.state-card { display: flex; flex-direction: column; gap: var(--st-s-3); }
.state-card__head { display: flex; align-items: center; gap: var(--st-s-4); flex-wrap: wrap; }
.badges { display: flex; gap: var(--st-s-2); flex-wrap: wrap; }
.badges .st-badge { opacity: .38; transition: opacity var(--st-dur); }
.badges .st-badge.on { opacity: 1; }
.state-card__row { display: flex; justify-content: space-between; gap: var(--st-s-4); font-size: var(--st-fs-sm);
                   font-weight: var(--st-fw-medium); font-variant-numeric: tabular-nums; }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--st-s-4); }
.metric-card { padding: var(--st-s-4) var(--st-s-5); min-height: 280px; height: 280px; display: flex; }
.st-metric__value small { font-size: var(--st-fs-md); font-weight: var(--st-fw-medium); color: var(--st-ink-muted); margin-left: 4px; }
.st-metric__sub { font-size: var(--st-fs-xs); color: var(--st-ink-muted); font-variant-numeric: tabular-nums; min-height: 1em; }
.st-metric__spark { display: block; overflow: visible; }
.st-metric__spark[data-tone="warn"] { color: var(--st-warn); }
.st-metric__spark[data-tone="info"] { color: var(--st-info); }
.monitor-row { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--st-s-4); }
.ctx-card { display: flex; flex-direction: column; gap: var(--st-s-2); }
.ctx-gauge { position: relative; width: 150px; height: 150px; margin: var(--st-s-2) auto var(--st-s-3); }
.ctx-gauge .st-gauge { width: 150px; height: 150px; }
.ctx-gauge .st-gauge__fill { transition: stroke-dasharray 400ms var(--st-ease); }
.ctx-gauge__label { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
                    font-size: var(--st-fs-xs); }
.ctx-gauge__pct { font-weight: var(--st-fw-black); font-size: var(--st-fs-xl); line-height: 1.1; font-variant-numeric: tabular-nums; }
.bar-row { display: flex; justify-content: space-between; font-size: var(--st-fs-sm); font-weight: var(--st-fw-medium);
           margin-top: var(--st-s-2); font-variant-numeric: tabular-nums; }
.req-card { display: flex; flex-direction: column; gap: var(--st-s-3); min-width: 0; }
.table-wrap { overflow-x: auto; }
/* Recent requests: keep headings, values and status badges on one line. */
#req-wrap .st-table th,
#req-wrap .st-table td {
  white-space: nowrap;
  padding-inline: 8px;
}
.req-head { display: flex; align-items: center; justify-content: space-between; gap: var(--st-s-2); }
.table-wrap.all { max-height: 420px; overflow-y: auto; }
.req-totals { margin: 0; font-size: var(--st-fs-sm); }
.req-totals:empty { display: none; }
.cc-card { display: flex; flex-direction: column; gap: var(--st-s-3); }
.cc-bars { display: grid; grid-template-columns: 1fr 1fr; gap: var(--st-s-2) var(--st-s-6); }
.cc-bars[hidden] { display: none; }
.cc-note { margin: 0; }
.cc-note:empty { display: none; }
.mcp-card { display: flex; flex-direction: column; gap: var(--st-s-3); }
.cfg-card { min-width: 0; }
.cfg-form { display: grid; grid-template-columns: minmax(0, 1fr) minmax(220px, 360px); gap: var(--st-s-3) var(--st-s-4);
            align-items: center; }
.cfg-form label { min-width: 0; overflow-wrap: anywhere; font-size: var(--st-fs-sm); font-weight: var(--st-fw-medium); }
.cfg-form label code { font: 400 12px var(--st-font-mono); color: var(--st-ink-muted); display: block; }
.cfg-form .st-input { height: 38px; width: 100%; min-width: 0; max-width: 100%; }
.cfg-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--st-s-3); }
.mcp-server { display: flex; flex-direction: column; gap: var(--st-s-2); padding-top: var(--st-s-3); border-top: 1px solid var(--st-line-soft); }
.mcp-server:first-child { padding-top: 0; border-top: 0; }
.mcp-server__head { display: flex; align-items: center; gap: var(--st-s-2); flex-wrap: wrap; font-size: var(--st-fs-sm); }
.mcp-server__tools { display: flex; flex-wrap: wrap; gap: 6px; }
.mcp-server__tools .chip { height: 26px; padding: 0 10px; font-family: var(--st-font-mono); }
.mcp-note { margin: 0; }

/* ---------------------------------------------------------------- about */
.about { max-width: 860px; }
.about .st-card { display: flex; flex-direction: column; gap: var(--st-s-3); }
.about p { margin: 0; }
.facts { display: grid; grid-template-columns: minmax(140px, max-content) 1fr; gap: 10px var(--st-s-6); margin: 0; font-size: var(--st-fs-md); }
.facts dt { color: var(--st-ink-muted); }
.facts dd { margin: 0; color: var(--st-ink-soft); font-variant-numeric: tabular-nums; display: flex; align-items: center; gap: 6px;
            overflow-wrap: anywhere; }
.facts dd code { font: 400 13px var(--st-font-mono); }
.facts .st-btn--icon { width: 28px; height: 28px; }
.facts .st-btn--icon .st-icon { width: 16px; height: 16px; }
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: var(--st-s-4); font-size: var(--st-fs-sm);
              font-weight: var(--st-fw-medium); color: var(--st-ink-soft); }
.toggle-row .st-toggle { flex: none; }   /* a long label must not squeeze the switch */

/* ---------------------------------------------------------------- drawer */
.st-drawer { z-index: 40; }
.scrim { position: fixed; inset: 0; background: rgba(15, 23, 42, .18); z-index: 39; }
.seg { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; padding: 4px; background: var(--st-surface-2);
       border: 1px solid var(--st-line); border-radius: var(--st-r-md); }
.seg button { height: 32px; border: 0; border-radius: 10px; background: transparent; color: var(--st-ink-muted);
              font: 500 var(--st-fs-sm)/1 var(--st-font); cursor: pointer; }
.seg button[aria-checked="true"] { background: var(--st-surface); color: var(--st-ink); font-weight: var(--st-fw-bold);
                                   box-shadow: var(--st-sh-card); }
.drawer-actions { display: grid; grid-template-columns: 1fr 1fr; gap: var(--st-s-3); margin-top: var(--st-s-2); }
.st-toast { animation: toast-in 180ms var(--st-ease); }
@keyframes toast-in { from { opacity: 0; transform: translateY(6px); } }

/* ---------------------------------------------------------------- narrow screens */
@media (max-width: 1000px) {
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .monitor-row { grid-template-columns: 1fr; }
  .cc-bars { grid-template-columns: 1fr; }
  .cfg-form { grid-template-columns: 1fr; gap: 4px; }
  .cfg-form .st-input { margin-bottom: var(--st-s-2); }
}
@media (max-width: 640px) {
  .st-header { padding: 0 var(--st-s-3); gap: var(--st-s-2); }
  .st-header .st-tabs { margin-left: 0; }
  .st-tab { padding: 0 10px; }
  .st-tab .st-icon { display: none; }
  #pill-text { display: none; }
  .chat { padding: var(--st-s-5) var(--st-s-3); }
  .composer-wrap { padding: 0 var(--st-s-3) var(--st-s-3); }
  .monitor, .about { padding: var(--st-s-4); }
  .facts { grid-template-columns: 1fr; gap: 2px; }
  .facts dd { margin-bottom: var(--st-s-2); }
}
/* Images tab (POST /v1/images/generations) */
.img-form{display:flex;flex-direction:column;gap:12px}
.img-prompt{height:auto;padding:10px 14px;resize:vertical}
.img-row{display:flex;gap:12px;align-items:flex-end;flex-wrap:wrap}
.img-results{display:flex;flex-direction:column;gap:12px}
.img-results figure{margin:0}
.img-results img{max-width:100%;border-radius:var(--st-r-lg);display:block}
.img-results figcaption{font-size:var(--st-fs-sm, 13px);color:var(--st-ink-2, inherit);margin-top:4px}

/* Keep the allocation breakdown readable without changing the other metric cards. */
.metric-card--wide { grid-column: span 2; }
.metric-card--wide .st-metric__spark { height: 90px; }
.vram-legend { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: var(--st-fs-xs); }
.vram-series--total { color: var(--st-accent); }
.vram-series--experts { color: var(--st-info); }
.vram-series--kv { color: var(--st-warn); }
.vram-series--other { color: #b695e8; }
.vram-series--experts { stroke-dasharray: 5 2; }
.vram-series--kv { stroke-dasharray: 2 2; }
.vram-series--other { stroke-dasharray: 7 2 2 2; }

.pcie-series--total { color: var(--st-accent); }
.pcie-series--to { color: var(--st-info); stroke-dasharray: 5 2; }
.pcie-series--from { color: var(--st-warn); stroke-dasharray: 2 2; }

.metric-chart-frame { position: relative; }
.metric-chart-axis { height: 90px; position: absolute; inset: 0; pointer-events: none; z-index: 1; color: var(--st-ink-soft); font-size: var(--st-fs-xs); font-variant-numeric: tabular-nums; }
.metric-chart-axis span { position: absolute; left: 0; transform: translateY(-100%); white-space: nowrap; text-shadow: none; background: var(--st-surface); }
.metric-chart-axis span:nth-child(1) { top: 12.5%; }
.metric-chart-axis span:nth-child(2) { top: 53.125%; }
.metric-chart-axis span:nth-child(3) { top: 93.75%; }
.metric-chart-grid { color: #89939c; opacity: .25; stroke-dasharray: 3 3; }
.metric-chart-floor { color: #394249; opacity: 1; }

.metric-chart-frame .st-metric__spark { height: 90px; }

.metric-model { font-size: 10px; font-weight: normal; color: var(--st-muted); }
.metric-card .st-metric__label { flex-wrap: wrap; }

.metric-card > .st-metric { flex: 1; min-width: 0; }
.metric-card:not(.metric-card--wide) .st-metric > .st-metric__spark,
.metric-card:not(.metric-card--wide) .st-metric > .metric-chart-frame { margin-top: auto; }

.disk-chart-frame { position: relative; margin-top: auto; }
.disk-chart-frame .metric-chart-grid { color: var(--st-ink-muted); opacity: 1; stroke-dasharray: none; }
.disk-zero-label { position: absolute; left: 0; bottom: 2px; z-index: 1; font-size: var(--st-fs-xs); color: var(--st-ink-soft); font-variant-numeric: tabular-nums; pointer-events: none; text-shadow: none; background: var(--st-surface); }

.metric-card .disk-chart-frame { flex: 1; min-height: 90px; margin-top: 6px; }
.disk-chart-frame .st-metric__spark { position: absolute; top: 0; left: 0; right: 0; bottom: 20px; height: calc(100% - 20px); }
.disk-chart-frame .disk-zero-label { bottom: 0; line-height: 16px; }
.disk-max-label { position: absolute; left: 0; top: -4px; line-height: 16px; transform: translateY(-100%); z-index: 1; font-size: var(--st-fs-xs); color: var(--st-ink-soft); font-variant-numeric: tabular-nums; pointer-events: none; text-shadow: none; background: var(--st-surface); }

/* Disk write: 10px flex gap + 26px margin - 20px label offset = 16px inset. */
.metric-card .disk-chart-frame { margin-top: 26px; }

.metric-header-checkbox { margin: 0 0 0 auto; width: 14px; height: 14px; flex: 0 0 14px; accent-color: var(--st-accent); cursor: pointer; }

.metric-checkbox-tip { position: relative; display: inline-flex; margin-left: auto; }
.metric-checkbox-tip [role="tooltip"] { position: absolute; right: 0; bottom: calc(100% + 8px); padding: 6px 10px; border: 1px solid var(--st-line); border-radius: var(--st-r-md); background: var(--st-surface-2); color: var(--st-ink); box-shadow: var(--st-sh-card); font-size: var(--st-fs-xs); font-weight: 500; white-space: nowrap; visibility: hidden; opacity: 0; pointer-events: none; z-index: 10; }
.metric-checkbox-tip:hover [role="tooltip"], .metric-checkbox-tip .metric-header-checkbox:focus-visible + [role="tooltip"] { visibility: visible; opacity: 1; }

.disk-smooth-label { transform: translateY(-100%); position: absolute; left: 0; z-index: 1; font-size: var(--st-fs-xs); line-height: 16px; color: var(--st-info-text); pointer-events: none; text-shadow: none; background: var(--st-surface); }
.disk-smooth-peak { color: var(--st-info); opacity: .65; stroke-dasharray: 4 3; }

.disk-smooth-min-label { position: absolute; left: 0; z-index: 1; font-size: var(--st-fs-xs); line-height: 16px; color: var(--st-info-text); pointer-events: none; text-shadow: none; background: var(--st-surface); }

.metric-card { position: relative; }
.chart-hover-tooltip { position: absolute; left: 20px; bottom: 12px; z-index: 5; max-width: calc(100% - 40px); padding: 6px 10px; background: var(--st-surface-2); border: 1px solid var(--st-line); border-radius: var(--st-r-md); color: var(--st-ink); font-size: var(--st-fs-xs); box-shadow: var(--st-sh-card); pointer-events: none; }

.metric-smoothing-select { margin-left: auto; max-width: 155px; min-width: 0; padding: 4px 6px; border: 1px solid var(--st-line); border-radius: var(--st-r-md); background: var(--st-surface-2); color: var(--st-ink); font-family: inherit; font-size: var(--st-fs-xs); cursor: pointer; }
.metric-smoothing-select:hover { border-color: var(--st-line); }
.metric-smoothing-select:focus, .metric-smoothing-select:focus-visible { outline: none; box-shadow: none; border-color: var(--st-line); }

.ctx-card.metric-card .ctx-gauge, .ctx-card.metric-card .ctx-gauge .st-gauge { width: 200px; height: 200px; max-width: 100%; }
.ctx-card.metric-card .ctx-gauge { flex: 0 0 200px; margin: 4px auto; }
.ctx-card.metric-card #kv-allocation { margin: 0; font-size: 11px; line-height: 1.35; }

.ctx-card.metric-card .ctx-gauge { margin: auto; }

.ctx-card.metric-card .ctx-gauge__pct { font-size: 36px; }

.metric-checkbox-tip .metric-smoothing-select:focus-visible + [role="tooltip"] { visibility: visible; opacity: 1; }

.metric-card[draggable="true"] { cursor: grab; }
.metric-card.card-dragging { opacity: .55; cursor: grabbing; }
.metric-card.card-drop-target { box-shadow: inset 0 0 0 2px var(--st-accent); }

.metric-card.card-drop-before::before, .metric-card.card-drop-after::after { content: ""; position: absolute; top: 8px; bottom: 8px; width: 3px; border-radius: 3px; background: var(--st-accent); pointer-events: none; z-index: 8; }
.metric-card.card-drop-before::before { left: -9px; }
.metric-card.card-drop-after::after { right: -9px; }

/* Keep the latest-message shortcut above the composer, outside scrolling content. */
.composer-wrap { position: relative; }
.chat-navigation { position: absolute; z-index: 3; left: 50%; bottom: calc(100% + 12px); transform: translateX(-50%); display: flex; gap: 8px; }
.chat-jump { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--st-line); background: var(--st-bg); color: var(--st-ink); }
.chat-bottom .st-icon { transform: rotate(180deg); }
.chat-jump:not(:disabled):hover { background: var(--st-accent-tint); }

.view--chat { flex-direction: row; }
.conversation-main { display: flex; flex-direction: column; flex: 1; min-width: 0; min-height: 0; }
.conversation-sidebar { background: var(--st-surface); width: var(--conversation-sidebar-width, 345px); flex: none; overflow-y: auto; padding: 16px 10px; border-right: 1px solid var(--st-line); }
.conversation-sidebar > button { width: 100%; margin-bottom: 12px; }
.conversation-row { display: flex; align-items: center; border-radius: var(--st-r-md); margin-bottom: 4px; }
.conversation-row.selected { background: var(--st-accent-tint); }
.conversation-select { flex: 1; min-width: 0; border: 0; background: none; color: var(--st-ink); font: inherit; padding: 12px 8px; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.conversation-select:disabled { cursor: default; opacity: .6; }
@media (max-width: 700px) { .view--chat { flex-direction: column; } .conversation-sidebar { width: auto; max-height: 145px; border-right: 0; border-bottom: 1px solid var(--st-line); } }

.conversation-edit { position: relative; }
.conversation-edit input { width: 100%; min-width: 0; padding-right: 72px; }
.conversation-edit-actions { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); display: flex; background: var(--st-bg); border-radius: var(--st-r-md); }
.conversation-edit-actions .st-btn { width: 30px; height: 30px; }
.conversation-cancel { color: var(--st-danger); }
.conversation-save { color: var(--st-accent); }

/* Tighter spacing between message actions; preserve the gap after the text. */
.st-msg__meta .st-btn--icon + .st-btn--icon { margin-left: -8px; }

.conversation-resizer { position: relative; flex: 0 0 8px; margin: 0 -4px; z-index: 2; cursor: col-resize; touch-action: none; }
.conversation-resizer::after { content: ""; position: absolute; top: 0; bottom: 0; left: 3px; width: 2px; background: transparent; }
.conversation-resizer:hover::after, .conversation-resizer:focus-visible::after,
.sidebar-resizing .conversation-resizer::after { background: var(--st-accent); }
.conversation-resizer:focus-visible { outline: none; }
.sidebar-resizing, .sidebar-resizing * { cursor: col-resize !important; user-select: none !important; }
@media (max-width: 700px) { .conversation-resizer { display: none; } }

@media (max-width: 700px) { #monitor-sidebar { display: none; } }

/* Sampling is a docked chat sidebar, rather than a modal overlay. */
.view--chat > .st-drawer { position: static; flex: none; min-width: 0; min-height: 0; width: 518px; max-width: 100%; transform: none; transition: none; box-shadow: none; z-index: auto; }
.view--chat > .st-drawer[data-open="false"] { display: none; }
.view--chat > .st-drawer .st-drawer__body { min-height: 0; }
.conversation-resizer[hidden] { display: none; }
@media (min-width: 701px) { .view--chat { overflow-x: auto; } .conversation-main { min-width: 280px; } }
@media (max-width: 700px) { .view--chat > .st-drawer { width: 100%; max-height: 60vh; border-left: 0; border-top: 1px solid var(--st-line); } }

#sampling-btn[aria-expanded="true"] { color: var(--st-accent-text); background: var(--st-accent-tint); border-color: var(--st-accent); }

.sidebar-tabs, .global-tabs { display: flex; flex-wrap: nowrap; width: 100%; }
.sidebar-tabs .st-tab, .global-tabs .st-tab { flex: 1 1 0; min-width: 0; justify-content: center; padding-inline: 8px; }
.st-drawer__body[hidden] { display: none; }

.st-input.prompt-textarea { height: auto; min-height: 120px; width: 100%; resize: vertical; padding: 12px; line-height: 1.5; }
#prompt-prepend:disabled { opacity: 1; color: var(--st-ink-soft); background: var(--st-surface-2); -webkit-text-fill-color: var(--st-ink-soft); }

.sidebar-config.cfg-form { grid-template-columns: minmax(0, 1fr); gap: 6px; margin-top: 0; }
.sidebar-config.cfg-form .st-input { margin-bottom: 10px; }

.global-tabs { margin-bottom: 4px; }
.global-tabs .st-tab { font-size: var(--st-fs-sm); }
.global-panel[hidden] { display: none; }

.sidebar-config .cfg-help { color: var(--st-ink-soft); font-size: var(--st-fs-sm); line-height: 1.4; font-weight: 400; }
.sidebar-config .cfg-help span { display: block; }
#sidebar-panel-global { gap: 12px; }
.global-settings-label { margin: 0 0 8px; padding: 0; font-family: inherit; }

.config-confirm { width: min(460px, calc(100vw - 32px)); box-sizing: border-box; padding: 28px; border: 1px solid var(--st-line); border-radius: 20px; background: var(--st-surface); color: var(--st-ink); box-shadow: 0 24px 80px rgb(0 0 0 / 25%); }
.config-confirm::backdrop { background: rgb(0 0 0 / 40%); backdrop-filter: blur(3px); }
.config-confirm h2 { margin: 0 0 16px; font-size: 22px; }
.config-confirm p { line-height: 1.5; }
.config-confirm-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 12px; margin-top: 24px; }

.sidebar-config .cfg-setting { position: relative; display: grid; gap: 6px; min-width: 0; }
.sidebar-config .cfg-help { position: absolute; left: 0; right: 0; bottom: calc(100% + 6px); z-index: 20; padding: 12px 14px; border: 1px solid var(--st-line); border-radius: 12px; background: var(--st-surface-2); color: var(--st-ink); box-shadow: var(--st-sh-card); visibility: hidden; opacity: 0; transition: opacity .12s ease; }
.sidebar-config .cfg-help::after { content: ""; position: absolute; top: 100%; left: 0; right: 0; height: 8px; }
.sidebar-config .cfg-setting:not(.tip-dismissed):has(label:hover, .st-input:hover, .cfg-range:hover, .st-input:focus-visible, .cfg-range:focus-visible) .cfg-help,
.sidebar-config .cfg-setting:not(.tip-dismissed) .cfg-help:hover { visibility: visible; opacity: 1; }
.sidebar-config .cfg-setting:has(.cfg-override:hover) .cfg-help { visibility: hidden; opacity: 0; }
@media (prefers-reduced-motion: reduce) { .sidebar-config .cfg-help { transition: none; } }

.config-fieldset { min-width: 0; margin: 0 0 16px; padding: 16px; border: 1px solid var(--st-line); border-radius: 14px; }
.config-fieldset > legend { padding: 0 8px; color: var(--st-ink); font-weight: 600; font-size: var(--st-fs-sm); }

.sidebar-config .cfg-slider-setting { grid-template-columns: minmax(72px, .9fr) minmax(40px, 1fr) 64px; align-items: center; gap: 8px; margin-bottom: 12px; }
.sidebar-config .cfg-slider-setting .st-input { margin: 0; padding: 6px; text-align: center; }
.cfg-range { width: 100%; min-width: 0; margin: 0; accent-color: var(--st-accent); }
.cfg-unset .cfg-range { opacity: .45; }

.sidebar-config .cfg-aligned-setting { grid-template-columns: minmax(72px, .9fr) minmax(40px, 1fr) 64px; align-items: center; gap: 8px; margin-bottom: 12px; }
.sidebar-config .cfg-aligned-setting .st-input { grid-column: 2 / 4; margin: 0; }

.cfg-override-label { display: flex; align-items: center; gap: 7px; min-width: 0; }
.cfg-override { flex: 0 0 auto; width: 14px; height: 14px; margin: 0; accent-color: var(--st-accent); cursor: pointer; }
.sidebar-config .st-input:disabled { opacity: .55; cursor: not-allowed; }
.sidebar-config .cfg-range:disabled { cursor: not-allowed; }

/* Compact Defaults rows keep the controls close to the slider height. */
#cfg-form-defaults, #cfg-form-runtime, #cfg-form-integration { gap: 3px; }
#cfg-form-defaults .cfg-setting, #cfg-form-runtime .cfg-setting, #cfg-form-integration .cfg-setting { margin-bottom: 0; min-height: 28px; }
#cfg-form-defaults .st-input, #cfg-form-runtime .st-input, #cfg-form-integration .st-input { height: 28px; min-height: 28px; padding: 2px 6px; margin: 0; font-size: var(--st-fs-sm); line-height: 1.2; border-radius: 8px; }
#cfg-form-defaults .cfg-setting label, #cfg-form-runtime .cfg-setting label, #cfg-form-integration .cfg-setting label { line-height: 1.2; }
.config-fieldset { padding: 10px 12px 12px; }

/* Field spacing comes from the shared gap, not browser paragraph margins. */
#sidebar-panel-prompts .st-field > p { margin: 0; }

.sidebar-tabs .st-tab { padding-inline: 6px; white-space: nowrap; }
@media (max-width: 400px) { .sidebar-tabs .st-tab { font-size: 12px; padding-inline: 3px; } }

.reasoning-fieldset { display: flex; flex-direction: column; gap: 16px; margin-bottom: 0; }

.generation-controls, .generation-tools { display: flex; flex-direction: column; gap: 12px; margin: 0; }
.generation-row { display: grid; grid-template-columns: minmax(80px, .9fr) minmax(40px, 1fr) 64px; gap: 8px; align-items: center; }
.generation-row .st-input { width: 100%; min-width: 0; height: 28px; padding: 2px 6px; border-radius: 8px; }
.generation-row .st-slider { min-width: 0; width: 100%; margin: 0; }

.generation-tools:not(:has(.toggle-row:not([hidden]))) { display: none; }

.generation-override-label { justify-content: flex-start; align-items: center; gap: 7px; }
.generation-override-label input { flex: 0 0 auto; width: 14px; height: 14px; margin: 0; accent-color: var(--st-accent); }
.generation-controls input:disabled { opacity: .5; }

/* Connected Effort radio choices, distinct from the sidebar tabs. */
#s-thinking { gap: 0; padding: 0; border: 1px solid var(--st-line); border-radius: 10px; background: var(--st-surface); }
#s-thinking button { display: flex; align-items: center; justify-content: center; gap: 7px; height: 36px; border-radius: 0; box-shadow: none; color: var(--st-ink-soft); font-weight: 500; transition: background .12s ease; }
#s-thinking button + button { border-left: 1px solid var(--st-line); }
#s-thinking button:first-child { border-radius: 9px 0 0 9px; }
#s-thinking button:last-child { border-radius: 0 9px 9px 0; }
#s-thinking button::before { content: ""; width: 13px; height: 13px; flex: 0 0 13px; box-sizing: border-box; border: 1.5px solid var(--st-ink-muted); border-radius: 50%; background: var(--st-surface); }
#s-thinking button:hover { background: var(--st-surface-2); }
#s-thinking button[aria-checked="true"] { background: var(--st-accent-tint); color: var(--st-accent-text); font-weight: 600; box-shadow: none; }
#s-thinking button[aria-checked="true"]::before { border: 4px solid var(--st-accent); }
#s-thinking button:focus-visible { outline: 2px solid var(--st-accent); outline-offset: 2px; z-index: 1; }
@media (prefers-reduced-motion: reduce) { #s-thinking button { transition: none; } }

.generation-max-row .generation-input-tip { grid-column: 2 / 4; position: relative; min-width: 0; }
.generation-input-tip [role="tooltip"] { position: absolute; bottom: calc(100% + 8px); right: 0; max-width: 100%; padding: 8px 12px; border: 1px solid var(--st-line); border-radius: 10px; background: var(--st-surface-2); color: var(--st-ink); box-shadow: var(--st-sh-card); font-size: var(--st-fs-sm); visibility: hidden; opacity: 0; z-index: 20; }
.generation-input-tip:hover [role="tooltip"], .generation-input-tip:focus-within [role="tooltip"] { visibility: visible; opacity: 1; }
.generation-input-tip [role="tooltip"]::after { content: ""; position: absolute; top: 100%; left: 0; right: 0; height: 8px; }

.seed-row { position: relative; }
.seed-help { position: absolute; bottom: calc(100% + 8px); left: 0; right: 0; padding: 10px 12px; border: 1px solid var(--st-line); border-radius: 10px; background: var(--st-surface-2); color: var(--st-ink); box-shadow: var(--st-sh-card); font-size: var(--st-fs-sm); visibility: hidden; opacity: 0; z-index: 20; }
.seed-row:has(.seed-label-text:hover, .st-slider:hover, .generation-value:hover, .st-slider:focus-visible, .generation-value:focus-visible) .seed-help,
.seed-help:hover { visibility: visible; opacity: 1; }
.seed-help::after { content: ""; position: absolute; top: 100%; left: 0; right: 0; height: 8px; }
.seed-row:has(input[type="checkbox"]:hover) .seed-help { visibility: hidden; opacity: 0; }

.api-tools .facts { grid-template-columns: minmax(0, 1fr); gap: 4px; }
.api-tools .facts dd { min-width: 0; margin-bottom: 8px; }
.api-tools .facts dd code { min-width: 0; overflow-wrap: anywhere; }
.api-tools .facts .st-btn--icon { flex-shrink: 0; }

/* Thinking expands inside the response's shared padding. */
.response-heading > .think { border: 0; border-radius: var(--st-r-md); background: var(--st-surface-2); margin: 0 0 12px; padding: 10px 14px; }
.response-heading > .think > summary { padding: 0; }
.response-heading > .think > .thinking { padding: 10px 0 0; }
.answer-content > :first-child { margin-top: 0; }
.answer-content > :last-child { margin-bottom: 0; }

.response-heading > .think:not([open]) { padding-block: 4px; }
.response-heading > .think { width: 100%; flex-basis: 100%; }

.response-heading { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px; }
.response-model { font: 500 var(--st-fs-xs)/1.4 var(--st-font); color: var(--st-ink-muted); background: var(--st-surface-2); border-radius: var(--st-r-sm); padding: 3px 8px; overflow-wrap: anywhere; min-width: 0; }
.response-heading > .think { margin-bottom: 0; }


.response-model { color: var(--st-accent-text); background: color-mix(in srgb, var(--st-accent) 18%, var(--st-surface)); border: 1px solid color-mix(in srgb, var(--st-accent) 50%, var(--st-line)); }
[data-theme="light"] .response-model { color: #000; }
[data-theme="dark"] .response-model { color: #fff; }

.response-heading > .think > summary .st-chev { margin-left: auto; }

.st-msg--assistant .response-model { display: inline-flex; align-items: center; gap: 8px; min-height: 30px; padding: 4px 10px; box-sizing: border-box; }
.response-heading > .think:not([open]) { min-height: 30px; box-sizing: border-box; }
.response-heading > .think > summary { min-height: 22px; }
/* Compact thinking pill beside the model; expanded content stays below. */
.response-heading > .think:not([open]) { flex-basis: auto; width: fit-content; max-width: 100%; min-height: 0; padding: 2px 8px; border-radius: 999px; }
.response-heading > .think:not([open]) > summary { min-height: 18px; font-size: var(--st-fs-xs); gap: 5px; }
.response-heading > .think:not([open]) > summary .st-icon { width: 14px; height: 14px; }
.response-heading > .think:not([open]) > summary .st-chev { display: none; }
.response-heading > .think[open] { flex-basis: 100%; width: 100%; }
.st-msg--assistant .response-model { background: transparent; border: 0; font-size: var(--st-fs-sm); }
.response-heading > .think:not([open]) { border: 1px solid #000; }
.response-heading > .think:not([open]) { margin-left: auto; }

.response-model .response-toggle { width: 24px; height: 24px; padding: 0; flex: none; color: inherit; }
.response-toggle[aria-expanded="true"] .st-icon { transform: rotate(180deg); }
.response-collapsed .answer-content { display: none; }
.response-collapsed .response-heading { margin-bottom: 0; }
.response-heading > .think:not([open]) { cursor: pointer; transition: background-color 120ms ease, box-shadow 120ms ease; }
.response-heading > .think:not([open]):hover { background: color-mix(in srgb, var(--st-accent) 22%, var(--st-surface)); box-shadow: 0 0 0 2px color-mix(in srgb, var(--st-accent) 40%, transparent); }
.response-heading > .think:not([open]) > summary:focus-visible { outline: 2px solid var(--st-accent); outline-offset: 3px; border-radius: 999px; }
.st-msg--assistant .response-model { padding-left: 0; }
.response-model .response-toggle { justify-content: flex-start; }
.st-msg--assistant .response-model { font-size: var(--st-fs-xs); line-height: 18px; min-height: 24px; padding: 2px 8px; gap: 5px; border: 1px solid #000; border-radius: 999px; background: transparent; }
.st-msg--assistant .response-model .response-toggle { width: 14px; height: 18px; min-height: 0; border: 0; border-radius: 999px; }
.st-msg--assistant .response-model .response-toggle .st-icon { width: 14px; height: 14px; }
[data-theme="dark"] .st-msg--assistant .response-model { border-color: #fff; }

.response-heading > .response-toggle { width: 24px; height: 24px; padding: 0; flex: none; justify-content: flex-start; color: var(--st-ink); }
[data-theme="dark"] .response-heading > .think:not([open]) { border-color: #fff; }
.response-heading > .think:not([open]) { border-radius: 6px; }
.response-heading > .think:not([open]) > summary:focus-visible { border-radius: 4px; }

.st-msg--user .response-model { display: inline-flex; align-items: center; font-size: var(--st-fs-xs); line-height: 18px; min-height: 24px; padding: 2px 8px; box-sizing: border-box; border: 1px solid currentColor; border-radius: 999px; background: transparent; color: var(--st-accent-ink); }
.st-msg--user .response-heading > .response-toggle { color: var(--st-accent-ink); }
.response-collapsed .user-prompt-content,
.st-msg--user.response-collapsed > .msg-images,
.st-msg--user.response-collapsed > .msg-files { display: none; }

.prompt-prefill { margin-left: auto; padding: 2px 8px; border: 1px solid currentColor; border-radius: 999px; color: var(--st-accent-ink); background: transparent; font: 500 var(--st-fs-xs)/18px var(--st-font); white-space: nowrap; }
[data-theme="light"] .st-msg--user .st-bubble { background: #f5f6f7; color: #000; border: 1px solid var(--st-line); }
[data-theme="dark"] .st-msg--user .st-bubble { background: #24272b; color: #fff; border: 1px solid var(--st-line); }
.st-msg--user .response-model,
.st-msg--user .response-heading > .response-toggle,
.st-msg--user .prompt-prefill { color: inherit; }
.st-msg--user .response-model { order: 0; border: 0; border-radius: 0; padding: 0; background: transparent; }
.st-msg--user .prompt-prefill { order: 1; }
.st-msg--user .response-heading > .response-toggle { order: 2; margin-left: auto; justify-content: flex-end; }
.st-msg--user .response-heading:has(.prompt-prefill:not([hidden])) > .response-toggle { margin-left: 0; }
.st-msg--user .response-model { font-family: var(--st-font-mono); font-weight: 600; text-transform: uppercase; letter-spacing: .08em; }
.st-msg--user .response-model { font-family: var(--st-font); font-size: 11px; font-weight: 600; line-height: 16px; min-height: 0; letter-spacing: .04em; color: var(--st-ink-muted); }
.st-msg--user .response-model { font-weight: 700; }
.st-msg--assistant .response-model { order: 0; border: 0; border-radius: 0; padding: 0; background: transparent; font-family: var(--st-font); font-size: 11px; font-weight: 700; line-height: 16px; min-height: 0; letter-spacing: .04em; text-transform: uppercase; color: var(--st-ink-muted); }
.st-msg--assistant .response-heading > .think:not([open]) { order: 1; }
.st-msg--assistant .response-heading > .response-toggle { order: 2; margin-left: auto; justify-content: flex-end; }
.st-msg--assistant .response-heading:has(.think:not([open]):not([hidden])) > .response-toggle { margin-left: 0; }
.st-msg--assistant .response-heading > .think[open] { order: 3; }
.st-msg--user .response-model,
.st-msg--assistant .response-model { font-size: 13px; line-height: 20px; }
.response-heading > .think:not([open]) { box-sizing: border-box; height: 20px; min-height: 20px; padding: 0 8px; }
.response-heading > .think:not([open]) > summary { height: 18px; min-height: 18px; line-height: 18px; font-size: 11px; }
.st-msg:not(.response-collapsed) .response-heading { border-bottom: 1px solid color-mix(in srgb, var(--st-ink-muted) 60%, var(--st-line)); padding-bottom: 2.5px; margin-bottom: 12px; }

.think-close { display: none; }
.think[open] > summary .think-close { display: inline-flex; align-items: center; justify-content: center; margin-left: auto; width: 24px; height: 24px; border-radius: 5px; color: var(--st-ink-muted); transition: background-color 120ms ease, color 120ms ease; }
.think[open] > summary .think-close:hover,
.think[open] > summary:focus-visible .think-close { color: var(--st-ink); background: color-mix(in srgb, var(--st-accent) 22%, var(--st-surface)); }

.st-msg--user .st-bubble > .st-msg__meta { display: flex; justify-content: flex-end; margin-top: 12px; white-space: normal; }
.st-msg--user .st-bubble { position: relative; }
.st-msg--user .st-bubble > .st-msg__meta { position: absolute; right: 12px; bottom: 6px; margin-top: 0; z-index: 1; background: inherit; border-radius: 6px; padding-left: 4px; }
.st-msg--user.response-collapsed > .st-msg__meta { display: none; }

.st-msg--assistant .st-bubble { position: relative; }
.st-msg--assistant .st-bubble > .st-msg__meta { position: absolute; right: 12px; bottom: 6px; display: flex; justify-content: flex-end; margin-top: 0; z-index: 1; background: inherit; border-radius: 6px; padding-left: 4px; }
.st-msg--assistant.response-collapsed > .st-msg__meta { display: none; }

.chat-jump:disabled { opacity: 1; cursor: default; background: var(--st-surface-2); color: var(--st-ink-muted); border-color: var(--st-line); box-shadow: none; }

[data-theme="light"] .chat-jump:disabled { background: #e3e5e8; color: #92969d; }
[data-theme="dark"] .chat-jump:disabled { background: #30343a; color: #777d87; }

.chat-navigation, .chat-navigation:hover, .chat-navigation:focus-within { background: transparent; border: 0; box-shadow: none; }
.chat-navigation { opacity: .125; transition: opacity 150ms ease; }
.chat-navigation:hover, .chat-navigation:has(.chat-jump:focus-visible) { opacity: 1; }
[data-theme="light"] .chat-jump { border: 2px solid #000; }
[data-theme="dark"] .chat-jump { border: 2px solid #fff; }

.message-identity { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; order: 0; min-width: 0; }
.message-timestamp { font: 400 11px/16px var(--st-font); color: var(--st-ink-muted); white-space: normal; }
.message-timestamp:empty { display: none; }
.message-identity > .message-timestamp { order: 1; }

body.auth-pending main, body.signed-out main,
body.auth-pending .st-header > nav, body.signed-out .st-header > nav,
body.auth-pending #pill, body.signed-out #pill,
body.auth-pending #theme-btn, body.signed-out #theme-btn { display: none; }
#signed-out-actions { display: flex; gap: 10px; }
.account-menu { position: relative; }
.account-menu > summary { list-style: none; cursor: pointer; max-width: 260px; overflow: hidden; text-overflow: ellipsis; }
.account-menu > summary::-webkit-details-marker { display: none; }
.account-menu-content { position: absolute; top: calc(100% + 8px); right: 0; padding: 8px; border: 1px solid var(--st-line); border-radius: var(--st-r-md); background: var(--st-surface); box-shadow: 0 8px 24px #0002; z-index: 50; }
.auth-dialog { width: min(440px, calc(100vw - 32px)); }
.auth-dialog .st-field { margin-block: 16px; }
#auth-error { color: var(--st-danger-text); }
#account-error:empty { display: none; }
body.account-member #sidebar-tab-global, body.account-member #s-share { display: none; }
body.account-member .toggle-row:has(#s-share) { display: none; }
.account-menu-content { width: 100%; box-sizing: border-box; }
.account-menu-content > button { width: 100%; }
.account-menu-content { width: 260px; max-width: calc(100vw - 32px); }

.account-menu-divider { border: 0; border-top: 1px solid var(--st-line); margin: 8px 0; }

.view--admin { flex-direction: row; overflow: hidden; }
.admin-main { flex: 1; min-width: 0; min-height: 0; overflow: auto; padding: var(--st-s-6); }
.account-menu-content > button + button { margin-top: 6px; }
@media (max-width: 700px) { .view--admin { flex-direction: column; } #admin-sidebar { width: 100%; max-height: 145px; } }

.admin-main { display: flex; flex-direction: column; padding: 0; overflow: hidden; }
#admin-content #monitor-sidebar, #admin-content #monitor-resizer { display: none; }
.admin-nav { justify-content: flex-start; gap: 10px; }
.admin-nav.selected { background: var(--st-accent-tint); color: var(--st-accent-text); border-color: var(--st-accent); }

/* Compact server settings, opened from the Admin navigation. */
.admin-settings-nav > summary { width: 100%; list-style: none; cursor: pointer; }
.admin-settings-nav > summary::-webkit-details-marker { display: none; }
.admin-settings-arrow { margin-left: auto; transition: transform .15s; }
.admin-settings-nav[open] .admin-settings-arrow { transform: rotate(90deg); }
.admin-settings-children { display: grid; gap: 6px; padding: 8px 0 8px 24px; }
.admin-settings-children .st-btn { justify-content: flex-start; }
.admin-settings-dialog { width: min(580px, calc(100vw - 32px)); max-height: calc(100dvh - 48px); overflow: auto; }
.admin-settings-dialog .config-fieldset { margin: 16px 0; }
.admin-settings-dialog .global-settings-label { margin: 0; }
.admin-settings-dialog .cfg-actions { display: flex; justify-content: flex-end; gap: 10px; }
.admin-settings-dialog #cfg-msg:empty { display: none; }

/* Keep the reasoning toggle in the header while its panel expands below. */
.response-heading > .think:not([open]) { display: none; }
.reasoning-toggle { order: 1; margin-left: auto; height: 20px; box-sizing: border-box; padding: 0 8px; border: 1px solid #000; border-radius: 6px; background: var(--st-surface-2); color: var(--st-ink); font: inherit; font-size: 11px; line-height: 18px; cursor: pointer; }
[data-theme="dark"] .reasoning-toggle { border-color: #fff; }
.reasoning-toggle:hover, .reasoning-toggle[aria-expanded="true"] { background: var(--st-accent-tint); color: var(--st-accent-text); }
.reasoning-toggle:focus-visible { outline: 2px solid var(--st-accent); outline-offset: 3px; }
.st-msg--assistant .response-heading:has(.reasoning-toggle:not([hidden])) > .response-toggle { margin-left: 0; }

/* The conversation header stays outside the scrolling message history. */
.conversation-heading { display: flex; flex: none; align-items: baseline; justify-content: space-between; gap: 16px; min-width: 0; padding: 0; color: var(--st-ink-muted); font-size: var(--st-fs-sm); }
#conversation-heading-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }

/* Full-width header surface with inset, clearly separated metadata. */
.conversation-heading { box-sizing: border-box; align-items: center; gap: 24px; padding: 16px 24px; background: var(--st-surface); border-bottom: 1px solid var(--st-line); box-shadow: 0 2px 8px rgb(0 0 0 / 3%); }
[data-theme="light"] .conversation-heading { background: #fff; }
#conversation-heading-title { color: var(--st-ink); font-size: 15px; line-height: 1.5; font-weight: 600; }
@media (max-width: 700px) { .conversation-heading { padding: 12px 16px; gap: 12px; } }

/* Match the account label size and keep navbar controls centered. */
.st-header { align-items: center; }
.st-header__brand { display: inline-flex; align-items: center; align-self: center; font-size: var(--st-fs-md); line-height: 1; }
.st-header > #pill { font-size: var(--st-fs-md); }
