/* ==========================================================
   Workspace shell — pro dark "creative app" chrome
   ========================================================== */
:root {
  --accent: #3b82f6;
  --accent-soft: rgba(59, 130, 246, 0.16);
  --accent-border: rgba(59, 130, 246, 0.55);
  --bg-shell: #18181b;
  --bg-bar: #1e1e23;
  --bg-panel: #202025;
  --bg-panel-head: #26262c;
  --bg-pasteboard: #121215;
  --bg-artboard: #1b1b20;
  --bg-well: #151519;
  --bg-input: #141418;
  --hairline: #32323a;
  --text: #e4e4e7;
  --text-2: #d4d4d8;
  --muted: #8e8e99;
  --dim: #71717a;
  --ok: #34d399;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, Consolas, monospace;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body {
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--bg-shell); color: var(--text);
  font: 12px/1.45 var(--sans); user-select: none; -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
kbd { font: 10px var(--mono); padding: 1px 5px; border-radius: 3px; background: #272730; color: #d4d4d8; }
h1, h2, h3 { margin: 0; }
p { margin: 0; }

.mono { font-family: var(--mono); }
.tiny { font-size: 9.5px; }
.muted { color: var(--muted); }
.accent-text { color: var(--accent); }
.selectable { user-select: text; }
.hairline-b { border-bottom: 1px solid var(--hairline); }
.hairline-t { border-top: 1px solid var(--hairline); }
.hairline-r { border-right: 1px solid var(--hairline); }
.hairline-l { border-left: 1px solid var(--hairline); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.link-btn { color: var(--accent); font-size: 10.5px; }
.link-btn:hover { text-decoration: underline; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 8px; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: #16161a; }
::-webkit-scrollbar-thumb { background: #35353f; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #494956; }

/* ---------------- Top bar ---------------- */
.topbar { height: 40px; flex-shrink: 0; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 8px; background: var(--bg-bar); z-index: 40; }
.topbar-left, .topbar-right { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.home-btn { width: 28px; height: 28px; border-radius: 6px; display: grid; place-items: center; border: 1px solid transparent; transition: background .12s, border-color .12s; }
.home-btn:hover { background: #2c2c34; border-color: #3c3c46; }
.home-btn svg { transition: transform .3s; }
.home-btn:hover svg { transform: rotate(12deg); }
.vsep { width: 1px; height: 16px; background: var(--hairline); margin: 0 2px; }
.view-pills { display: flex; align-items: center; gap: 4px; }
.pill-btn { display: inline-flex; align-items: center; gap: 6px; padding: 3px 8px; border-radius: 4px; font-size: 11px; font-weight: 500; background: #292931; border: 1px solid #3a3a45; color: var(--text); transition: border-color .12s; }
.pill-btn:hover { border-color: #71717a; }
.pill-btn .dot { width: 6px; height: 6px; transition: opacity .12s; }
.pill-btn.off .dot { opacity: .25; }
.kbd-hint { margin-left: 4px; padding: 2px 8px; border-radius: 4px; background: #16161a; border: 1px solid #2c2c34; color: var(--muted); font: 10.5px var(--mono); display: inline-flex; gap: 4px; align-items: center; }

.doc-tabs { flex: 1; min-width: 0; align-self: flex-end; display: flex; align-items: flex-end; overflow-x: auto; scrollbar-width: none; margin: 0 8px; }
.doc-tabs::-webkit-scrollbar { display: none; }
.doc-tabs-inner { display: flex; background: #16161a; border-left: 1px solid var(--hairline); border-top: 1px solid var(--hairline); border-radius: 4px 4px 0 0; }
.doc-tab { position: relative; height: 30px; display: inline-flex; align-items: center; gap: 7px; padding: 0 8px 0 11px; background: #1b1b20; color: var(--muted); border-right: 1px solid var(--hairline); border-top: 2px solid transparent; font: 11.5px var(--mono); white-space: nowrap; cursor: pointer; transition: background .1s, color .1s; }
.doc-tab:hover { background: #232329; color: var(--text-2); }
.doc-tab.active { background: var(--bg-pasteboard); color: #fff; border-top-color: var(--accent); }
.doc-tab .tab-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.doc-tab .tab-close { width: 16px; height: 16px; border-radius: 3px; display: grid; place-items: center; color: #71717a; font-size: 12px; }
.doc-tab .tab-close:hover { background: #32323e; color: var(--text); }

.zoom-box { display: flex; align-items: center; background: #151519; border: 1px solid var(--hairline); border-radius: 4px; padding: 2px 6px; font-size: 11px; }
.zoom-box button { padding: 0 4px; color: #a1a1aa; }
.zoom-box button:hover { color: #fff; }
.zoom-box span { padding: 0 6px; cursor: pointer; }
.zoom-box.disabled { opacity: .35; pointer-events: none; }
.swatch-row { display: flex; align-items: center; gap: 4px; background: #151519; border: 1px solid var(--hairline); border-radius: 4px; padding: 4px 6px; }
.swatch-row button { width: 12px; height: 12px; border-radius: 2px; transition: transform .12s; }
.swatch-row button:hover { transform: scale(1.12); }
.swatch-row button.current { box-shadow: 0 0 0 1px rgba(255,255,255,.55); }
.chrome-btn { height: 28px; display: inline-flex; align-items: center; gap: 6px; padding: 0 8px; border-radius: 4px; background: #26262e; border: 1px solid #383844; color: var(--text); font-size: 11px; transition: background .12s; }
.chrome-btn:hover { background: #30303a; }
.chrome-btn.square { width: 28px; padding: 0; justify-content: center; }

/* ---------------- Workspace row ---------------- */
.workspace { flex: 1; min-height: 0; display: flex; position: relative; overflow: hidden; }

/* Dock */
.dock { width: 48px; flex-shrink: 0; background: var(--bg-panel); display: flex; flex-direction: column; align-items: center; justify-content: space-between; padding: 8px 0; z-index: 30; }
.dock-tools { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.grip { width: 20px; height: 4px; border-radius: 99px; background: #363640; margin-bottom: 4px; }
.tool-btn { position: relative; width: 36px; height: 36px; border-radius: 5px; display: grid; place-items: center; color: #a1a1aa; border: 1px solid transparent; transition: all .12s; }
.tool-btn:hover { background: #2a2a32; color: #f4f4f5; }
.tool-btn.active { background: #141418; color: #fff; border-color: var(--accent-border); box-shadow: inset 0 1px 3px rgba(0,0,0,.65), 0 0 0 1px var(--accent-soft); }
.tool-btn::after { content: ''; position: absolute; right: 3px; bottom: 3px; border-style: solid; border-width: 0 0 4px 4px; border-color: transparent transparent #6b6b76 transparent; }
.tool-btn.active::after { border-color: transparent transparent var(--accent) transparent; }
.tool-tip { position: absolute; left: 44px; top: 50%; transform: translate(-4px, -50%); opacity: 0; pointer-events: none; white-space: nowrap; display: flex; gap: 8px; align-items: center; padding: 6px 10px; border-radius: 4px; background: #111114; border: 1px solid #383844; color: #f4f4f5; box-shadow: 0 10px 24px rgba(0,0,0,.5); transition: opacity .12s, transform .12s; z-index: 60; font-size: 12px; }
.tool-btn:hover .tool-tip { opacity: 1; transform: translate(0, -50%); }
.dock-sep { width: 24px; height: 1px; background: var(--hairline); margin: 4px 0; }
.aux-btn { width: 32px; height: 32px; border-radius: 4px; display: grid; place-items: center; color: #a1a1aa; }
.aux-btn:hover { color: #fff; background: #2a2a32; }
.dock-swatch { display: flex; flex-direction: column; align-items: center; gap: 6px; padding-bottom: 4px; }
.swatch-stack { position: relative; width: 32px; height: 32px; }
.swatch-bg { position: absolute; right: 0; bottom: 0; width: 20px; height: 20px; border-radius: 3px; background: #18181b; border: 1px solid #71717a; }
.swatch-fg { position: absolute; left: 2px; top: 2px; width: 20px; height: 20px; border-radius: 3px; background: var(--accent); border: 1px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.4); transition: background .15s; }

/* Stage, rulers, viewport */
.stage { flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; position: relative; background: var(--bg-pasteboard); }
.ruler-top { height: 20px; flex-shrink: 0; display: flex; background: #1b1b20; overflow: hidden; }
.ruler-origin { width: 20px; height: 20px; flex-shrink: 0; background: #202026; border-right: 1px solid var(--hairline); color: var(--dim); font-size: 9px; }
.ruler-origin:hover { color: var(--text); }
.ruler-h { flex: 1; position: relative; overflow: hidden; }
.ruler-h canvas, .ruler-left canvas { display: block; width: 100%; height: 100%; }
.stage-row { flex: 1; min-height: 0; display: flex; position: relative; overflow: hidden; }
.ruler-left { width: 20px; flex-shrink: 0; position: relative; overflow: hidden; background: #1b1b20; }
.tracker-v { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--accent); pointer-events: none; left: -10px; }
.tracker-h { position: absolute; left: 0; right: 0; height: 1px; background: var(--accent); pointer-events: none; top: -10px; }
.rulers-off .ruler-top, .rulers-off .ruler-left { display: none; }

.viewport { flex: 1; min-width: 0; position: relative; overflow: auto; padding: 36px 40px; background-color: var(--bg-pasteboard); }
.viewport.grid-on {
  background-image:
    linear-gradient(to right, rgba(255,255,255,.03) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,.03) 1px, transparent 1px),
    radial-gradient(rgba(255,255,255,.08) 1px, transparent 1px);
  background-size: 100px 100px, 100px 100px, 20px 20px;
  background-attachment: local;
}
.viewport.is-project { overflow: hidden; display: flex; flex-direction: column; padding: 20px 24px; }
.zoom-stage { max-width: 1024px; margin: 0 auto; transform-origin: top center; transition: transform .15s; }
.page { display: grid; gap: 36px; }

/* Artboards */
.board-label { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 0 2px 6px; font: 10.5px var(--mono); letter-spacing: .06em; color: #a1a1aa; }
.board-label > span:first-child { display: flex; align-items: center; gap: 8px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board-label > span:last-child { font-size: 10px; color: var(--dim); white-space: nowrap; }
.artboard { position: relative; background: var(--bg-artboard); border: 1px solid #32323b; border-radius: 4px; box-shadow: 0 16px 40px rgba(0,0,0,.45); padding: 18px; transition: border-color .15s; }
.artboard:hover, .artboard.focused { border-color: #484856; }
.artboard.pad-lg { padding: 22px; }
.handle { position: absolute; width: 6px; height: 6px; background: #18181b; border: 1px solid var(--accent); z-index: 5; pointer-events: none; }
.handle.tl { top: -4px; left: -4px; } .handle.tr { top: -4px; right: -4px; } .handle.bl { bottom: -4px; left: -4px; } .handle.br { bottom: -4px; right: -4px; }

.chip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 8px; border-radius: 4px; background: #23232b; border: 1px solid #343440; font-size: 10px; color: #d4d4d8; margin-bottom: 12px; }
.live-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ok); animation: pulse 2s infinite; }
@keyframes pulse { 50% { opacity: .35; } }
.well { background: var(--bg-well); border: 1px solid var(--hairline); border-radius: 4px; padding: 10px 12px; display: grid; gap: 4px; }
.well-title { font-size: 10.5px; font-weight: 600; color: #d4d4d8; }

/* Overview intro */
.intro-grid { display: grid; grid-template-columns: 5fr 7fr; gap: 20px; align-items: stretch; }
.intro-card { display: flex; flex-direction: column; justify-content: space-between; gap: 16px; background: var(--bg-well); border: 1px solid var(--hairline); border-radius: 6px; padding: 16px; }
.intro-card h1 { font-size: 17px; font-weight: 600; line-height: 1.35; margin-bottom: 8px; color: #f4f4f5; }
.intro-card p { font-size: 12px; line-height: 1.6; }
.jump-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; font-size: 10.5px; }
.jump-grid button { padding: 8px; border-radius: 4px; background: #222229; border: 1px solid #343440; color: var(--text); transition: background .12s; }
.jump-grid button:hover { background: #2c2c36; }
.intro-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; padding-top: 6px; border-top: 1px solid #26262f; font-size: 10.5px; color: var(--dim); }
.toy-frame { display: flex; flex-direction: column; min-height: 280px; background: #111115; border: 1px solid var(--hairline); border-radius: 6px; overflow: hidden; }
.frame-bar { height: 28px; flex-shrink: 0; display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 0 10px; background: #19191f; border-bottom: 1px solid var(--hairline); font-size: 10.5px; color: #a1a1aa; }
.toy-host { flex: 1; position: relative; }
.toy-host iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* Category page intro */
.cat-intro { display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: end; }
.cat-intro h2 { font-size: 16px; font-weight: 600; color: #f4f4f5; margin-bottom: 4px; }
.cat-intro p { color: var(--muted); max-width: 560px; line-height: 1.6; }
.cat-stats { display: flex; gap: 8px; }
.cat-stats .well { min-width: 92px; }
.cat-stats b { font: 600 14px var(--mono); color: #fff; }

/* Cards */
.card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.node-card { display: flex; flex-direction: column; justify-content: space-between; gap: 12px; padding: 14px; text-align: left; background: #222228; border: 1px solid #32323c; border-radius: 6px; transition: transform .14s, border-color .14s, box-shadow .14s; }
.node-card:hover, .node-card:focus-visible { border-color: var(--accent); transform: translateY(-2px); box-shadow: 0 8px 20px rgba(0,0,0,.35), 0 0 0 1px var(--accent-soft); outline: none; }
.card-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 10px; font: 10px var(--mono); color: #a1a1aa; }
.card-top .file { display: flex; align-items: center; gap: 6px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sq { width: 8px; height: 8px; border-radius: 2px; flex-shrink: 0; }
.status-tag { padding: 1px 6px; border-radius: 4px; background: #17171c; border: 1px solid #32323c; color: #d4d4d8; white-space: nowrap; }
.thumb { position: relative; height: 84px; border-radius: 4px; background: #16161b; border: 1px solid var(--hairline); margin-bottom: 12px; display: flex; justify-content: space-between; align-items: center; padding: 0 16px; overflow: hidden; }
.thumb::before { content: ''; position: absolute; inset: 0; opacity: .2; background-image: radial-gradient(var(--layer) 1px, transparent 1px); background-size: 10px 10px; }
.thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.thumb .glyph { position: relative; font-size: 24px; color: var(--layer); }
.thumb .layer-name { position: relative; font: 10px var(--mono); color: var(--dim); text-transform: uppercase; }
.node-card h3 { font-size: 13px; font-weight: 600; color: #f4f4f5; margin-bottom: 4px; }
.node-card p { font-size: 11px; color: #a1a1aa; line-height: 1.55; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding-top: 8px; border-top: 1px solid #2d2d37; }
.tags { display: flex; flex-wrap: wrap; gap: 4px; }
.tag { font: 9.5px var(--mono); padding: 2px 6px; border-radius: 3px; background: #191920; color: #a1a1aa; }
.open-hint { font: 10.5px var(--mono); color: var(--accent); white-space: nowrap; }
.empty-note { grid-column: 1 / -1; padding: 32px 0; text-align: center; font: 11px var(--mono); color: var(--dim); }
.error-note { grid-column: 1 / -1; padding: 16px; border-radius: 4px; border: 1px solid rgba(239,68,68,.45); background: rgba(239,68,68,.08); color: #fca5a5; font: 11px var(--mono); }

/* Readme */
.readme-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.readme-col { display: grid; gap: 14px; align-content: start; }
.readme-col h2 { font-size: 17px; font-weight: 600; color: #fff; }
.readme-col p { line-height: 1.65; }
.patch-notes { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 11px; color: #a1a1aa; }
.patch-notes b { color: var(--accent); font-weight: 500; }
.spec-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; font-size: 11px; }
.console { display: flex; flex-direction: column; height: 340px; background: #101014; border: 1px solid var(--hairline); border-radius: 6px; overflow: hidden; }
.console-out { flex: 1; overflow-y: auto; padding: 12px; display: grid; gap: 6px; align-content: start; font-size: 11px; color: #d4d4d8; }
.console-chips { display: flex; flex-wrap: wrap; gap: 4px; padding: 6px 10px; background: #15151b; border-top: 1px solid var(--hairline); font-size: 10px; }
.console-chips button { padding: 2px 8px; border-radius: 4px; background: #23232c; color: #d4d4d8; }
.console-chips button:hover { background: #2f2f3b; }
.console-input { height: 36px; display: flex; align-items: center; gap: 8px; padding: 0 10px; background: #18181f; border-top: 1px solid var(--hairline); }
.console-input input { flex: 1; background: transparent; border: 0; outline: none; color: #f4f4f5; font-size: 12px; user-select: text; }

/* Project tabs */
.project-views { display: contents; }
.project-view { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.project-view .artboard { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 0; overflow: visible; }
.pv-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 12px; border-bottom: 1px solid var(--hairline); background: #1d1d22; border-radius: 4px 4px 0 0; }
.pv-title { display: flex; align-items: center; gap: 8px; min-width: 0; }
.pv-title strong { font-size: 12.5px; font-weight: 600; color: #f4f4f5; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pv-actions { display: flex; gap: 6px; flex-shrink: 0; }
.pv-actions a, .pv-actions button { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; border-radius: 4px; background: #262630; border: 1px solid #3a3a46; color: var(--text); font: 11px var(--mono); text-decoration: none; }
.pv-actions a:hover, .pv-actions button:hover { border-color: var(--accent); }
.pv-frame { flex: 1; min-height: 0; position: relative; background: #0e0e12; border-radius: 0 0 4px 4px; overflow: hidden; }
.pv-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; }
.pv-loading { position: absolute; inset: 0; display: grid; place-items: center; font: 11px var(--mono); color: var(--dim); pointer-events: none; }
.project-view.full { position: fixed; inset: 0; z-index: 100; padding: 0; background: #000; }
.project-view.full .board-label, .project-view.full .handle { display: none; }
.project-view.full .artboard { border: 0; border-radius: 0; box-shadow: none; }
.project-view.full .pv-head { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); z-index: 5; border: 1px solid var(--hairline); border-radius: 6px; background: rgba(24,24,29,.85); backdrop-filter: blur(8px); opacity: .25; transition: opacity .2s; }
.project-view.full .pv-head:hover { opacity: 1; }
.project-view.full .pv-frame { border-radius: 0; }

/* ---------------- Inspector ---------------- */
.inspector { width: 272px; flex-shrink: 0; background: var(--bg-panel); display: flex; flex-direction: column; z-index: 30; transition: transform .15s; }
.panel-head { height: 28px; flex-shrink: 0; display: flex; justify-content: space-between; align-items: center; padding: 0 10px; background: var(--bg-panel-head); border-bottom: 1px solid var(--hairline); }
.panel-title { font-size: 10.5px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--text); display: flex; gap: 6px; align-items: center; min-width: 0; white-space: nowrap; overflow: hidden; }
.panel-title .mono { text-transform: none; overflow: hidden; text-overflow: ellipsis; }
.close-narrow { display: none; color: #a1a1aa; font-size: 12px; }
.props { flex: 1; min-height: 0; display: flex; flex-direction: column; border-bottom: 1px solid var(--hairline); }
.xywh { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 10px; background: #1c1c21; border-bottom: 1px solid var(--hairline); font-size: 10.5px; }
.xywh > div { display: flex; justify-content: space-between; padding: 4px 8px; border-radius: 4px; background: var(--bg-input); border: 1px solid var(--hairline); color: #e4e4e7; }
.props-body { flex: 1; overflow-y: auto; padding: 12px; display: grid; gap: 12px; align-content: start; }
.node-card-insp { background: #17171c; border: 1px solid var(--hairline); border-radius: 4px; padding: 10px; display: grid; gap: 6px; }
.badge { font-size: 9.5px; padding: 2px 6px; border-radius: 4px; background: var(--accent-soft); color: var(--accent); }
.insp-title { font-size: 12px; font-weight: 600; color: #f4f4f5; }
.insp-desc { font-size: 11px; color: #a1a1aa; line-height: 1.6; }
.live-head { display: flex; justify-content: space-between; align-items: center; font-size: 10px; letter-spacing: .07em; color: #a1a1aa; }
.live-head .dot { width: 6px; height: 6px; }
.live-controls { background: #17171c; border: 1px solid var(--hairline); border-radius: 4px; padding: 10px; display: grid; gap: 10px; }
.lc-section { font: 10px var(--mono); color: var(--dim); text-transform: uppercase; letter-spacing: .08em; padding-top: 2px; }
.lc-line { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 11px; }
.lc-line .lbl { color: #a1a1aa; }
.lc-line .val { font: 11px var(--mono); color: #e4e4e7; }
.lc-hint { font-size: 10.5px; color: var(--dim); margin-top: 3px; line-height: 1.5; }
.lc-empty { font-size: 11px; color: var(--muted); line-height: 1.6; }
input[type=range].pro-slider { -webkit-appearance: none; appearance: none; width: 100%; height: 4px; margin: 6px 0 0; background: var(--bg-input); border: 1px solid var(--hairline); border-radius: 99px; outline: none; }
input[type=range].pro-slider::-webkit-slider-thumb { -webkit-appearance: none; width: 11px; height: 11px; border-radius: 2px; background: var(--accent); border: 1px solid #fff; cursor: ew-resize; }
input[type=range].pro-slider::-moz-range-thumb { width: 10px; height: 10px; border-radius: 2px; background: var(--accent); border: 1px solid #fff; cursor: ew-resize; }
.lc-check { accent-color: var(--accent); }
.lc-select { background: var(--bg-input); color: var(--text); border: 1px solid var(--hairline); border-radius: 4px; font: 11px var(--mono); padding: 2px 4px; }
.lc-btn { width: 100%; padding: 5px 8px; border-radius: 4px; background: #262630; border: 1px solid #363644; color: var(--text); font-size: 11px; transition: background .12s; }
.lc-btn:hover { background: #323240; }
.lc-btn.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.lc-btn-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(70px, 1fr)); gap: 6px; }
.lc-track { height: 5px; border-radius: 99px; background: #26262e; overflow: hidden; margin-top: 5px; }
.lc-bar { height: 100%; width: 0; background: var(--accent); transition: width 60ms linear; }
.kv { display: flex; justify-content: space-between; font: 10.5px var(--mono); }

.layers { height: 236px; flex-shrink: 0; display: flex; flex-direction: column; background: var(--bg-bar); }
.blend-bar { display: flex; justify-content: space-between; padding: 6px 10px; background: #1a1a1f; border-bottom: 1px solid var(--hairline); font-size: 10.5px; color: #a1a1aa; }
.layers-list { flex: 1; overflow-y: auto; }
.layer-row { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 10px; border-bottom: 1px solid #292932; color: var(--text); transition: background .1s; }
.layer-row:hover { background: #272730; }
.layer-row.off { color: #71717a; opacity: .6; }
.layer-row .left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.eye { width: 20px; height: 20px; border-radius: 4px; background: #15151a; border: 1px solid #32323c; display: grid; place-items: center; flex-shrink: 0; }
.eye .off-bar { width: 6px; height: 2px; background: #52525b; }
.layer-row .name { font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.layer-row .count { font: 10px var(--mono); padding: 1px 6px; border-radius: 3px; background: #16161b; color: #a1a1aa; }

/* ---------------- Status bar ---------------- */
.statusbar { height: 24px; flex-shrink: 0; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 0 10px; background: var(--bg-bar); font-size: 10.5px; color: #a1a1aa; z-index: 40; }
.status-left, .status-right { display: flex; align-items: center; gap: 12px; min-width: 0; white-space: nowrap; }
.status-tool { display: flex; align-items: center; gap: 6px; color: #e4e4e7; }
.ok-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ok); }
.sep { color: #52525b; }
.status-msg { color: var(--accent); overflow: hidden; text-overflow: ellipsis; }

/* ---------------- Panels hidden (TAB) ---------------- */
body.panels-hidden .dock, body.panels-hidden .inspector { display: none; }

/* ---------------- Responsive ---------------- */
@media (max-width: 1279px) { .hide-xl { display: none !important; } }
@media (max-width: 1023px) {
  .hide-lg { display: none !important; }
  .inspector { position: absolute; top: 0; right: 0; bottom: 0; box-shadow: -20px 0 40px rgba(0,0,0,.5); transform: translateX(100%); }
  body.inspector-open .inspector { transform: translateX(0); }
  body.panels-hidden .inspector { display: flex; }
  .close-narrow { display: block; }
  .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .intro-grid, .readme-grid { grid-template-columns: 1fr; }
}
@media (max-width: 767px) {
  .hide-md { display: none !important; }
  .viewport { padding: 20px 16px; }
  .viewport.is-project { padding: 10px; }
  .cat-intro { grid-template-columns: 1fr; }
}
@media (max-width: 639px) {
  .hide-sm { display: none !important; }
  .card-grid { grid-template-columns: 1fr; }
  .ruler-top, .ruler-left { display: none; }
  .pv-actions .label { display: none; }
}

/* ---------------- Right-click menu ---------------- */
.ctx-menu { position: fixed; z-index: 200; min-width: 220px; max-width: 300px; padding: 4px; background: #1e1e24; border: 1px solid #3a3a46; border-radius: 6px; box-shadow: 0 16px 40px rgba(0,0,0,.6), 0 0 0 1px rgba(0,0,0,.4); display: grid; font-size: 12px; }
.ctx-item { display: grid; grid-template-columns: 14px 1fr auto; align-items: center; gap: 6px; padding: 5px 8px; border-radius: 4px; text-align: left; color: var(--text); outline: none; }
.ctx-item:hover, .ctx-item:focus-visible, .ctx-item:focus { background: var(--accent); color: #fff; }
.ctx-item:disabled { color: #5c5c66; cursor: default; background: none; }
.ctx-check { font-size: 11px; color: var(--accent); }
.ctx-item:hover .ctx-check, .ctx-item:focus .ctx-check { color: #fff; }
.ctx-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ctx-key { font: 10.5px var(--mono); color: var(--muted); padding-left: 16px; }
.ctx-item:hover .ctx-key, .ctx-item:focus .ctx-key { color: rgba(255,255,255,.8); }
.ctx-sep { height: 1px; margin: 4px 6px; background: var(--hairline); }
.ctx-header { padding: 6px 8px 3px 28px; font: 10px var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
