/* studio-kit UI theme: "Graphite Workbench", from the PCB studio. Every colour comes from here.
   A studio sets only its accent: :root { --accent: #ffd23f; } — the soft and hover shades follow. */
@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600;700&family=IBM+Plex+Sans:wght@400;500;600&display=swap');

:root {
  --bg: #16181b;
  --chrome: #111315;
  --panel: #1f2226;
  --panel2: #25292e;
  --line: #33383f;
  --line-strong: #4a5058;
  --text: #e4e6e9;
  --dim: #a3a9b1;
  --faint: #8a919a;
  --accent: #f2a93b;
  --accent-ink: #1a1405;
  --accent-soft: color-mix(in srgb, var(--accent) 12%, transparent);
  --accent-hover: color-mix(in srgb, var(--accent) 82%, white);
  --pass: #5fc48a;
  --warn: #f2c14e;
  --fail: #f07a6a;
  --fail-soft: rgba(240, 122, 106, 0.12);
  --info: #8fb3e8;
  --mono: 'IBM Plex Mono', ui-monospace, 'SF Mono', monospace;
  --sans: 'IBM Plex Sans', system-ui, -apple-system, sans-serif;
  --radius: 3px;
  --radius-pop: 8px;
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  /* badges: the count pill (<sk-badge>), the numbered comment markers and the comment tool's pins are one family */
  --badge-radius: 999px;
  --badge-weight: 700;
  --badge-muted: var(--line);
  --badge-muted-ink: var(--dim);
  color-scheme: dark;
}

/* The names the studios' own pages use for the same tokens. */
:root {
  --raised: var(--panel2);
  --hover: color-mix(in srgb, var(--panel2) 85%, var(--text));
  --line2: var(--line-strong);
  --hi: var(--text);
  --muted: var(--dim);
}

/* agent4's palette: the warm ground, hairlines and Recursive of agent4.xyz. A page opts in with
   <html data-palette="agent4"> and loads Recursive itself (see the README); its accent stays its own. */
:root[data-palette="agent4"] {
  --sans: 'Recursive', system-ui, -apple-system, sans-serif;
  --mono: 'Recursive', ui-monospace, monospace;
}
:root[data-palette="agent4"]:not([data-theme="light"]) {
  --bg: #161513;
  --chrome: #121110;
  --panel: #1c1b18;
  --panel2: #22201d;
  --line: #2a2925;
  --line-strong: #3a3833;
  --text: #ece6d6;
  --dim: #9b968a;
  --faint: #6b675d;
  --pass: #8fd19e;
  --info: #8fbcff;
  --warn: #f0b44c;
  --fail: #f07167;
  --fail-soft: rgba(240, 113, 103, 0.12);
  --hover: #2c2a26;
}
:root[data-palette="agent4"] body { font-variation-settings: "MONO" 0, "CASL" 0, "CRSV" 0; }
:root[data-palette="agent4"] :is(code, kbd, .mono, .sk-ver b) { font-variation-settings: "MONO" 1, "CASL" 0, "CRSV" 0; }
/* the wordmark beside the mark: agent4<b>fabric</b> */
.sk-wm { font-family: 'Recursive', var(--sans); font-size: 18px; font-weight: 300; letter-spacing: -.02em; line-height: 1; color: var(--hi); }
.sk-wm b { font-weight: 300; color: var(--accent); }

/* A page showing a project by its public link marks itself with projectPage (body.sk-viewer): what edits is hidden. */
body.sk-viewer [data-edit] { display: none !important; }

/* The light workbench: the same pieces on paper. A page opts in with <html data-theme="light"> (or lets the person
   choose: see the README's "Light and dark"). Only the neutrals change; the studio's accent stays. */
:root[data-theme="light"] {
  --bg: #f4f2ed;
  --chrome: #fbfaf7;
  --panel: #ffffff;
  --panel2: #f3f1ec;
  --line: #e2ded5;
  --line-strong: #cfc9bc;
  --text: #23211e;
  --dim: #6b675d;
  --faint: #8f8a7f;
  --accent-ink: #ffffff;
  --accent-hover: color-mix(in srgb, var(--accent) 85%, black);
  --pass: #2f8a4c;
  --warn: #b7791f;
  --fail: #c8452c;
  --fail-soft: rgba(200, 69, 44, 0.1);
  --info: #3f63d6;
  --shadow: 0 8px 24px rgba(30, 25, 15, 0.12);
  color-scheme: light;
}

:where(.sk-pop, .sk-dialog, sk-comments, sk-comment-tool, sk-account, sk-connect, sk-section, sk-notice, sk-members, sk-sidebar, sk-tabs, sk-badge), :where(.sk-pop, .sk-dialog, sk-comments, sk-comment-tool, sk-account, sk-connect, sk-section, sk-notice, sk-members, sk-sidebar, sk-tabs, sk-badge) * { box-sizing: border-box; }
body { background: var(--bg); color: var(--text); font: 400 13px/1.4 var(--sans); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track, ::-webkit-scrollbar-corner { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 4px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: var(--line-strong); background-clip: padding-box; }

/* ---- controls ---- */
.sk-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 28px; padding: 0 12px; border-radius: var(--radius); border: 1px solid var(--line); background: transparent; color: var(--text); font: 500 12px/1 var(--mono); white-space: nowrap; cursor: pointer; text-decoration: none; }
.sk-btn:hover:not(:disabled) { border-color: var(--line-strong); background: var(--panel2); }
.sk-btn:disabled { cursor: default; opacity: 0.5; }
.sk-btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.sk-btn.primary:hover:not(:disabled) { background: var(--accent-hover); border-color: var(--accent-hover); }
.sk-btn.danger { border-color: var(--fail); color: var(--fail); }
.sk-btn.small { height: 22px; padding: 0 8px; font-size: 11px; }
.sk-btn.icon { width: 28px; padding: 0; }
.sk-btn.small.icon { width: 22px; }
.sk-btn.link { height: auto; padding: 0; border: 0; background: none; color: var(--accent); font-weight: 500; }
.sk-btn.link:hover:not(:disabled) { background: none; text-decoration: underline; }
.sk-input { background: var(--bg); border: 1px solid var(--line); border-radius: 2px; padding: 5px 8px; font: 500 12px/1.3 var(--mono); color: var(--text); }
.sk-input:focus { border-color: var(--accent); outline: none; }
textarea.sk-input { font-family: var(--sans); resize: vertical; width: 100%; }
.sk-tool { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-width: 50px; height: 46px; padding: 0 4px; border: 1px solid transparent; background: transparent; color: var(--text); border-radius: var(--radius); font: 500 10px/1 var(--mono); letter-spacing: 0.04em; cursor: pointer; }
.sk-tool:hover:not(:disabled) { background: var(--panel2); }
.sk-tool[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.sk-toolgroup { display: flex; flex-direction: column; padding: 0 8px; border-right: 1px solid var(--line); }
.sk-toolgroup > div { display: flex; gap: 2px; }
.sk-toolgroup > span { font: 600 9px/1 var(--mono); letter-spacing: 0.14em; color: var(--faint); text-align: center; padding-top: 4px; text-transform: uppercase; }
.sk-row { display: flex; align-items: center; gap: 8px; width: 100%; padding: 5px 12px; border: 0; background: transparent; color: var(--text); font: 400 12px/1.25 var(--mono); text-align: left; cursor: pointer; }
.sk-row:hover { background: var(--panel2); }
.sk-row[aria-selected="true"] { background: var(--accent-soft); color: var(--accent); box-shadow: inset 2px 0 var(--accent); }

/* ---- text and marks ---- */
.sk-kicker { font: 600 10px/1 var(--mono); letter-spacing: 0.14em; color: var(--dim); text-transform: uppercase; }
.sk-muted { color: var(--dim); }
.sk-faint { color: var(--faint); }
.sk-badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 7px; background: var(--panel2); border: 1px solid var(--line); color: var(--dim); font: 500 11px/1 var(--mono); border-radius: 2px; }
.sk-badge.accent { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.sk-badge.fail { background: var(--fail-soft); border-color: var(--fail); color: var(--fail); }
.sk-badge.pass { border-color: var(--pass); color: var(--pass); }
.sk-badge.small { padding: 1px 5px; font-size: 10px; }
/* the count badge: a pill on its label's line, gone when it has nothing to count. <sk-badge> or class="sk-badge count". */
sk-badge, .sk-badge.count { display: inline-flex; align-items: center; justify-content: center; flex: none; gap: 0; min-width: 16px; height: 16px; padding: 0 5px; border: 0; border-radius: var(--badge-radius); background: var(--badge-muted); color: var(--badge-muted-ink); font: var(--badge-weight) 10px/1 var(--mono); font-variant-numeric: tabular-nums; letter-spacing: 0; text-transform: none; white-space: nowrap; vertical-align: middle; }
sk-badge:empty, .sk-badge.count:empty, sk-badge[hidden] { display: none; }
sk-badge[tone="accent"], .sk-badge.count.accent { background: var(--accent); color: var(--accent-ink); }
sk-badge[tone="pass"], .sk-badge.count.pass { background: var(--pass); color: var(--accent-ink); }
sk-badge[tone="fail"], .sk-badge.count.fail { background: var(--fail); color: var(--accent-ink); }
/* a filter chip: a small button that stays pressed, with its count as a badge */
.sk-btn.sk-chip { gap: 5px; padding: 0 7px; }
.sk-btn.sk-chip[aria-pressed="true"], .sk-btn.sk-chip[aria-pressed="true"]:hover { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.sk-num { flex: none; display: inline-block; min-width: 20px; height: 20px; padding: 0 5px; border-radius: var(--badge-radius); border: 0; background: var(--accent); color: var(--accent-ink); font: var(--badge-weight) 11px/20px var(--mono); font-variant-numeric: tabular-nums; text-align: center; }
.sk-num.resolved { background: var(--pass); }
.sk-num.wontfix { background: var(--faint); }
.sk-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--line-strong); }
.sk-dot.live { background: var(--pass); box-shadow: 0 0 0 3px rgba(95, 196, 138, 0.18); }
.sk-dot.busy { background: var(--accent); }
.sk-dot.fail { background: var(--fail); }
.sk-code { display: block; min-width: 0; padding: 5px 7px; background: var(--panel2); border: 1px solid var(--line); border-radius: 2px; font: 400 11px/1.45 var(--mono); overflow-wrap: anywhere; white-space: pre-wrap; }
.sk-quote { margin-top: 3px; padding: 4px 6px; background: var(--bg); border-left: 2px solid var(--line-strong); color: var(--dim); font: 400 11px/1.4 var(--mono); overflow-wrap: anywhere; }
.sk-kv { color: var(--dim); }
.sk-kv b { color: var(--text); font-weight: 500; }

/* ---- surfaces ---- */
.sk-titlebar { display: flex; align-items: center; gap: 12px; height: 40px; padding: 0 10px; background: var(--chrome); border-bottom: 1px solid var(--line); flex-shrink: 0; }
.sk-titlebar nav { display: flex; align-self: stretch; gap: 2px; flex: 1; min-width: 0; overflow-x: auto; }
.sk-titlebar nav a { display: flex; align-items: center; padding: 0 14px; white-space: nowrap; text-decoration: none; font: 500 12px/1 var(--mono); color: var(--dim); border-top: 2px solid transparent; }
.sk-titlebar nav a[aria-current="page"] { color: var(--text); background: var(--bg); border-top-color: var(--accent); }
.sk-panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.sk-box { display: flex; flex-direction: column; gap: 6px; padding: 8px; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); }
.sk-pop { position: fixed; z-index: 100; padding: 10px; background: var(--panel2); border: 1px solid var(--accent); border-radius: var(--radius); box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 8px; }
.sk-dialog { border: 1px solid var(--line-strong); border-radius: var(--radius-pop); background: var(--panel); color: var(--text); padding: 0; box-shadow: var(--shadow); max-width: min(560px, 92vw); }
.sk-dialog::backdrop { background: rgba(0, 0, 0, 0.55); }
.sk-dialog > header { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.sk-dialog > header h2 { flex: 1; margin: 0; font: 600 12px/1 var(--mono); letter-spacing: 0.06em; }
.sk-dialog > section { padding: 12px; max-height: 75vh; overflow: auto; }
.sk-tabs { display: flex; gap: 14px; padding: 0 12px; border-bottom: 1px solid var(--line); }
.sk-tabs button { padding: 9px 0 8px; border: 0; border-bottom: 2px solid transparent; background: none; color: var(--dim); font: 600 10px/1 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; }
.sk-tabs button[aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent); }
.sk-statusbar { display: flex; flex-wrap: wrap; align-items: center; gap: 20px; min-height: 26px; padding: 4px 12px; background: var(--chrome); border-top: 1px solid var(--line); font: 400 11px/1.2 var(--mono); color: var(--dim); flex-shrink: 0; }
.sk-empty { padding: 10px 12px; color: var(--dim); font: 400 12px/1.5 var(--sans); }
.sk-progress { position: relative; display: inline-block; width: 140px; height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; vertical-align: middle; }
.sk-progress > span { position: absolute; inset: 0 auto 0 0; background: var(--accent); }
.sk-progress.sweep > span { width: 40%; animation: sk-sweep 1.2s linear infinite; }
@keyframes sk-sweep { from { transform: translateX(-100%); } to { transform: translateX(250%); } }

/* ---- <sk-section> ---- */
sk-section { display: flex; flex-direction: column; border-bottom: 1px solid var(--line); min-height: 0; }
sk-section > .sk-section-head { display: flex; align-items: center; gap: 6px; width: 100%; padding: 9px 12px; border: 0; background: transparent; color: var(--dim); font: 600 10px/1 var(--mono); letter-spacing: 0.14em; text-transform: uppercase; text-align: left; cursor: pointer; }
sk-section > .sk-section-head .sk-aside { margin-left: auto; letter-spacing: 0.04em; text-transform: none; font-weight: 500; }
sk-section > .sk-section-body { display: flex; flex-direction: column; min-height: 0; padding-bottom: 8px; }
sk-section[collapsed] > .sk-section-body { display: none; }

/* ---- <sk-notice> ---- */
sk-notice { position: fixed; right: 16px; top: 56px; z-index: 200; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; pointer-events: none; }
sk-notice > div { padding: 7px 12px; background: var(--panel2); border: 1px solid var(--line-strong); border-radius: var(--radius); box-shadow: var(--shadow); font: 500 12px/1.3 var(--mono); color: var(--text); max-width: 70vw; }
sk-notice > div.fail { border-color: var(--fail); color: var(--fail); }
sk-notice > div.pass { border-color: var(--pass); }

/* ---- <sk-comments> ---- */
sk-comments { display: flex; flex-direction: column; min-height: 0; }
sk-comments .sk-filters { display: flex; gap: 4px; padding: 0 12px 8px; }
sk-comments ol { list-style: none; margin: 0; padding: 0; overflow-y: auto; }
sk-comments li { display: flex; gap: 10px; align-items: flex-start; padding: 7px 12px; border-left: 2px solid transparent; cursor: pointer; }
sk-comments li:hover { background: var(--panel2); }
sk-comments li[aria-selected="true"] { background: var(--accent-soft); border-left-color: var(--accent); }
sk-comments li.done { opacity: 0.8; }
sk-comments .sk-c-main { flex: 1; min-width: 0; font: 400 12px/1.45 var(--sans); }
sk-comments .sk-c-head { display: flex; flex-wrap: wrap; gap: 0 6px; align-items: baseline; font: 400 10px/1.5 var(--mono); color: var(--faint); }
sk-comments .sk-c-head b { font: 600 12px var(--mono); color: var(--text); }
sk-comments .sk-c-status { font: 600 9px/1 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; }
sk-comments .sk-c-body { overflow-wrap: anywhere; white-space: pre-wrap; }
sk-comments li.done .sk-c-body { color: var(--dim); }
sk-comments .sk-c-reply { margin-top: 4px; padding-left: 8px; border-left: 2px solid var(--line); font-size: 12px; overflow-wrap: anywhere; white-space: pre-wrap; }
sk-comments .sk-c-reply .who { font: 600 10px var(--mono); color: var(--dim); }
sk-comments .sk-c-reply.agent .who { color: var(--accent); }
sk-comments .sk-c-actions { display: none; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
sk-comments li:hover .sk-c-actions, sk-comments li:focus-within .sk-c-actions, sk-comments li[aria-selected="true"] .sk-c-actions, sk-comments .sk-c-composer .sk-c-actions { display: flex; }
sk-comments .sk-c-composer { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
sk-comments .sk-c-hint { font: 400 10px var(--mono); color: var(--faint); }

/* ---- <sk-account> / <sk-connect> ---- */
sk-account, sk-connect { display: flex; flex-direction: column; gap: 12px; }
sk-account .sk-a-row, sk-connect .sk-a-row { display: flex; gap: 6px; align-items: stretch; }
sk-account .sk-a-row .sk-code, sk-connect .sk-a-row .sk-code { flex: 1; }
sk-account ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
sk-account li { display: flex; align-items: center; gap: 8px; font: 400 12px var(--mono); }
sk-account li span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
sk-account p, sk-connect p { margin: 0; color: var(--dim); font: 400 12px/1.45 var(--sans); }

/* ---- <sk-comment-tool>: lies over the studio's surface (its parent should be position: relative) ---- */
sk-comment-tool { position: absolute; inset: 0; z-index: 5; pointer-events: none; touch-action: none; }
sk-comment-tool[mode="comment"], sk-comment-tool[mode="draw"] { pointer-events: auto; cursor: crosshair; }
sk-comment-tool .sk-ct-layer { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
sk-comment-tool .sk-ct-box { fill: var(--accent-soft); stroke: var(--accent); stroke-width: 1.5; stroke-dasharray: 4 3; }
sk-comment-tool .sk-ct-ink { fill: none; stroke: var(--accent); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
sk-comment-tool .sk-ct-dot { fill: var(--accent); stroke: var(--accent-ink); stroke-width: 1.5; }
sk-comment-tool .sk-ct-mark { opacity: 0.75; }
sk-comment-tool .sk-ct-mark.resolved { stroke: var(--pass); fill: transparent; }
sk-comment-tool .sk-ct-mark.wontfix { stroke: var(--faint); fill: transparent; }
sk-comment-tool .sk-ct-pins { position: absolute; inset: 0; pointer-events: none; }
sk-comment-tool .sk-ct-pins .sk-num { position: absolute; transform: translate(-50%, -120%); pointer-events: auto; cursor: pointer; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.45); }
/* inside an <sk-viewport> the marks are drawn in nested frames that stretch with the picture: lines keep their width */
sk-comment-tool .sk-ct-layer svg { overflow: visible; }
sk-comment-tool .sk-ct-layer svg * { vector-effect: non-scaling-stroke; }
sk-comment-tool .sk-ct-spot { fill: none; stroke: var(--accent); stroke-width: 11; stroke-linecap: round; }
/* ---- <sk-viewport>: pan, zoom and fit around a studio's picture; its own layers are styled in its shadow root ---- */
sk-viewport:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.sk-ct-title { font: 600 12px var(--mono); color: var(--accent); overflow-wrap: anywhere; }

sk-members { display: block; }
sk-members .sk-row { display: flex; align-items: center; gap: 6px; margin: 4px 0; }
sk-account-button, sk-share-button { display: inline-block; }
sk-share-button[hidden] { display: none; }

/* an account an agent made, with no passkey yet: the browser is all that holds it */
.sk-btn.sk-unsaved { border-color: var(--warn); }
.sk-btn.sk-unsaved::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--warn); }
.sk-a-save { display: grid; gap: 8px; padding: 12px; border: 1px solid var(--warn); border-radius: var(--radius-pop); background: color-mix(in srgb, var(--warn) 6%, transparent); }
.sk-a-save p { margin: 0; }

/* <sk-viewer-bar>: what a public link's visitor sees above a shared project */
sk-viewer-bar { display: block; }
sk-viewer-bar[hidden] { display: none; }
.sk-vbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 8px 14px; border-bottom: 1px solid var(--line); background: var(--chrome); font: 400 12px/1.4 var(--sans); color: var(--dim); }
.sk-vbar b { color: var(--text); font-weight: 600; }
.sk-vbar .sk-vbar-sp { flex: 1; }
.sk-pass { color: var(--pass); }

/* <sk-storyboard>: the sketch stage's directions, frames and pick */
.sk-sb { display: block; padding: 16px 20px 40px; overflow: auto; color: var(--text); font: 13px/1.4 var(--sans); }
.sk-sb-empty { max-width: 460px; margin: 60px auto; text-align: center; }
.sk-sb-empty p { color: var(--dim); }
.sk-sb-bar { position: sticky; top: -16px; z-index: 2; display: flex; gap: 10px; align-items: center; padding: 10px 0 12px; margin-bottom: 8px; background: var(--bg); border-bottom: 1px solid var(--line); }
.sk-sb-status { display: flex; flex-direction: column; gap: 2px; min-width: 200px; flex: 1; }
.sk-sb-sentence { color: var(--dim); }
.sk-sb-sentence.on { color: var(--text); font-weight: 600; }
.sk-sb-note { flex: 1.4; min-width: 200px; resize: vertical; }
.sk-sb-ghost { background: transparent; }
.sk-sb-dir { padding: 14px 0 18px; border-bottom: 1px solid var(--line); }
.sk-sb-dir.picked .sk-sb-letter { outline: 3px solid var(--text); outline-offset: 2px; }
.sk-sb-head { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 10px; }
.sk-sb-letter { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 6px; background: var(--dir); color: #fff; font: 800 18px/1 var(--sans); }
.sk-sb-words { flex: 1; min-width: 0; }
.sk-sb-words b { font-size: 15px; }
.sk-sb-words p { margin: 2px 0 0; color: var(--dim); max-width: 900px; }
.sk-sb-refs { display: flex; gap: 8px; margin: 0 0 12px 46px; overflow-x: auto; }
.sk-sb-ref { flex: none; width: 120px; color: var(--dim); text-decoration: none; font-size: 11.5px; }
.sk-sb-ref img { display: block; width: 120px; height: 80px; object-fit: cover; border-radius: var(--radius); background: var(--panel2); margin-bottom: 3px; }
.sk-sb-ref:hover { color: var(--text); }
.sk-sb-frames { display: flex; gap: 14px; overflow-x: auto; padding: 4px 4px 6px 46px; }
.sk-sb-frame { flex: none; padding: 0; border: 0; background: none; color: inherit; text-align: left; cursor: pointer; font: inherit; }
.sk-sb-shot { position: relative; overflow: hidden; border-radius: 5px; background: #f3f1ec; box-shadow: 0 0 0 1px var(--line); }
.sk-sb-shot iframe { position: absolute; left: 0; top: 0; border: 0; transform-origin: 0 0; pointer-events: none; }
.sk-sb-frame:hover .sk-sb-shot { box-shadow: 0 0 0 2px var(--line-strong); }
.sk-sb-frame.picked .sk-sb-shot { box-shadow: 0 0 0 3px var(--text); }
.sk-sb-frame.sel .sk-sb-shot { box-shadow: 0 0 0 3px var(--accent); }
.sk-sb-cap { margin-top: 6px; }
.sk-sb-cap b { margin-right: 6px; color: var(--dir); }
.sk-sb-meta { color: var(--faint); font-size: 11.5px; margin-top: 1px; }

/* <sk-presence>: who is in the project now */
sk-presence { display: inline-flex; align-items: center; gap: 8px; }
sk-presence[hidden] { display: none; }
.sk-avatars { display: inline-flex; align-items: center; }
.sk-avatar { display: inline-grid; place-items: center; width: 26px; height: 26px; margin-left: -6px; padding: 0; border-radius: 50%; border: 2px solid var(--peer, var(--line-strong)); background: var(--panel2); color: var(--text); font: 600 10px/1 var(--mono); cursor: pointer; box-shadow: 0 0 0 2px var(--chrome); }
.sk-avatar:first-child { margin-left: 0; }
.sk-avatar:hover:not(:disabled) { background: color-mix(in srgb, var(--peer) 24%, var(--panel2)); }
.sk-avatar.following { background: var(--peer); color: #111315; }
.sk-avatar.me { cursor: default; opacity: 0.85; }
.sk-avatar.more { border-color: var(--line-strong); color: var(--dim); cursor: default; }
.sk-agent-chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel2); color: var(--dim); font: 500 11px/1 var(--mono); white-space: nowrap; max-width: 180px; overflow: hidden; text-overflow: ellipsis; }
.sk-agent-chip.working { border-color: var(--accent); color: var(--accent); }
.sk-agent-chip.working svg { animation: sk-pulse 1.4s ease-in-out infinite; }
@keyframes sk-pulse { 50% { opacity: 0.35; } }
@media (prefers-reduced-motion: reduce) { .sk-agent-chip.working svg { animation: none; } .sk-cursor { transition: none !important; } }

/* <sk-cursors>: the others' cursors over the studio's surface */
sk-cursors { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 5; }
.sk-cursor { position: absolute; left: 0; top: 0; display: flex; align-items: flex-start; will-change: transform; transition: transform 90ms linear; }
.sk-cursor i { width: 0; height: 0; border-left: 5px solid transparent; border-right: 5px solid transparent; border-bottom: 13px solid var(--peer); transform: translate(-3px, -2px) rotate(-28deg); filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.5)); }
.sk-cursor span { margin: 10px 0 0 2px; padding: 2px 6px; border-radius: 3px; background: var(--peer); color: #111315; font: 600 10px/1.3 var(--mono); white-space: nowrap; }

/* ---- tiledPanes(): the customisable view panels ---- */
.sk-panes { position: relative; overflow: hidden; background: var(--chrome); }
.sk-pane { position: absolute; display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--line); border-radius: 4px; background: var(--bg); z-index: 1; }
.sk-pane.focused { border-color: var(--line-strong); }
.sk-pane-head { display: flex; align-items: stretch; gap: 2px; height: 32px; padding: 0 4px 0 6px; background: var(--panel); border-bottom: 1px solid var(--line); flex: none; }
.sk-pane.focused .sk-pane-head { background: var(--panel2); }
.sk-pane-tabs { display: flex; gap: 2px; min-width: 0; overflow: hidden; }
.sk-pane-tabs button { display: flex; align-items: center; gap: 5px; padding: 0 10px; border: 0; border-top: 2px solid transparent; background: transparent; color: var(--dim); font: 600 10px/1 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; white-space: nowrap; cursor: pointer; }
.sk-pane-tabs button[aria-selected="true"] { border-top-color: var(--accent); background: var(--bg); color: var(--text); }
.sk-pane-tabs button.elsewhere { color: var(--faint); }
.sk-pane-sp { flex: 1; }
.sk-pane-btn { display: flex; align-items: center; justify-content: center; width: 26px; height: 24px; align-self: center; border: 0; border-radius: var(--radius); background: transparent; color: var(--dim); cursor: pointer; }
.sk-pane-btn:hover:not(:disabled) { background: var(--line); color: var(--text); }
.sk-pane-btn:disabled { opacity: 0.35; cursor: default; }
.sk-pane-body { flex: 1; position: relative; min-height: 0; }
.sk-splitter { position: absolute; z-index: 6; border-radius: 3px; }
.sk-splitter.row { width: 8px; cursor: col-resize; }
.sk-splitter.col { height: 8px; cursor: row-resize; }
.sk-splitter.row:hover, .sk-splitter.row:focus-visible, .sk-splitter.row:active { background: linear-gradient(to right, transparent 3px, var(--accent) 3px, var(--accent) 5px, transparent 5px); outline: none; }
.sk-splitter.col:hover, .sk-splitter.col:focus-visible, .sk-splitter.col:active { background: linear-gradient(to bottom, transparent 3px, var(--accent) 3px, var(--accent) 5px, transparent 5px); outline: none; }
.sk-pane-overlay { position: absolute; inset: 0; z-index: 8; pointer-events: none; }
.sk-pane-overlay > .sk-pane-drop { position: absolute; display: flex; align-items: center; justify-content: center; border-radius: 4px; pointer-events: auto; background: color-mix(in srgb, var(--bg) 60%, transparent); outline: 1px dashed var(--line-strong); outline-offset: -2px; color: var(--dim); font: 600 11px/1 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; }
.sk-pane-overlay > .sk-pane-drop.on { background: var(--accent-soft); outline: 2px solid var(--accent); color: var(--accent); }

/* ---- the studio shell: .sk-shell lays a main area and an <sk-sidebar> side by side (stacked on a narrow screen) ---- */
.sk-shell { display: flex; flex: 1; min-width: 0; min-height: 0; }
.sk-shell > :not(sk-sidebar) { flex: 1; min-width: 0; min-height: 0; }

/* ---- <sk-sidebar>: resizable, collapsible; its width is --sk-side-width, its height as a sheet --sk-side-height ---- */
sk-sidebar { position: relative; display: flex; flex-direction: column; flex: none; width: var(--sk-side-width, 360px); max-width: calc(100% - 160px); min-width: 0; min-height: 0; background: var(--panel); border-left: 1px solid var(--line); }
sk-sidebar[hidden] { display: none; }
sk-sidebar[side="left"] { border-left: 0; border-right: 1px solid var(--line); }
/* the handle lies over the inner edge, above whatever the main area draws there */
sk-sidebar > .sk-side-handle { position: absolute; top: 0; bottom: 0; left: -5px; width: 9px; z-index: 20; cursor: col-resize; touch-action: none; }
sk-sidebar[side="left"] > .sk-side-handle { left: auto; right: -5px; }
sk-sidebar > .sk-side-handle:hover, sk-sidebar > .sk-side-handle:focus-visible, sk-sidebar[resizing] > .sk-side-handle { background: linear-gradient(to right, transparent 3px, var(--accent) 3px, var(--accent) 6px, transparent 6px); outline: none; }
.sk-side-btn { display: flex; align-items: center; justify-content: center; flex: none; width: 26px; height: 24px; padding: 0; border: 0; border-radius: var(--radius); background: transparent; color: var(--dim); cursor: pointer; }
.sk-side-btn:hover { background: var(--line); color: var(--text); }
sk-sidebar[side="left"] .sk-side-btn > svg { transform: scaleX(-1); }
.sk-side-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex: none; height: 37px; padding: 0 5px 0 12px; border-bottom: 1px solid var(--line); }
.sk-side-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--dim); font: 600 10px/1 var(--mono); letter-spacing: 0.14em; text-transform: uppercase; }
.sk-side-rail { display: none; }
@media (width > 900px) {
  /* collapsed: a rail with the button that brings it back, the count that needs attention, and its name */
  sk-sidebar[collapsed] { width: 36px; }
  sk-sidebar[collapsed] > :not(.sk-side-rail) { display: none !important; }
  sk-sidebar[collapsed] > .sk-side-rail { display: flex; flex: 1; flex-direction: column; align-items: center; gap: 10px; min-height: 0; padding: 6px 0; cursor: pointer; }
  sk-sidebar[collapsed] > .sk-side-rail:hover { background: var(--panel2); }
  .sk-side-rail > .sk-side-name { writing-mode: vertical-rl; }
}
@media (max-width: 900px) {
  /* a narrow screen: the sidebar is a sheet under the main area, with the handle on its top edge */
  .sk-shell { flex-direction: column; }
  sk-sidebar, sk-sidebar[side="left"] { order: 1; width: auto; max-width: none; height: var(--sk-side-height, 45%); min-height: 120px; max-height: 80%; border-left: 0; border-right: 0; border-top: 1px solid var(--line); }
  sk-sidebar > .sk-side-handle, sk-sidebar[side="left"] > .sk-side-handle { top: -8px; bottom: auto; left: 0; right: 0; width: auto; height: 16px; cursor: row-resize; }
  sk-sidebar > .sk-side-handle:hover, sk-sidebar > .sk-side-handle:focus-visible, sk-sidebar[resizing] > .sk-side-handle { background: linear-gradient(to bottom, transparent 6px, var(--accent) 6px, var(--accent) 9px, transparent 9px); }
  sk-sidebar > .sk-side-handle::after { content: ""; position: absolute; left: 50%; top: 5px; width: 36px; height: 5px; margin-left: -18px; border-radius: 3px; background: var(--line-strong); }
  /* collapsed: only its tab bar (or its header) stays */
  sk-sidebar[collapsed] { height: auto; min-height: 0; }
  sk-sidebar[collapsed] > :not(sk-tabs, .sk-side-head) { display: none !important; }
  sk-sidebar[collapsed] > sk-tabs { flex: none; }
  sk-sidebar[collapsed] > sk-tabs > sk-tab { display: none; }
  sk-sidebar[collapsed] .sk-tabs-bar, sk-sidebar[collapsed] > .sk-side-head { border-bottom: 0; }
}

/* ---- <sk-tabs> and its <sk-tab> panels ---- */
sk-tabs { display: flex; flex-direction: column; flex: 1; min-width: 0; min-height: 0; }
sk-tab { display: block; flex: 1; min-width: 0; min-height: 0; overflow: auto; }
sk-tabs[hidden], sk-tab[hidden] { display: none; }
.sk-tabs-bar { display: flex; align-items: stretch; flex: none; min-width: 0; border-bottom: 1px solid var(--line); }
.sk-tablist { position: relative; display: flex; flex: 1; min-width: 0; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.sk-tablist::-webkit-scrollbar { display: none; }
/* a tab is one line: its words and its badge never wrap. While every label fits, the tabs share the bar. */
.sk-tablist > button { display: inline-flex; align-items: center; justify-content: center; gap: 5px; flex: 1 0 auto; min-width: 0; height: 36px; padding: 0 7px; border: 0; border-bottom: 2px solid transparent; background: none; color: var(--dim); font: 600 12px/1 var(--sans); letter-spacing: 0; white-space: nowrap; cursor: pointer; }
.sk-tablist > button[hidden] { display: none; }
.sk-tablist > button:hover { color: var(--text); }
.sk-tablist > button[aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent); }
.sk-tablist > button:focus-visible { outline-offset: -2px; }
.sk-tablist > button > svg { display: none; flex: none; }
.sk-tab-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
/* compact (the labels no longer fit): the selected tab keeps its words, the others show their icon alone, or shorten;
   compact="icons" (narrower still): the selected tab is its icon too */
sk-tabs[compact] .sk-tablist > button { flex: 1 1 auto; min-width: 48px; }
sk-tabs[compact] .sk-tablist > button > svg { display: block; }
sk-tabs[compact] .sk-tablist > button[aria-selected="true"] { flex-shrink: 0; }
sk-tabs[compact] .sk-tablist > button.has-icon:not([aria-selected="true"]), sk-tabs[compact="icons"] .sk-tablist > button.has-icon { flex: 1 0 auto; min-width: 32px; padding: 0 4px; }
sk-tabs[compact] .sk-tablist > button.has-icon:not([aria-selected="true"]) > .sk-tab-label, sk-tabs[compact="icons"] .sk-tablist > button.has-icon > .sk-tab-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.sk-tabs-tools { display: flex; align-items: center; gap: 2px; flex: none; padding: 0 5px 0 2px; }
.sk-tabs-tools:empty { display: none; }

/* ---- rendering states: <sk-working> (the studio's craft drawing itself while it makes the picture) and .sk-skel ---- */
sk-working { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 10px; padding: 24px; color: var(--text); text-align: center; pointer-events: none; z-index: 2;
  background: radial-gradient(closest-side, transparent 35%, var(--bg) 100%), var(--bg); }
.sk-working-art { width: min(440px, 70%); }
.sk-working-art svg { display: block; width: 100%; height: auto; overflow: visible; }
.sk-working-cap { display: flex; gap: 10px; align-items: baseline; font-size: 14px; }
.sk-working-cap b { font-weight: 500; }
.sk-working-cap span { font: 12px var(--mono); color: var(--dim); }
.sk-working-note { margin: 0; max-width: 46ch; font-size: 12.5px; color: var(--dim); }
sk-working .sk-draw { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 1;
  animation: sk-draw 4.8s infinite; animation-delay: calc(var(--at, 0) * 4.8s - 4.8s); }
sk-working .sk-draw.thin { stroke-width: 1; opacity: .8; }
sk-working .sk-draw.axis { stroke: var(--line-strong); stroke-width: 1; stroke-dasharray: 12 4 2 4; stroke-dashoffset: 0; animation: none; }
sk-working .sk-draw-fill { opacity: 0; animation: sk-draw-fade 4.8s infinite; animation-delay: calc(var(--at, .3) * 4.8s - 4.8s); }
sk-working .sk-draw-text { font: 11px var(--mono); fill: var(--accent); opacity: 0; animation: sk-draw-fade 4.8s infinite; animation-delay: calc(var(--at, .5) * 4.8s - 4.8s); }
@keyframes sk-draw { 0% { stroke-dashoffset: 1; } 20%, 80% { stroke-dashoffset: 0; } 92%, 100% { stroke-dashoffset: 1; } }
@keyframes sk-draw-fade { 0% { opacity: 0; } 10%, 80% { opacity: 1; } 92%, 100% { opacity: 0; } }
.sk-skel { display: block; border-radius: 5px; background: linear-gradient(90deg, var(--panel2) 0%, var(--line) 40%, var(--panel2) 80%); background-size: 300% 100%; animation: sk-skel 1.6s infinite linear; }
.sk-skel.head { height: 10px; width: 40%; margin: 18px 0 12px; }
.sk-skel.row { height: 14px; margin: 10px 0; }
.sk-skel.card { height: 44px; margin: 8px 0; }
@keyframes sk-skel { from { background-position: 100% 0; } to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) {
  sk-working .sk-draw { animation: none; stroke-dashoffset: 0; }
  sk-working .sk-draw-fill, sk-working .sk-draw-text { animation: none; opacity: 1; }
  .sk-skel { animation: none; }
}

/* <sk-versions>: a project's versions, newest first */
sk-versions { display: block; }
.sk-ver { padding: 8px 10px; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; align-items: center; }
.sk-ver b { font-family: var(--mono); }
.sk-ver .sk-ver-meta { grid-column: 1; color: var(--dim); font-size: 12px; }
.sk-ver .sk-ver-label { color: var(--accent); }
.sk-ver button { grid-row: 1 / span 2; grid-column: 2; }
.sk-ver.sk-ver-head b::after { content: " · current"; color: var(--dim); font-family: var(--sans); font-weight: 400; }
