/* The effect sheets (Эффект, Свет, Глубина) and the control component they share (controls.js).
   Tokens only, from skin.css. Rows reuse .rng and .seg, so a slider here looks like one in the
   settings panel. Acid marks the current choice and the main action, nothing else. */
.ctl [hidden], .lk [hidden], .lt [hidden], .dp [hidden] { display: none; }

/* ---------- the shared control ---------- */
.ctl__row { margin-bottom: var(--s4); }
.ctl__head { display: flex; align-items: center; gap: var(--s2); min-height: 28px; }
.ctl__row > .ctl__head + * { margin-top: var(--s1); }
.ctl__name { flex: 1 1 auto; min-width: 0; color: var(--text); overflow-wrap: anywhere; }
.ctl__ctx { color: var(--faint); font-size: var(--fs-xs); }
.ctl__note { display: inline-flex; align-items: center; flex: none; }
.ctl__note:empty { display: none; }
.ctl__val, .ctl__hex {
  flex: none; min-width: 40px; padding: 0 var(--s1); border: 0; border-radius: 6px; background: none;
  color: var(--mute); font: inherit; text-align: right; cursor: text; transition: background var(--ease), color var(--ease);
}
.ctl__val:hover { background: var(--hover); color: var(--text); }
.is-moved > .ctl__head .ctl__val, .is-moved > .ctl__head .ctl__hex { color: var(--text); }
.ctl__hex { cursor: default; }
.ctl__num, .ctl__text {
  height: 28px; padding: 0 var(--s2); border: 0; border-radius: var(--r); background: var(--sunk);
  box-shadow: 0 0 0 1px var(--line-2); color: var(--text); font: inherit; font-variant-numeric: tabular-nums;
}
.ctl__num { width: 80px; text-align: right; }
.ctl__text { width: 100%; height: 32px; }
.ctl__color {
  flex: none; width: 36px; height: 24px; padding: 0; border: 0; border-radius: 6px; background: none; cursor: pointer;
  -webkit-appearance: none; appearance: none; box-shadow: 0 0 0 1px var(--line-2);
}
.ctl__color::-webkit-color-swatch-wrapper { padding: 0; }
.ctl__color::-webkit-color-swatch { border: 0; border-radius: 6px; }
.ctl__color::-moz-color-swatch { border: 0; border-radius: 6px; }
.ctl__seg { margin-bottom: 0; }
.ctl__check { display: flex; align-items: center; gap: var(--s2); flex: 1 1 auto; min-height: 32px; cursor: pointer; }
.ctl__row.is-off { opacity: 0.45; }

/* the pin: hidden until the row is hovered or focused; a pinned one stays quietly visible */
.ctl__pin {
  flex: none; width: 24px; height: 24px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 6px;
  background: none; color: var(--faint); opacity: 0; cursor: pointer; transition: opacity var(--ease), background var(--ease), color var(--ease);
}
.ctl__pin svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; }
.ctl__row:hover .ctl__pin, .ctl__row:focus-within .ctl__pin, .ctl__pin[aria-pressed="true"] { opacity: 1; }
.ctl__pin:hover { background: var(--hover); color: var(--text); }
.ctl__pin[aria-pressed="true"] { color: var(--mute); }
.ctl__pin[aria-pressed="true"] svg { fill: currentColor; }

/* groups: a quiet heading that folds */
.ctl__grp + .ctl__grp { margin-top: var(--s4); padding-top: var(--s4); border-top: 1px solid var(--line); }
.ctl__gh { margin: 0 0 var(--s2); }
.ctl__ghb {
  display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 28px; padding: 0; border: 0; background: none;
  color: var(--faint); font-size: var(--fs-xs); font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; text-align: left; cursor: pointer;
}
.ctl__ghb:hover { color: var(--text); }
.ctl__ghb svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform var(--ease); }
.ctl__grp.is-shut .ctl__ghb svg { transform: rotate(-90deg); }
.ctl__grp.is-shut .ctl__gh { margin-bottom: 0; }

/* ---------- sheet «Эффект» ---------- */
.lk > * + * { margin-top: var(--s6); }
.lk__h, .lk__gh {
  margin: 0 0 var(--s3); color: var(--faint); font-size: var(--fs-xs); font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase;
}
.lk__gh { margin: var(--s4) 0 var(--s2); font-weight: 500; }
.lk__row { display: flex; align-items: center; gap: var(--s1); }
.lk__row--sub { margin-top: var(--s2); padding-top: var(--s2); border-top: 1px solid var(--line); }
.lk__title { display: grid; flex: 1 1 auto; min-width: 0; margin-right: var(--s2); }
.lk__name { font-size: var(--fs); font-weight: 500; line-height: 1.3; }
.lk__pos { color: var(--mute); font-size: var(--fs-xs); line-height: 1.3; }
.lk__pname { flex: 1 1 auto; min-width: 0; margin-right: var(--s2); color: var(--mute); }
.lk__pname.is-custom { color: var(--text); }
.lk__step {
  flex: none; width: 32px; height: 32px; display: grid; place-items: center; padding: 0; border: 0; border-radius: var(--r);
  background: var(--raise); color: var(--text); font-size: 18px; line-height: 1; cursor: pointer; transition: background var(--ease);
}
.lk__row--sub .lk__step { width: 28px; height: 28px; background: none; color: var(--mute); }
.lk__step:hover { background: var(--hover); color: var(--text); }
.lk__empty { margin: 0; color: var(--mute); line-height: 1.5; }
.lk__acts { display: flex; align-items: center; flex-wrap: wrap; gap: var(--s2); margin-top: var(--s3); }
.lk__strength .ctl__row { margin-bottom: 0; }
.lk__btn {
  min-height: 32px; padding: 0 var(--s3); border: 0; border-radius: var(--r); background: var(--raise); color: var(--text);
  font-weight: 500; cursor: pointer; transition: background var(--ease);
}
.lk__btn:hover:not(:disabled) { background: var(--hover); }
.lk__off { min-height: 32px; margin-left: auto; padding: 0 var(--s1); border: 0; background: none; color: var(--mute); cursor: pointer; }
.lk__off:hover:not(:disabled) { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }
.lk__btn:disabled, .lk__off:disabled, .lt__chip:disabled { opacity: 0.4; cursor: default; }

.lk__cathead, .lt__head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s2); }
.lk__cathead .lk__h, .lt__head .lk__h { margin-bottom: var(--s2); }
.lk__open { min-height: 28px; padding: 0 var(--s1); border: 0; background: none; color: var(--mute); cursor: pointer; }
.lk__open:hover { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }
.lk__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s3) var(--s2); }
.lk__pgrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s3) var(--s2); }
.lk__card { display: grid; gap: var(--s1); align-content: start; min-width: 0; padding: 0; border: 0; border-radius: var(--r-m); background: none; color: inherit; text-align: left; cursor: pointer; }
.lk__pic {
  display: block; aspect-ratio: 8 / 5; overflow: hidden; border-radius: var(--r-m); background: var(--sunk);
  box-shadow: 0 0 0 1px var(--line); transition: box-shadow var(--ease);
}
.lk__cv { display: block; width: 100%; height: 100%; opacity: 0; transition: opacity var(--ease); }
.is-ready .lk__cv { opacity: 1; }
.lk__card:not(.is-ready):not(.is-none) .lk__pic {   /* the picture is still being made */
  background: linear-gradient(100deg, var(--sunk) 30%, var(--raise) 50%, var(--sunk) 70%) 0 0 / 300% 100%;
  animation: lk-wait 1.4s linear infinite;
}
@keyframes lk-wait { to { background-position: -150% 0; } }
.lk__card:hover .lk__pic { box-shadow: 0 0 0 1px var(--line-2); }
.lk__card[aria-pressed="true"] .lk__pic { box-shadow: var(--ring); }
.lk__cn { color: var(--mute); line-height: 1.3; overflow-wrap: anywhere; }
.lk__card--p .lk__cn { font-size: var(--fs-xs); }
.lk__card:hover .lk__cn, .lk__card[aria-pressed="true"] .lk__cn { color: var(--text); }
.lk__card[aria-pressed="true"] .lk__cn { font-weight: 500; }

/* ---------- sheet «Свет» ---------- */
.lt__head { margin-bottom: var(--s1); }
.lt__row { display: flex; flex-wrap: wrap; gap: var(--s2); margin-bottom: var(--s6); }
.lt__chip {
  min-height: 32px; padding: 0 var(--s3); border: 0; border-radius: var(--pill); background: var(--raise); color: var(--text);
  font-weight: 500; cursor: pointer; transition: background var(--ease);
}
.lt__chip:hover { background: var(--hover); }
.lt__chip[aria-pressed="true"] { background: var(--hover); box-shadow: inset 0 0 0 1px var(--acid), var(--lift); }

/* ---------- sheet «Глубина» ---------- */
.dp__lead { margin: 0 0 var(--s3); color: var(--mute); line-height: 1.5; }
.dp__go { width: 100%; margin-top: var(--s2); }
.dp__go:disabled { opacity: 0.4; cursor: default; }
.dp__note { margin: var(--s2) 0 0; color: var(--faint); }
.dp__draw { margin-bottom: var(--s4); }

/* ---------- touch: 44 px targets, pins always in sight ---------- */
@media (pointer: coarse), (max-width: 899px) {
  .ctl__head { min-height: 44px; }
  .ctl__pin { width: 44px; height: 44px; opacity: 1; margin: -10px 0; }
  .ctl__val, .ctl__hex { min-height: 44px; min-width: 56px; }
  .ctl__num { height: 44px; }
  .ctl__text { height: 44px; }
  .ctl__color { width: 56px; height: 44px; }
  .ctl__check { min-height: 44px; }
  .ctl .v3__check { width: 24px; height: 24px; }
  .ctl .rng input { height: 44px; }
  .ctl__ghb { min-height: 44px; }
  .lk__step, .lk__row--sub .lk__step { width: 44px; height: 44px; }
  .lk__btn, .lk__off, .lk__open, .lt__chip { min-height: 44px; }
  .lk__off, .lk__open { padding: 0 var(--s2); }
}
@media (prefers-reduced-motion: reduce) {
  .ctl__val, .ctl__pin, .ctl__ghb svg, .lk__step, .lk__btn, .lk__pic, .lk__cv, .lt__chip { transition: none; }
  .lk__card:not(.is-ready):not(.is-none) .lk__pic { animation: none; }
}

/* ---------- sheet «Движение» ---------- */
.mt > * + * { margin-top: var(--s6); }
.mt [hidden] { display: none; }
.mt__lead { margin: 0; color: var(--mute); line-height: 1.5; }
.mt__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s2); }
.mt__card {
  display: grid; align-content: start; gap: 2px; min-height: 44px; padding: var(--s3); border: 0; border-radius: var(--r-m);
  background: var(--raise); color: var(--text); text-align: left; cursor: pointer; transition: background var(--ease);
}
.mt__card:hover { background: var(--hover); }
.mt__card[aria-pressed="true"] { background: var(--hover); box-shadow: inset 0 0 0 1px var(--acid), var(--lift); }
.mt__curve { width: 100%; height: 26px; margin-bottom: var(--s1); fill: none; stroke: var(--faint); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.mt__card[aria-pressed="true"] .mt__curve { stroke: var(--acid); }
.mt__cn { font-weight: 500; }
.mt__cs { color: var(--mute); font-size: var(--fs-xs); line-height: 1.35; }
.mt__empty, .mt__note { margin: 0; color: var(--mute); line-height: 1.5; }
.mt__note { margin-top: var(--s2); font-size: var(--fs-xs); color: var(--faint); }
.mt__grp { display: grid; gap: var(--s1); margin-bottom: var(--s3); padding: var(--s3); border-radius: var(--r-m); background: var(--raise); }
.mt__gh { display: flex; align-items: center; justify-content: space-between; }
.mt__gn { font-weight: 500; }
.mt__sl { display: grid; grid-template-columns: 76px minmax(0, 1fr) 40px; align-items: center; gap: var(--s2); color: var(--mute); }
.mt__sl output { text-align: right; color: var(--text); }
.mt__sl input { width: 100%; }
.mt__list { margin: 0; padding: 0; list-style: none; display: grid; gap: var(--s1); }
.mt__item { display: flex; align-items: center; gap: var(--s2); min-height: 36px; padding: 2px 0; border-top: 1px solid var(--line); }
.mt__in { display: grid; flex: 1 1 auto; min-width: 0; line-height: 1.3; }
.mt__in small { color: var(--mute); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mt__go { flex: none; min-height: 32px; padding: 0 var(--s2); border: 0; border-radius: var(--r); background: none; color: var(--mute); font: inherit; font-size: var(--fs-xs); cursor: pointer; }
.mt__go:hover { background: var(--hover); color: var(--text); }
.mt__x { flex: none; width: 28px; height: 28px; border: 0; border-radius: 6px; background: none; color: var(--faint); font-size: 16px; cursor: pointer; }
.mt__x:hover { background: var(--hover); color: var(--text); }
.mt__card:focus-visible, .mt__go:focus-visible, .mt__x:focus-visible, .dpop button:focus-visible { outline: 2px solid var(--acid); outline-offset: 1px; }
/* where «Перейти к ручке» landed */
.is-flash { animation: flash 1.6s ease; border-radius: var(--r); }
@keyframes flash { 0%, 55% { box-shadow: 0 0 0 2px var(--acid); background: rgba(232, 232, 12, 0.08); } 100% { box-shadow: 0 0 0 2px transparent; background: transparent; } }

/* the motion's popover, by its dial */
.dpop {
  position: fixed; z-index: 70; width: 288px; max-width: calc(100vw - 16px); display: grid; gap: var(--s3); padding: var(--s4);
  border-radius: var(--r-l); background: var(--panel); box-shadow: var(--float);
}
.dpop[hidden] { display: none; }
.dpop [hidden] { display: none; }
.dpop__h { margin: 0; font-weight: 500; }
.dpop__say { margin: 0; color: var(--mute); font-size: var(--fs-xs); line-height: 1.4; }
.dpop__say:empty { display: none; }
.dpop__row { display: grid; gap: var(--s1); }
.dpop .rng, .mt__sl.rng { margin-bottom: 0; }
.dpop__row:has(> output) { grid-template-columns: 1fr auto; align-items: baseline; }
.dpop__row:has(> output) > input { grid-column: 1 / -1; grid-row: 2; }
.dpop__row > output { color: var(--text); }
.dpop__l { color: var(--faint); font-size: var(--fs-xs); font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; }
.dpop__row input[type="range"] { width: 100%; }
.dpop__shapes { display: grid; grid-template-columns: repeat(5, 1fr); gap: var(--s1); }
.dpop__shapes button { min-height: 36px; border: 0; border-radius: var(--r); background: var(--raise); color: var(--mute); cursor: pointer; }
.dpop__shapes button:hover { background: var(--hover); color: var(--text); }
.dpop__shapes button[aria-pressed="true"] { background: var(--hover); color: var(--acid); box-shadow: inset 0 0 0 1px var(--acid); }
.dpop__shapes svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; }
.dpop__seg { display: grid; grid-template-columns: repeat(3, 1fr); margin: 0; }
.dpop__seg button { min-height: 36px; font-size: var(--fs-xs); }
.dpop__once { grid-template-columns: 1fr 1fr; gap: var(--s2); }
.dpop__num { display: grid; gap: 2px; color: var(--faint); font-size: var(--fs-xs); }
.dpop__num input { height: 32px; padding: 0 var(--s2); border: 0; border-radius: var(--r); background: var(--sunk); box-shadow: 0 0 0 1px var(--line-2); color: var(--text); font: inherit; font-size: var(--fs-s); }
.dpop__n { margin: 0; color: var(--faint); font-size: var(--fs-xs); line-height: 1.4; }
.dpop__act { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); }
.dpop__act .link:disabled { opacity: 0.4; cursor: default; }
@media (pointer: coarse), (max-width: 899px) {
  .mt__go, .mt__x { min-height: 44px; min-width: 44px; }
  .mt__card { min-height: 64px; }
  .dpop__shapes button, .dpop__seg button, .dpop__num input, .dpop__act .btn, .dpop__act .link { min-height: 44px; }
  .dpop { width: calc(100vw - 16px); }
}
@media (prefers-reduced-motion: reduce) { .mt__card { transition: none; } .is-flash { animation: none; box-shadow: 0 0 0 2px var(--acid); } }

/* ---------- text as a picture (text-source.js) ---------- */
.txt { display: grid; gap: var(--s2); margin-bottom: var(--s3); padding: var(--s3); border-radius: var(--r-m); background: var(--sunk); box-shadow: 0 0 0 1px var(--line-2); }
.txt[hidden] { display: none; }
.txt__in {
  width: 100%; min-height: 88px; padding: var(--s2) var(--s3); resize: none; border: 0; border-radius: var(--r);
  background: var(--bg); box-shadow: 0 0 0 1px var(--line-2); color: var(--text); font: inherit; line-height: 1.3;
}
.txt__in::placeholder { color: var(--faint); }
.txt__in:focus-visible, .txt__sel:focus-visible, .txt__chk input:focus-visible, .txt__done:focus-visible { outline: 2px solid var(--acid); outline-offset: 2px; }
.txt__seg { grid-template-columns: repeat(3, 1fr); margin-bottom: 0; }
.txt__sel {
  width: 100%; min-height: 32px; padding: 0 var(--s2); border: 0; border-radius: var(--r);
  background: var(--bg); box-shadow: 0 0 0 1px var(--line-2); color: var(--text); font: inherit;
}
.txt__chk { display: flex; align-items: center; gap: var(--s2); min-height: 32px; color: var(--text); cursor: pointer; }
.txt__done { justify-self: end; min-height: 32px; padding: 0 var(--s2); border: 0; background: none; color: var(--mute); font: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.txt__done:hover { color: var(--text); }
@media (pointer: coarse), (max-width: 540px) {
  .txt__in { min-height: 96px; font-size: 16px; }   /* 16px: iOS does not zoom the page on focus */
  .txt__seg button, .txt__sel, .txt__chk, .txt__done { min-height: 44px; }
  .txt__chk input { width: 20px; height: 20px; }
}

/* ---------- sound: the sheet (sheet-sound.js) and the popover's «Звук» half ---------- */
.sn.is-drop { outline: 2px dashed var(--acid); outline-offset: -6px; }
.sn > section > * + * { margin-top: var(--s3); }
.sn__acts { display: flex; flex-wrap: wrap; gap: var(--s2); }
.sn__pick { display: inline-flex; align-items: center; cursor: pointer; }
.sn__pick.is-off, .sn__acts .btn:disabled { opacity: 0.4; pointer-events: none; }
.sn__pick:focus-visible, .sn__btn:focus-visible, .sn__wave:focus-visible, .sn__block:focus-visible, .dpop__sel:focus-visible, .dpop__mode button:focus-visible { outline: 2px solid var(--acid); outline-offset: 1px; }
.sn__prog { position: relative; height: 28px; border-radius: var(--r); background: var(--sunk); box-shadow: 0 0 0 1px var(--line-2); overflow: hidden; }
.sn__prog i { position: absolute; inset: 0; background: var(--hover); transform: scaleX(0); transform-origin: left; }
.sn__prog span { position: relative; display: block; padding: 0 var(--s2); line-height: 28px; font-size: var(--fs-xs); color: var(--mute); }
.sn__err { margin: 0; color: #e0a24a; font-size: var(--fs-s); line-height: 1.4; }
.sn__err:empty { display: none; }
.sn__head { display: flex; align-items: center; gap: var(--s2); }
.sn__name { margin: 0; flex: 1 1 auto; min-width: 0; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sn__time { flex: none; color: var(--mute); font-size: var(--fs-xs); font-variant-numeric: tabular-nums; }
.sn__btn { flex: none; width: 36px; height: 36px; display: grid; place-items: center; padding: 0; border: 0; border-radius: var(--r); background: var(--raise); color: var(--text); cursor: pointer; }
.sn__btn:hover { background: var(--hover); }
.sn__btn[aria-pressed="true"] { color: var(--acid); }
.sn__btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; }
.sn__wave { position: relative; height: 72px; border-radius: var(--r); background: var(--sunk); box-shadow: 0 0 0 1px var(--line-2); cursor: pointer; overflow: hidden; touch-action: none; }
.sn__cv { position: absolute; inset: 0; width: 100%; height: 100%; }
.sn__ph { position: absolute; left: 0; top: 0; bottom: 0; width: 2px; background: var(--acid); pointer-events: none; will-change: transform; }
.sn__block { justify-self: start; min-height: 32px; padding: 0 var(--s3); border: 0; border-radius: var(--pill); background: var(--raise); color: var(--mute); font: inherit; font-size: var(--fs-xs); cursor: pointer; }
.sn__block[hidden] { display: none; }
.sn__parts { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: var(--s1); }
.sn__chip { position: relative; display: grid; gap: 3px; padding: var(--s2); border-radius: var(--r); background: var(--raise); font-size: var(--fs-xs); color: var(--mute); overflow: hidden; }
.sn__lv, .sn__ht { display: block; height: 4px; border-radius: 2px; transform-origin: left; transform: scaleX(0); will-change: transform; }
.sn__lv { background: var(--acid); }
.sn__ht { height: 2px; background: var(--text); opacity: 0.8; }
.dpop__mode { display: grid; grid-template-columns: 1fr 1fr; margin: 0; }
.dpop__mode button { min-height: 36px; font-size: var(--fs-xs); }
.dpop__m, .dpop__snd { display: grid; gap: var(--s3); }
.dpop__2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s2) var(--s3); align-items: start; }
.dpop__2 .dpop__row:has(> output) { grid-template-columns: 1fr auto; }
.dpop__sel { width: 100%; min-height: 36px; padding: 0 var(--s2); border: 0; border-radius: var(--r); background: var(--sunk); box-shadow: 0 0 0 1px var(--line-2); color: var(--text); font: inherit; font-size: var(--fs-s); }
.dpop__seg2 { grid-template-columns: 1fr 1fr; }
.dpop__meter { height: 4px; border-radius: 2px; background: var(--sunk); overflow: hidden; }
.dpop__meter i { display: block; height: 100%; background: var(--acid); transform-origin: left; transform: scaleX(0); }
/* the unlit wave mark: a dot says the dial listens to sound; hollow, there is no sound to listen to */
.wv[data-snd] { position: relative; }
.wv[data-snd]::after { content: ""; position: absolute; right: 3px; top: 3px; width: 6px; height: 6px; border-radius: 50%; background: var(--acid); }
.wv[data-snd="none"]::after { background: transparent; box-shadow: inset 0 0 0 1.5px var(--faint); }
.v3__snd { position: fixed; left: 50%; bottom: calc(var(--s6) + 52px); transform: translateX(-50%); z-index: 61; min-height: 32px; padding: 0 var(--s4); border: 0; border-radius: var(--pill); background: var(--panel); box-shadow: var(--float); color: var(--mute); font: inherit; font-size: var(--fs-xs); cursor: pointer; }
.v3__snd[hidden] { display: none; }
.v3__snd:focus-visible { outline: 2px solid var(--acid); outline-offset: 2px; }
@media (pointer: coarse), (max-width: 899px) {
  .sn__btn { width: 44px; height: 44px; }
  .sn__block, .v3__snd, .dpop__sel, .dpop__mode button { min-height: 44px; }
  .sn__pick, .sn__acts .btn { min-height: 44px; }
  .dpop input[type="range"] { min-height: 44px; }
}

/* ---------- sheet «Слои» (sheet-layers.js) ---------- */
.ly > * + * { margin-top: var(--s6); }
.ly [hidden] { display: none; }
.ly__list { margin: 0; padding: 0; list-style: none; display: grid; gap: var(--s1); }
.ly__empty { margin: 0; color: var(--mute); line-height: 1.5; }
.ly__row { display: flex; align-items: center; gap: 2px; border-radius: var(--r-m); transition: background var(--ease); }
.ly__row:hover { background: var(--raise); }
.ly__row.is-sel { background: var(--hover); box-shadow: inset 0 0 0 1px var(--acid); }
.ly__row.is-off .ly__thumb, .ly__row.is-off .ly__txt { opacity: 0.45; }
.ly__row--base .ly__sub { color: var(--faint); }
.ly__main { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: var(--s2); min-height: 48px; padding: var(--s1) var(--s2); border: 0; border-radius: var(--r-m); background: none; color: var(--text); text-align: left; cursor: pointer; }
.ly__thumb { flex: none; width: 36px; height: 36px; border-radius: 6px; object-fit: cover; background: var(--sunk); box-shadow: 0 0 0 1px var(--line); }
.ly__txt { display: grid; min-width: 0; line-height: 1.25; }
.ly__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.ly__sub { color: var(--mute); font-size: var(--fs-xs); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ly__rename { flex: 1 1 auto; min-width: 0; height: 28px; padding: 0 var(--s2); border: 0; border-radius: var(--r); background: var(--sunk); box-shadow: 0 0 0 1px var(--acid); color: var(--text); font: inherit; }
.ly__btn { flex: none; width: 32px; height: 32px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 6px; background: none; color: var(--faint); cursor: pointer; transition: color var(--ease), background var(--ease); }
.ly__btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; }
.ly__btn:hover { background: var(--hover); color: var(--text); }
.ly__eye[aria-pressed="true"] { color: var(--mute); }
.ly__dup, .ly__del { opacity: 0; }
.ly__row:hover .ly__dup, .ly__row:hover .ly__del, .ly__row:focus-within .ly__dup, .ly__row:focus-within .ly__del, .ly__row.is-sel .ly__dup, .ly__row.is-sel .ly__del { opacity: 1; }
.ly__main:focus-visible, .ly__btn:focus-visible, .ly__pic:focus-visible, .ly__rename:focus-visible { outline: 2px solid var(--acid); outline-offset: -2px; }
.ly__add { display: flex; flex-wrap: wrap; gap: var(--s2); }
.ly__pick { margin-top: var(--s3); display: grid; gap: var(--s2); }
.ly__grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s2); }
.ly__pic { display: grid; gap: 2px; justify-items: center; padding: var(--s1); border: 0; border-radius: var(--r); background: none; color: var(--mute); font-size: var(--fs-xs); cursor: pointer; min-width: 0; }
.ly__pic img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 6px; box-shadow: 0 0 0 1px var(--line); }
.ly__pic span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ly__pic:hover { background: var(--raise); color: var(--text); }
.ly__up { justify-self: start; min-height: 32px; display: inline-flex; align-items: center; cursor: pointer; }
.ly__texthome { margin-top: var(--s3); }
.ly__block + .ly__block { margin-top: var(--s6); }
.ly__kinds { display: flex; flex-wrap: wrap; gap: var(--s1); margin-bottom: var(--s4); }
.ly__kinds .lt__chip { min-height: 28px; padding: 0 var(--s2); font-size: var(--fs-xs); }
.ly__keys, .ly__base { margin: var(--s3) 0 0; color: var(--faint); font-size: var(--fs-xs); line-height: 1.5; }
.ly__base { color: var(--mute); font-size: var(--fs); margin-bottom: var(--s3); }
.ly__status { display: flex; align-items: baseline; gap: var(--s2); margin: 0 0 var(--s4); color: var(--mute); }
.ly__retry { min-height: 28px; }
@media (pointer: coarse), (max-width: 899px) {
  .ly__main { min-height: 56px; }
  .ly__btn { width: 44px; height: 44px; }
  .ly__dup, .ly__del { opacity: 1; }
  .ly__pic { min-height: 64px; }
  .ly__up, .ly__retry, .ly__kinds .lt__chip { min-height: 44px; }
  .ly__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ly__rename { height: 44px; font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) { .ly__row, .ly__btn { transition: none; } }

/* ---------- a layer on the stage (layer-stage.js): outline, corner handles, turn knob ---------- */
.lyo { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.lyo[hidden] { display: none; }
.lyo__svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.lyo__poly { fill: rgba(232, 232, 12, 0.05); stroke: var(--acid); stroke-width: 1.5; stroke-linejoin: round; }
.lyo.is-drag .lyo__poly { fill: rgba(232, 232, 12, 0.1); }
.lyo b { position: absolute; width: 10px; height: 10px; margin: -5px 0 0 -5px; border: 2px solid var(--acid); border-radius: 2px; background: var(--bg); pointer-events: auto; touch-action: none; cursor: nwse-resize; }
.lyo b::after { content: ""; position: absolute; inset: -12px; }
.lyo b[data-h="ne"], .lyo b[data-h="sw"] { cursor: nesw-resize; }
.lyo .lyo__turn { border-radius: 50%; cursor: ew-resize; }
.lyo b:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
.lyo__tip { position: absolute; left: var(--lyo-x, 50%); top: var(--lyo-y, 50%); transform: translate(-50%, -50%); padding: 2px 8px; border-radius: var(--pill); background: var(--acid); color: var(--on-acid); font-size: var(--fs-xs); font-weight: 500; white-space: nowrap; pointer-events: none; }
.lyo__tip[hidden] { display: none; }
.lyo__hud { position: absolute; left: 50%; top: var(--s3); z-index: 5; transform: translateX(-50%); margin: 0; padding: var(--s1) var(--s3); border-radius: var(--pill); background: var(--panel); box-shadow: var(--float); color: var(--text); font-size: var(--fs-xs); white-space: nowrap; max-width: calc(100% - 2 * var(--s3)); overflow: hidden; text-overflow: ellipsis; pointer-events: none; }
.lyo__hud[hidden] { display: none; }
.v3__stage[data-layer-mode] canvas { cursor: crosshair; }
@media (pointer: coarse) {
  .lyo b { width: 16px; height: 16px; margin: -8px 0 0 -8px; }
  .lyo b::after { inset: -14px; }
}
