/* Shapi · "Graphite". Warm graphite neutrals, monochrome primary actions, blue only for vector selection; the icons are the only color. */
:root {
  --pasteboard: oklch(0.17 0.006 60);
  --chrome: oklch(0.205 0.007 60);
  --raised: oklch(0.245 0.008 60);
  --raised-2: oklch(0.285 0.008 60);
  --line: oklch(0.30 0.008 60);
  --line-soft: oklch(0.26 0.008 60);
  --text: oklch(0.93 0.008 70);
  --muted: oklch(0.68 0.01 70);
  --faint: oklch(0.62 0.01 70);
  --accent: oklch(0.95 0.005 70);
  --accent-hover: oklch(0.88 0.006 70);
  --accent-ink: oklch(0.17 0.006 60);
  --accent-soft: oklch(0.95 0.005 70 / 0.09);
  --select: oklch(0.68 0.16 245);
  --select-soft: oklch(0.68 0.16 245 / 0.16);
  --live-pen: oklch(0.80 0.13 205);
  --ok: oklch(0.76 0.13 150);
  --warn: oklch(0.80 0.14 85);
  --bad: oklch(0.66 0.19 25);
  --art-a: oklch(0.215 0.007 60);
  --art-b: oklch(0.195 0.007 60);
  --art-ink: oklch(0.93 0.008 70);
  --grid: oklch(0.9 0.01 70 / 0.07);
  --handle: oklch(0.205 0.007 60);
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --r: 6px;
  --r-lg: 8px;
  --chat-w: 336px;
  --panel-w: 296px;
  color-scheme: dark;
}
body.vscode-light, body.vscode-high-contrast-light, body.theme-light {
  --pasteboard: oklch(0.94 0.004 70);
  --chrome: oklch(0.985 0.003 70);
  --raised: oklch(0.955 0.004 70);
  --raised-2: oklch(0.925 0.005 70);
  --line: oklch(0.885 0.006 70);
  --line-soft: oklch(0.915 0.005 70);
  --text: oklch(0.24 0.01 60);
  --muted: oklch(0.49 0.01 60);
  --faint: oklch(0.52 0.01 60);
  --accent: oklch(0.22 0.01 60);
  --accent-hover: oklch(0.32 0.01 60);
  --accent-ink: oklch(0.985 0.003 70);
  --accent-soft: oklch(0.22 0.01 60 / 0.07);
  --select: oklch(0.56 0.17 250);
  --select-soft: oklch(0.56 0.17 250 / 0.14);
  --live-pen: oklch(0.58 0.13 215);
  --ok: oklch(0.55 0.13 150);
  --warn: oklch(0.58 0.13 75);
  --bad: oklch(0.55 0.2 27);
  --art-a: oklch(0.995 0.002 70);
  --art-b: oklch(0.97 0.003 70);
  --art-ink: oklch(0.24 0.01 60);
  --grid: oklch(0.3 0.01 60 / 0.08);
  --handle: oklch(0.995 0.002 70);
  color-scheme: light;
}
@media (prefers-color-scheme: light) {
  body:not([class*="vscode"]):not(.theme-dark) {
    --pasteboard: oklch(0.94 0.004 70); --chrome: oklch(0.985 0.003 70); --raised: oklch(0.955 0.004 70); --raised-2: oklch(0.925 0.005 70);
    --line: oklch(0.885 0.006 70); --line-soft: oklch(0.915 0.005 70); --text: oklch(0.24 0.01 60); --muted: oklch(0.49 0.01 60); --faint: oklch(0.52 0.01 60);
    --accent: oklch(0.22 0.01 60); --accent-hover: oklch(0.32 0.01 60); --accent-ink: oklch(0.985 0.003 70); --accent-soft: oklch(0.22 0.01 60 / 0.07);
    --select: oklch(0.56 0.17 250); --select-soft: oklch(0.56 0.17 250 / 0.14);
  --live-pen: oklch(0.58 0.13 215); --ok: oklch(0.55 0.13 150); --warn: oklch(0.58 0.13 75); --bad: oklch(0.55 0.2 27);
    --art-a: oklch(0.995 0.002 70); --art-b: oklch(0.97 0.003 70); --art-ink: oklch(0.24 0.01 60); --grid: oklch(0.3 0.01 60 / 0.08); --handle: oklch(0.995 0.002 70);
    color-scheme: light;
  }
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--pasteboard); color: var(--text); font: 400 13px/1.45 var(--sans); overflow: hidden; -webkit-font-smoothing: antialiased; }
#app { height: 100vh; display: flex; flex-direction: column; }
button { font: inherit; color: inherit; }
code, kbd, .mono { font-family: var(--mono); font-size: 0.92em; }
code { background: var(--raised); padding: 1px 4px; border-radius: 4px; }
kbd { background: var(--raised); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; padding: 0 5px; font-size: 11px; }
h2 { font-size: 15px; font-weight: 600; margin: 0 0 4px; letter-spacing: -0.005em; }
h3 { font-size: 13px; font-weight: 600; margin: 0 0 12px; }
p { margin: 0 0 6px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.tiny { font-size: 11px; }
.pad { padding: 8px 0; }
.spacer { flex: 1; }
.row { display: flex; align-items: center; gap: 8px; }
.row.wrap { flex-wrap: wrap; margin: 8px 0; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.vsep { width: 1px; align-self: stretch; background: var(--line); margin: 0 4px; flex: none; }

/* buttons & controls */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 28px; padding: 0 12px; border-radius: var(--r); border: 1px solid var(--line); background: var(--raised); color: var(--text); cursor: pointer; white-space: nowrap; font-weight: 500; transition: background-color .15s cubic-bezier(.25,1,.5,1), border-color .15s; }
.btn:hover:not(:disabled) { background: var(--raised-2); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover:not(:disabled) { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover:not(:disabled), .btn.ghost.on { background: var(--raised); color: var(--text); }
.btn.small { height: 24px; padding: 0 8px; font-size: 12px; gap: 4px; }
.btn.icon { width: 28px; padding: 0; }
.btn.danger { color: var(--bad); }
.btn:disabled, .chip-btn:disabled, .tool:disabled, .opt:disabled { opacity: .45; cursor: default; }
:is(button, input, select, textarea, .btn):focus-visible { outline: 2px solid var(--select); outline-offset: 2px; }
.link { background: none; border: 0; padding: 0; color: var(--text); text-decoration: underline; text-underline-offset: 2px; text-decoration-color: var(--faint); cursor: pointer; font: inherit; }
.link:hover { text-decoration: underline; }
input, textarea, select { font: inherit; color: var(--text); background: var(--raised); border: 1px solid var(--line); border-radius: var(--r); padding: 4px 8px; outline: none; }
input:focus, textarea:focus, select:focus { border-color: var(--select); }
select { padding: 2px 6px; height: 24px; font-size: 12px; }
textarea { resize: vertical; }
.chip, .chip-ver, .badge { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px; border-radius: 999px; font-size: 12px; white-space: nowrap; border: 1px solid var(--line); background: transparent; }
.chip.quiet { color: var(--muted); }
.chip.bad { color: var(--bad); border-color: color-mix(in oklch, var(--bad) 45%, transparent); cursor: pointer; }
.chip-ver { font-family: var(--mono); font-weight: 600; color: var(--text); border-color: var(--line); background: var(--raised); }
.badge.ok { color: var(--ok); border-color: color-mix(in oklch, var(--ok) 35%, transparent); }
.badge.warn { color: var(--warn); border-color: color-mix(in oklch, var(--warn) 40%, transparent); cursor: help; max-width: 260px; overflow: hidden; text-overflow: ellipsis; }
.badge.bad { color: var(--bad); border-color: color-mix(in oklch, var(--bad) 40%, transparent); }
.badge.quiet { color: var(--faint); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); flex: none; }
.dot.ok { background: var(--ok); }
.chip.bad .dot { background: var(--bad); }
.spin { width: 14px; height: 14px; border: 2px solid color-mix(in oklch, var(--text) 20%, transparent); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; display: inline-block; flex: none; }
.spin.tiny { width: 10px; height: 10px; border-width: 1.5px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* top bar */
.topbar { height: 44px; flex: none; display: flex; align-items: center; gap: 8px; padding: 0 10px 0 12px; background: var(--chrome); border-bottom: 1px solid var(--line); position: relative; z-index: 20; }
.brand { display: flex; align-items: center; gap: 7px; font-size: 13px; }
.brand svg { color: var(--text); }
.switcher { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 8px; border-radius: var(--r); border: 1px solid transparent; background: transparent; cursor: pointer; }
.switcher:hover:not(:disabled) { background: var(--raised); border-color: var(--line); }
.topbar .file { padding: 0 4px; }
.menu { position: absolute; top: 40px; min-width: 240px; background: var(--chrome); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 4px; box-shadow: 0 12px 32px oklch(0 0 0 / .35); z-index: 30; }
.icons-menu { left: 140px; width: 320px; }
.more-menu { right: 10px; }
.menu-item { display: flex; align-items: center; gap: 8px; width: 100%; padding: 6px 8px; border: 0; background: none; border-radius: 4px; cursor: pointer; text-align: left; }
.menu-item:hover:not(:disabled) { background: var(--raised); }
.menu-item.on { background: var(--accent-soft); }
.menu-item .mono { flex: 1; }
.menu-item:disabled { opacity: .45; cursor: default; }
.menu-item .kbd { color: var(--faint); font-size: 11px; margin-left: auto; }
.menu-sep { height: 1px; background: var(--line); margin: 4px; }
.thumb.empty { border: 1px dashed var(--line); border-radius: 3px; }

/* workspace */
.ws { flex: 1; min-height: 0; display: grid; grid-template-columns: var(--chat-w) minmax(0, 1fr) var(--panel-w); }
.ws.chat-collapsed { grid-template-columns: 44px minmax(0, 1fr) var(--panel-w); }
.ws.style-mode { grid-template-columns: var(--chat-w) minmax(0, 1fr); }
.ws.style-mode.chat-collapsed { grid-template-columns: 44px minmax(0, 1fr); }
@media (max-width: 1100px) { :root { --chat-w: 300px; --panel-w: 272px; } }
@media (max-width: 760px) { :root { --panel-w: 240px; } }
.chat-rail { background: var(--chrome); border-right: 1px solid var(--line); display: flex; justify-content: center; padding-top: 8px; }
.chat-rail .btn svg { color: var(--accent); }

/* chat */
.chat { display: flex; flex-direction: column; min-height: 0; background: var(--chrome); border-right: 1px solid var(--line); }
.thread { flex: 1; overflow-y: auto; padding: 14px 14px 8px; display: flex; flex-direction: column; gap: 14px; }
.hero { margin: auto 0; padding: 12px 2px 24px; display: flex; flex-direction: column; gap: 10px; }
.hero h2 { font-size: 18px; }
.suggest { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-btn { height: 26px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--raised); cursor: pointer; font-size: 12px; transition: border-color .15s, background-color .15s; }
.chip-btn:hover:not(:disabled) { border-color: var(--accent); background: var(--accent-soft); }
.chip-btn.small { height: 22px; padding: 0 8px; font-size: 11.5px; }
.msg { display: flex; flex-direction: column; gap: 6px; }
.msg.user { align-items: flex-end; }
.bubble { max-width: 88%; background: var(--raised); border: 1px solid var(--line-soft); border-radius: var(--r-lg) var(--r-lg) 3px var(--r-lg); padding: 7px 10px; white-space: pre-wrap; word-break: break-word; }
.sent-chips { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.who { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; }
.who svg { color: var(--text); }
.who .muted { font-weight: 400; }
.msg.claude p { margin: 0; }
.msg.claude.undone > :not(.who):not(.msg-actions) { opacity: .45; }
.msg.err p { color: var(--bad); }
.ba { display: flex; align-items: center; gap: 8px; }
.ba .arrow { color: var(--faint); display: inline-flex; }
.tile { display: inline-flex; align-items: center; justify-content: center; border-radius: var(--r); background: var(--art-a); color: var(--art-ink); border: 1px solid var(--line-soft); box-sizing: content-box; padding: 6px; }
.tile.on { border-color: color-mix(in oklch, var(--accent) 55%, transparent); }
.vlink { background: none; border: 0; padding: 0; font: 600 12.5px var(--mono); color: var(--text); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; text-decoration-color: var(--faint); }
.vlink:hover { text-decoration: underline; }
.msg-actions { display: flex; gap: 2px; align-items: center; margin-left: -8px; }
.try { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.try .muted { margin-right: 2px; }
.alt-row { display: flex; align-items: center; gap: 10px; }
.note-line { display: flex; align-items: center; gap: 8px; color: var(--faint); font-size: 11.5px; }
.note-line::before, .note-line::after { content: ''; flex: 1; height: 1px; background: var(--line-soft); }
.note-line span { max-width: 80%; text-align: center; }
.qcard { border: 1px solid var(--line); border-radius: var(--r-lg); padding: 10px; display: flex; flex-direction: column; gap: 10px; background: var(--pasteboard); }
.qcard.done { opacity: .7; }
.q-t { font-weight: 600; font-size: 12.5px; margin-bottom: 6px; }
.q-opts { display: flex; flex-direction: column; gap: 4px; }
.opt { display: flex; align-items: center; gap: 6px; text-align: left; padding: 6px 8px; border: 1px solid var(--line); border-radius: var(--r); background: var(--raised); cursor: pointer; font-size: 12.5px; }
.opt span:first-of-type { flex: 1; }
.opt:hover:not(:disabled) { border-color: var(--faint); }
.opt.on { border-color: var(--accent); background: var(--accent-soft); }
.opt.on svg { color: var(--accent); }
.rec { font-size: 10.5px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; }
.steps li { display: flex; align-items: center; gap: 8px; color: var(--faint); }
.steps li.done { color: var(--muted); }
.steps li.done svg { color: var(--ok); }
.steps li.now { color: var(--text); }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); margin: 0 2.5px; animation: pulse 1.1s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; transform: scale(.8); } }
.todo { width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid var(--faint); margin: 0 2.5px; }
.signin { margin: 0 12px 8px; padding: 10px; border: 1px solid color-mix(in oklch, var(--bad) 40%, transparent); background: color-mix(in oklch, var(--bad) 8%, transparent); border-radius: var(--r-lg); font-size: 12.5px; display: flex; flex-direction: column; gap: 8px; }
.composer { margin: 0 12px 12px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--raised); padding: 6px; flex: none; transition: border-color .15s; }
.composer:focus-within { border-color: var(--select); }
.composer textarea { width: 100%; border: 0; background: transparent; resize: none; padding: 4px 6px; min-height: 40px; max-height: 160px; font-size: 13px; }
.composer textarea:focus, .composer textarea:focus-visible { border: 0; outline: none; }
.atts { display: flex; flex-wrap: wrap; gap: 4px; }
.atts:empty { display: none; }
.att { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 999px; border: 1px solid var(--line); background: var(--chrome); font-size: 11.5px; color: var(--muted); }
.att svg { color: var(--accent); }
.att.toggle { cursor: pointer; }
.att.toggle.on { color: var(--text); border-color: color-mix(in oklch, var(--select) 55%, transparent); background: var(--select-soft); }
.att.toggle.on svg { color: var(--select); }
.att .x { background: none; border: 0; color: var(--faint); cursor: pointer; padding: 0 0 0 2px; font-size: 14px; line-height: 1; }
.comp-row { display: flex; align-items: center; gap: 8px; padding: 2px 2px 0; }
.toggle-l { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); cursor: pointer; }
.toggle-l input { accent-color: var(--accent); margin: 0; }

/* canvas */
.canvas { display: flex; flex-direction: column; min-width: 0; min-height: 0; position: relative; background: var(--pasteboard); }
.canvas-top { position: absolute; top: 8px; left: 10px; right: 10px; display: flex; align-items: center; gap: 8px; z-index: 5; pointer-events: none; }
.canvas-top > * { pointer-events: auto; }
.ctl { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); background: var(--chrome); border: 1px solid var(--line); border-radius: var(--r); height: 28px; padding: 0 4px 0 8px; }
.ctl select { border: 0; background: transparent; height: 24px; }
.ctl.mono { padding: 0 8px; min-width: 56px; justify-content: center; }
.cmp-bar { display: flex; align-items: center; gap: 8px; background: var(--chrome); border: 1px solid var(--line); border-radius: var(--r); padding: 2px 4px 2px 10px; height: 32px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.seg button { background: none; border: 0; color: var(--muted); padding: 2px 10px; font-size: 12px; cursor: pointer; height: 22px; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button.on { background: var(--raised-2); color: var(--text); }
.canvas-wrap { flex: 1; position: relative; overflow: hidden; min-height: 0; touch-action: none; user-select: none; }
.canvas-wrap[data-tool="pen"], .canvas-wrap[data-tool="rect"], .canvas-wrap[data-tool="ellipse"], .canvas-wrap[data-tool="line"], .canvas-wrap[data-tool="comment"] { cursor: crosshair; }
.stage { position: absolute; border-radius: 2px; box-shadow: 0 0 0 1px color-mix(in oklch, var(--line) 65%, var(--text)), 0 8px 28px oklch(0 0 0 / .22); color: var(--art-ink); }
.stage.bg-artboard { background: var(--art-a); }
.stage.bg-checker { background-color: var(--art-a); background-image: conic-gradient(var(--art-b) 25%, transparent 0 50%, var(--art-b) 0 75%, transparent 0); background-size: 16px 16px; }
.stage.bg-light { background: oklch(0.995 0.002 70); color: oklch(0.24 0.01 60); }
.stage.bg-dark { background: oklch(0.2 0.006 60); color: oklch(0.93 0.008 70); }
.stage .ss-art, .stage .overlay, .stage .flash-layer, .stage .ghost-ref, .stage .cmp-prev, .stage .peek-prev, .stage .live-art { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.stage .overlay, .stage .flash-layer, .stage .ghost-ref, .stage .cmp-prev, .stage .peek-prev, .stage .live-art { pointer-events: none; }
.stage .ghost-ref { color: var(--select); opacity: .28; }
.stage .cmp-prev.onion { color: var(--bad); opacity: .45; }
.stage .cmp-prev.wipe { color: inherit; opacity: 1; }
.stage:has(.peek-prev) .ss-art { visibility: hidden; }
/* Live drawing: what Claude is writing right now, over the art. */
.stage:has(.live-art) .ss-art { visibility: hidden; }
.stage .live-art [data-live="new"] { animation: live-in .42s cubic-bezier(.25, 1, .5, 1) both; transform-box: fill-box; transform-origin: center; }
.stage .live-art [data-live="pen"] { color: var(--live-pen); }
.stage .live-art [data-live="tip"] { fill: var(--live-pen); stroke: none; filter: drop-shadow(0 0 0.6px var(--live-pen)); }
.stage .live-art [data-live="stale"] { opacity: .6; transition: opacity .2s; }
@keyframes live-in { from { opacity: 0; transform: scale(.94); } to { opacity: 1; transform: none; } }
.live-badge { position: absolute; top: 52px; left: 50%; transform: translateX(-50%); display: inline-flex; align-items: center; gap: 7px; padding: 4px 10px 4px 9px; border-radius: 999px; background: var(--raised); border: 1px solid var(--line); font-size: 11.5px; color: var(--muted); pointer-events: none; z-index: 3; font-variant-numeric: tabular-nums; }
@media (prefers-reduced-motion: reduce) { .stage .live-art [data-live="new"] { animation: none; } }
.wipe-handle { position: absolute; top: -8px; bottom: -8px; width: 2px; margin-left: -1px; background: var(--accent); cursor: ew-resize; z-index: 4; }
.wipe-handle::before { content: ''; position: absolute; top: 50%; left: -7px; width: 16px; height: 16px; margin-top: -8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px var(--pasteboard); }
.wipe-handle span { position: absolute; top: -20px; font-size: 11px; color: var(--muted); white-space: nowrap; }
.wipe-handle span:first-child { right: 8px; }
.wipe-handle span:last-child { left: 8px; }
.ss-art [data-ss-hidden] { visibility: hidden; }
.review-shimmer { position: absolute; inset: 0; z-index: 2; pointer-events: none; background: linear-gradient(110deg, transparent 25%, color-mix(in oklch, var(--live-pen) 18%, transparent) 42%, color-mix(in oklch, var(--live-pen) 30%, transparent) 50%, color-mix(in oklch, var(--live-pen) 18%, transparent) 58%, transparent 75%); background-size: 250% 100%; animation: shim 1.8s linear infinite; }
@media (prefers-reduced-motion: reduce) { .review-shimmer { animation: none; background-position: 50% 0; } }
.stage-shimmer { position: absolute; inset: 0; background: linear-gradient(100deg, transparent 30%, oklch(1 0 0 / .05) 50%, transparent 70%); background-size: 220% 100%; animation: shim 1.4s linear infinite; pointer-events: none; }
.shimmer { background: linear-gradient(100deg, var(--raised) 30%, var(--raised-2) 50%, var(--raised) 70%); background-size: 220% 100%; animation: shim 1.4s linear infinite; }
@keyframes shim { from { background-position: 120% 0; } to { background-position: -120% 0; } }
.grid-line { stroke: var(--grid); stroke-width: 1; vector-effect: non-scaling-stroke; fill: none; }
.keyline { fill: none; stroke: color-mix(in oklch, var(--select) 45%, transparent); stroke-width: 1; vector-effect: non-scaling-stroke; }
.grid-center { stroke: color-mix(in oklch, var(--select) 30%, transparent); stroke-width: 1; vector-effect: non-scaling-stroke; fill: none; stroke-dasharray: 4 4; }
.hover-outline { fill: none; stroke: var(--select); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.sel-outline, .sel-box { fill: none; stroke: var(--select); stroke-width: 1; vector-effect: non-scaling-stroke; }
.sel-handle { fill: var(--handle); stroke: var(--select); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.marquee { fill: var(--select-soft); stroke: var(--select); stroke-width: 1; vector-effect: non-scaling-stroke; }
.guide { stroke: oklch(0.66 0.22 350); stroke-width: 1; vector-effect: non-scaling-stroke; }
.dim-label { fill: var(--select); text-anchor: middle; font-family: var(--sans); font-weight: 600; paint-order: stroke; stroke: var(--pasteboard); stroke-width: 3px; vector-effect: non-scaling-stroke; }
.dim-label.strong { fill: oklch(0.99 0 0); stroke: var(--select); stroke-width: 6px; }
.node-anchor { fill: var(--handle); stroke: var(--select); stroke-width: 1.3; vector-effect: non-scaling-stroke; }
.node-anchor.on { fill: var(--select); }
.node-anchor.first { fill: var(--accent); stroke: var(--accent); }
.node-handle { fill: var(--select); stroke: var(--handle); stroke-width: 1; vector-effect: non-scaling-stroke; }
.node-arm { stroke: var(--select); stroke-width: 1; vector-effect: non-scaling-stroke; fill: none; }
.pen-rubber { stroke: var(--select); stroke-width: 1; vector-effect: non-scaling-stroke; fill: none; stroke-dasharray: 4 3; }
.flash { fill: none; stroke: var(--select); stroke-width: 3; vector-effect: non-scaling-stroke; animation: flash .9s cubic-bezier(.25,1,.5,1) forwards; }
@keyframes flash { from { opacity: 1; } to { opacity: 0; } }
.pins { position: absolute; inset: 0; pointer-events: none; overflow: visible; }
.pin { position: absolute; width: 22px; height: 22px; margin: -22px 0 0 -2px; border-radius: 11px 11px 11px 2px; background: var(--accent); color: var(--accent-ink); font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; pointer-events: auto; cursor: pointer; box-shadow: 0 2px 6px oklch(0 0 0 / .35); }
.pin.editing { outline: 2px solid var(--text); }
.pin-pop { position: absolute; pointer-events: auto; transform: translateY(-50%); z-index: 3; }
.pin-pop input { width: 260px; box-shadow: 0 6px 18px oklch(0 0 0 / .4); background: var(--chrome); }
.canvas-error { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; text-align: center; padding: 20px; color: var(--bad); font-family: var(--mono); font-size: 12px; background: var(--chrome); }
.dock { position: absolute; left: 50%; bottom: 76px; transform: translateX(-50%); display: flex; align-items: center; gap: 2px; padding: 4px; background: var(--chrome); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 24px oklch(0 0 0 / .28); z-index: 6; max-width: calc(100% - 24px); }
.tool { width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: var(--r); background: none; color: var(--muted); cursor: pointer; flex: none; transition: background-color .15s, color .15s; }
.tool:hover:not(:disabled) { background: var(--raised); color: var(--text); }
.tool.on { background: var(--select-soft); color: var(--select); }
.tool-hint { position: absolute; left: 12px; bottom: 74px; max-width: calc(100% - 24px); font-size: 11.5px; color: var(--muted); background: var(--chrome); border: 1px solid var(--line-soft); border-radius: 6px; padding: 3px 8px; pointer-events: none; z-index: 3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tool-hint:empty { display: none; }
.strip { height: 60px; flex: none; display: flex; align-items: center; gap: 12px; padding: 0 14px; border-top: 1px solid var(--line); background: var(--chrome); overflow: hidden; }
.sizes { display: flex; align-items: flex-end; gap: 14px; }
.sizes > span { display: flex; flex-direction: column; align-items: center; gap: 2px; color: var(--text); }
.sizes em { font-style: normal; font-size: 10px; color: var(--faint); font-family: var(--mono); }
.thumb { display: inline-flex; align-items: center; justify-content: center; flex: none; color: inherit; }
.thumb svg { display: block; overflow: visible; }
.thumb.px canvas { display: block; }
.thumb-err { color: var(--bad); font-weight: 700; }
.ctx { display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 12px; border-radius: var(--r); flex: none; }
.ctx.dark { background: oklch(0.2 0.006 60); color: oklch(0.93 0.008 70); }
.ctx.light { background: oklch(0.985 0.003 70); color: oklch(0.24 0.01 60); border: 1px solid var(--line); }
.ctx-new { outline: 1.5px dashed var(--accent); outline-offset: 3px; border-radius: 2px; display: inline-flex; }
@media (max-width: 1180px) { .ctx.light { display: none; } }

/* side panel */
.side { display: flex; flex-direction: column; min-height: 0; background: var(--chrome); border-left: 1px solid var(--line); }
.side-tabs { display: flex; height: 36px; flex: none; border-bottom: 1px solid var(--line-soft); padding: 0 6px; gap: 2px; }
.stab { background: none; border: 0; border-bottom: 2px solid transparent; color: var(--muted); padding: 0 8px; cursor: pointer; font-size: 12.5px; white-space: nowrap; }
.stab:hover { color: var(--text); }
.stab.on { color: var(--text); border-bottom-color: var(--accent); }
.side-body { flex: 1; overflow: auto; padding: 4px 12px 16px; display: flex; flex-direction: column; }
.sec-h { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line-soft); flex-wrap: wrap; }
.sec { padding: 10px 0; border-bottom: 1px solid var(--line-soft); display: flex; flex-direction: column; gap: 6px; }
.sec-t { display: flex; align-items: center; gap: 8px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: 2px; }
.sec-t .muted { text-transform: none; letter-spacing: 0; font-weight: 400; color: var(--faint); }
.grid4, .grid2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 6px; }
.grid4 label, .grid2 label { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--faint); }
.grid4 input, .grid2 input { flex: 1; min-width: 0; height: 26px; padding: 0 6px; font-family: var(--mono); font-size: 12px; font-variant-numeric: tabular-nums; }
.prop-row { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 6px; align-items: center; }
.prop-row > label { font-size: 12px; color: var(--muted); }
.prop-row input { height: 26px; padding: 0 6px; font-family: var(--mono); font-size: 12px; min-width: 0; }
.prop-row.paint { grid-template-columns: 52px 24px minmax(0, 1fr) auto auto auto; }
.swatch { width: 24px; height: 24px; padding: 0; border-radius: 4px; border: 1px solid var(--line); background: none; cursor: pointer; }
.swatch::-webkit-color-swatch-wrapper { padding: 2px; }
.swatch::-webkit-color-swatch { border: none; border-radius: 2px; }
.swatch.is-none { background: linear-gradient(135deg, transparent 45%, var(--bad) 45% 55%, transparent 55%); }
.swatch.is-none::-webkit-color-swatch { opacity: 0; }
.mini { background: var(--raised); color: var(--text); border: 1px solid var(--line); border-radius: 4px; font-size: 11px; height: 22px; padding: 0 6px; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.mini:hover { background: var(--raised-2); }
.mini.on { background: var(--select-soft); color: var(--select); border-color: color-mix(in oklch, var(--select) 40%, transparent); }
.segmented { display: inline-flex; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; width: fit-content; }
.segmented button { background: none; border: 0; color: var(--muted); padding: 0 10px; height: 24px; font-size: 12px; cursor: pointer; }
.segmented button + button { border-left: 1px solid var(--line); }
.segmented button.on { background: var(--raised-2); color: var(--text); }
.iconrow { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.ib { background: var(--raised); color: var(--text); border: 1px solid var(--line-soft); border-radius: var(--r); width: 30px; height: 28px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.ib:hover:not(:disabled) { background: var(--raised-2); }
.ib:disabled { opacity: .35; cursor: default; }
.ib.wide { width: auto; padding: 0 8px; gap: 5px; font-size: 12px; }
.row.tight { gap: 4px; flex-wrap: wrap; }
.inline { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); }
.inline input { width: 56px; height: 24px; padding: 0 4px; font-size: 12px; }
.attrs-d { padding: 8px 0; }
.attrs-d summary { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: 6px; cursor: pointer; }
.attrs { display: flex; flex-direction: column; gap: 4px; }
.attr { display: grid; grid-template-columns: 84px minmax(0, 1fr) 18px; gap: 4px; align-items: center; }
.attr.tall { align-items: start; }
.attr label { font-family: var(--mono); font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attr.tall label { padding-top: 5px; }
.attr input, .attr textarea { font-family: var(--mono); font-size: 11.5px; padding: 3px 6px; min-width: 0; }
.attr textarea { resize: vertical; line-height: 1.45; word-break: break-all; }
.attr.add { grid-template-columns: 84px minmax(0, 1fr) auto; margin-top: 4px; }
.x { background: none; border: 0; color: var(--faint); cursor: pointer; font-size: 15px; line-height: 1; padding: 0; }
.x:hover { color: var(--bad); }
.pane-h { display: flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 10px 0 6px; }
.layer-list { display: flex; flex-direction: column; border: 1px solid var(--line-soft); border-radius: var(--r); overflow: auto; }
.layer-row { display: flex; align-items: center; gap: 6px; padding: 4px 6px; font-size: 12px; border-top: 2px solid transparent; border-bottom: 2px solid transparent; }
.layer-row:hover { background: var(--raised); }
.layer-row.on { background: var(--select-soft); }
.layer-row.dim .ln, .layer-row.dim .lt { opacity: .45; }
.layer-row.drop-before { border-top-color: var(--select); }
.layer-row.drop-after { border-bottom-color: var(--select); }
.layer-row.drop-in { background: var(--select-soft); }
.lt { width: 16px; text-align: center; color: var(--faint); flex: none; }
.ln { font-family: var(--mono); font-size: 11.5px; white-space: nowrap; }
.lh { flex: 1; font-family: var(--mono); font-size: 10.5px; color: var(--faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb { background: none; border: 0; color: var(--muted); cursor: pointer; padding: 2px; opacity: 0; display: inline-flex; }
.layer-row:hover .lb, .lb.show { opacity: 1; }
.rename { font-family: var(--mono); font-size: 11.5px; padding: 1px 4px; width: 120px; }
.code-wrap { flex: 1; display: flex; min-height: 280px; margin-top: 8px; }
.code { flex: 1; width: 100%; font-family: var(--mono); font-size: 12px; line-height: 1.5; resize: none; white-space: pre; tab-size: 2; }
.note { padding: 8px 10px; border-radius: var(--r); border: 1px solid var(--line); margin: 8px 0; font-size: 12px; }
.note.err { border-color: color-mix(in oklch, var(--bad) 40%, transparent); color: var(--bad); font-family: var(--mono); }
.hist-list { display: flex; flex-direction: column; gap: 2px; margin-top: 8px; }
.hist { display: flex; gap: 10px; align-items: center; padding: 6px; border-radius: var(--r); cursor: pointer; border: 0; background: none; text-align: left; width: 100%; }
.hist:hover { background: var(--raised); }
.hist.on { background: var(--accent-soft); }
.hist .tile { padding: 3px; }
.hist-t { display: flex; flex-direction: column; min-width: 0; }
.hist-l { font-size: 12px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.hist-l b { font-family: var(--mono); color: var(--text); margin-right: 2px; }

/* style view */
.style { overflow: auto; padding: 12px 24px 32px; background: var(--pasteboard); }
.style-head { margin: 0 0 12px -8px; }
.style-title { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 12px; }
.rules { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 20px; }
.rule { font-size: 11.5px; padding: 3px 8px; border-radius: var(--r); background: var(--chrome); border: 1px solid var(--line); }
.style-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; }
@media (max-width: 980px) { .style-cols { grid-template-columns: 1fr; } }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 2px; margin-top: 8px; }
.g-item { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 4px 8px; border-radius: var(--r); }
.g-item:hover { background: var(--chrome); }
.g-item span:not(.thumb) { font-size: 10.5px; color: var(--faint); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.guide-col { display: flex; flex-direction: column; gap: 8px; }
.guide { width: 100%; min-height: 380px; font-size: 12px; line-height: 1.6; background: var(--chrome); margin-top: 8px; }
.empty { max-width: 440px; margin: 10vh auto; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.empty > svg { color: var(--faint); }
.empty p { color: var(--muted); }
.progress { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r); margin-bottom: 12px; background: var(--chrome); }

/* sheet, toasts */
.sheet-backdrop { position: fixed; inset: 0; background: oklch(0.1 0.005 60 / .5); display: flex; align-items: center; justify-content: center; z-index: 40; padding: 20px; }
.sheet { background: var(--chrome); border: 1px solid var(--line); border-radius: 10px; padding: 18px 20px; max-width: 600px; width: 100%; box-shadow: 0 20px 48px oklch(0 0 0 / .45); }
.keys-grid { display: grid; grid-template-columns: auto 1fr auto 1fr; gap: 7px 14px; font-size: 12.5px; align-items: center; }
.keys-grid kbd { justify-self: start; white-space: nowrap; }
#toasts { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 50; max-width: 420px; }
.toast { padding: 9px 14px; border-radius: var(--r-lg); background: var(--chrome); border: 1px solid var(--line); box-shadow: 0 8px 24px oklch(0 0 0 / .35); transition: opacity .25s cubic-bezier(.25,1,.5,1), transform .25s cubic-bezier(.25,1,.5,1); font-size: 12.5px; }
.toast.error { border-color: color-mix(in oklch, var(--bad) 55%, transparent); }
.toast.warn { border-color: color-mix(in oklch, var(--warn) 55%, transparent); }
.toast.out { opacity: 0; transform: translateY(6px); }
body.disconnected::before { content: 'Disconnected from VS Code. Changes will not sync until it reconnects.'; position: fixed; top: 0; left: 0; right: 0; z-index: 100; background: var(--bad); color: oklch(0.99 0 0); text-align: center; font-size: 12px; padding: 4px; }

/* styles & attachments */
.style-opts { display: flex; flex-direction: column; gap: 4px; }
.style-opt { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--r); background: var(--raised); cursor: pointer; text-align: left; color: var(--text); }
.style-opt:hover:not(:disabled) { border-color: var(--faint); }
.style-opt.on { border-color: var(--accent); background: var(--accent-soft); }
.style-opt:disabled { cursor: default; }
.style-row { display: inline-flex; align-items: center; gap: 10px; color: var(--text); }
.att.img { color: var(--text); padding-left: 4px; }
.att.img .thumb { background: var(--art-a); border-radius: 3px; padding: 1px; box-sizing: content-box; }
.att.style-chip { cursor: pointer; gap: 6px; }
.att.style-chip .style-row { gap: 4px; }
.picker { border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--chrome); margin-bottom: 6px; display: flex; flex-direction: column; max-height: 300px; overflow: hidden; }
.picker-head { display: flex; align-items: center; gap: 6px; padding: 6px; border-bottom: 1px solid var(--line-soft); }
.picker-head input { flex: 1; min-width: 0; height: 26px; }
.picker-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 2px; padding: 6px; overflow-y: auto; }
.pick-item { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 2px 6px; border: 1px solid transparent; border-radius: var(--r); background: none; cursor: pointer; color: var(--text); min-width: 0; }
.pick-item:hover { background: var(--raised); }
.pick-item.on { border-color: var(--accent); background: var(--accent-soft); }
.pick-item span:not(.thumb) { font-size: 10px; color: var(--faint); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.picker-sep { grid-column: 1 / -1; height: 1px; background: var(--line-soft); margin: 4px 0; }
.picker-sep:first-child { display: none; }
.picker-foot { padding: 4px 8px 6px; border-top: 1px solid var(--line-soft); }
.picker-empty { padding: 16px; display: flex; gap: 8px; align-items: center; justify-content: center; grid-column: 1 / -1; }
.style-pop .style-opts { padding: 6px; overflow-y: auto; }
.styles-list { display: flex; flex-direction: column; gap: 14px; margin-bottom: 24px; }
.style-group { border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--chrome); padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.style-group .style-row { flex-wrap: wrap; gap: 14px; }
.style-group .rules { margin: 0; }

/* tabs-era additions */
.drag-out { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: var(--r); border: 1px dashed var(--line); cursor: grab; }
.drag-out:hover { border-color: var(--accent); }
.drag-out:active { cursor: grabbing; }
.title-btn { display: inline-flex; align-items: center; height: 28px; padding: 0 8px; border-radius: var(--r); border: 1px solid transparent; background: transparent; cursor: text; }
.title-btn:hover { background: var(--raised); border-color: var(--line); }
.title-edit { display: inline-flex; align-items: center; gap: 2px; }
.title-edit input { height: 28px; width: 220px; padding: 0 8px; font-size: 12.5px; }
.canvas-empty { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; pointer-events: none; z-index: 3; }
.canvas-empty > * { pointer-events: auto; }
.btn.big { height: 36px; padding: 0 16px; font-size: 13.5px; gap: 8px; }
.checking { display: inline-flex; align-items: center; gap: 6px; }
.checking .pulse { margin: 0; width: 7px; height: 7px; }
.composer.pulse-ring { border-color: var(--select); box-shadow: 0 0 0 3px var(--select-soft); }

.toggle-panel { cursor: pointer; gap: 6px; padding: 0 10px; color: var(--text); }
.toggle-panel:hover { background: var(--raised); }
.toggle-panel.on { background: var(--raised); }

/* ---------- Ask about a part: floats next to the selection ---------- */
.ask-layer { position: absolute; inset: 0; pointer-events: none; z-index: 4; overflow: hidden; }
.ask { position: absolute; left: 0; top: 0; pointer-events: auto; transition: opacity .12s ease-out; }
.ask.away { opacity: 0; pointer-events: none; }
.ask > * { animation: ask-in .2s cubic-bezier(.25, 1, .5, 1) both; }
@keyframes ask-in { from { opacity: 0; transform: translateY(4px) scale(.98); } to { opacity: 1; transform: none; } }
.ask-pill { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 6px 0 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--chrome); color: var(--text); font: inherit; font-size: 12px; font-weight: 500; cursor: pointer; box-shadow: 0 4px 14px oklch(0.1 0.01 60 / .28); }
.ask-pill:hover { border-color: var(--faint); }
.ask-pill svg { color: var(--select); }
.ask-pill kbd { font-size: 10.5px; padding: 0 5px; border-radius: 4px; border: 1px solid var(--line); color: var(--muted); line-height: 16px; }
.ask-card { width: 340px; max-width: calc(100vw - 48px); box-sizing: border-box; padding: 10px; border-radius: 12px; border: 1px solid var(--line); background: var(--chrome); box-shadow: 0 14px 40px oklch(0.1 0.01 60 / .36), 0 2px 6px oklch(0.1 0.01 60 / .2); display: flex; flex-direction: column; gap: 8px; }
.ask-running { flex-direction: row; align-items: center; gap: 9px; width: auto; min-width: 230px; padding: 6px 6px 6px 12px; border-radius: 999px; }
.ask-running .pulse { margin: 0; width: 7px; height: 7px; background: var(--select); }
.ask-status { font-size: 12px; color: var(--text); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ask-head { display: flex; align-items: center; gap: 8px; min-width: 0; }
.ask-thumb { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 6px; background: var(--raised); flex: none; color: var(--text); }
.ask-what { font-size: 12px; color: var(--muted); min-width: 0; }
.ask-lock { display: inline-flex; align-items: center; gap: 5px; flex: none; height: 24px; padding: 0 8px; border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--muted); font: inherit; font-size: 11.5px; cursor: pointer; }
.ask-lock.on { color: var(--select); border-color: color-mix(in oklch, var(--select) 45%, transparent); background: var(--select-soft); }
.ask-input { display: flex; align-items: flex-end; gap: 6px; padding: 6px 6px 6px 10px; border-radius: 9px; border: 1px solid var(--line); background: var(--raised); }
.ask-input:focus-within { border-color: color-mix(in oklch, var(--select) 60%, var(--line)); }
.ask-input textarea { flex: 1; min-width: 0; resize: none; border: 0; outline: 0; background: transparent; color: var(--text); font: inherit; font-size: 13px; line-height: 20px; padding: 2px 0; max-height: 120px; }
.ask-input textarea::placeholder { color: var(--faint); }
.ask-send { flex: none; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 7px; border: 0; background: var(--accent); color: var(--chrome); cursor: pointer; }
.ask-send:disabled { background: var(--line); color: var(--faint); cursor: default; }
.ask-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ask-done { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--text); padding: 0 0 8px; border-bottom: 1px solid var(--line); min-width: 0; }
.ask-done > svg { color: var(--select); flex: none; }
@media (prefers-reduced-motion: reduce) { .ask > * { animation: none; } }
