/* Bismillah
   Atkinson Hyperlegible, drawn by the Braille Institute so I/l/1 and O/0
   cannot be mistaken for one another. Carried here rather than shared, so
   this folder is complete on its own. Licence in OFL.txt. */

@font-face {
  font-family: 'YD Text';
  font-weight: 400;
  font-display: swap;
  src: url('yd-text-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+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215;
}
@font-face {
  font-family: 'YD Text';
  font-weight: 400;
  font-display: swap;
  src: url('yd-text-400-latinext.woff2') format('woff2');
  unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB,
    U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'YD Text';
  font-weight: 700;
  font-display: swap;
  src: url('yd-text-700-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215;
}
@font-face {
  font-family: 'YD Text';
  font-weight: 700;
  font-display: swap;
  src: url('yd-text-700-latinext.woff2') format('woff2');
  unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB,
    U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* Bismillah */

/* ================= TOKENS ================= */
:root{
  --yd-font: 'YD Text', system-ui, -apple-system, 'Segoe UI', sans-serif;

  --yd-r-sm: 10px;
  --yd-r-md: 14px;
  --yd-r-lg: 20px;
  --yd-r-pill: 999px;

  --yd-gap: 14px;
  --yd-pad: 20px;

  --yd-top: 58px;
  --yd-rail: 218px;
  --yd-panel: 292px;
  --yd-status: 30px;

  --yd-t: .16s cubic-bezier(.4,0,.2,1);
}

/* ---------- DARK (default) ---------- */
:root, :root[data-theme="dark"]{
  /* Tells the browser this page handles light and dark itself. Without it a
     browser set to darken pages automatically repaints the background behind
     our back, and the light theme comes out with a near black body while
     every token still says cream. It also makes scrollbars and form controls
     follow the theme instead of the system. */
  color-scheme: dark;

  --yd-bg:        #0E0E0F;
  --yd-surface:   #161618;
  --yd-surface-2: #1D1D20;
  --yd-border:    #2A2A2E;
  --yd-border-hi: #3A3A40;
  --yd-text:      #EDEBE8;
  --yd-text-dim:  #97938D;
  --yd-text-faint:#5E5B57;

  --yd-accent:    #D8B56B;
  --yd-accent-hi: #E8C983;
  --yd-accent-lo: #9C7C33;
  --yd-on-accent: #17140C;

  --yd-lift:   0 5px 0 var(--yd-accent-lo), 0 12px 20px rgba(0,0,0,.50);
  --yd-lift-a: 0 1px 0 var(--yd-accent-lo), 0 4px 10px rgba(0,0,0,.45);
  --yd-card:   0 1px 0 rgba(255,255,255,.03) inset;
  /* The line that marks a thing as hovered or focused. Gold sits well on
     near black, so here it is the accent. See the light theme. */
  --yd-edge:   var(--yd-accent);
  --yd-ring:   0 0 0 3px rgba(216,181,107,.28);
  --yd-dot:    rgba(255,255,255,.06);
}

/* ---------- LIGHT ---------- */
:root[data-theme="light"]{
  color-scheme: light;

  --yd-bg:        #F5F3EF;
  --yd-surface:   #FFFFFF;
  --yd-surface-2: #EFECE5;
  --yd-border:    #DFDAD1;
  --yd-border-hi: #C9C2B6;
  --yd-text:      #1A1917;
  --yd-text-dim:  #6C6862;
  --yd-text-faint:#9A958D;

  --yd-accent:    #CBA65A;
  --yd-accent-hi: #DEBB72;
  --yd-accent-lo: #8E6C26;
  --yd-on-accent: #1A1408;

  --yd-lift:   0 5px 0 var(--yd-accent-lo), 0 10px 18px rgba(80,62,20,.22);
  --yd-lift-a: 0 1px 0 var(--yd-accent-lo), 0 4px 8px rgba(80,62,20,.18);
  --yd-card:   0 1px 2px rgba(60,50,30,.05);
  /* Gold on cream is the worst of both: too pale to see at a hairline and
     too warm to pass as quiet. A plain dark line does the job. */
  --yd-edge:   var(--yd-text);
  --yd-ring:   0 0 0 3px rgba(26,25,23,.16);
  --yd-dot:    rgba(0,0,0,.07);
}

/* ================= SHELL ================= */
*{ box-sizing:border-box; }
html,body{ margin:0; height:100%; }
body{
  background:var(--yd-bg); color:var(--yd-text);
  font-family:var(--yd-font); font-weight:400; font-size:14px; line-height:1.55;
  -webkit-font-smoothing:antialiased; overflow:hidden;
  transition:background var(--yd-t), color var(--yd-t);
}
h1,h2,h3{ margin:0; font-weight:500; letter-spacing:-.01em; }
p{ margin:0; }
::-webkit-scrollbar{ width:9px; height:9px; }
::-webkit-scrollbar-thumb{ background:var(--yd-border-hi); border-radius:var(--yd-r-pill); }
::-webkit-scrollbar-track{ background:transparent; }

.yd-shell{ height:100%; display:flex; flex-direction:column; }
.yd-mid{ flex:1; display:flex; min-height:0; }
.yd-sp{ flex:1; }

.yd-top{
  height:var(--yd-top); flex:none; display:flex; align-items:center; gap:14px;
  padding:0 18px; background:var(--yd-surface); border-bottom:1px solid var(--yd-border);
}
.yd-brand{ display:flex; align-items:baseline; gap:9px; min-width:0; }
.yd-brand .mark{ align-self:center; flex:none; }
.yd-brand .name{ font-weight:500; font-size:15px; letter-spacing:.01em;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.yd-brand .by{ font-size:11.5px; font-weight:300; color:var(--yd-text-faint);
  white-space:nowrap; letter-spacing:.02em; }
.yd-brand .by b{ font-weight:500; color:var(--yd-text-dim); }
.yd-menu{ display:flex; gap:2px; margin-left:10px; }
.yd-menu button{ font:400 13px/1 var(--yd-font); padding:8px 12px; border:0;
  border-radius:var(--yd-r-sm); background:transparent; color:var(--yd-text-dim);
  cursor:pointer; transition:var(--yd-t); }
.yd-menu button:hover{ background:var(--yd-surface-2); color:var(--yd-text); }

.yd-rail{ width:var(--yd-rail); flex:none; padding:14px 12px; overflow:auto;
  background:var(--yd-bg); border-right:1px solid var(--yd-border);
  display:flex; flex-direction:column; gap:3px; }
.yd-rail .grp{ font-size:10px; font-weight:500; letter-spacing:.16em; text-transform:uppercase;
  color:var(--yd-text-faint); padding:14px 10px 7px; }
.yd-nav{ display:flex; align-items:center; gap:11px; width:100%;
  font:400 13.5px/1 var(--yd-font); text-align:left; padding:11px 12px; border:0;
  border-radius:var(--yd-r-sm); background:transparent; color:var(--yd-text-dim);
  cursor:pointer; transition:var(--yd-t); }
.yd-nav svg{ flex:none; opacity:.85; }
.yd-nav:hover{ background:var(--yd-surface); color:var(--yd-text); }
.yd-nav[aria-current="true"]{ background:var(--yd-surface); color:var(--yd-accent); font-weight:500; }
.yd-nav[aria-current="true"] svg{ opacity:1; }

.yd-main{ flex:1; min-width:0; display:flex; flex-direction:column; }
.yd-bar{ flex:none; display:flex; align-items:center; gap:10px; flex-wrap:wrap;
  padding:12px 18px; border-bottom:1px solid var(--yd-border); background:var(--yd-bg); }
.yd-stage{ flex:1; min-height:0; overflow:auto; padding:clamp(18px,3vw,34px);
  display:grid; place-items:center;
  background:
    radial-gradient(circle at 1px 1px, var(--yd-dot) 1px, transparent 0) 0 0/22px 22px,
    var(--yd-bg); }

.yd-panel{ width:var(--yd-panel); flex:none; overflow:auto; padding:var(--yd-pad);
  background:var(--yd-surface); border-left:1px solid var(--yd-border);
  display:flex; flex-direction:column; gap:20px; }
.yd-sec-h{ display:flex; align-items:center; gap:10px;
  font-size:10px; font-weight:500; letter-spacing:.16em; text-transform:uppercase;
  color:var(--yd-text-faint); margin-bottom:12px; }
.yd-sec-h::after{ content:""; flex:1; height:1px; background:var(--yd-border); }

.yd-status{ height:var(--yd-status); flex:none; display:flex; align-items:center; gap:12px;
  padding:0 18px; font-size:11.5px; color:var(--yd-text-faint);
  background:var(--yd-surface); border-top:1px solid var(--yd-border); }
.yd-status .dot{ width:6px; height:6px; border-radius:50%; background:var(--yd-accent); flex:none; }

/* ================= COMPONENTS ================= */
.yd-btn{
  font-family:inherit; font-size:14px; font-weight:500; line-height:1;
  display:inline-flex; align-items:center; justify-content:center; gap:9px;
  padding:13px 22px; border:0; border-radius:var(--yd-r-md);
  color:var(--yd-on-accent);
  background:linear-gradient(180deg, var(--yd-accent-hi), var(--yd-accent));
  box-shadow:var(--yd-lift); cursor:pointer; min-height:44px;
  transition:transform var(--yd-t), box-shadow var(--yd-t), filter var(--yd-t);
}
.yd-btn:hover{ filter:brightness(1.05); }
.yd-btn:active{ transform:translateY(4px); box-shadow:var(--yd-lift-a); }
.yd-btn:focus-visible{ outline:0; box-shadow:var(--yd-lift), var(--yd-ring); }
.yd-btn[disabled]{ opacity:.38; pointer-events:none; }
.yd-btn.wide{ width:100%; }
.yd-btn.sm{ padding:10px 16px; font-size:13px; min-height:38px;
  box-shadow:0 4px 0 var(--yd-accent-lo), 0 8px 14px rgba(0,0,0,.4); }
.yd-btn.icon{ padding:0; width:44px; border-radius:var(--yd-r-pill); }

.yd-btn2{
  font-family:inherit; font-size:14px; font-weight:400; line-height:1;
  display:inline-flex; align-items:center; justify-content:center; gap:9px;
  padding:13px 20px; border-radius:var(--yd-r-md); min-height:44px;
  color:var(--yd-text); background:var(--yd-bg);
  border:1px solid var(--yd-border-hi); cursor:pointer; transition:var(--yd-t);
}
.yd-btn2:hover{ background:var(--yd-surface-2); border-color:var(--yd-edge); color:var(--yd-edge); }
.yd-btn2:active{ transform:translateY(1px); }
.yd-btn2.sm{ padding:10px 14px; font-size:13px; min-height:38px; }
/* square, so the pair reads as one control rather than two words missing */
.yd-btn2.icon{ padding:0; width:44px; flex:none; }
.yd-btn2[disabled]{ opacity:.38; pointer-events:none; }

.yd-btn3{ font-family:inherit; font-size:13.5px; font-weight:400; min-height:44px;
  padding:13px 10px; border:0; background:transparent;
  color:var(--yd-text-dim); cursor:pointer; transition:var(--yd-t); }
.yd-btn3:hover{ color:var(--yd-accent); }

.yd-field{ display:flex; flex-direction:column; gap:6px; margin-bottom:14px; }
.yd-lab{ font-size:11.5px; font-weight:400; color:var(--yd-text-dim); letter-spacing:.02em;
  display:flex; justify-content:space-between; gap:8px; }
.yd-lab b{ font-weight:500; color:var(--yd-accent); }
.yd-in, .yd-sel{
  font-family:inherit; font-size:14px; color:var(--yd-text);
  padding:12px 14px; border-radius:var(--yd-r-sm); min-height:44px;
  background:var(--yd-bg); border:1px solid var(--yd-border);
  transition:var(--yd-t); width:100%;
}
.yd-sel{ appearance:none; cursor:pointer;
  background-image:linear-gradient(45deg,transparent 50%,currentColor 50%),linear-gradient(135deg,currentColor 50%,transparent 50%);
  background-position:calc(100% - 18px) 20px, calc(100% - 13px) 20px;
  background-size:5px 5px,5px 5px; background-repeat:no-repeat; }
.yd-in::placeholder{ color:var(--yd-text-faint); }
.yd-in:focus, .yd-sel:focus{ outline:0; border-color:var(--yd-edge); box-shadow:var(--yd-ring); }

.yd-range{ -webkit-appearance:none; appearance:none; width:100%; height:4px; margin:11px 0;
  border-radius:var(--yd-r-pill);
  background:var(--yd-surface-2); border:1px solid var(--yd-border); cursor:pointer; }
.yd-range::-webkit-slider-thumb{ -webkit-appearance:none; width:20px; height:20px; border-radius:50%;
  background:var(--yd-accent); border:0; box-shadow:0 3px 0 var(--yd-accent-lo), 0 5px 10px rgba(0,0,0,.4); }
.yd-range::-moz-range-thumb{ width:20px; height:20px; border:0; border-radius:50%;
  background:var(--yd-accent); box-shadow:0 3px 0 var(--yd-accent-lo); }
.yd-range:focus-visible{ outline:0; box-shadow:var(--yd-ring); }

.yd-tog{ display:flex; align-items:center; gap:11px; cursor:pointer; font-size:13.5px;
  color:var(--yd-text-dim); min-height:40px; }
.yd-tog input{ position:absolute; opacity:0; pointer-events:none; }
.yd-tog i{ width:44px; height:25px; border-radius:var(--yd-r-pill); background:var(--yd-surface-2);
  border:1px solid var(--yd-border); position:relative; transition:var(--yd-t); flex:none; }
.yd-tog i::after{ content:""; position:absolute; top:3px; left:3px; width:17px; height:17px;
  border-radius:50%; background:var(--yd-text-faint); transition:var(--yd-t); }
.yd-tog input:checked + i{ background:var(--yd-accent); border-color:var(--yd-accent-lo); }
.yd-tog input:checked + i::after{ left:22px; background:var(--yd-on-accent); }

.yd-seg{ display:inline-flex; padding:4px; gap:3px; border-radius:var(--yd-r-md); max-width:100%;
  background:var(--yd-surface-2); border:1px solid var(--yd-border); }
.yd-seg button{ font-family:inherit; font-size:13px; font-weight:400; padding:9px 16px; border:0;
  flex:1 1 auto; white-space:nowrap; border-radius:var(--yd-r-sm);
  background:transparent; color:var(--yd-text-dim); cursor:pointer; transition:var(--yd-t); }
.yd-seg button:hover{ color:var(--yd-text); }
.yd-seg button[aria-pressed="true"]{ background:var(--yd-accent); color:var(--yd-on-accent); font-weight:500; }

/* Same recipe as the tag on the site's front page: dim text, a plain surface
   behind it, an ordinary border. A chip is a label, and a label does not need
   to shout in the brand colour to be read. */
.yd-chip{ display:inline-block; font-size:10px; font-weight:500; letter-spacing:.1em; text-transform:uppercase;
  padding:5px 10px; border-radius:var(--yd-r-pill);
  color:var(--yd-text-dim);
  background:var(--yd-surface-2);
  border:1px solid var(--yd-border); }

.yd-card{ padding:var(--yd-pad); border-radius:var(--yd-r-lg);
  background:var(--yd-surface); border:1px solid var(--yd-border);
  box-shadow:var(--yd-card); transition:var(--yd-t); }
.yd-card:hover{ border-color:var(--yd-border-hi); }

.yd-switch{ display:inline-flex; align-items:center; gap:2px; flex:none;
  padding:3px; border-radius:var(--yd-r-pill);
  background:var(--yd-surface-2); border:1px solid var(--yd-border); }
.yd-switch button{ display:grid; place-items:center; width:34px; height:28px; padding:0;
  border:0; border-radius:var(--yd-r-pill); background:transparent;
  color:var(--yd-text-faint); cursor:pointer; transition:var(--yd-t); }
.yd-switch button:hover{ color:var(--yd-text-dim); }
.yd-switch button[aria-pressed="true"]{ background:var(--yd-accent); color:var(--yd-on-accent); }

/* The way back to the site. A pill of its own rather than a third button
   inside the theme switch, because it is not a third theme — pressing it
   leaves the page. 36px, not 34: the switch beside it is a 28px button in 3px
   of padding inside a 1px border, and the two line up at the shoulders. */
.yd-back{ display:grid; place-items:center; width:36px; height:36px; flex:none;
  border-radius:var(--yd-r-pill); text-decoration:none; cursor:pointer;
  background:var(--yd-surface-2); border:1px solid var(--yd-border);
  color:var(--yd-text-faint); transition:var(--yd-t); }
.yd-back:hover{ color:var(--yd-text); border-color:var(--yd-border-hi); }
.yd-back:focus-visible{ outline:0; box-shadow:var(--yd-ring); }

/* ================= APP PIECES (same tokens only) ================= */
.hint{ font-size:11px; font-weight:300; line-height:1.45; color:var(--yd-text-faint); }
.yd-sr{ position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; }
[hidden]{ display:none !important; }

.yd-menuwrap{ position:relative; }
.yd-pop{ position:absolute; top:calc(100% + 8px); left:0; z-index:60; min-width:236px;
  padding:6px; border-radius:var(--yd-r-md); background:var(--yd-surface);
  border:1px solid var(--yd-border-hi); display:none; flex-direction:column; gap:2px; }
.yd-pop.on{ display:flex; }
.yd-pop button{ font:400 13.5px/1 var(--yd-font); text-align:left; padding:11px 12px; border:0;
  border-radius:var(--yd-r-sm); background:transparent; color:var(--yd-text-dim);
  cursor:pointer; transition:var(--yd-t); min-height:40px; }
.yd-pop button:hover{ background:var(--yd-surface-2); color:var(--yd-text); }
.yd-pop button[disabled]{ opacity:.38; pointer-events:none; }

/* the checks behind see-through pixels, as tokens so they follow the theme */
/* mid grey in the dark theme: black ink and white ink both have to show, and a
   colour is judged fairly only against something neutral */
:root, :root[data-theme="dark"]{ --px-c1:#6E6E74; --px-c2:#5E5E64; --px-grid:rgba(255,255,255,.10); --px-grid8:rgba(255,255,255,.22); }
:root[data-theme="light"]{ --px-c1:#FFFFFF; --px-c2:#E7E3DB; --px-grid:rgba(0,0,0,.08); --px-grid8:rgba(0,0,0,.18); }

/* A toggle that is on. Neutral and filled, never gold: gold is kept for the
   one thing on the screen you are choosing between, the tool. */
.yd-btn2[aria-pressed="true"]{ background:var(--yd-text); color:var(--yd-bg); border-color:var(--yd-text); }
.yd-btn2[aria-pressed="true"]:hover{ color:var(--yd-bg); }

/* tools, down the left */
.px-rail{ width:66px; flex:none; padding:12px 11px; overflow:auto;
  background:var(--yd-bg); border-right:1px solid var(--yd-border);
  display:flex; flex-direction:column; align-items:center; gap:6px; }
.px-tool{ width:44px; height:44px; flex:none; display:grid; place-items:center; padding:0; border:0;
  border-radius:var(--yd-r-sm); background:transparent; color:var(--yd-text-dim);
  cursor:pointer; transition:var(--yd-t); }
.px-tool:hover{ background:var(--yd-surface); color:var(--yd-text); }
.px-tool[aria-pressed="true"]{ background:var(--yd-accent); color:var(--yd-on-accent); }
.px-tool:focus-visible{ outline:0; box-shadow:var(--yd-ring); }
.px-sep{ width:28px; height:1px; flex:none; background:var(--yd-border); margin:4px 0; }

/* the bar above the stage */
/* One line, always. Buttons that appear with a selection used to push the bar
   onto a second line, the stage got shorter and the canvas jumped under the
   pointer in the middle of a drag. Too narrow, and the bar scrolls sideways. */
.px-bar{ gap:8px; padding:10px 14px; flex-wrap:nowrap; overflow-x:auto; overflow-y:hidden; scrollbar-width:none; }
.px-bar::-webkit-scrollbar{ display:none; }
.px-bar > *{ flex:none; }
.px-bar > .yd-sp{ flex:1 1 0; }
.px-bar .yd-seg button{ padding:8px 12px; }
.px-zoom{ display:inline-flex; align-items:center; gap:6px; }
.px-zoomval{ min-width:54px; text-align:center; font-size:13px; font-weight:500;
  font-variant-numeric:tabular-nums; color:var(--yd-text-dim); }
.px-lbl{ font-size:11.5px; color:var(--yd-text-faint); margin-left:4px; }

/* the stage gives up its padding: the canvas runs edge to edge */
.px-stage{ position:relative; padding:0; display:block; overflow:hidden; }
#pxCanvas{ position:absolute; inset:0; width:100%; height:100%; display:block;
  touch-action:none; cursor:crosshair; outline:0; }
#pxCanvas.t-move{ cursor:move; }
#pxCanvas.is-pan{ cursor:grab; }
#pxCanvas.is-panning{ cursor:grabbing; }
.px-over{ position:absolute; inset:14px; z-index:5; display:none; place-items:center;
  border-radius:var(--yd-r-lg); border:2px dashed var(--yd-text-dim);
  background:color-mix(in srgb, var(--yd-bg) 72%, transparent); pointer-events:none; }
.px-stage.is-over .px-over{ display:grid; }
.px-over span{ font-size:14px; font-weight:500; padding:10px 18px; border-radius:var(--yd-r-pill);
  background:var(--yd-surface); border:1px solid var(--yd-border-hi); }

/* the timeline, under the stage */
.px-time{ flex:none; border-top:1px solid var(--yd-border); background:var(--yd-surface);
  padding:10px 14px 10px; display:flex; flex-direction:column; gap:10px; }
.px-trow{ display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.px-trow .yd-seg button{ padding:8px 12px; }
.px-fps{ display:inline-flex; align-items:center; gap:8px; font-size:12px; color:var(--yd-text-dim); }
.px-fps .yd-in{ width:68px; min-height:38px; padding:8px 10px; font-size:13px; }
.px-onion{ min-height:38px; font-size:13px; }
.px-onion i{ width:38px; height:22px; }
.px-onion i::after{ width:14px; height:14px; }
.px-onion input:checked + i::after{ left:19px; }
.px-fgrp{ display:inline-flex; gap:8px; flex:none; }
.px-frames{ display:flex; gap:6px; overflow-x:auto; padding:2px 2px 4px; min-height:78px; }
.px-frame{ flex:none; display:flex; flex-direction:column; align-items:center; gap:4px; padding:4px;
  border:0; border-radius:var(--yd-r-sm); background:transparent; color:var(--yd-text-faint);
  cursor:pointer; font:500 10.5px/1 var(--yd-font); font-variant-numeric:tabular-nums; transition:var(--yd-t); }
.px-frame canvas{ width:54px; height:54px; display:block; border-radius:6px; object-fit:contain;
  image-rendering:pixelated;
  background:repeating-conic-gradient(var(--px-c1) 0 25%, var(--px-c2) 0 50%) 0 0/10px 10px; }
.px-frame:hover{ background:var(--yd-surface-2); color:var(--yd-text-dim); }
.px-frame[aria-pressed="true"]{ background:var(--yd-accent); color:var(--yd-on-accent); }
.px-frame:focus-visible{ outline:0; box-shadow:var(--yd-ring); }

/* panel */
.px-facts{ display:grid; grid-template-columns:auto 1fr; gap:8px 14px; margin:12px 0 0; font-size:13px; }
.px-facts dt{ color:var(--yd-text-faint); }
.px-facts dd{ margin:0; text-align:right; font-variant-numeric:tabular-nums; }
.px-row{ display:flex; gap:8px; }
.px-grid2{ display:grid; grid-template-columns:1fr 1fr; gap:8px; }
.px-grid2 > *{ min-width:0; padding-left:6px; padding-right:6px; }
.px-row > *{ flex:1 1 0; min-width:0; padding-left:6px; padding-right:6px; }

.px-cur{ display:flex; gap:10px; align-items:center; margin-bottom:12px; }
.px-curbtn{ width:44px; height:44px; flex:none; display:block;
  border-radius:var(--yd-r-sm); border:1px solid var(--yd-border-hi); }
/* saturation across, brightness down */
.px-sv{ position:relative; height:132px; border-radius:var(--yd-r-sm); overflow:hidden;
  cursor:crosshair; touch-action:none; border:1px solid var(--yd-border); }
.px-sv:focus-visible{ outline:0; box-shadow:var(--yd-ring); }
.px-sv canvas{ position:absolute; inset:0; width:100%; height:100%; display:block; }
.px-svdot{ position:absolute; width:14px; height:14px; margin:-7px 0 0 -7px; border-radius:50%;
  border:2px solid #FFFFFF; box-shadow:0 0 0 1px rgba(0,0,0,.6); pointer-events:none; }
.px-hue{ height:12px; margin:14px 0 6px; border:0;
  background:linear-gradient(to right, #F00 0%, #FF0 16.7%, #0F0 33.3%, #0FF 50%, #00F 66.7%, #F0F 83.3%, #F00 100%); }
.px-rgb{ display:grid; grid-template-columns:14px 1fr 62px; gap:4px 10px; align-items:center; margin-top:4px; }
.px-rgb > span{ font-size:12px; font-weight:500; color:var(--yd-text-dim); }
.px-ch{ height:8px; margin:9px 0; border:0; }
.px-num{ min-height:34px; padding:6px 8px; font-size:13px; font-variant-numeric:tabular-nums; }
.px-hex{ flex:1; min-width:0; text-transform:uppercase; font-variant-numeric:tabular-nums; }
.px-pal{ display:grid; grid-template-columns:repeat(auto-fill, minmax(26px, 1fr)); gap:5px; }
.px-sw{ aspect-ratio:1; min-height:26px; padding:0; border:0; border-radius:6px; cursor:pointer;
  position:relative; box-shadow:inset 0 0 0 1px rgba(128,128,128,.28); }
.px-sw:focus-visible{ outline:0; box-shadow:var(--yd-ring); }
/* the chosen swatch carries a dot in whichever ink reads on it */
.px-sw[aria-pressed="true"]::after{ content:""; position:absolute; left:50%; top:50%;
  width:8px; height:8px; margin:-4px 0 0 -4px; border-radius:50%; background:#FFFFFF; }
.px-sw.ink-dark[aria-pressed="true"]::after{ background:#141414; }
.px-add{ display:grid; place-items:center; background:transparent; color:var(--yd-text-faint);
  box-shadow:none; border:1px dashed var(--yd-border-hi); }
.px-add:hover{ color:var(--yd-text); border-color:var(--yd-text-dim); }

.px-layers{ display:flex; flex-direction:column; gap:2px; max-height:244px; overflow:auto; margin-bottom:10px; }
.px-layer{ display:flex; align-items:center; gap:8px; min-height:40px; padding:4px 10px 4px 4px;
  border-radius:var(--yd-r-sm); color:var(--yd-text-dim); cursor:pointer; transition:var(--yd-t); }
.px-layer:hover{ background:var(--yd-surface-2); }
.px-layer[aria-selected="true"]{ background:var(--yd-surface-2); color:var(--yd-text); }
.px-layer[aria-selected="true"]::after{ content:""; width:3px; height:16px; flex:none; border-radius:2px;
  background:var(--yd-edge); order:9; }
.px-eye{ width:32px; height:32px; flex:none; display:grid; place-items:center; padding:0; border:0;
  border-radius:8px; background:transparent; color:var(--yd-text-dim); cursor:pointer; }
.px-eye:hover{ color:var(--yd-text); }
.px-eye.off{ color:var(--yd-text-faint); opacity:.6; }
.px-lname{ flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:13px; }
.px-layer[aria-selected="true"] .px-lname{ font-weight:500; }
.px-lop{ font-size:11px; color:var(--yd-text-faint); font-variant-numeric:tabular-nums; }
.px-lin{ flex:1; min-width:0; min-height:30px; padding:5px 8px; font-size:13px; }
.px-acts{ display:grid; grid-template-columns:repeat(3, 1fr); gap:6px; }
.px-acts .yd-btn2{ padding:8px 4px; min-height:36px; font-size:12.5px; }

/* the panel shows one part at a time */
.px-tabs{ width:100%; flex:none; }
.px-tabs button{ padding:9px 4px; font-size:12.5px; }
.yd-panel section[data-tab]:not(.on){ display:none; }
.px-scale{ display:grid; grid-template-columns:repeat(5, 1fr); width:100%; }
.px-scale button{ padding:9px 0; font-variant-numeric:tabular-nums; }
.px-scale button[disabled]{ opacity:.35; cursor:not-allowed; text-decoration:line-through; }
.px-result{ margin-top:10px; font-size:13px; font-variant-numeric:tabular-nums; }
.px-dl{ display:flex; flex-direction:column; gap:8px; margin-top:14px; }

/* new canvas */
.px-newbox{ width:min(420px, 100%); }
.px-newbox h2{ font-size:16px; margin-bottom:14px; }
.px-presets{ display:grid; grid-template-columns:repeat(5, 1fr); width:100%; margin-bottom:14px; }
.px-presets button{ padding:9px 0; }
.px-wh{ display:flex; gap:10px; align-items:flex-end; }
.px-wh .yd-field{ flex:1; margin:0; }
.px-wh .x{ padding-bottom:12px; color:var(--yd-text-faint); }
.px-anchorwrap{ display:flex; gap:14px; align-items:flex-start; margin-top:16px; }
.px-anchor{ display:grid; grid-template-columns:repeat(3, 26px); gap:4px; flex:none; padding:5px;
  border-radius:var(--yd-r-sm); background:var(--yd-surface-2); border:1px solid var(--yd-border); }
.px-anchor button{ width:26px; height:26px; padding:0; border:0; border-radius:6px; cursor:pointer;
  background:var(--yd-bg); transition:var(--yd-t); }
.px-anchor button:hover{ background:var(--yd-border-hi); }
.px-anchor button[aria-pressed="true"]{ background:var(--yd-text); }
.px-anchor button:focus-visible{ outline:0; box-shadow:var(--yd-ring); }
.px-newbtns{ display:flex; gap:10px; margin-top:20px; flex-wrap:wrap; }

.px-back{ width:100%; }
.px-back button{ padding:9px 6px; }
/* the frame pictures sit on the same backdrop as the stage */
.px-frames.bk-white .px-frame canvas{ background:#FFFFFF; }
.px-frames.bk-black .px-frame canvas{ background:#000000; }

/* help */
.scrim{ position:fixed; inset:0; z-index:90; background:rgba(0,0,0,.55);
  display:none; place-items:center; padding:20px; }
.scrim.on{ display:grid; }
.helpbox{ width:min(560px,100%); max-height:82vh; overflow:auto; }
.helpbox h2{ font-size:16px; margin-bottom:6px; }
.helpbox p{ font-size:13px; font-weight:300; color:var(--yd-text-dim); line-height:1.6; }
.helpbox dl{ margin:14px 0 0; display:grid; grid-template-columns:auto 1fr; gap:8px 14px;
  font-size:13px; color:var(--yd-text-dim); }
.helpbox dt{ color:var(--yd-text); font-weight:400; white-space:nowrap; }
.helpbox dd{ margin:0; font-weight:300; }

/* ================= RESPONSIVE ================= */
@media (max-width:1000px){
  :root{ --yd-panel:268px; }
  .yd-menu{ display:none; }
}
@media (max-width:860px){
  html,body{ height:auto; overflow:visible; }
  .yd-shell{ height:auto; min-height:100%; }
  .yd-mid{ flex-direction:column; }
  :root{ --yd-panel:auto; }
  .yd-main{ overflow:visible; }
  .px-rail{ width:100%; flex-direction:row; padding:8px 12px; overflow-x:auto; scrollbar-width:none;
    border-right:0; border-bottom:1px solid var(--yd-border); }
  .px-sep{ width:1px; height:28px; margin:0 4px; }
  .px-stage{ flex:none; height:56vh; min-height:300px; }
  .yd-panel{ width:100%; border-left:0; border-top:1px solid var(--yd-border); }
}
@media (max-width:460px){
  .yd-top{ padding:0 12px; gap:8px; }
  .yd-brand{ flex-direction:column; gap:0; align-items:flex-start; }
  .yd-brand .mark{ display:none; }
  .px-bar{ padding:8px 10px; }
  .px-time{ padding:10px; }
  /* the frame buttons share one full row rather than running off the edge */
  .px-fgrp{ width:100%; gap:6px; }
  .px-fgrp > *{ flex:1 1 auto; min-width:0; padding-left:6px; padding-right:6px; }
  .px-fgrp > .icon{ flex:0 0 38px; width:38px; }
  .yd-status{ height:auto; padding:8px 12px; flex-wrap:wrap; }
}

@media (prefers-reduced-motion:reduce){ *{ transition:none !important; } }
