/* OverCraft — product layer over tc-base.css (the shared Overshoot base:
   tokens, fonts, .seg, .tile, .toggle, .ghost-pill, .curve-svg, scrollbar).
   Nothing here redefines a token. Minimal by design: icons carry the panel,
   words live in tooltips and toasts. .oc- = product; .sim- and .ae- = the
   browser simulator, which never ships. */

/* three sizes — picked from the dock width, or forced from ⋮ ▸ SIZE. Everything that has a size reads these. */
.oc-panel { --ib: 30px; --ic: 16px; --mode-fs: 10.5px; --mode-py: 6px; --tile-val: 15px; --tile-head: 8px; --opt-head: 8px; --opt-val: 13px; --opt-pad: 5px 10px 4px; --lib-head: 8.5px; --lib-name: 11px; --lib-tw: 46px; --lib-th: 32px; --lib-cw: 62px; --lib-ch: 40px; --lib-cn: 9px; --lib-w: 232px; --thumb-w: 38px; --thumb-h: 28px; --gap: 10px; --pad: 12px; --meta-fs: 10px; --chip-fs: 10.5px; }
.oc-panel[data-size="compact"] { --ib: 26px; --ic: 14px; --mode-fs: 9.5px; --mode-py: 5px; --tile-val: 13px; --tile-head: 7.5px; --opt-head: 7px; --opt-val: 11.5px; --opt-pad: 4px 8px 3px; --lib-head: 8px; --lib-name: 10px; --lib-tw: 40px; --lib-th: 28px; --lib-cw: 54px; --lib-ch: 35px; --lib-cn: 8.5px; --lib-w: 204px; --thumb-w: 32px; --thumb-h: 24px; --gap: 8px; --pad: 8px; --meta-fs: 9px; --chip-fs: 10px; }
.oc-panel[data-size="wide"] { --ib: 36px; --ic: 19px; --mode-fs: 12.5px; --mode-py: 8px; --tile-val: 19px; --tile-head: 9px; --opt-head: 8px; --opt-val: 13px; --opt-pad: 5px 10px 4px; --lib-head: 9.5px; --lib-name: 12.5px; --lib-tw: 54px; --lib-th: 38px; --lib-cw: 72px; --lib-ch: 46px; --lib-cn: 10px; --lib-w: 264px; --thumb-w: 50px; --thumb-h: 34px; --gap: 12px; --pad: 16px; --meta-fs: 11px; --chip-fs: 12px; }
.oc-panel { position: relative; background: var(--bg); color: var(--t-body); display: flex; flex-direction: column; gap: var(--gap); padding: var(--gap) var(--pad) 18px; min-height: 100%; -webkit-user-select: none; user-select: none; }
.oc-panel .ic { width: var(--ic); height: var(--ic); flex: none; }

/* icon buttons — the whole vocabulary */
.oc-ib { display: grid; place-items: center; width: var(--ib); height: var(--ib); border-radius: 8px; border: 1px solid transparent; background: transparent; color: var(--t-muted); cursor: pointer; transition: color .15s, background .15s, border-color .15s; }
.oc-ib:hover { color: var(--t-primary); background: var(--card); border-color: var(--b2); }
.oc-ib:active { color: var(--mint); }
.oc-ib.on { color: var(--mint); }
.oc-ib.idle { opacity: .4; }
.oc-ib[hidden] { display: none; }
.oc-ib.oc-apply { background: var(--accent); color: var(--on-accent); border-color: transparent; width: calc(var(--ib) * 1.5); }
.oc-ib.oc-apply:hover { filter: brightness(1.08); box-shadow: 0 0 14px rgba(var(--mint-rgb), 0.45); color: var(--on-accent); }
.oc-ib.oc-apply.idle { opacity: 1; background: transparent; color: var(--t-faint); border-color: var(--b3); box-shadow: none; }
/* auto mode: the check becomes a live light — every change already went through */
.oc-ib.oc-apply.live { background: rgba(var(--mint-rgb), 0.1); color: var(--mint); border-color: rgba(var(--mint-rgb), 0.45); box-shadow: none; }
.oc-ib.oc-apply.live.idle { background: transparent; color: var(--t-faint); border-color: var(--b3); }
.oc-ib.oc-apply.flash { animation: ocFlash .4s cubic-bezier(0.16, 1, 0.3, 1); }
@keyframes ocFlash { 0% { background: var(--accent); color: var(--on-accent); box-shadow: 0 0 16px rgba(var(--mint-rgb), 0.6); } 100% { } }
.oc-ib#autoBtn.on { color: var(--mint); background: rgba(var(--mint-rgb), 0.1); border-color: rgba(var(--mint-rgb), 0.3); }
.oc-sep { width: 1px; height: 16px; background: var(--b2); margin: 0 4px; }

.oc-bar { display: flex; align-items: center; justify-content: center; gap: 2px; }
/* the status line: the selection chip on the left, ⋮ on the right, straight under the options */
.oc-status { display: flex; align-items: center; gap: 2px; min-width: 0; }
.oc-fill { flex: 1; }
/* the name, in the status line (his pick 2026-09-19): Over white, Shoot mint, the version faint */
.oc-logo { display: inline-flex; align-items: baseline; gap: 6px; margin-left: 4px; font-family: var(--sg); font-size: 15px; font-weight: 700; letter-spacing: -0.01em; color: var(--t-primary); white-space: nowrap; }
.oc-logo b { font-weight: 700; color: var(--mint); margin-left: -6px; }
.oc-logo i { font-style: normal; font-family: var(--sg); font-size: 9.5px; font-weight: 500; letter-spacing: 0.04em; color: var(--t-muted); }
.oc-chip { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; font-family: var(--sg); font-size: 10.5px; font-weight: 600; letter-spacing: 0.02em; color: var(--t-faint); padding-right: 4px; white-space: nowrap; }
.oc-chip i { width: 6px; height: 6px; border-radius: 50%; background: var(--b4); }
.oc-chip.live { color: var(--mint); } .oc-chip.live i { background: var(--mint); box-shadow: 0 0 8px rgba(var(--mint-rgb), 0.6); }
.oc-chip.blocked { color: var(--t-muted); } .oc-chip.blocked i { background: #ff9a5a; }

/* the canvas — biggest thing on screen; curve, handles, preview all inside the black */
.oc-canvas { position: relative; background: var(--inset); border: 1px solid var(--b2); border-radius: 10px; overflow: hidden; aspect-ratio: 1.12; }
/* the canvas is ALWAYS the full width of the panel — it is the instrument; the panel scrolls if it must */
.oc-canvas .curve-svg { position: absolute; inset: 0; width: 100%; height: 100%; border: none; border-radius: 0; background: transparent; overflow: visible; }
/* the preview strip: its ▷ toggle heads the line it animates (his pick 2026-09-18, P2) */
.oc-pvrow { display: flex; align-items: center; gap: 2px; margin-top: -2px; }
.oc-pvrow .oc-ib { width: 22px; height: 18px; flex: none; border-radius: 6px; }
.oc-pvbar { display: block; height: 18px; flex: 1; min-width: 0; }
.oc-pvbar.off { visibility: hidden; }
.oc-nums { display: inline-flex; align-items: baseline; gap: 10px; margin: 0 8px; justify-self: center; min-width: 0; color: var(--t-faint); transition: opacity .15s; }
.oc-nums[hidden] { display: none; }
.oc-nums.pair .tile.mini[data-scrub="pt_t"], .oc-nums.pair .tile.mini[data-scrub="pt_v"] { display: none; }
/* the middle of the meta line is a control, not code (his pick 2026-09-18, F2d): tracked Space Grotesk
   labels, Instrument Sans numbers at the readout's size and grey */
.oc-nums .k { font-family: var(--sg); font-size: 8px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--t-faint); }
.oc-nums .tile.mini [data-val] { font-family: var(--is); font-size: var(--meta-fs); font-weight: 500; letter-spacing: 0; }
.oc-nums .tile.mini { display: inline-flex; align-items: baseline; gap: 5px; padding: 0; background: transparent; border: none; border-radius: 0; cursor: ew-resize; font: inherit; letter-spacing: inherit; }
.oc-nums .tile.mini [data-val] { color: inherit; min-width: 2ch; text-align: right; }
.oc-nums .tile.mini em { display: none; }
.oc-nums .tile.mini:hover [data-val] { color: var(--mint); }
.oc-nums.off { opacity: .45; } .oc-nums.off .tile.mini { pointer-events: none; }
.oc-nums .tile.mini.end { opacity: .35; pointer-events: none; }
.tile-in, .oc-metain { font: inherit; color: var(--mint); background: transparent; border: none; border-bottom: 1px solid var(--mint); outline: none; width: 5.5ch; padding: 0; text-align: center; }
.oc-metain { width: 14ch; text-align: left; }
.oc-ask { min-width: 190px; padding: 8px; gap: 6px; }
.oc-ask #askInput { font-family: var(--sg); font-size: 11px; letter-spacing: 0.06em; color: var(--t-primary); background: var(--inset); border: 1px solid var(--b3); border-radius: 6px; padding: 6px 8px; outline: none; }
.oc-ask #askInput:focus { border-color: var(--mint); }
.oc-askhint { font-family: var(--sg); font-size: 8px; letter-spacing: 0.12em; color: var(--t-faint); padding: 0 2px; }
#tip { position: fixed; z-index: 60; max-width: 260px; padding: 7px 9px; background: var(--card); border: 1px solid var(--b4); border-radius: 7px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5); color: var(--t-secondary); font-family: var(--is); font-size: 10.5px; line-height: 1.4; letter-spacing: 0.01em; pointer-events: none; white-space: pre-line; animation: tcIn .14s cubic-bezier(0.16, 1, 0.3, 1) backwards; }
#tip[hidden] { display: none; }
.oc-metar { display: inline-flex; align-items: center; gap: 8px; justify-self: end; }
.oc-meta { display: grid; grid-template-columns: 1fr auto 1fr; align-items: baseline; padding: 0 6px; margin-top: -8px; font-family: ui-monospace, Menlo, monospace; font-size: var(--meta-fs); color: var(--t-faint); letter-spacing: 0.02em; }
.oc-meta span { cursor: pointer; }
.oc-meta span:hover { color: var(--t-secondary); }
.oc-canvas.empty .curve-svg { opacity: .55; }
/* the unit square — the limit of a plain ease; overshoot lives outside it */
.oc-canvas .curve-svg .gbox { fill: none; stroke: rgba(201, 201, 208, 0.34); stroke-width: 1; }
.oc-canvas .curve-svg .gv.out, .oc-canvas .curve-svg .gh.out { opacity: 0.45; }

/* library — ONE foldable strip. Folded: a single scrolling row, favourites first. Open: a wrapped grid. */
/* ── the library as a column (his pick 2026-09-19): ⋮ ▸ LIBRARY Left / Right ─────────────── */
.oc-main { display: flex; flex-direction: column; gap: var(--gap); flex: 1; min-width: 0; min-height: 0; }
.oc-panel[data-lib="left"], .oc-panel[data-lib="right"] { flex-direction: row; gap: 14px; height: 100vh; box-sizing: border-box; min-height: 0; overflow: hidden; }
.oc-panel[data-lib="left"] { flex-direction: row-reverse; }
.oc-panel[data-lib="left"] .oc-main, .oc-panel[data-lib="right"] .oc-main { overflow-y: auto; overflow-x: hidden; scrollbar-gutter: stable; }
.oc-panel[data-lib="left"] #libwrap, .oc-panel[data-lib="right"] #libwrap { display: none; }
.oc-side { width: var(--lib-w); flex: none; display: flex; flex-direction: column; min-height: 0; border-left: 1px solid var(--b2); padding-left: 12px; }
.oc-panel[data-lib="left"] .oc-side { border-left: none; border-right: 1px solid var(--b2); padding-left: 0; padding-right: 12px; }
.oc-side[hidden] { display: none; }
.oc-shead-bar { display: flex; align-items: center; justify-content: space-between; padding: 4px 2px 8px; flex: none; }
/* ⋮ ▸ ACCENT: seven swatches and a custom picker (his ask 2026-09-19) */
.oc-swatches { display: flex; align-items: center; gap: 5px; flex: 1; min-width: 0; flex-wrap: wrap; row-gap: 6px; }
.oc-sw { flex: none; width: 16px; height: 16px; border-radius: 50%; border: 2px solid transparent; padding: 0; cursor: pointer; background: var(--c); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.25); }
.oc-sw:hover { transform: scale(1.12); }
.oc-sw.on { border-color: var(--t-primary); }
.oc-swpick { position: relative; flex: none; width: 16px; height: 16px; border-radius: 50%; background: conic-gradient(#ff5a5a, #ffd15a, #5aff8c, #5ad0ff, #b45aff, #ff5a5a); border: 2px solid transparent; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.25); cursor: pointer; overflow: hidden; }
.oc-swpick.on { border-color: var(--t-primary); }
.oc-swpick input { position: absolute; inset: -6px; width: 30px; height: 30px; opacity: 0; cursor: pointer; }
.oc-slbl2 { font-family: var(--sg); font-size: var(--lib-head); font-weight: 700; letter-spacing: 0.14em; color: var(--t-faint); }
.oc-sview { width: 112px; } .oc-sview button { padding: 3px 0; font-size: 10px; }
.oc-sbody { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; scrollbar-width: thin; padding-right: 2px; }
.oc-shead { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 6px; padding: 6px 2px 6px; background: var(--bg); font-family: var(--sg); font-size: var(--lib-head); font-weight: 700; letter-spacing: 0.14em; color: var(--t-faint); cursor: pointer; -webkit-user-select: none; user-select: none; }
.oc-shead:hover { color: var(--t-secondary); }
.oc-shead .ic { width: 10px; height: 10px; }
.oc-shead > span:first-of-type { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }   /* the name takes the room; the count and chevron hang on the right, one column */
.oc-shead .n { flex: none; min-width: 22px; text-align: right; font-family: var(--is); font-size: calc(var(--lib-name) - 1px); font-weight: 500; letter-spacing: 0; }
.oc-shead .chev { width: 9px; height: 9px; opacity: .6; transition: transform .15s; }
.oc-sgroup.folded .oc-shead .chev { transform: rotate(-90deg); }
.oc-sgroup.folded .oc-sitems { display: none; }
.oc-shead.drop { color: var(--mint); }
.oc-sitems.names { display: flex; flex-direction: column; gap: 2px; padding-bottom: 0; }
.oc-lrow { display: flex; align-items: center; gap: 8px; padding: 2px 4px 2px 2px; border-radius: 7px; cursor: pointer; }
.oc-lrow:hover { background: var(--inset); }
.oc-lrow.on { background: rgba(var(--mint-rgb), 0.08); }
.oc-lrow .oc-thumbb { width: var(--lib-tw); height: var(--lib-th); pointer-events: none; }
.oc-lrow .nm { font-family: var(--is); font-size: var(--lib-name); font-weight: 500; color: var(--t-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.oc-lrow.on .nm { color: var(--mint); }
.oc-lrow .fv { margin-left: auto; width: 5px; height: 5px; border-radius: 50%; background: var(--mint); flex: none; }
.oc-lrow .kk { margin-left: auto; font-family: var(--is); font-size: 10px; font-weight: 700; color: var(--mint); }
.oc-sitems.grid { display: flex; flex-wrap: wrap; gap: 6px; padding-bottom: 0; }
.oc-card { width: var(--lib-cw); display: flex; flex-direction: column; align-items: center; gap: 2px; cursor: pointer; }
.oc-card .oc-thumbb { width: var(--lib-cw); height: var(--lib-ch); pointer-events: none; }
.oc-card .nm { font-family: var(--is); font-size: var(--lib-cn); font-weight: 500; color: var(--t-muted); max-width: var(--lib-cw); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.oc-card.on .nm { color: var(--mint); }
.oc-snew { display: block; width: 100%; margin: 0 0 6px; padding: 6px 8px; border: 1px dashed var(--b3); border-radius: 7px; background: transparent; color: var(--t-faint); font-family: var(--sg); font-size: var(--lib-head); font-weight: 700; letter-spacing: 0.14em; cursor: pointer; text-align: left; }
.oc-snew:hover { color: var(--t-secondary); border-color: var(--b-hover); }
.oc-libwrap { position: relative; display: flex; align-items: flex-start; gap: 4px; margin-top: 2px; }
.oc-libwrap.open { flex-wrap: wrap; }
.oc-libwrap.open .oc-lib { order: 2; flex-basis: 100%; }
.oc-libwrap.open .oc-fold { margin-left: auto; }
.oc-lib { flex: 1; min-width: 0; display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; padding-bottom: 1px; }
.oc-lib::-webkit-scrollbar { display: none; }
.oc-lib.open { flex-wrap: wrap; overflow: visible; }
.oc-thumbb { position: relative; flex: none; width: var(--thumb-w); height: var(--thumb-h); border-radius: 6px; border: 1px solid transparent; background: var(--card); padding: 0; cursor: pointer; transition: border-color .15s; }
.oc-thumbb svg { display: block; width: 100%; height: 100%; }
.oc-thumbb svg path { fill: none; stroke: var(--t-secondary); stroke-width: 1.5; stroke-linecap: round; transition: stroke .15s; }
.oc-thumbb:hover { border-color: var(--b-hover); } .oc-thumbb:hover svg path { stroke: var(--mint); }
.oc-thumbb.on { border-color: var(--mint); background: rgba(var(--mint-rgb), 0.1); } .oc-thumbb.on svg path { stroke: var(--mint); }
.oc-thumbb.fav::after { content: ""; position: absolute; right: 3px; bottom: 3px; width: 4px; height: 4px; border-radius: 50%; background: var(--mint); opacity: .85; }
.oc-thumbb.yours svg path { stroke: var(--t-muted); }
.oc-thumbb.fx::before { content: "ƒ"; position: absolute; left: 4px; top: 1px; font-family: var(--is); font-style: italic; font-size: 9px; font-weight: 600; color: var(--t-faint); line-height: 1; }   /* an expression preset */
/* group selector — one group at a time, picked from a tiny dropdown at the head of the strip */
.oc-gsel-wrap { position: relative; flex: none; }
.oc-gsel { display: inline-flex; align-items: center; gap: 5px; height: var(--thumb-h); padding: 0 7px 0 8px; border-radius: 6px; border: 1px solid var(--b3); background: transparent; color: var(--t-muted); cursor: pointer; font-family: var(--sg); font-size: 8.5px; font-weight: 700; letter-spacing: 0.14em; white-space: nowrap; transition: color .15s, border-color .15s; }
.oc-gsel .ic { width: 10px; height: 10px; }
.oc-gsel .chev { width: 9px; height: 9px; opacity: .7; }
.oc-gsel:hover, .oc-gsel.on { color: var(--t-primary); border-color: var(--b-hover); }
.oc-gmenu { position: absolute; left: 0; bottom: 32px; z-index: 30; width: 176px; padding: 4px; background: var(--card); border: 1px solid var(--b4); border-radius: 9px; box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55); animation: tcIn .18s cubic-bezier(0.16, 1, 0.3, 1) backwards; display: flex; flex-direction: column; gap: 1px; }
.oc-gmenu[hidden] { display: none; }
.oc-gitem { display: flex; align-items: center; gap: 8px; height: 26px; padding: 0 9px; width: 100%; box-sizing: border-box; overflow: hidden; border: none; border-radius: 6px; background: transparent; color: var(--t-secondary); cursor: pointer; font-family: var(--sg); font-size: 8.5px; font-weight: 700; letter-spacing: 0.14em; text-align: left; }
.oc-gitem .ic { width: 10px; height: 10px; flex: 0 0 auto; }
/* an imported tab name can be long — one line, clipped, so the list stays scannable */
.oc-gitem > span:not(.n):not(.x) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.oc-gitem .n { margin-left: auto; font-family: var(--is); font-size: 10px; font-weight: 500; letter-spacing: 0; color: var(--t-faint); }
.oc-gitem:hover { background: var(--inset); color: var(--t-primary); }
.oc-gitem .x { display: grid; visibility: hidden; flex: 0 0 auto; width: 16px; height: 16px; border-radius: 4px; place-items: center; font-size: 12px; font-weight: 500; color: var(--t-faint); margin-right: -4px; }
.oc-gitem:hover .x.ren, .oc-gitem:hover .x[data-del], .oc-gitem.user:hover .x { visibility: visible; }
.oc-gitem .x:hover { color: var(--t-primary); background: var(--b2); }
.oc-gitem .x.ren { font-size: 10px; margin-right: 0; }   /* ✎ rename, next to × — both slots reserved on every row */
.oc-grule { height: 1px; background: var(--b2); margin: 3px 4px; }
.oc-gnew { color: var(--t-faint); }
.oc-ctx { position: fixed; left: 0; top: 0; bottom: auto; width: auto; min-width: 150px; }
.oc-ctx .oc-ctitle { padding: 4px 9px 3px; font-family: var(--sg); font-size: 8.5px; font-weight: 700; letter-spacing: 0.14em; color: var(--t-faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.oc-ctx .oc-gitem.sub { padding-left: 18px; }
/* a pick menu (the flip tiles' choices): the scope menu's voice — a list of options, not of commands */
.oc-ctx.oc-pick { min-width: 168px; padding: 5px; }
.oc-ctx.oc-pick .oc-gitem { height: 30px; padding: 0 10px; font-family: var(--is); font-size: 12px; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--t-primary); }
.oc-ctx.oc-pick .oc-gitem .n { font-size: 12px; color: var(--mint); }
.oc-ctx.oc-pick .oc-gitem.on { color: var(--mint); }
.oc-ctx .oc-gitem.dim { color: var(--t-faint); cursor: default; } .oc-ctx .oc-gitem.dim:hover { background: transparent; }
.oc-ctx .oc-gitem.danger:hover { color: #ff7a7a; }
.oc-ghost { position: fixed; z-index: 40; width: var(--thumb-w); height: var(--thumb-h); border-radius: 6px; border: 1px solid var(--mint); background: var(--card); pointer-events: none; opacity: .92; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5); transform: translate(-50%, -50%); }
.oc-ghost svg { display: block; width: 100%; height: 100%; } .oc-ghost svg path { fill: none; stroke: var(--mint); stroke-width: 1.5; stroke-linecap: round; }
.oc-ghost[hidden] { display: none; }
.oc-ghost.grp { width: auto; height: auto; padding: 4px 8px; border-radius: 6px; }
.oc-gghost { font-family: var(--sg); font-size: 8.5px; font-weight: 700; letter-spacing: 0.14em; color: var(--mint); white-space: nowrap; }
/* the curve's name, the instant it is hovered (the 2 s tooltip carries the rest) */
.oc-cname { position: fixed; z-index: 45; transform: translate(-50%, -100%); padding: 3px 7px; border-radius: 5px; background: var(--card); border: 1px solid var(--b3); color: var(--t-primary); font-family: var(--is); font-size: 10.5px; font-weight: 600; white-space: nowrap; pointer-events: none; }
.oc-cname .k { color: var(--mint); margin-left: 5px; font-weight: 700; }
.oc-cname[hidden] { display: none; }
/* where a dragged curve will land in the strip */
.oc-ins { position: fixed; z-index: 44; width: 2px; height: var(--thumb-h); margin-left: -1px; border-radius: 1px; background: var(--mint); box-shadow: 0 0 6px rgba(var(--mint-rgb), 0.7); pointer-events: none; }
.oc-ins[hidden] { display: none; }
.oc-gsel.drop { color: var(--mint); border-color: var(--mint); }
.oc-gitem.drop { background: rgba(var(--mint-rgb), 0.12); color: var(--mint); }
.oc-gnew:hover { color: var(--mint); }
.oc-gitem.on { color: var(--mint); }
.oc-fold { flex: none; width: 22px; height: var(--thumb-h); border-radius: 6px; border: 1px solid transparent; background: transparent; color: var(--t-faint); cursor: pointer; display: grid; place-items: center; }
.oc-fold:hover { color: var(--t-secondary); background: var(--card); border-color: var(--b2); }
.oc-fold .ic { width: 12px; height: 12px; transition: transform .2s; }
.oc-libwrap.open .oc-fold .ic { transform: rotate(180deg); }

/* mode row — what Apply makes. Text, not glyphs: five words are cheaper to read than five squiggles. */
.oc-mode { background: var(--inset); border-color: var(--b2); margin-top: -2px; }
.oc-mode button { padding: var(--mode-py) 0; font-size: var(--mode-fs); letter-spacing: 0.01em; }

/* generator drawer — sits under the curve, only when Apply generates keyframes */
/* the options line (his layout 2026-09-19): the mode's settings as small tiles, one grid line, wrapping
   when the panel is narrow; no box around them */
.oc-opts { display: flex; margin-top: -1px; animation: tcIn .22s cubic-bezier(0.16, 1, 0.3, 1) backwards; }
.oc-opts.off { display: none; }
.oc-opts [data-for].off { display: none; }
.oc-tiles { display: flex; flex-wrap: wrap; align-items: stretch; gap: 6px; width: 100%; }
.oc-tiles .tile { flex: none; min-width: 48px; padding: var(--opt-pad); background: var(--inset); border-color: var(--b2); border-radius: 7px; }   /* sizes follow the SIZE tier (his note 2026-09-19) */
.oc-tiles .tile-head { font-size: var(--opt-head); letter-spacing: 0.12em; margin-bottom: 2px; }
.oc-tiles .tile-val { font-family: var(--is); font-size: var(--opt-val); font-weight: 600; letter-spacing: 0; line-height: 1.15; }
.oc-tiles .tile-val em { font-size: 10px; margin-left: 2px; }
.oc-tiles .tile.flip { cursor: pointer; }
.oc-tiles .tile.flip:hover { border-color: var(--b-hover); }
.oc-tiles .tile.flip .tile-val { display: flex; align-items: center; gap: 4px; }
.oc-tiles .tile.flip .chev { width: 9px; height: 9px; opacity: .5; flex: none; }
.oc-tiles .oc-commitb { margin-left: auto; align-self: flex-end; }
/* generator presets: a thumbnail of what Apply will write, and three chips that set the tiles */
.oc-genthumb { flex: none; width: 120px; height: 28px; border-radius: 6px; background: var(--inset); border: 1px solid var(--b2); }
.oc-genthumb path { fill: none; stroke: var(--mint); stroke-width: 1.5; stroke-linecap: round; }
.oc-genthumb line { stroke: rgba(201, 201, 208, 0.25); stroke-width: 1; }
.oc-chips { flex: 1; display: flex; gap: 4px; flex-wrap: wrap; }
.oc-chipb { height: 24px; padding: 0 10px; border-radius: 7px; border: 1px solid var(--b3); background: transparent; color: var(--t-secondary); font-family: var(--is); font-size: 11px; font-weight: 500; cursor: pointer; transition: color .15s, border-color .15s, background .15s; }
.oc-chipb:hover { color: var(--t-primary); border-color: var(--b-hover); }
.oc-chipb.on { color: var(--mint); border-color: rgba(var(--mint-rgb), 0.45); background: rgba(var(--mint-rgb), 0.08); }
.oc-ssize { gap: 10px; }
.oc-ssize .seg { flex: 1; }
.oc-slbl { font-family: var(--sg); font-size: 9px; font-weight: 700; letter-spacing: 0.14em; color: var(--t-faint); }
.seg.seg-n4 { grid-template-columns: repeat(4, 1fr); }
.seg.oc-mini.seg-n4 .seg-ind { width: calc((100% - 18px) / 4); left: calc(3px + var(--idx, 0) * ((100% - 18px) / 4 + 4px)); }
.seg.oc-mini { background: var(--inset); border-color: var(--b2); padding: 3px; border-radius: 8px; }
.seg.oc-mini button { padding: 5px 0; font-size: 10.5px; border-radius: 6px; }
.seg.oc-mini .seg-ind { top: 3px; bottom: 3px; border-radius: 6px; }
.seg.seg-n5 { grid-template-columns: repeat(5, 1fr); }
.seg.seg-n5 .seg-ind { width: calc((100% - 24px) / 5); left: calc(4px + var(--idx, 0) * ((100% - 24px) / 5 + 4px)); }
.seg.seg-n2 { grid-template-columns: repeat(2, 1fr); }
.seg.seg-n2 .seg-ind { width: calc((100% - 12px) / 2); left: calc(4px + var(--idx, 0) * ((100% - 12px) / 2 + 4px)); }
.seg.oc-mini.seg-n2 .seg-ind { width: calc((100% - 10px) / 2); left: calc(3px + var(--idx, 0) * ((100% - 10px) / 2 + 4px)); }
.gated.off { display: none; }

/* the chip is a button now: it says what Apply will touch, and opens the choice */
.oc-scope-wrap { position: relative; min-width: 0; display: flex; justify-content: flex-end; }
.oc-chip { max-width: 100%; } .oc-chip > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.oc-chip { display: inline-flex; align-items: center; gap: 6px; height: calc(var(--ib) - 4px); padding: 0 8px 0 8px; border-radius: 7px; border: 1px solid transparent; background: transparent; font-family: var(--sg); font-size: var(--chip-fs); font-weight: 600; letter-spacing: 0.02em; color: var(--t-faint); white-space: nowrap; cursor: pointer; transition: border-color .15s, background .15s; }
.oc-chip:hover, .oc-chip.on { border-color: var(--b3); background: var(--card); }
.oc-chip i { width: 6px; height: 6px; border-radius: 50%; background: var(--b4); }
.oc-chip.live { color: var(--mint); } .oc-chip.live i { background: var(--mint); box-shadow: 0 0 8px rgba(var(--mint-rgb), 0.6); }
.oc-chip .chev { width: 9px; height: 9px; opacity: .6; }
.oc-scope { position: absolute; right: 0; top: 30px; z-index: 30; min-width: 176px; padding: 4px; background: var(--card); border: 1px solid var(--b4); border-radius: 9px; box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55); animation: tcIn .18s cubic-bezier(0.16, 1, 0.3, 1) backwards; display: flex; flex-direction: column; gap: 1px; }
.oc-scope[hidden] { display: none; }
.oc-sitem { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; padding: 6px 9px; border: none; border-radius: 6px; background: transparent; color: var(--t-secondary); cursor: pointer; text-align: left; font-family: var(--is); }
.oc-sitem b { font-size: 11.5px; font-weight: 600; color: var(--t-primary); }
.oc-sitem span { font-size: 10px; color: var(--t-faint); }
.oc-sitem:hover { background: var(--inset); }
.oc-sitem.on b { color: var(--mint); }
.oc-stitle { padding: 5px 9px 2px; font-family: var(--sg); font-size: 8.5px; font-weight: 700; letter-spacing: 0.14em; color: var(--t-faint); white-space: nowrap; }
.oc-stitle.live { color: var(--t-secondary); }

/* settings — a short list, nothing that changes what Apply does */
.oc-menu { position: absolute; top: 44px; left: var(--pad); z-index: 20; width: 256px; max-width: calc(100vw - 2 * var(--pad)); background: var(--card); border: 1px solid var(--b4); border-radius: 10px; padding: 6px; display: flex; flex-direction: column; gap: 2px; box-shadow: 0 20px 50px rgba(0, 0, 0, 0.55); animation: tcIn .22s cubic-bezier(0.16, 1, 0.3, 1) backwards; }
.oc-menu[hidden] { display: none; }
.oc-srow { display: flex; align-items: center; gap: 9px; height: 30px; padding: 0 8px; border-radius: 6px; }
.oc-srow.toggle:hover { background: var(--inset); }
.oc-srow .tgl-label { font-size: 11.5px; }
.oc-sbtn { border: none; background: transparent; color: var(--t-secondary); cursor: pointer; font-family: var(--is); font-size: 11.5px; font-weight: 500; text-align: left; }
.oc-sbtn:hover { background: var(--inset); color: var(--t-primary); }
.oc-srule { height: 1px; background: var(--b2); margin: 3px 4px; }
.oc-ver { padding: 4px 8px 2px; font-family: var(--sg); font-size: 9.5px; color: var(--t-faint); letter-spacing: 0.04em; }

/* ══ SIMULATOR (browser only) ══ */
/* the scrollbar's width is reserved even when it is not showing (CEF 99 supports it). Without this the
   panel oscillated: content a few px taller than the window → scrollbar → 8 px narrower → the square
   canvas gets shorter → content fits → scrollbar gone → wider → taller → … (his "glitching" 2026-09-19) */
html, body { height: 100%; scrollbar-gutter: stable; }
body { max-width: none; margin: 0; padding: 0; gap: 0; display: block; background: #1E1E20; color: var(--t-body); font-family: var(--is); }
.sim-bar { position: sticky; top: 0; z-index: 50; display: flex; align-items: center; gap: 18px; flex-wrap: wrap; padding: 10px 18px; background: #141416; border-bottom: 1px solid #2A2A2E; color: #8A8A92; font-size: 11.5px; }
.sim-bar .sim-tag { font-family: var(--sg); font-weight: 700; letter-spacing: 0.14em; font-size: 10px; color: #6C6C74; } .sim-bar .sim-tag b { color: #FFB84D; }
.sim-group { display: flex; align-items: center; gap: 4px; } .sim-group > span { margin-right: 6px; color: #6C6C74; }
.sim-group button { height: 26px; padding: 0 10px; border-radius: 6px; border: 1px solid #2C2C31; background: #1B1B1E; color: #A0A0A8; font-family: var(--is); font-size: 11.5px; font-weight: 500; cursor: pointer; }
.sim-group button:hover { border-color: #3C3C44; color: #E0E0E6; } .sim-group button.on { border-color: #FFB84D; color: #FFB84D; background: rgba(255, 184, 77, 0.08); }
.sim-note { margin-left: auto; color: #55555C; }
.sim-stage { display: flex; justify-content: center; align-items: flex-start; padding: 36px 20px 80px; }
.ae-dock { width: 330px; background: #232326; border: 1px solid #333338; border-radius: 6px; overflow: hidden; box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5); transition: width .35s cubic-bezier(0.22, 1, 0.36, 1); }
.ae-tab { display: flex; align-items: center; gap: 8px; height: 26px; padding: 0 10px; background: #1A1A1C; color: #B9B9C0; font-size: 11px; border-bottom: 1px solid #333338; }
.ae-tab .on { color: #EDEDED; padding: 0 8px; height: 26px; display: inline-flex; align-items: center; background: #232326; border-right: 1px solid #333338; }
.ae-tab i { margin-left: auto; color: #6C6C74; font-style: normal; }
.ae-body { max-height: 900px; overflow: auto; background: var(--bg); }
.ae-body::-webkit-scrollbar { width: 8px; } .ae-body::-webkit-scrollbar-thumb { background: var(--b4); border-radius: 4px; }

.oc-empty { font-size: 11px; color: var(--t-faint); padding: 7px 4px; white-space: nowrap; }

/* commit — leaves the parametric stage for good, so it reads as a deliberate act, not a toggle */
.oc-commitb { margin-left: auto; height: 22px; padding: 0 10px 0 8px; display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--b2); border-radius: 6px; background: transparent; color: var(--t-secondary); font-family: var(--sg); font-size: 8.5px; font-weight: 700; letter-spacing: 0.14em; cursor: pointer; }
.oc-commitb:hover { border-color: var(--mint); color: var(--mint); }
.oc-commitb .ic { width: 11px; height: 11px; flex: none; }
.oc-commitb.off { display: none; }

/* a generated curve is a preview of the maths — nothing on it is grabbable, so say so */
#editor.locked { cursor: default; }
#editor.locked .cpt { opacity: 0.45; }
#editor .cpt.sel { stroke: var(--mint); stroke-width: 2; }
#editor .cpt.hot { r: 5.5; }
#editor .cpt.held { fill: #ff9a5a; }
#editor .marquee { fill: rgba(var(--mint-rgb), 0.08); stroke: var(--mint); stroke-width: 1; stroke-dasharray: 3 3; pointer-events: none; }
.oc-ib.on.part { color: var(--t-secondary); }

/* The two stages read as two kinds of thing, not five of a kind. The STAGE is a place you are in,
   so it keeps the segmented pill; the MODE is a choice within that place, so it is plain text with
   a rule under the live one. Two identical pill rows made them look like the same kind of choice. */
.oc-tabs { margin-bottom: 9px; }
.oc-tabs button { padding: var(--mode-py) 0; font-family: var(--is); font-size: calc(var(--mode-fs) + 0.5px); letter-spacing: 0.01em; font-weight: 600; }
.seg.seg-n3 { grid-template-columns: repeat(3, 1fr); }
.seg.seg-n3 .seg-ind { width: calc((100% - 16px) / 3); left: calc(4px + var(--idx, 0) * ((100% - 16px) / 3 + 4px)); }
.oc-mode.off { display: none; }

/* the mode row, stripped back to text — same markup and same binding as any segmented control */
.oc-textmodes { display: flex; gap: 18px; background: none; border: none; border-radius: 0; padding: 0 3px; margin-bottom: 2px; }
.oc-textmodes .seg-ind { display: none; }
.oc-textmodes button { padding: 3px 0 0; font-family: var(--is); font-size: 12.5px; font-weight: 500; letter-spacing: 0; color: var(--t-faint); border-radius: 0; }
.oc-textmodes button:hover { color: var(--t-secondary); box-shadow: none; }
.oc-textmodes button::after { content: ""; display: block; height: 2px; border-radius: 2px; background: transparent; margin-top: 5px; }
.oc-textmodes button.on { color: var(--t-primary); font-weight: 600; }
.oc-textmodes button.on::after { background: var(--mint); }
.oc-panel[data-size="compact"] .oc-textmodes { gap: 13px; }
.oc-panel[data-size="compact"] .oc-textmodes button { font-size: 11.5px; }
.oc-panel[data-size="wide"] .oc-textmodes { gap: 22px; }
.oc-panel[data-size="wide"] .oc-textmodes button { font-size: 13.5px; }
