/* Axon Studio — the shell, panels, output pages and value renderers (docs/studio.md §11). Owner: S8.
   Prefixes: st- (layout), sth- (header), sti- (inspector), stl- (library), stlog- (console), str (runs), stver
   (versions), stt- (triggers), stappr- (approvals), stshare- (share), sthome- (home), sto- (output pages), stv- (viz).
   Tokens from base.css; dark default, light complete. Chart colours: a fixed categorical order validated for both
   themes (dataviz validate_palette: lightness band, chroma, CVD and normal-vision separation, 3:1 on the surface). */

:root {
  --st-c1: #16a383; --st-c2: #4a86d6; --st-c3: #cf6a30; --st-c4: #9273e0; --st-c5: #b08f2a;
  --st-head: 52px;
  --st-left: 248px;
  --st-right: 352px;
}
:root[data-theme="light"] { --st-c1: #00866a; --st-c2: #285cc2; --st-c3: #d55c13; --st-c4: #7a52d6; --st-c5: #9a7a12; }
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) { --st-c1: #00866a; --st-c2: #285cc2; --st-c3: #d55c13; --st-c4: #7a52d6; --st-c5: #9a7a12; }
}
.stv-c1 { --c: var(--st-c1); } .stv-c2 { --c: var(--st-c2); } .stv-c3 { --c: var(--st-c3); } .stv-c4 { --c: var(--st-c4); } .stv-c5 { --c: var(--st-c5); }

/* ================================================================== the editor page */
.st-ed { height: 100vh; height: 100dvh; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: var(--st-head) auto minmax(0, 1fr); background: var(--canvas); overflow: hidden; }
.st-ed.is-loading { display: block; }
.st-ed-head { position: relative; z-index: 3; background: var(--glass); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px); box-shadow: inset 0 -0.5px 0 var(--hair-2); min-height: var(--st-head); }
.st-ed-bars:empty { display: none; }
.st-bar { display: flex; align-items: center; gap: 10px; padding: 8px 16px; font-size: var(--fs-small); flex-wrap: wrap; }
.st-bar[hidden] { display: none; }
.st-bar svg { width: 16px; height: 16px; flex: none; }
.st-bar.is-conflict { background: var(--warn-wash); color: var(--warn-ink); }
.st-bar.is-viewer { background: var(--biz-wash); color: var(--ink-2); }
.st-bar.is-post { background: var(--accent-wash); color: var(--ink-2); }
.st-bar.is-post strong { color: var(--ink); }
.st-bar.is-viewing { background: var(--accent-wash); color: var(--accent-ink); }
.st-ed-body { display: grid; grid-template-columns: var(--st-left) minmax(0, 1fr) var(--st-right); min-height: 0; }
/* full canvas: a hidden rail gives up its column, and the canvas simply grows into it. `display: none` (not a zero
   width) keeps it out of the tab order too. Only where the rail is a column — below its own breakpoint it is a
   sheet with its own open state, and hiding it here would stop it opening at all. */
.st-ed-body.is-no-left { --st-left: 0px; }
.st-ed-body.is-no-right { --st-right: 0px; }
@media (min-width: 1181px) { .st-ed-body.is-no-left > .st-ed-left { display: none; } }
@media (min-width: 901px) { .st-ed-body.is-no-right > .st-ed-right { display: none; } }
.st-ed-left, .st-ed-right { background: var(--s1); min-height: 0; overflow: auto; overscroll-behavior: contain; }
.st-ed-left { box-shadow: inset -0.5px 0 0 var(--hair-2); }
.st-ed-right { box-shadow: inset 0.5px 0 0 var(--hair-2); display: flex; flex-direction: column; }
.st-ed-center { display: grid; grid-template-rows: minmax(0, 1fr) auto; grid-template-columns: minmax(0, 1fr); min-width: 0; min-height: 0; }
.st-ed-canvas { position: relative; min-height: 0; overflow: hidden; background-color: var(--canvas);
  background-image: radial-gradient(circle, var(--hair-2) 1px, transparent 1.2px); background-size: 22px 22px; }
.st-ed-rhead { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; gap: 8px; padding: 10px 12px; background: var(--s1); box-shadow: inset 0 -0.5px 0 var(--hair); }
.st-ed-rtabs { flex: 1; }
.st-ed-rtabs button, .st-dr-tabs button, .stl-tabs button { display: inline-flex; align-items: center; gap: 6px; }
.st-ed-rtabs button svg { width: 14px; height: 14px; }
.st-ed-rtabs [aria-selected="true"], .stl-tabs [aria-selected="true"] { background: var(--s3); color: var(--ink); }
.st-ed-close { display: none; }
.st-ed-pane { padding: 14px 16px 32px; min-height: 0; flex: 1; }
.st-ed-pane.sta-host { padding: 0; display: flex; flex-direction: column; }
.st-ed-pane[hidden] { display: none; }
.st-ed-fail { padding-top: 15vh; }

/* the drawer */
.st-dr { position: relative; display: flex; flex-direction: column; min-height: 0; background: var(--s1); box-shadow: inset 0 0.5px 0 var(--hair-2); }
.st-dr.is-collapsed { height: auto !important; }
.st-dr.is-collapsed .st-dr-body { display: none; }
.st-dr.is-collapsed .st-dr-toggle svg { transform: rotate(180deg); }
.st-dr-handle { position: absolute; top: -5px; left: 0; right: 0; height: 10px; cursor: ns-resize; z-index: 2; display: grid; place-items: center; touch-action: none; }
.st-dr-handle i { width: 36px; height: 4px; border-radius: 999px; background: var(--hair-2); transition: background var(--t-1); }
.st-dr-handle:hover i, .st-dr-handle:focus-visible i { background: var(--accent); }
.st-dr-bar { display: flex; align-items: center; gap: 8px; padding: 6px 10px 6px 12px; }
.st-dr-tabs { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; flex: 1; min-width: 0; }
/* a tab row narrower than its tabs scrolls, with soft edges saying there is more */
@media (max-width: 760px) {
  .st-dr-tabs { -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 24px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 24px), transparent); padding-right: 16px; }
}
.st-dr-tabs::-webkit-scrollbar { display: none; }
.st-dr-tabs button { border: 0; background: transparent; color: var(--ink-3); height: 30px; padding: 0 12px; border-radius: 999px; font-size: 13px; font-weight: 550; white-space: nowrap; }
.st-dr-tabs button:hover { color: var(--ink); background: var(--wash); }
.st-dr-tabs [aria-selected="true"] { color: var(--ink); background: var(--wash-2); }
.st-dr-n { height: 18px; padding: 0 6px; }
.st-dr-toggle svg { transition: transform var(--t-1) var(--ease); }
.st-dr-body { flex: 1; min-height: 0; overflow: auto; padding: 4px 16px 16px; overscroll-behavior: contain; }
.st-dr-pane[hidden] { display: none; }
.st-dr-empty { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.st-dr-empty svg { margin: 0; }
.st-dr-cta { margin-top: 4px; }

/* ================================================================== header */
.sth { height: var(--st-head); min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 12px 0 14px; }
.sth-left, .sth-right { display: flex; align-items: center; gap: 6px; min-width: 0; }
.sth-left { flex: 1; overflow: hidden; }
.sth-right { flex: none; }
.sth-mark { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; flex: none; color: var(--ink); }
.sth-mark:hover { background: var(--wash); }
.sth-mark .brand-mark { width: 22px; height: auto; }
.sth-crumb { font-weight: 600; font-size: 14px; color: var(--ink-2); padding: 4px 6px; border-radius: 8px; flex: none; }
.sth-crumb:hover { color: var(--ink); background: var(--wash); }
.sth-sep { color: var(--ink-4); flex: none; }
.sth-title { border: 0; background: transparent; font-size: 15px; font-weight: 600; letter-spacing: -0.01em; padding: 5px 8px; border-radius: 9px; min-width: 60px; width: min(36ch, 100%); flex: 0 1 auto; text-overflow: ellipsis; }
.sth-title:hover:not(:disabled) { background: var(--wash); }
.sth-title:focus { outline: none; background: var(--s2); box-shadow: inset 0 0 0 1px var(--accent); }
.sth-title:disabled { color: var(--ink); opacity: 1; }
.sth-save { white-space: nowrap; flex: none; display: inline-flex; align-items: center; gap: 6px; }
.sth-save::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--ok); }
.sth-save.is-dirty::before, .sth-save.is-saving::before { background: var(--warn); animation: pulse 1.4s var(--ease) infinite; }
.sth-save.is-offline, .sth-save.is-error, .sth-save.is-invalid { color: var(--warn-ink); }
.sth-save.is-offline::before, .sth-save.is-error::before, .sth-save.is-invalid::before { background: var(--warn); }
.sth-save.is-conflict { color: var(--crit); }
.sth-save.is-conflict::before { background: var(--crit); }
.sth-save.is-readonly::before { background: var(--ink-4); }
.sth-sched { border: 0; cursor: pointer; max-width: 240px; }
.sth-sched span { overflow: hidden; text-overflow: ellipsis; }
.sth-sched[hidden] { display: none; }
.sth-split { display: inline-flex; }
.sth-split .sth-run { border-radius: 999px 0 0 999px; padding-right: 12px; }
.sth-split .sth-run-more { border-radius: 0 999px 999px 0; padding: 0 9px; box-shadow: inset 0.5px 0 0 color-mix(in srgb, var(--on-accent) 30%, transparent); }
.sth-run.is-running { background: var(--crit-wash); color: var(--crit); }
/* paused for an approval: a calm waiting state that opens the approvals, not a red Stop */
.sth-run.is-waiting { background: var(--warn-wash, color-mix(in srgb, var(--warn) 16%, var(--s1))); color: var(--warn-ink); }
.sth-rail { display: inline-grid; }
.sth-rail[aria-pressed="false"] { color: var(--ink-3); }
.sth-mobile { display: none; }
.sth-est { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.sth-est-tile { background: var(--s2); border-radius: 16px; padding: 14px; display: flex; flex-direction: column; gap: 2px; }
.sth-est-v { font-size: 24px; font-weight: 650; letter-spacing: -0.02em; }
.sth-keys { display: inline-flex; gap: 4px; }
kbd { font: 600 12px/1 var(--mono); padding: 4px 7px; border-radius: 6px; background: var(--s3); color: var(--ink-2); box-shadow: inset 0 -1px 0 var(--hair-2); }

/* ================================================================== library (left rail) */
.stl { display: flex; flex-direction: column; min-height: 100%; }
.stl-tabs { margin: 12px 12px 8px; display: flex; flex-wrap: nowrap; }
.stl-tabs button { flex: 1 1 auto; min-width: 0; justify-content: center; padding: 0 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stl-body { padding: 0 12px 24px; display: flex; flex-direction: column; gap: 10px; }
.stl-search { min-height: 36px; padding: 7px 11px; font-size: 14px; }
.stl-cat { margin-top: 6px; }
.stl-cat-h { display: flex; align-items: center; gap: 8px; font-size: var(--fs-cap); font-weight: 650; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.05em; margin: 10px 4px 4px; }
:lang(zh) .stl-cat-h { text-transform: none; letter-spacing: 0.02em; }
.stl-cat-h .cap { margin-left: auto; }
.stl-dot { width: 8px; height: 8px; border-radius: 3px; flex: none; }
/* Evidence data's second level (what a source holds) and third (how it is reached) */
.stl-sub { margin: 2px 0 6px; }
.stl-sub-h { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); margin: 8px 8px 2px; }
.stl-sub-h .cap { margin-left: auto; }
.stl-acc { margin: 4px 8px 0; color: var(--ink-4); }
.stl-item { width: 100%; display: flex; align-items: center; gap: 6px; border: 0; background: transparent; text-align: left; padding: 7px 8px; border-radius: 10px; font-size: 13.5px; color: var(--ink); cursor: grab; }
.stl-item:hover, .stl-item:focus-visible { background: var(--wash-2); }
.stl-item:active { cursor: grabbing; }
.stl-item-t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stl-item .stl-ic { width: 13px; height: 13px; color: var(--ink-4); }
.stl-item .pill { height: 18px; font-size: 10.5px; }
.stl-none { padding: 12px 4px; }
.stl-float { position: fixed; z-index: var(--z-sheet); width: 280px; pointer-events: none; animation: fade var(--t-1) var(--ease); }
.stl-card { background: var(--s2); border-radius: 16px; padding: 14px; box-shadow: var(--shadow-float), inset 0 0 0 0.5px var(--hair-2); display: flex; flex-direction: column; gap: 6px; }
.stl-card-t { font-weight: 600; }
.stl-card-io { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 4px; }
.stl-ports li { display: flex; align-items: center; gap: 6px; font-size: 12.5px; flex-wrap: wrap; }
.stl-port { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.stl-tpl { background: var(--s2); border-radius: 14px; padding: 12px; display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; align-items: flex-start; }
.stl-tpl-t { font-weight: 600; font-size: 14px; }
.stl-src { background: var(--s2); border-radius: 14px; padding: 10px 12px; margin-bottom: 8px; }
.stl-src-kinds { margin-top: 4px; }
.stl-tplcats { gap: 6px; }

/* ================================================================== inspector */
.sti-cands { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; }
.sti-cand-list { display: flex; flex-direction: column; gap: 2px; }
.sti-cand { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--wash); }
.sti-cand-t { font-size: 13px; font-weight: 550; line-height: 1.35; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.sti-cand .btn, .sti-cand .pill { flex: none; }
.sti-node, .sti-wf { display: flex; flex-direction: column; gap: 18px; }
.sti-head { display: flex; flex-direction: column; gap: 8px; }
.sti-cat { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.sti-type { margin-left: auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 60%; }
.sti-title { font-size: 17px; font-weight: 650; letter-spacing: -0.015em; background: transparent; box-shadow: none; padding: 6px 8px; margin: 0 -8px; }
.sti-title:hover:not(:disabled) { background: var(--wash); }
.sti-title:disabled { opacity: 1; color: var(--ink); }
.sti-actions { margin-top: 2px; }
.sti-sec { display: flex; flex-direction: column; gap: 10px; }
.sti-h { font-size: var(--fs-cap); font-weight: 650; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.06em; }
:lang(zh) .sti-h { text-transform: none; letter-spacing: 0.02em; }
.sti-form { display: flex; flex-direction: column; gap: 14px; }
.sti-field .label { display: flex; gap: 4px; align-items: baseline; }
.sti-req { color: var(--warn-ink); }
.sti-err { color: var(--crit); font-size: var(--fs-cap); margin-top: 5px; }
.sti-err[hidden] { display: none; }
.sti-code { font-size: 12.5px; line-height: 1.55; tab-size: 4; }
.sti-codebox { display: flex; flex-direction: column; gap: 6px; }
.sti-lang { align-self: flex-start; }
.sti-helpers { gap: 5px; }
.sti-helpers .chip { min-height: 26px; padding: 3px 9px; font-size: 12px; }
.sti-fills { margin-top: 6px; align-items: center; }
.sti-fills > .cap { color: var(--ink-3); }
.sti-tools:empty { display: none; }
.sti-tools { margin-top: 6px; display: flex; flex-direction: column; gap: 6px; }
.sti-tool-chips { align-items: center; }
.sti-tool-chips > .cap, .sti-args > .cap { color: var(--ink-3); }
.sti-tools-check { min-height: 26px; padding: 3px 8px; font-size: 12px; }
.sti-tools-check svg { width: 13px; height: 13px; }
.sti-tool-does { overflow-wrap: anywhere; }
.sti-tool-gone { display: flex; gap: 6px; align-items: flex-start; color: var(--warn-ink); }
.sti-tool-gone svg { width: 14px; height: 14px; margin-top: 2px; flex: none; }
.sti-args { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.sti-arg-list { list-style: none; margin: 0; padding: 0; font-size: var(--fs-small); overflow-wrap: anywhere; }
.sti-arg-list li { padding: 1px 0; }
.sti-args-fill[hidden] { display: none; }
.sti-ticker { text-transform: uppercase; }
.sti-multi .chip { min-height: 28px; padding: 4px 11px; }
.sti-bool { align-items: center; }
.sti-adv summary { cursor: pointer; color: var(--ink-3); font-size: var(--fs-small); font-weight: 550; padding: 4px 0; }
.sti-adv[open] summary { margin-bottom: 10px; }
.sti-adv > .sti-field + .sti-field { margin-top: 14px; }
.sti-problems li { display: flex; gap: 8px; align-items: flex-start; font-size: var(--fs-small); padding: 4px 0; }
.sti-problems svg { width: 15px; height: 15px; margin-top: 3px; flex: none; }
.sti-problems .is-error { color: var(--crit); }
.sti-problems .is-warning { color: var(--warn-ink); }
.sti-run { display: flex; flex-direction: column; gap: 8px; }
.sti-error code, .stlog-node code { font-size: 12px; }
.sti-fix { margin-top: 4px; }
.sti-out { display: flex; flex-direction: column; gap: 10px; }
.sti-ports { align-self: flex-start; }
.sti-hint { line-height: 1.5; }
.sti-watch { display: flex; flex-direction: column; gap: 8px; }
.sti-watch-row { position: relative; width: 100%; display: flex; flex-direction: column; gap: 6px; text-align: left; background: var(--s2); color: inherit; border-radius: 14px; padding: 10px 12px; cursor: pointer; }
.sti-watch-row:hover { background: var(--s3); }
.sti-watch-t { font-weight: 600; font-size: 14px; min-width: 0; }
.sti-watch-btn { display: block; max-width: 100%; border: 0; padding: 0; background: none; color: inherit; font: inherit; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.sti-watch-btn::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.sti-watch-btn:focus-visible { outline: none; }
.sti-watch-row:has(.sti-watch-btn:focus-visible) { box-shadow: 0 0 0 2px var(--accent); }
.sti-full { min-height: 200px; }
.st-status.is-running .dot { margin-right: 2px; }

/* ================================================================== console, runs, versions, triggers, approvals */
.stlog { display: flex; flex-direction: column; gap: 10px; }
.stlog-head { padding-top: 6px; }
.stlog-list { display: flex; flex-direction: column; gap: 4px; }
.stlog-node { border-radius: 12px; background: var(--s2); }
.stlog-node[open] { padding-bottom: 8px; }
.stlog-node > :not(summary) { margin: 0 12px; }
.stlog-node > * + :not(summary) { margin-top: 6px; }
.stlog-sum { display: flex; align-items: center; gap: 8px; padding: 6px 10px; cursor: pointer; list-style: none; min-width: 0; }
.stlog-sum::-webkit-details-marker { display: none; }
.stlog-name { border: 0; background: transparent; padding: 2px 4px; border-radius: 6px; font-weight: 600; font-size: 13.5px; color: var(--ink); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stlog-name:hover { color: var(--accent-ink); text-decoration: underline; text-underline-offset: 3px; }
.stlog-node.is-failed { box-shadow: inset 2px 0 0 var(--crit); }
.stlog-node.is-blocked, .stlog-node.is-awaiting_approval { box-shadow: inset 2px 0 0 var(--warn); }
.stlog-logs { font-size: 12px; line-height: 1.6; color: var(--ink-2); background: var(--canvas); border-radius: 10px; padding: 8px 10px; max-height: 220px; overflow: auto; }
.stlog-logs li { display: flex; gap: 10px; }
.stlog-logs .is-warning { color: var(--warn-ink); }
.stlog-logs .is-error { color: var(--crit); }
.stlog-t { color: var(--ink-4); flex: none; }
.stlog-summary { color: var(--ink-2); }

.st-tbl { width: 100%; border-collapse: collapse; font-size: var(--fs-small); }
.st-tbl td { padding: 8px 6px; box-shadow: inset 0 -0.5px 0 var(--hair); white-space: nowrap; }
.st-tbl tr.is-viewing td { background: var(--accent-wash); }
.st-tbl-act { text-align: right; }

.stver { display: flex; flex-direction: column; }
.stver-row { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; box-shadow: inset 0 -0.5px 0 var(--hair); }
.stver-row.is-head .stver-n { color: var(--accent-ink); }
.stver-n { font-weight: 650; min-width: 36px; padding-top: 2px; }
.stver-diff { display: block; margin-top: 2px; }
.stver-act { flex: none; }

.stt { display: flex; flex-direction: column; gap: 6px; }
.stt-row { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; }
.stt-row.is-paused .stt-desc { color: var(--ink-3); }
.stt-ic { width: 32px; height: 32px; border-radius: 10px; background: var(--s2); display: grid; place-items: center; flex: none; color: var(--ink-2); }
.stt-ic svg { width: 16px; height: 16px; }
.stt-desc { font-weight: 550; }
.stt-warn { margin-top: 6px; }
.stt-act { flex: none; justify-content: flex-end; }
.stt-kinds { width: 100%; }
.stt-kinds button { display: inline-flex; align-items: center; gap: 6px; }
.stt-form { display: flex; flex-direction: column; gap: 14px; }

.stappr-list { display: flex; flex-direction: column; gap: 10px; }
.stappr-card { background: var(--s2); border-radius: 16px; padding: 14px; display: flex; flex-direction: column; gap: 8px; box-shadow: inset 2px 0 0 var(--warn); }
.stappr-ic { width: 26px; height: 26px; border-radius: 8px; background: var(--warn-wash); color: var(--warn-ink); display: grid; place-items: center; }
.stappr-ic svg { width: 14px; height: 14px; }
.stappr-sum { line-height: 1.5; }
.stappr-node { border: 0; background: transparent; color: var(--accent-ink); padding: 0; font: inherit; }
.stappr-node:hover { text-decoration: underline; }

.stshare-roles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stshare-role { display: flex; gap: 10px; align-items: flex-start; text-align: left; border: 0; border-radius: 16px; padding: 14px; background: var(--s2); color: var(--ink); }
.stshare-role svg { width: 18px; height: 18px; margin-top: 2px; color: var(--ink-3); }
.stshare-role span { display: flex; flex-direction: column; gap: 2px; }
.stshare-role[aria-checked="true"] { box-shadow: inset 0 0 0 1.5px var(--accent); background: var(--accent-wash); }
.stshare-role[aria-checked="true"] svg { color: var(--accent-ink); }
.stshare-url { margin-top: 8px; }
.stshare-made:empty { display: none; }
@media (max-width: 520px) { .stshare-roles { grid-template-columns: 1fr; } }

.st-ver-canvas { position: relative; height: min(56vh, 520px); border-radius: 16px; overflow: hidden; background-color: var(--canvas);
  background-image: radial-gradient(circle, var(--hair-2) 1px, transparent 1.2px); background-size: 22px 22px; }

/* ================================================================== home */
.st-home { display: flex; flex-direction: column; gap: 28px; }
.sthome-hero { padding: clamp(20px, 6vh, 64px) 0 8px; display: flex; flex-direction: column; gap: 14px; max-width: 880px; }
.sthome-h { font-size: clamp(30px, 4.6vw, 46px); line-height: 1.08; letter-spacing: -0.035em; font-weight: 650; }
:lang(zh) .sthome-h { letter-spacing: -0.01em; line-height: 1.2; }
.sthome-sub { font-size: var(--fs-lead); line-height: 1.5; max-width: 64ch; }
.sthome-ask { margin-top: 8px; background: var(--s1); border-radius: 24px; padding: 8px; box-shadow: inset 0 0 0 0.5px var(--hair-2); transition: box-shadow var(--t-1) var(--ease); }
.sthome-ask:focus-within { box-shadow: inset 0 0 0 1px var(--accent), 0 0 0 5px var(--accent-wash); }
.sthome-goal { width: 100%; border: 0; background: transparent; resize: none; padding: 12px 14px; font-size: 18px; line-height: 1.5; min-height: 84px; }
.sthome-goal:focus { outline: none; }
.sthome-goal::placeholder { color: var(--ink-4); }
.sthome-ask-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 6px 4px 14px; flex-wrap: wrap; }
.sthome-ask-foot .cap svg { width: 12px; height: 12px; vertical-align: -1px; }
.sthome-ex { align-items: center; }
.sthome-ex .chip { max-width: 100%; }
.sthome-start { margin-top: 2px; }
/* the person's own agent (panels/ownagent.js): two steps, the key and the commands to copy, the first message */
.st-own-step { display: flex; flex-direction: column; gap: 10px; min-width: 0; padding: 16px 18px; border-radius: 18px; background: var(--wash); }
.st-own-h { margin: 0; font-size: 15px; font-weight: 600; }
.st-own-step .cap { margin: 0; }
.st-own-reveal:empty { display: none; }
.st-own-copy { align-items: flex-start; }
.st-own-copy.is-pre code { white-space: pre-wrap; max-height: 220px; overflow: auto; padding: 4px 0; }
.st-own-copy .btn { flex: none; }
.sthome-approvals[hidden] { display: none; }
.sthome-appr { background: var(--warn-wash); border-radius: 18px; padding: 4px 16px; }
.sthome-appr summary { display: flex; align-items: center; gap: 10px; cursor: pointer; padding: 10px 0; list-style: none; color: var(--warn-ink); }
.sthome-appr summary::-webkit-details-marker { display: none; }
.sthome-appr summary svg { margin-left: auto; width: 16px; height: 16px; transition: transform var(--t-1); }
.sthome-appr[open] summary svg { transform: rotate(180deg); }
.sthome-appr .stappr-list { padding-bottom: 14px; }
.sthome-sources { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-radius: 18px; background: var(--s1); transition: background var(--t-1); }
.sthome-sources:hover { background: var(--s2); }
.sthome-sources > svg { width: 20px; height: 20px; color: var(--accent-ink); }
.sthome-sources .link { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.sthome-sec { display: flex; flex-direction: column; gap: 14px; }
.sthome-h2 { font-size: var(--fs-h2); letter-spacing: -0.02em; }
.sthome-grid, .sthome-tpls { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 14px; }
.sthome-card { background: var(--s1); border-radius: var(--r-card); padding: 18px 18px 12px; display: flex; flex-direction: column; gap: 10px; min-width: 0; transition: background var(--t-1); }
.sthome-card:hover { background: var(--s2); }
.sthome-card.is-skel { min-height: 150px; }
.sthome-card-link { display: flex; flex-direction: column; gap: 6px; border-radius: 12px; }
.sthome-card-t { font-size: 17px; letter-spacing: -0.015em; line-height: 1.3; }
.sthome-spark { height: 40px; margin-top: 4px; }
/* a workflow in miniature (viz.thumbnail): node blocks in their category's colour (registry.CATEGORIES) */
.stv-thumb { display: block; width: 100%; height: 56px; margin-top: 4px; border-radius: 10px; background: var(--wash); }
.stv-thumb-n { fill: var(--ink-4); opacity: 0.9; }
.stv-thumb-n.is-data { fill: #2f6fdb; } .stv-thumb-n.is-transform { fill: #2a9d8f; } .stv-thumb-n.is-compute { fill: #7b61ff; }
.stv-thumb-n.is-agent { fill: #d1495b; } .stv-thumb-n.is-model { fill: #e09f3e; } .stv-thumb-n.is-control { fill: #6c757d; }
.stv-thumb-n.is-output { fill: #3fd5ae; }
.sthome-spark .stv-spark { width: 100%; height: 40px; }
.sthome-card-meta { gap: 6px; }
.sthome-sched { max-width: 100%; overflow: hidden; }
.sthome-sched span { overflow: hidden; text-overflow: ellipsis; }
.sthome-card-foot { margin-top: auto; }
.sthome-more { color: var(--ink-2); }
/* the "more" dots are points of the stroke: drawn heavier so they read in both themes */
.sthome-more svg, .sth-more svg { stroke-width: 2.8; }
.sthome-more:hover { color: var(--ink); background: var(--wash-2); }
.stv-thumb-e { fill: none; stroke: var(--ink-4); stroke-width: 1.2; opacity: 0.7; }
.sthome-empty { grid-column: 1 / -1; }
.sthome-tpl { background: var(--s1); border-radius: var(--r-card); padding: 18px; display: flex; flex-direction: column; gap: 8px; }
.sthome-tpl-t { font-size: 16px; letter-spacing: -0.01em; }
.sthome-tpl-foot { margin-top: auto; padding-top: 6px; }

/* ================================================================== output pages */
.sto-page { display: flex; flex-direction: column; gap: 18px; }
.sto-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.sto-title { font-size: var(--fs-title); line-height: 1.12; letter-spacing: -0.025em; }
:lang(zh) .sto-title { line-height: 1.25; letter-spacing: -0.01em; }
/* auto-fit: the tiles there are share the whole width (no empty column on the right) */
.sto-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); gap: 16px; align-items: start; }
.sto-head > .grow { min-width: 0; }
.sto-head .eyebrow { overflow-wrap: anywhere; }
.sto-tile { background: var(--s1); border-radius: var(--r-card); padding: 20px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.sto-tile.is-wide { grid-column: 1 / -1; }
.sto-tile-t { font-size: var(--fs-body); font-weight: 600; letter-spacing: -0.01em; }
.sto-why { margin-top: 6px; }
.sto-foot { margin-top: 8px; }
.sto-sources { margin-top: 12px; }
.sto-report-page { gap: 24px; }

/* ================================================================== viz: small previews */
.stv-pv { min-width: 0; display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; line-height: 1.4; }
.stv-pv-num { display: flex; align-items: baseline; gap: 6px; }
.stv-pv-num b { font-size: 16px; font-weight: 650; letter-spacing: -0.02em; }
.stv-pv-num.is-big b { font-size: 24px; }
.stv-pv-text { color: var(--ink-2); }
.stv-pv-title { color: var(--ink); font-weight: 600; }
/* rows the source never had: the part of a step's loss that is not the step's doing */
.stv-lost { color: var(--warn-ink); }
.stv-pv-tbl { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 11.5px; }
.stv-pv-tbl th { text-align: left; color: var(--ink-3); font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0 4px 2px 0; }
.stv-pv-tbl td { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 1px 4px 1px 0; box-shadow: inset 0 0.5px 0 var(--hair); }
.stv-pv-tbl .num { text-align: right; }
.stv-pv-mk li { display: flex; gap: 6px; justify-content: space-between; }
.stv-pv-mk-t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); }
.stv-pv-prob { display: flex; align-items: center; gap: 10px; }
.stv-pv-p { font-size: 22px; font-weight: 650; letter-spacing: -0.02em; }
.stv-pv-chips { gap: 4px; }
.stv-pv-chips .pill { height: 18px; font-size: 10.5px; padding: 0 6px; }
.stv-pv-sc li { display: grid; grid-template-columns: 1fr 60px auto; gap: 6px; align-items: center; }
.stv-pv-sc-bar { height: 4px; border-radius: 999px; background: var(--st-c1); }
.stv-spark { width: 100%; height: 32px; display: block; overflow: visible; }
.stv-spark-l { fill: none; stroke: var(--accent); stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; }
.stv-spark-d { fill: var(--accent); }
.stv-dial { flex: none; overflow: visible; }
.stv-dial path { fill: none; stroke-width: 7; stroke-linecap: round; }
.stv-dial-track { stroke: var(--wash-2); }
.stv-dial-band { stroke: color-mix(in srgb, var(--accent) 30%, transparent); stroke-linecap: butt !important; }
.stv-dial-fill { stroke: var(--accent); }
.stv-masked { display: flex; align-items: center; gap: 8px; color: var(--ink-3); font-size: var(--fs-small); padding: 10px 12px; border-radius: 12px; background: var(--wash); flex-wrap: wrap; }
.stv-masked svg { width: 15px; height: 15px; flex: none; }
.stv-masked.is-compact { padding: 6px 8px; font-size: 12px; }

/* probability kinds: identity by a coloured dot and the word, never colour alone */
.stv-kind { --k: var(--st-c1); }
.stv-kind::before, .stv-comp-sw { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--k); flex: none; }
.stv-kind.is-model, .stv-comp-seg.is-model, .stv-comp-sw.is-model { --k: var(--st-c1); }
.stv-kind.is-market, .stv-comp-seg.is-market, .stv-comp-sw.is-market { --k: var(--st-c2); }
.stv-kind.is-blend, .stv-comp-seg.is-blend, .stv-comp-sw.is-blend { --k: var(--ink-2); }
.stv-kind.is-subjective, .stv-comp-seg.is-subjective, .stv-comp-sw.is-subjective { --k: var(--st-c4); }
.stv-kind.is-llm, .stv-comp-seg.is-llm, .stv-comp-sw.is-llm { --k: var(--st-c5); }

/* ================================================================== viz: full views */
.stv-full { min-width: 0; }
.stv-stack { display: flex; flex-direction: column; gap: 16px; }
.stv-chart { margin: 0; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.stv-chart-t { font-weight: 600; font-size: var(--fs-small); }
.stv-chart-empty { padding: 20px; }
.stv-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; color: var(--ink-2); }
.stv-legend li { display: inline-flex; align-items: center; gap: 6px; }
.stv-sw { width: 14px; height: 2px; border-radius: 2px; background: var(--c); }
.stv-chart-body { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px; }
.stv-yax { position: relative; min-width: 28px; font-size: 11px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.stv-yax span { position: absolute; right: 0; transform: translateY(-50%); white-space: nowrap; line-height: 1; }
.stv-chart-main { min-width: 0; }
.stv-plot { position: relative; }
.stv-svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.stv-grid { stroke: var(--hair-2); stroke-width: 1; }
.stv-grid.is-zero { stroke: var(--ink-4); }
.stv-line { fill: none; stroke: var(--c); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.stv-area { fill: color-mix(in srgb, var(--c) 16%, transparent); }
.stv-bar { fill: var(--c); }
.stv-pt { position: absolute; width: 8px; height: 8px; border-radius: 50%; background: var(--c); transform: translate(-50%, -50%); box-shadow: 0 0 0 2px var(--s1); }
.stv-mark { position: absolute; top: 0; bottom: 0; width: 0; border-left: 1px dashed var(--ink-4); }
/* a line's end label: a small rounded box outlined in its line's colour (not a left bar, which read as "(" — QA-6) */
.stv-end { position: absolute; right: 2px; transform: translateY(-50%); font-size: 11px; line-height: 16px; font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--ink); background: var(--s1); padding: 1px 7px; border-radius: 6px; border: 1px solid color-mix(in srgb, var(--c, var(--ink-3)) 60%, transparent); box-shadow: 0 1px 2px color-mix(in srgb, var(--ink) 8%, transparent); pointer-events: none; }
.stv-xax { position: relative; height: 18px; font-size: 11px; color: var(--ink-3); margin-top: 4px; }
.stv-xax span { position: absolute; transform: translateX(-50%); white-space: nowrap; }
/* a label at the plot's edge stays inside it; the others centre on their tick */
.stv-xax span.is-start { transform: none; }
.stv-xax span.is-end { transform: translateX(-100%); }
.stv-chart-main { container-type: inline-size; }
@container (max-width: 460px) { .stv-xax span.is-minor { display: none; } }
.ck-dot.stv-c1, .ck-dot.stv-c2, .ck-dot.stv-c3, .ck-dot.stv-c4, .ck-dot.stv-c5 { background: var(--c); }
.ck-sw.stv-c1, .ck-sw.stv-c2, .ck-sw.stv-c3, .ck-sw.stv-c4, .ck-sw.stv-c5 { background: var(--c); }

/* the map (output.map, js/studio/map.js): one hue in five steps; blue above and orange below zero when values span it */
.stv-map-svg { display: block; width: 100%; height: auto; max-height: 520px; }
.stv-map.is-compact .stv-map-svg { max-height: 96px; }
.stv-map-r { fill: var(--s3); stroke: var(--s1); stroke-width: 0.6px; vector-effect: non-scaling-stroke; stroke-linejoin: round; transition: fill var(--t-1) var(--ease); }
.stv-map:not(.is-compact) .stv-map-r { cursor: pointer; }
.stv-map-r:focus { outline: none; }
.stv-map-r:hover { stroke: var(--ink-2); stroke-width: 1px; }
.stv-map-hl { fill: none; stroke: var(--ink); stroke-width: 2px; vector-effect: non-scaling-stroke; stroke-linejoin: round; pointer-events: none; }
.stv-map-r.is-dot { stroke-width: 1px; }
.stv-map-r.is-empty, .stv-map-sw.is-empty { fill: var(--s3); background: var(--s3); }
.stv-mb-s1 { --m: color-mix(in srgb, var(--st-c2) 30%, var(--s1)); }
.stv-mb-s2 { --m: color-mix(in srgb, var(--st-c2) 48%, var(--s1)); }
.stv-mb-s3 { --m: color-mix(in srgb, var(--st-c2) 65%, var(--s1)); }
.stv-mb-s4 { --m: color-mix(in srgb, var(--st-c2) 82%, var(--s1)); }
.stv-mb-s5 { --m: var(--st-c2); }
.stv-mb-p1 { --m: color-mix(in srgb, var(--st-c2) 36%, var(--s1)); }
.stv-mb-p2 { --m: color-mix(in srgb, var(--st-c2) 66%, var(--s1)); }
.stv-mb-p3 { --m: var(--st-c2); }
.stv-mb-n1 { --m: color-mix(in srgb, var(--st-c3) 36%, var(--s1)); }
.stv-mb-n2 { --m: color-mix(in srgb, var(--st-c3) 66%, var(--s1)); }
.stv-mb-n3 { --m: var(--st-c3); }
.stv-mb-z { --m: color-mix(in srgb, var(--ink-4) 50%, var(--s1)); }
.stv-map-r[class*="stv-mb-"] { fill: var(--m); }
.stv-map-sw[class*="stv-mb-"] { background: var(--m); }
.stv-map-read { min-height: 22px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 6px; font-size: var(--fs-small); }
.stv-map-legend { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 11px; color: var(--ink-2); }
.stv-map-legend li { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.stv-map-sw { display: inline-block; width: 12px; height: 10px; border-radius: 3px; }
.stv-map-miss { overflow-wrap: anywhere; }
.stv-map-all summary { cursor: pointer; width: max-content; max-width: 100%; }
.stv-map-list { margin: 6px 0 0; padding: 0; list-style: none; columns: 2 220px; column-gap: 20px; font-size: 12.5px; }
.stv-map-list li { display: flex; justify-content: space-between; gap: 8px; padding: 3px 0; break-inside: avoid; box-shadow: inset 0 -0.5px 0 var(--hair); }
.stv-map-list li span { min-width: 0; overflow-wrap: anywhere; }
.stv-pv-map .stv-map { gap: 0; }
@media (prefers-reduced-motion: reduce) { .stv-map-r { transition: none; } }

/* the table viewer */
.stv-tview { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.stv-tscroll { overflow: auto; border-radius: 12px; background: var(--s2); overscroll-behavior: contain; }
.stv-table { min-width: max-content; font-size: 12.5px; }
.stv-tr { display: grid; min-height: 34px; align-items: center; }
.stv-thead { position: sticky; top: 0; z-index: 1; background: var(--s3); }
.stv-tbody { position: relative; }
.stv-tbody .stv-tr { box-shadow: inset 0 -0.5px 0 var(--hair); }
.stv-tbody .stv-tr:hover { background: var(--wash); }
.stv-td { padding: 6px 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; height: 34px; line-height: 22px; }
.stv-td.is-num { text-align: right; }
.stv-th { padding: 0 4px; }
.stv-th.is-num .stv-sortbtn { justify-content: flex-end; }
.stv-sortbtn { width: 100%; display: flex; align-items: center; gap: 4px; border: 0; background: transparent; padding: 7px 6px; font-weight: 600; color: var(--ink-2); font-size: 12px; text-align: left; border-radius: 8px; white-space: nowrap; }
.stv-sortbtn:hover { color: var(--ink); background: var(--wash); }
.stv-sortbtn svg { width: 12px; height: 12px; }
.stv-unit { font-weight: 500; color: var(--ink-4); }
.stv-unit::before { content: "("; } .stv-unit::after { content: ")"; }
.stv-ttools { flex-wrap: wrap; }
.stv-ttools .cap svg { width: 12px; height: 12px; vertical-align: -1px; }

/* probability */
.stv-prob { display: flex; flex-direction: column; gap: 12px; }
.stv-prob-head { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.stv-prob-big { font-size: 56px; line-height: 1; }
.stv-prob-meta { display: flex; flex-direction: column; gap: 6px; padding-bottom: 6px; min-width: 0; flex: 1 1 220px; }
.stv-prob-name { font-weight: 600; color: var(--ink); }
.stv-prob-br { color: var(--ink-2); }
.stv-prob-period svg, .stv-lic-terms svg { width: 12px; height: 12px; vertical-align: -1px; }
.stv-match.is-exact { color: var(--ink-2); }
.stv-pv-name { margin: 1px 0 3px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 150px; }
.stv-number-fit { margin-top: 2px; }
.sto-no-change { color: var(--ink-2); }
/* the rounded track is drawn behind (::before), so the scale itself is a plain box holding the band, the mark and the
   axis labels under it — not a capsule with text on two rows */
.stv-prob-scale { position: relative; height: 10px; margin: 6px 0 18px; }
.stv-prob-scale::before { content: ""; position: absolute; inset: 0; border-radius: 999px; background: var(--wash-2); }
.stv-prob-band { position: absolute; top: 0; bottom: 0; border-radius: 999px; background: color-mix(in srgb, var(--accent) 32%, transparent); }
.stv-prob-mark { position: absolute; top: -4px; width: 4px; height: 18px; border-radius: 2px; background: var(--ink); transform: translateX(-2px); box-shadow: 0 0 0 2px var(--s1); }
.stv-prob-ax { position: absolute; top: 14px; font-size: 10.5px; color: var(--ink-4); transform: translateX(-50%); }
.stv-prob-ax.is-0 { left: 0; transform: none; } .stv-prob-ax.is-50 { left: 50%; } .stv-prob-ax.is-100 { right: 0; transform: none; }
.stv-comps { display: flex; flex-direction: column; gap: 8px; }
.stv-comp-bar { display: flex; gap: 2px; height: 8px; border-radius: 999px; overflow: hidden; }
.stv-comp-seg { flex-basis: 0; background: var(--k); }
.stv-comp-list li { display: flex; align-items: center; gap: 8px; padding: 5px 0; font-size: var(--fs-small); flex-wrap: wrap; }
.stv-comp-sw { display: inline-block; }

/* lists */
.stv-doc { padding: 10px 0; display: flex; flex-direction: column; gap: 3px; }
.stv-doc-t { font-weight: 550; line-height: 1.4; }
.stv-doc-t .link { color: var(--ink); }
.stv-doc-t .link:hover { color: var(--accent-ink); }
.stv-doc-s { color: var(--ink-2); font-size: var(--fs-small); }
.stv-mkt { display: flex; gap: 14px; align-items: center; padding: 10px 0; }
.stv-mkt-t { font-weight: 550; line-height: 1.4; margin: 2px 0; overflow-wrap: anywhere; }
.stv-mkt > .grow, .stv-doc { min-width: 0; overflow-wrap: anywhere; }
.stv-sc-scroll { overflow-x: auto; max-width: 100%; }
.stv-mkt-t .link { color: var(--ink); }
.stv-mkt-p { width: 88px; flex: none; display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }
.stv-mkt-p .prob { font-size: 20px; }
.stv-mkt-p .prob-track { width: 100%; }
.stv-sc { width: 100%; border-collapse: collapse; font-size: var(--fs-small); }
.stv-sc th, .stv-sc td { text-align: left; padding: 8px 8px 8px 0; box-shadow: inset 0 -0.5px 0 var(--hair); vertical-align: top; }
.stv-sc thead th { color: var(--ink-3); font-weight: 550; font-size: var(--fs-cap); }
.stv-sc .num { text-align: right; }
.stv-sc-w { display: flex; align-items: center; gap: 8px; min-width: 110px; }
.stv-sc-w i { height: 6px; border-radius: 999px; background: var(--st-c1); max-width: 60px; }
.stv-event-s { font-size: var(--fs-lead); font-weight: 600; letter-spacing: -0.01em; margin-bottom: 10px; }
.stv-kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; font-size: var(--fs-small); }
.stv-kv dt { color: var(--ink-3); }
.stv-kv dd { margin: 0; }
.stv-number-v { font-size: 48px; line-height: 1.05; }
.stv-signal { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }

/* licence and provenance */
.stv-lic { display: flex; flex-direction: column; gap: 8px; }
.stv-lic-v { display: flex; align-items: center; gap: 6px; font-weight: 550; flex-wrap: wrap; }
.stv-lic-v svg { width: 15px; height: 15px; color: var(--ink-3); }
.stv-perms li { display: flex; align-items: center; gap: 8px; font-size: var(--fs-small); padding: 2px 0; }
.stv-perms svg { width: 14px; height: 14px; flex: none; }
.stv-perms .is-ok svg { color: var(--ok); }
.stv-perms .is-no { color: var(--ink-3); }
.stv-perms .is-no svg { color: var(--crit); }
.stv-lic .cap svg { width: 12px; height: 12px; vertical-align: -1px; }
.stv-srcs li { padding: 6px 0; box-shadow: inset 0 -0.5px 0 var(--hair); font-size: var(--fs-small); }
.stv-srcs .link { word-break: break-word; }

/* markdown and the report */
.stv-md { display: flex; flex-direction: column; gap: 10px; line-height: 1.65; }
.stv-md h3, .stv-md h4, .stv-md h5 { font-size: var(--fs-body); margin-top: 6px; }
.stv-md ul, .stv-md ol { padding-left: 1.3em; display: flex; flex-direction: column; gap: 4px; }
.stv-md ul { list-style: disc; } .stv-md ol { list-style: decimal; }
.stv-md blockquote { margin: 0; padding: 4px 0 4px 14px; box-shadow: inset 2px 0 0 var(--hair-2); color: var(--ink-2); }
.stv-md code { font-family: var(--mono); font-size: 0.9em; background: var(--wash-2); padding: 1px 5px; border-radius: 5px; }
.stv-code { margin: 0; padding: 12px 14px; background: var(--s2); border-radius: 12px; overflow: auto; font-size: 12.5px; }
.stv-code code { background: none; padding: 0; }
.stv-report { display: flex; flex-direction: column; gap: 22px; font-size: 16px; }
.stv-report-t { font-size: clamp(26px, 3.4vw, 36px); letter-spacing: -0.03em; line-height: 1.15; }
.stv-nums { display: flex; flex-direction: column; gap: 10px; }
.stv-nums-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 160px), 1fr)); gap: 10px; }
.stv-num { display: flex; flex-direction: column; gap: 2px; padding: 14px; border-radius: 16px; background: var(--s1); transition: background var(--t-1); }
a.stv-num:hover { background: var(--s2); }
.stv-num-v { font-size: 24px; font-weight: 650; letter-spacing: -0.02em; }
.stv-num-l { font-size: var(--fs-cap); color: var(--ink-3); }
.stv-sec { display: flex; flex-direction: column; gap: 8px; }
.stv-sec-h { font-size: var(--fs-h2); letter-spacing: -0.02em; }
.stv-sec.is-explanation { padding: 16px 18px; border-radius: 18px; background: var(--accent-wash); box-shadow: inset 3px 0 0 var(--accent); }
.stv-sec.is-explanation .stv-md { color: var(--ink); }
.stv-cite { font-size: 0.72em; margin-left: 1px; }
.stv-cite a { color: var(--accent-ink); font-weight: 600; }
.stv-cites ol { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; font-size: var(--fs-small); }
.stv-cites li { display: flex; gap: 8px; align-items: baseline; min-width: 0; overflow-wrap: anywhere; }
.stv-cites li > :not(.stv-cite-n) { min-width: 0; }
.stv-cite-n { color: var(--ink-3); flex: none; }
.stv-cite-node { color: var(--ink-4); display: inline-flex; }
.stv-cite-node:hover { color: var(--accent-ink); }
.stv-cite-node svg { width: 13px; height: 13px; }

/* ================================================================== narrower screens */
/* a laptop: the toolbar's buttons as icons and the schedule cut short, so the title and its save state keep their room */
@media (max-width: 1280px) {
  .sth-lbl { display: none; }
  .sth-sched { max-width: 168px; min-width: 0; }
  .sth-sched > span:not(.visually-hidden) { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
@media (max-width: 1180px) {
  :root { --st-right: 320px; }
  .st-ed-body { grid-template-columns: minmax(0, 1fr) var(--st-right); }
  /* off screen = out of the tab order too (visibility hides it once the slide is over) */
  .st-ed-left { position: absolute; z-index: 4; top: var(--st-head); bottom: 0; left: 0; width: min(300px, 86vw); transform: translateX(-104%); visibility: hidden; transition: transform var(--t-2) var(--ease), visibility 0s linear var(--t-2); box-shadow: var(--shadow-float); }
  .st-ed-left.is-open { transform: none; visibility: visible; transition: transform var(--t-2) var(--ease), visibility 0s; }
  .sth-rail:first-child { display: inline-grid; }
  .st-ed { position: relative; }
}
/* a laptop: the header's secondary buttons (View in Track, Estimate, Share) read as icons with their names in the
   tooltip, and the schedule chip is cut short, so the workflow's title and its save state keep their room */
@media (max-width: 1279px) {
  .sth-right > .btn .sth-lbl { display: none; }
  .sth-right > .btn { padding: 0 9px; }
  .sth-sched { max-width: 180px; }
}
@media (max-width: 900px) {
  .sth-lbl { display: none; }
  .sth-title { width: auto; max-width: 28vw; }
  /* a tablet in portrait: both rails over the canvas, so the canvas has the full width (and opens fitted to it) */
  .st-ed-body { grid-template-columns: minmax(0, 1fr); }
  .st-ed-right { position: absolute; z-index: 4; top: var(--st-head); bottom: 0; right: 0; width: min(420px, 100vw); transform: translateX(104%); visibility: hidden; transition: transform var(--t-2) var(--ease), visibility 0s linear var(--t-2); box-shadow: var(--shadow-float); }
  .st-ed-right.is-open { transform: none; visibility: visible; transition: transform var(--t-2) var(--ease), visibility 0s; }
  .st-ed-close { display: inline-grid; }
  .sth-rail { display: inline-grid; }
}
@media (max-width: 760px) {
  .st-ed.is-narrow .sth-rail:first-child { display: none; }
  .sth-title { flex: 1 1 auto; min-width: 0; }
  .sth-crumb, .sth-sep, .sth-save::after { display: none; }
  .sth-save-t { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .sth-save::before { width: 8px; height: 8px; }
  .sth { padding: 0 6px 0 8px; gap: 6px; }
  .sth-title { max-width: none; width: auto; font-size: 14px; }
  .sth-split .sth-run { padding: 0 10px; }
  .sth-split .sth-run-more { display: none; }
  .sth-split .sth-run { border-radius: 999px; }
  .sth-sched { display: none; }
  .st-dr-body { padding: 4px 12px 12px; }
  .sthome-goal { font-size: 16px; }
  .sth-est { grid-template-columns: 1fr; }
  .stv-prob-big { font-size: 44px; }
  .stv-mkt-p { width: 64px; }
  /* the report's head: back and the actions on one row, the title on its own line under them (never one word a line) */
  .sto-head > .grow { order: 9; flex: 1 1 100%; }
  .sto-head .eyebrow { white-space: normal; }
  .sth-lang, .sth-theme { display: none; }
  /* the translucent top bar would show the home's bright button scrolling under it as a glow */
  body:has(.sthome-hero) #topbar { background: var(--canvas); }
}

/* ================================================================== motion and print */
/* the smallest phones: the mark gives its room to the title and its save state (the bottom bar leads home) */
@media (max-width: 400px) {
  .sth-mark { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .st-ed-left, .st-ed-right { transition: none; }
}
@media print {
  #topbar, #tabbar, .sto-head, .sto-foot .btn, .toasts { display: none !important; }
  body, .page { background: #fff !important; color: #000 !important; }
  .sto-page { padding: 0 !important; max-width: none; }
  .stv-num, .stv-sec.is-explanation { background: #f4f4f6 !important; break-inside: avoid; }
  .stv-sec { break-inside: avoid-page; }
  a { color: inherit !important; text-decoration: underline; }
}

/* ================================================================== QA round 2 */
/* an empty canvas: how to start (clicks and double-clicks pass through to the canvas except on the example prompts) */
/* under the zoom bar and minimap (z 10), and set high enough to clear them */
.st-ed-empty { position: absolute; inset: 0; z-index: 1; display: grid; justify-items: start; align-items: start; padding: clamp(16px, 6vh, 56px) 16px 16px clamp(16px, 5vw, 56px); pointer-events: none; overflow: auto; }
.st-ed-empty[hidden] { display: none; }
.st-ed-empty-card { width: min(460px, 100%); padding: 24px 26px; border-radius: var(--r-card); background: var(--glass);
  -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  box-shadow: inset 0 0 0 1px var(--hair-2), var(--shadow-float); display: flex; flex-direction: column; gap: 12px; }
.st-ed-empty-t { font-size: 20px; font-weight: 650; letter-spacing: -0.02em; }
.st-ed-empty-ways { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; color: var(--ink-2); font-size: 14px; }
.st-ed-empty-ways li { display: flex; gap: 10px; align-items: flex-start; }
.st-ed-empty-ways svg { width: 16px; height: 16px; flex: none; margin-top: 2px; color: var(--ink-3); }
.st-ed-empty-ex { display: flex; flex-direction: column; gap: 6px; pointer-events: auto; }
/* an example goal may run to two lines: a rounded card, never a capsule holding two rows */
.st-ed-empty-chip { justify-content: flex-start; text-align: left; white-space: normal; height: auto; min-height: 34px; padding: 7px 12px; line-height: 1.35; border-radius: 14px; }

/* the version preview's legend */
.st-ver-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 0; padding: 0; list-style: none; font-size: 12px; color: var(--ink-2); }
.st-ver-legend li { display: inline-flex; align-items: center; gap: 6px; }
.st-ver-legend i { width: 12px; height: 12px; border-radius: 4px; box-shadow: inset 0 0 0 2px currentColor; }
.st-ver-legend .is-added i { color: var(--ok); }
.st-ver-legend .is-changed i { color: var(--warn); }
.st-ver-legend .is-removed i { color: var(--crit); box-shadow: none; outline: 2px dashed var(--crit); outline-offset: -2px; opacity: 0.7; }

/* freshness marks (inspector, watch list, output pages) */
.st-stale { display: inline-flex; align-items: center; gap: 5px; color: var(--warn-ink); }
.st-stale svg { width: 13px; height: 13px; }
.st-outdated { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 14px; border-radius: 14px; background: var(--warn-wash); color: var(--warn-ink); font-size: 13px; }
.st-outdated > span { flex: 1 1 200px; min-width: 0; }
.st-outdated svg { width: 15px; height: 15px; flex: none; }
.sti-watch-meta { display: block; margin-top: 2px; font-size: 11.5px; }

/* the output pages' breadcrumb: one line, cut at a word with an ellipsis, the page kind always visible */
.sto-crumb { display: flex; align-items: baseline; gap: 6px; min-width: 0; margin: 0; }
.sto-crumb-t { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sto-crumb-k { flex: none; }
.sto-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); gap: 12px; }
.sto-kpi { display: flex; flex-direction: column; gap: 4px; padding: 16px 18px; border-radius: var(--r-card); background: var(--s1); color: inherit; text-decoration: none; min-width: 0; }
.sto-kpi:hover { background: var(--s2); }
.sto-kpi-v { font-size: 28px; font-weight: 650; letter-spacing: -0.03em; line-height: 1.05; font-variant-numeric: tabular-nums; }
.sto-kpi-l { font-size: 12.5px; color: var(--ink-2); overflow-wrap: anywhere; }
.sto-missing { margin: 0; }
.stv-notes { margin: 6px 0 0; padding-left: 18px; display: flex; flex-direction: column; gap: 3px; list-style: disc; }

/* the approval's breakdown before deciding */
.stappr-kv { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; margin: 2px 0; font-size: 13px; }
.stappr-kv dt { color: var(--ink-3); }
.stappr-kv dd { margin: 0; font-variant-numeric: tabular-nums; min-width: 0; overflow-wrap: anywhere; }
.stappr-kv .is-total { font-weight: 650; }

/* QA round 3: an error's message first, its code a small muted chip; example placeholders never read as values */
.st-errline { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; }
.st-errcode { font-family: var(--mono); font-size: 10.5px; padding: 1px 6px; border-radius: 999px; background: var(--wash); color: var(--ink-3); }
.st-ed .field::placeholder, .st-ed textarea::placeholder, .stc-ctl::placeholder { color: var(--ink-4); font-style: italic; opacity: 1; }

/* report and dashboard number tiles: the name on one line (cut with an ellipsis, the whole label on hover), the range
   and kind on a quieter second line — never an awkward wrap */
.stv-num { min-width: 0; }
/* a tile's name may take two lines, wrapped evenly, so no essential word is cut ("Polymarket − Kalshi (pp)") */
.stv-num-l, .sto-kpi-l { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; min-width: 0; overflow: hidden; white-space: normal; text-wrap: balance; overflow-wrap: break-word; line-height: 1.3; }
.stv-num-l { color: var(--ink-2); }
/* the line under a headline number wraps (at 375 px "… · model · uncalibrated" is never cut to "uncalibra…", QA-6) */
.stv-num-m, .sto-kpi-m { display: block; min-width: 0; white-space: normal; overflow-wrap: break-word; text-wrap: pretty; font-size: var(--fs-cap); line-height: 1.35; color: var(--ink-3); }
/* the charts a report draws */
.stv-report-charts { display: grid; gap: 16px; margin: 8px 0 4px; }
.stv-report-chart { padding: 14px 16px 10px; border-radius: 16px; background: var(--s1); }
.stv-chart-node { display: inline-flex; align-items: center; gap: 4px; margin-top: 6px; }
.stv-chart-node svg { width: 13px; height: 13px; }
/* a list item ending in a colon holds the items after it */
.stv-md .stv-sublist { margin-top: 4px; list-style: circle; }
.st-stale-in { color: var(--warn-ink); }
@media print { .stv-report-chart { background: #f4f4f6 !important; break-inside: avoid; } .stv-chart-node { display: none; } }
.sti-watch-meta svg { width: 12px; height: 12px; margin-right: 4px; vertical-align: -2px; }
.stv-num-v, .sto-kpi-v { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stv-unit-s { margin-left: 0.25em; font-size: 0.55em; font-weight: 600; letter-spacing: 0; color: var(--ink-2); }

/* QA round 5: the alert that watches a monitor, said where the monitor is */
.sti-alert, .sto-alert { display: flex; align-items: center; gap: 6px; color: var(--ink-2); }
.sti-alert svg, .sto-alert svg { width: 13px; height: 13px; flex: none; }
.stv-number-verdict { font-weight: 550; color: var(--ink); }
/* QA-5 integration: a relationship's plain finding leads its tile and its result block (a sentence, not a figure) */
.stv-num-v.is-finding, .sto-kpi-v.is-finding { font-size: 15px; font-weight: 600; letter-spacing: 0; line-height: 1.3; white-space: normal; overflow: visible; text-overflow: clip; font-variant-numeric: tabular-nums; }
.sta-hl-v.is-finding { font-size: 15px; font-weight: 600; line-height: 1.35; letter-spacing: 0; }
.stv-prob-clip { color: var(--ink-3); }
.sti-post { display: grid; gap: 6px; }
.sti-post-note { white-space: pre-wrap; border-left: 2px solid var(--hair-2); padding-left: 8px; }
.stappr-kv dd.is-warn { color: var(--warn-ink); font-weight: 600; }
.stv-num:has(.is-finding), .sto-kpi:has(.is-finding) { grid-column: 1 / -1; }
/* QA round 6 integration: the posted words in the person's language, an earnings deadline the run re-derived, a
   trigger's kind above its description */
.sti-gloss { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; margin: 0; border-left: 2px solid var(--hair-2); padding-left: 8px; }
.sti-gloss dd { margin: 0; }
.sti-inplace { display: grid; gap: 6px; }
.sti-rederived { display: grid; gap: 2px; padding: 8px 10px; border: 1px solid var(--hair-2); border-radius: 8px; }
.sti-rederived-d { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sti-rederived-b { color: var(--ink-2); }
.sti-stored > summary { cursor: pointer; color: var(--ink-3); }
.stt-kind { margin: 0 0 2px; }
.sta-numbers li.is-aging .sta-num-val { color: var(--ink-2); }
