/* Chromatic Flow · OSO
   One workspace: the gradient is the only object on the page. Tools live in a dock and show their
   controls only while they're in use; the CSS readout beside the dock is always the current output.
   The interface stays neutral (shared with Chromatic Clash) so the blend reads true. */

@font-face { font-family: 'Schibsted Grotesk'; font-style: normal; font-weight: 400 900; font-display: swap;
  src: url(../chromaticclash/assets/fonts/schibsted-grotesk-latin-ext-wght-normal.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Schibsted Grotesk'; font-style: normal; font-weight: 400 900; font-display: swap;
  src: url(../chromaticclash/assets/fonts/schibsted-grotesk-latin-wght-normal.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'DM Mono'; font-style: normal; font-weight: 400; font-display: swap;
  src: url(../chromaticclash/assets/fonts/dm-mono-400-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'DM Mono'; font-style: normal; font-weight: 500; font-display: swap;
  src: url(../chromaticclash/assets/fonts/dm-mono-500-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --paper: #ECEBE7;
  --panel: #F5F4F1;
  --card: #FFFFFF;
  --text: #131312;
  --muted: #5E5D58;
  --line: rgba(19, 19, 18, .12);
  --line-2: rgba(19, 19, 18, .26);
  --hover: rgba(19, 19, 18, .055);
  --dot: rgba(19, 19, 18, .13);
  --invert-bg: #131312;
  --invert-fg: #F4F3F0;
  --dock: #161615;
  --dock-fg: #D9D8D3;
  --dock-line: transparent;
  --code: #1B1B1A;
  --code-fg: #E9E8E3;
  --code-muted: #8F8E89;
  --shadow: 0 24px 60px -34px rgba(0, 0, 0, .55), 0 2px 6px -2px rgba(0, 0, 0, .12);
  --font-ui: 'Schibsted Grotesk', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'DM Mono', ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
  --top-h: 56px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #151514; --panel: #1C1C1B; --card: #242422; --text: #EDECE8; --muted: #A3A29C;
    --line: rgba(237, 236, 232, .11); --line-2: rgba(237, 236, 232, .24); --hover: rgba(237, 236, 232, .06); --dot: rgba(237, 236, 232, .1);
    --invert-bg: #EDECE8; --invert-fg: #151514; --dock: #232321; --dock-fg: #CFCEC9; --dock-line: rgba(237, 236, 232, .1);
    --code: #232321; --code-fg: #E9E8E3; --code-muted: #8F8E89; --shadow: 0 24px 60px -30px rgba(0, 0, 0, .9);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #151514; --panel: #1C1C1B; --card: #242422; --text: #EDECE8; --muted: #A3A29C;
  --line: rgba(237, 236, 232, .11); --line-2: rgba(237, 236, 232, .24); --hover: rgba(237, 236, 232, .06); --dot: rgba(237, 236, 232, .1);
  --invert-bg: #EDECE8; --invert-fg: #151514; --dock: #232321; --dock-fg: #CFCEC9; --dock-line: rgba(237, 236, 232, .1);
  --code: #232321; --code-fg: #E9E8E3; --code-muted: #8F8E89; --shadow: 0 24px 60px -30px rgba(0, 0, 0, .9);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--text); font: 400 15px/1.5 var(--font-ui); -webkit-font-smoothing: antialiased; }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); background: var(--paper); z-index: 70; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: fixed; left: 12px; top: -60px; z-index: 100; padding: 10px 14px; border-radius: 99px; background: var(--invert-bg); color: var(--invert-fg); text-decoration: none; }
.skip:focus { top: calc(12px + env(safe-area-inset-top, 0px)); }
.sprite { display: none; }
.icon { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* ── Top bar ─────────────────────────────────────── */
.top { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 50; height: var(--top-h); display: flex; align-items: center; gap: 14px; padding: 0 max(18px, env(safe-area-inset-right, 0px)) 0 max(18px, env(safe-area-inset-left, 0px)); background: var(--paper); border-bottom: 1px solid var(--line); }
.brand { display: flex; color: var(--text); }
.oso-mark { width: 60px; height: 23px; overflow: visible; }
.oso-mark path { fill: currentColor; stroke: currentColor; stroke-width: .8; stroke-dasharray: 1; }
@media (prefers-reduced-motion: no-preference) {
  .oso-mark path { animation: cf-trace 1.1s var(--ease) both, cf-fill .45s ease 1s both; }
  .oso-mark path:nth-child(2) { animation-delay: .08s, 1.06s; }
  .oso-mark path:nth-child(n+3) { animation-delay: .16s, 1.12s; }
}
@keyframes cf-trace { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes cf-fill { from { fill-opacity: 0; } to { fill-opacity: 1; } }
.brand-sep { width: 1px; height: 22px; background: var(--line-2); }
.tool-id { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.tool-title { margin: 0; font-size: 17px; font-weight: 700; letter-spacing: -.02em; white-space: nowrap; }
.tool-sub { font: 400 12px var(--font-mono); color: var(--muted); white-space: nowrap; }
.top-nav { margin-left: auto; display: flex; gap: 20px; font-size: 13.5px; font-weight: 500; }
.top-nav a { text-decoration: none; color: var(--muted); }
.top-nav a:hover { color: var(--text); }
.tbtn { display: inline-flex; align-items: center; justify-content: center; height: 34px; border: 1px solid var(--line-2); border-radius: 99px; background: transparent; }
.tbtn:hover { background: var(--hover); }
.tbtn-icon { width: 34px; padding: 0; }
.tbtn .icon { width: 16px; height: 16px; }

/* ── Browse: the front door ──────────────────────── */
.tbtn-back { gap: 7px; width: auto; padding: 0 12px; font-size: 13.5px; font-weight: 500; white-space: nowrap; }
.browse { display: grid; grid-template-columns: minmax(0, 1fr); align-content: start; gap: 16px; padding: 0 max(20px, env(safe-area-inset-right, 0px)) 24px max(20px, env(safe-area-inset-left, 0px)); outline: none; }
.bnav { position: sticky; top: calc(var(--top-h) + env(safe-area-inset-top, 0px)); z-index: 40; display: flex; align-items: center; gap: 12px; margin: 0 calc(-1 * max(20px, env(safe-area-inset-left, 0px))); padding: 0 max(20px, env(safe-area-inset-right, 0px)) 0 max(20px, env(safe-area-inset-left, 0px)); background: var(--paper); border-bottom: 1px solid var(--line); }
.btabs { flex: 1; min-width: 0; display: flex; gap: 26px; overflow-x: auto; scrollbar-width: none; }
.btabs::-webkit-scrollbar { display: none; }
.ftab { flex: none; position: relative; height: 50px; padding: 0; border: 0; background: none; font-size: 14px; font-weight: 500; color: var(--muted); white-space: nowrap; }
.ftab small { margin-left: 6px; font: 400 10.5px var(--font-mono); }
.ftab:hover, .ftab[aria-current="true"] { color: var(--text); }
.ftab[aria-current="true"]::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--text); }
.ftab.out { opacity: .4; }
.ftab:focus-visible { outline-offset: -4px; }
.bnav-tools { flex: none; display: flex; align-items: center; gap: 6px; }
.icon-btn { width: 40px; height: 40px; display: grid; place-items: center; padding: 0; border: 1px solid var(--line-2); border-radius: 99px; background: transparent; }
.icon-btn:hover { background: var(--hover); }
.bnav-btn { position: relative; width: 36px; height: 36px; }
.bnav-btn .icon { width: 17px; height: 17px; }
.bnav-btn[aria-pressed="true"], .bnav-btn[aria-expanded="true"] { background: var(--invert-bg); color: var(--invert-fg); border-color: var(--invert-bg); }
.bnav-btn .count { position: absolute; top: -5px; right: -5px; min-width: 16px; padding: 0 4px; border-radius: 9px; background: var(--invert-bg); color: var(--invert-fg); font: 500 10px/16px var(--font-mono); text-align: center; box-shadow: 0 0 0 2px var(--paper); }
.bnav-btn .count:empty { display: none; }
.bsearch { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px; border: 1px solid var(--text); border-radius: 99px; background: var(--card); }
.bsearch .icon { width: 15px; height: 15px; color: var(--muted); }
.bsearch input { width: 170px; border: 0; background: transparent; outline: none; font-size: 13.5px; }

.car { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; min-width: 0; padding-top: 4px; }
.car-stage { position: relative; height: clamp(380px, calc(100svh - 206px), 760px); overflow: hidden; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.car-track { position: absolute; inset: 0; --drag: 0px; }
.fslide { position: absolute; top: 0; bottom: 0; left: 50%; width: var(--sw, 80%); margin-left: calc(var(--sw, 80%) / -2); container: fslide / size; overflow: hidden; border-radius: 4px; background-color: var(--f0); color: var(--on); transform: translateX(calc(var(--slot) * (var(--sw, 80%) + var(--gap, 16px)) + var(--drag))); transition: transform .42s var(--ease); cursor: pointer; }
.car-track.dragging .fslide, .car-track.snap .fslide { transition: none; }
.car-track.dragging .fslide { cursor: grabbing; }
.fslide.enter { animation: cf-enter .35s var(--ease) both; }
@keyframes cf-enter { from { opacity: .4; transform: translateX(calc(var(--slot) * (var(--sw) + var(--gap)))) scale(.985); } }
.fslide:not([data-slot="0"]) > * { opacity: 0; }
@media (prefers-reduced-motion: no-preference) { .fslide[data-slot="0"] > * { animation: cf-words .4s var(--ease) both; } }
@keyframes cf-words { from { opacity: 0; transform: translateY(6px); } }
.fs-top { position: absolute; left: 5cqw; right: 5cqw; top: max(18px, 4.5cqh); display: flex; justify-content: space-between; font: 500 12px var(--font-mono); letter-spacing: .08em; }
.fs-main { position: absolute; left: 5cqw; right: 5cqw; bottom: calc(max(18px, 7cqh) + 64px); display: grid; gap: 10px; }
.fs-name { margin: 0; max-width: 14ch; font-size: clamp(42px, 9cqw, 124px); line-height: .9; font-weight: 800; letter-spacing: -.05em; text-wrap: balance; }
.fs-note { margin: 0; max-width: 46ch; font-size: clamp(14px, 1.5cqw, 17px); line-height: 1.4; }
/* The stops, laid along a rule at their real positions. */
.fs-stops { position: absolute; left: 5cqw; right: 5cqw; bottom: max(18px, 7cqh); height: 1px; background: color-mix(in srgb, var(--on) 50%, transparent); }
.fs-stop { position: absolute; top: -7px; display: grid; justify-items: center; gap: 7px; padding: 0 0 4px; border: 0; background: none; color: inherit; transform: translateX(-50%); cursor: copy; }
.fs-stop:first-child { justify-items: start; transform: none; }
.fs-stop:last-child { justify-items: end; transform: translateX(-100%); }
.fs-stop i { width: 14px; height: 14px; border-radius: 50%; box-shadow: 0 0 0 2px var(--on); }
.fs-stop b { padding: 3px 6px; border-radius: 4px; background: var(--chip); color: var(--chip-ink); box-shadow: 0 0 0 1px color-mix(in srgb, var(--chip-ink) 24%, transparent); font: 500 clamp(11.5px, 1.2cqw, 13.5px) var(--font-mono); }
.fs-stop:hover b { text-decoration: underline; text-underline-offset: 3px; }
.fs-stop:focus-visible { outline: 2px solid var(--on); outline-offset: 3px; border-radius: 3px; }
.fslide-use .pv-layout { color: var(--on); }
.fs-cap { position: absolute; right: 5cqw; bottom: 4cqw; z-index: 1; margin: 0; font: 500 max(8px, 1.05cqw) var(--font-mono); letter-spacing: .1em; text-transform: uppercase; }
/* Set per element by inkSlide() when neither ink reaches the contrast that text needs over the band
   of the blend behind it. */
.fslide .lift { width: fit-content; margin-left: -.35em; padding: .15em .35em; border-radius: 4px; background: color-mix(in srgb, var(--on-inv) 82%, transparent); }
.fs-cap.lift { margin: 0; padding: .35em .6em; }
@container fslide (orientation: portrait) {
  .fs-name { font-size: clamp(36px, 13cqw, 64px); }
  .fs-main { bottom: calc(max(18px, 7cqh) + 64px); }
}
/* On a narrow slide, stops can sit about 70px apart, closer than two labels need. Alternate the
   labels above and below the rule so neighbours never share a side. */
@container fslide (max-width: 620px) {
  /* The note would run across most of the blend at this width, where no single ink holds 4.5:1.
     The editor still shows it. */
  .fs-note { display: none; }
  .fs-main { bottom: calc(max(18px, 7cqh) + 74px); }
  .fs-stop:nth-child(even) { top: auto; bottom: -6px; padding: 4px 0 0; }
  .fs-stop b { padding: 2px 5px; }
  .fs-stop:nth-child(even) b { order: -1; }
}
.car-empty { position: absolute; inset: 0; display: grid; place-content: center; gap: 4px; max-width: 46ch; margin: auto; padding: 24px; text-align: center; color: var(--muted); }
.car-empty b { display: block; color: var(--text); }
.car-bar { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: 12px; }
.car-nav { display: flex; align-items: center; gap: 6px; }
.car-strip { display: flex; justify-content: center; gap: 6px; min-width: 0; }
.strip-chip { flex: 0 1 38px; min-width: 22px; height: 26px; padding: 0; border: 0; border-radius: 5px; background-color: var(--f0); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .1); transition: transform .2s var(--ease), opacity .2s; }
.strip-chip:hover:not(:disabled) { transform: translateY(-2px); }
.strip-chip[aria-current="true"] { box-shadow: 0 0 0 2px var(--paper), 0 0 0 4px var(--text); }
.strip-chip.out { opacity: .2; cursor: default; }
.bview button { display: inline-flex; align-items: center; gap: 6px; }
.bview .icon { width: 15px; height: 15px; }
.car-edit { height: 40px; }

.bgrid { display: grid; gap: 36px; width: 100%; max-width: 1480px; margin: 0 auto; padding-top: 8px; }
.bg-sec { display: grid; gap: 14px; scroll-margin-top: calc(var(--top-h) + 70px); }
.bg-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; }
.bg-head h3 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: -.03em; }
.bg-head p { margin: 0; font-size: 13.5px; color: var(--muted); }
.bg-count { margin-left: auto; font: 400 11.5px var(--font-mono); color: var(--muted); }
/* Six across on a wide screen, so each family of six is exactly one row; three across in between. */
.bg-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px 14px; margin: 0; padding: 0; list-style: none; }
@media (min-width: 1000px) { .bg-list { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.bg-item { position: relative; }
.bg-card { display: grid; gap: 6px; width: 100%; padding: 0; border: 0; background: none; text-align: left; }
.bg-sw { display: block; aspect-ratio: 16 / 10; border-radius: 6px; background-color: var(--f0); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08); transition: transform .2s var(--ease); }
.bg-card:hover .bg-sw { transform: translateY(-3px); }
.bg-name { overflow: hidden; font-size: 14.5px; font-weight: 600; line-height: 1.2; white-space: nowrap; text-overflow: ellipsis; }
.bg-meta { margin-top: -3px; font: 400 10.5px var(--font-mono); letter-spacing: .04em; color: var(--muted); text-transform: uppercase; }
.bg-rm { position: absolute; top: 6px; right: 6px; width: 28px; height: 28px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 50%; background: rgba(0, 0, 0, .55); color: #FFF; }
.bg-rm .icon { width: 13px; height: 13px; }
.bg-empty { position: static; padding: 48px 16px; }

/* ── Workspace ───────────────────────────────────── */
.ws { --ar: 1.6; position: relative; grid-template-columns: minmax(0, 1fr); height: calc(100svh - var(--top-h) - env(safe-area-inset-top, 0px)); min-height: 560px; display: grid; grid-template-rows: auto minmax(200px, 1fr) auto auto; gap: 14px;
  padding: 16px max(24px, env(safe-area-inset-right, 0px)) max(16px, env(safe-area-inset-bottom, 0px)) max(24px, env(safe-area-inset-left, 0px));
  background-image: radial-gradient(var(--dot) 1px, transparent 1.3px); background-size: 22px 22px; background-position: 11px 11px; }
.ws-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; min-width: 0; }
.ws-title { min-width: 0; flex: 1; }
.name { display: block; width: 100%; max-width: 700px; height: 46px; margin: 0 0 0 -9px; padding: 0 8px; border: 1px solid transparent; border-radius: 8px; background: transparent; font-size: clamp(26px, 2.8vw, 36px); font-weight: 800; letter-spacing: -.04em; text-overflow: ellipsis; }
.name:hover { border-color: var(--line-2); }
.name:focus { border-color: var(--text); outline: none; background: var(--panel); }
.ws-meta { margin: 2px 0 0; font-size: 13.5px; color: var(--muted); }
.ctx { display: inline-block; margin-right: 10px; padding: 1px 8px; border: 1px solid var(--line-2); border-radius: 99px; font: 500 10.5px/18px var(--font-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--text); vertical-align: 1px; }
.origin-chip { margin: 6px 0 0; font-size: 13px; color: var(--muted); }
.origin-chip a { color: var(--text); font-weight: 500; }
.origin-chip .icon { width: 13px; height: 13px; vertical-align: -1px; }
.ws-acts { display: flex; align-items: center; gap: 10px; flex: none; padding-top: 4px; }
.link-btn { padding: 0; border: 0; background: none; font-size: 13.5px; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
.link-btn:hover { color: var(--text); }
.act { display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 15px; border: 1px solid var(--line-2); border-radius: 99px; background: transparent; font-size: 13.5px; font-weight: 500; white-space: nowrap; }
.act:hover:not(:disabled) { background: var(--hover); }
.act:disabled { opacity: .4; cursor: default; }
.act .icon { width: 16px; height: 16px; }
.btn { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 16px; border: 1px solid var(--invert-bg); border-radius: 99px; background: var(--invert-bg); color: var(--invert-fg); font-size: 13.5px; font-weight: 600; white-space: nowrap; }
.btn .icon { width: 16px; height: 16px; }

/* The board: the gradient at its export shape, with crop marks and a ruler of stops below. */
.board-area { container-type: size; min-height: 0; display: grid; place-items: center; }
.board-col { width: min(calc(100cqw - 56px), calc((100cqh - 96px) * var(--ar))); display: grid; gap: 14px; margin-top: 22px; }
.board { position: relative; aspect-ratio: var(--ar); width: 100%; container-type: inline-size; border-radius: 3px; background-color: var(--f0, #888); box-shadow: var(--shadow); cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; outline-offset: 6px; }
.board.turning { cursor: grabbing; }
.crop { position: absolute; width: 14px; height: 14px; border: 0 solid var(--line-2); pointer-events: none; }
.crop-tl { left: -12px; top: -12px; border-right-width: 1px; border-bottom-width: 1px; }
.crop-tr { right: -12px; top: -12px; border-left-width: 1px; border-bottom-width: 1px; }
.crop-bl { left: -12px; bottom: -12px; border-right-width: 1px; border-top-width: 1px; }
.crop-br { right: -12px; bottom: -12px; border-left-width: 1px; border-top-width: 1px; }
.board-size, .board-hint { position: absolute; top: -24px; font: 400 11px var(--font-mono); letter-spacing: .04em; color: var(--muted); white-space: nowrap; pointer-events: none; }
.board-size { right: 0; }
.board-hint { left: 0; }
.board-hint b { font-weight: 500; color: var(--text); }
@container (max-width: 420px) { .board-hint .t, .board-size .t { display: none; } }

/* Angle dial: shown in the Angle tool, drawn in whichever ink reads on the blend. */
.dial { position: absolute; left: 50%; top: 50%; width: calc(62cqw * min(1, 1 / var(--ar))); height: auto; aspect-ratio: 1; transform: translate(-50%, -50%); color: var(--on, #fff); pointer-events: none; opacity: 0; transition: opacity .25s; overflow: visible; }
.ws[data-active="angle"] .dial { opacity: 1; }
.dial .ring { fill: none; stroke: currentColor; stroke-opacity: .55; stroke-width: .6; }
.dial .tick { stroke: currentColor; stroke-opacity: .55; stroke-width: .6; }
.dial .tick.major { stroke-opacity: .95; stroke-width: 1; }
.dial text { fill: currentColor; font: 500 7px var(--font-mono); text-anchor: middle; dominant-baseline: middle; opacity: .9; }
.dial .arm { stroke: currentColor; stroke-width: 1.2; }
.dial .knob { fill: currentColor; }
.dial .hub { fill: none; stroke: currentColor; stroke-width: 1; }
.dial .deg { font: 700 15px var(--font-ui); letter-spacing: -.02em; opacity: 1; }

/* Previews on the board */
.board-content { position: absolute; inset: 0; overflow: hidden; color: var(--on, #fff); pointer-events: none; }
.pv-type { position: absolute; inset: 0; display: grid; grid-template-rows: auto 1fr auto; padding: 5cqw 5.5cqw; }
.pv-type small { font: 500 max(9px, 1.15cqw) var(--font-mono); letter-spacing: .1em; text-transform: uppercase; }
.pv-type strong { align-self: center; font-size: 10.5cqw; line-height: .9; font-weight: 800; letter-spacing: -.05em; }
.pv-type span { font-size: max(11px, 1.7cqw); line-height: 1.35; }
.pv-layout { position: absolute; inset: 0; display: grid; grid-template-rows: auto 1fr auto; padding: 4cqw 5cqw; }
.pv-nav { display: flex; justify-content: space-between; padding-bottom: 1.6cqw; border-bottom: 1px solid currentColor; font-size: max(9px, 1.4cqw); font-weight: 500; }
.pv-hero { align-self: center; display: grid; gap: 2cqw; }
.pv-hero b { font-size: 8.4cqw; line-height: .88; font-weight: 800; letter-spacing: -.05em; text-transform: uppercase; }
.pv-hero p { margin: 0; font-size: max(10px, 1.7cqw); line-height: 1.35; }
.pv-cta { justify-self: start; padding: 1.1cqw 2cqw; border-radius: 99px; background: var(--on, #fff); color: var(--on-inv, #111); font-size: max(9px, 1.4cqw); font-weight: 600; }
.pv-foot { font: 500 max(8px, 1.05cqw) var(--font-mono); letter-spacing: .1em; text-transform: uppercase; }

/* Ramp: the blend laid flat, with a handle for every stop. */
.ramp { display: grid; gap: 4px; transition: opacity .2s; }
.ws:not([data-active="blend"]) .ramp { opacity: 0; visibility: hidden; }
.ramp-track { position: relative; height: 26px; margin: 0 12px; }
.ramp-bar { position: absolute; inset: 4px -12px; border-radius: 99px; box-shadow: inset 0 0 0 1px var(--line); cursor: copy; }
.ramp-handles { position: absolute; inset: 0; pointer-events: none; }
.stop { position: absolute; top: 50%; width: 22px; height: 22px; margin: -11px 0 0 -11px; padding: 0; border: 0; border-radius: 50%; background: var(--sw); box-shadow: 0 0 0 3px #FFF, 0 0 0 4px rgba(0, 0, 0, .45), 0 2px 6px rgba(0, 0, 0, .3); cursor: grab; touch-action: none; pointer-events: auto; transition: transform .15s var(--ease); }
.stop[aria-pressed="true"] { z-index: 2; transform: scale(1.3); box-shadow: 0 0 0 3px #FFF, 0 0 0 5px var(--text), 0 2px 8px rgba(0, 0, 0, .35); }
.stop:focus-visible { outline: none; box-shadow: 0 0 0 3px #FFF, 0 0 0 5px var(--text), 0 0 0 8px var(--paper), 0 0 0 9px var(--text); }
.ramp-ticks { position: relative; height: 16px; margin: 4px 12px 0; font: 400 10.5px var(--font-mono); color: var(--muted); }
.ramp-ticks span { position: absolute; transform: translateX(-50%); white-space: nowrap; }
.ramp-ticks span.on { color: var(--text); font-weight: 500; }

/* Panel: one tool's controls at a time. */
.panel { justify-self: center; width: min(100%, 980px); padding: 12px 14px; border: 1px solid var(--line); border-radius: 16px; background: var(--panel); }
.ws[data-active=""] .panel { display: none; }
.pane { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; min-height: 40px; }
.stop-nav { display: inline-flex; align-items: center; gap: 2px; }
.mini { width: 30px; height: 30px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--muted); }
.mini:hover { background: var(--hover); color: var(--text); }
.mini .icon { width: 15px; height: 15px; }
.pane-k { font: 500 11px var(--font-mono); letter-spacing: .07em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.pane-sp { flex: 1; }
.pane-note { flex-basis: 100%; margin: 0; font-size: 12.5px; color: var(--muted); }
.pane-error { flex-basis: 100%; margin: 0; font-size: 12.5px; color: #C42A1E; }
.swatch-pick { position: relative; width: 38px; height: 38px; border-radius: 50%; overflow: hidden; box-shadow: inset 0 0 0 1px var(--line-2); cursor: pointer; }
.swatch-pick input { position: absolute; inset: -8px; width: calc(100% + 16px); height: calc(100% + 16px); border: 0; padding: 0; cursor: pointer; }
.field { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: 99px; background: var(--card); font-size: 12.5px; color: var(--muted); }
.field input { width: 84px; height: 100%; border: 0; background: transparent; color: var(--text); font: 500 13.5px var(--font-mono); text-transform: uppercase; outline: none; }
.field-sm input { width: 42px; text-align: right; }
.field i { font-style: normal; font: 400 12.5px var(--font-mono); }
.field:focus-within { border-color: var(--text); }
.field input[aria-invalid="true"] { color: #C42A1E; }
.range { flex: 1 1 200px; min-width: 140px; accent-color: var(--text); }
.seg { display: inline-flex; padding: 3px; border: 1px solid var(--line-2); border-radius: 99px; background: var(--card); }
.seg-wrap { flex-wrap: wrap; }
.seg button { height: 32px; padding: 0 14px; border: 0; border-radius: 99px; background: transparent; font-size: 13px; font-weight: 500; white-space: nowrap; }
.seg button:hover { background: var(--hover); }
.seg button[aria-pressed="true"] { background: var(--invert-bg); color: var(--invert-fg); }
.seg button small { margin-left: 5px; font: 400 10.5px var(--font-mono); opacity: .7; }

.pane-lib { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.lib-top { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.lib-search { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: 99px; background: var(--card); }
.lib-search .icon { width: 15px; height: 15px; color: var(--muted); }
.lib-search input { width: 150px; border: 0; background: transparent; outline: none; font-size: 13.5px; }
.lib-search:focus-within { border-color: var(--text); }
.lib-count { margin-left: auto; font: 400 11.5px var(--font-mono); color: var(--muted); }
.lib-list { display: flex; gap: 12px; margin: 0; padding: 2px 2px 8px; overflow-x: auto; list-style: none; scroll-snap-type: x proximity; scrollbar-width: thin; }
.lib-item { position: relative; flex: none; scroll-snap-align: start; }
.lib-pick { display: grid; gap: 6px; width: 140px; padding: 0; border: 0; background: none; text-align: left; }
.lib-sw { display: block; height: 82px; border-radius: 8px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08); }
.lib-pick[aria-current="true"] .lib-sw { box-shadow: 0 0 0 2px var(--panel), 0 0 0 4px var(--text); }
.lib-name { overflow: hidden; font-size: 13.5px; font-weight: 600; line-height: 1.2; white-space: nowrap; text-overflow: ellipsis; }
.lib-meta { margin-top: -4px; font: 400 10.5px var(--font-mono); letter-spacing: .04em; color: var(--muted); text-transform: uppercase; }
.lib-rm { position: absolute; top: 6px; right: 6px; width: 26px; height: 26px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 50%; background: rgba(0, 0, 0, .55); color: #FFF; }
.lib-rm .icon { width: 13px; height: 13px; }
.lib-empty { padding: 18px 4px; font-size: 13.5px; color: var(--muted); }
.lib-empty b { display: block; color: var(--text); }

.pane-export { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.ex-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.origin { display: grid; gap: 4px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--muted); }
.origin b { color: var(--text); font-weight: 600; }
.origin a { color: var(--text); }
.origin .icon { width: 13px; height: 13px; vertical-align: -1px; }
.code-details summary { width: max-content; font-size: 13px; color: var(--muted); cursor: pointer; }
.code-details textarea { width: 100%; margin-top: 8px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--code); color: var(--code-fg); font: 400 12px/1.6 var(--font-mono); resize: vertical; }

/* Dock and readout */
.dockbar { display: flex; align-items: center; justify-content: center; gap: 14px; min-width: 0; }
.readout { position: relative; display: flex; align-items: flex-start; gap: 10px; max-width: min(600px, 52vw); min-width: 0; padding: 10px 14px; border: 1px solid var(--dock-line); border-radius: 14px; background: var(--code); color: var(--code-fg); text-align: left; cursor: copy; box-shadow: var(--shadow); }
.readout::after { content: ""; position: absolute; right: -15px; top: 50%; width: 14px; height: 1px; background: var(--line-2); }
.ro-k { flex: none; margin-top: 1px; padding: 0 6px; border-radius: 4px; background: rgba(255, 255, 255, .1); font: 500 10px/17px var(--font-mono); letter-spacing: .08em; color: #C4C3BE; }
.readout code { min-width: 0; font: 400 12px/1.55 var(--font-mono); overflow-wrap: anywhere; }
.readout code i { font-style: normal; color: var(--code-muted); }
.readout code mark { padding: 0 2px; border-radius: 3px; background: rgba(255, 255, 255, .16); color: inherit; box-shadow: inset 0 -2px 0 var(--hl, #fff); }
.readout:hover { border-color: rgba(255, 255, 255, .2); }
.dock { flex: none; display: flex; align-items: center; gap: 4px; padding: 6px; border: 1px solid var(--dock-line); border-radius: 99px; background: var(--dock); color: var(--dock-fg); box-shadow: var(--shadow); }
.dock button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 42px; min-width: 42px; padding: 0 11px; border: 0; border-radius: 99px; background: transparent; font-size: 13px; font-weight: 600; letter-spacing: .02em; transition: background .2s, color .2s, padding .25s var(--ease); }
.dock button span { display: none; }
.dock button:hover { background: rgba(255, 255, 255, .08); color: #FFF; }
.dock button[aria-pressed="true"] { padding: 0 16px 0 12px; background: var(--grad, #FFF); color: var(--on, #111); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12); }
.dock button[aria-pressed="true"] span { display: inline; }
.dock button:focus-visible { outline: 2px solid #FFF; outline-offset: 2px; }
.noscript { margin: 0; text-align: center; color: var(--muted); }

.toast { position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom, 0px)); z-index: 90; max-width: calc(100vw - 32px); padding: 10px 16px; border-radius: 99px; background: var(--invert-bg); color: var(--invert-fg); font-size: 14px; font-weight: 500; opacity: 0; transform: translate(-50%, 12px); pointer-events: none; transition: opacity .2s, transform .2s var(--ease); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast { display: flex; align-items: center; gap: 14px; }
.toast button { pointer-events: auto; padding: 0; border: 0; background: none; color: inherit; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.toast.show:has(button:not([hidden])) { pointer-events: auto; }

/* ── Smaller screens ─────────────────────────────── */
@media (max-width: 900px) {
  .readout { max-width: none; flex: 1; }
  .readout::after { display: none; }
}
@media (max-width: 760px) {
  .ftab { height: 46px; font-size: 13.5px; }
  .btabs { gap: 20px; }
  .bsearch input { width: 120px; }
  .car-stage { height: clamp(380px, calc(100svh - 236px), 640px); }
  .car-bar { grid-template-columns: auto 1fr auto; grid-template-areas: "strip strip strip" "nav view edit"; gap: 12px 8px; }
  .car-strip { grid-area: strip; }
  .car-nav { grid-area: nav; }
  .bview { grid-area: view; justify-self: center; }
  .bview span { display: none; }
  .car-edit { grid-area: edit; }
  .car-shuffle { display: none; }
  .bg-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tbtn-back span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .tbtn-back { width: 34px; padding: 0; }
  .tool-sub { display: none; }
  .top-nav a:first-child { display: none; }
  .ws { min-height: 520px; gap: 10px; padding: 12px max(16px, env(safe-area-inset-right, 0px)) max(10px, env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); }
  .ws-head { align-items: center; gap: 10px; }
  .name { height: 38px; font-size: 24px; }
  .ws-meta { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
  .ws-acts { padding-top: 0; }
  #save span { display: none; }
  #save { width: 38px; padding: 0; justify-content: center; }
  .board-col { width: min(calc(100cqw - 28px), calc((100cqh - 92px) * var(--ar))); margin-top: 20px; gap: 10px; }
  .dockbar { flex-direction: column; gap: 8px; }
  .readout { width: 100%; padding: 7px 12px; box-shadow: none; }
  .readout code { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 11px; }
  .dock button { height: 44px; min-width: 44px; }
  .panel { padding: 10px; border-radius: 14px; }
  .pane { gap: 8px; }
  .pane-sp { display: none; }
  .lib-top { gap: 8px; }
  .lib-count { display: none; }
  .lib-search { flex: 1; min-width: 140px; }
  .lib-search input { width: 100%; }
  .lib-pick { width: 116px; }
  .lib-sw { height: 64px; }
  .seg button { flex: none; height: 30px; padding: 0 11px; font-size: 12.5px; }
  .seg-wrap { flex: 1 1 100%; flex-wrap: nowrap; min-width: 0; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
  .seg-wrap::-webkit-scrollbar { display: none; }
  .ex-row > .pane-k { display: none; }
  .toast { bottom: calc(132px + env(safe-area-inset-bottom, 0px)); }
}
@media (max-width: 520px) {
  .top-nav { display: none; }
  .tool-id { margin-right: auto; }
}
@media (max-width: 420px) {
  .pane:not(.pane-export) .act span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .pane:not(.pane-export) .act { width: 38px; padding: 0; justify-content: center; }
  .pane-export .act, .pane-export .btn { padding: 0 12px; }
  .field input { width: 76px; }
  .field-sm input { width: 34px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0s !important; animation-duration: 0s !important; }
}
