/* ==================== CREDITS & LICENSES ====================
   Icons:  Lucide (https://lucide.dev), ISC License. Some Lucide icons are derived from Feather, MIT License.
           Copyright (c) 2026 Lucide Icons and Contributors.
           Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby
           granted, provided that the above copyright notice and this permission notice appear in all copies.
           THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING
           ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL,
           DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
           WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE
           USE OR PERFORMANCE OF THIS SOFTWARE.
           Feather: MIT License, Copyright (c) 2013-present Cole Bemis (https://github.com/feathericons/feather).
           Full texts: https://github.com/lucide-icons/lucide/blob/main/LICENSE
   Fonts:  Newsreader and Hanken Grotesk, bundled in vendor/ (Instrument Sans stays only for the credits of work saved before the change; the optional custom Credits fonts load from Google Fonts),
           SIL Open Font License 1.1 (https://openfontlicense.org).
   PDF engine: PDF.js (Mozilla and contributors), Apache License 2.0, bundled in vendor/.
   PDF export: pdf-lib (Copyright (c) 2019 Andrew Dillon), MIT License (https://github.com/Hopding/pdf-lib), bundled in vendor/.
   ============================================================ */

/* ==================== 1. THEME & VARIABLES ==================== */
/* ----- Light theme (default colors, shadow) ----- */
:root{
  --hue-rail:linear-gradient(to right,#f00,#ff0,#0f0,#0ff,#00f,#f0f,#f00); --area-white:#fff; --area-black:#000;   /* the color picker: the hue strip, and the white and black its shade and brightness area fades between */
  --sw-h:22px;   /* a switch's height; a heading row in the video panel is as tall */
  --sh-name:50px; --sh-val:34px;   /* the Shadows rows: the name column (as wide as Softness) and the value column (as wide as 150%) */
  --gap-sub:2px; --gap-label:4px; --gap-head:8px; --gap-set:12px; --gap-field:16px; --gap-group:18px;   /* the spacing scale (2, 4, 8, 12, 16, with --gap-group, 18, the space above and below a divider between the video panel's groups): title to its subtitle, label to its control and a control to its note, a heading to its content, one setting to the next in an editor card (and card padding), one setting to the next in the video panel and the page windows */
  --fs:32px; --fsm:10px; --fs-trh:50px; --hint-bridge:21px; --w-glass:28px; --combo-btn-w:28px; --div-w:7px;   /* the floating strips on the video picture: their height and their distance from the picture's edge (the script sets both per picture size), a button's width on a glass bar, the font box's list button, and the System divider's grab width */
  --crop-edge:1.5px; --hl:var(--crop-grip); --dz:var(--step-s); --sb:160px; --zoom-min:56px; --zoom-off:300px; --panel-side-max:40px; --swatch-w:42px; --zoom-w:110px; --kbd-w:20px;
  --black:#000; --on-turn:#1a1d26;   /* the full-screen picture's black, and the ink on an amber (--turn) fill: the same in light and dark */
  --x-size:26px;   /* the remove (x) button on a Spectra list row: a square */
  --tip-x:66px;   /* how far in from the Limiter row's left edge its warning note starts (after the word Limiter) */
  --corr-h:14px;   /* the Imager's correlation tick: it stands this tall, reaching above and below its bar */
  --eq-sel-w:104px;   /* the EQ band's filter-type menu: one width in every band */
  --jack:20px;   /* the cable's progress ring at a tool's jack: its diameter */
  --ae-side:16px;   /* the tool window's one left line and one right line: the tool's name, its subtitle and buttons, the cards, and the status bar all sit this far in from the window's edges */
  --pill-bg:rgba(14,17,40,.92);   /* the dark pill: the wait pill and the hints drawn on the waveform, the same in light and dark */
  --gap-card:10px;   /* the space between two cards, side by side or one above the other, in every tool window (the same in both directions) */
  --slider-h:20px;   /* a slider's own box: its track sits in the middle, and the thumb hangs below the track */
  --pe-gutter:0px; --chip-max:320px; --chip-dot:4px; --chip-dot-drop:0px; --pe-edge:20px; --pe-edge-b:28px; --pe-col-gap:14px;   /* the PDF Editor's outer room: the page grid's and the large view's sides, the gap between the tool list and the tool, and the grid's bottom; the gap between page columns */
  --gap-tight:6px; --gap-snug:3px; --tab-py:7px; --hint-py:5px;   /* the small gaps between the scale's steps: a page card's padding, the page number's row, a glass bar's padding, a tool tab's and a bar's top and bottom room, a hint's top and bottom */
  --h-glass:26px; --hid-k:30px; --wipe-k:26px; --crop-grip:28px;   /* a button on a glass bar, the mark on a page left out, the handle on the before-and-after line, and a crop frame's grip */
  --r-paper:4px;   /* the corner of a page's picture and of the sheen over it */
  --paper:#fff; --on-dark:#fff;   /* a sheet of paper (a page's picture, a mark's edge) and text on a dark or accent fill: white in light and dark */
  --ctl-py:7px; --ctl-px:13px; --gap-room:20px; --gap-room-x:22px; --gap-hero:24px;   /* the shared rules' own sizes: a button's and a field's top and bottom padding, a button's side padding, a window's top and bottom padding and its side padding, and the big room round a start card or a window's empty state */
  --type-caption:12px; --type-heading:16px; --type-touch:16px;   /* a note's and a caption's size, a tool's heading, and the size a field has on a touch screen (a phone zooms in on anything smaller) */
  --tip-bridge:7px; --hs-indent:22px; --hs-dot:12px; --hs-arrow-x:5px; --brand-nudge-y:-.1px; --brand-nudge-x:1.33px;   /* a tip's bridge to its (i), the history list's left room, its dot, and its arrow's left edge, and the header logo's small optical shifts */
  --shadow-start:0 1px 0 color-mix(in srgb,#fff 70%,transparent) inset,0 10px 30px -14px rgba(20,30,70,.28); --shadow-start-hover:0 1px 0 color-mix(in srgb,#fff 70%,transparent) inset,0 18px 38px -16px color-mix(in srgb,var(--accent) 55%,transparent); --led-rim:inset 0 1px 1px rgba(255,255,255,.55),inset 0 -1px 1px rgba(0,0,0,.12); --led-lit-bg:radial-gradient(circle at 34% 28%,#ecfff3 0,#7defa6 30%,var(--ok) 70%,#17894c 100%); --led-lit-glow:0 0 0 .5px rgba(23,137,76,.5),0 0 8px 1px rgba(47,184,114,.6),0 0 16px 3px rgba(47,184,114,.22),inset 0 1px 1px rgba(255,255,255,.8); --led-target-ring:0 0 0 3px var(--accent-soft),0 0 0 4.5px var(--accent),inset 0 1px 1px rgba(255,255,255,.55); --wire-back:rgba(20,30,60,.14); --wire-hi:rgba(255,255,255,.55); --wire-dot:rgba(23,137,76,.55); --hover-soft:rgba(127,127,127,.08); --shadow-pop:0 1px 2px rgba(16,20,40,.06),0 12px 32px rgba(16,20,40,.16); --hover-grey:rgba(127,127,127,.1); --on-dark-faint:rgba(255,255,255,.2); --shadow-thumb:0 0 0 .5px var(--thumb-edge),0 1px 3px rgba(0,0,0,.22),0 2px 6px rgba(0,0,0,.08); --shadow-knob:0 1px 3px rgba(0,0,0,.35); --veil:rgba(20,24,40,.62); --paper-edge:rgba(0,0,0,.25); --shadow-primary:inset 0 1px 0 rgba(255,255,255,.22),0 1px 2px rgba(20,24,40,.16); --shadow-primary-hover:inset 0 1px 0 rgba(255,255,255,.28),0 4px 12px rgba(30,40,110,.22); --shadow-primary-press:inset 0 1px 2px rgba(0,0,0,.18); --shadow-chip-hover:0 3px 10px rgba(20,24,40,.08); --shadow-dlg:0 1px 2px rgba(16,20,40,.06),0 8px 24px rgba(16,20,40,.1),0 28px 70px rgba(16,20,40,.14);   /* the shared rules' shadows, lights, hover tints, and white-on-dark: the start cards, the lights and cable, a slider's thumb, a switch's knob, the primary button, a chip's hover, the dropped-file veil, the paper's edge, the history window, and the dialog */
  --page-shadow:0 0 0 .5px rgba(16,20,40,.16),0 2px 8px rgba(16,20,40,.10); --page-shadow-hover:0 0 0 .5px rgba(16,20,40,.18),0 10px 22px rgba(16,20,40,.16); --page-shadow-lift:0 0 0 .5px rgba(16,20,40,.16),0 6px 20px rgba(16,20,40,.16); --ghost-shadow:0 14px 32px rgba(10,14,30,.3);   /* a page at rest, lifted by the pointer, the large view's sheet, and a page being dragged */
  --chip-shadow:0 1px 4px rgba(0,0,0,.28); --wipe-shadow:0 1px 5px rgba(0,0,0,.3); --glass-ring:rgba(16,20,40,.14);   /* the small shadow under a mark on a page, the handle's, and the hairline round a glass bar */
  --chip-bg:rgba(255,255,255,.88); --chip-ink:rgba(16,20,40,.7); --chip-edge:rgba(16,20,40,.32); --dim-fill:rgba(255,255,255,.62);   /* a light mark on a page (left out, unticked) and the Dim frame's fill */
  --side-bg:rgba(10,14,30,.66); --hint-bg:rgba(10,14,30,.72); --crop-scrim:rgba(10,14,30,.42);   /* the before and after words, the hint, and the shade outside the crop frame */
  --cu-w:3.6ch; --cu-w-min:2ch;          /* the blank in a Custom choice: degrees hold a sign and three digits ("-180"), inches two digits, a point, and one decimal ("11.7"), so both fit the same width */
  --thumb:18px; --thumb-w:28px; --track:6px;   /* a slider: its handle is a pill 28px wide and 18px tall (--thumb, the height every slider measure uses), on a 6px track */
  --inactive:.45;   /* a control, field, or card that does not apply right now (switched off, nothing to act on): one level everywhere, never stacked */
  --val-w:round(up,calc(3ch + .81em),2px);   /* the room a value beside a slider keeps for its longest reading (three digits and a percent sign), so the slider never moves when 99% becomes 100% */
  --value-fs:13px;   /* every value readout: beside a slider, in a label row, in the Balance meter, and after a heading */
  --scale-fs:11px;   /* every end word and number under or beside a slider or bar (Meter, Gain, Width, Balance, Fades Length) */
  --big-fs:32px;   /* every big number over a slider (Gain, Fades Length) */
  --scale-gap:8px;   /* the white space from the visible bottom of any bar or slider track to the top of the numbers under it (Meter, Gain, Width, Balance, Fades Length); a slider's thumb hangs below its track, so a slider's numbers sit --scale-gap-thumb under the thumb */
  --scale-gap-thumb:calc(var(--scale-gap) - (var(--thumb) - var(--track)) / 2);
  --tick-h:6px;   /* a scale's middle tick under a slider (the approved pictures) */
  --line-s:16px;   /* the line a small label or note sits on (12px text), trimmed to its letters where rows must share one line */
  --h-s:30px; --h-m:34px; --h-l:36px; --h-xs:30px;   /* one control height for every small button, choice, and menu in both editors; --h-m is the taller one, --h-l the tallest (icon buttons, tool tabs, the loudness rows), --h-xs the compact one: a button group's outer height in the timeline bar and the PDF Editor's head, and the Fit button beside it */
  --field-pad-x:9px;   /* the room inside a field (a menu, a text box, a number box) between its edge and its first letter, and between its edge and a menu's chevron: the same on both sides */
  --chev-x:calc(var(--field-pad-x) + 1px); --chev-s:14px;   /* a menu's chevron (its picture is cut to its ink): the distance from the menu's right edge (the field's room plus the 1px of space a letter keeps beside its stem, so the chevron's space matches the first letter's), and its width */
  --num-w:80px;   /* the width of every number box (Loudest peak, the loudness target, an EQ frequency) */
  --r-sm:7px; --r-ctl:8px; --r-card:12px; --r-lg:14px; --r-win:18px;   /* corner scale: small control, control, card, large card, window. A group around controls uses the control corner plus the gap (7 + 4 = 11) */

  --bg:#f5efe5; --panel:#ffffff; --panel2:#ffffff; --line:#e3d7c6; --ink:#1b1a18; --muted:#6f6a62; --chev:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='5 8 14 8' fill='none' stroke='%235f6778' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  --hairline:color-mix(in srgb,var(--ink) 13.5%,transparent);   /* a divider or an unlit light on a tinted surface (where --line disappears in dark mode); made from ink, so it follows each theme with no override */
  --accent:#00522c; --accent-ink:#ffffff; --accent-soft:rgba(0,82,44,.12);
  --thumb-bg:#ffffff; --thumb-edge:rgba(16,20,40,.16);   /* a slider's handle: a pale pill with a hairline edge, so blue means only the value set */
  --fade:#b0389c; --turn:#d97706; --turn-soft:rgba(251,185,40,.34); --play:#d6333f; --cred:#12907c; --cred-soft:rgba(18,144,124,.20);
  --stage:#dfe3ea; --block:#ffffff; --wave:#7c8bf0; --danger:#c4283a;
  --turn-ink:#bf6500; --turn-sys:#8690a6; --ok-ink:#1f9a5b;
  --shadow:0 1px 2px rgba(20,24,40,.08),0 8px 24px rgba(20,24,40,.08);
  --glass-bg:linear-gradient(180deg,rgba(255,255,255,.76),rgba(244,246,252,.64)); --glass-edge:rgba(255,255,255,.95);
  --glass-shadow:0 6px 18px -10px rgba(10,14,30,.26),inset 0 1px 0 rgba(255,255,255,.8),inset 0 -1px 0 rgba(255,255,255,.35);
  --glass-sheen:radial-gradient(120% 140% at 8% -40%,rgba(255,255,255,.5),rgba(255,255,255,0) 52%),linear-gradient(180deg,rgba(255,255,255,.2),rgba(255,255,255,0) 45%); --glass-sheen-o:.7;          /* the soft highlight on every glass bar (see the rule that paints it) */
  --glass-ctl-bg:color-mix(in srgb,var(--panel2) 58%,transparent);          /* a control that sits on glass */
  --hover-fill:var(--accent-soft); --hover-ink:var(--accent); --hover-shadow:0 2px 8px rgba(17,17,17,.1);          /* one hover for every control on glass: a soft accent fill and accent ink, no lift; a stand-alone button lifts with the shadow */
  --hair:1px;   /* one pixel: a hairline's width, and the half-pixel and one-pixel offsets that center or tuck one */
  --step-s:22px;   /* the numbered step circle, the tool list's jack, the bypass pill, a chip's clear button: one small round size */
  --clip-h:24px;   /* the clip badge on the Level meter */
  --r-mark:2px;   /* the corner of a small marker or tick (the Level markers, the Emulator's key) */
  --ae-bar-lift:66px;   /* how far the Audio Editor's glass bar is pulled up over the picture: its 48px plus the 18px that stays beside the picture */
  --clip:#e5484d; --safe:#2fb872; --heal:#34d399; --cut:#fb923c; --pill-ink:#fff; --neutral:#808080;   /* the Level meter's clip red and safe green, Spectra's heal and cut, white on a dark or colored pill, and a neutral grey for a ring that is not a theme color: the same in light and dark */
  --shadow-lift:0 8px 22px rgba(10,14,30,.25);   /* a card lifted off the page while it is dragged */
  --shadow-float:0 24px 48px -28px rgba(10,14,30,.6),0 0 0 .5px rgba(10,14,30,.08);   /* the full-screen bars and tool window, under the glass shadow */
  --shadow-inset:inset 0 1px 2px rgba(0,0,0,.09);   /* a recessed panel (the Balance meter) */
  --erase:#0f93b0;   /* the eraser's one hue (the highlight, the ring): a teal, apart from the accent. The paper is white in both themes, so it is one value in both */
  --erase-live:color-mix(in srgb,var(--erase) 46%,transparent); --erase-mark:color-mix(in srgb,var(--erase) 32%,transparent); --erase-rest:color-mix(in srgb,var(--erase) 17%,transparent); --erase-edge:color-mix(in srgb,var(--erase) 80%,transparent);   /* a stroke on the selector: while drawing, set with the eraser on, set with it off, and under the pointer */
  --erase-fade:380ms; --erase-x:16px;   /* the preview's patch fades in or out over this; the remove chip's visible size (its hit area is 24px) */
  --erase-x-shadow:var(--glass-shadow),inset 0 0 0 1px var(--glass-edge),0 0 0 .5px var(--glass-ring);   /* the chip's edge on glass; dark mode drops the glass edge, which reads as a gray ring over the white paper */
  --brush:16px; --icon-s:14px; --icon-m:16px; --icon-l:18px;          /* glyph sizes. --icon-s is the glyph on every glass bar (the video strips, Full screen, Trim silence), whatever the button around it; --icon-l is a stand-alone icon button's */
}

/* ----- Dark mode: follows the device setting ----- */
@media (prefers-color-scheme: dark){
  :root:not([data-theme="light"]){
    --bg:#18231e; --panel:#202e27; --panel2:#293b31; --line:#40564a; --ink:#f5efe5; --muted:#bcbab2; --chev:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='5 8 14 8' fill='none' stroke='%2398a0b1' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    --accent:#a9d8bd; --accent-ink:#003d22; --accent-soft:rgba(169,216,189,.16);
    --thumb-bg:#eceef3; --thumb-edge:rgba(0,0,0,.4);
    --fade:#e58bd6; --turn:#f59e3b; --turn-soft:rgba(255,176,46,.30); --play:#ff6a5f; --cred:#4fd1bd; --cred-soft:rgba(79,209,189,.26); --turn-ink:#f59e3b; --turn-sys:#98a3b8; --ok-ink:#2fb872;
    --stage:#0d0f13; --block:#252b37; --wave:#6f7fe0; --danger:#ff7b8a;
    --shadow:0 1px 2px rgba(0,0,0,.4),0 8px 24px rgba(0,0,0,.35);
    --glass-bg:linear-gradient(180deg,rgba(40,46,66,.62),rgba(24,28,42,.56)); --glass-edge:rgba(255,255,255,.14);
    --glass-shadow:0 6px 18px -10px rgba(4,6,16,.38),inset 0 1px 0 rgba(255,255,255,.1),inset 0 -1px 0 rgba(255,255,255,.12);
    --glass-sheen-o:.25;
    --erase-x-shadow:var(--chip-shadow);
  }
}

/* ----- Dark mode: forced via data-theme="dark" ----- */
:root[data-theme="dark"]{
  --bg:#18231e; --panel:#202e27; --panel2:#293b31; --line:#40564a; --ink:#f5efe5; --muted:#bcbab2; --chev:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='5 8 14 8' fill='none' stroke='%2398a0b1' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  --accent:#a9d8bd; --accent-ink:#003d22; --accent-soft:rgba(169,216,189,.16);
  --thumb-bg:#eceef3; --thumb-edge:rgba(0,0,0,.4);
  --fade:#e58bd6; --turn:#f59e3b; --turn-soft:rgba(255,176,46,.30); --play:#ff6a5f; --cred:#4fd1bd; --cred-soft:rgba(79,209,189,.26); --turn-ink:#f59e3b; --turn-sys:#98a3b8; --ok-ink:#2fb872;
  --stage:#0d0f13; --block:#252b37; --wave:#6f7fe0; --danger:#ff7b8a;
  --shadow:0 1px 2px rgba(0,0,0,.4),0 8px 24px rgba(0,0,0,.35);
  --glass-bg:linear-gradient(180deg,rgba(40,46,66,.62),rgba(24,28,42,.56)); --glass-edge:rgba(255,255,255,.14);
  --glass-shadow:0 6px 18px -10px rgba(4,6,16,.38),inset 0 1px 0 rgba(255,255,255,.1),inset 0 -1px 0 rgba(255,255,255,.12);
  --glass-sheen-o:.25;
  --erase-x-shadow:var(--chip-shadow);
}

/* ==================== 2. BASE & RESET ==================== */
/* ----- Page, body and fonts ----- */
:root{box-sizing:border-box;padding-top:env(safe-area-inset-top,0px);padding-bottom:env(safe-area-inset-bottom,0px)}
html{scroll-padding-top:env(safe-area-inset-top,0px);height:100%}
*,*::before,*::after{box-sizing:inherit}
/* a pinch on a touch screen never zooms the whole page (the app zooms its own waveform and timeline), so the page cannot be left stuck zoomed in; panning still works, and parts that set their own touch-action keep it */
*{touch-action:pan-x pan-y}
input[type=range]{touch-action:pan-y}
[hidden]{display:none!important}
body{margin:0;height:100%;background:var(--bg);color:var(--ink);
  font:var(--type-value)/1.45 Inter,'Hanken Grotesk',system-ui,-apple-system,'Segoe UI',Roboto,sans-serif;-webkit-font-smoothing:antialiased}
button,input,select,textarea{font:inherit;color:inherit}
:root{--lh:1.45}
/* every line box is a whole number of pixels, so a control or a stack of text never lands on half a pixel (where the text would sit up to a pixel off its box). Set --lh, never line-height, for a factor; a fixed px line-height is fine. */
html *,html ::before,html ::after{line-height:round(calc(var(--lh) * 1em),1px)}

/* ----- App grid: header / work area / timeline ----- */
.app{height:100%;display:grid;grid-template-rows:auto minmax(0,1fr) auto;min-height:0;container:app/inline-size}          /* the page's own width: the stage, the timeline, and the settings panel stack by it (a container query), the screen's rules are left to the header */

/* ==================== 3. HEADER BAR ==================== */
/* ----- Header layout ----- */
.top{display:flex;align-items:center;gap:var(--gap-set);padding:var(--gap-card) var(--gap-field);border-bottom:1px solid var(--line);background:var(--panel)}

/* ----- Logo / site name ----- */
.brand{display:flex;align-items:center;gap:var(--gap-card);margin-right:var(--gap-tight)}
.brand h1{font:500 22px Georgia,serif;line-height:round(1em,1px);--lh:1;font-style:italic;letter-spacing:.2px}

/* ----- File chips (loaded PDF / audio names) ----- */
.chips{display:flex;gap:var(--gap-head);flex:0 1 auto;min-width:0;flex-wrap:nowrap;padding-right:var(--gap-label)}
.chips .chip{min-width:0;flex:0 1 auto}
.chips{margin-right:auto}
.brand h1 .home{color:inherit;text-decoration:none}
.title-pill{flex:0 1 var(--tw,136px);min-width:90px;max-width:300px;display:block;transition:flex-basis var(--ae-quick) var(--ease-out)}          /* --tw is the width of the text (never less than the placeholder), set by titleFit */
.title-pill input{width:100%;box-sizing:border-box;padding:var(--gap-tight) var(--gap-card);border:1px solid transparent;border-radius:var(--r-ctl);background:none;color:var(--ink);height:var(--h-m);font:500 15px inherit;line-height:round(1.2em,1px);--lh:1.2;font-family:inherit;transition:border-color var(--ae-quick) var(--ease-color),background-color var(--ae-quick) var(--ease-color)}
.title-pill input:hover{border-color:var(--line)}
.title-pill input:focus{border-color:var(--accent);background:var(--panel2)}
.title-pill input::placeholder{color:var(--muted)}
.top .btn{flex:none}
@media (max-width:1280px){.top #btnPdf span,.top #btnAudio span{display:none}.top #btnPdf,.top #btnAudio{padding-left:var(--gap-card);padding-right:var(--gap-card)}}
.chip{display:inline-flex;align-items:center;gap:var(--gap-head);padding:var(--gap-tight) var(--gap-card);border-radius:999px;background:var(--panel2);border:1px solid var(--line);font-size:var(--type-body)}
.chip svg{width:var(--icon-m);height:var(--icon-m);flex:none;color:var(--muted)}          /* whole-pixel glyphs in whole-pixel boxes (16px in 18px, 14px in 20px), so every glyph lands on the chip's middle line and not half a pixel off it */
.chip span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.chip small{color:var(--muted);white-space:nowrap}
.chip.busy{border-color:var(--accent)}

/* ==================== 4. BUTTONS ==================== */
/* ----- Standard button: size, padding, colors ----- */
.btn{display:inline-flex;align-items:center;justify-content:center;gap:var(--gap-head);padding:var(--ctl-py) var(--ctl-px);border-radius:var(--r-ctl);border:1px solid var(--line);background:var(--panel2);cursor:pointer;white-space:nowrap;--lh:1.2}
.btn:not(.small){min-height:var(--h-m)}          /* a full-size button is one --h-m tall whatever its text; .btn.small sizes itself */
.btn:hover{border-color:var(--muted)}
.btn:focus-visible,.icon-btn:focus-visible,input:focus-visible,select:focus-visible,.seg label:focus-within{outline:2px solid var(--accent);outline-offset:2px}
.btn svg{width:16px;height:16px}

/* ----- Button variants: primary, disabled, small ----- */
.btn.primary{background:var(--accent);color:var(--accent-ink);border-color:transparent}
.btn.primary:hover{filter:brightness(1.06)}
.btn[disabled]{opacity:var(--inactive);cursor:not-allowed}
.btn.small{padding:var(--gap-label) var(--field-pad-x);min-height:var(--h-s);font-size:var(--type-body)}

/* ==================== 5. WORK AREA (STAGE & TRANSPORT) ==================== */
/* ----- Layout: stage column + side panel ----- */
.work{display:grid;grid-template-columns:minmax(0,1fr) 322px;gap:0;min-height:0}
.stage-col{container:stagecol/inline-size;display:grid;grid-template-rows:minmax(0,1fr) auto;min-height:0;min-width:0;padding:var(--gap-field) var(--gap-field) var(--gap-card) var(--gap-field);gap:var(--gap-card)}

/* ----- Score preview stage ----- */
.stage-wrap{position:relative;background:var(--stage);border-radius:var(--r-card);overflow:hidden;display:flex;align-items:center;justify-content:center;min-height:0;border:1px solid var(--line)}
#stage{display:block;flex:none;object-fit:contain}
/* System: the selector (a page with the video frame on it) and the divider beside the preview */
.sys-sel{position:absolute;z-index:2;overflow:hidden;background:var(--stage);display:flex;align-items:center;justify-content:center}
.sys-sel[hidden],.sys-div[hidden]{display:none}
#selCv{display:block;flex:none;touch-action:none}
.sys-sel.zoomed{cursor:grab;touch-action:none}
.stage-wrap.sys-split.zoomed #stage{clip-path:var(--zoom-clip,none)}          /* the zoomed preview stops at its own half, never over the divider or the selector */
.sys-sel.pan-ready #selCv{cursor:grab!important}
.sys-div{position:absolute;z-index:3;width:var(--div-w);background:var(--stage);cursor:col-resize;touch-action:none}
.sys-div::before{content:"";position:absolute;left:calc((var(--div-w) - var(--hair)) / 2);top:0;bottom:0;width:var(--hair);background:var(--line);transition:background-color var(--ae-quick) var(--ease-color),box-shadow var(--ae-quick) var(--ease-color)}
.sys-div:hover::before,.sys-div:focus-visible::before,.sys-div.drag::before{background:var(--accent);box-shadow:0 0 0 1px var(--accent)}
.sys-div:focus-visible{outline:none}
.stage-wrap.sys-stack .sys-div{width:auto;height:var(--div-w);cursor:row-resize}
.stage-wrap.sys-stack .sys-div::before{left:0;right:0;top:calc((var(--div-w) - var(--hair)) / 2);bottom:auto;width:auto;height:var(--hair)}

/* ----- Intro / empty state text and buttons ----- */
.empty{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;padding:var(--gap-hero);background:var(--stage)}
.empty[hidden]{display:none}
.empty h1{font:500 clamp(24px,3.2vw,38px) Georgia,serif;line-height:round(1.1em,1px);--lh:1.1;margin:0;white-space:nowrap}
.empty h2{font:500 clamp(24px,3.2vw,38px) Georgia,serif;line-height:round(1.1em,1px);--lh:1.1;margin:0;white-space:nowrap}
@media (max-width:520px){.empty h2{white-space:normal}}
.empty p{margin:0;color:var(--muted);max-width:46ch;text-wrap:balance}
.empty .empty-intro{max-width:none;white-space:nowrap}
.empty .empty-intro{--lh:1.6}
.empty .empty-intro .drop{display:block}
@media (max-width:700px){.empty .empty-intro{white-space:normal}.empty .empty-intro span{display:block}}
.empty ol{margin:var(--gap-label) 0 0;padding:0;list-style:none;display:grid;gap:var(--gap-head);text-align:left;counter-reset:s}
.empty li{counter-increment:s;display:flex;gap:var(--gap-card);align-items:baseline;color:var(--muted)}
.empty li::before{content:counter(s);display:inline-grid;place-items:center;width:22px;height:22px;border-radius:50%;border:1px solid var(--line);font-size:var(--type-caption);color:var(--ink);flex:none}
.empty .row{display:flex;gap:var(--gap-card);flex-wrap:wrap;justify-content:center}

/* ----- Transport controls: play, time, tap button ----- */
.transport{display:flex;align-items:center;gap:var(--gap-tight);flex-wrap:wrap}
.icon-btn{display:inline-grid;place-items:center;width:var(--h-l);height:var(--h-l);border-radius:var(--r-ctl);border:1px solid var(--line);background:var(--panel2);cursor:pointer}
.icon-btn:hover{border-color:var(--muted)}
.icon-btn svg{width:var(--icon-l);height:var(--icon-l);fill:currentColor}
.icon-btn.play svg,.transport .icon-btn svg{width:var(--icon-m);height:var(--icon-m)}          /* Back to start and Play are the same square (--h-l) with the same glyph size (--icon-m); Play is blue */
.icon-btn.stroke svg{fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.icon-btn.play{width:var(--h-l);height:var(--h-l);background:var(--accent);border-color:transparent;color:var(--accent-ink)}
.icon-btn[disabled]{opacity:var(--inactive);cursor:not-allowed}
.time{font-variant-numeric:tabular-nums;margin:0 var(--gap-head) 0 var(--gap-card);min-width:140px}
.time b{font-weight:600}
.time span{color:var(--muted)}
.spacer{flex:1}
.info{color:var(--muted);font-size:var(--type-body)}
.transport .info{margin-left:auto}          /* the spread label is always on the right, also when it has a row of its own */
.info .si{display:inline-grid;justify-items:end;text-align:right;white-space:nowrap;font-variant-numeric:tabular-nums}          /* the label and, invisibly, the longest one share a cell, so the box never changes width */
.info .si>span,#spreadMax>span{grid-area:1/1}
#spreadMax{display:grid;visibility:hidden}
.transport[data-info=mid] .si .p{display:none}          /* a narrow row drops "Spread ", then the rest but the pages */
.transport[data-info=short] .si[data-l=spread] :is(.p,.c,.s){display:none}
.transport[data-info=short] .si[data-l=single] :is(.p,.s,.t){display:none}
.tapbtn{gap:var(--gap-head)}
.transport .icon-btn:not(.play){border-color:var(--muted)}          /* Back to start's outline reads as clearly as Play's filled edge, so the two look the same height: the pale border faded into the page and made the filled button look taller */
.transport .btn{min-height:var(--h-l)}          /* every button in the play row (Add page turn, and Hide editor in full screen) is the same height as Back to start and Play */
.hist-wrap .hi{display:none}
kbd{display:inline-block;min-width:var(--kbd-w);box-sizing:border-box;padding:var(--hair) var(--gap-tight);border:1px solid var(--line);border-bottom-width:2px;border-radius:var(--r-paper);background:var(--panel2);font:inherit;font-size:var(--type-note);line-height:round(1.5em,1px);--lh:1.5;text-align:center;color:var(--ink)}          /* the one key cap: in the shortcuts list, in a note, in a button's hint. In running text it is the note's own size, so it never stands out */
:is(p,li,.t-note,.btn) kbd{vertical-align:baseline;margin-block:calc(-1 * (var(--hair) + var(--gap-sub)))}          /* the cap's top and bottom edges take no line room, so a line of text or a button holding a cap is as tall as it was without one */

/* ==================== 6. SIDE PANEL (SETTINGS) ==================== */
/* ----- Panel container and groups ----- */
.panel{position:relative;border-left:1px solid var(--line);background:var(--panel);overflow:auto;padding:var(--gap-card) var(--gap-field) var(--gap-group);min-height:0}
/* keep the panel's width steady when its scrollbar appears or disappears (e.g. when a group opens) */
@container app (min-width:961px){
  .panel{overflow-x:hidden;overflow-y:scroll}
  @supports (scrollbar-gutter:stable){.panel{overflow-y:auto;scrollbar-gutter:stable}}
}
.group{padding:var(--gap-group) 0;border-bottom:1px solid var(--line)}
.group:last-child{border-bottom:0}
/* in the video panel each group is a tile (the shared card look); a tile with content has room above its heading and below its last row, and a closed one is centered on its heading row. The chevron's space stays reserved when it is hidden, so the heading does not move when the group opens */
.panel .group{padding:var(--gap-set) var(--gap-field) var(--gap-group);border:1px solid var(--line);border-radius:var(--r-lg);background:var(--panel2);margin-bottom:var(--gap-card)}
.panel .group:last-child{border-bottom:1px solid var(--line);margin-bottom:0}
.panel .group.off{padding-block:var(--gap-set)}
.panel .group.collapsed:not(.off){padding-bottom:calc(var(--gap-group) - var(--gap-label))}          /* a closed group with its summary: the heading row leaves room above its letters and the summary's line leaves --gap-label under its own, so the space above the heading and below the summary reads the same */
.panel .group>h3,.panel .group>.group-head{display:flex;align-items:center;min-height:var(--sw-h)}          /* every heading row is as tall as the switch, so the letters sit the same distance from the top of every tile, and a closed tile is centered on its heading */
.group h3{margin:0 0 var(--gap-card);font-size:var(--type-value);font-weight:600}
.group-head{position:relative;display:flex;align-items:center;gap:var(--gap-head)}
.group .group-head h3{margin:0}
.group-toggle{display:flex;align-items:center;margin-left:auto;cursor:pointer}
.group.off .group-head{margin-bottom:0}

/* ----- Form fields: labels, sliders, selects ----- */
.field{display:grid;gap:var(--gap-label);margin-bottom:var(--gap-field)}          /* a label sits --gap-label above its control, and one setting stands --gap-field from the next; an editor card sets its own --gap-set */
.field:last-child,.field:not(:has(~ :not([hidden]))){margin-bottom:0}          /* the last setting shown has no room under it, also when what follows it is hidden (Letterbox under Page margin) */
/* the settings panel: a label sits close to its control and a note sits right under the control it explains, while one setting stands clearly apart from the next */
.field+.t-note{margin-top:calc(var(--gap-label) - var(--gap-field))}          /* a note under a field that has its --gap-field below it still sits --gap-label under the control */
.panel .field>.t-note:empty{display:none}
.panel .adv,.panel .adv[open]{margin-bottom:var(--gap-card)}        /* the same 16px above Export video (with its 6px) whether Advanced is open or not */
#creditsAtField:has(~ #creditsEarlyField[hidden]){margin-bottom:0}        /* at Start the two rows after it are closed, so it ends the group */
.field label,.field .lbl{display:flex;justify-content:space-between;gap:var(--gap-card);font-size:var(--type-body);color:var(--muted)}
.field output{color:var(--ink);font-variant-numeric:tabular-nums}
.panel .field>label:not(.check),.panel .field>.lbl{margin-block:var(--cut-t) var(--cut-b)}          /* the video panel's labels are trimmed to their letters, as the PDF Editor's and Audio Editor's are */
.panel .field:has(>.seg)>.t-note,.panel .field:has(>select)>.t-note,.panel .field:has(>.combo)>.t-note{margin-top:calc(var(--gap-label) - var(--gap-head))}
.panel .field:has(>.csel),.panel .field:has(>.seg),.panel .field:has(>select),.panel .field:has(>.combo),.panel .field:has(>.fade-shape){gap:var(--gap-head)}          /* a label over a choice, a menu, or a picture sits --gap-head above it; over a slider it keeps --gap-label */
/* Sliders are drawn by the site instead of the browser, so they look the same whether or not the window is active
   (browsers gray out their own sliders after full screen, or when the window loses focus). --pct is the filled part. */
input[type=range]{-webkit-appearance:none;appearance:none;width:100%;height:var(--slider-h);margin:0;padding:0;background:transparent;cursor:pointer;--pct:50%}
input[type=range]::-webkit-slider-runnable-track{height:var(--track);border-radius:99px;background:linear-gradient(to right,var(--accent) 0,var(--accent) var(--pct),var(--line) var(--pct),var(--line) 100%)}
input[type=range]::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;width:var(--thumb-w);height:var(--thumb);margin-top:calc((var(--track) - var(--thumb)) / 2);border-radius:calc(var(--thumb) / 2);border:0;background:var(--thumb-bg);box-shadow:var(--shadow-thumb)}
input[type=range]::-moz-range-track{height:var(--track);border-radius:99px;background:var(--line)}
input[type=range]::-moz-range-progress{height:var(--track);border-radius:99px;background:var(--accent)}
input[type=range]::-moz-range-thumb{box-sizing:border-box;width:var(--thumb-w);height:var(--thumb);border-radius:calc(var(--thumb) / 2);border:0;background:var(--thumb-bg);box-shadow:var(--shadow-thumb)}
input[type=range]:focus-visible{outline:2px solid var(--accent);outline-offset:4px;border-radius:var(--r-sm)}
select,input[type=text],input[type=number],textarea.autogrow{border-radius:var(--r-ctl);border:1px solid var(--line);background:var(--panel2)}          /* every field you type in or pick from (a menu, a text box, a number box): one corner, one border, one fill, one hover, and one focus ring (below) */
select,input[type=text],textarea.autogrow{width:100%;padding:var(--ctl-py) var(--field-pad-x)}
select{-webkit-appearance:none;appearance:none;padding-right:calc(var(--chev-x) + var(--chev-s) + var(--gap-head));background-image:var(--chev);background-repeat:no-repeat;background-position:right var(--chev-x) center;background-size:var(--chev-s) auto}          /* every menu draws its own chevron, the same distance from the right edge (--chev-x) and the same size (--chev-s), in the muted color of the theme */
input[type=number]{width:var(--num-w);height:var(--h-s);padding:0 var(--field-pad-x);box-sizing:border-box;color:var(--ink);font:inherit;font-variant-numeric:tabular-nums}          /* every number box: one width, one corner (the control corner, as a menu or a button has), one border; its height follows the row it sits in (--h-s by default, --h-l beside a --h-l control) */
textarea.autogrow{display:block;resize:none;overflow:hidden;font:inherit;line-height:round(calc(var(--lh) * 1em),1px);--lh:1.35;min-height:var(--h-m)}
input.bad{border-color:var(--danger)}
/* style row under a credits line: optional font box, then Bold and Italic */
.line-style{display:flex;align-items:center;gap:var(--gap-tight)}
.line-style .combo{flex:1;min-width:0}
.line-style .line-font{height:var(--h-s);padding:0 var(--combo-btn-w) 0 var(--gap-head);font-size:var(--type-body)}          /* the font box is one small control tall (--h-s), and Bold and Italic beside it stretch to match */
.fmt-btn{flex:none;display:grid;place-items:center;width:var(--h-s);height:var(--h-s);padding:0;border:1px solid var(--line);border-radius:var(--r-ctl);background:var(--panel2);color:var(--ink);cursor:pointer;font:inherit;line-height:round(calc(var(--lh) * 1em),1px)}
.fmt-btn:hover{border-color:var(--muted)}
.fmt-btn[aria-pressed="true"]{background:var(--accent-soft);border-color:var(--accent);color:var(--accent)}
.line-row{display:flex;gap:var(--gap-tight);align-items:flex-start}
.line-row>input,.line-row>textarea{flex:1;min-width:0}
.fmt-btn.aa{width:var(--h-l);height:auto;align-self:stretch;font-size:var(--type-body);font-weight:600}
.line-row:has(textarea)>.aa{align-self:flex-start;height:var(--h-l)}
.fmt-btn.aa[data-own]{background:var(--accent-soft);border-color:var(--accent);color:var(--accent)}
.fmt-btn.aa[aria-expanded="true"]{border-color:var(--accent)}
.line-fold{margin-top:calc(-1 * var(--gap-tight));transition:grid-template-rows var(--ae-move) var(--ease-out),margin-top var(--ae-move) var(--ease-out)}
.line-fold.open{margin-top:0}
/* a credits line: its label, box, and note stay together, and a closed font row takes no room at all, so the next setting is the usual 16px away */
.panel .field:has(>.line-row){gap:0}
.panel .field:has(>.line-row)>.line-row{margin-top:var(--gap-label)}
.panel .field:has(>.line-row)>.t-note{margin-top:var(--gap-label)}
.panel .field:has(>.line-row)>.line-fold{margin-top:0}
.panel .field:has(>.line-row)>.line-fold.open{margin-top:var(--gap-label)}
.line-fold>.fa-in{transition:opacity var(--ae-ms) var(--ease-color),padding var(--ae-move) var(--ease-out),overflow 0s allow-discrete}
.line-fold.open>.fa-in{overflow:visible;transition:opacity var(--ae-ms) var(--ease-color),padding var(--ae-move) var(--ease-out),overflow 0s var(--ae-move) allow-discrete}        /* once the row has finished opening, its font list may drop below it; while it opens or closes the row is still clipped */
.line-style .combo-list{width:max-content;min-width:100%;max-width:240px}
.line-style .combo-list li{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
@media (prefers-reduced-motion:reduce){.line-fold>.fa-in{transition:none}}
.combo .ph{position:absolute;left:calc(var(--field-pad-x) + var(--hair));right:calc(var(--combo-btn-w) + var(--gap-tight));top:50%;transform:translateY(-50%);line-height:normal;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;color:var(--muted);pointer-events:none}
.combo .ph b{font-weight:inherit;color:var(--ink)}
.line-font~.ph{left:var(--field-pad-x);font-size:var(--type-body)}
.combo input:not(:placeholder-shown)~.ph{display:none}

/* ----- Segmented radio buttons ----- */
.seg{position:relative;box-sizing:border-box;height:var(--h-m);display:grid;grid-auto-flow:column;grid-auto-columns:1fr;padding:var(--gap-sub);border:1px solid var(--line);border-radius:calc(var(--r-sm) + var(--gap-sub));overflow:hidden;background:var(--panel2)}          /* the button group's shape: a 2px inset, the pill's corner (--r-sm) plus the inset */
.pe .seg{height:var(--h-s)}          /* the PDF Editor's choices are the small control height */
.seg label{position:relative;z-index:1;display:flex;align-items:center;justify-content:center;text-align:center;padding:0 var(--gap-label);border-radius:var(--r-sm);cursor:pointer;font-size:var(--type-body);color:var(--muted)}
.seg input{position:absolute;opacity:0;pointer-events:none}
.seg label:focus-within{outline-offset:0}          /* the focus ring sits in the 2px inset, so the control's edge does not clip it */
.seg input:checked+span{color:var(--ink)}
.seg label:has(input:checked){color:var(--ink)}
.seg label.dim{opacity:var(--inactive)}
.field label.check{min-height:20px;justify-content:flex-start;align-items:center;gap:var(--gap-head);color:var(--ink);cursor:pointer}
.colorrow{display:flex;gap:var(--gap-head);align-items:center}
/* the invert switch has no gap under it while its ink color row is hidden (the hidden row keeps no space) */
.field:has(+ #inkField[hidden]){margin-bottom:0}

/* small heading that splits a group into parts (Shadows: page turn, center fold, under the score) */
.sub>.field:last-child{margin-bottom:0}
/* small notes under a control: tucked to the right and quieter, so they stay out of the way of the labels */
/* font box: type a name, or open the list of popular Google Fonts */
.combo{position:relative}
/* a font lookup runs a thin bar along the box's bottom edge, end to end (it follows the box's rounded corners), so nothing around the box moves */
.combo-bar{position:absolute;inset:0;border-radius:var(--r-ctl);overflow:hidden;pointer-events:none;--sweep-h:2px}
/* the one sweep every bar of unknown length uses (the busy chip, the noise-reduction track, the font box): a band that enters from the left edge, crosses, and leaves past the right, so it always starts and ends off the bar. sweepStart and sweepStop (js/ui-and-export.js) set .sweeping; a stop lets the pass in progress finish, so the band never starts part way or stops short. Only transform moves */
.sweeping::after{content:'';position:absolute;left:0;bottom:0;width:40%;height:var(--sweep-h,100%);border-radius:99px;background:var(--accent);transform:translateX(-100%);animation:bar-sweep 1.3s cubic-bezier(.45,0,.25,1) var(--sweep-delay,0s) infinite;will-change:transform}
@keyframes bar-sweep{from{transform:translateX(-100%)}to{transform:translateX(250%)}}
@media (prefers-reduced-motion:reduce){.sweeping::after{animation:none;transform:none;width:100%;opacity:.5}}
/* the hover preview of the frame Save current frame would save */
.thumb-peek{position:fixed;z-index:60;width:230px;padding:var(--gap-snug);border-radius:var(--r-ctl);background:var(--ink);box-shadow:var(--shadow);line-height:0;pointer-events:none;visibility:hidden;opacity:0;transform:translateY(4px);transition:opacity var(--ae-quick) var(--ease-ui),transform var(--ae-quick) var(--ease-ui),visibility 0s var(--ae-quick)}
.thumb-peek.show{visibility:visible;opacity:1;transform:none;transition-delay:0s}
.thumb-peek canvas{display:block;width:100%;height:auto;border-radius:calc(var(--r-ctl) - var(--gap-snug))}
@media (prefers-reduced-motion:reduce){.thumb-peek{transition:none}}
.combo input[type=text]{padding-right:var(--combo-btn-w)}
.combo-btn{position:absolute;right:var(--hair);top:var(--hair);bottom:var(--hair);width:var(--combo-btn-w);display:grid;place-items:center;padding:0;border:0;border-radius:0 var(--r-sm) var(--r-sm) 0;background:none;color:var(--muted);cursor:pointer}
.combo-btn:hover{color:var(--ink)}
.combo-list{position:absolute;left:0;right:0;top:calc(100% + var(--gap-label));z-index:40;max-height:210px;overflow:auto;margin:0;padding:var(--gap-label);list-style:none;background:var(--panel);border:1px solid var(--line);border-radius:var(--r-ctl);box-shadow:var(--shadow)}
.combo-list li{padding:var(--gap-tight) var(--gap-head);border-radius:var(--r-sm);font-size:var(--type-body);cursor:pointer}
.combo-list li+li{border-top:1px solid var(--line)}
.combo-list li:hover,.combo-list li.act{background:var(--accent-soft)}
.combo-list li[aria-selected="true"]{font-weight:600;color:var(--accent)}
/* small heading that splits a group into parts (Shadows: page turn, center fold, under the score) */
.subhead{margin:0 0 var(--gap-set);font-size:var(--type-body);font-weight:600;color:var(--ink)}
/* Shadows: three parts (Crease, Page turn, Under score) split by hairlines, each row on one line: name, slider, value. The name column is as wide as the longest name (Softness) and the value column as wide as its widest reading, the same in every part */
[data-sum=shadows] .sub:not(.field){display:block}
[data-sum=shadows] .sub>.field{display:grid;grid-template-columns:var(--sh-name) minmax(0,1fr) var(--sh-val);align-items:center;column-gap:var(--gap-head);margin-bottom:var(--gap-set)}
[data-sum=shadows] .sub>.field:last-child,[data-sum=shadows] .sub>.field:not(:has(~ :not([hidden]))):not(:has(~ .t-note:not([hidden]))){margin-bottom:0}
[data-sum=shadows] .sub>.field>label{display:contents}
[data-sum=shadows] .sub>.field>label>output{order:3;text-align:right}
[data-sum=shadows] .sub>.field>input[type=range]{order:2}
#centerFold>.sub,#turnShadowBlock>.sub{padding-bottom:var(--gap-set);margin-bottom:var(--gap-set);border-bottom:1px solid var(--hairline)}
[data-sum=shadows] .sub>.t-note{margin:calc(var(--gap-head) - var(--gap-set)) 0 0}
[data-sum=shadows] .group-head .btn.small{margin:calc((var(--sw-h) - var(--h-s)) / 2) 0 calc((var(--sw-h) - var(--h-s)) / 2) auto}          /* the Reset button never makes the row taller, so nothing moves when it appears */
[data-sum=shadows] .group-head .btn.small:not([hidden])+.group-toggle{margin-left:0}          /* the switch stays at the right edge when Reset is hidden */

/* Video: Advanced */
.adv{margin:0 0 var(--gap-card)}
.adv summary{display:flex;align-items:center;gap:var(--gap-tight);padding:var(--gap-sub) 0;font-size:var(--type-body);color:var(--muted);cursor:pointer;list-style:none}
.adv summary::-webkit-details-marker{display:none}
.adv summary::before{content:'';width:var(--gap-tight);height:var(--gap-tight);border-right:1.6px solid currentColor;border-bottom:1.6px solid currentColor;transform:rotate(-45deg);transition:transform .15s var(--ease-ui)}
.adv[open] summary::before{transform:rotate(45deg)}
.adv summary:hover{color:var(--ink)}
.adv[open] summary{margin-bottom:var(--gap-card)}
@media (prefers-reduced-motion:reduce){.adv summary::before{transition:none}}

/* ----- Checkboxes, info (i) buttons and tooltips ----- */
.check-row{position:relative;display:flex;align-items:center;gap:var(--gap-head)}
.check-row .switch{margin-left:auto}
.field label.check:has(>.switch){flex-direction:row-reverse;justify-content:space-between}

/* ----- On / off switch (used for every toggle on the site) ----- */
input.switch{appearance:none;-webkit-appearance:none;flex:none;position:relative;width:38px;height:var(--sw-h);margin:0;border:0;border-radius:999px;background:var(--line);box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--neutral) 22%,transparent);cursor:pointer;transition:background-color var(--ae-quick) var(--ease-color)}
input.switch::before{content:'';position:absolute;top:var(--gap-sub);left:var(--gap-sub);width:18px;height:18px;border-radius:50%;background:var(--on-dark);box-shadow:var(--shadow-knob)}
input.switch:checked{background:var(--accent);box-shadow:none}
input.switch:checked::before{transform:translateX(16px)}
input.switch:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
@media (prefers-reduced-motion:reduce){input.switch,input.switch::before{transition:none}}
.info-i{position:relative;flex:none;display:grid;place-items:center;width:18px;height:18px;padding:0;border:0;border-radius:50%;background:none;color:var(--muted);cursor:pointer}
.info-i svg{width:18px;height:18px;display:block}
.info-i .ring{fill:none;stroke:currentColor;stroke-width:1.9}
.info-i .dot{fill:none;stroke:currentColor;stroke-width:2.8;stroke-linecap:round}
.info-i .stem{fill:none;stroke:currentColor;stroke-width:2.1;stroke-linecap:round}
.info-i::before{content:"";position:absolute;inset:-3px}          /* a 24px target around the 18px icon */
.info-i:hover,.info-i:focus-visible,.info-i[aria-expanded="true"]{color:var(--accent);background:var(--accent-soft);transform:scale(1.1)}
.info-i:not(:disabled):active{transform:scale(.92);transition-duration:.14s;transition-timing-function:var(--ease-out)}
@media (prefers-reduced-motion:reduce){.info-i:not(:disabled):active{transform:none}}
.tip{position:absolute;left:0;top:calc(100% + var(--gap-tight));width:max-content;max-width:100%;z-index:30;padding:var(--gap-head) var(--gap-set);border-radius:var(--r-ctl);background:var(--ink);color:var(--bg);font-size:var(--type-small);--lh:1.4;box-shadow:var(--shadow);
  visibility:hidden;opacity:0;transform:translateY(4px);transition:opacity var(--ae-quick) var(--ease-ui),transform var(--ae-quick) var(--ease-ui),visibility 0s var(--ae-quick)}
.tip::before{content:'';position:absolute;left:0;right:0;top:calc(-1 * var(--tip-bridge));height:var(--tip-bridge)}      /* a bridge, so the pointer can cross the gap from the (i) */
.info-i:hover+.tip,.info-i:focus-visible+.tip,.tip.open,.tip:hover{visibility:visible;opacity:1;transform:none;transition-delay:0s}
.term{cursor:help;border-bottom:1px dotted currentColor;border-radius:var(--r-paper)}
.term:hover,.term:focus-visible{background:var(--accent-soft);outline:none}

/* ----- Glow highlight, color picker, hints ----- */
#turnField{padding:var(--gap-tight) var(--gap-head);margin:calc(-1 * var(--gap-tight)) calc(-1 * var(--gap-head)) var(--gap-card);border-radius:var(--r-ctl);transition:box-shadow var(--ae-quick) var(--ease-color),background var(--ae-quick) var(--ease-color)}
#turnField.glow-ring{background:var(--accent-soft);box-shadow:0 0 0 2px var(--accent),0 0 18px 4px var(--accent)}
.colorrow[hidden]{display:none}
/* the color field: swatch, name, hex, and chevron in one field that opens a menu of named colors and a picker */
.csel{position:relative}
.csel-field{display:flex;align-items:center;gap:var(--gap-head);box-sizing:border-box;height:var(--h-m);padding:0 var(--chev-x) 0 var(--field-pad-x);border:1px solid var(--line);border-radius:var(--r-ctl);background:var(--panel2)}
.csel-field:hover{border-color:var(--muted)}
.csel-field:focus-within{border-color:var(--accent)}
.csel-open{display:flex;align-items:center;gap:var(--gap-head);flex:1 1 auto;min-width:0;height:100%;padding:0;border:0;background:none;color:var(--ink);font:inherit;text-align:left;cursor:pointer}
.csel-open:focus-visible{outline:none}
.csel-sw{flex:none;width:calc(var(--sw-h) - var(--gap-sub));height:calc(var(--sw-h) - var(--gap-sub));border-radius:var(--r-sm);box-shadow:inset 0 0 0 1px var(--hairline)}
.csel-name{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
.csel .csel-field input.csel-hex{flex:none;width:8ch;height:100%;padding:0;border:0;border-radius:0;background:none;color:var(--muted);font-variant-numeric:tabular-nums;text-align:right;outline:none}
.csel-chev{flex:none;width:var(--chev-s);height:100%;padding:0;border:0;background:var(--chev) no-repeat center / var(--chev-s) auto;cursor:pointer}
.csel-menu{position:absolute;left:0;right:0;top:calc(100% + var(--gap-label));z-index:40;display:grid;gap:var(--gap-head);padding:var(--gap-label);background:var(--panel);border:1px solid var(--line);border-radius:var(--r-ctl);box-shadow:var(--shadow)}
.csel-menu:not([hidden]){animation:rise var(--ae-quick) var(--ease-ui);--rise:-4px}
.csel-list{margin:0;padding:0;list-style:none}
.csel-list li{display:flex;align-items:center;gap:var(--gap-head);padding:var(--gap-tight) var(--gap-head);border-radius:var(--r-sm);font-size:var(--type-body);cursor:pointer;outline:none}
.csel-list li[hidden]{display:none}
.csel-list li:hover,.csel-list li:focus-visible{background:var(--accent-soft)}
.csel-list li[aria-selected="true"]{font-weight:600}
.csel-custom .csel-sw{background:var(--hue-rail)}          /* the Custom row's swatch is the picker's own hue strip */
.csel-code{margin-left:auto;color:var(--muted);font-weight:400;font-variant-numeric:tabular-nums}
.csel-pick{display:grid;gap:var(--gap-head);padding:var(--gap-head) var(--gap-head) var(--gap-label);border-top:1px solid var(--hairline)}
.csel-area{position:relative;height:calc(var(--h-m) * 3);border-radius:var(--r-sm);background-image:linear-gradient(to top,var(--area-black),transparent),linear-gradient(to right,var(--area-white),transparent);touch-action:none;cursor:crosshair}
.csel-hue{position:relative;height:var(--gap-field);border-radius:99px;background:var(--hue-rail);touch-action:none;cursor:pointer}
.csel-area:focus-visible,.csel-hue:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.csel-thumb{position:absolute;top:50%;left:0;width:var(--thumb);height:var(--thumb);box-sizing:border-box;border:2px solid var(--panel2);border-radius:50%;box-shadow:var(--chip-shadow);transform:translate(-50%,-50%);pointer-events:none}
.colorrow input[type=color]{width:var(--swatch-w);height:var(--h-m);padding:0;border:1px solid var(--line);border-radius:var(--r-ctl);background:var(--panel2);cursor:pointer}
.panel .btn.primary{width:100%;padding:var(--gap-card) var(--gap-field);margin-top:var(--gap-tight)}

/* ==================== 7. TIMELINE ==================== */
/* ----- Timeline layout and toolbar ----- */
.timeline{container:tl/inline-size;border-top:1px solid var(--line);background:var(--panel);display:grid;grid-template-rows:auto 1fr;height:var(--tl-h);min-height:0}
.tl-bar{position:relative;display:flex;align-items:center;justify-content:flex-end;gap:var(--gap-card);padding:var(--gap-tight) var(--gap-field);flex-wrap:wrap}
.tl-bar h2{margin:0;font-size:var(--type-value);font-weight:600}
/* the timeline help text lives in an (i) button, like the other info buttons, on every screen size */
.tl-info{display:block;margin-right:auto}
.tl-bar .hint{position:absolute;left:var(--gap-field);top:calc(100% + var(--gap-sub));width:max-content;max-width:min(560px,calc(100% - 2 * var(--gap-field)));z-index:30;flex:none;min-width:0;padding:var(--gap-head) var(--gap-set);border-radius:var(--r-ctl);background:var(--ink);color:var(--bg);font-size:var(--type-small);--lh:1.4;box-shadow:var(--shadow);visibility:hidden;opacity:0;transform:translateY(4px);transition:opacity var(--ae-quick) var(--ease-ui),transform var(--ae-quick) var(--ease-ui),visibility 0s var(--ae-quick)}
.tl-bar .hint::before{content:'';position:absolute;left:0;right:0;top:calc(-1 * var(--hint-bridge));height:var(--hint-bridge)}
.tl-info .info-i:hover+.hint,.tl-info .info-i:focus-visible+.hint,.tl-bar .hint.open,.tl-bar .hint:hover{visibility:visible;opacity:1;transform:none;transition-delay:0s}
.vsep{align-self:center;width:1px;height:20px;margin:0 var(--gap-label);background:var(--line)}
.zoom{display:flex;align-items:center;gap:var(--gap-tight);color:var(--muted);font-size:var(--type-body)}
.zoom input{width:var(--zoom-w)}
.tl-scroll{overflow-x:auto;overflow-y:hidden;position:relative;min-height:0;margin:0 0 0 0}
.tl-inner{position:relative;height:100%}
#tl{position:sticky;left:0;top:0;display:block;touch-action:pan-x}

/* ==================== 8. OVERLAYS, DIALOGS & MESSAGES ==================== */
/* ----- Toast message and drag-and-drop veil ----- */
.toast{position:fixed;left:50%;bottom:var(--toast-bottom,calc(var(--gap-hero) + env(safe-area-inset-bottom,0px)));background:var(--ink);color:var(--bg);padding:var(--gap-card) var(--gap-field);border-radius:var(--r-ctl);box-shadow:var(--shadow);max-width:min(560px,90vw);z-index:50;opacity:0;pointer-events:none}
.toast.show{opacity:1}
.dropveil{position:fixed;inset:0;z-index:40;background:var(--veil);display:flex;align-items:center;justify-content:center;pointer-events:none;opacity:0;visibility:hidden;transition:opacity var(--ae-quick) var(--ease-ui),visibility 0s var(--ae-quick)}
/* the drop card wears the toast's look (same ink, background, padding, radius, shadow, and width), but is its own element */
.drop-card{background:var(--ink);color:var(--bg);padding:var(--gap-card) var(--gap-field);border-radius:var(--r-ctl);box-shadow:var(--shadow);max-width:min(560px,90vw);text-align:center}
body.dragging .dropveil{opacity:1;visibility:visible;transition:opacity var(--ae-quick) var(--ease-ui),visibility 0s}
@media (prefers-reduced-motion:reduce){.dropveil{transition:none}}

/* ----- Dialog overlay ----- */
.exp-overlay{position:fixed;inset:0;z-index:60;background:var(--bg);display:grid;place-items:start center;padding:max(var(--gap-field),env(safe-area-inset-top,0px)) max(var(--gap-field),env(safe-area-inset-right,0px)) max(var(--gap-field),env(safe-area-inset-bottom,0px)) max(var(--gap-field),env(safe-area-inset-left,0px));overflow:auto}
.exp-overlay>.dlg{margin:auto;max-width:100%}      /* auto margins centre a short window and let a tall one start at the top and scroll, so nothing is ever cut off */
.exp-overlay[hidden]{display:none}
.dlg.wide{width:min(780px,94vw)}
#diagLog{width:100%;height:min(46vh,380px);font:12px ui-monospace,SFMono-Regular,Menlo,monospace;line-height:round(1.45em,1px);--lh:1.45;background:var(--panel2);color:var(--ink);border:1px solid var(--line);border-radius:var(--r-ctl);padding:var(--gap-card);resize:none}

/* ----- Dialog box, buttons row, progress bar ----- */
.dlg .row{flex-wrap:wrap}
.dlg{width:min(480px,92vw);border:1px solid var(--line);border-radius:var(--r-lg);background:var(--panel);color:var(--ink);padding:var(--gap-room) var(--gap-room-x);display:grid;gap:var(--gap-field)}
.dlg h2{margin:0;font:500 24px Georgia,serif;line-height:round(1.1em,1px);--lh:1.1}
.dlg p{margin:0;color:var(--muted)}
.bar{height:10px;border-radius:99px;background:var(--panel2);border:1px solid var(--line);overflow:hidden}
.bar i{display:block;height:100%;width:0;background:var(--accent)}
.dlg .row{display:flex;gap:var(--gap-card);justify-content:flex-end}
.dlg .row .push-left{margin-right:auto}

/* ----- Choose pages dialog ----- */
.page-card{position:relative;display:grid;gap:var(--gap-tight);justify-items:center;padding:var(--gap-head) var(--gap-head) var(--gap-tight);border:1px solid var(--line);border-radius:var(--r-card);background:var(--panel2);color:var(--ink);cursor:pointer}
.page-card:hover{border-color:var(--muted)}
.page-card:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.page-card canvas{display:block;width:100%;height:auto;background:var(--on-dark);border:var(--hair) solid var(--paper-edge);border-radius:var(--r-paper)}
.page-card .num{font-size:var(--type-caption);color:var(--muted);font-variant-numeric:tabular-nums}
.page-card .tick{position:absolute;top:var(--gap-set);right:var(--gap-set);display:grid;place-items:center;width:20px;height:20px;border-radius:50%;background:var(--accent);color:var(--accent-ink);box-shadow:var(--shadow-knob)}
.page-card .tick svg{width:12px;height:12px}
.page-card[aria-pressed="true"]{border-color:var(--accent);background:var(--accent-soft)}
.page-card[aria-pressed="false"] canvas{opacity:.4}
.page-card[aria-pressed="false"] .tick{background:var(--panel2);color:transparent;border:1px solid var(--muted)}
.err{color:var(--danger)}
.sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)}

/* ==================== 9. FILE CHIPS & SETTINGS MENU ==================== */
/* ----- File chip icon turns into a remove button on hover ----- */
.chip .chip-icon{position:relative;display:grid;place-items:center;width:18px;height:18px;padding:0;border:0;border-radius:50%;background:none;cursor:pointer;flex:none;color:var(--muted)}
.chip .chip-icon .ic{display:grid;place-items:center}
.chip .chip-icon .ic svg{display:block}
.chip .chip-icon .x{position:absolute;inset:0;display:none;place-items:center;border-radius:50%;background:var(--danger)}
.chip .chip-icon .x svg{width:10px;height:10px;color:var(--on-dark)}
.chip .chip-icon:hover .ic,.chip .chip-icon:focus-visible .ic{opacity:0}
.chip .chip-icon:hover .x,.chip .chip-icon:focus-visible .x{display:grid}
/* the score chip's name opens the page picker */
.chip-main{display:inline-flex;align-items:center;gap:var(--gap-head);min-width:0;padding:0;border:0;background:none;color:inherit;font:inherit;line-height:round(calc(var(--lh) * 1em),1px);cursor:pointer}
.chip:has(.chip-main:hover){border-color:var(--muted)}
.chip-main:focus-visible{outline:2px solid var(--accent);outline-offset:3px;border-radius:var(--r-sm)}

/* ----- Settings dropdown menu ----- */
.menu-wrap{position:relative}
.menu{position:absolute;right:0;top:calc(100% + var(--gap-head));min-width:230px;background:var(--panel2);border:1px solid var(--line);border-radius:var(--r-card);box-shadow:var(--shadow);padding:var(--gap-tight);z-index:80}
.menu-item{display:block;width:100%;text-align:left;padding:var(--field-pad-x) var(--gap-set);border:0;background:none;border-radius:var(--r-ctl);cursor:pointer;color:var(--ink)}
.menu-item:hover,.menu-item:focus-visible{background:var(--accent-soft)}
.menu-item.confirm{color:var(--danger);font-weight:600}

/* ==================== 10. FULL-SCREEN MODE ==================== */
/* ----- Full-screen button ----- */
.stage-strip,.sys-zoom,.sys-bar,.sys-nav{position:absolute;right:var(--fsm);bottom:var(--fsm);z-index:6;display:flex;align-items:center;gap:var(--gap-sub);height:var(--fs);padding:var(--gap-snug);box-sizing:border-box;border-radius:var(--r-card);background:var(--glass-bg);-webkit-backdrop-filter:var(--glass-blur);backdrop-filter:var(--glass-blur);box-shadow:var(--glass-shadow),inset 0 0 0 1px var(--glass-edge),0 0 0 .5px var(--glass-ring)}
.stage-strip[hidden],.sys-zoom[hidden],.sys-bar[hidden],.sys-nav[hidden],.stage-strip button[hidden],.stage-strip .stage-div[hidden]{display:none}
.stage-strip button,.sys-zoom button,.sys-bar button,.sys-nav button{display:grid;place-items:center;width:var(--w-glass);height:100%;padding:0;border:0;border-radius:var(--r-sm);background:none;color:var(--ink);cursor:pointer;transition:background-color var(--ae-quick) var(--ease-color),color var(--ae-quick) var(--ease-color),transform .14s var(--ease-out)}
.stage-strip button:not(:disabled):active,.sys-zoom button:not(:disabled):active,.sys-bar button:not(:disabled):active,.sys-nav button:not(:disabled):active{transform:scale(.97)}
@media (prefers-reduced-motion:reduce){.stage-strip button:not(:disabled):active,.sys-zoom button:not(:disabled):active{transform:none}}
.stage-strip button.txt,.sys-zoom button.txt,.sys-bar button.txt,.sys-nav button.txt{width:auto;padding:0 var(--gap-card);font-size:var(--type-small);font-weight:600}
.stage-strip button:not(:disabled):hover,.sys-zoom button:not(:disabled):hover,.sys-bar button:not(:disabled):hover,.sys-nav button:not(:disabled):hover,.stage-strip button:not(:disabled):focus-visible,.sys-zoom button:not(:disabled):focus-visible,.sys-bar button:not(:disabled):focus-visible,.sys-nav button:not(:disabled):focus-visible{background:var(--accent-soft);color:var(--accent)}
.stage-strip button:disabled,.sys-zoom button:disabled,.sys-bar button:disabled,.sys-nav button:disabled{color:var(--muted);opacity:var(--inactive);cursor:default}
.stage-strip svg,.sys-zoom svg,.sys-bar svg,.sys-nav svg{width:var(--icon-s);height:var(--icon-s)}
.sys-bar button[aria-pressed=true],.stage-strip button[aria-pressed=true],.sys-nav button[aria-pressed=true]{background:var(--accent-soft);color:var(--accent)}
.stage-wrap.sys-stack .sys-bar svg{transform:rotate(90deg)}
/* the preset strip: one vertical glass strip at the top right (the current preset, a divider, Detect this page again); hovering or tapping the preset icon unfolds the four presets sideways from it */
.sys-tools{position:absolute;top:var(--fsm);right:var(--fsm);z-index:6}
.sys-tools[hidden]{display:none}
.sys-tools .sp-col{position:static;flex-direction:column;height:auto;width:auto}
.sys-tools .sp-col button{height:calc(var(--fs) - 2 * var(--gap-snug))}
.sys-tools .sys-bar button{flex:none;width:calc(var(--w-glass) + 2 * var(--gap-sub))}
.sys-tools .sys-bar svg{width:var(--icon-m);height:var(--icon-m)}
.sys-tools .sp-col .stage-div{width:var(--icon-s);height:var(--hair);margin:var(--gap-snug) 0}
.sys-tools .sp-fly{position:absolute;top:0;right:calc(100% + var(--gap-tight));bottom:auto;overflow:hidden;max-width:0;opacity:0;visibility:hidden;pointer-events:none;transition:max-width var(--ae-quick) var(--ease-out),opacity var(--ae-quick) var(--ease-out),visibility 0s var(--ae-quick)}
.sys-tools.open .sp-fly{max-width:160px;opacity:1;visibility:visible;pointer-events:auto;transition-delay:0s}
@media (prefers-reduced-motion:reduce){.sys-tools .sp-fly{transition:none}}
.sys-controls{position:absolute;inset:auto var(--fsm) var(--fsm);z-index:6;display:flex;align-items:center;flex-wrap:wrap;gap:var(--gap-tight);pointer-events:none}
.sys-controls>.sys-nav,.sys-controls>.sys-zoom{position:relative;inset:auto;flex:none;pointer-events:auto}
.sys-controls>.sys-zoom{margin-left:auto}
.sys-sel.tight .sys-nav .seg label{padding:0 var(--gap-tight)}
.sys-sel.tight .sys-zoom button.txt{padding:0 var(--gap-tight)}
.sys-sel.tight .sys-nav,.sys-sel.tight .sys-zoom{gap:var(--hair)}          /* both strips tighten together before they wrap */
.sys-bar[hidden],.sys-nav[hidden]{display:none}
.sys-nav .seg{flex:none;height:calc(var(--fs) - 2 * var(--gap-snug))}
.sys-nav .seg label{display:grid;place-items:center;padding:0 var(--field-pad-x)}
.sys-nav .seg label span{display:grid;place-items:center}
.sys-nav button,.sys-nav .seg{flex:none}
.sys-nav .sys-pg{display:grid;place-items:center;height:100%;padding:0 var(--gap-snug);box-sizing:border-box;--lh:1;font-size:var(--type-small);font-weight:600;white-space:nowrap;color:var(--ink);font-variant-numeric:tabular-nums}          /* the label fills the strip's height and centers its figures between the edges, like the buttons beside it */
.sys-pg>span{grid-area:1/1;text-box:trim-both var(--trim-edge);margin-block:var(--trim-t) var(--trim-b);height:var(--trim-h)}
#selPgMax{visibility:hidden}
.stage-div{flex:none;width:var(--hair);height:var(--icon-s);margin:0 var(--gap-snug);background:var(--line)}
.stage-wrap.zoomed{cursor:grab}.stage-wrap.panning{cursor:grabbing}
.stage-wrap.zoomed{touch-action:none}
@media (prefers-reduced-transparency:reduce){.stage-strip,.sys-zoom,.sys-bar,.sys-nav{-webkit-backdrop-filter:none;backdrop-filter:none;background:var(--panel2)}}
.fs-only{display:none!important}
:root{--tl-h:262px;--tl-gap:var(--gap-tight)}
html.fs-lock,html.fs-lock body{overflow:hidden}

/* ----- Full-screen layout and overlay controls ----- */
.app.fs{position:fixed;inset:0;z-index:90;display:block;height:100vh;height:100dvh;background:var(--black)}
.app.fs .top,.app.fs .panel{display:none!important}
.app.fs .work{display:block;height:100%}
.app.fs .stage-col{display:block;padding:0;height:100%}
.app.fs .stage-wrap{position:absolute;inset:0;border:0;border-radius:0;background:var(--black);padding:var(--fs-top) var(--fs-right) var(--fs-bottom) var(--fs-left)}          /* the picture sits inside the safe area (the status bar, the home indicator, and the side insets) */
/* the header and settings, copied where they were so they can fade as full screen begins (see fsGhosts) */
.fs-ghost,.fs-ghost *{animation:none!important;transition:none!important}
.app.fs{--fs-gap:var(--gap-set);--fs-top:env(safe-area-inset-top,0px);--fs-right:env(safe-area-inset-right,0px);--fs-bottom:env(safe-area-inset-bottom,0px);--fs-left:env(safe-area-inset-left,0px);--fs-edge:calc(var(--fs-gap) + var(--fs-bottom))}
.app.fs .transport{position:absolute;z-index:20}
.app.fs .fs-only{display:inline-flex!important}
.app.fs #btnShowEditor,.app.fs.fs-min #btnHideEditor{display:none!important}
.app.fs.fs-min #btnShowEditor{display:inline-flex!important}
.app.fs.fs-min #bTap,.app.fs.fs-min .info{display:none}
.fs-only svg{width:var(--icon-s);height:var(--icon-s)}
/* the full screen dock button, one look in both editors (the video editor's Hide editor and Show editor, the Audio Editor's Hide tools and Show tools): the action it names and then a chevron, the chevron --icon-s wide and turned over when what it hides is hidden */
.fs-dock{display:inline-flex;flex-direction:row-reverse;align-items:center;gap:var(--gap-tight)}          /* the chevron comes after the words, as on every drop-down */
.fs-dock svg{width:var(--icon-s);height:var(--icon-s);flex:none;transition:transform var(--t-hover) var(--spring-hover)}
.fs-dock[aria-expanded=false] svg{transform:rotate(180deg)}
.app.fs .timeline{position:absolute;left:calc(var(--fs-gap) + var(--fs-left));right:calc(var(--fs-gap) + var(--fs-right));bottom:var(--fs-edge);z-index:20;overflow:hidden;border:1px solid var(--glass-edge);border-radius:var(--r-win);
  background:var(--glass-bg);-webkit-backdrop-filter:var(--glass-blur);backdrop-filter:var(--glass-blur);box-shadow:var(--glass-shadow)}
.app.fs .transport,.app.fs .timeline{opacity:0;pointer-events:none;transition:opacity var(--ae-ms) var(--ease-ui),transform var(--ae-move) var(--ease-out),bottom var(--ae-move) var(--ease-out),visibility 0s}
.app.fs.fs-min .timeline{transform:translateY(calc(100% + var(--fs-edge) + var(--gap-head)));visibility:hidden;transition:opacity var(--ae-ms) var(--ease-ui),transform var(--ae-move) var(--ease-out),visibility 0s var(--ae-ms)}
.app.fs.fs-active .transport,.app.fs.fs-active .timeline{opacity:1;pointer-events:auto}
/* the zoom and full screen strip hovers just above the play bar, and follows it when the timeline grows, shrinks, or is hidden (on a screen too short for the timeline, it stays at the top of the screen instead of leaving it) (--fs-trh is the play bar's height, set by script) */
.app.fs .stage-strip{right:calc(var(--fs-gap) + var(--fs-right));bottom:min(calc(var(--tl-h) + var(--fs-edge) + var(--gap-card) + var(--fs-trh) + var(--gap-head)),calc(100% - var(--fs-top) - var(--fs-gap) - var(--fs)));opacity:0;pointer-events:none;transition:opacity var(--ae-ms) var(--ease-ui),bottom var(--ae-move) var(--ease-out)}
.app.fs.fs-active .stage-strip{opacity:1;pointer-events:auto}
.app.fs.fs-min .stage-strip{bottom:calc(var(--fs-edge) + var(--fs-trh) + var(--gap-head))}
@media (prefers-reduced-motion:reduce){.app.fs .stage-strip{transition:none}}
.app.fs:not(.fs-active),.app.fs:not(.fs-active) *{cursor:none!important}
.app.fs .transport .icon-btn.play{background:var(--accent);border-color:transparent;color:var(--accent-ink)}
.app.fs .transport .tapbtn.on{background:var(--turn);border-color:transparent;color:var(--on-turn)}
@media (prefers-reduced-motion:reduce){.app.fs .transport,.app.fs .timeline{transition:none!important}}

/* ==================== 11. RESPONSIVE (TABLET & PHONE) ==================== */
@media (max-width:760px){
  .top{flex-wrap:wrap}
  .brand{margin-right:auto}
  .title-pill,.title-pill:focus-within{max-width:none}
  .chips{margin-right:0;max-width:100%}   /* on a phone the title and the two chips drop to a second row (the chips stay side by side) so nothing pushes the page sideways */
}
@media (max-width:960px){
  html,body{height:auto;min-height:100%}
  .app{height:auto;min-height:100%;display:flex;flex-direction:column}
}          /* the page itself: a box cannot ask about its own width, so its stacking stays on the screen's */
@container app (max-width:960px){
  .app.fs>*{--fs-gap:var(--gap-head);--fs-edge:calc(var(--fs-gap) + var(--fs-bottom))}          /* the full-screen edge, for everything inside the page */
  .vsep{display:none}
  .app>*,.stage-col,.panel{flex:none}
  .work{display:contents}
  .stage-col{order:1}
  .timeline{order:2}
  .panel{order:3}
  .app.fs .transport .info{display:none}
  .app.fs .timeline{border-radius:var(--r-lg)}
  .app:not(.fs) .stage-wrap{height:min(62vw,420px)}          /* the phone's in-page heights: full screen has its own (the whole screen), so they are scoped out of it here, at their source */
  .app:not(.fs) .stage-wrap.sys-split{height:min(110vw,640px,max(100vh - 125px,320px))}      /* System has the selector and the preview, so the stage gets more height, but never so much that the Play button drops below a short window (125px is the header above the stage and the transport below it) */
  .stage-wrap:has(>.empty:not([hidden])){height:auto;min-height:min(62vw,420px)}      /* the intro sets its own height, so a phone's narrow screen never clips its top or bottom */
  .stage-wrap:has(>.empty:not([hidden]))>#stage{display:none}
  .stage-wrap>.empty:not([hidden]){position:relative;inset:auto;flex:none;width:100%}
  .stage-col{grid-template-rows:auto auto}
  .stage-col{padding:var(--gap-field) var(--gap-field) var(--gap-card)}
  .panel{border-left:0;border-top:1px solid var(--line);padding:var(--gap-card) clamp(var(--gap-field),5vw,var(--panel-side-max)) calc(var(--gap-group) + var(--gap-tight))}
  .panel .group,.panel .status{max-width:560px;margin-left:auto;margin-right:auto}
}
@container app (max-width:760px){.app:not(.fs) .stage-wrap.sys-split{height:min(110vw,640px,max(100vh - 215px,320px))}}      /* the header wraps to two rows here, so the stage has less room */

/* ----- Reduced-motion preferences ----- */
@media (prefers-reduced-motion:reduce){.toast,.bar i{transition:none}}

/* ==================== 12. DIALOG STACKING ORDER & EXPORT PREVIEW ==================== */
.exp-overlay.z-diag{z-index:70}
.exp-overlay.z-pdf{z-index:72}
.exp-overlay.z-audio{z-index:71}
.exp-overlay.z-io{z-index:73}
.exp-overlay.z-warn{z-index:75}
.exp-preview{width:100%;border-radius:var(--r-ctl);background:var(--black);max-height:240px}
.exp-preview:not([hidden]){animation:fade .3s var(--ease-ui)}
@media (prefers-reduced-motion:reduce){.exp-preview:not([hidden]){animation:none}}

/* ==================== 12b. FIRST-RUN STATES & FOLDING GROUPS ==================== */
/* before a score is loaded the settings stay visible but dimmed and unusable */
.panel.locked .group{opacity:.45}
.status{flex-wrap:wrap;padding:var(--gap-card) 0 var(--gap-set);font-size:var(--type-body);color:var(--muted)}
.status .done{color:var(--ink)}
#exportHint:empty{display:none}
/* group headings fold their contents away */
.group-sum{display:none;margin:0;padding-left:var(--gap-set);font-size:var(--type-small);color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.group.collapsed>.group-sum{display:block}
.group.collapsed>h3{margin-bottom:var(--gap-label)}
.group.collapsed .group-head{margin-bottom:var(--gap-label)}
.group.off>.group-sum{display:none}

/* ==================== 13. MOTION ==================== */
/* The motion language borrowed from franklindhansen.com: things rise a few pixels as they fade in (ease-out, about 0.6 to 0.9 s),
   hovers swell with a soft spring, presses squeeze with a small bounce, and state changes take about 0.28 s. */
:root{
  --ease-out:cubic-bezier(.22,1,.36,1);
  --ease-ui:cubic-bezier(.2,.8,.2,1);
  --ease-color:cubic-bezier(.44,0,.56,1);
  --toast-ms:2800ms;   /* how long a short toast stays; JS reads it too (TOAST_MS) */
  --toast-long-ms:5000ms;   /* an error's toast, and the most any toast stays; JS reads it too (TOAST_LONG_MS) */
  --toast-word-ms:120ms;   /* added for each word beyond a short message, up to --toast-long-ms; JS reads it too (TOAST_WORD_MS) */
  --ae-note-ms:3000ms;   /* how long a note on the picture stays (the stop note, the noise graph's "No hum found"); JS reads it too (AE_NOTE_MS) */
  --glass-blur:blur(22px) saturate(1.5);      /* the one blur for every glass element */
  --ae-quick:200ms;   /* a hover or color change, a tip, a toast, a chip */
  --t-hover:300ms;    /* a hover spring plays at its drawn length */
  --glass-off:blur(0px);      /* glass that a state switches off: no blur, but never none. Safari paints an element at half strength for good when it gains a blur while a fade of its own opacity is running, so glass that comes and goes only changes how much it blurs */
  --t-press:400ms;    /* a press spring plays at its drawn length */
  --ae-ms:260ms;      /* the Audio Editor's one fade time: a tool switch, a view switch, a note, a pill; JS reads it too (AE_TOOL_MS) */
  --ae-move:400ms;    /* the Audio Editor's one slide time: a fold, the selection pill, the dock, the waveform resize */
  --ae-lift:10px;     /* how far a pane or view travels as it fades; JS reads it too (AE_LIFT) */
  --ae-lift-sm:4px;   /* the same for a small piece (a pill, a notice) */
  --spring-hover:linear(0, 0.0217, 0.0751, 0.1465, 0.2266, 0.309, 0.3895, 0.4656, 0.5357, 0.5993, 0.656, 0.7062, 0.75, 0.7881, 0.821, 0.8493, 0.8734, 0.8939, 0.9113, 0.9259, 0.9383, 0.9487, 0.9574, 0.9647, 0.9707, 0.9758, 0.98, 0.9835, 1);      /* no bounce, 0.3 s */
  --spring-press:linear(0, 0.0223, 0.0791, 0.1576, 0.2478, 0.3426, 0.4364, 0.5257, 0.608, 0.6821, 0.7471, 0.8032, 0.8507, 0.8901, 0.9223, 0.9481, 0.9682, 0.9836, 0.9951, 1.0033, 1.0089, 1.0124, 1.0144, 1.0151, 1.015, 1.0143, 1.0132, 1.0119, 1);      /* a little bounce, 0.4 s */
}
@keyframes rise{from{opacity:0;transform:translateY(var(--rise,14px))}to{transform:none}}       /* no end opacity: a dimmed element must not flash to full and then drop */
@keyframes fade{from{opacity:0}}

/* buttons: color and border ease, hover swells, press squeezes */
.btn,.icon-btn,.fmt-btn{transition:transform var(--t-hover) var(--spring-hover),background-color var(--ae-quick) var(--ease-color),border-color var(--ae-quick) var(--ease-color),box-shadow var(--ae-quick) var(--ease-ui),color var(--ae-quick) var(--ease-color),opacity var(--ae-quick) var(--ease-color),filter var(--ae-quick) var(--ease-color)}
@media (hover:hover){
  .btn:not(:disabled):hover{transform:scale(1.02);box-shadow:var(--hover-shadow);background-color:color-mix(in srgb,var(--ink) 5%,var(--panel2))}
  .btn.primary:not(:disabled):hover{background-color:var(--accent)}
  .icon-btn:not(:disabled):hover{transform:scale(1.05);box-shadow:var(--hover-shadow)}
  .panel .btn.primary:not(:disabled):hover{transform:scale(1.01)}
  .fmt-btn:hover{transform:scale(1.04)}
}
.btn:not(:disabled):active,.icon-btn:not(:disabled):active,.fmt-btn:active{transform:scale(.97);transition-duration:.14s;transition-timing-function:var(--ease-out);box-shadow:none}
.seg label{transition:background-color var(--ae-quick) var(--ease-color),color var(--ae-quick) var(--ease-color),opacity var(--ae-quick) var(--ease-color),transform .14s var(--ease-out)}
.seg label:active{transform:scale(.97)}
@media (prefers-reduced-motion:reduce){.seg label:active{transform:none}}
select:hover,input[type=text]:hover,textarea.autogrow:hover,input[type=number]:hover{border-color:var(--muted)}
select:focus-visible,input[type=text]:focus-visible,input[type=number]:focus-visible,textarea.autogrow:focus-visible{border-color:var(--accent);outline:1px solid var(--accent);outline-offset:0}          /* one ring, not a border and a ring side by side */
.chip,.page-card{transition:border-color var(--ae-quick) var(--ease-color),background-color var(--ae-quick) var(--ease-color),transform var(--t-hover) var(--spring-hover)}
@media (hover:hover){.page-card:hover{transform:scale(1.02)}}
.page-card:active{transform:scale(.97);transition-duration:.14s;transition-timing-function:var(--ease-out)}
.menu-item{transition:background-color var(--ae-quick) var(--ease-color)}
input[type=range]::-webkit-slider-thumb{transition:transform var(--t-hover) var(--spring-hover)}
input[type=range]::-moz-range-thumb{transition:transform var(--t-hover) var(--spring-hover)}
input[type=range]:hover::-webkit-slider-thumb{transform:scale(1.06)}
input[type=range]:active::-webkit-slider-thumb{transform:scale(1.05)}
input[type=range]:hover::-moz-range-thumb{transform:scale(1.06)}
.panel .group{transition:opacity var(--ae-ms) var(--ease-ui)}

/* the PDF chip opens the page chooser: the page count is underlined, and "Choose pages" slides out on hover */
.chip:has(.chip-main:hover){background-color:color-mix(in srgb,var(--accent) 7%,var(--panel2))}
/* pop-ups fade and drift in */
.exp-overlay:not([hidden]){animation:fade var(--ae-ms) var(--ease-ui)}
.exp-overlay:not([hidden]) .dlg{animation:rise var(--ae-ms) var(--ease-out);--rise:12px}
.menu:not([hidden]){--rise:-6px}
.combo-list:not([hidden]){animation:rise .2s var(--ease-ui);--rise:-4px}
.group-sum{animation:fade .3s var(--ease-ui)}

/* the page comes in: each part rises a little, one after another (only when the page first loads, or the intro text returns) */
@media (prefers-reduced-motion:no-preference){
  .top{animation:rise .7s var(--ease-out) backwards;--rise:10px}
  .stage-col{animation:rise .9s var(--ease-out) .06s backwards;--rise:18px}
  .timeline{animation:rise .8s var(--ease-out) .2s backwards;--rise:14px}
  .panel>*{animation:rise .7s var(--ease-out) backwards;--rise:12px}
  .panel>:nth-child(1){animation-delay:.14s}.panel>:nth-child(2){animation-delay:.19s}.panel>:nth-child(3){animation-delay:.24s}
  .panel>:nth-child(4){animation-delay:.29s}.panel>:nth-child(5){animation-delay:.34s}.panel>:nth-child(6){animation-delay:.39s}.panel>:nth-child(7){animation-delay:.44s}.panel>:nth-child(8){animation-delay:.49s}
  .empty-fit>*{animation:rise .9s var(--ease-out) backwards;--rise:18px}
  .empty-fit>:nth-child(2){animation-duration:.6s;animation-delay:.1s;--rise:12px}
  .empty-fit>:nth-child(3){animation-duration:.6s;animation-delay:.2s;--rise:12px}
  .empty-fit>:nth-child(4){animation-duration:.6s;animation-delay:.3s;--rise:12px}
}
@media (prefers-reduced-motion:reduce){
  *,*::before,*::after{animation-duration:.001s!important;animation-delay:0s!important;transition-duration:.001s!important}
}

/* ==================== 14. HEADINGS, STATUS & SMOOTH STATES ==================== */
/* group headings are real buttons (so the keyboard can reach them); a switched-off group cannot be folded */
.fold-btn{display:flex;align-items:center;gap:var(--gap-head);padding:0;border:0;background:none;color:inherit;font:inherit;line-height:round(calc(var(--lh) * 1em),1px);cursor:pointer;text-align:left}
.fold-chev::before{content:'';flex:none;align-self:center;width:6px;height:6px;border-right:1.6px solid var(--muted);border-bottom:1.6px solid var(--muted);transform:rotate(45deg) translate(-1px,-1px);transition:transform var(--t-hover) var(--spring-hover),opacity var(--ae-ms) var(--ease-color),border-color var(--ae-quick) var(--ease-color)}          /* the fold chevron: the panel headings and both editors' tool bars share this one (down when open, right when closed; the turn is instant with reduced motion, below) */
.fold-chev[aria-expanded=false]::before{transform:rotate(-45deg)}
.fold-chev:hover::before{border-color:var(--ink)}
.fold-btn:focus-visible{outline:2px solid var(--accent);outline-offset:3px;border-radius:var(--r-paper)}
.group.off .fold-btn{cursor:default}
.group.off .fold-chev::before{opacity:0}
/* the parts of a group keep their margins inside, so opening and closing never shifts anything at the start or the end */
.group-body,.sub:not(.field):not(.colorrow):not(.line-style),#turnShadowBlock,details.adv{display:flow-root}
.group>.group-head,.group>h3{transition:margin-bottom var(--ae-move) var(--ease-out)}
/* the loading status */
.st{display:inline-flex;align-items:center;gap:var(--gap-head);transition:color var(--ae-quick) var(--ease-color)}
.st-ic{width:15px;height:15px;flex:none;overflow:visible}
.st-c{fill:transparent;stroke:currentColor;stroke-width:2.2;transition:fill var(--ae-quick) var(--ease-color),stroke var(--ae-quick) var(--ease-color)}
.st-k{fill:none;stroke:var(--accent-ink);stroke-width:2.4;stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:12;stroke-dashoffset:12;transition:stroke-dashoffset .45s var(--ease-out) .12s}
.st.done .st-c{fill:var(--accent);stroke:var(--accent)}
.st.done .st-k{stroke-dashoffset:0}
.st.done{color:var(--ink)}
.st.done .st-ic{animation:pop .5s var(--spring-press)}
@keyframes pop{from{transform:scale(.55)}to{transform:scale(1)}}
/* nothing in the timeline can be touched until there is a score */
.timeline .tl-scroll{transition:opacity var(--ae-ms) var(--ease-ui)}
.timeline.locked .tl-scroll{pointer-events:none;opacity:.5}
/* when a score arrives the parts wake up one after another, and the intro text and stage trade places */
.panel:not(.locked)>.group{transition-delay:calc(var(--gi,0) * .07s)}
.panel>.group:nth-child(2){--gi:0}.panel>.group:nth-child(3){--gi:1}.panel>.group:nth-child(4){--gi:2}.panel>.group:nth-child(5){--gi:3}.panel>.group:nth-child(6){--gi:4}.panel>.group:nth-child(7){--gi:5}.panel>.group:nth-child(8){--gi:6}
#stage.in{animation:fade .8s var(--ease-ui)}
.top .btn:not([hidden]){animation:rise .55s var(--ease-out) backwards;--rise:6px}
/* settings menu: keyboard shortcuts */
.keys{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:var(--gap-tight) var(--gap-field);padding:var(--gap-card) var(--gap-set);border-radius:var(--r-card);font-size:var(--type-small);align-items:center}
.keys[hidden]{display:none}
.keys dt{min-width:0}          /* a long action wraps; the keys beside it never do */
.keys dd{margin:0;color:var(--muted);white-space:nowrap;justify-self:end;text-align:right}

/* the segmented control's glider */
.seg-pill{position:absolute;top:var(--gap-sub);bottom:var(--gap-sub);left:0;width:0;border-radius:var(--r-sm);opacity:0;background:var(--accent-soft);pointer-events:none;transition:transform var(--t-press) var(--spring-press),width var(--ae-move) var(--spring-press),opacity var(--ae-quick) var(--ease-color)}
/* a choice that has a value to type (Watermark's Custom direction, Re-size's Custom size): opt-in with .cu on the option. Its word and its blank share one cell; as the pill arrives the word rises out and the blank rises in, on the pill's own timing, and the cell never changes width */
.cu{overflow:hidden}
.cu-in{display:grid;place-items:center;min-width:0}
.cu-word,.cu-field{grid-area:1/1;transition:transform var(--t-press) var(--spring-press),opacity var(--ae-quick) var(--ease-color)}
.cu-field{display:inline-flex;align-items:baseline;gap:var(--gap-sub);color:var(--ink);opacity:0;transform:translateY(60%);pointer-events:none}
.cu.open .cu-word{opacity:0;transform:translateY(-60%)}
.cu.open .cu-field{opacity:1;transform:none;pointer-events:auto}
.cu-field input{position:static;opacity:1;pointer-events:auto;box-sizing:content-box;width:var(--cu-w);height:auto;min-height:0;margin:0;padding:0;border:0;border-bottom:var(--hair) solid var(--hairline);border-radius:0;background:transparent;box-shadow:none;outline:none;text-align:end;color:inherit;font:inherit;line-height:round(1em,1px);font-variant-numeric:tabular-nums}
@supports (field-sizing:content){.cu-field input{field-sizing:content;width:auto;min-width:var(--cu-w-min)}}          /* the blank is as wide as what is typed in it, never less than two digits, where the browser can size a field to its text; elsewhere it holds the most a value needs */
.cu-field input:focus,.cu-field input:focus-visible{outline:none;border-color:var(--line);border-bottom-color:var(--accent)}          /* where you type: the hairline under the digits turns to the accent, no box and no ring */
.cu-unit{color:var(--muted)}
.cu:has(.cu-field input:focus){outline:none}          /* typing shows the accent hairline instead of the option's focus ring */
@media (prefers-reduced-motion:reduce){.cu-word,.cu-field,.cu.open .cu-word{transform:none}}
/* full screen button: the corners swell for a moment, then settle a touch larger */
/* one full screen glyph in both editors (the video picture's strip and the Audio Editor's bar): the same outline (no fill), stroke (--fs-stroke), and swell; the hover is the shared glass hover */
:root{--fs-stroke:2.2}
.fs-btn svg,.ae-fullbtn svg{fill:none;width:var(--icon-s);height:var(--icon-s);stroke-width:var(--fs-stroke);transition:transform var(--t-hover) var(--spring-hover)}          /* fill:none: the generic icon button fills its glyph, which turned the corners into solid blobs */
.fs-btn:hover svg,.fs-btn:focus-visible svg,.ae-fullbtn:not(:disabled):hover svg,.ae-fullbtn:focus-visible svg{animation:fsCorners 1.1s var(--ease-out) forwards}
@keyframes fsCorners{0%{transform:scale(1)}45%{transform:scale(1.16)}100%{transform:scale(1.08)}}

/* a disabled slider (the timeline zoom before there is a score) looks switched off, not just still */
input[type=range]:disabled{opacity:var(--inactive);cursor:not-allowed}
input[type=range]:disabled::-webkit-slider-thumb{transform:none}

.panel .btn.wide{width:100%;margin-top:var(--gap-card)}

/* ==================== 15. EDITORS (Audio Editor, PDF Editor) ==================== */
.dlg.editor{width:min(900px,94vw);gap:var(--gap-field)}      /* wide enough for five pages per row beside the tools */
.ed-head{display:flex;align-items:center;gap:var(--gap-card)}
.ed-head .t-block{flex:1;min-width:min-content}          /* never narrower than its title, so on a phone the buttons wrap below it instead of covering it */
.ed-tools{display:flex;gap:var(--gap-tight);margin-left:auto}          /* when the buttons wrap under the title they sit at the right, in both editors */
.ae-wave{position:relative}
.ae-wave canvas{display:block;width:100%;height:100%;touch-action:none}
.ae-bar{display:flex;align-items:center;gap:var(--gap-set)}
.ae-times{display:flex;flex-wrap:wrap;color:var(--muted);font-variant-numeric:tabular-nums}
.ae-times b{color:var(--ink);font-weight:600}

/* ----- PDF Editor ----- */

.t-note.warn,.lv-tip-warn{color:var(--turn-ink)}          /* a note is the same size and weight whatever it says; only its color says the result is not what was asked for (a target that could not be reached) */

/* ==================== 16. FILE CHIPS (a steady size) ==================== */
/* the name is cut with an ellipsis, and on hover the small text (page count or length) trades places with the action, in the same space,
   so a chip never changes size and can never run into the buttons beside it */
.chip{max-width:var(--chip-max)}
.chip-main .chip-label{display:flex;align-items:center;gap:var(--gap-head);min-width:0;overflow:visible}          /* the name and the format are each centered on the chip's middle line by their capitals, as every label on the site is */
.chip-main .chip-name{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.chip-main .chip-meta{flex:none;font-size:var(--type-axis);letter-spacing:.04em;font-variant-numeric:tabular-nums;color:var(--muted)}          /* one quiet fact after the name: the score's page count or the sound's format */
.chip-main:hover .chip-meta,.chip-main:focus-visible .chip-meta{color:var(--ink)}
@supports (text-box:trim-both cap alphabetic){.chip-main :is(.chip-name,.chip-meta){text-box:trim-both var(--trim-edge);padding-block:var(--gap-label)}}          /* the name and the format are trimmed to their capitals, so their middle is the glyphs' middle (the row centers them), as everywhere else, with room above and below so a descender or an ellipsis box never clips; Firefox does not trim yet and sits up to a pixel low */
.chip-main .chip-dot{flex:none;align-self:center;transform:translateY(var(--chip-dot-drop));width:var(--chip-dot);height:var(--chip-dot);margin-right:calc(-1 * (var(--gap-label) + var(--gap-sub)));border-radius:50%;background:var(--muted);transition:background-color var(--ae-quick) var(--ease-color)}          /* edited: a small dot in the glyph's own grey, just left of the editor glyph (the glyph's own room is the gap) */
.chip-main:hover .chip-dot,.chip-main:focus-visible .chip-dot{background:var(--ink)}
.chip-main .pp-box{display:inline-grid;align-items:center;justify-items:start;overflow:visible}

/* ----- Editor polish: titles with a first-open line, header rows with a toggle, steady PDF Editor size, watermark mode ----- */
.exp-overlay{overscroll-behavior:contain}
/* (the page behind a window is kept still by a wheel guard in the script, so the page's own scrollbar never has to appear or disappear) */


/* ----- PDF Editor side panels: Pages and Tools slide over to the Watermark tool and back ----- */

.ed-lead.quip{color:var(--accent);font-style:italic}
.ed-lead{transition:color var(--ae-quick) var(--ease-ui)}

/* ----- Editor tidy-ups: room for focus rings, grid footer, gain ----- */

.ae-bar .push-right{margin-left:auto}
#aeGainField{transition:opacity var(--ae-ms) var(--ease-ui)}
#aeGainField.dim{opacity:var(--inactive)}
/* Normalize grays the Gain slider (a one-off: no shared disabled style dims a slider track and leaves its thumb readable): its card dims (.55) and the slider dims (.4), which stacks to about 22% and hides the track. Here the slider is not dimmed as a whole: the track and fill carry their own greyed colors (ink and accent, derived, so both themes hold), and the thumb takes the .4 */
#aeGain:disabled{opacity:1}
#aeGain:disabled::-webkit-slider-thumb{opacity:1}
#aeGain:disabled::-webkit-slider-runnable-track{background:linear-gradient(to right,color-mix(in srgb,var(--ink) 33%,transparent) 0,color-mix(in srgb,var(--ink) 33%,transparent) var(--lo,50%),color-mix(in srgb,var(--accent) 55%,transparent) var(--lo,50%),color-mix(in srgb,var(--accent) 55%,transparent) var(--hi,50%),color-mix(in srgb,var(--ink) 33%,transparent) var(--hi,50%),color-mix(in srgb,var(--ink) 33%,transparent) 100%)}
.ed-head{flex-wrap:wrap}
.ed-head h2{white-space:nowrap}
.ed-head h2{--hc:.715;--ha:.74;--hd:.26;          /* the title's own font (Newsreader): cap height, ascent, and descent as fractions of its size, so it can be trimmed to its letters like the labels */
  --hm-t:calc(-1 * (round(down, calc((1lh - round(var(--ha) * 1em, 1px) - round(var(--hd) * 1em, 1px)) / 2), 1px) + round(var(--ha) * 1em, 1px) - round(var(--hc) * 1em, 1px)));
  --hm-b:calc(-1 * (1lh - round(down, calc((1lh - round(var(--ha) * 1em, 1px) - round(var(--hd) * 1em, 1px)) / 2), 1px) - round(var(--ha) * 1em, 1px)));
  --hm-h:auto}
@supports (text-box:trim-both cap alphabetic){.ed-head h2{--hm-t:0px;--hm-b:0px;--hm-h:round(var(--hc) * 1em, 1px)}}
@container pedlg (max-width:488px){#pdfDlg .ed-head h2{text-box:trim-both cap alphabetic;margin-block:var(--hm-t) var(--hm-b);height:var(--hm-h)}}          /* with its line gone, the title stands alone across from Undo, Redo, History, and Reset, so it is centered by its letters, as in the Audio Editor */
@container aedlg (max-width:488px){#audioDlg .ed-head h2{text-box:trim-both cap alphabetic;margin-block:var(--hm-t) var(--hm-b);height:var(--hm-h)}}
.adv *{box-sizing:border-box}
details.adv::details-content{box-sizing:border-box}        /* two rules, since a browser that does not know ::details-content would drop a combined one */

/* ----- Polish: loading chips, editor open and close, tactile pages, audio hint, watermark row ----- */
.chip.busy{color:var(--ink);animation:breathe 1.6s var(--ease-ui) infinite alternate}
@keyframes breathe{from{border-color:var(--line)}to{border-color:var(--accent)}}
.chip .chip-icon.plain{cursor:default}
.chip .chip-icon .spin{width:15px;height:15px;color:var(--accent);animation:spin .9s linear infinite}
@keyframes spin{to{transform:rotate(360deg)}}
.chip-main.plain{cursor:default}
.chip.settle .chip-icon .ic,.chip.settle .pp-box{animation:settle .6s var(--ease-out) backwards}
@keyframes settle{from{opacity:0;transform:translateY(5px) scale(.9)}}
.exp-overlay:not([hidden]):not(.closing){animation:fade var(--ae-ms) var(--ease-ui)}
.exp-overlay.closing{opacity:0;transition:opacity calc(var(--ae-ms) * .55) var(--ease-ui)}
.exp-overlay.closing .dlg{transform:translateY(10px) scale(.985);transition:transform calc(var(--ae-ms) * .55) var(--ease-ui)}
.norm-to{display:inline-block;opacity:0;transform:translateX(-10px);transition:opacity var(--ae-ms) var(--ease-out) .08s,transform var(--ae-move) var(--ease-out) .08s}
.norm-to.on{opacity:1;transform:none}
.norm-arrow{vertical-align:-3.5px;color:var(--ink);margin:0 var(--gap-tight);flex:none}
.norm-arrow path{fill:none;stroke:currentColor;stroke-width:2.6;stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:1;stroke-dashoffset:1;transition:stroke-dashoffset .6s var(--ease-out) .12s}
.norm-to.on .norm-arrow path{stroke-dashoffset:0}
.norm-to b{color:var(--ink);font-weight:600}
@media (prefers-reduced-motion:reduce){.chip.busy,.chip .spin{animation:none}.norm-to,.norm-arrow path{transition:none}}

/* ----- Tactile touches: the settings gear turns, the menu grows from its corner, toasts rise ----- */
#btnSettings svg{transition:transform var(--ae-move) var(--ease-out)}
@media (hover:hover){#btnSettings:hover svg{transform:rotate(30deg)}}
#btnSettings[aria-expanded="true"] svg{transform:rotate(90deg)}
.menu:not([hidden]){animation:menu-in var(--ae-quick) var(--ease-out);transform-origin:calc(100% - 18px) -26px}          /* grows from the button's center (script sets the exact point when it opens) */
@keyframes menu-in{from{opacity:0;transform:scale(.85)}}
.toast{transform:translate(-50%,10px);transition:opacity var(--ae-quick) var(--ease-ui),transform var(--ae-quick) var(--ease-ui)}
.toast.show{transform:translate(-50%,0);transition:opacity var(--ae-ms) var(--ease-ui),transform var(--ae-move) var(--ease-out)}
@media (prefers-reduced-motion:reduce){#btnSettings svg,.toast{transition:none}.menu:not([hidden]){animation:none}}

/* ----- Premium, tactile finishing touches ----- */
::selection{background:var(--accent-soft);color:var(--ink)}
/* a switch's knob stretches under your finger, then springs back */
input.switch::before{transition:transform var(--t-press) var(--spring-press),width var(--ae-quick) var(--ease-out)}
input.switch:not(:disabled):active::before{width:23px}
input.switch:checked:not(:disabled):active::before{transform:translateX(11px)}
/* the main buttons catch a little light along their top edge and sink when pressed */
.btn.primary{box-shadow:var(--shadow-primary)}
.btn.primary:not(:disabled):hover{box-shadow:var(--shadow-primary-hover)}
.btn.primary:not(:disabled):active{box-shadow:var(--shadow-primary-press)}
.btn.primary:disabled{box-shadow:none}
/* chips and cards lift a hair on hover */
@media (hover:hover){.chip:not(.busy):hover{transform:translateY(-1px)}}
.chip{transition:border-color var(--ae-quick) var(--ease-color),background-color var(--ae-quick) var(--ease-color),transform var(--t-hover) var(--spring-hover),box-shadow var(--ae-quick) var(--ease-ui)}
.chip:not(.busy):hover{box-shadow:var(--shadow-chip-hover)}
.info-i{transition:color var(--ae-quick) var(--ease-color),transform var(--t-hover) var(--spring-hover)}
@media (hover:hover){.info-i:hover{transform:scale(1.15)}}
/* dialogs sit on layered shadows, so they feel like they float */
.dlg{box-shadow:var(--shadow-dlg)}
/* thin, quiet scrollbars: on every scrolling area (windows, lists, the panel, the timeline), so none shows the browser's thick default */
*{scrollbar-width:thin;scrollbar-color:color-mix(in srgb,var(--muted) 45%,transparent) transparent}
::-webkit-scrollbar{width:8px;height:8px}
::-webkit-scrollbar-thumb{background:color-mix(in srgb,var(--muted) 40%,transparent);border-radius:var(--r-ctl);border:2px solid transparent;background-clip:content-box}
::-webkit-scrollbar-thumb:hover{background:color-mix(in srgb,var(--muted) 65%,transparent);background-clip:content-box}
@media (prefers-reduced-motion:reduce){input.switch::before{transition:none}.chip:hover{transform:none}}

/* ----- Header: the file controls stop where the settings panel begins; whole-pixel heights keep the canvases from shifting on hover ----- */
@media (min-width:961px){
  .top{display:grid;grid-template-columns:minmax(0,1fr) 322px;gap:0;padding:0;box-sizing:border-box;height:57px;flex-wrap:nowrap}
  .top-main{display:flex;align-items:center;gap:var(--gap-set);padding:0 var(--gap-field);min-width:0}
  .top>.menu-wrap{display:flex;align-items:center;justify-content:flex-end;padding:0 var(--gap-field);border-left:1px solid var(--line);margin-left:0}
}
@media (max-width:960px){
  .top-main{display:contents}
}
.tl-bar{min-height:calc(var(--h-xs) + var(--gap-head));padding-top:0;padding-bottom:0;box-sizing:border-box}

/* the page never grows a scrollbar while the entrance animations run (the timeline rises from 14px below) */
.app{overflow:clip}

/* the wordmark's ink lines up with the video preview's edge and sits centered in the bar */
@media (min-width:961px){.brand h1{position:relative;top:var(--brand-nudge-y)}}

/* ----- PDF Editor side views: Pages and Tools, Watermark and Resize glide over one another ----- */

.keys{margin:0;background:var(--panel2)}
.dlg .keys{margin:0}

.ae-export{display:flex;align-items:center;gap:var(--gap-head);min-width:0}
.ae-export select{width:auto;max-width:210px;font-size:var(--type-body)}
@container aedlg (max-width:488px){.ae-export{flex-wrap:wrap}}
.pe .row .btn svg,.editor .row .btn svg{width:16px;height:16px;flex:none}

/* ----- How it works, and a steady scrollbar ----- */
.dlg.how{max-height:calc(100vh - 32px);max-height:calc(100dvh - 32px);overflow:hidden;grid-template-rows:auto minmax(0,1fr) auto}
.how-lead{font-size:var(--type-value);color:var(--ink)}
.how-body{display:grid;gap:var(--gap-field);align-content:start;overflow:auto;scrollbar-gutter:stable;padding-right:var(--gap-tight);min-height:0}
.how-body h3{margin:0 0 var(--gap-snug);font-size:var(--type-body);font-weight:600}
.how-body p{font-size:var(--type-body);--lh:1.5}

/* ----- Phones and small tablets only (the desktop layout above is untouched) ----- */
@media (max-width:960px){
  .top>.menu-wrap{order:2}
  .top>.btn{order:1}
}
@media (max-width:760px){
  /* header: the name on the left and the buttons on the right, then the title on a row of its own, then the file chips */
  .top{align-items:center;row-gap:var(--gap-card);padding:var(--gap-card) var(--gap-field) var(--gap-set)}
  .title-pill,.title-pill:focus-within{flex:1 1 100%;order:5}
  .chips{flex:1 1 100%;order:6}
}
/* timeline bar: by the timeline's own width. A clean two-row grid instead of buttons wrapping wherever they land */
@container tl (max-width:800px){
  .tl-bar{display:grid;grid-template-columns:auto auto 1fr auto;grid-template-areas:"ttl inf . his" "trn trn trn zm";align-items:center;gap:var(--gap-head);padding:var(--gap-head) var(--gap-field);min-height:0}
  .tl-bar h2{grid-area:ttl}
  .tl-bar .tl-info{grid-area:inf;margin:0}
  .tl-bar .hist-wrap{grid-area:his}
  .tl-bar .tl-turns{grid-area:trn;justify-self:start}
  .tl-bar .zoom{grid-area:zm;justify-self:end}
}
@container tl (max-width:520px){          /* the zoom group is wider than the old slider, so from here it takes the top row with the title and the history buttons drop to the turn tools' row */
  .tl-bar{grid-template-columns:auto auto minmax(0,1fr) auto;grid-template-areas:"ttl inf . zm" "trn trn trn his"}
  .tl-bar .hist-wrap{justify-self:end}
  .tl-bar .zoom{min-width:0}
  .tl-bar .hist-wrap .hw{display:none}
  .tl-bar .hist-wrap .hi{display:block;width:var(--icon-m);height:var(--icon-m)}
  .tl-bar .hist-wrap>.btn{padding:0 var(--gap-tight)}
}
/* phones: the timeline bar in two rows (turn tools left, history icons right), and one transport row */
@container tl (max-width:426px){
  .tl-bar{display:grid;grid-template-columns:auto auto minmax(0,1fr) auto;grid-template-areas:"ttl inf . zm" "trn trn trn his";align-items:center;gap:var(--gap-head);padding:var(--gap-head) var(--gap-field);min-height:0}
  .tl-bar h2{grid-area:ttl}
  .tl-bar .tl-info{grid-area:inf;margin:0}
  .tl-bar .hist-wrap{grid-area:his;justify-self:end}
  .tl-bar .tl-turns{grid-area:trn;justify-self:start}
  .tl-bar .zoom{grid-area:zm;justify-self:end;min-width:0}
  .tl-bar .zoom input{width:clamp(var(--zoom-min),calc(100vw - var(--zoom-off)),var(--zoom-w))}
  .tl-bar .hist.up{left:auto;right:0}
  .tl-bar .tl-turns>.btn{padding:0 var(--gap-label)}
}
@container stagecol (max-width:478px){
  #spreadInfo{display:none}
  .transport{flex-wrap:nowrap}
  .transport .time{min-width:0;margin:0 var(--gap-label) 0 var(--gap-head);white-space:nowrap}
  .transport .spacer{display:none}
  #bTap{margin-left:auto}
  #bTap kbd{display:none}
}
@container stagecol (max-width:612px){          /* full screen: the row also carries the Hide editor button, so it gives way sooner than the page's own */
  .app.fs #spreadInfo{display:none}
  .app.fs .transport{flex-wrap:nowrap}
  .app.fs .transport .time{min-width:0;margin:0 var(--gap-label) 0 var(--gap-head);white-space:nowrap}
  .app.fs .transport .spacer{display:none}
  .app.fs #bTap{margin-left:auto}
  .app.fs #bTap kbd{display:none}
}
@container stagecol (max-width:396px){          /* and in full screen Add page turn is only its icon sooner */
  .app.fs #bTap{padding:0;min-width:var(--h-l);min-height:var(--h-l)}
  .app.fs #bTap .tw{display:none}
}
@container tl (max-width:360px){
  .tl-bar{grid-template-columns:auto auto minmax(0,1fr) auto;grid-template-areas:"ttl inf . his" "trn trn trn trn" "zm zm zm zm"}          /* three rows: the title and history icons, the turn tools, the zoom. One row for all of them overlapped the title and its (i) at 300px */
  .tl-bar .zoom input{width:clamp(var(--zoom-min),calc(100vw - var(--zoom-off)),var(--zoom-w))}
  .tl-bar .hist-wrap>.btn{padding:0 var(--gap-tight)}
  .tl-bar .tl-turns{justify-self:stretch;display:flex}
  .tl-bar .tl-turns>.btn{flex:1 1 auto}
}
@container stagecol (max-width:340px){
  #bTap{padding:0;min-width:var(--h-l);min-height:var(--h-l)}
  #bTap .tw{display:none}
}
/* touch screens: 16px text in fields stops iPhones zooming the page in when you tap one */
@media (hover:none) and (pointer:coarse){
  input[type=text],input[type=number],select,textarea,.title-pill input,.line-font{font-size:var(--type-touch)}
}

/* phones: the editor's side panel shows only the view in use (the others would leave a tall empty gap) */

/* ----- Logo (SVG wordmark; takes the text color so it flips with light/dark) ----- */
.logo{display:block;height:100%;width:auto;fill:currentColor;overflow:visible}
.brand h1{height:22px;margin:0 0 0 var(--brand-nudge-x);font-size:0;line-height:0;align-self:center;position:static;top:auto}
.brand h1 .home{display:block;height:100%}
.empty h1.empty-logo{align-self:center;height:clamp(36px,5vw,56px);margin:0 0 var(--gap-label);font-size:0;line-height:0;white-space:normal}
@media (max-width:520px){.brand h1{height:19px}}
/* the timeline title and its info button dim along with the rest until there is a score */
.tl-bar h2,.tl-info{transition:opacity var(--ae-ms) var(--ease-ui)}
.timeline.locked .tl-bar h2,.timeline.locked .tl-info{opacity:.5;pointer-events:none}
/* a button directly under its label sits the same 6px away as the Style options do */
.panel .field>.lbl+.btn.wide{margin-top:0}
/* the wave under the logo slides in from the left once per load; it is clipped at the line's own left edge, so it never crosses a letter */
.logo-line{animation:logo-line 1.05s var(--ease-out) .3s both}
@keyframes logo-line{from{transform:translateX(-1260px)}to{transform:none}}
@media (prefers-reduced-motion:reduce){.logo-line{animation:none}}

/* PDF Editor drag: the lifted page is composited on its own layer so it follows the pointer smoothly */
/* a small sliders glyph at the end of each file chip: it says "there is more to do here" without a word, and glows twice when the file first loads */
.chip-edit{display:inline-grid;place-items:center;flex:none;width:20px;height:20px;border-radius:50%;color:var(--muted);transition:color var(--ae-quick) var(--ease-color),background-color var(--ae-quick) var(--ease-color),transform var(--t-hover) var(--spring-hover)}
.chip-edit svg{width:var(--icon-s);height:var(--icon-s)}
.chip-main:hover .chip-edit,.chip-main:focus-visible .chip-edit{color:var(--ink);background:color-mix(in srgb,var(--ink) 9%,transparent);transform:rotate(90deg)}
.chip.enter .chip-edit,.chip.settle .chip-edit{animation:chip-nudge 1.5s var(--ease-out) 1.2s 2}
@keyframes chip-nudge{0%{box-shadow:0 0 0 0 color-mix(in srgb,var(--ink) 28%,transparent);color:var(--ink)}70%{box-shadow:0 0 0 9px transparent;color:var(--ink)}100%{box-shadow:0 0 0 0 transparent}}
@media (prefers-reduced-motion:reduce){.chip.enter .chip-edit,.chip.settle .chip-edit{animation:none}}

/* ----- File chips: a new chip shows "Editor" first, then rolls over to the page count or length; hovering brings "Editor" back ----- */
@media (max-width:520px){.dlg{padding:var(--gap-field) var(--gap-field)}}

/* PDF Editor drag: the held page follows the pointer with no easing at all (the card's usual transform transition is what made it lag).
   A plain accent bar, the same as the timeline's brackets, marks the gap where it will land; it sits under the held page. */

/* ----- a reload fades out and back in instead of flashing ----- */
html{background:var(--bg)}
body{transition:opacity var(--ae-ms) var(--ease-ui)}
html.pre body{opacity:0}
html.pre body *{animation-play-state:paused!important}
html.leaving body{opacity:0;transition-duration:.18s}
@media (prefers-reduced-motion:reduce){body{transition:none}}

/* file chips: the hover lift moves the chip 1px, so a slightly taller invisible hit area keeps the pointer "inside" while it moves, which stops the hover flickering on and off */
.chip{position:relative}
.chip:not(.busy)::before,.chip:not(.busy)::after{content:'';position:absolute;left:0;right:0;height:5px}      /* the strips sit just outside the chip, never over its buttons */
.chip:not(.busy)::before{bottom:100%}.chip:not(.busy)::after{top:100%}

/* a soft glass card groups related controls (the same frosted glass as the full-screen timeline) */
/* the Keyboard shortcuts window is only as wide as its longest line, so nothing wraps */
.about a{white-space:nowrap;color:var(--accent);text-underline-offset:2px}
.about a:hover{text-decoration-thickness:2px}
.about .row{margin-top:var(--gap-card);align-items:flex-end}
/* the version: a quiet round outline with no fill, no hover and the plain cursor, so it reads as a label and not a button */
.about .ver{position:relative;z-index:1;width:fit-content;margin:0;padding:var(--gap-sub) var(--gap-card);border:1px solid var(--line);border-radius:999px;font-size:var(--type-note);--lh:1.5;letter-spacing:.02em;color:var(--muted);cursor:default;user-select:none}
.about .ver[hidden]{display:none}
/* in the page window the spare height goes above the version, so it stays with the links beneath it; the usual paragraph gap sits above it */
.dlg.page.about>.ver:not([hidden]){margin-top:auto;margin-bottom:calc(-1 * var(--gap-hero))}
@media (max-width:374px){.dlg.page.about>.ver:not([hidden]){margin-bottom:calc(-1 * var(--field-pad-x))}}      /* the links wrap above Close here, so they start at the top of their row */
.dlg.page.about>.ver:not([hidden])+.row:last-child{margin-top:0}
.about .fine{margin:0 auto 0 0;font-size:var(--type-small)}
.about .fine a{color:inherit}
.about .fine a:hover{color:var(--ink)}      /* fine print sits left of Close and wraps above it on a narrow screen */
.dlg.page{width:min(680px,92vw);min-height:420px}
.dlg.page:not(.how){display:flex;flex-direction:column}      /* extra height goes above the buttons, not into stretched rows and tall buttons */
.dlg.page:not(.how)>.row:last-child{margin-top:auto}
#diagDlg .dlg.page{width:min(720px,92vw)}      /* About, How it works, Import/Export, Keyboard shortcuts and Diagnostics share one size */
#keysDlg .dlg.page{width:min(900px,92vw)}      /* the reading window and the two-column shortcuts get the editors' width */
.dlg.page.how{width:min(720px,92vw);height:min(830px,calc(100dvh - 32px))}      /* one frame: opening a dropdown scrolls the text inside, it never resizes the window */
.keys-groups{display:grid;grid-template-columns:1fr 1fr;column-gap:var(--gap-room);align-items:start}      /* the groups fill two columns of whole-pixel height; one group never splits */
.keys-col section{margin-bottom:var(--gap-field)}
.keys-col section:last-child{margin-bottom:0}
.keys-groups h3{font-size:var(--type-note);font-weight:600;letter-spacing:.05em;text-transform:uppercase;color:var(--muted)}
@media (max-width:820px){.keys-groups{grid-template-columns:1fr}.keys-col+.keys-col{margin-top:var(--gap-field)}}
/* a control that is switched off dims smoothly */
.field.dim{opacity:var(--inactive)}
.field{transition:opacity var(--ae-ms) var(--ease-ui)}
/* Resize: the glass card sits a comfortable distance below the size line */

/* ==================== EMPTY STATE: two ways in ==================== */
.empty{overflow:hidden;gap:var(--gap-field);isolation:isolate}
/* the glow is a soft gradient, not a blurred disc: a 70px blur on a large layer is costly to paint, and this looks the same */
.empty::before,.empty::after{content:'';position:absolute;z-index:-1;width:78%;aspect-ratio:1;border-radius:50%;opacity:.5;pointer-events:none}
.empty::before{left:-8%;top:-22%;margin:-16% 0 0 -16%;background:radial-gradient(closest-side,var(--accent-soft),transparent);animation:orb-a 16s ease-in-out infinite alternate}
.empty::after{right:-10%;bottom:0;margin:0 -16% -16% 0;background:radial-gradient(closest-side,color-mix(in srgb,var(--accent) 22%,transparent),transparent);animation:orb-b 20s ease-in-out infinite alternate}
@keyframes orb-a{to{transform:translate(18%,12%) scale(1.15)}}
@keyframes orb-b{to{transform:translate(-16%,-10%) scale(1.2)}}
.empty-fit>*{animation:empty-in .8s var(--ease-out) backwards}          /* backwards, never both: the end of the entrance is the element's own state, and a held end would keep overriding its hover, press, and drag transforms once the entrance is over */
/* nothing in the intro is ever cut off and it never scrolls: it sits in the middle at full size when it fits, and the site scales it down (--is, set in introFit) when it does not */
.empty{justify-content:flex-start;overflow:hidden}
.empty{justify-content:center}
.empty-fit{flex:none;display:flex;flex-direction:column;align-items:center;gap:var(--gap-field);width:100%;transform:scale(var(--is,1));transform-origin:center}
.empty-fit>*{flex:none}
@media (max-height:760px) and (min-width:701px){.empty h1.empty-logo{display:none}.start-card p{display:none}.sc-ic{width:36px;height:36px}.empty-fit{gap:var(--gap-card)}.empty .empty-intro{--lh:1.4}}
.empty-fit>h2{animation-delay:.12s}
.empty-fit>.starts{animation:none}
.empty-fit>.empty-intro{animation-delay:.6s}
.starts{display:grid;grid-template-columns:repeat(2,minmax(0,300px));gap:var(--gap-field);width:min(640px,100%);margin-top:var(--gap-tight)}
.start-card{position:relative;display:flex;flex-direction:column;align-items:center;gap:var(--gap-tight);padding:var(--gap-room) var(--gap-group) var(--gap-group);border:1px solid var(--line);border-radius:var(--r-lg);text-align:center;cursor:pointer;
  background:linear-gradient(180deg,color-mix(in srgb,var(--panel) 97%,transparent),color-mix(in srgb,var(--panel) 86%,transparent));-webkit-backdrop-filter:var(--glass-blur);backdrop-filter:var(--glass-blur);
  box-shadow:var(--shadow-start);
  animation:empty-in .8s var(--ease-out) backwards;transition:transform var(--t-hover) var(--spring-hover),box-shadow var(--ae-quick) var(--ease-ui),border-color var(--ae-quick) var(--ease-color)}
.start-card:nth-child(1){animation-delay:.28s}.start-card:nth-child(2){animation-delay:.4s}
@media (hover:hover) and (pointer:fine){.start-card:hover{transform:translateY(-4px);border-color:var(--accent);box-shadow:var(--shadow-start-hover)}}
.start-card:active{transform:translateY(-1px) scale(.99)}
body.dragging .start-card:first-child{border-color:var(--accent);transform:translateY(-4px) scale(1.02)}
.sc-ic{display:grid;place-items:center;width:46px;height:46px;border-radius:var(--r-lg);background:var(--accent-soft);color:var(--accent);margin-bottom:var(--gap-label);transition:transform var(--t-hover) var(--spring-hover)}
.sc-ic svg{width:25px;height:25px}
@media (hover:hover) and (pointer:fine){.start-card:hover .sc-ic{transform:scale(1.1) rotate(-4deg)}}
.start-card h3{margin:0;max-width:100%;font:600 16px Inter,'Hanken Grotesk',system-ui,sans-serif;line-height:round(1.2em,1px);--lh:1.2;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.start-card p{margin:0 0 var(--gap-head);font-size:var(--type-body);--lh:1.45;color:var(--muted);text-wrap:balance}
.start-card .row{margin-top:auto}
.empty .empty-intro{font-size:var(--type-body);margin-bottom:0}
@keyframes empty-in{from{opacity:0;transform:translateY(16px)}to{opacity:1;transform:none}}
@media (max-width:700px){
  .empty{padding:var(--gap-field)}.empty-fit{gap:var(--gap-card)}
  .starts{grid-template-columns:1fr 1fr;gap:var(--gap-card)}
  .start-card{padding:var(--gap-set) var(--gap-card)}
  .start-card p,.empty .empty-intro .drop{display:none}
  .sc-ic{width:34px;height:34px;border-radius:var(--r-card)}.sc-ic svg{width:19px;height:19px}
  .start-card h3{font-size:var(--type-value)}.start-card .row{gap:var(--gap-tight);margin-top:0}          /* a card with less in it keeps its button right under its name, as the taller card does */
}
@media (max-height:620px) and (min-width:701px){.start-card p{display:none}.sc-ic{width:36px;height:36px}}
@media (prefers-reduced-motion:reduce){.empty::before,.empty::after,.empty-fit>*,.start-card{animation:none}.start-card,.sc-ic{transition:none}}
/* the two file checks are two tiles of the panel (the shared tile look) that split its width evenly, each with its mark and words on one line, centered */
.status{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:var(--gap-head);padding:0;margin-bottom:var(--gap-card);font-size:var(--type-small);border:0}
.status .st{justify-content:center;gap:var(--gap-head);white-space:nowrap;padding:var(--gap-head);border:1px solid var(--line);border-radius:var(--r-lg);background:var(--panel2);min-width:0}
.status .st.done{border-color:color-mix(in srgb,var(--accent) 45%,var(--line));background:var(--accent-soft)}
.status .st-t{text-box:trim-both cap alphabetic;margin-block:var(--trim-t) var(--trim-b);height:var(--trim-h)}

/* ==================== 17. AUDIO EDITOR: tool list, tools and tool window ==================== */
.dlg.editor.ae{width:min(1000px,96vw)}
.btn[aria-pressed="true"]{background:var(--accent-soft);border-color:var(--accent);color:var(--accent)}
.btn:disabled[aria-pressed]{opacity:var(--inactive)}
.ae-main{display:grid;gap:calc(var(--gap-card) * 2)}
.ae-pane[hidden]{display:none}
.ae-rail{display:flex;flex-direction:column}
.ae-procs{display:flex;flex-direction:column;gap:var(--gap-label);position:relative}
.ae-tool{display:flex;align-items:center;flex:0 1 auto;min-width:0;border:1px solid transparent;border-radius:var(--r-ctl);background:none;color:var(--ink);font:inherit;line-height:round(calc(var(--lh) * 1em),1px);font-weight:500;text-align:left;cursor:pointer;transition:background-color var(--ae-quick) var(--ease-color),border-color var(--ae-quick) var(--ease-color),color var(--ae-quick) var(--ease-color),transform .14s var(--ease-out)}
.ae-tool:not(:disabled):active{transform:scale(.98)}
@media (prefers-reduced-motion:reduce){.ae-tool:not(:disabled):active{transform:none}}
.ae-proc{display:flex;align-items:center;gap:var(--gap-label);border-radius:var(--r-ctl)}
.ae-proc .switch{margin-right:var(--gap-label)}
.ae-proc.dragging{z-index:2;box-shadow:var(--shadow-lift);background:var(--panel)}
@container aedlg (max-width:728px){
  .ae-main{gap:var(--gap-set)}
  .ae-rail{flex-direction:row;flex-wrap:wrap;align-items:center}
  .ae-procs{gap:var(--gap-sub) var(--gap-head)}
  .dlg.editor.ae{max-height:94dvh;overflow-y:auto;overscroll-behavior:contain}
  .ae-panes{min-height:0}
}
/* EQ */
.eq-top{display:flex;align-items:center;margin-bottom:var(--gap-card)}
.eq-top select{max-width:230px}
.eq-top .seg{flex:0 0 auto;transition:opacity var(--ae-ms) var(--ease-ui)}
.eq-top .seg[hidden]{display:none}
.eq-dyn{grid-column:1/-1}
.eq-band.ae-card{--eq-col-gap:var(--gap-set)}          /* the space between the band's columns, which is also the space above the Dynamic row's line: one gap in each direction, as the cards have */
.eq-dyn-g{display:grid;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);gap:0 var(--eq-col-gap);align-items:end;padding-top:var(--eq-col-gap)}          /* Threshold, its Auto, then Range: the two sliders are the same length, Auto stands between them on their one control line, and the gaps are the band row's own column gap, so a shut fold takes no space and nothing sits off the grid above */
.eq-dyn .eq-cell{gap:var(--gap-sub)}
.eq-dyn.fa.open>.fa-in{padding-block:0}          /* the fold's own top and bottom padding are taken out: the row's space above it is the grid's own gap, and the card's bottom edge is as far from the last control as its top edge is from the first label */
.eq-dyn .eq-ctl{height:var(--h-s)}
.eq-top .seg.dim{opacity:var(--inactive);pointer-events:none}
.eq-top .seg label{padding:var(--gap-label) var(--gap-card);font-size:var(--type-small)}
.eq-stage{position:relative;height:196px}
.eq-stage canvas,.im-scope canvas{display:block;width:100%;height:100%;touch-action:none}
.eq-band .field{margin:0}
.eq-band.none{opacity:var(--inactive);pointer-events:none}
/* Imager */
.im-cols{display:grid}
.im-corr{display:grid;grid-template-columns:1fr;gap:var(--gap-head);align-items:center;font-size:var(--type-small);color:var(--muted)}
.im-corr i{position:relative;height:6px;border-radius:99px}
.im-corr i::after{content:'';position:absolute;top:calc(-1 * var(--gap-label));left:calc(var(--c,.5) * 100%);width:var(--hair);height:var(--corr-h);margin-left:calc(var(--hair) * -.5);background:var(--muted);pointer-events:none}          /* a reading, not a control: a thin tick in the scale ticks' gray, never a handle */
#audioDlg:not(.afull) #aeBalCard{flex:none}
/* narrow but not a phone (521–760px): Fades and Noise use two columns, so the tool fits its window with less scrolling */
/* phones (520px and below): there is no room for a fixed window, so the whole dialog scrolls like a page and each tool shows at its full height */
@container aedlg (max-width:488px){
  html #audioDlg:not(.afull) .dlg.editor.ae{height:auto;max-height:94dvh;overflow-y:auto;overscroll-behavior:contain;grid-template-rows:none}
  html #audioDlg:not(.afull) .ae-main{height:auto;min-height:auto;grid-template-rows:none}
  html #audioDlg:not(.afull) .ae-wave{height:128px;min-height:0}
  html #audioDlg:not(.afull) .ae-win{height:auto;min-height:auto}
  html #audioDlg:not(.afull) .ae-pbody{height:auto;overflow:visible}
  html #audioDlg:not(.afull) .ae-pane{position:static}
}
/* the editor's first state is set without motion: while it opens, the tools take their state at once (the script removes the class two frames later) */
#audioDlg.ae-still :is(#aeWin,#aeRail) *{transition:none!important}
/* ----- Tool list: output tools, bypass, bipolar sliders, level meter ----- */
.ae-badge{font-size:var(--type-small);font-variant-numeric:tabular-nums;color:var(--muted);transition:opacity var(--ae-quick) var(--ease-ui)}
.ae-badge:empty{opacity:0}
.ae-proc .ae-tn{transition:opacity var(--ae-ms) var(--ease-ui)}
.ae-proc.bp .switch:checked{background:var(--muted)}
/* a slider with a zero in the middle fills outward from it */
input[type=range].bi::-webkit-slider-runnable-track{background:linear-gradient(to right,var(--line) 0,var(--line) var(--lo,50%),var(--accent) var(--lo,50%),var(--accent) var(--hi,50%),var(--line) var(--hi,50%),var(--line) 100%)}
input[type=range].bi::-moz-range-progress{background:transparent}
.sl-ends{display:flex;justify-content:space-between;font-size:var(--scale-fs);color:var(--muted)}
/* EQ */
.eq-top{gap:var(--gap-head)}
.eq-band{transition:opacity var(--ae-ms) var(--ease-ui)}
.eq-bn{display:flex;align-items:stretch;gap:var(--gap-card);align-self:center;font-weight:600}
.eq-bn b{font-variant-numeric:tabular-nums}
.eq-bn .switch{order:2}
.eq-stage canvas{cursor:default}
/* Imager */
.im-corr i{background:linear-gradient(to right,color-mix(in srgb,var(--clip) 35%,transparent) 0,color-mix(in srgb,var(--clip) 35%,transparent) 25%,var(--line) 25%,var(--line) 100%)}
.im-corr i.bad::after{background:var(--bad)}
.im-corr i::after{transition:left var(--ae-quick) linear,background-color var(--ae-quick) var(--ease-color)}
/* Level */

/* ----- Cards, folding windows, Fades and Level ----- */
.ae-card{padding:var(--gap-set) var(--gap-field);border:1px solid var(--line);border-radius:var(--r-lg);background:var(--panel2)}
.ae-card h4{font-size:var(--type-note);font-weight:600;letter-spacing:.05em;text-transform:uppercase;color:var(--muted)}
.ae-card .field{margin-bottom:0}
.ae-card.dim{opacity:var(--inactive)}
.ae-rail{--rail-pad:8px;padding:var(--rail-pad);border:1px solid var(--line);border-radius:var(--r-lg);background:var(--panel2);gap:0}
.ae-rail-cur,.pe-rail-cur{display:none}
/* the narrow tool bar, one rule for both editors: the fold chevron, the tool's name in a panel heading's type, then the tool's button(s) on the right */
.rail-bar{display:flex;align-items:center;padding-right:var(--gap-set)}
.rail-cur{flex:1 1 0;min-width:0;align-items:baseline;gap:var(--gap-head);padding:var(--gap-set) 0 var(--gap-set) var(--gap-set);border:0;border-radius:var(--r-lg);background:none;color:var(--ink);font:inherit;font-size:var(--type-value);font-weight:600;line-height:round(calc(var(--lh) * 1em),1px);text-align:left;cursor:pointer}
.rail-cur b{font-weight:600}
.rail-cur output{margin-left:auto;font-size:var(--type-small);font-weight:400;color:var(--muted);font-variant-numeric:tabular-nums}
.rail-bar>.btn,.rail-bar>.ae-abs{flex:none;margin-left:var(--gap-head)}
.ae-rail-body{display:flex;flex-direction:column;flex:1 0 auto}
.ae-rail-in{display:flex;flex-direction:column;gap:var(--gap-label);flex:1 0 auto}
.ae-panes{display:flex;flex-direction:column}
.lv-big{display:block;margin:0 0 var(--gap-set);font-size:var(--big-fs);font-weight:600;letter-spacing:-.02em;font-variant-numeric:tabular-nums;--lh:1;transform-origin:left center;will-change:transform;transition:color var(--ae-quick) var(--ease-color)}
.im-scope{display:flex;flex-direction:column}
.im-scope canvas{width:100%}
.eq-fold{display:grid;grid-template-rows:1fr;transition:grid-template-rows var(--ae-move) var(--ease-out),margin-top var(--ae-move) var(--ease-out)}
.eq-fold.shut{grid-template-rows:0fr}
.eq-fold-in{min-height:0;overflow:hidden}
.eq-fold.shut .eq-fold-in{visibility:hidden;transition:visibility 0s var(--ae-move)}
@media (prefers-reduced-motion:reduce){.eq-fold,.eq-fold.shut .eq-fold-in{transition:none}}
.eq-match .field.dim{opacity:var(--inactive)}
@container aedlg (max-width:728px){
  .ae-rail{display:block;padding:0}
  .ae-rail-cur{display:flex}
  .ae-rail-body{display:grid;grid-template-rows:0fr;transition:grid-template-rows var(--ae-move) var(--ease-out)}
  .ae-rail.open .ae-rail-body{grid-template-rows:1fr}
  .ae-rail-in{overflow:hidden;min-height:0;padding:0 var(--gap-head);flex-direction:column}
  .ae-rail.open .ae-rail-in{padding:0 var(--gap-head) var(--gap-card)}
  .ae-procs{flex-direction:column;flex-wrap:nowrap}
}
.eq-top{flex-wrap:wrap}

/* ----- Tool header, Bypass, lights, curves, EQ Match steps ----- */
:root{--ok:#2fb872;--bad:#e5484d}
:root{--type-axis:10.5px;--type-note:11.5px;--type-small:12.5px;--type-body:13px;--type-value:14px;--type-title:15px;--type-display:20px}          /* the Audio Editor's type scale: one size for each job, so the same kind of text is the same size in every tool (a graph's own text reads these through aeFont) */
.ae-phead{display:flex;align-items:center;justify-content:space-between;gap:var(--gap-card);min-height:32px;margin:0 0 var(--gap-set)}
.ae-phead h3{margin:0;font-size:var(--type-title);font-weight:600}
.ae-phead>:first-child{flex:1 1 150px;min-width:0}
.ae-phead .ae-abs{flex:none;margin-left:auto}
.ae-phead{flex-wrap:wrap;row-gap:var(--gap-head)}          /* the heading and its buttons share a row while they fit; when they do not, the buttons drop under the heading instead of squeezing it */
.ae-phead .btn{transition:opacity var(--ae-ms) var(--ease-ui),transform var(--ae-move) var(--spring-hover),background-color var(--ae-quick) var(--ease-color),border-color var(--ae-quick) var(--ease-color),color var(--ae-quick) var(--ease-color)}
.ae-phead .btn.gone{opacity:0;transform:scale(.9);pointer-events:none}
.ae-times{gap:var(--gap-label) var(--gap-field)}
.ae-bar{flex-wrap:wrap}
/* the green light on an Output tool that is doing something: a small glass bead */
.led{position:relative;display:block;border-radius:50%;background:var(--hairline);box-shadow:var(--led-rim)}
.led::after{content:'';position:absolute;inset:0;border-radius:50%;background:var(--led-lit-bg);box-shadow:var(--led-lit-glow);opacity:0;transform:scale(.55);transition:opacity var(--ae-ms) var(--ease-out),transform var(--t-press) var(--spring-press)}
.led.on::after{opacity:1;transform:none}
/* slider labels that are also buttons */
.sl-ends{margin-top:0}          /* the end labels sit directly under their slider (the field's own gap is the space between them) */
.sl-end{padding:var(--gap-sub) var(--gap-label);margin:0 calc(-1 * var(--gap-label));border:0;border-radius:var(--r-sm);background:none;color:var(--muted);font:inherit;line-height:round(calc(var(--lh) * 1em),1px);font-size:var(--scale-fs);font-variant-numeric:tabular-nums;cursor:pointer;transition:color var(--ae-quick) var(--ease-color),background-color var(--ae-quick) var(--ease-color),transform .14s var(--ease-out)}
.sl-end:hover,.sl-end:focus-visible{color:var(--accent);background:var(--accent-soft)}
.sl-end:not(:disabled):active{transform:scale(.97)}
@media (prefers-reduced-motion:reduce){.sl-end:not(:disabled):active{transform:none}}
/* Fades */

/* level meter: red clips, green is a healthy peak, blue is quiet */
.lv-big.clip{color:var(--bad)}
/* EQ Match */
.mt-steps{display:flex;flex-direction:column;gap:var(--gap-set)}
.mt-step{display:flex;align-items:flex-start;gap:var(--gap-set);transition:opacity var(--ae-ms) var(--ease-ui)}
.mt-step.dim{opacity:var(--inactive)}
.mt-n{display:grid;place-items:center;flex:none;width:var(--step-s);height:var(--step-s);margin-top:0;border-radius:50%;background:var(--accent-soft);color:var(--accent);font-size:var(--type-small);font-weight:600;font-variant-numeric:tabular-nums}
.mt-body{flex:1;min-width:0}
.mt-step :is(.mt-title,.field output){display:flex;align-items:center;min-height:22px}          /* a step's first line is as tall as its number, so the number is centered on it */
.mt-title{margin:0 0 var(--gap-label);font-weight:600;color:var(--ink)}
.mt-body .field label{display:flex;justify-content:space-between}
.mt-body .field .mt-title{margin:0}
.mt-pick{display:flex;align-items:center;flex-wrap:wrap;gap:var(--gap-head);color:var(--muted);font-size:var(--type-body)}
.mt-chip{display:flex;align-items:center;gap:var(--gap-head);max-width:100%;height:var(--h-s);box-sizing:border-box;padding:0 var(--gap-label) 0 var(--gap-set);border:1px solid var(--line);border-radius:99px;background:var(--panel);font-size:var(--type-body)}
.mt-chip b{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:600}
.mt-chip button{display:grid;place-items:center;flex:none;width:var(--step-s);height:var(--step-s);padding:0;border:0;border-radius:50%;background:none;color:var(--muted);cursor:pointer;transition:background-color var(--ae-quick) var(--ease-color),color var(--ae-quick) var(--ease-color),transform var(--t-hover) var(--spring-hover)}
@media (hover:hover) and (pointer:fine){.mt-chip button:hover{background:var(--accent-soft);color:var(--accent);transform:scale(1.1)}}
.mt-chip button svg{width:12px;height:12px}
.mt-chip button:disabled{opacity:var(--inactive);pointer-events:none}          /* held while the wait pill is up, so a clear never lands in the middle of the job */
/* a card that gets a nudge: the tool wants something moved first */
@keyframes nudge{0%{border-color:var(--line);box-shadow:none}30%{border-color:var(--accent);box-shadow:0 0 0 4px var(--accent-soft)}100%{border-color:var(--line);box-shadow:none}}
.ae-card.nudge{animation:nudge .9s var(--ease-out)}
@media (prefers-reduced-motion:reduce){.ae-card.nudge{animation:none}}
@container aedlg (max-width:728px){
  .mt-head .btn{font-size:var(--type-small)}
}

/* ----- Lights on the left, one selection pill that glides ----- */
.ae-rail-in{position:relative}
.ae-sel{position:absolute;left:0;top:0;z-index:0;width:0;height:0;border:1px solid var(--accent);border-radius:var(--r-ctl);background:var(--accent-soft);pointer-events:none;opacity:0;will-change:transform;transition:transform var(--ae-move) var(--spring-press),width var(--ae-move) var(--spring-press),height var(--ae-move) var(--spring-press),opacity var(--ae-ms) var(--ease-ui)}
.ae-proc{position:relative;z-index:1}
.ae-tool,.ae-tool:hover{background:none}
.ae-tool:hover{background:color-mix(in srgb,var(--accent-soft) 55%,transparent)}
.ae-tool.on{background:none;border-color:transparent;color:var(--accent)}
.ae-tool{border-color:transparent}
.ae-badge{flex:none;margin:0 var(--gap-sub) 0 auto;text-align:right}          /* the note sits at the row's right end, as wide as its words */
.ae-proc .switch{flex:none;margin:0 var(--gap-sub) 0 var(--gap-head)}
.field>.lv-big{margin:0 0 var(--gap-set)}

/* ----- noise reduction ----- */
.nr-prog b{display:block;width:0;height:100%;background:var(--accent);transition:width var(--ae-quick) linear}
.ae-tool{--row-px:8px;--row-py:8px;padding:0 var(--row-px);height:calc(1lh + 2 * var(--row-py) + 2px);white-space:nowrap}          /* the highlight is the button, so it hugs the name: the same space before and after it (the name is trimmed to its letters, so the height is set here) */
input.switch:disabled{cursor:progress;opacity:var(--inactive)}

/* ----- One window per tool, wires between lit lights, zoom, live meter ----- */
.ae-main{grid-template-columns:226px minmax(0,1fr);align-items:stretch}
.ae-win{border:1px solid var(--line);border-radius:var(--r-lg);background:var(--panel2)}
.ae-win .ae-phead{margin-bottom:var(--gap-set)}
.ae-pbody{display:block}
.btn.gone{opacity:0;pointer-events:none;transform:scale(.92)}
#aeZoomFit{transition:opacity var(--ae-ms) var(--ease-ui),transform var(--ae-move) var(--spring-hover)}
/* the rail: every row is a light, a name, and a note */
.ae-jack{display:grid;place-items:center;flex:none;width:var(--step-s);height:calc(var(--h-s) + var(--gap-sub));padding:0;border:0;background:none;cursor:grab;touch-action:none}
.ae-jack.fixed,.ae-jack.lockd{cursor:default}
.ae-jack.pulling{cursor:grabbing}
.led{width:10px;height:10px}
.led.tgt{box-shadow:var(--led-target-ring)}
.led.shake{animation:ledshake .4s var(--ease-out)}
@keyframes ledshake{20%{transform:translateX(-3px)}45%{transform:translateX(3px)}70%{transform:translateX(-2px)}100%{transform:none}}
.ae-proc.off .ae-tn{opacity:var(--inactive)}
.ae-proc.bp .ae-tn{opacity:var(--inactive);text-decoration:line-through}
.ae-wires{position:absolute;left:0;top:0;overflow:visible;pointer-events:none}
.w-back{fill:none;stroke:var(--wire-back);stroke-width:5.5;stroke-linecap:round}
.w-front{fill:none;stroke:var(--accent);stroke-width:2.6;stroke-linecap:round}
.w-hi{fill:none;stroke:var(--wire-hi);stroke-width:.9;stroke-linecap:round;transform:translate(-.7px,-.7px)}
.w-plug{fill:none;stroke:var(--accent);stroke-width:1.7;opacity:.85}
.w-plug.drag{fill:var(--accent);opacity:1}
.w-front.drag{stroke-dasharray:none;opacity:.9}
/* EQ: every control sits on the same two lines, a small label above and the control below */
.eq-band.ae-card{display:flex;flex-direction:column}          /* the band card's parts: its row of cells, then the Dynamic fold */
.eq-cells{display:grid;grid-template-columns:auto auto auto minmax(0,1fr) minmax(0,1fr);gap:0 var(--gap-set);align-items:start}
.eq-cell{display:flex;flex-direction:column;gap:var(--gap-label);min-width:0}
.eq-lbl{display:flex;justify-content:space-between;align-items:baseline;gap:var(--gap-card);margin:0;font-weight:500;color:var(--muted)}
.eq-lbl output{color:var(--ink);font-variant-numeric:tabular-nums}
.eq-lbl b{color:var(--ink)}
.eq-ctl{display:flex;align-items:center;height:var(--h-s)}          /* the control line is as tall as its controls (30px), so the cell's box ends where they do */
.eq-cells>.eq-cell>.eq-ctl:has(>input[type=range]){margin-bottom:calc((var(--thumb) - var(--h-s)) / 2)}          /* a slider's line is as tall as the controls beside it so they share one center line, but its cell ends where the thumb does, so a row of sliders ends where its thumbs do */
.eq-ctl select{height:var(--h-m)}
.eq-ctl input[type=range]{width:100%}
.eq-bn{min-width:70px}
.eq-cell.dim{opacity:var(--inactive)}
.eq-cell[hidden]{display:none}
.eq-bn .eq-ctl{gap:var(--gap-set)}
.eq-ctl .seg{width:100%;font-size:var(--type-small)}
.eq-top select{flex:0 0 auto;width:var(--eq-sel-w);min-width:0}
/* EQ Match fits beside the curve without growing the window */
.mt-steps.two{display:grid;grid-template-columns:minmax(0,1.15fr) minmax(0,1fr);gap:var(--gap-head) calc(var(--gap-card) * 2)}
/* Noise reduction steps */
.nr-learn{display:flex;align-items:center;gap:var(--gap-head) var(--gap-card)}
.nr-learn .mt-chip{padding-top:var(--gap-label);padding-bottom:var(--gap-label)}
.mt-n.inl{display:inline-grid;margin-right:var(--gap-head);vertical-align:middle}
/* live meter */
@keyframes clippulse{50%{box-shadow:0 0 3px color-mix(in srgb,var(--clip) 30%,transparent)}}
@media (prefers-reduced-motion:reduce){.lv-clip,.led.shake{animation:none}}
@container aedlg (max-width:728px){
  .ae-main{grid-template-columns:minmax(0,1fr)}
  .ae-win{min-height:0;padding:var(--gap-set)}
  .mt-steps.two{grid-template-columns:1fr}
}

@container aedlg (max-width:728px){.ae-bar .push-right.gone{display:none}}

/* Noise reduction: the graph spans the whole window; the two cards sit under it */
.nr-learn{flex-wrap:nowrap;min-height:var(--h-s)}
.nr-learn .btn,.nr-learn .mt-chip{height:var(--h-s);box-sizing:border-box;margin:0}
.nr-learn .mt-chip{padding:0 var(--gap-label) 0 var(--gap-set);white-space:nowrap}
.mt-pick{min-height:var(--h-s)}
.mt-pick span.bad{color:var(--bad)}

/* tool windows slide */
/* While a window slides, the box that holds it clips, whatever else sets its overflow: the leaving and arriving tools overlap by a few pixels, and a box that scrolls would flash a scroll bar for the length of the slide. This is the one rule for every such box (the Audio Editor's window, the PDF Editor's top and body), and it is !important so no later, more specific scroll rule can win. */
.ae-pbody.sliding{overflow:hidden!important}
.pe-top.sliding,.pe-body.sliding{overflow:clip!important}
.pe-grid-wrap.pe-fits{overflow:hidden!important}          /* set while the head slides when the pages already fit the window's final size: its height changes under the grid and a bar would flash. A grid that needs a bar keeps it. */
.ae-pane.sliding{position:absolute;left:0;right:0;top:0}

/* main-panel Fades: in and out share a row */
.fade-pair{display:flex;justify-content:space-between;gap:var(--gap-set)}

/* ----- Noise reduction, on the tool grid (.tool-grid): the pane lays itself out by its own width. Narrow, it is one column in the order the graph, Noise sample, Removal. From 520px the graph spans the top and the two cards sit side by side under it;
   before any noise is found, Noise sample takes the graph's place (the graph is hidden) and Removal spans the row under it, and when a noise is learned they slide into their places. ----- */
#aePaneNoise{container:noise/inline-size}
.nr-grid{grid-template-columns:minmax(0,1fr)}
.nr-stage{height:116px;background:color-mix(in srgb,var(--ink) 6%,var(--panel2));border:1px solid var(--line);border-radius:var(--r-card)}
.nr-stage canvas{transition:opacity var(--ae-ms) var(--ease-ui)}
.nr-sample{transition:background-color var(--ae-ms) var(--ease-color),border-color var(--ae-ms) var(--ease-color)}
.nr-removal{position:relative;overflow:clip}          /* clip, not hidden: the progress bar stays inside, and the card never shrinks below its content (it is not a scroll container) */
@container noise (min-width:520px){
  .nr-grid{grid-template-columns:minmax(0,1.1fr) minmax(0,1fr);grid-template-rows:minmax(auto,1fr) auto}
  .nr-stage{grid-area:1/1/2/3;height:auto;min-height:64px}
  .nr-sample{grid-area:2/1}
  .nr-removal{grid-area:2/2}
}
.nr-learn{min-width:0}
.nr-learn .mt-chip{min-width:0}
/* Removal: its two small sliders sit under Reduction, in a fold that closes when Reduction is Off */
.nr-removal .field{margin-bottom:0}
.nr-more{gap:calc(var(--gap-set) - var(--gap-sub))}          /* Sensitivity and Smoothing are the shared one-line slider rows (.field.row3, as Imager's Low, Middle, and High), stacked one setting-gap apart (the row's own 2px margin is part of it) */
.nr-head+.field{margin-top:var(--gap-sub)}          /* the seg above Reduction ends a hair high in its row, so the body sits level between the heading and the card's foot */
.nr-removal .fa.open>.fa-in{padding:var(--gap-label);margin:calc(-1 * var(--gap-label))}          /* room for a slider's thumb inside the fold's clip, taken back by the margin so nothing moves */
@container aedlg (max-width:728px){.ae-pbody{min-height:0}}
}

/* Noise reduction: rows size to their content; even spacing around Noise only */
.nr-stage canvas{position:absolute;left:0;top:0;width:100%;height:100%}

/* the cables run in front of lights that are off; a lit light is drawn again on top of them */
.ae-wires{z-index:2}
.w-dot{fill:url(#wDot);stroke:var(--wire-dot);stroke-width:.5}

/* Imager: width overall or by frequency, balance, listen */
.im-head .seg{width:auto;font-size:var(--type-small)}
.im-view{grid-area:1/1;transition:opacity var(--ae-ms) var(--ease-ui) calc(var(--ae-ms) * .15),transform var(--ae-ms) var(--ease-out) calc(var(--ae-ms) * .15)}
.im-view.off{opacity:0;transform:translateY(calc(var(--ae-lift) * -1));pointer-events:none;visibility:hidden;transition:opacity calc(var(--ae-ms) * .55) var(--ease-ui),transform calc(var(--ae-ms) * .55) var(--ease-out),visibility 0s var(--ae-ms)}.im-view .field:last-child{margin-bottom:0}#aeWvBands.off{transform:translateY(var(--ae-lift))}
.hz{font-style:normal;color:var(--muted);font-size:var(--type-note);margin-left:var(--gap-label);position:relative;top:calc(var(--cap) * (var(--type-note) - var(--type-body)) / 2)}          /* a smaller word after a label: moved up by half the difference in their capitals' heights, so its letters' middle is the label's (on a slider's line); moved, not laid out higher, so the row keeps its size */
.im-low{display:flex;align-items:center;justify-content:space-between;gap:var(--gap-set)}
.im-low .check{white-space:nowrap}
.im-lowf{display:flex;align-items:center;gap:var(--gap-head);flex:1;min-width:0;max-width:210px;transition:opacity var(--ae-ms) var(--ease-ui)}
.im-lowf.dim{opacity:var(--inactive)}.im-lowf input{flex:1;min-width:0}.im-lowf output{width:46px;text-align:right;font-size:var(--type-small);font-variant-numeric:tabular-nums}
.im-listen{display:flex;align-items:center;gap:var(--gap-card)}.im-listen>span{font-size:var(--type-small);color:var(--muted)}.im-listen .seg{flex:1;font-size:var(--type-small)}.im-listen .seg span{padding:var(--gap-label) calc(var(--gap-label) + var(--gap-sub))}
.im-view{align-self:center}
.row3-set,.field.row3{column-gap:var(--gap-field)}
.row3-set{display:grid;grid-template-columns:max-content minmax(0,1fr) max-content}          /* a group of slider rows: the name column is as wide as the longest name in the group, so every slider starts at the same place with one gap after the longest word, and one gap before the value */
.field.row3{display:grid;grid-column:1/-1;grid-template-columns:subgrid;align-items:center}
.field.row3 label{display:contents}
.field.row3 label span{order:1;white-space:nowrap}
.field.row3 input{order:2;margin:0}
.field.row3 output{order:3;text-align:right;min-width:4.5ch}          /* names sit flush left and values flush right, with one gap beside the slider at the longest name and the widest value (like -100 or 100%, with a little room for the % sign) so the slider never resizes while it is dragged */
.ae-abs{display:flex;align-items:center;gap:var(--gap-head)}
#aeABm{transition:opacity var(--ae-ms) var(--ease-ui),transform var(--ae-move) var(--spring-hover),background-color var(--ae-quick) var(--ease-color),border-color var(--ae-quick) var(--ease-color)}
/* the noise window stays within the same height as every other tool */
@container aedlg (min-width:729px) and (max-width:948px){.ae-pbody{height:max(var(--ae-body),430px)}}          /* the height the tools need in a pane this narrow; a height, not a minimum, so a tool's own rows (Spectra's list) fill it instead of ending at the main size's height */
.ae-wave{height:128px}
.ae-view{width:auto;flex:none;font-size:var(--type-small)}.ae-view span{padding:var(--gap-label) var(--gap-set)}
#audioDlg{container:aedlg/inline-size}          /* every narrow rule of the Audio Editor asks about the dialog's own width (its content box, 32px under the screen's), never the screen's, so full screen and any window follow the same give-way order */
#audioDlg:focus{outline:none}
/* margins inside the noise card never merge, so closing the sliders slides "Noise only" the whole way with no jump at the end */

/* ==================== AUDIO EDITOR: full screen (the picture fills the screen, everything else floats as glass) ==================== */
#audioDlg.afull{padding:0;place-items:stretch}
#audioDlg.afull>.dlg.editor.ae{position:fixed;inset:0;width:auto;max-width:none;max-height:none;margin:0;border:0;border-radius:0;padding:var(--gap-set);gap:var(--gap-card);overflow:hidden;display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:auto minmax(0,1fr) auto auto;align-content:stretch}
#audioDlg.afull .ae-wave{position:absolute;left:0;right:0;top:0;bottom:0;height:auto;z-index:0;transition:top var(--ae-move) var(--ease-out),bottom var(--ae-move) var(--ease-out)}
#audioDlg.afull .ae-wave canvas{border-radius:0}
/* while the window grows or shrinks, one animation moves it and nothing else glides on its own */
#audioDlg.fsmove,#audioDlg.fsmove *{transition:none!important}
#audioDlg.fsmove{overflow:hidden}          /* no scroll bars flash up while the window moves past the edges */
#audioDlg.afull>.dlg.editor.ae>.row{visibility:hidden}          /* Export audio, Cancel, and Done have no place in full screen: left to the grid they stretch into its tall middle row, behind the picture */
#audioDlg.afull .ed-head{grid-row:1;z-index:2}
#audioDlg.afull .ae-bar{grid-row:3;z-index:2}
#audioDlg.afull .ae-main{grid-row:4;z-index:2;overflow:auto;overscroll-behavior:contain}
#audioDlg.afull .ed-head,#audioDlg.afull .ae-bar,#audioDlg.afull .ae-main{padding:var(--gap-card) var(--gap-field)}
#audioDlg.afull.dock-off .ae-main{position:absolute;left:var(--ae-side);right:var(--ae-side);bottom:var(--ae-side);transform:translateY(calc(100% + 40px));opacity:0;pointer-events:none;visibility:hidden;transition:transform var(--ae-move) var(--ease-out),opacity var(--ae-ms) var(--ease-ui),visibility 0s var(--ae-move)}
#audioDlg.afull.dock-off .ae-bar{grid-row:4}
@container aedlg (max-width:728px){#audioDlg.afull .ae-main{max-height:50dvh}#audioDlg.afull>.dlg.editor.ae{padding:var(--gap-head)}}

@media (prefers-reduced-motion:reduce){#audioDlg.afull .ae-main{transition:none}}
/* the Spectra tool */
.sp-grid{grid-template-columns:minmax(0,1fr) minmax(0,1fr);align-items:stretch}
.sp-card{display:flex;flex-direction:column;gap:var(--gap-set);min-height:0}
.sp-seg label>span{display:inline-flex;align-items:center;justify-content:center}
.sp-list{display:flex;flex-direction:column;gap:var(--gap-label);overflow-y:auto;overflow-x:hidden;min-height:0;flex:1}
.sp-item{display:flex;align-items:center;gap:var(--gap-card);padding:var(--gap-head) var(--gap-head) var(--gap-head) var(--gap-set);border:1px solid var(--line);border-radius:calc(var(--r-sm) + var(--gap-label));background:var(--panel2);cursor:pointer;transition:border-color var(--ae-quick) var(--ease-color),background-color var(--ae-quick) var(--ease-color),transform var(--t-hover) var(--spring-hover)}
/* a new edit fades in in place: no slide, so nothing pokes past the list and no scroll bar flashes */
.sp-item.in{animation:sp-in .35s var(--ease-out) both}
@keyframes sp-in{from{opacity:0}to{opacity:1}}
.sp-draw{align-self:flex-start}
@media (hover:hover) and (pointer:fine){.sp-item:hover{transform:translateX(2px)}}
.sp-item.on{border-color:var(--accent);background:var(--accent-soft)}
.sp-dot{flex:none;width:9px;height:9px;border-radius:50%}
.sp-dot.heal{background:var(--heal);box-shadow:0 0 8px color-mix(in srgb,var(--heal) 70%,transparent)}
.sp-dot.cut{background:var(--cut);box-shadow:0 0 8px color-mix(in srgb,var(--cut) 70%,transparent)}
.sp-t{display:flex;flex-direction:column;min-width:0;flex:1;--lh:1.25}
.sp-t b{font-weight:600;font-size:var(--type-body);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.sp-t small{font-size:var(--type-note);color:var(--muted)}
.sp-item em{font-style:normal;font-size:var(--type-small);color:var(--muted)}
.sp-x{display:grid;place-items:center;width:var(--x-size);height:var(--x-size);border:0;border-radius:var(--r-ctl);background:none;color:var(--muted);cursor:pointer;transition:background-color var(--ae-quick) var(--ease-color),color var(--ae-quick) var(--ease-color)}
.sp-x:hover{background:color-mix(in srgb,var(--bad) 14%,transparent);color:var(--bad)}
.sp-x svg{width:13px;height:13px}
.sp-empty{display:grid;place-items:center;flex:1;color:var(--muted);opacity:.45}
.sp-empty svg{width:44px;height:44px;animation:sp-breathe 3s ease-in-out infinite}
@keyframes sp-breathe{50%{transform:scale(1.08);opacity:.6}}

/* ---- full screen, refined: the same glass as the score player's timeline, with a soft specular sheen ---- */
#audioDlg.afull>.dlg.editor.ae{background:var(--panel)}
#audioDlg.afull .ed-head,#audioDlg.afull .ae-bar,#audioDlg.afull .ae-main{position:relative;isolation:isolate;border:1px solid var(--glass-edge);border-radius:var(--r-win);background:var(--glass-bg);-webkit-backdrop-filter:var(--glass-blur);backdrop-filter:var(--glass-blur);
  box-shadow:var(--glass-shadow),var(--shadow-float)}
/* the sheen: every glass bar of the Audio Editor and the video picture's floating strips carries the same highlight (--glass-sheen), in one place */
#audioDlg .ae-bar::before,#audioDlg.afull .ed-head::before,#audioDlg.afull .ae-main::before,.stage-strip::before,.sys-zoom::before,.sys-bar::before,.sys-nav::before,.app.fs .transport::before,.app.fs .timeline::before{content:'';position:absolute;inset:0;z-index:-1;border-radius:inherit;pointer-events:none;background:var(--glass-sheen);opacity:var(--glass-sheen-o)}
.stage-strip,.sys-zoom,.sys-bar,.sys-nav{isolation:isolate}
/* one hover for every button on a glass bar or head: soft fill, accent ink, no lift or shadow */
#audioDlg :is(.ae-bar,.ed-head) :is(.btn,.icon-btn):not(.primary,.play):not(:disabled):hover{transform:none;box-shadow:none;background:var(--hover-fill);color:var(--hover-ink);border-color:transparent}
#audioDlg.afull .ed-head,#audioDlg.afull .ae-bar{padding:var(--gap-head) var(--gap-set)}
#audioDlg.afull .ed-head h2{font-size:var(--type-display)}
#audioDlg.afull .ae-main{padding:var(--gap-card);gap:var(--gap-set)}
#audioDlg.afull .ae-pbody,#audioDlg.afull .ae-panes{min-height:0}
#audioDlg.afull .ae-main .ae-win,#audioDlg.afull .ae-main .ae-rail-in{background:transparent;border-color:color-mix(in srgb,var(--glass-edge) 80%,var(--line))}
#audioDlg.afull .ae-main .ae-card,#audioDlg.afull .ae-win .ae-card{background:color-mix(in srgb,var(--panel) 46%,transparent);border-color:color-mix(in srgb,var(--glass-edge) 70%,var(--line))}

/* Imager: the toggle sits on the same line as its words, on the right like every other toggle */
.im-low .check{display:flex;align-items:center;gap:var(--gap-set);font-size:var(--type-value);--lh:1;margin:0}
.im-low .check .switch{flex:none;margin:0}
/* the bar: a hidden button takes no room, and on a phone the buttons stay in one row */
#audioDlg #aeDock.gone{display:none}          /* stronger than the narrow icon-button rule, which would show it */
/* the tools dock is as tall as its tool needs (the Spectra stays small, so the picture stays big), and eases between heights */
#audioDlg.afull .ae-main{transition:transform var(--ae-move) var(--ease-out),opacity var(--ae-ms) var(--ease-ui),max-height var(--ae-move) var(--ease-out)}
#audioDlg.afull[data-tool=eq] .ae-main,#audioDlg.afull[data-tool=imager] .ae-main,#audioDlg.afull[data-tool=noise] .ae-main{max-height:min(440px,50dvh)}
#audioDlg.afull .ae-main{max-height:min(440px,50dvh)}

/* EQ: bands are added and removed from one small pill, an icon and a divider, then + and - */
.band-pill{display:inline-flex;align-items:center;height:32px;border:1px solid var(--line);border-radius:var(--r-ctl);background:var(--panel2);overflow:hidden}
.band-pill .bp-ic{display:grid;place-items:center;width:34px;height:100%;color:var(--muted)}
.band-pill svg{width:16px;height:16px}
.band-pill .bp-sep{align-self:stretch;width:1px;background:var(--line);margin:var(--gap-tight) 0}
.band-pill .bp-b{display:grid;place-items:center;width:34px;height:100%;padding:0;border:0;background:none;color:var(--ink);cursor:pointer;transition:background-color var(--ae-quick) var(--ease-color),color var(--ae-quick) var(--ease-color),transform var(--t-hover) var(--spring-hover)}
.band-pill .bp-b+.bp-b{border-left:1px solid var(--line)}
.band-pill .bp-b:hover:not(:disabled){background:var(--accent-soft);color:var(--accent)}
.band-pill .bp-b:active:not(:disabled){transform:scale(.88)}
.band-pill .bp-b:disabled{opacity:var(--inactive);cursor:default}
.band-pill .bp-b:focus-visible{outline:2px solid var(--accent);outline-offset:-2px}
/* full screen: only Spectra gets the big picture. Every other tool shows its whole window (no scrolling) under a smaller picture. */
#audioDlg.afull .ae-pbody{min-height:395px}
#audioDlg.afull .ae-panes{min-height:0}
#audioDlg.afull .ae-main,#audioDlg.afull[data-tool=eq] .ae-main,#audioDlg.afull[data-tool=imager] .ae-main,#audioDlg.afull[data-tool=noise] .ae-main{max-height:calc(100dvh - 232px)}
#audioDlg.afull[data-tool=spec] .ae-pbody{min-height:0}
#audioDlg.afull[data-tool=spec] .ae-main{max-height:min(300px,34dvh)}
#audioDlg.afull .ae-tool{--row-px:10px;--row-py:5px}
@container aedlg (max-width:728px){#audioDlg.afull .ae-main,#audioDlg.afull[data-tool=spec] .ae-main{max-height:50dvh}#audioDlg.afull .ae-pbody{min-height:0}}
/* narrow, not full screen: the dialog keeps one fixed height and never scrolls, so Done and Cancel always show. The picture gives way first (150px down to 120px, where the rows are set with the transport below), then the tool body scrolls inside the window. */
@container aedlg (max-width:728px){
  #audioDlg:not(.afull) .dlg.editor.ae{height:94dvh;max-height:94dvh;overflow:hidden}
  #audioDlg:not(.afull) .ae-wave{height:auto;min-height:0;align-self:stretch}
  #audioDlg:not(.afull) .ae-main{grid-template-rows:auto minmax(0,1fr);height:100%;min-height:0}
  #audioDlg:not(.afull) .ae-win{height:100%;min-height:0}
  #audioDlg:not(.afull) .ae-pbody{flex:1 1 auto;height:auto;min-height:0;overflow-y:auto;overscroll-behavior:contain}
}
/* EQ, narrow: the graph keeps a usable height. Below 980px the band is two columns (its Band row across the top, then Type and Frequency, then Gain and Width), the same two-column narrow rule Fades and Noise use, so no slider is squeezed to nothing */
#aePaneEq{container:eq/inline-size}
/* the band is two columns: its Band row across the top, then Type and Frequency, then Gain and Width, the same two-column narrow rule Fades and Noise use. A pane under 635px (a 761px to 991px screen) takes it; the wide layout holds Gain and Width at 90px or more only from 634.5px, and so does the 760px mode, whose tool list is gone and whose pane is wider */
@container eq (max-width:634.5px){
  .eq-cells{grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:var(--gap-card)}
  .eq-band.ae-card{--eq-col-gap:var(--gap-card)}
  .eq-bn{grid-column:1/-1;flex-direction:row;align-items:center;justify-content:space-between}
  .eq-band .eq-cell{min-width:0}
  .eq-band select{width:100%}
}
@container aedlg (max-width:728px){          /* the narrow layout's pane is wider than 635px, and the band is two columns here too */
  #audioDlg:not(.afull) .eq-main>.eq-stage{flex:none;height:clamp(160px,36dvh,240px)}          /* where the tool body scrolls the graph keeps a usable height */
  .eq-cells{grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:var(--gap-card)}
  .eq-band.ae-card{--eq-col-gap:var(--gap-card)}
  .eq-bn{grid-column:1/-1;flex-direction:row;align-items:center;justify-content:space-between}
  .eq-band .eq-cell{min-width:0}
  .eq-band select{width:100%}
}

/* ---- full screen, both editors: no title bar. Small glass chips float at the top; the controls and the tools sit in glass rows at the bottom. ---- */
#audioDlg.afull .ed-head{background:none;border:0;box-shadow:none;-webkit-backdrop-filter:none;backdrop-filter:none;padding:0;justify-content:flex-end;pointer-events:none;align-items:flex-start}
#audioDlg.afull .ed-head::before{display:none}
#audioDlg.afull .ed-head .t-block{display:none}
#audioDlg.afull .ed-head .ed-tools{pointer-events:auto;margin:0}
#audioDlg.afull .ed-head .btn,.app.fs .transport .btn:not(.primary),.app.fs .transport .icon-btn:not(.play){background:var(--glass-bg);-webkit-backdrop-filter:var(--glass-blur);backdrop-filter:var(--glass-blur);border:1px solid var(--glass-edge);color:var(--ink);box-shadow:var(--glass-shadow)}
#audioDlg.afull .ed-head .btn:disabled:not(.btn-group:not(:has(>:is(button,input):enabled))>*){opacity:var(--inactive)}          /* a button in a group that is switched off as a whole is not dimmed again (the group is) */
/* glass that only full screen switches on keeps the off blur outside it (see --glass-off); the timeline and the tool window hold menus and tips, so they stay none outside full screen and their own opacity is never faded while their glass switches */
.app .transport,#audioDlg .ed-head .btn,#audioDlg .ed-head .btn-group{-webkit-backdrop-filter:var(--glass-off);backdrop-filter:var(--glass-off)}
/* the score player's controls: one glass row above the timeline, the same recipe as the Audio Editor's */
.app.fs .transport{left:calc(var(--fs-gap) + var(--fs-left));right:calc(var(--fs-gap) + var(--fs-right));bottom:calc(var(--tl-h) + var(--fs-edge) + var(--gap-card));padding:var(--gap-head) var(--gap-field);gap:var(--gap-head);border:1px solid var(--glass-edge);border-radius:var(--r-win);background:var(--glass-bg);-webkit-backdrop-filter:var(--glass-blur);backdrop-filter:var(--glass-blur);box-shadow:var(--glass-shadow),var(--shadow-float);color:var(--ink);text-shadow:none;isolation:isolate}
.app.fs .transport .info,.app.fs .transport .time span{color:var(--muted)}
.app.fs .transport .icon-btn,.app.fs .transport .btn{box-shadow:none}
.app.fs .transport .icon-btn:not(.play),.app.fs .transport .btn:not(.primary){background:var(--panel2);border-color:var(--line);-webkit-backdrop-filter:none;backdrop-filter:none}
.app.fs .transport kbd{background:var(--panel2);border-color:var(--line);color:var(--muted)}
.app.fs.fs-min .transport{bottom:var(--fs-edge)}
@container stagecol (max-width:760px){.app.fs .transport{padding:var(--gap-tight) var(--gap-card);border-radius:var(--r-lg);bottom:calc(var(--tl-h) + var(--fs-edge) + var(--gap-head))}}
/* the export window floats over the editor, which stays faintly visible behind it */
#aeExpDlg{background:color-mix(in srgb,var(--bg) 52%,transparent);-webkit-backdrop-filter:var(--glass-blur);backdrop-filter:var(--glass-blur);place-items:center}

/* a little more room: under every group's last row (before the divider), and between a group's heading and its first row of toggles */
.group-body>.field.fade-pair{margin-top:var(--gap-card)}
/* Bypass dims every lit module (Level and Fades too); a module that is already off stays as quiet as it was */
.ae-proc.bp.off .ae-tn{opacity:var(--inactive)}

/* ----- Export audio: the Advanced fold (sample rate, metadata) ----- */
.adv{display:grid;grid-template-columns:minmax(0,1fr)}
.fa{display:grid;grid-template-rows:0fr;transition:grid-template-rows var(--ae-move) var(--ease-out)}
.fa.open{grid-template-rows:1fr}
.fa-in{overflow:hidden;min-height:0;opacity:0;transition:opacity var(--ae-ms) var(--ease-ui)}
.fa.open>.fa-in{opacity:1}
.fa.open>.fa-in{padding:var(--gap-label) var(--gap-label) calc(var(--gap-label) + var(--hair));margin:0 calc(-1 * var(--gap-label))}
.tag-grid{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:var(--gap-tight) var(--gap-card);padding:var(--gap-tight) var(--gap-label) var(--gap-label);margin:0 calc(-1 * var(--gap-label))}
.tag-grid.inner{padding:var(--gap-tight) 0 0;margin:0}
.tag-grid input{padding-top:var(--gap-label);padding-bottom:var(--gap-label);font-size:var(--type-body)}
.tag-grid .check{padding:var(--gap-sub) 0}
.tag-sub{display:grid}
.tag-grid .c2{grid-column:span 2}.tag-grid .c3{grid-column:span 3}.tag-grid .c4{grid-column:span 4}.tag-grid .c6{grid-column:1/-1}
.tag-grid .field{min-width:0;margin:0}
.tag-grid .field label{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.tag-grid .check{display:flex;align-items:center;gap:var(--gap-head);font-size:var(--type-small);color:var(--ink);cursor:pointer;min-width:0;--lh:1.25}
@media (max-width:420px){.tag-grid .c3{grid-column:1/-1}}
@media (prefers-reduced-motion:reduce){.fa,.fa-in{transition:none}}
/* ----- Imager balance: say what the sound is like now, and mark on the slider where it becomes even ----- */

/* ----- a button that is greyed out but still tells you why (hover, focus or click) ----- */
.btn.soft{position:relative;cursor:default;color:color-mix(in srgb,currentColor calc(var(--inactive) * 100%),transparent);background:color-mix(in srgb,var(--panel2) calc(var(--inactive) * 100%),transparent);border-color:color-mix(in srgb,var(--line) calc(var(--inactive) * 100%),transparent)}
.btn.soft::after{content:attr(data-why);position:absolute;right:0;top:calc(100% + var(--gap-head));width:max-content;max-width:min(260px,70vw);padding:var(--gap-head) var(--gap-set);border-radius:var(--r-ctl);background:var(--ink);color:var(--bg);font-size:var(--type-small);font-weight:400;--lh:1.4;text-align:left;box-shadow:var(--shadow);opacity:0;transform:translateY(-4px);pointer-events:none;z-index:40;transition:opacity var(--ae-quick) var(--ease-ui),transform var(--t-hover) var(--spring-hover)}
.btn.soft:hover::after,.btn.soft:focus-visible::after,.btn.soft.say::after{opacity:1;transform:none}
.btn.soft:not([data-why])::after,.btn.soft[data-why=""]::after{display:none}
@media (prefers-reduced-motion:reduce){.btn.soft::after{transition:none}}
#aeExpDlg{overflow-x:hidden}

/* ----- the busy chip: what it is doing, and how far along ----- */
.busybar{display:block;position:relative;width:84px;height:4px;border-radius:99px;background:var(--line);overflow:hidden}
.busybar b{display:block;height:100%;width:0;border-radius:inherit;background:var(--accent);transition:width var(--ae-move) var(--ease-out)}
.chip.settle .chip-name{animation:settle .65s var(--ease-out) .08s backwards}
@media (prefers-reduced-motion:reduce){.busybar b{transition:none}.chip.settle .chip-name{animation:none}}


/* Peak and Loudness share one cell, so the one leaving stays where it is and wipes up while the one arriving fades in at the same place, rather than sliding down under a growing panel */
.fa-stack{display:grid}
@media (min-width:761px){.fa-stack>.fa{grid-template-rows:1fr}.fa-stack>.fa:not(.open)>.fa-in{visibility:hidden;transition:opacity calc(var(--ae-ms) * .55) var(--ease-ui),visibility 0s var(--ae-ms)}}
.fa-stack>.fa.open>.fa-in{transition:opacity var(--ae-ms) var(--ease-ui) calc(var(--ae-ms) * .15)}          /* folds that share a place pass the way the Imager's two views do (the same times and curve): the old one is mostly gone before the new one comes up, so two sets of words are never half-visible on top of each other */          /* every fold keeps its full height, hidden, so the stack is as tall as its tallest fold in every mode and the card never changes height when a fold opens or shuts (the narrow layout scrolls and keeps its own) */
.fa-stack>.fa{grid-area:1/1;align-self:start}
@keyframes note-pulse{from{opacity:.45}to{opacity:1}}
/* the Level summary under the meter: loudness, peak and change, before → after */
.lv-sum{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:var(--gap-head);margin-top:var(--gap-head);padding-top:var(--gap-head);box-shadow:inset 0 1px 0 var(--hairline)}
.lv-sum>div{min-width:0}
.lv-sum span{display:block;font-size:var(--type-note);font-weight:600;letter-spacing:.04em;text-transform:uppercase;color:var(--muted)}
.lv-sum b{display:block;margin-top:var(--gap-label);font-size:var(--type-value);font-weight:600;color:var(--ink);font-variant-numeric:tabular-nums;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}

@keyframes lim-nudge{0%,100%{box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--neutral) 22%,transparent),0 0 0 0 color-mix(in srgb,var(--accent) 0%,transparent)}45%{box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--neutral) 22%,transparent),0 0 0 6px color-mix(in srgb,var(--accent) 28%,transparent)}}
#aeDrFold.open>.fa-in{padding:var(--gap-sub) var(--gap-label) 0}

/* ==================== 18. AUDIO EDITOR: picture, tool window and tools (the current design; it refines everything above) ==================== */
:root{--ae-margin:32px;--ae-floor:362px;--ae-chrome:226px;--ae-wave:170px;--ae-body:calc(round(down,max(182px,min(var(--ae-floor),calc(100dvh - var(--ae-margin) - var(--ae-chrome) - var(--ae-wave)))) - 2px,4px) + 2px);--ae-pad:clamp(6px,calc((var(--ae-body) - var(--ae-floor) + 24px) / 2),12px)}          /* the tool window's height (always 2px over a multiple of 4px, so that two cards stacked with --gap-card between them each get a whole, even share), set here once, and the picture's: both are fixed sizes, whatever the screen. --ae-floor is the height the tallest tool needs (Level, with its Meter, and Imager are the tallest, 362px). --ae-chrome is everything in the dialog that is not the picture or the tool body (padding, head, bar, footer, status bar). On a screen too short for both, the tool body is what gets shorter: the tool keeps its full size and scrolls inside it. */
.dlg.editor.ae,.dlg.editor.pe{padding:var(--gap-field) var(--gap-group);gap:var(--gap-card)}          /* the Audio Editor and the PDF Editor share one frame: the same padding, the same gap, the subtitle tight under the title */
/* In and Out: where the sound comes in and goes out. The cable always runs between them, through whatever is lit. */
.ae-end{display:flex;align-items:center;gap:var(--gap-head);height:22px;margin:var(--gap-sub) 0;font-size:var(--type-note);font-weight:600;letter-spacing:.05em;text-transform:uppercase;color:var(--muted)}
.ae-end i{flex:none;width:16px;height:16px;margin-left:calc(var(--gap-sub) + var(--hair));border:2px solid var(--accent);border-radius:50%;background:var(--panel2);box-shadow:0 0 0 3px var(--accent-soft)}
/* the tool window: head, a line, the tool, a status bar. The head, the line and the tool slide together. */
.ae-win{padding:0;min-height:0;overflow:hidden;position:relative;display:flex;flex-direction:column}
.ae-panes{min-height:0}
:root{--ae-head:56px}
.ae-top{position:relative;flex:none;height:var(--ae-head);overflow:clip}
@container aedlg (min-width:729px) and (max-width:790px){.ae-top{--ae-head:72px}}          /* the pane is narrow enough for a subtitle to wrap to two lines (Spectra's): the head holds two lines with the same room above and below as one, the same for every tool so the head never changes size as the tool does */
.ae-win .ae-phead,.ae-phead{position:absolute;inset:0;margin:0;min-height:0;padding:0 var(--ae-side);display:flex;align-items:center;justify-content:space-between;gap:var(--gap-field)}
.ae-pt{min-width:0}
.ae-rule{display:block;flex:none;height:1px;background:var(--hairline)}
.ae-rule.ghost{position:absolute;left:0;right:0;pointer-events:none}
.ae-pbody{position:relative;flex:none;height:var(--ae-body);min-height:0;overflow:hidden;padding:0}
.ae-pane{height:100%;padding:var(--ae-pad) var(--ae-side);overflow:hidden}          /* the space above the cards and below them are one value: 12px, down to 6px when the window is up to 12px shorter than the tool, so neither is ever a sliver the other is not */
.ae-stat{flex:none;display:flex;align-items:center;gap:var(--gap-set);box-sizing:border-box;height:28px;padding:0 var(--ae-side);box-shadow:inset 0 1px 0 var(--line);font-size:var(--type-body);--lh:1.3846;color:var(--muted)}          /* 28px with its rule drawn inside and an 18px line, so its content sits on whole pixels */
.ae-chain{display:flex;align-items:center;gap:var(--gap-head);min-width:0;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
.ae-chain b{padding:0 var(--gap-head);border-radius:999px;background:var(--accent-soft);color:var(--accent);font-size:var(--type-small);line-height:16px;font-weight:500}
.ae-chain svg{flex:none;width:12px;height:12px;opacity:.7}
.ae-win .ae-card{background:color-mix(in srgb,var(--ink) 3%,var(--panel2))}
/* the picture, with the transport floating over its lower edge as glass (the picture keeps its drawing above it) */
@container aedlg (min-width:729px){
  #audioDlg:not(.afull) .ae-wave{height:var(--ae-wave)}          /* the picture never changes size */
  #audioDlg:not(.afull) .ae-main{margin-top:calc(-1 * (var(--gap-set) + var(--hair)))}          /* the tool window sits a little closer to the picture, so a tool has the room it was drawn for on a laptop screen; the saving is an even number of pixels, so the dialog stays centered on whole pixels */
}
/* the transport: one glass bar over the picture's lower edge at every width; narrower windows only tighten its gaps */
#audioDlg:not(.afull) .ae-bar{position:relative;z-index:3;flex-wrap:nowrap;height:48px;margin:calc(-1 * var(--ae-bar-lift)) var(--gap-head) var(--gap-head);padding:0 var(--gap-head) 0 var(--gap-card);gap:var(--gap-set);border:1px solid var(--glass-edge);border-radius:var(--r-lg);background:var(--glass-bg);-webkit-backdrop-filter:var(--glass-blur);backdrop-filter:var(--glass-blur);box-shadow:var(--glass-shadow);isolation:isolate}
#audioDlg:not(.afull) .ae-bar .btn,#audioDlg:not(.afull) .ae-bar .seg,#audioDlg:not(.afull) .ae-bar .icon-btn:not(.play){background:var(--glass-ctl-bg)}
/* a screen shorter than the picture + the floor + --ae-chrome + --ae-margin (796px): the blank space around the dialog goes first (--ae-margin is 0, so the dialog is as tall as the screen lets it be, up to its full size). Only on a screen too short for even that does the tool window get shorter than its tool, and the tool keeps its full size and scrolls inside the window, as it does in the narrow layout */
/* wide layout: a tool that needs more than the body's height (Imager, Emulator, and Noise reduction when the pane is narrow) scrolls inside the window at any screen height, never clipped; with nothing to scroll there is no bar */
@container aedlg (min-width:729px){
  #audioDlg:not(.afull) .ae-pbody{overflow-y:auto;overscroll-behavior:contain}
  #audioDlg:not(.afull) .ae-pane{height:clamp(calc(var(--ae-floor) - 12px),var(--ae-body),var(--ae-floor));overflow:visible}
}
@media (max-height:795px){
  :root{--ae-margin:0px}
  #audioDlg:not(.afull):not(.head-in-bar){padding-top:env(safe-area-inset-top,0px);padding-bottom:env(safe-area-inset-bottom,0px)}          /* the page's own 16px above and below goes too (the wide layout only: the dialog's own state, set where its width is measured, since a rule cannot ask about the width of the box it styles) */
}
@container aedlg (min-width:729px){#audioDlg:not(.afull) .ae-rail{contain:size;overflow-y:auto;overscroll-behavior:contain;scrollbar-gutter:stable}}          /* the scrollbar's room is always kept, so the buttons and the selection outline keep one width whether or not the list scrolls */          /* the tool list never makes the window taller: on a screen too short for it, it scrolls */
@container aedlg (max-width:728px){.ae-win{overflow:visible;--ae-side:var(--gap-set);--ae-narrow:1}.ae-top{height:auto;padding:var(--gap-set) 0;overflow:visible}.ae-win .ae-phead,.ae-phead{position:static;inset:auto;height:auto;padding:0 var(--ae-side)}.ae-pbody{height:auto;overflow:visible}.ae-pane{height:auto;padding:var(--ae-side)}}
/* full screen keeps its own rows: the picture gives way so the whole tool window always shows */
#audioDlg.afull{--ae-body:calc(round(down,max(182px,min(var(--ae-floor),calc(100dvh - 392px))) - 2px,4px) + 2px);--ae-pad:clamp(6px,calc((var(--ae-body) - var(--ae-floor) + 24px) / 2),12px)}          /* the same rule as the window: the tool is one size, and on a screen too short for it the tool window gets shorter and the tool scrolls inside it */
@container aedlg (min-width:729px){#audioDlg.afull .ae-pbody{overflow-y:auto;overscroll-behavior:contain}#audioDlg.afull .ae-pane{height:clamp(calc(var(--ae-floor) - 12px),var(--ae-body),var(--ae-floor));overflow:visible}}
#audioDlg.afull .ae-stat{display:none}
#audioDlg.afull[data-tool] .ae-main,#audioDlg.afull .ae-main{max-height:none;overflow:visible}
#audioDlg.afull .ae-pbody,#audioDlg.afull[data-tool] .ae-pbody{min-height:0}
/* Noise reduction: the second step is the button itself. Removal's two small sliders fold away when Reduction is Off. */
/* Spectra: the tools sit in one roomy row, the edits fill the rest */
/* ----- The footer row (shared): a label and a switch on one row, under a hairline, pinned to the bottom of its card. The space above the switch (hairline to switch) and below it (switch to the card's padding edge) is the same: --gap-set, the card's own padding. ----- */
.foot-row{margin-top:auto;padding-top:var(--gap-set);box-shadow:inset 0 1px 0 var(--hairline);display:flex;align-items:center;justify-content:space-between;gap:var(--gap-set)}
/* a card held taller than its content: a footer row pins to the bottom; otherwise its groups spread evenly; a card with one row centers it */
#aeEmCard{--card-gap:0px}          /* this card spaces its own parts */
#aeEmCard>.mt-steps{flex:1;justify-content:space-between}
/* at phone width the Center low notes row stays on one line, so its switch keeps equal space above and below (the slider narrows instead) */
.sp-grid{display:flex;flex-direction:column;gap:var(--gap-card);height:100%}
.sp-sel{flex:none}
.sp-tools{display:grid;grid-template-columns:auto minmax(0,1.2fr) minmax(0,1fr);gap:var(--gap-set);align-items:center}
.sp-tools .btn,.sp-tools .seg{height:var(--h-m);box-sizing:border-box}
.sp-draw{display:inline-flex;align-items:center;justify-content:center;padding:0 var(--gap-set);font-size:var(--type-body);border-radius:var(--r-ctl)}
.sp-seg label{display:flex}
.sp-seg label>span{flex:1;height:100%}
#aePaneSpec{container:spec/inline-size}
#aePaneEmu{container:emu/inline-size}
@container spec (max-width:469.5px){.sp-tools{grid-template-columns:auto minmax(0,1fr)}.sp-tools>.sp-seg:last-child{grid-column:1/-1}}          /* two rows, not three: the button that starts the row stays its own size beside the first choice, and the last choice takes the row under */
.sp-lcard{flex:1 1 0;min-height:0}
.sp-list{padding:var(--gap-sub);align-content:start}
.sp-sel .fa.open>.fa-in{padding:var(--gap-label) var(--gap-sub) var(--gap-sub);margin:0 calc(-1 * var(--gap-label)) calc(-1 * var(--gap-sub))}          /* the 2px of room for the thumb's shadow under the slider is not part of the body, so the box ends where the thumb does (the 2px moves above the label, so the fold keeps its height) */
/* EQ: the picture takes whatever room is left, so opening EQ Match never makes the window taller */
#aePaneEq:not([hidden]){display:flex;flex-direction:column}
#aePaneEq .eq-fold{flex:none}
.eq-fold-in>.ae-card{flex:none}
.tool-grid>.card-fold.shut{margin-top:calc(-1 * var(--gap-card))}          /* a card that folds open sits a card gap below the card above it (the grid's gap); while its fold is shut it takes no gap */
.tool-grid.eq-grid{display:flex;flex-direction:column;flex:1 1 auto}          /* EQ: the graph card takes the spare height, the band and Match fold open under it */
.mt-steps.two{gap:var(--gap-head) calc(var(--gap-card) * 2)}
/* the graph card: the tools on top (12px above them, from the card's padding, and 12px below), then the graph edge to edge under one line, running to the card's bottom edge; it takes whatever room is left */
.eq-main{display:flex;flex-direction:column;gap:var(--gap-set);flex:1 1 auto;min-height:0;overflow:hidden}
.eq-main>.eq-top{flex:none;margin:0}
.eq-main>.eq-stage{flex:1 1 0;min-height:64px;height:auto;margin:0 calc(-1 * var(--gap-field)) calc(-1 * var(--gap-set));border-top:1px solid var(--hairline)}
/* Imager: both columns end together */
.im-cols{--scope-col:244px;height:100%;grid-template-columns:minmax(0,1fr) var(--scope-col);gap:var(--gap-card);align-items:stretch}
.im-ctl{display:flex;flex-direction:column;gap:var(--gap-card);min-height:0}          /* Balance keeps its height and sits on the scope's bottom line; Width takes the spare height, and its footer row pins to the bottom of its card */
#aeWidthCard{flex:1 1 auto;display:flex;flex-direction:column}
#aeBalCard{flex:none;align-content:space-between}
.im-views{display:grid}          /* the two views share one place, as tall as the taller; each is centered in it, so each is balanced in its own state */
.im-view .field{margin:0}
.im-ctl .field{margin:0}
/* ==================== The slider row: words beside a slider line up with it by themselves ====================
   .sl-row is any row that holds a slider and words beside it (end labels, a label, a value). Every word in it is trimmed to its letters (the shared trim) and the row centers it on the slider,
   whose box is its thumb around its track, so the letters' middle is the track's middle at any size, font, or wording, with no number of its own. Values beside a slider are regular weight.
   .sl-in lays a slider out with its end words beside the track (Apple's end markers): the left word on the row's left line, the track, the right word, then a value; a middle that means
   something (Width's Normal, Balance's Center) is a short tick under the track at the middle, clear of the handle. A scale of values (numbers, a labeled value like Auto) stays under the slider. */
.sl-row{align-items:center}
.sl-row>:not(input,label,.sl-end,.tick),.sl-row>label>:not(input){text-box:trim-both cap alphabetic;margin-block:var(--trim-t) var(--trim-b);height:var(--trim-h);align-self:center}
.sl-row output{font-weight:400;color:var(--ink);font-size:var(--value-fs);font-variant-numeric:tabular-nums}
.sl-in{display:grid;grid-template-columns:auto minmax(0,1fr);grid-template-rows:auto;grid-auto-flow:column;grid-auto-columns:auto;column-gap:var(--gap-head);min-width:0}
.sl-in>*{grid-row:1}
.sl-in>input{grid-column:2;margin:0;min-width:0}
.sl-in>output{text-align:right;margin-left:var(--gap-label);min-inline-size:var(--val-w)}
#audioDlg .sl-in>.sl-end.tick{grid-column:2;grid-row:2;justify-self:center;align-self:start;display:flex;align-items:flex-start;width:1px;height:var(--tick-h);margin:var(--gap-sub) 0 0;padding:0;border:0;border-radius:0;background:none}          /* the tick sits in its own row under the track at the middle, so it takes real room: the slider's body (thumb to tick) is what the card centers */
#audioDlg .im-view .sl-in>.sl-end.tick{height:calc(round(up, calc(var(--gap-sub) + var(--tick-h)), 2px) - var(--gap-sub))}          /* views that share one slot are each centered in it: a view's height is a whole number of pairs of pixels, so its centered top is a whole pixel (the tick is drawn the same; only the room under it grows by a pixel) */
.sl-in>.sl-end.tick>i{display:block;width:1px;height:var(--tick-h);background:var(--muted);opacity:.6}
.field.row3{margin-bottom:var(--gap-sub)}
.im-view.row3-set{row-gap:var(--gap-sub);margin-block:calc(var(--gap-sub) * -1)}          /* Imager's three rows sit a little further apart; the extra comes out of the space above and below them, so the card keeps its height */
.head-note{color:var(--muted);font-size:var(--type-small);font-variant-numeric:tabular-nums;white-space:nowrap}          /* a readout beside a heading's text (Balance's shift), shown only when it has something to say */
.head-note:empty{display:none}
.bal-meter{display:grid;grid-template-columns:auto minmax(0,1fr) auto;gap:var(--gap-set);align-items:center;margin:0;padding:var(--gap-set);border-radius:var(--r-ctl);background:color-mix(in srgb,var(--ink) 4%,transparent);box-shadow:var(--shadow-inset),inset 0 0 0 1px color-mix(in srgb,var(--ink) 6%,transparent);font-size:var(--type-small);color:var(--muted);font-variant-numeric:tabular-nums;transition:opacity var(--ae-ms) var(--ease-ui)}          /* a readout, not a control: the meters sit in an inset panel with --gap-set inside on all four sides (its rows are trimmed to their letters and bars, so the room is the same on every side) */
.bal-meter.none{opacity:var(--inactive)}
.bm-name{justify-self:end}          /* L and R hug their bars, so the space from a letter to its bar is the space from the bar to its value */
.bm-val{justify-self:start;text-align:left;color:var(--muted);font-weight:400}
.bm-val::before{content:'\2212 00.0dB';display:block;height:0;overflow:hidden;visibility:hidden}          /* the value column is always as wide as the widest reading (digits are all one width), and a value starts the same --gap-set after its bar as the bar starts after L, so a longer number never moves the bar */
.bm-track{position:relative;display:block;height:8px;border-radius:99px;background:color-mix(in srgb,var(--ink) 10%,transparent);overflow:hidden}
.bm-track b{position:absolute;left:0;top:0;bottom:0;width:0;border-radius:99px;background:color-mix(in srgb,var(--ink) 24%,transparent);transition:width var(--ae-move) var(--ease-out)}
.im-scope{min-height:0;gap:var(--gap-card)}
.im-scope canvas{flex:1 1 0;min-height:0;aspect-ratio:auto;height:auto}
/* ==================== Tool grid: a tool's cards sit on one shared set of lines ====================
   .tool-grid is the tool's grid, its cards --gap-card apart. A card with .on-grid lays its parts on the tool's own rows (heading, body, foot), so the headings of cards side by side share one row,
   their bodies start on one line, and their last parts end on one line, whatever each card holds. The space under a heading is the shared .t-head rule; a part adds no margin of its own to line up.
   A tool names its columns and rows once, and changes them by the width of its own pane (a container query), never by the width of the screen. */
.tool-grid{display:grid;gap:var(--gap-card);height:100%;min-height:0}
.tool-group{display:grid;gap:var(--gap-card)}          /* cards that stand in a row of a tool grid together, sharing rows of their own (Level's Normalize and Gain) */
.ae-card.on-grid{display:grid;grid-row:span 3;grid-template-columns:minmax(0,1fr);grid-template-rows:subgrid;row-gap:0}
#audioDlg .tool-grid .ae-card:not(.on-grid,.own-grid)>:is(:first-child,.t-head+*):not(.t-head,.foot-row,[hidden],.nr-prog,.tip,.t-note,.fa:not(.open),.fa-stack):not(:has(~ :not(.t-head,.foot-row,[hidden],.nr-prog,.tip,.t-note,.fa:not(.open),.fa-stack))){flex:1 0 auto;margin-block:0;align-content:center}          /* on the grid a card's parts reach its content edges: a card's only part fills the body and centers what it holds, so its letters and controls stay centered (the balanced body) */

/* ----- Level: Normalize and Gain share the top rows; the Meter is the flexible card and takes the spare height ----- */
#aePaneLevel{container:level/inline-size}
.lv-grid{grid-template-columns:minmax(0,1fr);grid-template-rows:1fr 1fr}          /* Normalize and Gain over the Meter share the column evenly (the column rule); each takes more only when its content needs it */
.lv-top{grid-template-columns:minmax(0,1.6fr) minmax(0,1fr)}
.lv-meter{grid-column:1/-1}
@container level (max-width:659px){          /* too narrow for the Normalize choice at its full size: Normalize takes the wider share and the choice tightens, so it stays on the heading's row */
  .lv-top{grid-template-columns:minmax(0,2.3fr) minmax(0,1fr)}
  #audioDlg .ae-card>.t-head.lv-head>.seg span{padding:0 var(--gap-sub)}
}
@container aedlg (max-width:728px){#audioDlg .sp-grid{min-height:0}}          /* the pane is a flex column here, so its grid grows by flex, not by a percentage of the pane */
@container level (max-width:519px){          /* too narrow even so: the choice takes its own full row under the heading, and each card keeps its own rows, so Gain's number stays under its heading */
  .lv-top{grid-template-columns:minmax(0,1.6fr) minmax(0,1fr)}
  .lv-head>.seg{flex:1 1 100%}
}
@container level (max-width:399px){          /* the phone's one column: no card stands beside another, so each keeps its own rows */
  .lv-grid{height:auto;grid-template-rows:none}
  .lv-top{grid-template-columns:minmax(0,1fr);grid-template-rows:none}
}

/* Normalize: the heading holds the choice; the folds take the body and the foot, so the Limiter's footer row ends on Gain's last line */
#aeNormCard{overflow:hidden}
.ae-card>.fa-stack{flex:1 1 auto;min-height:0}          /* a stack of folds is the card's whole body: the open fold fills it and lays out its own parts */
#aeNormCard .fa-stack>.fa{align-self:stretch}
.lv-peak{display:grid;grid-template-rows:1fr auto 1fr}
.lv-peak>.lv-target{grid-row:2}
.lv-peak>.lv-note{grid-row:3;align-self:end;margin:0}          /* Peak's target is always centered; its note sits in the spare room under it, so a note appearing moves nothing */
.fa-stack>.fa>.fa-in{height:calc(100% + var(--gap-sub));padding:0 var(--gap-label) var(--gap-sub);margin:0 calc(-1 * var(--gap-label)) calc(-1 * var(--gap-sub))}          /* the 2px of room for a ring under the controls is not part of the body, so the box ends where its last row does */
.lv-target{display:flex;align-items:center;justify-content:space-between;gap:var(--gap-card);font-size:var(--type-value);transition:opacity var(--ae-ms) var(--ease-ui)}
.lv-target.dim{opacity:var(--inactive)}
.lv-target .num{display:inline-flex;align-items:center;gap:var(--gap-head)}
.lv-target input{height:var(--h-l);text-align:right}          /* the Level boxes sit beside --h-l rows (the menu, the Loudness target), so they are --h-l too */
.lv-target em{font-style:normal;color:var(--muted)}
.lv-loud{display:grid;grid-template-columns:minmax(0,1fr) auto;grid-template-rows:auto 1fr auto auto;gap:0 var(--gap-card);align-items:start;height:100%}
#audioDlg .lv-loud select{width:100%;min-width:0;height:var(--h-l)}          /* as tall as the number box beside it */
.lv-trow{height:var(--h-l)}
.lv-noterow,.lv-limrow{grid-column:1/-1}
.lv-noterow{grid-row:3;margin-bottom:var(--cut-b)}          /* the note's row is always there, so a note appearing moves nothing; it counts as part of the body, which is the menu and its note line */          /* the note's line holds its letters with room under the baseline: the row gives that room back (the metrics' trim), so it ends where its letters do */
.lv-limrow{grid-row:4;margin-top:var(--gap-set)}
.lv-noterow{display:flex;gap:var(--gap-label) var(--gap-set);min-width:0;height:var(--line-s);line-height:var(--line-s);font-size:var(--type-small)}
.lv-note{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-height:16px;transition:color var(--ae-quick) var(--ease-color)}
.lv-noterow .lv-note{margin:0;min-width:0;flex:0 1 auto;height:var(--line-s);line-height:var(--line-s)}
.lv-note.busy{animation:note-pulse 1.4s var(--ease-ui) infinite alternate}
.lv-limrow .check-row{flex:1;min-width:0;cursor:pointer;font-size:var(--type-value)}
.lv-tip-warn{position:absolute;left:var(--tip-x);top:50%;transform:translateY(-50%);font-size:var(--type-small);white-space:nowrap;pointer-events:none}
.lv-limrow.nudge .switch:not(:checked){animation:lim-nudge 2.2s var(--ease-ui) infinite}
@media (prefers-reduced-motion:reduce){.lv-note.busy{animation:none}.lv-limrow.nudge .switch:not(:checked){animation:none;box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--neutral) 22%,transparent),0 0 0 3px color-mix(in srgb,var(--accent) 35%,transparent)}}


/* Meter: heading, bar, scale, then the Loudness and True peak row on the card's last line, with the spare height above it */
.lv-meter{display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:auto minmax(0,1fr) auto auto minmax(0,1fr) auto;row-gap:0}          /* the bar and its scale are one body between two equal spare rows, so the pair is centered between the heading row and the strip's line (--gap-set at the least on each side) */
.lv-meter>.lv-track{grid-row:3}
.lv-meter>.lv-scale{grid-row:4;margin-bottom:calc(var(--gap-set) - var(--inset))}
.lv-meter>.lv-sum{grid-row:6}
.lv-hit{cursor:pointer}
.lv-clip{box-sizing:border-box;height:var(--clip-h);padding:var(--gap-sub) var(--gap-card);border:0;border-radius:99px;background:var(--bad);color:var(--pill-ink);font:600 var(--type-note)/calc(var(--clip-h) - 3 * var(--gap-sub)) inherit;font-family:inherit;cursor:pointer;box-shadow:0 0 10px color-mix(in srgb,var(--clip) 55%,transparent);animation:clippulse 1.2s ease-in-out infinite}
.lv-clip:not(.on){visibility:hidden;animation:none;pointer-events:none}          /* its place is reserved, so True peak never moves when Clip shows */
.lv-track{position:relative;height:14px;border-radius:99px;overflow:hidden;background:var(--line)}
.lv-zone{position:absolute;top:0;bottom:0;right:0;width:25%;background:color-mix(in srgb,var(--clip) 18%,transparent)}
.lv-zone::before{content:'';position:absolute;top:0;bottom:0;right:100%;width:50%;background:color-mix(in srgb,var(--safe) 16%,transparent)}
.lv-ceil{position:absolute;top:0;bottom:0;width:0;border-left:1.5px dashed var(--ink);opacity:.5;pointer-events:none}          /* the ceiling: a dashed tick across the bar */
.lv-fill{position:absolute;left:0;top:0;bottom:0;width:0;border-radius:99px;background:var(--accent);transition:width var(--ae-move) var(--spring-press),background-color var(--ae-quick) var(--ease-color)}
.lv-orig{position:absolute;z-index:2;top:var(--gap-sub);bottom:var(--gap-sub);width:var(--gap-sub);margin-left:calc(var(--hair) * -1);border-radius:var(--r-mark);background:var(--ink);opacity:.55;transition:left var(--ae-move) var(--spring-press)}
.lv-hold{position:absolute;z-index:3;top:var(--hair);bottom:var(--hair);width:calc(var(--gap-sub) + var(--hair));margin-left:calc(var(--hair) * -1.5);border-radius:var(--r-mark);background:var(--ink);opacity:0;box-shadow:0 0 6px color-mix(in srgb,var(--pill-ink) 70%,transparent);transition:opacity var(--ae-ms) var(--ease-ui)}
.lv-meter.good .lv-fill{background:var(--ok)}
.lv-meter.hot .lv-fill{background:var(--bad)}
.lv-meter.good #aePeakNow{color:var(--ok-ink)}
.lv-meter.hot #aePeakNow{color:var(--bad)}
.lv-meter.live .lv-fill{transition:background-color var(--ae-quick) var(--ease-color)}
.lv-meter.live .lv-orig{opacity:.25}
.lv-scale{position:relative;height:16px;--inset:calc((16px - round(calc(var(--cap) * var(--scale-fs)), 1px)) / 2);margin:calc(var(--scale-gap) - var(--inset)) 0 calc(-1 * var(--inset));font-size:var(--scale-fs);color:var(--muted);font-variant-numeric:tabular-nums}          /* the 16px line has the same room above its numbers' letters and below them (--inset), which the margins take back: the scale's box ends where its letters do, --gap-label under the bar */
.lv-scale span{position:absolute;transform:translateX(-50%)}
.lv-scale span:first-child{transform:none}
.lv-scale span:last-child{transform:translateX(-100%)}
.lv-meter>.lv-sum{align-self:end;margin-top:0;padding-top:var(--gap-set)}
.em-view>.lv-sum{margin-top:auto;padding-top:var(--gap-set)}          /* Level's strip sits at the card's bottom; its label sits midway between the divider and the card's bottom edge */
.lv-meter>.lv-sum{grid-template-columns:repeat(2,minmax(0,1fr))}
.em-view>.lv-sum{grid-template-columns:none;grid-auto-flow:column;grid-auto-columns:auto;justify-content:space-between}          /* the Emulator's strip holds as many values as it can set: the first starts at the card's left edge and the last ends at its right edge, so the space either side is the same */
.lv-meter>.lv-sum>div{display:flex;align-items:last baseline;gap:var(--gap-head)}
.em-view>.lv-sum>div{display:grid;align-content:start;row-gap:var(--gap-head)}          /* three values do not fit label-beside-value in a half-width card, so the label stands over its value, as Level's strip does where its columns are narrow */          /* a label sits beside its value, so the strip is one line tall, and the two share a baseline (letters of different sizes, so centering them leaves the smaller one a pixel high) */
.lv-meter>.lv-sum b,.em-view>.lv-sum b{margin-top:0}
.ae-card .lv-big,.ae-card .field>.lv-big{margin:0 0 var(--gap-head)}

/* … in loading messages: three dots that bounce one after another */
.dots i{display:inline-block;font-style:normal;animation:dot-bounce 1.2s var(--ease-ui) infinite}
.dots i:nth-child(2){animation-delay:.15s}
.dots i:nth-child(3){animation-delay:.3s}
@keyframes dot-bounce{0%,55%,100%{transform:translateY(0)}25%{transform:translateY(-.32em)}}
@media (prefers-reduced-motion:reduce){.dots i{animation:none}}

/* export window with two pages that glide past each other */
.pg-dlg{overflow:hidden;padding:0}
.pg-wrap{position:relative;overflow:hidden;transition:height var(--ae-move) var(--ease-out)}
.pg-wrap.moving{transition:none}
.pg{display:grid;gap:var(--gap-field);padding:var(--gap-room) var(--gap-room-x);box-sizing:border-box;position:absolute;left:0;top:0;width:100%}
.pg-sub{gap:var(--gap-card);max-height:calc(100vh - 48px);max-height:calc(100dvh - 48px);overflow:auto;visibility:hidden}
.pg-main{visibility:visible}
.pg-back{display:flex;align-items:center;gap:var(--gap-head);justify-self:start;margin:0 0 0 calc(-1 * var(--gap-label));padding:var(--gap-sub) var(--gap-head) var(--gap-sub) var(--gap-sub);border:0;border-radius:var(--r-ctl);background:none;color:var(--ink);font:inherit;line-height:round(calc(var(--lh) * 1em),1px);cursor:pointer}
.pg-back h2{margin:0;pointer-events:none}
.pg-back i{width:10px;height:10px;margin-left:var(--gap-tight);border-left:2px solid var(--muted);border-bottom:2px solid var(--muted);transform:rotate(45deg);transition:transform var(--ae-move) var(--ease-out),border-color var(--ae-quick) var(--ease-color)}
.pg-back:hover i{transform:rotate(45deg) translate(-2px,2px);border-color:var(--ink)}
.pg-back:focus-visible,.go-row:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.go-row{display:flex;align-items:center;gap:var(--gap-head);width:100%;padding:var(--gap-set) var(--gap-set);border:1px solid var(--line);border-radius:var(--r-card);background:none;color:var(--ink);font:inherit;line-height:round(calc(var(--lh) * 1em),1px);font-size:var(--type-value);text-align:left;cursor:pointer;transition:background-color var(--ae-quick) var(--ease-color),border-color var(--ae-quick) var(--ease-color)}
.go-row span{flex:1}
.go-row em{font-style:normal;font-size:var(--type-body);color:var(--muted)}
.go-row i{width:7px;height:7px;border-right:1.6px solid var(--muted);border-top:1.6px solid var(--muted);transform:rotate(45deg);transition:transform var(--ae-move) var(--ease-out),border-color var(--ae-quick) var(--ease-color)}
.go-row:hover{background:var(--hover-soft);border-color:var(--muted)}.go-row:hover i{transform:rotate(45deg) translate(2px,-2px);border-color:var(--ink)}
.tag-sub .check-row{padding:var(--gap-sub) 0}
@media (prefers-reduced-motion:reduce){.pg-wrap,.pg-back i,.go-row i{transition:none!important}}
.pg .check-row{display:flex;align-items:center;justify-content:space-between;gap:var(--gap-set);cursor:pointer;font-size:var(--type-body);color:var(--ink)}

/* history */
.ed-head{position:relative}
.hist{position:absolute;right:0;top:calc(100% + var(--gap-head));z-index:30;width:min(360px,92vw);display:grid;gap:var(--gap-head);padding:var(--gap-field) var(--gap-field) var(--gap-set);border:1px solid var(--line);border-radius:var(--r-lg);background:var(--panel);box-shadow:var(--shadow-pop)}
.hist[hidden]{display:none}
.hist-top{min-width:0}
.hist-top h3{margin:0;font:500 18px Georgia,serif;line-height:round(1.1em,1px);--lh:1.1}
.hist-list{position:relative;list-style:none;margin:0;padding:0;max-height:min(46vh,380px);overflow:auto;display:block}
.hs-row{position:relative;padding-left:var(--hs-indent)}
.hs-row::before{content:'';position:absolute;left:var(--gap-tight);top:0;bottom:0;width:2px;background:var(--line)}
.hs-row:first-child::before{top:calc(var(--h-m) / 2)}.hs-row:last-of-type::before{bottom:calc(100% - var(--h-m) / 2)}
.hs-main{position:relative;display:flex;align-items:center;gap:var(--gap-head);min-height:34px}
.hs-dot{position:absolute;left:calc(var(--hair) - var(--hs-indent));top:50%;width:var(--hs-dot);height:var(--hs-dot);margin-top:calc(var(--hs-dot) / -2);border-radius:50%;background:var(--panel);border:2px solid var(--muted);box-sizing:border-box;transition:background-color var(--ae-quick) var(--ease-color),border-color var(--ae-quick) var(--ease-color),transform var(--ae-move) var(--ease-out)}
.hs-btn{flex:1;min-width:0;display:block;padding:var(--gap-tight) var(--gap-head);border:0;border-radius:var(--r-ctl);background:none;color:var(--ink);font:inherit;line-height:round(calc(var(--lh) * 1em),1px);font-size:var(--type-body);text-align:left;cursor:pointer;transition:background-color var(--ae-quick) var(--ease-color),color var(--ae-quick) var(--ease-color)}
.hs-btn:hover{background:var(--hover-grey)}
.hs-btn:focus-visible,.hs-more:focus-visible{outline:2px solid var(--accent);outline-offset:1px}
.hs-n{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;transition:opacity var(--ae-ms) var(--ease-color)}
.hs-row em{font-style:normal;font-size:var(--type-note);color:var(--muted)}
.hs-row.cur>.hs-main .hs-dot{background:var(--accent);border-color:var(--accent)}
.hs-row.undone .hs-btn{color:var(--muted)}
.hs-row.target>.hs-main .hs-dot{border-color:var(--accent);background:var(--accent);transform:scale(1.25)}
.hs-row.target>.hs-main .hs-btn{background:color-mix(in srgb,var(--accent) 12%,transparent)}
.hs-row.drop>.hs-main .hs-n{opacity:.45;text-decoration:line-through}
.hs-row.kept>.hs-main .hs-dot{background:var(--accent);border-color:var(--accent)}
.hs-more{flex:none;width:22px;height:22px;display:grid;place-items:center;border:0;border-radius:var(--r-sm);background:none;cursor:pointer;color:var(--muted)}
.hs-more:hover{background:var(--hover-grey);color:var(--ink)}
.hs-more i{width:6px;height:6px;border-right:1.6px solid currentColor;border-bottom:1.6px solid currentColor;transform:rotate(-45deg);transition:transform var(--ae-move) var(--ease-out)}
.hs-row.open .hs-more i{transform:rotate(45deg)}
.hs-sub{display:grid;grid-template-rows:0fr;transition:grid-template-rows var(--ae-move) var(--ease-out)}
.hs-row.open .hs-sub{grid-template-rows:1fr}
.hs-sub ul{min-height:0;overflow:hidden;margin:0;padding:0 0 0 var(--gap-head);list-style:none;opacity:0;transition:opacity var(--ae-ms) var(--ease-color)}
.hs-row.open .hs-sub ul{opacity:1}
.hs-ch{display:flex;align-items:center;gap:var(--gap-head);min-height:28px;padding:0 0 0 var(--gap-head);font-size:var(--type-small);color:var(--muted);border-left:2px solid var(--line)}
.hs-ch span{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;transition:opacity var(--ae-ms) var(--ease-color)}
.hs-ch.drop span{opacity:.5;text-decoration:line-through}
.hs-cb{appearance:none;-webkit-appearance:none;flex:none;width:17px;height:17px;margin:0 var(--gap-sub) 0 0;border:1.6px solid var(--muted);border-radius:var(--r-paper);background:var(--panel) center/12px no-repeat;cursor:pointer;transition:background-color var(--ae-quick) var(--ease-color),border-color var(--ae-quick) var(--ease-color)}
.hs-cb:hover{border-color:var(--ink)}
.hs-cb:checked{background-color:var(--accent);border-color:var(--accent);background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7'/%3E%3C/svg%3E")}
.hs-cb:indeterminate{background-color:var(--accent);border-color:var(--accent);background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.4' stroke-linecap='round'%3E%3Cpath d='M6 12h12'/%3E%3C/svg%3E")}
.hs-cb:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.hs-arrow{position:absolute;left:var(--hs-arrow-x);width:4px;border-radius:var(--r-mark);background:var(--accent);transition:top var(--ae-move) var(--ease-out),height var(--ae-move) var(--ease-out);pointer-events:none}
.hs-arrow::after{content:'';position:absolute;left:50%;bottom:calc(-1 * var(--hair));width:9px;height:9px;border-right:2px solid var(--accent);border-bottom:2px solid var(--accent);transform:translateX(-50%) rotate(45deg) translateY(-2px)}
.hist-foot{display:flex;align-items:center;justify-content:space-between;gap:var(--gap-card);padding-top:var(--gap-label);font-size:var(--type-small);color:var(--muted)}
.hist-foot div{display:flex;gap:var(--gap-tight)}
@media (prefers-reduced-motion:reduce){.hs-arrow,.hs-dot,.hs-btn,.hs-n,.hs-sub,.hs-sub ul,.hs-more i{transition:none}}

/* the pages make room for the one you hold */

.pw-line{position:relative;display:flex}
#pwDlg .dlg{position:relative}
.pw-toast{position:absolute;left:50%;top:50%;bottom:auto;transform:translate(-50%,-50%);z-index:2;pointer-events:none;text-align:center;white-space:nowrap}          /* a toast over the prompt: it takes no room, so the prompt never moves */
.pw-toast.show{transform:translate(-50%,-50%)}
@media (prefers-reduced-motion:no-preference){.pw-line.shake{animation:ledshake var(--ae-ms) var(--ease-out)}}
.pw-line input{flex:1;min-width:0;padding-right:calc(var(--h-s) + var(--gap-head))}
.pw-eye{position:absolute;right:var(--gap-label);top:50%;width:30px;height:30px;margin-top:calc(var(--h-s) / -2);display:grid;place-items:center;border:0;border-radius:var(--r-ctl);background:none;color:var(--muted);cursor:pointer;transition:color var(--ae-quick) var(--ease-color),background-color var(--ae-quick) var(--ease-color)}
.pw-eye svg{width:17px;height:17px}.pw-eye:hover{color:var(--ink);background:var(--hover-grey)}.pw-eye[aria-pressed="true"]{color:var(--accent)}
.pw-file{margin:calc(-1 * var(--gap-tight)) 0 0;font-size:var(--type-body);word-break:break-all}
.t-note.err{color:var(--bad)}

/* ==================== PDF Editor ====================
   The Audio Editor's shape: a tool list on the left, one window on the right. The window has a head (title, what the tool does,
   its buttons), the tool's options, then the pages, then a status bar. Pages look like paper: no card frame, just a soft shadow. */
.dlg.editor.pe{width:min(1040px,96vw);height:min(88vh,880px);max-height:calc(100dvh - 32px);grid-template-columns:minmax(0,1fr);grid-template-rows:auto minmax(0,1fr) auto}
.pe-main{display:grid;grid-template-columns:196px minmax(0,1fr);gap:var(--pe-edge);min-height:0}

/* the tool list: grouped, with the same gliding pill as the Audio Editor */
.pe-rail{align-self:stretch;min-width:0;padding:var(--gap-head);border:1px solid var(--line);border-radius:var(--r-lg);background:var(--panel2)}
.pe-rail-in{position:relative;display:flex;flex-direction:column;gap:var(--gap-sub)}
.pe-rail-h{margin:var(--gap-set) 0 var(--gap-label) var(--gap-card);font-size:var(--type-note);font-weight:600;letter-spacing:.04em;text-transform:uppercase;color:var(--muted)}
.pe-sel+.pe-rail-h{margin-top:var(--gap-label)}
.pe-tab{position:relative;z-index:1;display:flex;align-items:center;gap:var(--gap-card);width:100%;min-height:var(--h-l);padding:var(--tab-py) var(--gap-card);border:0;border-radius:var(--r-ctl);background:none;color:var(--ink);font:inherit;line-height:round(calc(var(--lh) * 1em),1px);font-weight:500;text-align:left;white-space:nowrap;cursor:pointer;transition:color var(--ae-quick) var(--ease-color),background-color var(--ae-quick) var(--ease-color),transform .14s var(--ease-out)}
.pe-tab svg{flex:none;width:17px;height:17px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;color:var(--muted);transition:color var(--ae-quick) var(--ease-color)}
@media (hover:hover){.pe-tab:not(.on):hover{background:color-mix(in srgb,var(--accent-soft) 55%,transparent)}}
.pe-tab.on,.pe-tab.on svg{color:var(--accent)}
.pe-tab:focus-visible{outline:2px solid var(--accent);outline-offset:1px}
.pe-tab:not(:disabled):active{transform:scale(.97)}
@media (prefers-reduced-motion:reduce){.pe-tab:not(:disabled):active{transform:none}}
.pe-sel{position:absolute;left:0;top:0;z-index:0;width:0;height:0;border:1px solid var(--accent);border-radius:var(--r-ctl);background:var(--accent-soft);pointer-events:none;opacity:0;will-change:transform;transition:transform var(--t-press) var(--spring-press),width var(--ae-move) var(--spring-press),height var(--ae-move) var(--spring-press),opacity var(--ae-ms) var(--ease-ui)}

/* the window */
.pe-win{display:flex;flex-direction:column;min-width:0;min-height:0;border:1px solid var(--line);border-radius:var(--r-lg);background:var(--panel2);overflow:hidden}
.pe-win{position:relative}
.pe-top{position:relative;flex:none}
.pe-rule{display:block;flex:none;height:1px;background:var(--line)}
.pe-rule.pe-snap{position:absolute;left:0;right:0;pointer-events:none}
.pe-tv[hidden]{display:none}
.pe-tv.sliding{position:absolute;left:0;right:0;top:0;pointer-events:none}
.pe-tv.measure{position:absolute;left:0;right:0;top:0;visibility:hidden}
.pe-snap{position:absolute;inset:0;z-index:2;pointer-events:none;overflow:hidden!important;background:var(--panel2)}
.pe-grid-wrap.pe-snap{overflow:auto!important;background:none}
.pe-pt{min-width:0}
.pe-pt h3{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.pe-sub{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.pe-status{font-variant-numeric:tabular-nums;white-space:nowrap}
.pe-status:empty{display:none}
.pe-status.err{color:var(--bad);font-weight:600}

/* options: one tidy row under the head */

/* Add pages: three numbered steps in a row, the same numbers as the Audio Editor's noise steps */
#peCropNote{margin-top:var(--gap-set)}
/* a plain line that says what a tool found or how it works */

/* Page size: the sizes as one row of tiles; the readout sits in the head */

/* Watermark: labels beside their controls, two rows */

/* The tool band: heading (title and subtitle left, the page-size slider right), a hairline, then one padded settings row with the tool's one Apply button at its right end. Every value is a token. */
.pe-tv{padding:0}
.pe-phead{display:flex;align-items:center;justify-content:space-between;gap:var(--gap-field);padding:var(--gap-set) var(--ae-side)}
.pe-g{display:flex;flex-direction:column;align-items:flex-start;gap:var(--gap-head);min-width:0}          /* a name is trimmed to its letters (in a card or a settings row), so the control under it sits --gap-head below them: the same space you see under a name in the video panel, where the line's own room under the letters makes up the rest */
.pe-g>.t-lbl{font-size:var(--type-body);color:var(--muted);line-height:var(--line-s)}          /* a setting's name: the same look as a slider's name (.field label), as in the video panel; small capitals are only for a card's title */
.pe-cards .seg{height:var(--h-s)}
.pe-cards .seg label{display:flex;align-items:center;justify-content:center;padding:0 var(--gap-head)}
.pe-acts{display:flex;align-items:center;justify-content:flex-end;gap:var(--gap-head);flex:none;margin-left:auto}
.pe-lone{justify-content:flex-end}
.pe-inl{display:flex;align-items:center;gap:var(--gap-head);height:var(--h-s);font-size:var(--type-body);color:var(--muted)}
.pe-inl input[type=range]{width:calc(var(--h-s) * 3.2);flex:none}
.pe-inl output{min-width:var(--val-w);text-align:left;color:var(--ink);font-variant-numeric:tabular-nums}
#peCropPadF{transition:opacity var(--ae-ms) var(--ease-ui)}
#peCropPadF.dim{opacity:var(--inactive);pointer-events:none}
.pe-sw{display:flex;align-items:center;gap:var(--gap-head);height:var(--h-s);color:var(--muted);font-size:var(--type-body)}
.pe-text{display:flex;align-items:center;gap:var(--gap-head)}
.pe-text input[type=text]{width:calc(var(--h-s) * 3);height:var(--h-s)}
.pe-text :is(input[type=text],.fmt-btn,.fmt-group>.btn){font-size:var(--type-body)}          /* the text and its Bold and Italic buttons are the same size as every name and choice around them */
.pe-dir{display:flex;align-items:center;gap:var(--gap-head);min-width:0}
.btn.primary.pe-apply[aria-pressed=true]{background:var(--accent-soft);border-color:var(--accent);color:var(--accent)}
/* Re-size: two rows of four size cards, then Orientation and Apply on the right */
.pe-rzcards .seg label{white-space:nowrap}
.pe-rz .rz-grid{display:grid;grid-template-columns:repeat(4,minmax(max-content,1fr));gap:calc(var(--gap-set) + var(--hair)) var(--gap-set);align-content:start;width:100%}          /* the rows are a pixel further apart than the columns, so the card's height leaves Page shape's card an even room to center its one setting in, on whole pixels; the sizes spread across their card: equal columns where there is room, as wide as their words where there is not */
.pe-rz .rz-opt{display:flex;align-items:center;justify-content:space-between;gap:var(--gap-label);padding:0 var(--gap-head);min-height:var(--h-s)}
.pe-rz .rz-opt b{font-weight:400}          /* a size's name is regular like every other label; the chosen one is told by its fill and ink */
.pe-rz .rz-opt small{min-height:0;white-space:nowrap;color:var(--muted)}
.pe-rz .rz-opt.cu .cu-in{place-items:center start}
.pe-rz .rz-opt.cu .cu-field input{text-align:center}          /* the word and the blanks start where the other cards' names start */
/* the pages */
.pe-body{position:relative;flex:1 1 0;min-height:0;display:flex;flex-direction:column}
.pe-grid-wrap{flex:1 1 0;min-height:0;overflow:auto;scrollbar-gutter:stable;padding:var(--pe-edge) max(0px,calc(var(--pe-edge) - var(--pe-gutter))) var(--pe-edge-b) var(--pe-edge);overscroll-behavior:contain}          /* the room kept for the scroll bar counts as part of the right margin: the same space left and right whether or not the bar shows */
.pe-grid{position:relative;display:grid;grid-template-columns:repeat(auto-fill,minmax(116px,1fr));gap:var(--gap-group) var(--pe-col-gap);align-content:start;justify-content:space-between}          /* the page size sets each card's width; whatever room is left in a row is shared between the cards, so every row ends flush with the grid's right edge */
.pe .page-card{display:flex;flex-direction:column;gap:var(--gap-head);padding:var(--gap-tight);border:0;border-radius:var(--r-card);background:none;box-shadow:none;cursor:pointer;touch-action:pan-y;user-select:none;-webkit-user-select:none;transition:background-color var(--ae-quick) var(--ease-color),transform var(--t-hover) var(--spring-hover)}
.pe .page-card[aria-pressed]{border:0;background:none}
.pe .pe-grid.arrange .page-card{cursor:grab}
.pe .pe-grid.arrange .page-card:active{cursor:grabbing}
.pe .page-card:focus-visible{outline:2px solid var(--accent);outline-offset:0}
.pe-thumb{position:relative;display:flex;flex:1 1 auto;flex-direction:column;justify-content:center;min-height:0}          /* the thumb is the card's fixed room above the number: a turned page is centered inside it, so the room, the tools and the tick never move when the page turns */
.pe .page-card canvas{display:block;width:100%;height:auto;margin:auto 0;border:0;border-radius:var(--r-paper);background:var(--paper);pointer-events:none;box-shadow:var(--page-shadow);transition:opacity var(--ae-ms) var(--ease-color),transform var(--t-hover) var(--spring-hover)}
@media (hover:hover){
  .pe .page-card:not(.na):not(.pe-hole):hover{background:color-mix(in srgb,var(--ink) 4%,transparent);transform:none}
  .pe .page-card:not(.na):not(.pe-hole):hover canvas{transform:translateY(-2px)}          /* the page lifts; the bar and the tick under it stay still */
  .pe .page-card:not(.na):not(.pe-hole):hover canvas{box-shadow:var(--page-shadow-hover)}
}
.pe .page-card:not(.na):not(.pe-hole):active:not(:has(.pe-tools:active)){transform:scale(.97);transition-duration:.14s;transition-timing-function:var(--ease-out)}          /* pressing a card's own bar (Rotate, Repeat) does not shrink the card: the page must not move beneath the turn */
.pe .page-card.off canvas{opacity:var(--inactive);filter:grayscale(1)}
.pe .pe-grid.sized .page-card.far{content-visibility:auto;contain-intrinsic-block-size:var(--ih,0px)}          /* a card a screen or more away skips layout and paint; it keeps its true size (its picture's width, set once per column count, by its shape, plus the room around it) so the scroll bar never jumps. Cards near the view are not touched, so their shadows, tools, and lift are exactly as before. */
.pe .page-card .pe-hid{position:absolute;left:50%;top:50%;display:none;place-items:center;width:var(--hid-k);height:var(--hid-k);margin:calc(-1 * var(--hid-k) / 2) 0 0 calc(-1 * var(--hid-k) / 2);border-radius:50%;background:var(--chip-bg);color:var(--chip-ink);box-shadow:var(--chip-shadow);pointer-events:none}
.pe .page-card .pe-hid svg{width:17px;height:17px}
.pe .page-card.hid .pe-hid{display:grid}
.pe .page-card.na{cursor:default}
.pe .page-card.na canvas{opacity:var(--inactive);filter:grayscale(1)}
/* the tick: a check in a circle on the page's corner, always showing in Arrange and in every tick tool. A left-out page is dimmed and carries a crossed-eye badge */
.pe .page-card .tick{top:var(--gap-head);right:var(--gap-head);width:22px;height:22px;border:1.5px solid var(--paper);background:var(--accent);color:var(--on-dark);box-shadow:var(--chip-shadow);transition:background-color var(--ae-quick) var(--ease-color),border-color var(--ae-quick) var(--ease-color),opacity var(--ae-ms) var(--ease-ui),transform var(--t-press) var(--spring-press)}
.pe .page-card .tick svg{width:12px;height:12px}
.pe .page-card.off .tick{background:var(--chip-bg);color:transparent;border-color:var(--chip-edge)}
.pe .pe-grid:not(.ticks) .tick,.pe .page-card.na .tick{opacity:0;transform:scale(.6)}
/* under each page its place in the video, and the page of the PDF when that differs */
.pe-foot{position:relative;display:flex;align-items:center;justify-content:center;gap:var(--gap-tight);min-height:20px;min-width:0}
.pe-pos{--pos-d:20px;display:grid;place-items:center;min-width:var(--pos-d);height:var(--pos-d);padding:0 var(--gap-tight);border-radius:99px;background:color-mix(in srgb,var(--ink) 8%,transparent);color:var(--ink);font-size:var(--type-note);font-weight:600;font-variant-numeric:tabular-nums}
.pe-pos .pe-cell{flex:none;width:50%;height:100%;display:grid;place-items:center}          /* a sliding digit's half of the strip; where the browser can trim text the rule below centers it exactly as the resting digit is, so the end of a slide changes nothing */
@supports (text-box:trim-both cap alphabetic){          /* the digits are trimmed to their height by the browser (the shared trim, as the labels and big numbers are) and centered in the circle by an equal room above and below, so every number sits on the circle's center line; tabular figures keep every number of a length the same width */
  .pe-pos:not(.slide),.pe-pos .pe-cell{display:block;box-sizing:border-box;height:var(--pos-d);padding-top:calc((var(--pos-d) - var(--trim-h)) / 2);text-align:center;text-box:trim-both cap alphabetic}
  .pe-pos .pe-cell{height:100%}
}
.pe-pos:empty{display:none}
.pe-foot .num{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:var(--type-note);color:var(--muted)}
.pe-foot .num{max-width:80px}
.pe-cp{display:inline-flex;vertical-align:-.125em;margin-right:var(--gap-snug);font-style:normal}
.pe-cp svg{width:1em;height:1em}          /* the copy glyph of a repeated page (the same one as the card's Repeat button), as tall as the digits beside it */
@supports (text-box:trim-both cap alphabetic){.pe-foot .num{text-box:trim-both cap alphabetic;padding-block:var(--gap-label)}}          /* the tag's digits are trimmed to their height like the bubble's, so both share one center line; the padding keeps the copy glyph from being clipped */
.pe-foot .num.same{max-width:0;opacity:0;margin-left:calc(-1 * var(--gap-tight))}
.pe-foot .num.pe-num-out{position:absolute;margin:0;pointer-events:none}          /* a tag that goes: a still copy fading where it was, out of the layout, so the bubble glides to the middle at once */
.pe-pos i{font-style:normal}
/* sliding number: the two digits sit side by side in a strip two digits wide, and the pill clips it, so the pill keeps its colour and round ends while the digits move */
.pe-pos.slide{display:block;position:relative;width:var(--slide-w);padding:0;overflow:hidden;color:var(--ink)}
.pe-measure{position:absolute;left:0;top:0;visibility:hidden;pointer-events:none}          /* sized by the pill's own rules, never seen; used only to measure a digit */
.pe-pos .pe-strip{position:absolute;left:0;top:0;display:flex;width:200%;height:100%;will-change:transform}
/* rotate and repeat float on the page while you point at it, in a small frosted bar */
.pe-tools{position:absolute;left:50%;bottom:var(--gap-head);display:flex;gap:var(--gap-sub);padding:var(--gap-snug);border-radius:var(--r-card);background:var(--glass-bg);-webkit-backdrop-filter:var(--glass-blur);backdrop-filter:var(--glass-blur);box-shadow:var(--glass-shadow),inset 0 0 0 1px var(--glass-edge),0 0 0 .5px var(--glass-ring);opacity:0;transform:translate(-50%,4px);pointer-events:none;transition:opacity var(--ae-quick) var(--ease-ui),transform var(--t-hover) var(--spring-hover)}
.pe .pe-grid.arrange .page-card:hover .pe-tools,.pe .pe-grid.arrange .page-card:focus-within .pe-tools{opacity:1;transform:translate(-50%,0);pointer-events:auto}
@media (hover:none){.pe .pe-grid.arrange .pe-tools{opacity:1;transform:translate(-50%,0);pointer-events:auto}}
/* in Re-kilter and Crop the bar holds one button, on the page's other top corner from the tick: it opens the page large */
.pe-grid.arrange .pe-tools [data-act=open],.pe-grid.opens .pe-tools button:not([data-act=open]){display:none}
.pe .pe-grid.opens .pe-tools{left:var(--gap-head);top:var(--gap-head);bottom:auto;transform:translateY(-4px)}
.pe .pe-grid.opens .page-card:not(.off):not(.na):hover .pe-tools,.pe .pe-grid.opens .page-card:not(.off):not(.na):focus-within .pe-tools{opacity:1;transform:none;pointer-events:auto}
@media (hover:none){.pe .pe-grid.opens .page-card:not(.off):not(.na) .pe-tools{opacity:1;transform:none;pointer-events:auto}}
.pe-tools button{display:grid;place-items:center;width:var(--w-glass);height:var(--h-glass);padding:0;border:0;border-radius:var(--r-sm);background:none;color:var(--ink);cursor:pointer;transition:background-color var(--ae-quick) var(--ease-color),color var(--ae-quick) var(--ease-color),transform .14s var(--ease-out)}
.pe-tools button svg{width:14px;height:14px}
.pe-tools button:hover{background:var(--accent-soft);color:var(--accent)}
.pe-tools button:not(:disabled):active{transform:scale(.97)}
@media (prefers-reduced-motion:reduce){.pe-tools button:not(:disabled):active{transform:none}}

/* dragging: only the held page moves; a thin line shows where it will land */
.page-card.pe-ghost{position:fixed;z-index:200;margin:0;pointer-events:none;background:none;transition:none;will-change:transform;transform-origin:50% 50%;cursor:grabbing}
.page-card.pe-ghost canvas{box-shadow:var(--ghost-shadow)}
.page-card.pe-ghost .tick,.page-card.pe-ghost .pe-tools{display:none}
.page-card.pe-ghost .pe-foot{visibility:hidden}          /* you carry the page only; its number stays on its row's line and rolls there when you let go */
.pe .page-card.pe-hole{background:color-mix(in srgb,var(--accent) 8%,transparent);outline:1.5px dashed color-mix(in srgb,var(--accent) 60%,transparent);outline-offset:-1px}
.pe .page-card.pe-hole>.pe-thumb{visibility:hidden}          /* the place you lifted the page from keeps its number until the page lands somewhere */
.pe .page-card.pe-landing{z-index:1;pointer-events:none}          /* the page you let go lands above the pages it passes */
.pe-grid.pe-dragging .page-card{pointer-events:none;transition:none!important}
.pe-drop{position:absolute;left:0;top:0;width:3px;border-radius:var(--r-mark);background:var(--accent);box-shadow:0 0 0 3px var(--accent-soft),0 0 10px var(--accent);opacity:0;pointer-events:none;will-change:transform;transition:opacity var(--ae-quick) linear}

/* Crop and Adjust by hand: one page on a soft backdrop, page arrows under it */
.pe-crop{display:none;flex:1 1 0;min-height:0;flex-direction:column}
.pe-win.one .pe-crop{display:flex}
.pe-win.one .pe-grid-wrap{display:none}
.pe-stage{flex:1 1 0;min-height:0;display:grid;place-items:center;padding:var(--pe-edge);background:color-mix(in srgb,var(--ink) 4%,var(--panel2));overflow:hidden}
.pe-stage{position:relative;touch-action:none}
.pe-stage.zoomed{cursor:grab}.pe-stage.zoomed.panning{cursor:grabbing}
.pe-crop-pg{position:relative;overflow:hidden;background:var(--paper);border-radius:var(--r-mark);box-shadow:var(--page-shadow-lift);--z:1;will-change:transform}
.pe-crop-pg canvas{transition:opacity var(--ae-ms) var(--ease-ui)}
.pe-crop-pg.loading canvas{opacity:0}
.pe-crop-pg{transition:opacity var(--ae-ms) var(--ease-ui)}
.pe-crop-pg.loading{opacity:var(--inactive)}          /* a page still being drawn: the softened paper, and the wait pill over the pages (peLoadPill) carries the sweep */
.pe-crop-pg .pe-wipe,.pe-crop-pg .pe-side{transition:opacity var(--ae-ms) var(--ease-ui)}
.pe-crop-pg.loading .pe-wipe,.pe-crop-pg.loading .pe-side,.pe-crop-pg.loading .pe-crop-box{opacity:0}
/* the back arrow and the zoom buttons float over the stage like the page's own corner button */
.pe-glass{position:absolute;z-index:4;display:flex;gap:var(--gap-sub);padding:var(--gap-snug);border-radius:var(--r-card);background:var(--glass-bg);-webkit-backdrop-filter:var(--glass-blur);backdrop-filter:var(--glass-blur);box-shadow:var(--glass-shadow),inset 0 0 0 1px var(--glass-edge),0 0 0 .5px var(--glass-ring)}
.pe-back{left:var(--gap-set);top:var(--gap-set)}.pe-zoom,.pe-pgzoom{right:var(--gap-set);bottom:var(--gap-set)}
.pe-glass{align-items:center}
.pe-pgzoom input{width:calc(var(--h-s) * 3.4);margin-inline:var(--gap-label)}          /* the page size: the slider between its minus and plus on one floating strip, as the crop preview's zoom floats */
.pe-win.one .pe-pgzoom{display:none}
.pe-glass button{display:grid;place-items:center;width:var(--w-glass);height:var(--h-glass);padding:0;border:0;border-radius:var(--r-sm);background:none;color:var(--ink);cursor:pointer;transition:background-color var(--ae-quick) var(--ease-color),color var(--ae-quick) var(--ease-color),transform .14s var(--ease-out)}
.pe-glass button svg{width:14px;height:14px}
.pe-glass button:not(:disabled):hover{background:var(--accent-soft);color:var(--accent)}
.pe-glass button:not(:disabled):active{transform:scale(.97)}
@media (prefers-reduced-motion:reduce){.pe-glass button:not(:disabled):active{transform:none}}
.pe-glass button:disabled{color:var(--muted);opacity:var(--inactive);cursor:default}
.pe-crop-pg canvas{display:block;width:100%;height:100%}
.pe-crop-pg canvas.pe-ghost{position:absolute;left:50%;top:50%;width:auto;height:auto;transform:translate(-50%,-50%);transition:none;pointer-events:none;opacity:1}
/* Re-kilter: the original lies over the leveled page as far as the line, which you drag */
.pe-crop-pg{--wp:.5}
#peOneOrig,.pe-wipe{display:none}
.pe-win.wipe #peOneOrig{display:block;position:absolute;inset:0;clip-path:inset(0 calc(100% - var(--wp)*100%) 0 0)}
.pe-win.wipe .pe-wipe{display:block;position:absolute;top:0;bottom:0;left:calc(var(--wp)*100%);width:2px;margin-left:calc(-1 * var(--hair));background:var(--accent);cursor:ew-resize;touch-action:none}
.pe-wipe::before{content:'';position:absolute;inset:0 calc(-14px/var(--z,1))}
.pe-crop-pg .pe-wipe{width:calc(2px/var(--z,1))!important;margin-left:calc(-1 * var(--hair) / var(--z,1))!important}
.pe-wipe::after{scale:calc(1/var(--z,1))}
.pe-crop-pg .pe-crop-box{border-width:calc(1.5px/var(--z,1))}
.pe-crop-box .h{scale:calc(1/var(--z,1))}
.pe-wipe::after{content:'';position:absolute;left:50%;top:var(--ky,50%);transition:top var(--kt,0s) cubic-bezier(.22,1,.36,1);width:var(--wipe-k);height:var(--wipe-k);margin:calc(-1 * var(--wipe-k) / 2) 0 0 calc(-1 * var(--wipe-k) / 2);border-radius:50%;background:var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m9 7-5 5 5 5M15 7l5 5-5 5'/%3E%3C/svg%3E") center/16px no-repeat;box-shadow:var(--wipe-shadow)}
.pe-wipe:focus-visible{outline:none}.pe-wipe:focus-visible::after{outline:2px solid var(--paper);outline-offset:1px}
.pe-side{position:absolute;z-index:3;left:0;top:0;padding:var(--gap-sub) var(--field-pad-x);border-radius:999px;background:var(--side-bg);color:var(--on-dark);font-size:var(--type-note);font-weight:600;--lh:1.5;white-space:nowrap;pointer-events:none;opacity:0;transition:opacity var(--ae-ms) var(--ease-ui);will-change:transform,opacity}
.pe-side.on{opacity:1}
.pe-stage:has(.pe-crop-pg.loading) .pe-side,.pe-stage:has(.pe-crop-pg.loading) .pe-hint{opacity:0}
/* what the page needs before its large view says anything: a quiet line at the top, so it is plain why the page looks unchanged */
.pe-hint{position:absolute;z-index:3;left:50%;top:calc(var(--gap-head) + var(--gap-tight));max-width:calc(100% - 120px);transform:translate(-50%,-6px);padding:var(--hint-py) var(--gap-set);border-radius:999px;background:var(--hint-bg);color:var(--on-dark);font-size:var(--type-small);font-weight:600;--lh:1.4;text-align:center;pointer-events:none;opacity:0;transition:opacity var(--ae-ms) var(--ease-ui),transform var(--ae-move) var(--ease-out)}
.pe-hint.on{opacity:1;transform:translate(-50%,0)}
.pe-glass button.txt{width:auto;padding:0 var(--gap-card);font-size:var(--type-small);font-weight:600}
/* a change on the open page: the old picture dims at once, and the new one sweeps in from the left behind a bright edge */
.pe-crop-pg canvas{transition:opacity var(--ae-ms) var(--ease-ui)}
.pe-crop-pg.busy canvas{opacity:.6;transition-duration:.14s}
.pe-reveal{position:absolute;inset:0;clip-path:inset(0 100% 0 0)}
.pe-edge{position:absolute;inset:0;pointer-events:none;background:linear-gradient(90deg,transparent calc(100% - 64px),color-mix(in srgb,var(--accent) 26%,transparent) calc(100% - 2px),var(--accent) calc(100% - 2px));transform:translateX(-100%);will-change:transform,opacity}
@media (prefers-reduced-motion:reduce){.pe-hint{transition:opacity var(--ae-quick) linear}}
.pe-win[data-mode="skew"] .pe-crop-box,.pe-win[data-mode="clean"] .pe-crop-box{display:none}
/* the frame: the page outside it dims. In Auto it follows the margin slider; in Manually it grows corner brackets and edge bars you drag */
.pe-crop-box{position:absolute;border:1.5px solid var(--accent);border-radius:var(--r-mark);box-shadow:0 0 0 9999px var(--crop-scrim);pointer-events:none;touch-action:none;transform-origin:0 0}
.pe-win.hand .pe-crop-box{pointer-events:auto}
.pe-crop-box>i{position:absolute}
.pe-crop-box>i[data-h=move]{inset:0;cursor:move}
.pe-crop-box .h{--t:3.5px;width:22px;height:22px;border:0 solid var(--accent);opacity:0;transform:scale(.6);transition:opacity var(--ae-ms) var(--ease-ui),transform var(--t-press) var(--spring-press)}
.pe-win.hand .pe-crop-box .h{opacity:1;transform:none}
.pe-crop-box .h::after{content:'';position:absolute;inset:-10px}
.pe-crop-box .nw{left:calc(-1 * var(--crop-edge));top:calc(-1 * var(--crop-edge));border-width:var(--t) 0 0 var(--t);cursor:nwse-resize;transform-origin:0 0}.pe-crop-box .ne{right:calc(-1 * var(--crop-edge));top:calc(-1 * var(--crop-edge));border-width:var(--t) var(--t) 0 0;cursor:nesw-resize;transform-origin:100% 0}
.pe-crop-box .se{right:calc(-1 * var(--crop-edge));bottom:calc(-1 * var(--crop-edge));border-width:0 var(--t) var(--t) 0;cursor:nwse-resize;transform-origin:100% 100%}.pe-crop-box .sw{left:calc(-1 * var(--crop-edge));bottom:calc(-1 * var(--crop-edge));border-width:0 0 var(--t) var(--t);cursor:nesw-resize;transform-origin:0 100%}
.pe-crop-box .n,.pe-crop-box .s{left:50%;width:var(--crop-grip);height:0;margin-left:calc(-1 * var(--crop-grip) / 2);border-top-width:var(--t);cursor:ns-resize}.pe-crop-box .n{top:calc(-1 * var(--crop-edge))}.pe-crop-box .s{bottom:calc(-1 * var(--crop-edge))}
.pe-crop-box .e,.pe-crop-box .w{top:50%;width:0;height:var(--crop-grip);margin-top:calc(-1 * var(--crop-grip) / 2);border-left-width:var(--t);cursor:ew-resize}.pe-crop-box .w{left:calc(-1 * var(--crop-edge))}.pe-crop-box .e{right:calc(-1 * var(--crop-edge))}
.pe-nav{flex:none;display:grid;grid-template-columns:minmax(0,1fr) auto auto auto minmax(0,1fr);align-items:center;gap:var(--gap-card);min-height:44px;padding:var(--gap-tight) var(--gap-set);border-top:1px solid var(--line);font-size:var(--type-body);font-variant-numeric:tabular-nums}
.pe-nav #peCropName{min-width:104px;text-align:center}
.pe-nav-a{display:flex;justify-content:flex-start}.pe-nav-b{display:flex;justify-content:flex-end}
.pe-nav .btn{border-color:transparent;background:none;color:var(--accent);box-shadow:none}
.pe-nav .btn:not(:disabled):hover,.pe-nav .btn[aria-pressed="true"]{background:var(--accent-soft);border-color:transparent;box-shadow:none;transform:none}
.pe-nav .btn:disabled{color:var(--muted);opacity:var(--inactive)}
.pe-win:not([data-mode="skew"]):not([data-mode="clean"]) #peOneCmp{visibility:hidden}
.pe-nav .icon-btn{width:var(--h-s);height:var(--h-s);border-color:transparent;background:none;color:var(--muted)}
.pe-nav .icon-btn:not(:disabled):hover{color:var(--ink);background:color-mix(in srgb,var(--ink) 6%,transparent);box-shadow:none}
.pe-nav .icon-btn svg{width:17px;height:17px}

/* the status bar: how many pages, and Select all / Deselect all as plain text buttons */
.pe-bar{flex:none;display:flex;align-items:center;gap:var(--gap-sub);min-height:44px;padding:var(--tab-py) var(--gap-set) var(--gap-tight) var(--pe-edge);border-top:1px solid var(--line)}
.pe-count{min-width:5ch;margin-right:auto;font-size:var(--type-body);color:var(--muted);font-variant-numeric:tabular-nums}
.pe-bar .pe-pages{flex:0 1 auto;box-sizing:border-box;width:100px;min-width:0;height:var(--h-s);margin:0 var(--gap-tight) 0 var(--gap-head);padding:0 var(--field-pad-x);border-radius:var(--r-sm);font-size:var(--type-body);font-variant-numeric:tabular-nums}
.pe-bar .pe-pages:disabled{opacity:var(--inactive);cursor:not-allowed}
.pe-bar .btn:disabled{color:var(--muted);opacity:var(--inactive)}
.pe-bar .btn-group[hidden]{display:none}
.pe-win.one .pe-bar,.pe-win[data-mode="resize"] .pe-bar{display:none}

.pe-nav .icon-btn:disabled{opacity:var(--inactive)}
@media (prefers-reduced-motion:reduce){.pe-crop-box .h,.pe-sel,.pe-crop-box,.pe-tools,.pe-thumb,.pe .page-card .tick,.pe-check{transition:none}}

/* narrower windows: the tool list moves above the window as a grid of buttons, so every tool stays in sight */


/* very short windows (under 600px: a laptop with the browser cut down): the editor scrolls instead of squeezing the pages any further. Above that the pages give way and the dialog fits the screen. */


/* Watermark: two windows side by side, as the Audio Editor's tools are laid out */
.pe-card-text .pe-text input[type=text]{flex:1 1 0;width:auto;min-width:0}
.pe-cards{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:var(--gap-card);padding:var(--gap-set) var(--ae-side)}
.pe-cards .ae-card{display:flex;align-items:center;gap:var(--gap-head);min-width:0}
.pe-cards .pe-card-text,.pe-cards .pe-card-dir{flex-direction:column;align-items:stretch;justify-content:space-between;gap:var(--gap-set)}          /* two settings per card, each a name over its control: the first name sits on the card's top padding and the last control on its bottom, so both cards are balanced and their rows line up */
.pe-cards .pe-g,.pe-card-dir .pe-dir{align-items:stretch}
.pe-cards .pe-card-set{flex-direction:column;align-items:stretch;justify-content:center}          /* Clean, Crop, and Arrange: one setting per card, its name over its control, the control as wide as the card, so the two cards match */
.pe-card-set .seg label{white-space:nowrap}
.pe-card-set select{width:100%;height:var(--h-s);padding-block:0}
.pe-cards .pe-card-crop{justify-content:space-between;gap:calc(var(--gap-field) + var(--gap-set))}          /* Margin and Keep frame on one center line with a wide gap */
.pe-card-crop .pe-inl{flex:1 1 auto;min-width:0}
.pe-card-crop .pe-sw{flex:none;white-space:nowrap}
.pe-card-crop .pe-inl input[type=range]{flex:1 1 0;width:auto;min-width:0}
.pe-rzcards{container:rzcards/inline-size;grid-template-columns:minmax(0,1fr) max-content}          /* Re-size: the sizes in one card, a little the longer, and Page shape in another of the same height, its one setting centered */
.pe-rzcards .ae-card{align-items:center}
.pe-rzcards .pe-card-sizes{display:block}
.pe-card-dir .pe-dir .seg{flex:1 1 0;min-width:0}
@container rzcards (min-width:644px){.pe-rz .rz-opt:nth-child(-n+4){grid-row:1}.pe-rz .rz-opt:nth-child(n+5){grid-row:2}}
@container rzcards (max-width:643px){.pe-rz .rz-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@container rzcards (max-width:257px){.pe-rz .rz-opt{height:var(--h-l);min-height:var(--h-l);padding-block:0}.pe-rz .rz-opt:not(.cu){flex-direction:column;align-items:flex-start;justify-content:center;gap:0}}          /* too narrow even for that (the sizes' box under 258px): the numbers sit under the name */
@container rzcards (max-width:282px){.pe-rz .rz-opt{padding-inline:var(--gap-label)}.pe-rz .rz-opt small{font-size:var(--type-axis)}}          /* once a size and its numbers no longer fit side by side in half the box, the numbers stay beside the name, a little smaller and with a little less padding */
          /* four cards to a row while the cards sit beside Page shape; narrower, they flow two to a row */
.pe-win.waiting .pe-grid{opacity:var(--inactive)}
.pe-win.waiting .pe-grid .page-card{pointer-events:none}
.pe-grid{transition:opacity var(--ae-ms) var(--ease-ui)}
.pe-toast{position:absolute;left:50%;top:50%;bottom:auto;transform:translate(-50%,-50%);z-index:2;pointer-events:none;text-align:center}
.pe-toast.show{transform:translate(-50%,-50%)}
#pdfDlg{container:pedlg/inline-size}
@container pedlg (max-width:744px){
  .pe-main{grid-template-columns:minmax(0,1fr);grid-template-rows:auto minmax(0,1fr);gap:0}          /* the tool bar is the top of the tool window, divided from it by a hairline, as in the Audio Editor */
  .pe-rail{border-radius:var(--r-lg) var(--r-lg) 0 0;border-bottom-color:var(--hairline)}
  .pe-win{border-top:0;border-radius:0 0 var(--r-lg) var(--r-lg)}
  .pe-rail{padding:0}          /* the tool list becomes a drop-down, as the Audio Editor's does: the same bar, chevron, and glide */
  .pe-rail-cur{display:flex}
  #peWin{--pe-narrow:1}          /* the script reads this to know the tool bar holds the tool's button (one place for the width) */
  .pe-rail-body{display:grid;grid-template-rows:0fr;transition:grid-template-rows var(--ae-move) var(--ease-out)}
  .pe-rail.open .pe-rail-body{grid-template-rows:1fr}
  .pe-pt h3{display:none}          /* the drop-down above already names the tool, so the head keeps only its line and its buttons */
  #pdfDlg .pe-sub{display:none}          /* nor does the tool's subtitle get a row of its own under the drop-down */
  #pdfDlg .pe-phead:not(:has(.pe-status:not([hidden]))):not(:has(.pe-acts>.btn:not([hidden]))),#pdfDlg .pe-phead:not(:has(.pe-status:not([hidden]))):not(:has(.pe-acts>.btn:not([hidden])))+.ae-rule{display:none}
  .pe-rail-in{overflow:hidden;min-height:0;padding:0 var(--gap-head)}
  .pe-rail.open .pe-rail-in{padding:0 var(--gap-head) var(--gap-card)}
}
@container pedlg (max-width:728px){
  .dlg.editor.pe{height:auto;max-height:none;grid-template-rows:none}
  .pe-main{grid-template-rows:none}
  .pe-body,.pe-crop{flex:none}
  .pe-phead{flex-wrap:wrap;gap:var(--gap-head)}
  .pe-acts{flex-wrap:wrap;flex:0 1 auto;min-width:0}
  .pe-status{white-space:normal;text-align:right}
  .pe-grid-wrap{flex:none;height:min(58vh,480px);padding:var(--gap-field)}
  .pe-grid{gap:var(--gap-field) var(--gap-head)}
  .pe-stage{flex:none;height:min(58vh,480px);padding:var(--gap-field)}
  .pe-bar{padding-left:var(--gap-field)}
  .pe-bar .pe-pages{width:calc(var(--h-s) * 3.2);margin:0 var(--gap-sub) 0 var(--gap-label)}
  .pe-rz .rz-grid{grid-template-columns:repeat(2,minmax(0,1fr));width:100%}
}
@container pedlg (max-width:488px){
  #pdfDlg .pe-sub,#pdfDlg .ed-lead{display:none}
  #pdfDlg .pe-phead:not(:has(.pe-status:not([hidden]))):not(:has(.pe-acts>.btn:not([hidden]))),#pdfDlg .pe-phead:not(:has(.pe-status:not([hidden]))):not(:has(.pe-acts>.btn:not([hidden])))+.ae-rule{display:none}}          /* with its line and its button gone, a head with nothing left in it goes too */          /* as in the Audio Editor at this width: a tool's one-line description and the window's subtitle give way (a warning stays) */
@container pedlg (max-width:512px){.pe-cards{grid-template-columns:minmax(0,1fr)}.pe-cards .ae-card>.pe-g{width:100%}.pe-cards .seg label{padding-inline:var(--gap-label)}}          /* Watermark's two cards stack once three choices side by side would no longer fit their words in half the width */
@container pedlg (max-width:288px){.pe-bar{padding-right:var(--gap-label)}.pe-bar .pe-pages{width:calc(var(--h-s) * 2.6);margin:0 0 0 var(--gap-label);padding:0 var(--gap-head)}.pe-bar .btn.small{padding-left:var(--gap-head);padding-right:var(--gap-head)}.pe-bar .btn-group .vsep{margin:0 var(--gap-sub)}}

.pe-lvl{position:absolute;left:var(--gap-tight);bottom:var(--gap-tight);max-width:calc(100% - 12px);box-sizing:border-box;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;padding:var(--gap-sub) var(--tab-py);border-radius:999px;background:var(--accent);color:var(--on-dark);font-size:var(--scale-fs);font-weight:600;--lh:1.4;box-shadow:var(--chip-shadow);opacity:0;transform:translateY(4px) scale(.9);transition:opacity var(--ae-ms) var(--ease-ui),transform var(--t-press) var(--spring-press);pointer-events:none}
.pe-win[data-mode="dim"] .page-card.lvl .pe-lvl,.pe-win[data-mode="skew"] .page-card.lvl .pe-lvl,.pe-win[data-mode="clean"] .page-card.lvl .pe-lvl,.pe-win[data-mode="crop"] .page-card.shared:not(.off) .pe-lvl{opacity:1;transform:none}
.pe-win[data-mode="crop"] .page-card.cropped .pe-lvl{opacity:1;transform:none}

/* Noise reduction: the wait pill sits in the middle of the graph, as System finding does; its bar is filled by the tween, not by a transition */
.nr-wait{opacity:0;visibility:hidden;transition:opacity var(--ae-ms) var(--ease-ui),visibility 0s var(--ae-ms)}
.nr-wait.on{opacity:1;visibility:visible;transition-delay:0s}
.nr-wait .nr-prog-t b{width:100%;transition:none}
.nr-wait .nr-pct{min-width:3.2ch;text-align:right;font-variant-numeric:tabular-nums;margin-left:var(--gap-label)}
.nr-wait .nr-pct:empty{margin-left:0}
@media (prefers-reduced-motion:reduce){.nr-wait{transition-duration:.08s}}
/* the play button waits (pulses) until the noise removal has a result; reduced motion keeps it still */
.icon-btn.play.waiting{animation:play-wait 1.1s ease-in-out infinite}
@keyframes play-wait{0%,100%{opacity:1}50%{opacity:.45}}
@media (prefers-reduced-motion:reduce){.icon-btn.play.waiting{animation:none;opacity:.7}}

/* working in the background: a thin blue ring fills around the tool's light (Noise reduction) or in its empty slot (Emulator) with the share done, only while another tool is open: the open tool's own window says it in its bar. Nothing is said in words. It fades in with the job and out when it ends; before the first tick a short arc turns */
@property --ring{syntax:'<number>';inherits:true;initial-value:0}
.ae-jack{position:relative}
.ae-jack::before{content:'';position:absolute;left:50%;top:50%;width:var(--jack);height:var(--jack);margin:calc(var(--jack) / -2) 0 0 calc(var(--jack) / -2);border-radius:50%;background:conic-gradient(var(--accent) calc(var(--ring) * 360deg),color-mix(in srgb,var(--accent) 20%,transparent) 0);-webkit-mask:radial-gradient(circle,transparent calc(var(--jack) * .375),#000 calc(var(--jack) * .4));mask:radial-gradient(circle,transparent calc(var(--jack) * .375),#000 calc(var(--jack) * .4));opacity:0;transform:scale(.82);pointer-events:none;transition:opacity var(--ae-ms) var(--ease-ui),transform var(--ae-move) var(--ease-out),--ring .25s linear}          /* the share glides between ticks */
.ae-jack.start::before{transition:opacity var(--ae-ms) var(--ease-ui),transform var(--ae-move) var(--ease-out)}
.ae-jack.busy::before{opacity:1;transform:none}
.ae-jack.busy.wait::before{--ring:.25;animation:ring-turn 1s linear infinite}
@keyframes ring-turn{to{transform:rotate(1turn)}}
@media (prefers-reduced-motion:reduce){.ae-jack.busy.wait::before{animation:none}.ae-jack::before{transition:opacity var(--ae-ms) var(--ease-ui)}}
/* the Removal card: the processing row sits right under Noise only, and its space is kept when idle so nothing shifts */
/* before the first tick, the shared sweep (.sweeping) moves along the track: it says the job has started */


/* Export audio: the button fills as the export goes */
#aeExport.exporting,#peExport.exporting{position:relative;overflow:hidden;opacity:1}
#aeExport.exporting::before,#peExport.exporting::before{content:"";position:absolute;inset:0;background:var(--accent);opacity:.3;transform-origin:left;transform:scaleX(var(--p,0));transition:transform .2s linear}
#aeExport.exporting>*,#peExport.exporting>*{position:relative}
@media (prefers-reduced-motion:reduce){#aeExport.exporting::before,#peExport.exporting::before{transition:none}}

/* the audio export window while it runs: a progress page in the same window, with the stage, a bar and the choice to keep editing */
.pg-run{display:grid;gap:var(--gap-field);padding:var(--gap-room) var(--gap-room-x);box-sizing:border-box}
.pg-run[hidden],.pg-wrap[hidden]{display:none}
.pg-run h2{margin:0}
.pg-run p{margin:0}
.pg-run .row{display:flex;justify-content:flex-end;gap:var(--gap-head)}

/* ---- the Audio Editor's controls bar and its buttons share one recipe (the Undo group is a .btn-group, see the end of this file): a soft glass edge, buttons the same height and corner,
   and a group corner that is the button corner plus the gap around it (7px + 4px = 11px), so the curves nest ---- */
#audioDlg .ae-bar .btn,#audioDlg .ae-bar .ae-view{height:var(--h-m);box-sizing:border-box;background:var(--glass-ctl-bg);-webkit-backdrop-filter:none;backdrop-filter:none;box-shadow:none}
#audioDlg .ae-bar .btn{border-radius:var(--r-sm)}          /* Wave|Spec keeps the segmented control's own corner */
#audioDlg .ae-bar .btn.small:not(.ico){padding:0 var(--field-pad-x);font-size:var(--type-body)}
#audioDlg .ae-bar .ae-view{min-height:var(--h-m);font-size:var(--type-body)}          /* the same heights as the video editor's transport: a choice or text button --h-m, an icon button and Play --h-l */
#audioDlg .ae-bar .btn.ico{width:var(--h-l);min-width:var(--h-l);height:var(--h-l)}          /* Trim silence is an icon button like Full screen and Play */
#audioDlg .ae-bar .ae-view label{display:flex;align-items:center;justify-content:center;padding:0 var(--gap-set);height:100%;box-sizing:border-box}
#audioDlg .ae-bar .ae-view span{padding:0}
#audioDlg .ed-head .btn[aria-pressed=true],#pdfDlg .ed-head .btn[aria-pressed=true],#audioDlg .ae-bar .btn[aria-pressed=true]{background:var(--accent-soft)}

/* the finished audio chip: the start of the file's name, then the format over the length in small grey type, so it stays narrow */
/* the Open audio button while the sound is read: it fills as it goes and says how far */
.btn.loading{font-variant-numeric:tabular-nums;white-space:nowrap;position:relative;overflow:hidden;isolation:isolate;color:var(--accent-ink);cursor:progress;opacity:1;background:color-mix(in srgb,var(--accent) 48%,var(--panel2))}
.btn.loading::before{content:"";position:absolute;inset:0;z-index:-1;background:var(--accent);transform:translateX(calc(var(--p,0%) - 100%));transition:transform var(--ae-move) var(--ease-out);will-change:transform;pointer-events:none}          /* the fill is a layer slid in from the left (the wait pill's way), so it glides on the compositor while the page is busy; a new run is a new layer and starts empty */
@media (prefers-reduced-motion:reduce){.btn.loading::before{transition-duration:.08s}}
.btn.loading.ind{animation:busy-pulse 1.4s var(--ease-ui) infinite alternate}
@keyframes busy-pulse{from{filter:brightness(1)}to{filter:brightness(1.12)}}
@media (prefers-reduced-motion:reduce){.btn.loading.ind{animation:none}}
.eq-bn .eq-ctl .switch{order:0}

/* EQ Match: the two buttons in the card's head sit together; the EQ Match button carries a dot while a curve is made */
.mt-acts{display:inline-flex;gap:var(--gap-head);margin-left:auto}
#aeMatchBtn{position:relative}
#aeMatchBtn.has::after{content:'';position:absolute;top:calc(-1 * (var(--gap-sub) + var(--hair)));right:calc(-1 * (var(--gap-sub) + var(--hair)));width:var(--gap-head);height:var(--gap-head);border-radius:50%;background:var(--accent);box-shadow:0 0 0 2px var(--panel)}
.mt-head .mt-acts .btn{margin-left:0}

/* Emulator: the three steps on the left, the picture of both tones and the reference's numbers on the right */
.em-grid{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.3fr);gap:var(--gap-card);align-items:stretch}
.em-take{display:flex;flex-wrap:wrap;gap:var(--gap-head)}
.mt-body>.mt-chip{width:fit-content}          /* a reference chip hugs its name and its clear button, in EQ Match and the Emulator alike */
.em-go{display:flex;align-items:center;gap:var(--gap-set);margin-top:var(--gap-set);min-height:var(--h-s)}
.em-view{display:flex;flex-direction:column;min-width:0}
.em-key{display:flex;align-items:center;gap:var(--gap-head);margin-left:auto;font-size:var(--type-small);color:var(--muted)}
.em-key i{width:14px;height:2px;border-radius:var(--r-mark);background:var(--muted)}
.em-key i.b{margin-left:var(--gap-head);background:var(--turn)}
.em-stage{position:relative;flex:1 1 0;min-height:96px}
.em-stage canvas{position:absolute;inset:0;display:block;width:100%;height:100%}
/* the Emulator's row sits apart from the chain, under Out: it has no light and no cable */
.ae-procs.ae-apart{margin-top:auto;padding-top:var(--rail-pad);border-top:1px solid var(--hairline)}          /* pinned to the list's bottom at any height; the space from the hairline to the name equals the space from the name to the list's border (the rail's own padding), so the name is centered */
.ae-chain b.bp{background:transparent;color:var(--muted);text-decoration:line-through;box-shadow:inset 0 0 0 1px var(--hairline)}          /* a hairline edge in place of the fill, so the pill still reads on the status bar; same box as the others */

/* "Bypassed" beside the title of the tools that have no picture to carry it (the others draw it in the corner of their picture) */
.ae-ptl{display:flex;align-items:center;gap:var(--gap-card);min-width:0;height:20px}
@container aedlg (max-width:728px){.ae-ptl{height:auto;min-height:20px}}          /* the narrow layout lets a long tool name wrap onto a second line */
.ae-bypill{flex:none;height:var(--step-s);padding:0 var(--gap-card);border-radius:99px;background:var(--ink);color:var(--panel2);font:600 var(--type-note)/22px Inter,'Hanken Grotesk',system-ui,sans-serif;opacity:0;transform:translateY(calc(var(--ae-lift-sm) * -1)) scale(.94);pointer-events:none;visibility:hidden;transition:opacity var(--ae-ms) var(--ease-ui),transform var(--ae-move) var(--spring-hover),visibility 0s var(--ae-move)}
#audioDlg[data-by="1"][data-tool="fades"] .ae-bypill,#audioDlg[data-by="1"][data-tool="spec"] .ae-bypill,#audioDlg[data-by="1"][data-tool="emu"] .ae-bypill{opacity:1;transform:none;visibility:visible;transition-delay:0s}
@media (prefers-reduced-motion:reduce){.ae-bypill{transition:none}}

/* Emulator: the measuring bar, the third line in the key, and the small second line under each summary figure */
.em-key i.c{margin-left:var(--gap-head);background:var(--accent)}
.lv-sum small{display:block;margin-top:var(--gap-sub);min-height:round(calc(var(--lh) * 1em),1px);font-size:var(--type-note);--lh:1.3;color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.lv-sum small:empty{display:none}          /* a line with nothing to say takes no room */
/* the Emulator's strip keeps one height whether or not its lines have a second row, and its letters sit midway between its line and the card's bottom edge (--gap-set under the line, the rest centered, and the card's own padding below) */

/* Audio Editor control sizes: two heights only. Small (--h-s, 30px) for buttons, the band pill, and the EQ's toolbar and band row; medium (34px) for segmented controls and menus that stand alone. Controls side by side always match */
#audioDlg .btn.small{min-height:var(--h-s)}
#audioDlg .seg{min-height:var(--h-m);box-sizing:border-box}
#audioDlg .seg label{display:flex;align-items:center;justify-content:center}
#audioDlg select{height:var(--h-m);box-sizing:border-box;padding-top:0;padding-bottom:0}
#audioDlg .eq-top .seg,#audioDlg .eq-top select,#audioDlg .eq-ctl select,#audioDlg .eq-ctl input[type=number]{min-height:var(--h-s);height:var(--h-s)}
#audioDlg .eq-ctl .seg{min-height:var(--h-s)}
#audioDlg .band-pill{height:var(--h-s)}
#audioDlg .band-pill .bp-ic,#audioDlg .band-pill .bp-b{width:30px}
#audioDlg .nr-learn{min-height:var(--h-s)}
#audioDlg .nr-learn .btn,#audioDlg .nr-learn .mt-chip{height:var(--h-s)}
#audioDlg .seg label{padding-top:0;padding-bottom:0}
@container imager (max-width:256.5px){.im-low{flex-wrap:wrap}.im-low .im-lowf{flex-basis:100%}}          /* Center low notes: at 300px its slider and value go under the switch (wider, the row holds them) */
@container eq (max-width:335.5px){
  .eq-cells{grid-template-columns:minmax(0,1fr)}          /* one control per row: nothing sits side by side on a phone */
  .eq-dyn-g{grid-template-columns:minmax(0,1fr) auto;row-gap:var(--eq-col-gap)}          /* Threshold and its Auto on the first line, Range under them */
  .eq-dyn-g>:last-child{grid-column:1/-1}
  .eq-bn{flex-wrap:wrap;row-gap:var(--gap-head)}          /* Band 1, its switch, Listen, and Dynamic go on a second row when one will not hold them */
}
#aePaneImager{container:imager/inline-size}
@container imager (max-width:335.5px){
  .im-head .seg{flex:1 1 100%;width:100%}          /* the Width choice takes its own full-width row under the heading, as Normalize does */
}

/* PDF Editor controls: one height (--h-s) for every button, choice and menu in a tool's head, so what sits side by side always matches */

/* History in the PDF Editor and the main view: the same list as the Audio Editor's, a little smaller (no ticks to keep changes) */
.hist-wrap{position:relative;display:inline-flex;align-items:center;gap:var(--gap-head)}
.hist.up{top:auto;bottom:calc(100% + var(--gap-head));right:auto;left:0}
.hist-wrap .hist{z-index:60}
.pe .ed-head{position:relative}

/* How it works: the long explanations fold away under a plain line, so the page is short until you ask for more */
.how-body h4{margin:var(--gap-set) 0 var(--gap-sub);font-size:var(--type-body);font-weight:600}
.how-body h4:first-child{margin-top:0}
.how-d{margin-top:var(--gap-head);border:1px solid var(--line);border-radius:var(--r-ctl);background:var(--panel2)}
.how-d>summary{display:flex;align-items:center;gap:var(--gap-head);padding:var(--gap-head) var(--gap-set);font-size:var(--type-body);font-weight:500;color:var(--ink);cursor:pointer;list-style:none;border-radius:inherit}
.how-d>summary::-webkit-details-marker{display:none}
.how-d>summary::before{content:'';flex:none;width:6px;height:6px;border-right:1.6px solid var(--muted);border-bottom:1.6px solid var(--muted);transform:rotate(-45deg);transition:transform var(--ae-quick) var(--ease-ui),border-color var(--ae-quick) var(--ease-color)}
.how-d[open]>summary::before{transform:rotate(45deg)}
.how-d[data-closing="1"]>summary::before{transform:rotate(-45deg)}
.how-d>summary:hover{background:var(--accent-soft)}
.how-d>summary:hover::before{border-color:var(--ink)}
.how-d>summary:focus-visible{outline:2px solid var(--accent);outline-offset:-2px}
.how-in{box-sizing:border-box;padding:var(--gap-card) var(--gap-field) var(--gap-field);border-top:1px solid var(--line)}
@media (prefers-reduced-motion:reduce){.how-d>summary::before{transition:none}}
.pe-count,.chip small,.toast,#peCropName,.pe-pos{font-variant-numeric:tabular-nums}

/* the note that says a page turn is holding a trim handle: sits on the waveform, below the ruler, and fades away */
.ae-stop{position:absolute;left:50%;top:var(--ae-cy,50%);transform:translate(-50%,calc(-50% - var(--ae-lift-sm)));margin:0;max-width:min(92%,460px);padding:var(--gap-head) var(--gap-set);border:1px solid var(--glass-edge);border-radius:var(--r-ctl);background:color-mix(in srgb,var(--panel) 94%,transparent);-webkit-backdrop-filter:var(--glass-blur);backdrop-filter:var(--glass-blur);color:var(--ink);box-shadow:var(--shadow);font-size:var(--type-small);font-weight:500;--lh:1.4;text-align:center;opacity:0;pointer-events:none;z-index:2;transition:opacity var(--ae-ms) var(--ease-ui),transform var(--ae-move) var(--ease-out)}
.ae-stop.show{opacity:1;transform:translate(-50%,-50%)}
@media (prefers-reduced-motion:reduce){.ae-stop{transition:none}}

/* a button's name inside a sentence: the name sits in a small button, spelled as on the button; a switch's name carries a tiny switch */
/* the one pill over the stage while systems are found: the shared chip and bar, centered over the selector and the preview together */
.sys-find-box{position:absolute;inset:0;z-index:7;display:grid;place-items:center;pointer-events:none}          /* centered by layout, never by a transform, so the text stays crisp */
.sys-find{opacity:0;visibility:hidden;transition:opacity var(--ae-ms) var(--ease-ui,ease),visibility 0s var(--ae-ms)}
.sys-find.on{opacity:1;visibility:visible;transition-delay:0s}
@media (prefers-reduced-motion:reduce){.sys-find,.wait-bar b{transition-duration:.08s}}
.hb{display:inline-flex;align-items:center;gap:var(--gap-tight);padding:var(--hair) var(--field-pad-x);margin:0 var(--hair);border:1px solid var(--line);border-radius:var(--r-sm);background:var(--panel2);color:var(--ink);font-size:.88em;font-weight:400;--lh:1.35;white-space:nowrap;vertical-align:baseline}
.hb.primary{background:var(--accent);color:var(--accent-ink);border-color:transparent}
.hb.sw::before{content:'';flex:none;width:13px;height:8px;border-radius:99px;background:radial-gradient(circle at 74% 50%,var(--on-dark) 2.5px,transparent 2.7px),var(--accent)}
.hb.sw{padding:0;border-color:transparent;background:none;font-weight:600}
.pe .page-card.loading .tick{z-index:1}
.pe .page-card.loading canvas{opacity:var(--inactive)}          /* a card waiting for its picture shows the softened paper, the same look as a page not ready in the video preview */

/* video Fades: the shape picture fits the settings column */
.fade-shape canvas{display:block;width:100%;height:84px}
#fadeSide{margin-bottom:0}

.field output .ov-dim{color:var(--muted)}
/* the slider's end labels sit under their real notches: Off at the left end, Auto at the length it works out to, Longer at the right end */
#fadeLenField .fade-ends{position:relative;display:block;height:var(--slider-h)}
#fadeLenField .fade-ends .sl-end{position:absolute;top:0;margin-inline:0}
#fadeLenField .fade-ends .sl-end[data-v="0"]{left:calc(-1 * var(--gap-label))}
#fadeLenField .fade-ends .sl-end:last-child{right:calc(-1 * var(--gap-label))}

/* ---- Button group: the one pill for buttons that belong together (the Undo group in the video, Audio and PDF editors; the video's turn tools).
   One outline round the group, flat buttons inside it, a thin divider between them. The group corner is the button corner plus the gap (7px + 2px = 9px), so the curves nest.
   Mark up a group as <span class="btn-group"> with .btn buttons and <span class="vsep"> dividers; a lone button, a slider or a toggle that stands apart is not in one. ---- */
.btn-group{display:inline-flex;align-items:center;gap:0;padding:var(--gap-sub);border-radius:calc(var(--r-sm) + var(--gap-sub));border:1px solid var(--line);background:var(--panel2)}
.btn-group>.btn{box-sizing:border-box;height:calc(var(--h-xs) - var(--gap-tight));min-height:0;padding:0 var(--gap-card);border:0;border-radius:var(--r-sm);background:transparent;box-shadow:none;font-size:var(--type-body)}
.btn-group>.btn:hover:not([disabled]){background:var(--accent-soft)}
.btn-group>.btn[aria-pressed=true]{background:var(--accent-soft)}
.btn-group .vsep{display:block;width:1px;height:16px;margin:0 var(--gap-snug);background:var(--line)}          /* the 3px each side keep a button's hover fill clear of the divider */
.btn-group:not(:has(>:is(button,input):enabled)){opacity:var(--inactive)}          /* a group with nothing to act on (Undo, Redo, and History before there is a step; the timeline zoom before there is a score) is dimmed once as a whole, frame and all, so every group looks the same when it is switched off */
.btn-group:not(:has(>:is(button,input):enabled))>:disabled{opacity:1}          /* and its controls are not dimmed a second time */
.btn-group.hist-wrap{gap:0}
.btn-group.fmt-group{align-self:stretch;flex:none}          /* Bold and Italic: one group as tall as the field beside it (the font box, the text box), whatever that height is */
.btn-group.fmt-group>.btn{align-self:stretch;height:auto;display:grid;place-items:center;min-width:var(--h-s);padding:0 var(--gap-head)}
.btn-group.fmt-group>.btn[aria-pressed=true]{color:var(--accent)}
.btn-group.zoom{gap:0;color:var(--ink)}          /* the zoom group reads as Undo, Redo, and Fit do: ink when it can be used, dimmed with the rest of the group when it cannot (it inherited the muted label color before, so a usable minus, plus, and Fit looked switched off) */          /* the timeline's zoom: minus, the slider, plus, then Fit, in the same group as Undo and Redo (the page-size strip's minus and plus) */
.btn-group.zoom>.zbtn{width:var(--w-glass);height:calc(var(--h-xs) - var(--gap-tight));border:0;border-radius:var(--r-sm);background:transparent;box-shadow:none}
.btn-group.zoom>.zbtn:hover:not(:disabled){background:var(--accent-soft)}
.btn-group.zoom>.zbtn svg{width:14px;height:14px}
.btn-group.zoom>input{margin-inline:var(--gap-label)}
/* full screen: the group floats over the wave, so it is glass with a shadow; its buttons stay flat inside it */
#audioDlg.afull .ed-head .btn-group{border-color:var(--glass-edge);background:var(--glass-bg);-webkit-backdrop-filter:var(--glass-blur);backdrop-filter:var(--glass-blur);box-shadow:var(--glass-shadow)}
#audioDlg.afull .ed-head .btn-group>.btn{background:transparent;border:0;box-shadow:none;-webkit-backdrop-filter:var(--glass-off);backdrop-filter:var(--glass-off)}
#audioDlg.afull .ed-head .btn-group>.btn[aria-pressed=true],#audioDlg.afull .ed-head .btn-group>.btn:hover:not([disabled]){background:var(--accent-soft)}

/* Dim: boxes drawn on a page. The frame and handles are Crop's own; the area inside is faded like the finished page, and a round X at its center deletes it */
.pe-dim-layer{position:absolute;inset:0;z-index:2;touch-action:none;cursor:crosshair;container-type:size}          /* a size container: a box's X and handles are sized from the picture's own size in CSS, so they are right the moment a card is laid out, with no script */
.pe-dim-layer[hidden]{display:none}
.pe-win:not([data-mode="dim"]) .pe-dim-layer{display:none}
.pe-win[data-mode="dim"] #peCropBox{display:none}
.pe-dimbox{pointer-events:auto;box-shadow:none;background:var(--dim-fill);--bpx:min(calc(var(--bw,0) * 100cqw),calc(var(--bh,0) * 100cqh));--dz:clamp(6px,calc(var(--bpx) * .5),22px);--hs:clamp(5px,calc(var(--bpx) * .28),22px);--hl:clamp(10px,calc(var(--bpx) * .45),28px)}
.pe-dimbox .h.nw,.pe-dimbox .h.ne,.pe-dimbox .h.se,.pe-dimbox .h.sw{width:var(--hs);height:var(--hs)}
.pe-dimbox .h.n,.pe-dimbox .h.s{width:var(--hl);margin-left:calc(var(--hl)/-2)}
.pe-dimbox .h.e,.pe-dimbox .h.w{height:var(--hl);margin-top:calc(var(--hl)/-2)}
.pe-dimbox.sel .h{opacity:1;transform:none}
.pe-crop-pg .pe-dimbox{border-width:calc(1.5px/var(--z,1))}
.pe-dimx{position:absolute;left:50%;top:50%;width:var(--dz);height:var(--dz);margin:calc(var(--dz)/-2) 0 0 calc(var(--dz)/-2);padding:0;border:0;border-radius:50%;background:var(--accent);color:var(--on-dark);display:grid;place-items:center;cursor:pointer;box-shadow:var(--chip-shadow);scale:calc(1/var(--z,1));transition:transform var(--t-press) var(--spring-press)}
.pe-dimx svg{width:62%;height:62%}
@media (hover:hover){.pe-dimx:hover{transform:scale(1.1)}}
.pe-dimx:focus-visible{outline:2px solid var(--paper);outline-offset:1px}
.pe-win[data-mode="dim"] .pe-tools{z-index:3}          /* the Open button stays above the drawing layer */

/* the start and end glide: no scroll bar flickers in while the axis is wider than the window */
.tl-scroll.gliding{overflow-x:hidden}

/* ----- Info windows (About, How it works, Import/Export, Keyboard shortcuts, Diagnostics): one voice for the subtitle, one for the section labels ----- */
.dlg.page p{text-wrap:pretty}
/* About: three short groups (who made it, how to help, how to reach out): close inside a group, more room between groups */
.about-g{display:grid;gap:var(--gap-set)}
.about-g+.about-g{margin-top:var(--gap-set)}
.about-g p{--lh:1.55}
/* small delights, none of them an icon: the answers settle in one after another when the window opens, a dropdown's lines follow it down as it opens, and its arrow leans toward where it will go */
@keyframes howIn{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:none}}
@media (prefers-reduced-motion:no-preference){
  .how-d[open]:not([data-closing="1"])>.how-in>*{animation:howIn .32s var(--spring-hover) backwards;animation-delay:calc(20ms + min(var(--k,0)*16ms,96ms))}
  .how-d[open]:not([data-closing="1"])>.how-in>:nth-child(1){--k:1}
  .how-d[open]:not([data-closing="1"])>.how-in>:nth-child(2){--k:2}
  .how-d[open]:not([data-closing="1"])>.how-in>:nth-child(3){--k:3}
  .how-d[open]:not([data-closing="1"])>.how-in>:nth-child(4){--k:4}
  .how-d[open]:not([data-closing="1"])>.how-in>:nth-child(5){--k:5}
  .how-d[open]:not([data-closing="1"])>.how-in>:nth-child(6){--k:6}
  .how-d[open]:not([data-closing="1"])>.how-in>:nth-child(7){--k:7}
  .how-d[open]:not([data-closing="1"])>.how-in>:nth-child(8){--k:8}
  .how-d[open]:not([data-closing="1"])>.how-in>:nth-child(9){--k:9}
  .how-d[open]:not([data-closing="1"])>.how-in>:nth-child(10){--k:10}
  .how-d[open]:not([data-closing="1"])>.how-in>:nth-child(11){--k:11}
  .how-d[open]:not([data-closing="1"])>.how-in>:nth-child(12){--k:12}
  .how-d[open]:not([data-closing="1"])>.how-in>:nth-child(13){--k:13}
  .how-d[open]:not([data-closing="1"])>.how-in>:nth-child(14){--k:14}
  .how-d[open]:not([data-closing="1"])>.how-in>:nth-child(15){--k:15}
  .how-d[open]:not([data-closing="1"])>.how-in>:nth-child(16){--k:16}
  .how-d[open]:not([data-closing="1"])>.how-in>:nth-child(17){--k:17}
  .how-d[open]:not([data-closing="1"])>.how-in>:nth-child(18){--k:18}
  .how-d[open]:not([data-closing="1"])>.how-in>:nth-child(19){--k:19}
  .how-d[open]:not([data-closing="1"])>.how-in>:nth-child(20){--k:20}
  #howDlg:not([hidden]) .how-body>section{animation:howIn .5s var(--ease-out) backwards;animation-delay:calc(140ms + var(--i,0)*55ms)}
  #howDlg:not([hidden]) .how-body>section:nth-child(2){--i:1}
  #howDlg:not([hidden]) .how-body>section:nth-child(3){--i:2}
  #howDlg:not([hidden]) .how-body>section:nth-child(4){--i:3}
  #howDlg:not([hidden]) .how-body>section:nth-child(5){--i:4}
  #howDlg:not([hidden]) .how-body>section:nth-child(6){--i:5}
}

/* About: the version, hovered, gets one soft sweep of light across it, a glissando for the eye, and its words come up to full ink */
.about .ver{background:linear-gradient(105deg,transparent 35%,var(--accent-soft) 50%,transparent 65%) 100% 0/250% 100% no-repeat;transition:color var(--ae-quick) var(--ease-ui),border-color var(--ae-quick) var(--ease-ui)}
.about .ver:hover{color:var(--ink);border-color:color-mix(in srgb,var(--accent) 45%,var(--line))}
@keyframes verGliss{from{background-position:100% 0}to{background-position:0 0}}
@media (prefers-reduced-motion:no-preference){.about .ver:hover{animation:verGliss .9s var(--ease-out)}}
/* a page whose picture is still being made (preview and selector): after a moment, the wait pill centered on it; the layer sits over the canvas and never takes a click */
.pg-waits{position:absolute;pointer-events:none;z-index:1}
.pg-wait{position:absolute;display:flex;align-items:center;justify-content:center;transition:opacity var(--ae-ms) var(--ease-ui,ease)}          /* centered by layout, never by a transform, so the text stays crisp; the pill may pass a narrow page's edges */
.pg-wait.out{opacity:0}
/* the one wait pill: dark, nearly solid, with white text (the same in light and dark, and over any picture) and a bar along its foot (a fill once a share is known, the shared sweep while it is not) */
.wait-pill{position:relative;display:inline-flex;align-items:center;flex:none;overflow:hidden;padding:var(--gap-label) var(--gap-card);border-radius:99px;background:var(--pill-bg);color:var(--on-dark);font:600 var(--type-small) "Hanken Grotesk",system-ui,sans-serif;line-height:round(1.3em,1px);--lh:1.3;white-space:nowrap}
.wait-pill .wait-bar{position:absolute;left:0;right:0;bottom:0;height:3px;overflow:hidden;background:var(--on-dark-faint)}
.wait-bar b{display:block;height:100%;background:color-mix(in srgb,var(--accent) 55%,var(--on-dark));transform-origin:0 50%;transform:scaleX(0);transition:transform var(--ae-move) var(--ease-out);will-change:transform}          /* a scaled layer, so the fill glides on the compositor even while the page is busy drawing */
.wait-bar.sweeping::after{background:color-mix(in srgb,var(--accent) 55%,var(--on-dark))}          /* the sweep in the fill's own color */
.pg-wait-t{display:inline-block;text-align:center}
.pg-wait-l{opacity:0;transition:opacity var(--ae-quick) var(--ease-ui,ease)}
.pg-wait.show .pg-wait-l{opacity:1}
@media (prefers-reduced-motion:reduce){.pg-wait,.pg-wait-l{transition-duration:.08s}}
.sys-find #sysFindT{font-variant-numeric:tabular-nums;white-space:nowrap;display:inline-block;text-align:center}          /* "Processing 100%" fits, so the pill never changes width as the number grows */

/* ----- Fades: Length and Shape are two cards side by side at the pane's full height; Shape is the picture with Gradual | Straight pinned under it. Stacked, Length comes first and Shape second. ----- */
#aePaneFades{container:fades/inline-size}
.fd-grid{grid-template-columns:minmax(0,1fr) minmax(0,1fr);grid-template-rows:minmax(0,1fr)}
.fd-shape canvas{display:block;width:100%;flex:1 1 0;min-height:150px;height:auto}          /* the picture takes the card's spare height, as the Imager's scope does */
@container fades (max-width:399px){
  .fd-grid{height:auto;grid-template-columns:minmax(0,1fr);grid-template-rows:none}
  .fd-shape canvas{min-height:140px}
}

/* ==================== Layout system: the shared building blocks of a tool window ====================
   Every card in a tool window (.ae-card) is built the same way, and a new card is laid out correctly the moment it follows it:
     card         border, --r-lg corners, 16px at the sides and --gap-set below (and above, plus --gap-head on a card with a heading row); a column of a heading row, a body, and an optional footer row (.foot-row)
     heading row  (.t-head) spans the card's width and is as tall as its letters. The heading's letters (cap top) sit 21px under the card's top edge. A choice or button on the row is --h-s (30px) tall, centered on the middle of
                  the letters, and the first of them sits at the row's right end, on the card's right content line; the (i) sits right after the heading. The row ends at its lowest visible edge: the baseline, or
                  the bottom of a choice or button on it (the (i) does not count).
     balanced body  the body sits between the heading row and the next line (the footer row's line, or the card's bottom edge). One part is centered (equal space above and below); several parts spread, the first under the
                  heading and the last above the line. Flex auto margins, --card-gap kept on each side at the least. Centering is by what you see, so text is trimmed to its letters (cap top to baseline), a slider to its thumb, and a scale
                  to its numbers: a box ends where its ink does (--trim-t and --trim-b where the browser can trim text, --cut-t and --cut-b always).
   Distances come from the spacing tokens; a card, tool, or id never carries a heading margin of its own. */
:root{
  --cap:.697; --asc:1; --dsc:.3;          /* the font's cap height, ascent, and descent as fractions of the font size (Hanken Grotesk) */
  --head-fs:11.5px;          /* a heading's size, so the row can be sized by its letters */
  --trim-h:auto;
}
/* Text trimmed to its letters, so a box ends where the letters do. Where the browser trims text (text-box), it does; elsewhere the same trim is made from the font's metrics (the line box's leading and the part of the ascent above the capitals and the descent below the baseline) as a negative margin. One rule, in both: the two values below are zero where the browser trims. */
:root{
  --cut-t:calc(-1 * (round(down, calc((1lh - round(1em, 1px) - round(var(--dsc) * 1em, 1px)) / 2), 1px) + round(var(--asc) * 1em, 1px) - round(var(--cap) * 1em, 1px)));
  --cut-b:calc(-1 * (1lh - round(down, calc((1lh - round(1em, 1px) - round(var(--dsc) * 1em, 1px)) / 2), 1px) - round(var(--asc) * 1em, 1px)));

  --trim-t:var(--cut-t);--trim-b:var(--cut-b);          /* --cut is always the metrics' trim, for text the browser cannot trim (a label that is a flex box holds its text in a box of no name) */
}
@supports (text-box:trim-both cap alphabetic){:root{--trim-t:0px;--trim-b:0px;--trim-h:round(var(--cap) * 1em, 1px)}}
:root{--trim-edge-letters:cap alphabetic; --trim-edge:var(--trim-edge-letters)}          /* where a trim ends, for text the browser trims: at the capitals (every label, number, and file name) */          /* trimmed by the browser, a box is its letters' height on a whole pixel */
:is(#audioDlg,#pdfDlg) .ae-card :is(h4,.field>label>span:not(.mt-title),.field>label>output:not(.mt-body .field>label>output),.bal-meter>span,.pe-g>.t-lbl){text-box:trim-both cap alphabetic;margin-block:var(--trim-t) var(--trim-b);height:var(--trim-h)}
#audioDlg .ae-card .lv-big{text-box:trim-both cap alphabetic;margin-block:var(--trim-t) var(--trim-b);height:var(--trim-h)}          /* a big number is trimmed to its letters like any text */
#audioDlg .ae-card>.lv-big{margin-block:auto 0;position:relative;top:calc((var(--trim-t) - var(--trim-b)) / 2)}          /* a big value that is a card's own part (Gain) is centered between the heading and the slider: the spare room is split evenly between its top and the slider's top (the card's last part already takes the rest), so there is equal room above and below its letters. Where the browser cannot trim text, the box has the font's spare room, which top gives back */
#audioDlg .ae-card .eq-lbl{height:var(--line-s);line-height:var(--line-s);margin-block:var(--cut-t) var(--cut-b)}          /* every label in the band row is one 16px line trimmed to its letters, so every label shares one line and every control one center line */
#audioDlg .ae-card .eq-lbl>*{line-height:var(--line-s)}
#audioDlg .ae-tool .ae-tn{text-box:trim-both cap alphabetic;margin-block:var(--trim-t) var(--trim-b);height:var(--trim-h)}          /* a tool's name in the list is its letters, so the row can be centered by what you see */
/* a tag after a name: its own element, a pill with the same space on each side of its word */
.beta-chip{display:inline-flex;align-items:center;flex:none;height:20px;padding:0 var(--gap-head);border:1px solid var(--line);border-radius:99px;background:var(--panel2);color:var(--muted);font-size:var(--type-note);font-weight:600;--lh:1;white-space:nowrap}
.beta-chip[hidden]{display:none}
.ae-proc .beta-chip{margin:0 var(--gap-sub) 0 0}          /* in the list the chip is the row's last part, on the readouts' right line; the Amount sits before it */
:is(#audioDlg,#pdfDlg) .ae-card input[type=range]{margin-block:calc(var(--hair) * -1)}          /* a slider's box is its thumb and ring (the input is 20px tall around an 18px thumb) */
/* every scale label, in any panel: */
.sl-ends .sl-end,#audioDlg .ae-card .sl-end{text-box:trim-both cap alphabetic;box-sizing:content-box;height:var(--trim-h);padding:var(--gap-sub) var(--gap-label);margin:calc(var(--trim-t) - var(--gap-sub)) calc(-1 * var(--gap-label)) calc(var(--trim-b) - var(--gap-sub))}          /* a scale label's box is its letters; the 2px and 4px around them are its click area, taken back by the margin */

/* the card: a column of a heading row, a body, and an optional footer row, --card-gap apart at the least (a card on a grid of its own sets 0 and places its parts itself) */
:where(#audioDlg) .ae-card{--card-gap:var(--gap-set)}
:where(#audioDlg) .ae-card:where(.on-grid,.own-grid){--card-gap:0px}
:where(#audioDlg) .ae-card:where(:not(.on-grid,.own-grid)){display:flex;flex-direction:column;gap:var(--card-gap)}          /* a card with a layout of its own (a grid, set by its id or class) keeps it: this rule is the least specific one */

/* a card with a heading row has --gap-head more above it, so the heading's letters sit 21px under the card's top edge (1px border, --gap-set, --gap-head) */
#audioDlg .ae-card:has(>.t-head:first-child,>h4:first-child){padding-top:calc(var(--gap-set) + var(--gap-head))}

/* the heading row */
#audioDlg .ae-card>.t-head{position:relative;display:flex;flex-wrap:wrap;align-items:flex-start;justify-content:flex-start;column-gap:var(--gap-head);row-gap:calc((var(--h-s) - var(--cap-px)) / 2 + var(--gap-head));min-height:var(--cap-px);margin:0 0 calc(var(--gap-set) - var(--card-gap));padding:0;--cap-px:round(calc(var(--cap) * var(--head-fs)), 1px)}          /* wrapped, a choice or button takes a line of its own, --gap-head under the letters */
#audioDlg .ae-card>.t-head:has(>:is(.btn,.seg,select,.mt-acts)){min-height:calc((var(--cap-px) + var(--h-s)) / 2)}          /* a row with a choice or button ends where that does (centered on the letters, so half its height below their middle), so the card's content is what you see */
#audioDlg .ae-card>.t-head.hang:has(>:is(.btn,.seg,select,.mt-acts)){min-height:var(--cap-px)}
#audioDlg .ae-card>.t-head.hang>:is(.btn,.seg,select,.mt-acts){margin-bottom:calc((var(--cap-px) - var(--h-s)) / 2)}          /* a heading row whose choice hangs into the body (nothing sits beside it there): the row ends at its letters, so the body is balanced between the letters and the next line */
#audioDlg .ae-card>.t-head>h4{min-height:0;font-size:var(--head-fs);margin-inline:0}
#audioDlg .ae-card>.t-head>:is(.btn,.seg,select,.mt-acts){height:var(--h-s);min-height:0;box-sizing:border-box;margin-block:calc((var(--cap-px) - var(--h-s)) / 2) 0}          /* centered on the middle of the letters: a half of its height above them and below, so the row ends at its lowest edge */
#audioDlg .ae-card>.t-head>.info-i{margin-block:calc((var(--cap-px) - var(--icon-l)) / 2)}
#audioDlg .ae-card>.t-head>:not(h4,.info-i,.tip,.head-note,.btn,.seg,select,.mt-acts,.lv-clip){display:flex;align-items:center;align-content:center;height:var(--cap-px);margin-block:0}          /* anything else on the row (a readout, a key) is as tall as the letters and centered on them */
#audioDlg .ae-card>.t-head .mt-n.inl{vertical-align:middle;margin-block:calc(var(--step-s) / -2)}          /* a step number in a heading never makes the row taller */
#audioDlg .ae-card>.t-head>.seg label{padding-block:0}
#audioDlg .ae-card>.t-head>.seg span{padding:0 var(--gap-card)}
#audioDlg .ae-card>.t-head>.lv-clip{margin-block:calc((var(--cap-px) - var(--clip-h)) / 2)}          /* the Clip pill is its own 24px height, centered on the letters; it takes no more room than the letters, so the card's body never moves */
#audioDlg .ae-card>.t-head>:not(h4,.info-i,.tip,.head-note):not(:not(h4,.info-i,.tip,.head-note) ~ *){margin-left:auto}          /* the first of them goes to the row's right end; the rest follow it */

/* the balanced body: the parts between the heading row and the next line (the footer row's line, or the card's bottom edge) keep --card-gap at the least on each side. One part is centered, so its space above and below are equal; several parts spread, the first under the heading and the
   last above the line, and the spare height goes between them. Flex auto margins, so a new card needs no numbers. A collapsed fold and anything out of the flow is not a part, and a collapsed fold takes no gap. */
#audioDlg .ae-card:not(.on-grid,.own-grid)>:not(.t-head,.foot-row,[hidden],.nr-prog,.tip,.t-note,.fa:not(.open),.fa-stack) ~ :not(.t-head,.foot-row,[hidden],.nr-prog,.tip,.t-note,.fa:not(.open),.fa-stack),
#audioDlg .ae-card:not(.on-grid,.own-grid)>:not(.t-head,.foot-row,[hidden],.nr-prog,.tip,.t-note,.fa:not(.open),.fa-stack):not(:has(~ :not(.t-head,.foot-row,[hidden],.nr-prog,.tip,.t-note,.fa:not(.open),.fa-stack))){margin-top:auto}          /* every part after the first, and a part that is the only one */
#audioDlg .ae-card:not(.on-grid,.own-grid)>:is(:first-child,.t-head+*):not(.t-head,.foot-row,[hidden],.nr-prog,.tip,.t-note,.fa:not(.open),.fa-stack):not(:has(~ :not(.t-head,.foot-row,[hidden],.nr-prog,.tip,.t-note,.fa:not(.open),.fa-stack))){margin-bottom:auto}          /* the only part also has space below it: it is centered */
#audioDlg .ae-card:not(.on-grid,.own-grid)>.fa:not(.open){margin-top:calc(-1 * var(--card-gap))}
#audioDlg .ae-card:not(.on-grid,.own-grid)>.fa-stack:not(:has(>.fa.open)){margin-top:calc(-1 * var(--card-gap))}          /* a stack with no fold open holds nothing, so it takes no gap either */
#audioDlg .ae-card:not(.on-grid,.own-grid)>.foot-row{margin-top:0}          /* the line above the footer is where the body's spare height ends */

/* the column rule: stacked cards share their column, declared once by each tool grid (never a height on a card). Two control cards share it evenly; a control card over a list or a picture takes a third; a card is never shorter than its content (the minimum of a track is its content) */
.sp-grid{display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:minmax(round(calc((100% - var(--gap-card)) / 3), 2px),auto) minmax(0,1fr)}          /* Spectra: Select over the list of edits */
.sp-grid>.sp-sel,.sp-grid>.sp-lcard{flex:none}
.im-ctl{display:grid;grid-template-rows:1fr 1fr}          /* the Imager: Width over Balance */
.im-ctl>.ae-card{flex:none}

/* label rows: a label beside a control with words sits on the words' baseline, and is 13px and regular; beside a switch it is centered */
#audioDlg .foot-row :is(label,span,.check-row),#audioDlg .im-listen>span{font-size:var(--type-body);font-weight:400}
#audioDlg .eq-lbl .btn{font-weight:400}          /* a button never takes the weight of the label row it sits in */

/* the numbers under every slider (any panel) start --scale-gap under its track */
.sl-ends{margin-top:calc(var(--scale-gap) - (var(--slider-h) - var(--track)) / 2)}
.field:has(>.sl-ends){row-gap:0}
.field:has(>.sl-ends)>.lbl:not(#audioDlg *){margin-bottom:var(--gap-label)}          /* outside the Audio Editor a label still sits --gap-label above its slider: the row gap is zero so the numbers keep --scale-gap */
#audioDlg .sl-in:has(>.tick)+.sl-ends{margin-top:calc(var(--scale-gap-thumb) - var(--gap-sub) - var(--tick-h))}          /* a tick row sits between the thumb and the numbers: the numbers still start --scale-gap-thumb under the thumb */
#audioDlg .ae-card :is(output:not(.lv-big),.bm-val,.head-note){font-size:var(--value-fs)}
#audioDlg .ae-card output:not(.lv-big){font-weight:400}
#audioDlg :is(.dim,.none) :is(.dim,.none,input[type=range]:disabled,input.switch:disabled,.btn:disabled,.btn[disabled],.icon-btn[disabled]){opacity:1}          /* inside something already dimmed, a dimmed part is not dimmed again (no stacking: one level, --inactive) */          /* every value readout is regular weight, wherever it sits (a label row inherits the label's weight otherwise) */
#audioDlg .sl-in:not(:has(>.sl-end:not(.tick))){grid-template-columns:minmax(0,1fr);column-gap:0}          /* a slider row with no words beside its track is just the track, no empty column or gap */
#audioDlg .sl-in:not(:has(>.sl-end:not(.tick)))>input{grid-column:1}
#audioDlg .sl-in:not(:has(>.sl-end:not(.tick)))>.sl-end.tick{grid-column:1}

/* ==================== 20. SPACING AND SMALL TEXT: the tokens in :root, the title block, and the three small-text roles ====================
   Title block (.t-block): a title and its subtitle in one block, --gap-sub apart, so the subtitle's place never depends on the buttons beside it.
   A window title is Newsreader 24px; a tool head (.t-block.tool) is a 20px title line, --gap-sub, and a 16px subtitle line (38px), centered against the head's buttons.
   Subtitle (.t-sub): 13px, muted, one sentence.  Label: 13px, --gap-label above its control (a .field's own gap).  Note (.t-note): 12px on a 16px line, muted, --gap-label under what it explains.
   Heading (.t-head): a card or group heading, --gap-head above its content. One setting to the next: --gap-set in an editor card, --gap-field in the video panel and the page windows. */
.t-block{display:grid;gap:var(--gap-sub);min-width:0}
.t-block>h2,.t-block>h3{margin:0}
.t-block.tool{align-content:center}
.t-block.tool h3{margin:0;font-size:var(--type-heading);font-weight:600;line-height:20px}
.t-sub{display:block;margin:0;font-size:var(--type-body);font-weight:400;font-style:normal;line-height:16px;color:var(--muted);text-wrap:pretty}
.t-lbl{font-size:var(--type-body);line-height:16px}
.t-note{margin:var(--gap-label) 0 0;font-size:var(--type-caption);font-weight:400;line-height:16px;color:var(--muted);text-align:left;text-wrap:pretty}
.field>.t-note,.t-note.inline{margin:0}
.t-head{margin:0 0 var(--gap-head)}
.dlg>.t-note{margin-top:calc(var(--gap-label) - var(--gap-field))}          /* a note under a control in a window sits --gap-label under it, not a whole window gap */
.pg>.field{margin-bottom:0}
.eq-bn .eq-lbl{justify-content:flex-start;gap:var(--gap-label)}          /* "Band 1" reads as one label, left-aligned like the others */

/* Narrow layout (760px and under): the tool bar is the tool's heading, with Match gain and Bypass on its line; the pane's own title row goes */
@container aedlg (max-width:728px){
  #audioDlg.head-in-bar .ae-top,#audioDlg.head-in-bar .ae-rule{display:none}
  #audioDlg.head-in-bar .ae-rail-cur output{display:none}
}
/* where the cards stack (the dialog's width is 488px and under): labels become icons and the subtitles go. One collapsing button class, .ae-ib (an icon .ae-ic and a label .ae-lb), serves Match gain and Bypass in the head, and Spectra's Draw, Box, Band, Moment, Heal, and Reduce (words at full size, icons only here) */
.btn.small.ico{min-width:var(--h-s);padding:0;display:inline-flex;align-items:center;justify-content:center}          /* a button that is only an icon (Trim silence): as wide as it is tall, at every width; its name is in its tooltip and aria-label */
.btn.small.ico svg{width:var(--icon-s);height:var(--icon-s);flex:none}          /* the same glyph size as Full screen beside it and the video strips: a glyph on glass is --icon-s (14px) in every bar */
.ae-ib .ae-ic{display:none}
@container aedlg (max-width:488px){
  #audioDlg :is(.ae-bar,.ae-abs) .ae-ib.btn{min-width:var(--h-s);padding:0;display:inline-flex;align-items:center;justify-content:center}
  #audioDlg .ae-ib .ae-lb{display:none}          /* the buttons shrink to Lucide icons so a long tool name keeps one line */
  #audioDlg .ae-ib .ae-ic{display:block;width:16px;height:16px}
  #audioDlg .ae-pt .ae-sub,#audioDlg .ed-lead{display:none}          /* a tool's one-line description and the window's subtitle give way */
}

/* Narrow layouts (760px and under): one card. The tool bar is the top of the tool window, divided from it by a hairline, as in the wide layout */
@container aedlg (max-width:728px){
  #audioDlg.head-in-bar:not(.afull) .ae-main{gap:0}
  #audioDlg.head-in-bar:not(.afull) .ae-rail{border-radius:var(--r-lg) var(--r-lg) 0 0;border-bottom-color:var(--hairline)}
  #audioDlg.head-in-bar:not(.afull) .ae-win{border-top:0;border-radius:0 0 var(--r-lg) var(--r-lg)}
}
/* Narrow layouts: the transport floats over the picture's lower edge as glass, as in the wide layout */
@container aedlg (max-width:728px){
  #audioDlg:not(.afull) .dlg.editor.ae{grid-template-rows:auto minmax(120px,min(150px,calc(100dvh - 400px))) auto minmax(0,1fr) auto}
  #audioDlg:not(.afull) .ae-bar{gap:var(--gap-head)}
  #audioDlg:not(.afull) .ae-times{flex:none}
  #audioDlg:not(.afull) .ae-tail{margin-left:auto}          /* Trim silence and Full screen sit at the bar's right end */
}
@container aedlg (max-width:488px){html #audioDlg:not(.afull) .ae-wave{height:150px}}
@container aedlg (max-width:519px){          /* the times stack when they no longer fit on one line beside the rest of the bar (the bar is under 476px wide) */
  #audioDlg:not(.afull) .ae-times{display:flex;flex-direction:column;gap:0;font-size:var(--type-small);line-height:1.2}
  #audioDlg:not(.afull) .ae-times span{display:block;white-space:nowrap}
  #audioDlg:not(.afull) .ae-times b{display:inline}
}
.lv-meter>.lv-sum>div{flex-wrap:wrap;column-gap:var(--gap-head);row-gap:var(--gap-head)}          /* where a column is too narrow for its label and value side by side, the value goes under its label instead of being cut off */
.lv-meter>.lv-sum b,.em-view>.lv-sum b{flex:none;overflow:visible;text-overflow:clip}
/* the transport gives way only where its parts no longer fit, and the times go last: the spacing tightens first (the bar is 362px wide or less), then, with Play, Wave | Spec, Trim silence, and Full screen still showing, the start and end times (the bar is under 288px) */
@container aedlg (max-width:400px){#audioDlg:not(.afull) .ae-bar .ae-view label{padding-left:var(--gap-label);padding-right:var(--gap-label)}#audioDlg:not(.afull) .ae-bar{padding:0 var(--gap-label);gap:var(--gap-label)}}
@container aedlg (max-width:324px){#audioDlg:not(.afull) .ae-times{display:none}}
.ae-chain>span{min-width:0;overflow:hidden;text-overflow:ellipsis}          /* a status line too long for a narrow window ends in an ellipsis, as its own box, instead of being cut off */

/* Level's strip: the label and its value are boxes trimmed to their letters and centered on each other, so their letters share one middle whatever their sizes */
#audioDlg :is(.lv-meter,.em-view)>.lv-sum :is(span,b){text-box:trim-both cap alphabetic;margin-block:var(--trim-t) var(--trim-b);height:var(--trim-h)}

/* ==================== Narrow sizes: cards that stack take their content height ====================
   The column rule (two control cards share a column, a control card over a list takes a third) applies only where the tool body has a fixed height to share. Where the dialog is 728px wide or less the body scrolls and the pane is
   as tall as its tool; and where a tool's own pane is too narrow for its cards to stand side by side (a container query on the pane, whatever the screen) the cards stack and the body scrolls as well. In both, each grid's rows
   are its cards' own heights and nothing is left empty under a card. */
@container aedlg (max-width:728px){
  #audioDlg :is(.tool-grid,.nr-grid,.lv-grid,.fd-grid,.im-cols,.im-ctl,.em-grid){height:auto;grid-template-rows:none}
  #audioDlg .ae-pane{box-sizing:border-box;display:flex;flex-direction:column;min-height:100%}          /* where the body is taller than its tool, the pane is as tall as the body and its grid takes the spare height (the cards stretch; Spectra's list of edits takes it), as at the main size */
  #audioDlg .ae-pane>:is(.tool-grid,.nr-grid,.lv-grid,.fd-grid,.im-cols,.em-grid,.sp-grid){flex:1 0 auto}
  #audioDlg .sp-grid{height:auto;flex:1 0 auto;grid-template-rows:auto minmax(0,1fr)}          /* the list of edits takes whatever room the body has left under Select, as it does at the main size; when the body is shorter than its content the grid is its content's height and the body scrolls */
  #audioDlg .sp-lcard{flex:none;min-height:120px}          /* the tool body scrolls, so the Edits card keeps a height instead of collapsing under its own heading */
  #audioDlg .sp-list{flex:1 1 160px}          /* a list of edits is 160px tall and scrolls inside, and takes any room the card has beyond that */
}
@container spec (max-width:469.5px){
  #audioDlg .sp-grid{height:auto;min-height:100%;grid-template-rows:auto minmax(0,1fr)}
  #audioDlg .sp-lcard{flex:none;min-height:120px}
  #audioDlg .sp-list{flex:1 1 160px}          /* a list of edits is 160px tall and scrolls inside, and takes any room the card has beyond that */
}
@container imager (max-width:553.5px){          /* the scope (244px) and the controls no longer fit side by side: one column, the scope at the height it has beside the cards (its square is drawn centered) */
  #audioDlg :is(.im-cols,.im-ctl){height:auto;grid-template-rows:none}
  #audioDlg .im-cols{grid-template-columns:minmax(0,1fr)}
  #audioDlg .im-scope canvas{flex:none;height:calc(var(--scope-col) - 2 * var(--gap-field))}
  #audioDlg .im-lowf{flex-basis:auto;max-width:none}          /* the Center low notes row stays on one line, so its switch keeps equal space above and below (the slider narrows instead) */
}
@container emu (max-width:561.5px){          /* the Reference step and the Tone picture no longer fit side by side */
  #audioDlg .em-grid{height:auto;grid-template-columns:minmax(0,1fr);grid-template-rows:none}
  #audioDlg .em-stage{min-height:120px}
}

/* the learned noise reads as a quiet status beside Learn: a check and the words, with a small clear button, not a pill */
.nr-learn .mt-chip{border:0;background:none;padding:0;gap:var(--gap-label);color:var(--muted)}
.nr-learn .mt-chip::before{content:"";flex:none;width:14px;height:14px;margin-right:var(--gap-sub);background:var(--accent);-webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center/contain no-repeat;mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center/contain no-repeat}
.nr-learn .mt-chip b{font-weight:400}

.nr-learn .btn{min-width:0}
.nr-foot{flex-wrap:wrap;column-gap:var(--gap-set)}          /* the two switches share the row, and stack when the card is too narrow for both */
.nr-foot>label{display:flex;align-items:center;gap:var(--gap-card);font-size:var(--type-value);white-space:nowrap}

/* the eraser, on the System selector: a ring at the pointer (a small round tip, the same size at every zoom), a muted one where a stroke cannot start, and a glass × in the middle of a hovered stroke */
.erase-ring{position:absolute;left:0;top:0;z-index:5;width:var(--brush);height:var(--brush);margin:calc(var(--brush) / -2) 0 0 calc(var(--brush) / -2);box-sizing:border-box;border-radius:50%;border:var(--hair) solid var(--erase-edge);pointer-events:none;will-change:transform}
.erase-ring.no{border-style:dashed;border-color:var(--muted);opacity:.8}
.erase-ring[hidden]{display:none}
.sys-sel.erasing #selCv{cursor:none;touch-action:none}
.sys-sel.erasing.pan-ready #selCv{cursor:grab!important}
.erase-x{position:absolute;left:0;top:0;z-index:7;display:grid;place-items:center;width:24px;height:24px;translate:-50% -50%;padding:0;border:0;background:none;cursor:pointer;color:var(--ink);will-change:transform}
.erase-x[hidden]{display:none}
.erase-x-chip{display:grid;place-items:center;width:var(--erase-x);height:var(--erase-x);border-radius:50%;background:var(--glass-bg),var(--panel2);box-shadow:var(--erase-x-shadow);-webkit-backdrop-filter:var(--glass-blur);backdrop-filter:var(--glass-blur);transition:color var(--ae-quick) var(--ease-color)}
.erase-x-chip svg{width:8px;height:8px}
.erase-x:hover .erase-x-chip,.erase-x:focus-visible .erase-x-chip{color:var(--danger)}

/* ScoreMotion identity: keep editor geometry and controls intact. */
.sm-wordmark{display:flex;align-items:center;gap:.45em;height:100%;font-family:Georgia,serif;font-weight:400;font-style:normal;color:var(--ink);white-space:nowrap;line-height:1}
.sm-wordmark img{display:block;height:100%;width:auto;flex:none;background:#f5efe5;border-radius:50%}
.brand h1 .sm-wordmark{font-size:20px}.empty-logo .sm-wordmark{font-size:clamp(28px,5vw,48px)}
@media(max-width:520px){.brand h1 .sm-wordmark{font-size:16px}}
