@font-face { font-family: 'Instrument Serif'; src: url(assets/fonts/instrument-serif.woff2) format('woff2'); font-display: swap; }
@font-face { font-family: 'Instrument Serif'; font-style: italic; src: url(assets/fonts/instrument-serif-italic.woff2) format('woff2'); font-display: swap; }
@font-face { font-family: 'JetBrains Mono'; src: url(assets/fonts/jetbrains-mono.woff2) format('woff2'); font-weight: 100 800; font-display: swap; }
:root {
  --ink: #f5f5ed; --dim: rgba(245,245,237,.62); --faint: rgba(245,245,237,.38); --line: rgba(245,245,237,.1); --fill: rgba(245,245,237,.055); --fill2: rgba(245,245,237,.12);
  --neon: #84f800; --mono: 'JetBrains Mono', ui-monospace, Consolas, monospace; --serif: 'Instrument Serif', 'Times New Roman', serif;
  --ctl: 26px; --r: 5px; --sheet: 0px; --rw: 308px; --strip: 96px; color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #000; color: var(--ink); font: 11.5px/1.45 var(--mono); letter-spacing: -.01em; overflow: hidden; -webkit-font-smoothing: antialiased; overscroll-behavior: none; }
button, input, select, textarea { font: inherit; letter-spacing: inherit; color: inherit; }
[hidden] { display: none !important; }
:focus { outline: none; }
:focus-visible { outline: 1.5px solid var(--neon); outline-offset: 1px; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--fill2); border-radius: 4px; border: 2px solid #000; }
::-webkit-scrollbar-track { background: transparent; }
::selection { background: var(--neon); color: #000; }
body.scrubbing, body.scrubbing * { cursor: ew-resize !important; user-select: none; }

/* The canvas owns the page. Presets run under it like a contact strip; everything that edits is in one panel on the right. */
body { display: grid; grid-template-columns: minmax(0, 1fr) var(--rw); grid-template-rows: 48px minmax(0, 1fr) 42px var(--strip); grid-template-areas: 'top top' 'stage insp' 'dock insp' 'strip insp'; }
#top { grid-area: top; }
#stage { grid-area: stage; position: relative; overflow: hidden; background: #000; min-height: 0; }
#dock { grid-area: dock; }
#strip { grid-area: strip; }
#inspector { grid-area: insp; border-left: 1px solid var(--line); }
#sheet { display: none; }
body.nopanels { grid-template-columns: minmax(0, 1fr) 0; }
body.nopanels #inspector { display: none; }
body.chromeless { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); grid-template-areas: 'stage'; }
body.chromeless #inspector, body.chromeless #top, body.chromeless #dock, body.chromeless #strip { display: none; }

/* Controls */
input[type=text], input[type=search], input[type=number], textarea { background: var(--fill); border: 1px solid transparent; border-radius: var(--r); height: var(--ctl); padding: 0 8px; min-width: 0; }
input[type=text]:hover, input[type=search]:hover, input[type=number]:hover, textarea:hover { border-color: var(--line); }
input[type=text]:focus, input[type=search]:focus, input[type=number]:focus, textarea:focus { border-color: var(--faint); outline: none; }
input[type=search]::-webkit-search-cancel-button { display: none; }
textarea { height: auto; padding: 6px 8px; width: 100%; resize: vertical; }
::placeholder { color: var(--faint); }
button { height: var(--ctl); padding: 0 9px; border: 0; background: var(--fill); border-radius: var(--r); cursor: pointer; white-space: nowrap; display: inline-flex; align-items: center; justify-content: center; gap: 5px; transition: background .08s, color .08s; }
button:hover:not(:disabled) { background: var(--fill2); }
button:disabled { opacity: .3; cursor: default; }
button.icon { padding: 0; width: var(--ctl); flex: none; background: none; color: var(--dim); }
button.icon:hover:not(:disabled) { background: var(--fill); color: var(--ink); }
button.ghost { background: none; color: var(--dim); padding: 0 7px; }
button.ghost:hover:not(:disabled) { background: var(--fill); color: var(--ink); }
button.pri { background: var(--neon); color: #000; font-weight: 600; }
button.pri:hover:not(:disabled) { background: #9dff2e; }
button[aria-pressed=true], button[aria-pressed=true]:hover:not(:disabled) { background: var(--fill2); color: var(--ink); }
.ico { display: inline-flex; }
h2 { font: 400 22px/1.1 var(--serif); margin: 0; letter-spacing: 0; }
h3 { font: 500 11.5px/1.4 var(--mono); margin: 0; color: var(--ink); letter-spacing: -.01em; }
.note { color: var(--dim); margin: 8px 0 0; font-size: 11px; }
.note.warn { color: var(--ink); border-left: 2px solid var(--neon); padding-left: 8px; }
.btns { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.grow { flex: 1; }

/* Top bar */
#top { display: flex; align-items: center; gap: 4px; padding: 0 10px 0 12px; min-width: 0; }
#top img { width: 22px; height: 22px; border-radius: 4px; display: block; flex: none; }
#top .brand { font: 20px/1 var(--serif); letter-spacing: 0; padding: 0 2px 0 6px; white-space: nowrap; color: inherit; text-decoration: none; }
#top .slash { color: var(--faint); padding: 0 2px; }
#top .name { width: 158px; flex: 0 1 158px; min-width: 40px; background: none; color: var(--dim); }
#top .name:hover, #top .name:focus { background: var(--fill); color: var(--ink); }
#top .spacer { flex: 1; min-width: 4px; }
#top .gap { width: 6px; flex: none; }
#top .toplink { color: var(--dim); text-decoration: none; padding: 0 8px; white-space: nowrap; display: inline-flex; align-items: center; min-height: 24px; }
@media (pointer: coarse), (max-width: 700px) { #top .toplink { min-height: 44px; } }
#top .toplink:hover { color: var(--ink); }
#describe { position: relative; flex: 0 1 460px; min-width: 120px; display: flex; align-items: center; }
#describe input { width: 100%; height: 30px; padding: 0 30px 0 30px; border-radius: 7px; background: var(--fill); }
#describe .ico { position: absolute; left: 8px; color: var(--faint); pointer-events: none; }
#describe kbd { position: absolute; right: 8px; color: var(--faint); font: inherit; font-size: 10px; pointer-events: none; }
#describe:focus-within kbd { display: none; }
.sugg { padding: 6px; display: grid; gap: 8px; }
.sugg .lst { display: grid; }
.sugg .lst button { justify-content: flex-start; background: none; color: var(--dim); height: 26px; padding: 0 7px; }
.sugg .lst button:hover:not(:disabled), .sugg .lst button:focus-visible { background: var(--fill); color: var(--ink); }
.sugg .styles { display: flex; flex-wrap: wrap; gap: 3px; padding: 6px 2px 2px; border-top: 1px solid var(--line); }
.sugg .styles button { height: 22px; padding: 0 7px; background: none; color: var(--dim); font-size: 10.5px; }
.sugg .styles button:hover:not(:disabled) { color: var(--ink); }
.sugg .styles button[aria-pressed=true] { background: var(--fill2); color: var(--ink); }

/* Panel */
.panel { display: flex; flex-direction: column; min-height: 0; min-width: 0; background: #000; overflow: hidden; }
.tabs { display: flex; flex: none; gap: 2px; padding: 8px 10px 0; }
.tabs button { height: 26px; padding: 0 9px; color: var(--dim); background: none; }
.tabs button:hover:not(:disabled) { background: var(--fill); color: var(--ink); }
.tabs button[aria-selected=true], .tabs button[aria-selected=true]:hover:not(:disabled) { background: var(--fill2); color: var(--ink); }
.pane { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; scrollbar-width: thin; scrollbar-color: var(--fill2) transparent; padding-bottom: 12px; }
.sec { padding: 12px 12px 10px; border-bottom: 1px solid var(--line); }
.sec:last-child { border-bottom: 0; }
.head { display: flex; align-items: center; justify-content: space-between; gap: 6px; min-height: var(--ctl); margin-bottom: 6px; }
.head .acts { display: flex; gap: 2px; align-items: center; }
.head h2 { font-size: 21px; }
.head .note { margin: 0; color: var(--faint); }
.sub { margin-top: 10px; }
.sub > h4 { font: 400 11px/1.4 var(--mono); color: var(--faint); margin: 0 0 3px; }

/* Rows: label, control, value. Nothing crosses the label. */
.row { display: grid; grid-template-columns: 84px minmax(0, 1fr) 46px; gap: 8px; align-items: center; height: var(--ctl); --p: 0%; }
.row label, .lbl { color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row:hover label, .row:hover > .lbl { color: var(--ink); }
.scrubbable { cursor: ew-resize; user-select: none; touch-action: none; }
.trk { position: relative; height: 100%; display: flex; align-items: center; min-width: 0; }
.range { -webkit-appearance: none; appearance: none; width: 100%; height: 100%; margin: 0; background: none; cursor: ew-resize; }
.range::-webkit-slider-runnable-track { height: 2px; border-radius: 1px; background: linear-gradient(90deg, var(--fill2) var(--a, 0%), var(--ink) var(--a, 0%), var(--ink) var(--p), var(--fill2) var(--p)); }
.range::-moz-range-track { height: 2px; background: var(--fill2); }
.range::-moz-range-progress { height: 2px; background: var(--ink); }
.range::-webkit-slider-thumb { -webkit-appearance: none; width: 10px; height: 10px; margin-top: -4px; border-radius: 50%; background: var(--ink); box-shadow: 0 0 0 2px #000; transition: transform .08s; }
.range::-moz-range-thumb { width: 10px; height: 10px; border: 0; border-radius: 50%; background: var(--ink); box-shadow: 0 0 0 2px #000; }
.range:hover::-webkit-slider-thumb, .range:active::-webkit-slider-thumb { transform: scale(1.25); }
.range:focus-visible { outline: none; }
.range:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 2px #000, 0 0 0 3.5px var(--neon); }
.num { text-align: right; font-variant-numeric: tabular-nums; -moz-appearance: textfield; appearance: textfield; color: var(--dim); }
.num::-webkit-inner-spin-button { display: none; }
.row > .num, .pf .num { width: 100%; height: 22px; padding: 0 4px; background: none; }
.row > .num:hover, .row > .num:focus, .pf .num:hover, .pf .num:focus { background: var(--fill); color: var(--ink); }
.row.tracked .range::-webkit-slider-runnable-track { height: 10px; border-radius: 5px; background: var(--track); box-shadow: inset 0 0 0 1px rgba(255,255,255,.08); }
.row.tracked .range::-moz-range-track { height: 10px; border-radius: 5px; background: var(--track); }
.row.tracked .range::-moz-range-progress { background: none; }
.row.tracked .range::-webkit-slider-thumb { width: 14px; height: 14px; margin-top: -2px; background: none; box-shadow: 0 0 0 2px #fff, 0 0 0 3px rgba(0,0,0,.7), inset 0 0 0 1px rgba(0,0,0,.7); }
.row.wide { grid-template-columns: 84px minmax(0, 1fr); }
.row.check { cursor: pointer; grid-template-columns: 1fr auto; }
.row.pair { grid-template-columns: 84px minmax(0, 1fr) minmax(0, 1fr); }
.pf { display: flex; align-items: center; min-width: 0; }
.pf .tag { color: var(--faint); padding: 0 2px 0 0; flex: none; }
.pf:hover .tag { color: var(--ink); }
.menuval { justify-content: space-between; background: none; width: 100%; padding: 0 2px 0 7px; color: var(--ink); }
.menuval .ico { color: var(--faint); }
.swatchbtn { width: 100%; height: 20px; padding: 0; background: var(--c); border-radius: 4px; box-shadow: inset 0 0 0 1px rgba(255,255,255,.14); justify-content: flex-start; }
.swatchbtn:hover:not(:disabled) { background: var(--c); box-shadow: inset 0 0 0 1px var(--ink); }
input[type=file] { width: 100%; color: var(--dim); font-size: 10.5px; }
input[type=file]::file-selector-button { font: inherit; color: var(--ink); background: var(--fill2); border: 0; border-radius: var(--r); height: var(--ctl); padding: 0 9px; margin-right: 8px; cursor: pointer; }
input[type=checkbox] { width: 14px; height: 14px; accent-color: var(--neon); margin: 0; }
details.fold { margin-top: 8px; border-top: 1px solid var(--line); }
details.fold > summary { list-style: none; display: flex; align-items: center; justify-content: space-between; cursor: pointer; height: 30px; color: var(--dim); }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary::after { content: '+'; color: var(--faint); font-size: 13px; }
details.fold[open] > summary::after { content: '\2212'; }
details.fold > summary:hover { color: var(--ink); }

/* Popovers */
#pop { position: fixed; z-index: 20; background: #0b0b0a; border: 1px solid rgba(245,245,237,.16); border-radius: 9px; box-shadow: 0 18px 50px rgba(0,0,0,.75); min-width: 150px; max-height: calc(100vh - 16px); overflow: auto; }
.menu { padding: 4px; display: grid; }
.menu button { justify-content: space-between; background: none; height: 26px; padding: 0 7px; width: 100%; }
.menu button:hover:not(:disabled), .menu button:focus-visible { background: var(--fill2); outline: none; }
.menu button[aria-checked=true] span:first-child::before { content: ''; display: inline-block; width: 5px; height: 5px; border-radius: 50%; background: var(--neon); margin: 0 6px 1px 0; }
.menu small { color: var(--faint); font-size: 10.5px; padding-left: 14px; }
.menu .sep { color: var(--faint); font-size: 10.5px; padding: 8px 7px 3px; }
.cpick { width: 262px; padding: 10px; display: grid; gap: 2px; }
.cpick .top { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 6px; align-items: center; margin-bottom: 6px; }
.cpick .big { width: 34px; height: 26px; border-radius: 5px; background: var(--c); box-shadow: inset 0 0 0 1px rgba(255,255,255,.14); }
.cpick .top input { width: 100%; text-transform: lowercase; }
.cpick .row { grid-template-columns: 50px minmax(0, 1fr) 44px; }
.cpick .quick { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 6px; padding-top: 8px; border-top: 1px solid var(--line); }
.cpick .foot { display: flex; justify-content: flex-end; margin-top: 6px; }
.chip { width: 20px; height: 20px; padding: 0; border-radius: 4px; background: var(--c); box-shadow: inset 0 0 0 1px rgba(255,255,255,.14); font-size: 10px; flex: none; }
.chip:hover:not(:disabled) { background: var(--c); box-shadow: inset 0 0 0 1px var(--ink); }
.chip[aria-checked=true], .chip[aria-pressed=true], .chip[aria-pressed=true]:hover:not(:disabled) { background: var(--c); box-shadow: 0 0 0 1px #000, 0 0 0 2.5px var(--ink); }

/* Style tab */
#swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(26px, 1fr)); gap: 3px; margin-bottom: 8px; }
#swatches button { height: 30px; padding: 0; background: var(--c); border-radius: 5px; box-shadow: inset 0 0 0 1px rgba(255,255,255,.12); }
#swatches button:hover:not(:disabled) { background: var(--c); box-shadow: inset 0 0 0 1px var(--ink); }
#swatches button[aria-expanded=true] { box-shadow: 0 0 0 1px #000, 0 0 0 2.5px var(--ink); }
.seg { display: flex; gap: 2px; background: var(--fill); border-radius: var(--r); padding: 2px; }
.seg button { flex: 1; height: 22px; background: none; color: var(--dim); border-radius: 3px; padding: 0 6px; }
.seg button:hover:not(:disabled) { background: none; color: var(--ink); }
.seg button[aria-pressed=true], .seg button[aria-pressed=true]:hover:not(:disabled) { background: var(--fill2); color: var(--ink); }

/* Palette drawer */
.drawerhead { display: flex; align-items: center; gap: 4px; padding: 10px 10px 6px; }
.drawerhead h2 { font-size: 21px; flex: 1; }
.palfilters { padding: 0 12px 8px; display: grid; gap: 6px; border-bottom: 1px solid var(--line); }
.palfilters input { width: 100%; }
.chips { display: flex; gap: 3px; overflow-x: auto; scrollbar-width: none; }
.chips button { height: 22px; padding: 0 7px; flex: none; color: var(--dim); background: none; font-size: 10.5px; }
.chips button[aria-pressed=true] { color: var(--ink); }
.pallist { padding: 8px 12px; }
.palcard { display: block; width: 100%; height: auto; padding: 5px; margin: 0 -5px; width: calc(100% + 10px); text-align: left; background: none; border-radius: 7px; }
.palcard:hover:not(:disabled), .palcard:focus-visible { background: var(--fill); }
.palcard .strip { display: flex; height: 26px; border-radius: 4px; overflow: hidden; }
.palcard .strip i { flex: 1; }
.palcard .nm { display: block; padding-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--dim); font-size: 10.5px; }
.palcard:hover .nm { color: var(--ink); }
.more { height: 1px; }

/* Layers */
.layer { position: relative; display: grid; grid-template-columns: 18px minmax(0, 1fr) auto; align-items: center; gap: 7px; height: 30px; padding: 0 3px 0 6px; border-radius: var(--r); cursor: grab; }
.layer:hover { background: var(--fill); }
.layer.on, .layer.on:hover { background: var(--fill2); }
.layer.drop { box-shadow: inset 0 2px 0 var(--neon); }
.layer.off .sw, .layer.off .pick { opacity: .36; }
.layer .sw { width: 18px; height: 18px; border-radius: 4px; box-shadow: inset 0 0 0 1px rgba(255,255,255,.14); }
.layer .pick { background: none; justify-content: flex-start; padding: 0; height: 100%; overflow: hidden; gap: 6px; cursor: inherit; }
.layer .pick:hover:not(:disabled) { background: none; }
.layer .pick span { overflow: hidden; text-overflow: ellipsis; }
.layer .pick small { color: var(--faint); font-size: 10.5px; overflow: hidden; text-overflow: ellipsis; }
.layer input.rename { height: 22px; width: 100%; padding: 0 4px; }
.layer .acts { display: flex; }
.layer .acts button { width: 22px; height: 24px; }
.layer .acts .opt { display: none; }
.layer:hover .acts .opt, .layer.on .acts .opt, .layer .acts:focus-within .opt { display: inline-flex; }
.layer .acts .eye { opacity: 0; }
.layer:hover .acts .eye, .layer.on .acts .eye, .layer.off .acts .eye, .layer .acts .eye:focus-visible { opacity: 1; }

/* Stop bar: the gradient itself is the control */
.stopbar { margin: 0 0 10px; }
.stoptrack { position: relative; height: 26px; border-radius: 6px; background: var(--grad), repeating-conic-gradient(#222 0 25%, #111 0 50%) 0 0/10px 10px; box-shadow: inset 0 0 0 1px rgba(255,255,255,.1); cursor: copy; margin: 0 8px; touch-action: none; }
.stoptrack .sh { position: absolute; top: 50%; width: 16px; height: 32px; margin: -16px 0 0 -8px; padding: 0; border-radius: 5px; background: var(--c); box-shadow: 0 0 0 1.5px #fff, 0 0 0 2.5px rgba(0,0,0,.6); cursor: ew-resize; touch-action: none; transition: none; }
.stoptrack .sh:hover:not(:disabled) { background: var(--c); }
.stoptrack .sh[aria-expanded=true] { box-shadow: 0 0 0 2px var(--neon), 0 0 0 3px rgba(0,0,0,.6); z-index: 1; }
.stophint { display: flex; justify-content: space-between; color: var(--faint); font-size: 10.5px; margin-top: 7px; }
.ptlist { display: flex; flex-wrap: wrap; gap: 3px; margin-bottom: 6px; }

/* Export */
#exportdlg, #help, #gallery { background: #000; color: var(--ink); border: 1px solid rgba(245,245,237,.16); border-radius: 12px; padding: 0; }
#exportdlg { width: min(1000px, calc(100vw - 48px)); height: min(700px, calc(100dvh - 48px)); overflow: hidden; }
#exportdlg[open] { display: grid; grid-template-columns: 150px minmax(0, 1fr); grid-template-rows: 52px minmax(0, 1fr); }
dialog::backdrop { background: rgba(0,0,0,.65); }
.exphead { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; padding: 0 10px 0 16px; border-bottom: 1px solid var(--line); }
.exphead h2 { font-size: 24px; }
.exphead h2 i { color: var(--dim); }
.expnav { padding: 8px; border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; }
.expnav button { justify-content: flex-start; background: none; color: var(--dim); height: 30px; flex: none; }
.expnav button:hover:not(:disabled) { color: var(--ink); background: var(--fill); }
.expnav button[aria-pressed=true], .expnav button[aria-pressed=true]:hover:not(:disabled) { background: var(--fill2); color: var(--ink); }
.expbody { min-height: 0; min-width: 0; overflow-y: auto; padding: 14px 16px 16px; display: flex; flex-direction: column; }
.tgroups { display: flex; flex-wrap: wrap; gap: 10px 18px; }
.tgroups h4 { font: 400 11px/1.4 var(--mono); color: var(--faint); margin: 0 0 4px; }
.tgroups .opts { display: flex; gap: 2px; flex-wrap: wrap; }
.tgroups button { background: none; color: var(--dim); }
.tgroups button:hover:not(:disabled) { background: var(--fill); color: var(--ink); }
.tgroups button[aria-pressed=true], .tgroups button[aria-pressed=true]:hover:not(:disabled) { background: var(--fill2); color: var(--ink); }
.whatis { color: var(--dim); margin: 12px 0 0; max-width: 72ch; }
.fitprev { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 14px; align-items: center; margin-top: 12px; }
.fitprev .box { height: 112px; border-radius: 8px; box-shadow: inset 0 0 0 1px var(--line); }
.fitprev p { margin: 0; color: var(--dim); max-width: 52ch; }
.fitprev b { color: var(--ink); font-weight: 500; }
pre.code { flex: 1; min-height: 140px; margin: 12px 0 0; padding: 12px; overflow: auto; background: var(--fill); border-radius: 8px; font: 11px/1.55 var(--mono); white-space: pre-wrap; word-break: break-all; tab-size: 2; color: var(--dim); }
.expfoot { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.expfoot .note { margin: 0; flex: 1; }
.expfoot button { height: 32px; padding: 0 14px; }
.expbody h2 { margin-bottom: 8px; }
.expbody .lede { color: var(--dim); max-width: 60ch; margin: 0 0 14px; }
.sizechips { display: flex; flex-wrap: wrap; gap: 3px; margin-bottom: 8px; }
.sizechips button { background: none; color: var(--dim); }
.sizechips button:hover:not(:disabled) { background: var(--fill); color: var(--ink); }
.sizechips button[aria-pressed=true], .sizechips button[aria-pressed=true]:hover:not(:disabled) { background: var(--fill2); color: var(--ink); }
.sizes { display: flex; align-items: center; gap: 6px; }
.sizes input { width: 76px; }
.sizes span { color: var(--faint); }
.expbody .btns { max-width: 460px; }
.expbody .btns button { height: 32px; }
.progress { height: 2px; background: var(--fill2); margin-top: 14px; max-width: 460px; }
.progress i { display: block; height: 100%; width: 0; background: var(--neon); }
.surfgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.surf { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; min-width: 0; }
.surf .prev { min-height: 120px; display: flex; align-items: center; justify-content: center; padding: 16px; overflow: hidden; background: var(--on, #000); }
.surf .prev > div { max-width: 100%; }
.surf[data-surface=text] .prev > div { zoom: .5; }
.surf .meta { padding: 6px 6px 6px 10px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.surf .meta h3 { text-transform: capitalize; }
.surf .meta .notes { color: var(--faint); font-size: 10.5px; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.surfbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 12px; }
.surfbar input { width: 200px; }

/* Gallery */
#gallery { width: min(1180px, calc(100vw - 48px)); height: min(820px, calc(100dvh - 48px)); overflow: hidden; }
#gallery[open] { display: grid; grid-template-rows: 56px minmax(0, 1fr); }
.galhead { display: flex; align-items: center; gap: 10px; padding: 0 10px 0 18px; border-bottom: 1px solid var(--line); }
.galhead h2 { font-size: 24px; flex: 1; }
.galhead input { width: min(320px, 40vw); height: 30px; }
.galbody { overflow-y: auto; padding: 16px 18px 24px; }
.galbody h3 { color: var(--faint); font-weight: 400; margin: 0 0 8px; }
.galbody section + section { margin-top: 22px; }
.galgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px 10px; }
.card { display: block; height: auto; padding: 0; text-align: left; white-space: normal; background: none; min-width: 0; border-radius: 6px; }
.card:hover:not(:disabled) { background: none; }
.card .th { display: block; width: 100%; aspect-ratio: 16/10; object-fit: cover; border-radius: 6px; background: var(--fill); }
.card .nm { display: block; padding: 5px 1px 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--dim); }
.card:hover .nm { color: var(--ink); }
.card.on .th { box-shadow: 0 0 0 1.5px #000, 0 0 0 3px var(--neon); }
.card.on .nm { color: var(--ink); }

/* Strip */
#strip { display: flex; align-items: stretch; gap: 8px; padding: 2px 10px 10px; min-width: 0; overflow: hidden; }
#strip .all { flex: none; width: 64px; height: 62px; display: flex; flex-direction: column; gap: 3px; font-size: 10.5px; color: var(--dim); }
#strip .all small { color: var(--faint); font-size: 10px; }
#strip .scroller { display: flex; gap: 8px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; flex: 1; min-width: 0; padding: 3px; margin: -3px; scroll-behavior: smooth; }
#strip .scroller::-webkit-scrollbar { display: none; }
#strip .scroller { -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); }
#strip .card { flex: none; width: 100px; }
#strip .card .th { height: 62px; aspect-ratio: auto; transition: filter .1s; }
#strip .card:hover .th { filter: brightness(1.15); }
#strip .card .nm { font-size: 10.5px; padding-top: 3px; }
#strip .div { flex: none; width: 1px; margin: 4px 2px 22px; background: var(--line); }

/* Dock */
#dock { display: flex; align-items: center; gap: 6px; padding: 0 10px; min-width: 0; }
#dock .play { width: 28px; height: 28px; color: var(--ink); background: var(--fill); border-radius: 50%; }
#dock .play:hover:not(:disabled) { background: var(--fill2); }
#timeval { font-variant-numeric: tabular-nums; color: var(--dim); white-space: nowrap; min-width: 70px; text-align: center; font-size: 10.5px; }
.scrub { -webkit-appearance: none; appearance: none; flex: 1; min-width: 40px; height: 28px; margin: 0 4px 0 0; background: none; cursor: pointer; --p: 0%; }
.scrub::-webkit-slider-runnable-track { height: 2px; background: linear-gradient(90deg, var(--ink) var(--p), var(--fill2) var(--p)); }
.scrub::-moz-range-track { height: 2px; background: var(--fill2); }
.scrub::-moz-range-progress { height: 2px; background: var(--ink); }
.scrub::-webkit-slider-thumb { -webkit-appearance: none; width: 10px; height: 10px; margin-top: -4px; border-radius: 50%; background: var(--ink); }
.scrub::-moz-range-thumb { width: 10px; height: 10px; border: 0; border-radius: 50%; background: var(--ink); }
.frames { display: flex; gap: 1px; flex: none; }
.frames button { width: 28px; height: 26px; padding: 0; background: none; color: var(--faint); }
.frames button:hover:not(:disabled) { background: var(--fill); color: var(--ink); }
.frames button[aria-pressed=true], .frames button[aria-pressed=true]:hover:not(:disabled) { background: var(--fill2); color: var(--ink); }
.frames i { display: block; border: 1.25px solid currentColor; border-radius: 2px; }
.dsep { width: 1px; height: 16px; background: var(--line); flex: none; margin: 0 3px; }
#dock .tg { background: none; color: var(--dim); flex: none; padding: 0 7px; }
#dock .tg:hover:not(:disabled) { background: var(--fill); color: var(--ink); }
#dock .tg[aria-pressed=true], #dock .tg[aria-pressed=true]:hover:not(:disabled) { background: var(--fill2); color: var(--ink); }
#contrast { flex: none; color: var(--dim); font-size: 10.5px; white-space: nowrap; font-variant-numeric: tabular-nums; }
#contrast::before { content: ''; display: inline-block; width: 6px; height: 6px; border-radius: 50%; margin: 0 5px 1px 0; background: var(--faint); }
#contrast.pass::before { background: var(--neon); }
#stats { flex: none; text-align: right; color: var(--faint); font-size: 10px; font-variant-numeric: tabular-nums; min-width: 62px; }

/* Stage */
#frame { position: absolute; overflow: hidden; background: #000; container-type: size; border-radius: 8px; }
#gl { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
body.chromeless #frame { border-radius: 0; }
#veil { position: absolute; inset: -4%; width: 108%; height: 108%; max-width: none; object-fit: cover; opacity: 0; pointer-events: none; filter: blur(14px) saturate(1.05); transition: opacity .32s ease-out; }
#veil.on { opacity: 1; transition: opacity .1s linear; }
#busy { position: absolute; left: 0; right: 0; top: 0; height: 2px; overflow: hidden; pointer-events: none; animation: busyin .15s .15s both; }
#busy span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
#busy::before { content: ''; position: absolute; inset: 0; width: 34%; background: linear-gradient(90deg, transparent, var(--ink), transparent); animation: sweep 1.1s ease-in-out infinite; }
@keyframes sweep { from { transform: translateX(-100%); } to { transform: translateX(300%); } }
@keyframes busyin { from { opacity: 0; } to { opacity: 1; } }
/* Handles stay out of the artwork until the pointer is over it. Touch has no hover, so they stay visible there. */
@media (hover: hover) { #rings, #handles { opacity: 0; transition: opacity .12s; } #stage:hover #rings, #stage:hover #handles, #handles:focus-within, #handles:focus-within ~ * { opacity: 1; } }
#rings { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
#rings circle, #rings line { fill: none; stroke: #fff; stroke-width: 1; stroke-dasharray: 3 4; mix-blend-mode: difference; }
#rings circle.hit { stroke: transparent; stroke-width: 14; stroke-dasharray: none; pointer-events: stroke; cursor: ew-resize; touch-action: none; }
#handles { position: absolute; inset: 0; pointer-events: none; }
.hd { position: absolute; width: 14px; height: 14px; margin: -7px 0 0 -7px; padding: 0; border-radius: 50%; border: 2px solid #fff; background: var(--c, #000); box-shadow: 0 0 0 1px rgba(0,0,0,.65), 0 2px 8px rgba(0,0,0,.5); pointer-events: auto; cursor: grab; touch-action: none; transition: none; }
.hd:hover:not(:disabled) { background: var(--c, #000); }
.hd:active { cursor: grabbing; }
.hd.on { width: 16px; height: 16px; margin: -8px 0 0 -8px; box-shadow: 0 0 0 1.5px #000, 0 2px 10px rgba(0,0,0,.6); }
.hd.off { border-style: dashed; }
.hd.knob { width: 11px; height: 11px; margin: -5.5px 0 0 -5.5px; border-radius: 3px; background: #000; cursor: ew-resize; }
.hd.knob:hover:not(:disabled) { background: #000; }
.hd.spin { border-radius: 50%; cursor: alias; background: #fff; }
.hd.spin:hover:not(:disabled) { background: #fff; }
.hd::after { content: ''; position: absolute; inset: -11px; border-radius: 50%; }

/* Hero text preview: real type, measured against the real pixels */
#site { position: absolute; inset: 0; color: var(--site-ink, #fff); display: flex; flex-direction: column; padding: 0 5.2cqw; font: clamp(11px, 1.15cqw, 19px)/1.5 system-ui, -apple-system, 'Segoe UI', sans-serif; letter-spacing: 0; transition: color .2s; }
#site nav { display: flex; align-items: center; gap: 2.4cqw; padding: 2.6cqw 0; font-weight: 500; }
#site nav b { font-weight: 650; margin-right: auto; }
#site nav em { font-style: normal; padding: .45em .95em; border-radius: 99em; background: var(--site-ink, #fff); color: var(--site-bg, #000); transition: background .2s, color .2s; }
#site .hero { flex: 1; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; padding-bottom: 8cqw; }
#site[data-align=center] .hero { align-items: center; text-align: center; }
#site[data-align=center] h1 { max-width: 15em; }
#site h1 { font: 400 clamp(30px, 6.6cqw, 132px)/.98 var(--serif); letter-spacing: -.015em; margin: 0 0 .32em; max-width: 9.5em; outline: none; }
#site p { margin: 0 0 1.6em; max-width: 30em; font-size: 1.32em; opacity: .84; outline: none; }
#site h1:hover, #site p:hover, #site h1:focus, #site p:focus { box-shadow: 0 1px 0 currentColor; }
#site .cta { display: flex; gap: .7em; flex-wrap: wrap; }
#site .cta span { padding: .72em 1.35em; border-radius: 99em; font-weight: 600; background: var(--site-ink, #fff); color: var(--site-bg, #000); transition: background .2s, color .2s; }
#site .cta span + span { background: none; color: inherit; box-shadow: inset 0 0 0 1.5px currentColor; }
@container (max-aspect-ratio: 1/1) {
  #site { padding: 0 7cqw; font-size: clamp(11px, 2.6cqw, 18px); }
  #site nav { padding: 6cqw 0; gap: 4cqw; }
  #site nav span { display: none; }
  #site h1 { font-size: clamp(30px, 13.5cqw, 110px); }
  #site .hero { padding-bottom: 18cqw; }
}

/* Dialog + toast */
#help { padding: 20px; width: min(470px, calc(100vw - 32px)); }
#help h2 { font-size: 26px; }
#help dl { display: grid; grid-template-columns: 150px 1fr; gap: 5px 12px; margin: 12px 0 16px; }
#help dt { color: var(--ink); }
#help dd { margin: 0; color: var(--dim); }
#toast { position: fixed; z-index: 30; left: calc(50% - var(--rw) / 2); bottom: 150px; transform: translateX(-50%); background: var(--ink); color: #000; padding: 6px 12px; border-radius: 99px; opacity: 0; pointer-events: none; max-width: calc(100vw - 24px); transition: opacity .15s; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#toast.show { opacity: 1; }
#toast.err { background: #000; color: var(--ink); box-shadow: 0 0 0 1px var(--neon); }
dialog #toast { position: absolute; left: 50%; bottom: 14px; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }

/* Narrower desktops */
@media (max-width: 1280px) { :root { --rw: 284px; } #top .btxt { display: none; } #stats { display: none; } #top .name { flex-basis: 120px; width: 120px; } }
@media (max-width: 1040px) { :root { --rw: 264px; } #top .brand, #top .slash, #top .opt { display: none; } .frames button { width: 24px; } .row { grid-template-columns: 70px minmax(0, 1fr) 42px; } .row.wide, .row.pair { grid-template-columns: 70px minmax(0, 1fr); } .row.pair { grid-template-columns: 70px minmax(0, 1fr) minmax(0, 1fr); } }

/* Phone and small tablet: canvas above, one sheet below */
@media (max-width: 820px) {
  :root { --ctl: 38px; }
  html, body { font-size: 13px; }
  body, body.nopanels { grid-template-columns: minmax(0, 1fr); grid-template-rows: calc(46px + env(safe-area-inset-top)) minmax(0, 1fr) 44px var(--sheet); grid-template-areas: 'top' 'stage' 'dock' 'insp'; }
  #strip { display: none; }
  #inspector { border-left: 0; border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
  #inspector.dragging { transition: none; }
  #top { padding: env(safe-area-inset-top) 8px 0; gap: 2px; }
  #top .brand, #top .slash, #top .opt, #top .gap, #describe { display: none; }
  #top .name { flex: 1; width: auto; font-size: 14px; color: var(--ink); }
  #top .spacer { display: none; }
  #top .icon { width: 36px; height: 36px; }
  #top button.pri { height: 34px; padding: 0 12px; }
  #dock { padding: 0 8px; gap: 6px; }
  #dock .play { width: 34px; height: 34px; }
  #dock .frames, #dock .dsep, #dock .tg.opt, #stats, #contrast { display: none; }
  #dock .frameb { display: inline-flex; flex: none; height: 34px; }
  #timeval { min-width: 0; font-size: 11px; }
  .grabber { flex: none; height: 16px; width: 100%; background: none; touch-action: none; border-radius: 0; padding: 0; }
  .grabber:hover:not(:disabled) { background: none; }
  .grabber::before { content: ''; width: 34px; height: 4px; border-radius: 2px; background: var(--faint); }
  .tabs { padding: 0 8px 6px; }
  .tabs button { height: 34px; flex: 1; font-size: 13px; }
  .row { grid-template-columns: 96px minmax(0, 1fr) 52px; margin-bottom: 2px; }
  .row.wide { grid-template-columns: 96px minmax(0, 1fr); }
  .row.pair { grid-template-columns: 96px minmax(0, 1fr) minmax(0, 1fr); }
  .range::-webkit-slider-thumb { width: 16px; height: 16px; margin-top: -7px; }
  .chip { width: 32px; height: 32px; }
  input[type=text], input[type=search], input[type=number], textarea { font-size: 16px; }
  .row > .num, .pf .num { font-size: 13px; height: 32px; }
  .chips button { height: 32px; padding: 0 11px; }
  #swatches { grid-template-columns: repeat(auto-fill, minmax(38px, 1fr)); }
  #swatches button { height: 40px; }
  .seg button { height: 32px; }
  .layer { height: 44px; }
  .layer .acts .opt { display: inline-flex; }
  .layer .acts .eye { opacity: 1; }
  .layer .acts button { width: 34px; height: 36px; }
  .stoptrack { height: 36px; }
  .stoptrack .sh { width: 22px; height: 44px; margin: -22px 0 0 -11px; }
  .menu button { height: 40px; }
  .cpick { width: calc(100vw - 18px); }
  .cpick .row { grid-template-columns: 72px minmax(0, 1fr) 52px; }
  .galgrid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px 8px; }
  .startphone { padding: 10px 12px; display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto; gap: 4px; border-bottom: 1px solid var(--line); }
  .startphone input { width: 100%; height: 38px; }
  .startphone button { height: 38px; }
  #exportdlg, #gallery { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; border: 0; border-radius: 0; }
  #exportdlg[open] { grid-template-columns: minmax(0, 1fr); grid-template-rows: 52px 46px minmax(0, 1fr); }
  .expnav { flex-direction: row; border-right: 0; border-bottom: 1px solid var(--line); padding: 4px 6px; overflow-x: auto; scrollbar-width: none; }
  .expnav button { flex: 1 0 auto; height: 36px; }
  .expbody { padding: 12px; }
  .tgroups button, .sizechips button { height: 36px; }
  .fitprev { grid-template-columns: minmax(0, 1fr); }
  #toast { left: 50%; bottom: calc(var(--sheet) + 56px); }
}
/* Embedded in the front page's sidebar: the page is the preview, so only the top bar and the panel remain. */
body.embed, body.embed.nopanels { grid-template-columns: minmax(0, 1fr); grid-template-rows: 46px minmax(0, 1fr); grid-template-areas: 'top' 'insp'; }
body.embed #stage, body.embed #dock, body.embed #strip, body.embed .grabber, body.embed #panelsbtn { display: none !important; }
body.embed #inspector { border: 0; }
body.embed #top > img, body.embed #top .toplink { display: none; }
body.embed button.pri:hover:not(:disabled) { background: var(--neon); filter: brightness(1.12); }
body.embed #toast { bottom: 20px; }
@media (min-width: 821px) { .grabber, #dock .frameb, .startphone { display: none; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }

/* ---------- from image: drop zone, reference card, compare */
#dropzone { position: absolute; inset: 0; z-index: 6; display: grid; place-items: center; background: rgb(0 0 0 / .58); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); opacity: 0; pointer-events: none; transition: opacity .16s; }
#dropzone::before { content: ''; position: absolute; inset: 14px; border-radius: 12px; border: 1.5px dashed color-mix(in srgb, var(--neon) 70%, transparent); }
#stage.dropping #dropzone { opacity: 1; }
#dropzone .dzin { display: grid; justify-items: center; gap: 10px; max-width: 340px; text-align: center; }
#dropzone .ico svg { width: 30px; height: 30px; color: var(--neon); }
#dropzone b { font: 400 38px/1 var(--serif); letter-spacing: -.01em; color: var(--ink); }
#dropzone span:not(.ico) { color: var(--dim); }
#stage.reading #frame::after { content: ''; position: absolute; inset: 0; z-index: 5; background: rgb(0 0 0 / .25); pointer-events: none; animation: busyin .15s both; }
#refimg { position: absolute; inset: 0; z-index: 3; width: 100%; height: 100%; object-fit: cover; opacity: 0; pointer-events: none; transition: opacity .18s ease-out; }
#refimg.on { opacity: 1; transition-duration: .08s; }
#refcard { position: absolute; z-index: 4; left: 12px; bottom: 12px; display: flex; align-items: center; gap: 2px; padding: 5px; border-radius: 12px; background: rgb(0 0 0 / .6); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); box-shadow: inset 0 0 0 1px var(--line), 0 10px 30px -12px #000; animation: refin .35s cubic-bezier(.2,.8,.2,1) both; }
@keyframes refin { from { opacity: 0; transform: translateY(8px); } }
#refcard .refpeek { display: flex; align-items: center; gap: 10px; padding: 0 10px 0 0; height: auto; border-radius: 8px; background: none; color: var(--ink); cursor: zoom-in; user-select: none; -webkit-user-select: none; touch-action: none; }
#refcard .refpeek:hover { background: var(--fill); }
#refcard .refpeek:active { cursor: zoom-out; }
#refcard .refpeek img { width: 64px; height: 40px; border-radius: 7px; object-fit: cover; box-shadow: inset 0 0 0 1px var(--line); pointer-events: none; }
#refcard .reft { display: grid; gap: 2px; text-align: left; }
#refcard .reft b { font-weight: 500; }
#refcard .reft span { font-size: 10.5px; color: var(--dim); white-space: nowrap; }
#refcard #refx { width: 26px; height: 26px; }
@media (max-width: 820px) { #refcard .reft span { display: none; } #refcard { left: 8px; bottom: 8px; } }
@media (max-width: 820px) { #top #fromimg { display: none; } }

/* =====================================================================
   Editor shell (2026-11-05): rail and library on the left, canvas in the middle, properties on the right,
   slim top bar with Export as the one filled button. Arrangement from research/ux-arrangement.md.
   Phones (<=820) and the embedded sidebar keep the single panel; their rules above still apply.
   ===================================================================== */
@font-face { font-family: 'Inter Tight'; src: url(assets/fonts/inter-tight-var.woff2) format('woff2'); font-weight: 100 900; font-display: swap; }
:root { --ui: 'Inter Tight', 'Inter', system-ui, sans-serif; --serif: var(--ui); --lw: 236px; --railw: 56px; --panel: #0b0b0c; --stagebg: #050506; }
html, body { font: 450 12.5px/1.45 var(--ui); letter-spacing: -.006em; }
.num, #timeval, #stats, .row output, kbd, code, pre, #hexin, .cpick input { font-family: var(--mono); letter-spacing: -.01em; }
h2 { font: 650 18px/1.15 var(--ui); letter-spacing: -.03em; }
.head h2 { font-size: 17px; }
h3 { font: 600 12.5px/1.4 var(--ui); letter-spacing: -.01em; }
h4 { font: 600 11px/1.3 var(--ui); letter-spacing: .01em; color: var(--faint); margin: 0 0 8px; text-transform: none; }

@media (min-width: 821px) {
  body:not(.embed) { grid-template-columns: var(--railw) var(--lw) minmax(0, 1fr) var(--rw); grid-template-rows: 52px minmax(0, 1fr) 46px; grid-template-areas: 'top top top top' 'rail left stage insp' 'rail left dock insp'; background: var(--stagebg); }
  body:not(.embed).leftshut { grid-template-columns: var(--railw) 0 minmax(0, 1fr) var(--rw); }
  body:not(.embed).leftshut #left { visibility: hidden; }
  body:not(.embed).nopanels { grid-template-columns: 0 0 minmax(0, 1fr) 0; }
  body:not(.embed).nopanels #rail, body:not(.embed).nopanels #left { display: none; }
  body:not(.embed).chromeless { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); grid-template-areas: 'stage'; }
  body.chromeless #rail, body.chromeless #left { display: none; }
  #strip { grid-area: auto; }
  #rail { grid-area: rail; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 6px; background: var(--panel); border-right: 1px solid var(--line); }
  #left { grid-area: left; background: var(--panel); border-right: 1px solid var(--line); min-width: 0; }
  #inspector { background: var(--panel); }
  #top { background: var(--panel); border-bottom: 1px solid var(--line); padding: 0 10px 0 14px; gap: 6px; }
  #dock { background: var(--panel); border-top: 1px solid var(--line); }
  #stage { background: var(--stagebg); }
}
/* tablet: the library floats over the canvas instead of squeezing it */
@media (min-width: 821px) and (max-width: 1099px) {
  body:not(.embed), body:not(.embed).leftshut { grid-template-columns: var(--railw) 0 minmax(0, 1fr) var(--rw); }
  body:not(.embed) #left { position: fixed; z-index: 30; top: 52px; bottom: 0; left: var(--railw); width: 272px; box-shadow: 30px 0 60px -30px #000; }
}
@media (max-width: 820px) { #rail, #left { display: none !important; } }
body.embed #rail, body.embed #left { display: none !important; }

/* top bar */
#top img { width: 26px; height: 26px; border-radius: 50%; }
#top .brand { font: 650 15px/1 var(--ui); letter-spacing: -.03em; padding: 0 2px 0 8px; }
#top .name { font-weight: 500; }
#top button.pri { height: 32px; padding: 0 16px; border-radius: 999px; font: 650 12.5px/1 var(--ui); letter-spacing: -.01em; }
#top .icon { width: 30px; height: 30px; border-radius: 8px; }

/* rail */
.rgrp { display: grid; gap: 4px; }
.rbtn { width: 44px; height: 50px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 0; border-radius: 10px; background: none; color: var(--dim); font: 550 9.5px/1 var(--ui); letter-spacing: 0; text-decoration: none; }
.rbtn:hover:not(:disabled) { background: var(--fill); color: var(--ink); }
.rbtn[aria-pressed=true], .rbtn[aria-pressed=true]:hover:not(:disabled) { background: var(--fill2); color: var(--ink); box-shadow: inset 2px 0 0 var(--neon); }
.rbtn .ico svg { width: 18px; height: 18px; }
#rail .grow { flex: 1; }

/* left library */
.lhead { display: flex; align-items: center; gap: 6px; height: 46px; padding: 0 8px 0 14px; flex: none; border-bottom: 1px solid var(--line); }
.lhead h3 { font-size: 13px; }
.lhead .cnt { color: var(--faint); font: 500 11px/1 var(--mono); }
.lhead .grow { flex: 1; }
.lhead .sm { height: 26px; font-size: 11.5px; }
.lhead .lclose { display: none; }
@media (max-width: 1099px) { .lhead .lclose { display: inline-flex; } }
#left .pane { padding: 0 0 16px; }
.lsearch { position: sticky; top: 0; z-index: 2; display: grid; gap: 8px; padding: 10px 12px; background: var(--panel); }
.lsearch input { height: 32px; border-radius: 8px; padding: 0 10px; }
.kinds { display: flex; gap: 4px; }
button.kchip { height: 24px; padding: 0 9px; border-radius: 999px; background: none; color: var(--dim); box-shadow: inset 0 0 0 1px var(--line); font-size: 11px; }
button.kchip:hover:not(:disabled) { color: var(--ink); background: var(--fill); }
button.kchip[aria-pressed=true], button.kchip[aria-pressed=true]:hover:not(:disabled) { background: var(--ink); color: #000; box-shadow: none; }
#left #strip { display: block; padding: 0 12px; overflow: visible; }
#left #strip .scroller { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 8px; overflow: visible; -webkit-mask-image: none; mask-image: none; margin: 0; padding: 0; }
#left #strip .grp { grid-column: 1 / -1; margin: 8px 0 -4px; }
#left #strip .card { width: auto; padding: 0; height: auto; display: flex; flex-direction: column; align-items: stretch; gap: 0; background: none; border-radius: 9px; }
#left #strip .card .th { width: 100%; height: auto; aspect-ratio: 16 / 10; border-radius: 8px; display: block; object-fit: cover; }
#left #strip .card .nm { font-size: 11.5px; padding-top: 5px; text-align: left; color: var(--dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#left #strip .card:hover .nm, #left #strip .card.on .nm { color: var(--ink); }
#left #strip .card.on .th { outline: 2px solid var(--neon); outline-offset: 2px; }
#left #strip .card:hover { background: none; }
#left .sec { padding: 14px; }
#left #sec-layers .head h3 { display: none; }
#left #sec-layers .head { margin: 0 0 8px; }
#left #sec-layers .head .acts { flex: 1; }
#left #sec-layers { border: 0; padding: 10px 8px; }
#left .layer { height: 36px; border-radius: 8px; }
#left .layer .sw { width: 22px; height: 22px; border-radius: 6px; }
#left #describe { position: relative; display: flex; align-items: center; }
#left #describe input { width: 100%; height: 38px; padding: 0 30px; border-radius: 10px; font-size: 13px; }
#left #describe .ico { position: absolute; left: 9px; color: var(--faint); }
#left #describe kbd { position: absolute; right: 10px; color: var(--faint); font-size: 11px; }
#left .sugg { padding: 6px 0 0; }
#left .sugg .lst button { height: 30px; font-size: 12px; border-radius: 8px; }
#left .styles { display: flex; flex-wrap: wrap; gap: 5px; }
.duo { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
button.sec2 { height: 36px; border-radius: 10px; background: var(--fill); box-shadow: inset 0 0 0 1px var(--line); color: var(--ink); font-weight: 550; gap: 7px; }
button.sec2:hover:not(:disabled) { background: var(--fill2); }
button.sec2.wide { width: 100%; }
#left .note { line-height: 1.5; }

/* Add layer sits in the library head row */
#left #sec-layers .acts #addlayer, #left #addlayer { color: var(--ink); }

/* right inspector */
#inspector .tabs { padding: 8px 10px 8px; border-bottom: 1px solid var(--line); }
#inspector .tabs button { height: 28px; padding: 0 12px; border-radius: 8px; font-weight: 550; }

/* dock */
#dock .play { width: 30px; height: 30px; }
#dock .tg { border-radius: 8px; }
