/* Audio2MIDI — desktop window UI.
   Layout: top bar (logo + song · the three steps, centred) / one view at a time:
   1 Загрузка = dashed card (logo, version, greeting, file → «Проверить файл» → «Старт» → progress with «Стоп» → «Далее»);
   2–3 = overview (▶, the song, «Оригинал», master volume) + track rows + action bar / the notes screen.
   The steps follow the approved stands (steps 1–3, the neck, 10–11.10.2026);
   the screens change with one slide (.3 s).
   Stem colours are the identity of each instrument across the app (rows, waveforms, later the note lanes).
   Rules: everything that changes the page's composition or size is animated (reveal / morph in app.js);
   warnings and confirmations use the soft warning tone (--warn-*), not red. */
:root {
  --bg: #eceef2;
  --surface: #ffffff;
  --surface-2: #f5f6f8;
  --ink: #15171c;
  --muted: #5c6370;
  --line: #d9dde4;
  --accent: #2550c0;
  --accent-ink: #ffffff;
  --accent-soft: #e6ecfb;
  --danger: #b3261e;
  --ink-soft: #3b404b;
  --warn-soft: #fbeceb;
  --warn-line: #eec3bd;
  --warn-ink: #9b3e33;
  --speech: #c9851f;
  --noise: #8a909c;
  --disabled: #c9ced8;
  --disabled-ink: #6b7280;
  --veil: rgba(21, 23, 28, 0.42);
  --wave-mix: #8a92a3;
  --c-piano: #d98a1c;
  --c-vocals: #cf4a70;
  --c-other: #6c5ce7;
  --c-guitar: #3f8f46;
  --c-bass: #148f83;
  --c-drums: #6f7a8f;
  --font: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
  --mono: "Cascadia Mono", Consolas, "SFMono-Regular", Menlo, monospace;
  /* one button font for every button in the program (big buttons only change the size) */
  --btn: 600 13.5px/1.2 var(--font);
  /* track names, everywhere they are a name: rows on step 2, lanes on step 3 */
  --track: 600 15.5px/1.25 var(--font-display);
  --ok-ink: #2f7a3a;
  --on-c: #ffffff;           /* text over a filled track colour */
  --vp-track: #d5d9e0;       /* the groove of a volume slider (В2): a shade of the page */
  --vk-1: #ffffff; --vk-2: #eef0f3; --vk-3: #d9dce2;   /* its knob: lighter than the groove */
  --key-white: #fbfbfc;
  --key-black: #22252c;
  --key-line: #c4c9d2;
  --play-bg: var(--accent);   /* ▶: taken here (the theme's own), so the button of the falling notes is the same */
  --play-ink: var(--accent-ink);
  --kb-black: #2f3238;        /* the black keys of the keyboards */
  --kb-gap: #8f95a0;          /* the thin gap between the keys of the keyboards */
  --key-bar: #d3dff1;         /* a key of this bar's notes (not pressed): a neutral light blue; a black one — a lighter, bluish one */
  --key-bar-black: #71839f;
  --lane-black: rgba(21, 23, 28, 0.045);
  --ease: cubic-bezier(.2, .7, .2, 1);
  --radius: 10px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #101216; --surface: #181b21; --surface-2: #1e2229; --ink: #e6e8ed; --muted: #949bab;
    --line: #2a2f39; --accent: #7b98ff; --accent-ink: #0b0f1e; --danger: #ff7a70; --wave-mix: #7c8496;
    --accent-soft: #1d2540; --disabled: #2c313b; --disabled-ink: #7d8494; --veil: rgba(0, 0, 0, 0.6);
    --ink-soft: #c8ccd5; --warn-soft: #3a2220; --warn-line: #6a3b35; --warn-ink: #f2a79d; --speech: #e0a24a; --noise: #6f7685;
    --ok-ink: #82cf8a;
    --c-piano: #f2aa45; --c-vocals: #ef7196; --c-other: #9c8fff; --c-guitar: #6cbd70; --c-bass: #3fc3b3; --c-drums: #9aa3b6;
    --key-white: #d9dce3; --key-black: #0c0d10; --key-line: #4a505c; --lane-black: rgba(255, 255, 255, 0.04); --on-c: #101216; --vp-track: #22262d; --vk-1: #e3e6ea; --vk-2: #c2c6cc; --vk-3: #a6abb2;
    --kb-black: #24272d; --kb-gap: #23262c; --key-bar: #aebdd6; --key-bar-black: #63759a;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #101216; --surface: #181b21; --surface-2: #1e2229; --ink: #e6e8ed; --muted: #949bab;
  --line: #2a2f39; --accent: #7b98ff; --accent-ink: #0b0f1e; --danger: #ff7a70; --wave-mix: #7c8496;
    --accent-soft: #1d2540; --disabled: #2c313b; --disabled-ink: #7d8494; --veil: rgba(0, 0, 0, 0.6);
    --ink-soft: #c8ccd5; --warn-soft: #3a2220; --warn-line: #6a3b35; --warn-ink: #f2a79d; --speech: #e0a24a; --noise: #6f7685;
    --ok-ink: #82cf8a;
  --c-piano: #f2aa45; --c-vocals: #ef7196; --c-other: #9c8fff; --c-guitar: #6cbd70; --c-bass: #3fc3b3; --c-drums: #9aa3b6;
  --key-white: #d9dce3; --key-black: #0c0d10; --key-line: #4a505c; --lane-black: rgba(255, 255, 255, 0.04); --on-c: #101216; --vp-track: #22262d; --vk-1: #e3e6ea; --vk-2: #c2c6cc; --vk-3: #a6abb2;
  --kb-black: #24272d; --kb-gap: #23262c; --key-bar: #aebdd6; --key-bar-black: #63759a;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: var(--bg); color: var(--ink); font: 14px/1.45 var(--font); -webkit-user-select: none; user-select: none; overflow: hidden; }
[hidden] { display: none !important; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.dim { color: var(--muted); }
.fineprint { color: var(--muted); font-size: 12px; margin: 0; }
h1, h2 { font-family: var(--font-display); font-weight: 600; letter-spacing: -0.01em; text-wrap: balance; margin: 0; }
h1 { font-size: 26px; }
h2 { font-size: 22px; }

.app { height: 100%; display: grid; grid-template-rows: auto 1fr; grid-template-columns: minmax(0, 1fr); }
/* canvases size themselves from their box; never let their pixel size feed back into the layout */
canvas { max-width: 100%; }
main { min-height: 0; position: relative; grid-row: 2; overflow-x: clip; }   /* stays full height when the top bar is hidden; slides never scroll the page */
.view { height: 100%; }

/* ---------- top bar: the same three steps on every screen
   steps stay centred while the song name has room; in a narrow window the name keeps ≥ ~180px and the steps move right */
.topbar { display: grid; grid-template-columns: minmax(min(400px, calc(100% - 500px)), 1fr) auto minmax(0, 1fr); align-items: center;
          gap: 16px; padding: 8px 16px; background: var(--surface); border-bottom: 1px solid var(--line); min-width: 0; }
.topbar.bare { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); }
.lead { display: flex; align-items: center; gap: 20px; min-width: 0; padding-right: 8px; transition: opacity .22s ease; }
.lead.off { visibility: hidden; opacity: 0; transition: none; }
.brand { display: flex; align-items: center; gap: 9px; flex: none; font: 600 15px var(--font-display); letter-spacing: -0.01em; color: var(--ink); }
.brand svg { width: 40px; height: 16px; flex: none; color: var(--accent); }
.fileinfo { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.filename { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.filedur { flex: none; color: var(--muted); font: 12px var(--mono); font-variant-numeric: tabular-nums; }
.flow ol { list-style: none; margin: 0; padding: 0; display: flex; align-items: flex-start; gap: 6px; }
.flow .sep { width: 32px; height: 2px; margin-top: 17px; border-radius: 2px; background: var(--line); transition: background .3s; }
.flow .sep.on { background: var(--accent); }
.st { display: grid; grid-template-columns: auto 1fr; column-gap: 8px; align-items: center; text-align: left; padding: 6px 10px 6px 6px; border: 0;
      border-radius: 12px; background: none; font: 500 13px var(--font); color: var(--muted); cursor: pointer; white-space: nowrap; }
.st i { font-style: normal; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; flex: none;
        font: 600 12px var(--font); border: 1px solid var(--line); color: var(--muted); background: var(--surface); transition: background .2s, border-color .2s, color .2s; }
.st .nm { white-space: nowrap; }
/* descriptions under the step names: shown on step 1, folded from step 2 on (one line each; folding animates
   height and width, so the steps slide back together into the compact bar) */
.st .ds { grid-column: 2; display: grid; grid-template-rows: 0fr; opacity: 0; transition: grid-template-rows .26s ease, opacity .22s ease; }
.st .ds > span { min-height: 0; overflow: hidden; white-space: nowrap; max-width: 0; font: 400 12px/1.5 var(--font); color: var(--muted);
                 transition: max-width .26s ease; }
.flow.described .st .ds { grid-template-rows: 1fr; opacity: 1; }
.flow.described .st .ds > span { max-width: 260px; }
.st.cur, .st.busy { color: var(--ink); cursor: default; }
.st.cur .nm, .st.busy .nm { font-weight: 600; }
.st.cur i { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.st.busy i, .st.pulse i { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); animation: pulse 1.4s ease-in-out infinite; }
.st.cur.pulse i { background: var(--accent); color: var(--accent-ink); }      /* the current step working: filled, pulsing */
.st.done, .st.ready { color: var(--ink); }
.st.done i { background: var(--accent-soft); border-color: var(--accent-soft); color: var(--accent); }
.st.ready i { border-color: var(--accent); color: var(--accent); }
.st.done:hover, .st.ready:hover { background: var(--surface-2); }
.st.locked { cursor: default; }
@keyframes pulse { 50% { box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent) 18%, transparent); } }

/* ---------- buttons */
.btn { font: var(--btn); color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 7px 14px; cursor: pointer; white-space: nowrap;
       transition: background-color .2s, border-color .2s, color .2s; }
.btn:hover:not(:disabled) { border-color: var(--muted); }
.btn:disabled { background: var(--disabled); border-color: var(--disabled); color: var(--disabled-ink); cursor: default; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.primary:hover:not(:disabled) { filter: brightness(1.08); }
.btn.ghost { background: transparent; }
.btn.big { font-size: 15px; padding: 11px 22px; }
.btn.primary.big { padding-inline: 26px; }
/* warning tone: «Стоп», «Остановить», «Удалить и …» — noticeable, not alarming */
.btn.stop, .btn.warn { color: var(--warn-ink); border-color: var(--warn-line); }
.btn.stop:hover:not(:disabled), .btn.warn:hover:not(:disabled) { background: var(--warn-soft); border-color: var(--warn-ink); }
.btn.primary:disabled { background: var(--disabled); border-color: var(--disabled); color: var(--disabled-ink); filter: none; }
button:focus-visible, select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- 1 Загрузка */
#vStart { display: grid; place-items: center; padding: 28px 16px 48px; overflow-y: auto; }
.start { width: min(640px, 100%); display: grid; gap: 22px; }
.card { display: grid; justify-items: center; gap: 18px; text-align: center; padding: 38px 36px 30px;
        border: 2px dashed var(--line); border-radius: 18px; background: var(--surface); transition: border-color .15s; }
.card.over { border-color: var(--accent); }
.card p { margin: 0; }
.head { display: grid; justify-items: center; gap: 6px; }
.lockup { display: flex; align-items: center; gap: 16px; font: 600 30px var(--font-display); letter-spacing: -0.015em; color: var(--ink); }
.lockup svg { width: 120px; height: 48px; flex: none; color: var(--accent); }
.ver { color: var(--muted); font: 11px/1 var(--mono); letter-spacing: 0.04em; font-variant-numeric: tabular-nums; min-height: 11px; }
/* greeting: «Привет!» apart, then readable text with a small step between the sizes */
.greet { display: grid; gap: 8px; }
.greet h1 { display: grid; gap: 4px; }
.greet .hello { font: 600 28px/1.15 var(--font-display); letter-spacing: -0.015em; }
.greet .intro { margin: 0 auto; max-width: 34ch; font: 500 18px/1.35 var(--font-display); letter-spacing: -0.005em; text-wrap: balance; }
.greet .sub { margin: 0 auto; max-width: 46ch; color: var(--ink-soft); font-size: 16px; line-height: 1.5; text-wrap: pretty; }
.rule { width: 48px; height: 1px; background: var(--line); }
.pick, .chosen { display: grid; justify-items: center; gap: 12px; width: 100%; }
.drop-title { font: 600 16px var(--font); }
.formats, .hint { color: var(--muted); font-size: 12px; margin: 0; }
.file { display: flex; align-items: center; gap: 12px; padding: 10px 16px 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); max-width: 100%; }
.file-ico { width: 38px; height: 38px; border-radius: 9px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); flex: none; }
.file-meta { display: grid; text-align: left; min-width: 0; }
.file-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-info { color: var(--muted); font-size: 12px; }
.chosen-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }

/* the site (0.9.0): a song by its name or a YouTube link — hints under the field; «или», then the file */
.find { position: relative; width: min(460px, 100%); }
.find-box { display: flex; align-items: center; gap: 10px; height: 46px; padding: 0 8px 0 14px; border: 1px solid var(--line); border-radius: 12px;
            background: var(--surface-2); transition: border-color .15s, background .15s, box-shadow .15s; }
.find-box:focus-within { border-color: var(--accent); background: var(--surface); box-shadow: 0 0 0 3px var(--accent-soft); }
.find-box > svg { width: 18px; height: 18px; flex: none; color: var(--muted); }
.find-box input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: none; color: var(--ink); font: 15px var(--font); }
.find-box input::placeholder { color: var(--muted); }
.find-box input:disabled { cursor: not-allowed; }
.find-x { width: 30px; height: 30px; border: 0; border-radius: 8px; background: none; color: var(--muted); display: grid; place-items: center; cursor: pointer; flex: none; }
.find-x:hover { background: var(--line); color: var(--ink); }
.find-x svg { width: 14px; height: 14px; }
.sugg { position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 40; margin: 0; padding: 6px; list-style: none; text-align: left;
        background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 32px rgba(21, 23, 28, .16);
        max-height: min(360px, 52vh); overflow-y: auto; animation: rise .16s ease; }
.sugg li { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 9px; cursor: pointer; }
.sugg li[aria-selected="true"], .sugg li:hover { background: var(--accent-soft); }
.sugg .cov { width: 40px; height: 40px; flex: none; border-radius: 7px; display: grid; place-items: center; overflow: hidden;
             background: linear-gradient(135deg, hsl(var(--h) 55% 52%), hsl(calc(var(--h) + 40) 60% 38%)); color: #fff; font: 600 14px var(--font-display); }
.sugg .cov img { width: 100%; height: 100%; object-fit: cover; }
.sugg .cov.yt { background: #e1302b; }
.sugg .cov.yt svg { width: 18px; height: 18px; }
.sugg .s-t { display: grid; min-width: 0; }
.sugg .s-t b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sugg .s-t span { color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sugg .s-msg { padding: 10px 12px; color: var(--muted); font-size: 13px; cursor: default; }
.sugg .s-msg:hover { background: none; }
.sugg .s-head { justify-content: space-between; padding: 6px 10px 4px; font-size: 12px; color: var(--muted); cursor: default; }
.sugg .s-head:hover { background: none; }
.sugg .s-head .lnk { font-size: 12px; }
.sugg .s-x { margin-left: auto; flex: none; width: 30px; height: 30px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 7px;
             background: none; color: var(--muted); cursor: pointer; }
.sugg .s-x:hover { background: var(--surface-2); color: var(--ink); }
.sugg .s-x svg { width: 14px; height: 14px; }
.or { display: flex; align-items: center; gap: 12px; width: min(460px, 100%); color: var(--muted); font-size: 12px; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.file-ico.yt { background: #fde8e7; color: #d22a24; }
.file-ico.art { background: none; overflow: hidden; }
.file-ico img { width: 100%; height: 100%; object-fit: cover; }
.sugg .cov.free { background: var(--accent-soft); color: var(--accent); }
.sugg .cov.free svg { width: 18px; height: 18px; }

/* links in the text and at the bottom of step 1; the documents */
.lnk { border: 0; padding: 0; background: none; color: var(--accent); font: inherit; cursor: pointer; text-decoration: underline;
       text-decoration-color: color-mix(in srgb, var(--accent) 35%, transparent); text-underline-offset: 2px; }
.lnk:hover { text-decoration-color: currentColor; }
.terms { color: var(--muted); font-size: 12px; max-width: 46ch; }
.foot { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 18px; font-size: 13px; }
.foot .lnk { color: var(--muted); text-decoration: none; }
.foot .lnk:hover { color: var(--accent); }
.doc-over { place-items: start center; padding: 6vh 16px 16px; overflow-y: auto; }
.doc { width: min(720px, 100%); display: grid; grid-template-rows: auto 1fr; max-height: 88vh; border-radius: 16px; background: var(--surface);
       border: 1px solid var(--line); box-shadow: 0 20px 60px rgba(21, 23, 28, .25); animation: rise .2s ease; overflow: hidden; }
.doc-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px 14px 24px; border-bottom: 1px solid var(--line); }
.doc-head h2 { margin: 0; font: 600 20px var(--font-display); }
.doc-body { overflow-y: auto; padding: 16px 24px 24px; text-align: left; line-height: 1.55; font-size: 14.5px; }
.doc-body h3 { margin: 22px 0 8px; font: 600 16px var(--font-display); }
.doc-body h3:first-child { margin-top: 4px; }
.doc-body p { margin: 0 0 10px; }
.doc-body ul { margin: 0 0 10px; padding-left: 20px; }
.doc-body li { margin: 3px 0; }
.doc-body .muted { color: var(--muted); font-size: 13px; }
.doc-body details { border: 1px solid var(--line); border-radius: 10px; margin: 0 0 8px; background: var(--surface-2); }
.doc-body summary { padding: 11px 14px; font-weight: 600; cursor: pointer; list-style: none; display: flex; justify-content: space-between; gap: 10px; }
.doc-body summary::-webkit-details-marker { display: none; }
.doc-body summary::after { content: "+"; color: var(--muted); font-weight: 400; }
.doc-body details[open] summary::after { content: "−"; }
.doc-body details > div { padding: 0 14px 6px; }
.doc-body .ver-h { display: flex; align-items: baseline; gap: 10px; margin: 18px 0 6px; }
.doc-body .ver-h:first-child { margin-top: 2px; }
.doc-body .ver-h b { font: 600 16px var(--font-display); }
.doc-body .ver-h span { color: var(--muted); font-size: 12.5px; }
.doc-body .tag { display: inline-block; padding: 1px 7px; border-radius: 6px; background: var(--accent-soft); color: var(--accent); font-size: 11.5px; font-weight: 600; }
.cookie { position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 30; width: min(560px, calc(100% - 32px)); display: flex; align-items: center; gap: 14px;
          padding: 12px 14px 12px 18px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); box-shadow: 0 10px 30px rgba(21, 23, 28, .16);
          font-size: 13px; color: var(--ink-soft); animation: rise .2s ease; }
.cookie > span { flex: 1; }
body.cookie-on #vStart { padding-bottom: 120px; }   /* the cookie line does not cover the links at the bottom */
body.cookie-away #cookie { display: none; }         /* steps 2–3: it would cover their buttons; back on step 1 until «Понятно» */

/* blocks that slide open / closed (height + fade): file card, hint, progress */
.reveal { display: grid; grid-template-rows: 0fr; opacity: 0; width: 100%; transition: grid-template-rows .26s ease, opacity .22s ease, margin-top .26s ease; }
.reveal > div { min-height: 0; overflow: hidden; }
.reveal.open { grid-template-rows: 1fr; opacity: 1; }
.reveal.settled > div { overflow: visible; }
.chosen > .reveal:not(.open) { margin-top: -12px; }
.card > .reveal:not(.open) { margin-top: -18px; }
.reveal.anim > div > .proc, .reveal.anim > div > .chosen, .reveal.anim > div > .check { animation: rise .26s ease; }   /* only when opened by the user */
@keyframes rise { from { transform: translateY(-8px); } }
.preload .reveal { transition: none; }

/* preliminary estimate: its own block between the file and «Старт» */
.check { width: 100%; display: grid; gap: 8px; text-align: left; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2);
         transition: border-color .2s, background .2s; }
.check.bad { border-color: var(--warn-line); background: var(--warn-soft); }
.check-head { display: flex; align-items: center; gap: 8px; }
.check-head b { font-weight: 600; }
.check.bad .check-head b { color: var(--warn-ink); }
.check-ico { width: 18px; height: 18px; flex: none; color: var(--accent); display: grid; place-items: center; }
.check-ico svg { width: 18px; height: 18px; }
.check.bad .check-ico { color: var(--warn-ink); }
.check-text { margin: 0; font-size: 13px; color: var(--muted); }
/* the site's notice on step 1: «Сервер отдыхает» (the tone of the check block), «Песня не сохранилась» (soft warning) */
.note { width: 100%; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: start; gap: 4px 10px; text-align: left;
        padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.note .check-ico { margin-top: 1px; }
.note.warn { border-color: var(--warn-line); background: var(--warn-soft); }
.note.warn .check-ico, .note.warn b { color: var(--warn-ink); }
.note-body b { font-weight: 600; }
.note-body p { margin: 2px 0 0; font-size: 13px; color: var(--muted); }
.note-x { width: 26px; height: 26px; margin: -3px -5px 0 0; display: grid; place-items: center; border: 0; border-radius: 6px; background: none; color: var(--muted); cursor: pointer; }
.note-x svg { width: 14px; height: 14px; }
.note-x:hover { background: var(--surface); color: var(--ink); }
.note-x:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.reveal.anim > div > .note { animation: rise .26s ease; }
.check-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.check .meter { height: 6px; background: var(--surface); }
/* what the model heard: one stacked bar (music · speech · noise), the shares, the verdict */
.mix { display: grid; gap: 8px; }
.mix-bar { display: flex; gap: 2px; height: 8px; border-radius: 99px; overflow: hidden; background: var(--surface); border: 1px solid var(--line); }
/* shares are flex-grow fractions (sum 1): growing from 0 fills the bar from the left in proportion */
.mix-bar i { display: block; height: 100%; flex: 0 1 0; min-width: 0; transition: flex-grow .6s cubic-bezier(.2, .7, .2, 1); }
.mix .m { background: var(--accent); } .mix .s { background: var(--speech); } .mix .n { background: var(--noise); }
.mix-legend { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 13px; color: var(--ink-soft); }
.mix-legend span { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.mix-legend b { font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.check-verdict { margin: 0; font-size: 14px; color: var(--ink); }
.check-verdict b { font-weight: 600; }
.check.bad .check-verdict b { color: var(--warn-ink); }

/* progress under the greyed buttons */
.proc { width: 100%; display: grid; gap: 10px; text-align: left; padding: 16px 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.proc-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.proc-title { font-weight: 600; display: flex; align-items: center; gap: 7px; }
.proc-title svg { width: 16px; height: 16px; color: var(--accent); flex: none; }
.proc .meter { background: var(--surface); }
.proc-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 12px; font-size: 13px; }
.proc-row > span { white-space: nowrap; }
.proc-row > .t { margin-left: auto; }
.t { color: var(--muted); font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: 13px; }
.proc-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px 12px; flex-wrap: wrap; min-height: 34px; }
.proc-foot .hint { flex: 1 1 220px; }
/* confirmations: a soft warning panel */
.confirm { flex: 1 1 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: 13px;
           padding: 10px 12px; border: 1px solid var(--warn-line); border-radius: 10px; background: var(--warn-soft); }
.confirm-btns { display: flex; gap: 8px; }
.confirm b { color: var(--warn-ink); font-weight: 600; }

/* «Вернуться к загрузке?» */
.overlay { position: fixed; inset: 0; display: grid; place-items: center; padding: 16px; background: var(--veil); z-index: 40; animation: fade .15s ease; }
.dialog { width: min(420px, 100%); display: grid; gap: 12px; padding: 22px 22px 18px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line);
          box-shadow: 0 18px 50px rgba(0, 0, 0, 0.25); }
.dialog h2 { font-size: 18px; }
.dialog p { margin: 0; color: var(--muted); }
.dialog-btns { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
/* «Оставить отзыв» (the site, 0.9.8): top right of the steps; a phone — the footer link (step 1) or an icon by the logo */
.top-right { display: flex; justify-content: flex-end; min-width: 0; }
.fb-btn { display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; color: var(--muted); background: transparent; }
.fb-btn:hover:not(:disabled) { color: var(--ink); }
.fb-btn svg, .fb-mini svg { width: 18px; height: 18px; flex: none; }
.fb-mini { display: none; margin-left: auto; flex: none; width: 34px; height: 34px; place-items: center; padding: 0; border: 0; border-radius: 8px;
           background: transparent; color: var(--muted); cursor: pointer; }
.fb-mini:hover { color: var(--ink); background: var(--surface-2); }
#fb { z-index: 60; }
.topbar, .topbar.bare { grid-template-columns: minmax(min(400px, calc(100% - 560px)), 1fr) auto minmax(max-content, 1fr); }
.topbar.bare { grid-template-columns: minmax(0, 1fr) auto minmax(max-content, 1fr); }
@media (max-width: 1240px) { .fb-btn span { display: none; } .fb-btn { padding: 6px 8px; } }   /* narrower: the icon only */
.dialog.fb { width: min(480px, 100%); }
.fb-form, .fb-done { display: grid; gap: 12px; }
.fb textarea { width: 100%; min-height: 132px; resize: vertical; font: inherit; font-size: 14px; line-height: 1.45; color: var(--ink);
               background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; box-sizing: border-box; }
.fb textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.fb-meta { display: flex; justify-content: space-between; gap: 12px; min-height: 16px; margin-top: -6px; font-size: 12px; }
.fb-err { color: var(--danger); }
.fb-count { color: var(--muted); margin-left: auto; font-variant-numeric: tabular-nums; }
.dialog .fb-note { font-size: 12px; }
.view.enter { animation: fade .2s ease; }
/* screens: the old one leaves to the side, the new one comes from the other (app.js slide) */
.slide { transition: opacity .3s var(--ease), transform .3s var(--ease); }
.out-l { opacity: 0; transform: translateX(-28px); }
.out-r { opacity: 0; transform: translateX(28px); }
.leaving { pointer-events: none; }
main > .view.leaving { position: absolute; inset: 0; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } }

/* ---------- error, meters */
#vError { display: grid; place-items: center; padding: 24px; }
.work { width: min(560px, 100%); display: grid; gap: 12px; }
.work p { margin: 0; }
.meter { height: 8px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; }
.meter.small { height: 6px; flex: 1; min-width: 120px; }
.meter-fill { height: 100%; width: 0; background: var(--accent); border-radius: 99px; transition: width .4s ease; }
.errtext { color: var(--danger); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; user-select: text; -webkit-user-select: text; overflow-wrap: anywhere; }

/* ---------- review */
.review { display: grid; grid-template-rows: auto minmax(0, 1fr); grid-template-columns: minmax(0, 1fr); min-height: 0; overflow: hidden; }
.review > .overview { grid-row: 1; position: relative; z-index: 3; }
.review > .pane { grid-row: 2; grid-column: 1; }
.pane { min-height: 0; }
.stems-pane { display: grid; grid-template-rows: auto 1fr auto; grid-template-columns: minmax(0, 1fr); }

/* overview: ▶, the whole song, «Оригинал», master volume (steps 2 and 3) */
.overview { display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto auto auto; align-items: center; gap: 12px 14px; padding: 12px 18px;
            background: var(--surface); border-bottom: 1px solid var(--line); }
.play { position: relative; width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--play-bg); color: var(--play-ink); display: grid; place-items: center; cursor: pointer;
        --aura: var(--play-bg); }
/* the aura on hover: it breathes while the pointer is over ▶ and fades in and out (its own layer, so leaving it fades too) */
.play::after { content: ""; position: absolute; inset: 0; border-radius: 50%; pointer-events: none; opacity: 0; transition: opacity .35s var(--ease);
               box-shadow: 0 0 0 2px color-mix(in srgb, var(--aura) 14%, transparent), 0 0 10px 1px color-mix(in srgb, var(--aura) 50%, transparent);
               animation: playGlow 2.2s ease-in-out infinite; animation-play-state: paused; }
.play:hover::after { opacity: 1; animation-play-state: running; }
@keyframes playGlow { 50% { box-shadow: 0 0 0 3px color-mix(in srgb, var(--aura) 9%, transparent), 0 0 14px 2px color-mix(in srgb, var(--aura) 30%, transparent); } }
/* the falling notes (black): a lighter, stronger aura */
.fbar .play { --aura: color-mix(in srgb, var(--play-bg) 55%, #ffffff); }
.fbar .play::after { box-shadow: 0 0 0 2px color-mix(in srgb, var(--aura) 26%, transparent), 0 0 14px 3px color-mix(in srgb, var(--aura) 62%, transparent);
                     animation-name: playGlowFall; }
@keyframes playGlowFall { 50% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--aura) 16%, transparent), 0 0 20px 5px color-mix(in srgb, var(--aura) 40%, transparent); } }
.play svg { grid-area: 1 / 1; width: 20px; height: 20px; fill: currentColor; transition: opacity .18s ease, transform .24s var(--ease); }
.play .i-pause { opacity: 0; transform: scale(.5) rotate(-90deg); }          /* ▶ ⇄ ❚❚: one turns away, the other turns in */
.play.playing .i-play { opacity: 0; transform: scale(.5) rotate(90deg); }
.play.playing .i-pause { opacity: 1; transform: none; }
.play .i-again { opacity: 0; transform: scale(.5) rotate(-90deg); }          /* the end of the song: «Начать с начала» turns in */
.play.ended .i-play { opacity: 0; transform: scale(.5) rotate(90deg); }
.play.ended .i-again { opacity: 1; transform: none; }
.play.loading { opacity: .6; cursor: progress; }
.time { font-size: 13px; min-width: 4.5ch; }
.ov-wave { height: 40px; min-width: 0; cursor: pointer; position: relative; touch-action: pan-y; }
.ov-wave canvas, .wave canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
/* «Оригинал»: a latch — pressed, only the original plays */
.latch { display: inline-flex; align-items: center; gap: 7px; font: var(--btn); padding: 7px 12px; border-radius: 8px; border: 1px solid var(--line);
         background: var(--surface-2); color: var(--muted); cursor: pointer; transition: background-color .2s, color .2s, border-color .2s; }
.latch i { width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid currentColor; transition: background-color .2s; }
.latch[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.latch[aria-pressed="true"] i { background: currentColor; }
/* volume «В2» (0.10.3, the stand of 29.10.2026; was «В1», a hollow bar in the track colour): a recessed groove,
   a light round knob with a light upper rim (a convex button); the percent in the track colour, always at the left end
   of the groove, above the knob when the knob is there. The knob's left edge: 2px + (W − 22px) · v.
   No focus ring: the knob itself shows where it is */
.vp { --h: 22px; --v: 100; --vc: var(--c, var(--accent)); --kx: calc(2px + (100% - 22px) * var(--v) / 100);
      position: relative; height: var(--h); border-radius: calc(var(--h) / 2); overflow: hidden;
      cursor: pointer; touch-action: none; user-select: none; -webkit-user-select: none; outline: none; background: var(--vp-track);
      box-shadow: inset 0 1px 2.5px rgba(0, 0, 0, .28), inset 0 -1px 0 rgba(255, 255, 255, .08); transition: opacity .2s; }
.vp .t { position: absolute; top: 0; bottom: 0; left: 9px; z-index: 1; display: flex; align-items: center; pointer-events: none;
         font: 600 11.5px/1 var(--font); font-variant-numeric: tabular-nums; letter-spacing: .01em; white-space: nowrap;
         color: color-mix(in srgb, var(--vc) 72%, var(--ink));      /* over the knob too (z-index): a halo of the groove keeps it legible */
         text-shadow: 0 0 1px var(--vp-track), 0 0 2.5px var(--vp-track), 0 0 4px var(--vp-track); }
.vp .knob { position: absolute; top: 2px; left: var(--kx); width: 18px; height: 18px; border-radius: 50%; pointer-events: none;
            background: linear-gradient(180deg, var(--vk-1) 0%, var(--vk-2) 55%, var(--vk-3) 100%);
            box-shadow: inset 0 1.2px 0 rgba(255, 255, 255, .95), inset 0 -1px 1px rgba(0, 0, 0, .22),
                        0 0 0 .6px rgba(0, 0, 0, .22), 0 1px 2.5px rgba(0, 0, 0, .45); }
/* held: pressed in, as a real key — no relief of its own (nearly flat), a soft shadow inside from the top edge, a thin
   light line at the bottom, no shadow under it; the outline stays as crisp as when released (no scaling, no shift) */
.vp.down .knob { background: linear-gradient(180deg, color-mix(in srgb, var(--vk-2) 70%, var(--vk-3)) 0%, var(--vk-2) 55%, var(--vk-2) 100%);
                 box-shadow: inset 0 1px 1.5px rgba(0, 0, 0, .2), inset 0 -1px 0 rgba(255, 255, 255, .5), 0 0 0 1px rgba(0, 0, 0, .3); }
.vp:focus-visible { outline: none; }
.row.muted .vp, .trow.off .vp { --vc: var(--disabled-ink); }
.row.muted .vp .knob, .trow.off .vp .knob { opacity: .75; }
.master { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--muted); }
.master .vp { width: 150px; --vc: var(--accent); }
.seg { display: inline-flex; padding: 2px; gap: 2px; border-radius: 9px; background: var(--surface-2); border: 1px solid var(--line); }
.seg button { font: var(--btn); border: 0; background: none; color: var(--muted); padding: 6px 10px; border-radius: 7px; cursor: pointer; white-space: nowrap;
              transition: background-color .2s, color .2s, box-shadow .2s; }
.seg button[aria-checked="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, .12), 0 0 0 1px var(--line); }
.seg button:disabled { cursor: default; opacity: .55; }

/* track rows: № · name, «Похоже на» / «Почти тишина», «Это гитара» · waveform · Соло/Вкл/Выкл + volume · В нотах · MP3.
   «Дорожка», «Слушать», «В нотах», «Скачать» are exactly as wide as their content (measured in app.js: --who-w, --listen-w,
   --notes-w, --dl-w); the rest is the waveform's */
.list-head, .row { display: grid; grid-template-columns: 18px var(--who-w, 170px) minmax(150px, 1fr) var(--listen-w, 186px) var(--notes-w, 180px) var(--dl-w, 96px); column-gap: 14px; align-items: center;
                   padding-inline: 16px 18px; grid-template-areas: "num who wave listen notes dl"; }
.list-head { padding-block: 10px 6px; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .07em; font-weight: 600; }
.list-head > :first-child { text-align: center; font-size: 12px; }
.stems { overflow-y: auto; min-height: 0; padding-bottom: 8px; }
.row { position: relative; padding-block: 10px; border-top: 1px solid var(--line); }
.row::before { content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 4px; border-radius: 0 3px 3px 0; background: var(--c); transition: opacity .2s; }
.row .num { grid-area: num; font: 600 14px var(--mono); color: var(--ink-soft); text-align: center; transition: color .2s; }
/* under the name, fixed places (the same on every track): «Похоже на» — or «Почти тишина» in its place; «Это гитара» */
.who { grid-area: who; display: grid; grid-template-rows: auto 50px 26px; gap: 4px; justify-items: start; align-items: center; min-width: 0; }
.who .tname { font: var(--track); color: var(--ink); background: none; border: 0; padding: 1px 5px; margin-left: -5px; border-radius: 6px; cursor: text;
      max-width: calc(100% + 5px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left; transition: color .2s; }
.who .tname:hover { box-shadow: inset 0 0 0 1px var(--line); background: var(--surface-2); }
.tname-input { font: var(--track); color: var(--ink); width: calc(100% + 5px); padding: 0 4px; margin-left: -5px; border: 1px solid var(--accent); border-radius: 6px; background: var(--surface);
            -webkit-user-select: text; user-select: text; }
/* «Похоже на»: one size on every track — as wide as «Ударная установка» on one line, two lines high */
.heard, .quiet { width: calc(17.5ch + 18px); max-width: 100%; height: 50px; display: grid; align-content: center; gap: 1px; padding: 3px 8px; border-radius: 7px;
                 font-size: 12px; background: var(--surface-2); border: 1px solid var(--line); }
.heard .hl { font-size: 10px; line-height: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.heard .hv { font-size: 12px; line-height: 14px; color: var(--ink-soft); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.quiet { background: none; border-style: dashed; font-size: 12px; color: var(--muted); }
.quiet b { font-weight: 600; }
.gchip { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; font: var(--btn); padding: 3px 10px 3px 6px; border-radius: 99px; border: 1px solid var(--line);
         background: var(--surface); color: var(--muted); cursor: pointer; transition: background-color .2s, color .2s, border-color .2s; }
.gchip i { width: 13px; height: 13px; border-radius: 3px; border: 1.5px solid currentColor; display: grid; place-items: center; }
.gchip i svg { width: 9px; height: 9px; opacity: 0; }
.gchip[aria-pressed="true"] { color: var(--ink); border-color: var(--c); background: color-mix(in srgb, var(--c) 12%, var(--surface)); }
.gchip[aria-pressed="true"] i { background: var(--c); border-color: var(--c); color: var(--surface); }
.gchip[aria-pressed="true"] i svg { opacity: 1; }
.gchip:disabled { cursor: default; opacity: .6; }
.gchip .auto { font: 600 10px/1 var(--font); padding: 3px 6px; margin-right: -4px; border-radius: 99px; background: var(--accent-soft); color: var(--accent); }
.wave { grid-area: wave; height: 52px; position: relative; cursor: pointer; min-width: 0; transition: opacity .2s; touch-action: pan-y; }
.listen { display: flex; gap: 6px; transition: opacity .2s; }                  /* step 3 lanes: Соло · Выкл */
.row .listen { grid-area: listen; display: grid; grid-template-columns: max-content; align-content: center; gap: 7px; }   /* the volume as long as the three buttons */
.trio { display: flex; gap: 4px; }
.chip { font: var(--btn); border: 1px solid var(--line); background: var(--surface); color: var(--muted); border-radius: 6px; padding: 4px 10px; cursor: pointer;
        transition: background-color .15s, color .15s, border-color .15s; }
.chip:hover { color: var(--ink); border-color: var(--muted); }
.chip.solo[aria-pressed="true"], .chip.on.solo { background: var(--c); border-color: var(--c); color: #fff; }
.chip.onb[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.chip.offb[aria-pressed="true"], .chip.on.mute { background: var(--ink); border-color: var(--ink); color: var(--surface); }
.listen.dim .chip:not(.on) { opacity: .5; }
.listen.dim .chip.on { opacity: .6; }
.notes { grid-area: notes; display: grid; gap: 6px; align-content: center; justify-items: start; min-width: 0; }
/* «Объединить» and «Не использовать»: toggles one above the other, as wide as «Не использовать» */
.nopts { display: inline-grid; gap: 6px; max-width: 100%; }
.nbtn { width: 100%; min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; font: var(--btn); color: var(--ink); text-align: left;
        padding: 5px 10px; border-radius: 7px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; white-space: nowrap;
        transition: background-color .2s, border-color .2s, color .2s, box-shadow .2s; }
.nbtn > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.nbtn:hover:not(:disabled) { border-color: var(--muted); }
.nbtn:disabled { cursor: default; color: var(--disabled-ink); background: var(--surface-2); }
.nbtn .box { width: 13px; height: 13px; flex: none; border-radius: 3px; border: 1.5px solid currentColor; display: grid; place-items: center; }
.nbtn .box svg { opacity: 0; width: 9px; height: 9px; }
.nbtn[aria-pressed="true"] .box svg { opacity: 1; }
.join[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); }
.join[aria-pressed="true"] .box { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.unuse[aria-pressed="true"] { background: var(--surface-2); color: var(--ink); border-color: var(--muted); }
.unuse[aria-pressed="true"] .box { background: var(--ink); border-color: var(--ink); color: var(--surface); }
.nonotes { margin: 0; font-size: 12px; color: var(--muted); }
/* «Скачать»: MP3 of the track and, under it, «В общий» (the marked tracks in one MP3 — the button under the list) */
.dl { grid-area: dl; display: grid; gap: 6px; align-content: center; }
.mp3 { padding: 6px 12px; }
/* every button of a row on one of two lines, all as high as «Соло»: Соло/Вкл/Выкл · Объединить · MP3,
   then the volume · Не использовать · В общий */
.row { --bh: 26px; }
.row .listen, .row .nopts, .row .dl { grid-template-rows: var(--bh) var(--bh); row-gap: 6px; align-content: center; }
.row .listen .vp { align-self: center; }
.row .chip, .row .nbtn, .row .mp3 { height: var(--bh); padding-block: 0; }
.pick[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); }
.pick[aria-pressed="true"] .box { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.mixbar { display: flex; align-items: center; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap; padding: 12px 18px 4px;
          border-top: 1px solid var(--line); }
.mixbar + .list-note { border-top: 0; }
.mixinfo { display: flex; align-items: flex-start; gap: 8px; margin: 0; flex: 1 1 320px; min-width: 0; font-size: 12px; color: var(--muted); }
.mixinfo svg { width: 14px; height: 14px; flex: none; margin-top: 1px; color: var(--accent); }
.mixinfo b { color: var(--ink); font-weight: 600; }
.mixinfo .sw { display: inline-block; width: 8px; height: 8px; border-radius: 2px; background: var(--c); margin-right: 5px; vertical-align: 0; }
#btnMix.busy { opacity: .6; cursor: progress; }
/* «Не использовать» greys the track; «Выкл» dims its waveform; «Оригинал» dims all listening controls */
.row.unused::before { opacity: .3; }
.row.unused .tname, .row.unused .num { color: var(--muted); }
.row.muted .wave { opacity: .38; }
.stems.orig .listen, .stems.orig .wave { opacity: .5; }
/* «Точно получить ноты дорожки вокала?» — a neutral bubble by «Не использовать» */
.bubble { position: fixed; z-index: 35; display: grid; gap: 10px; width: max-content; max-width: min(340px, calc(100vw - 16px)); padding: 12px 14px;
          border-radius: 12px; background: var(--surface); border: 1px solid var(--line); box-shadow: 0 12px 34px rgba(0, 0, 0, .18); font-size: 13.5px;
          animation: bubbleIn .2s var(--ease); }
.bubble b { font-weight: 600; color: var(--ink); }
.bubble::before { content: ""; position: absolute; left: calc(var(--ax, 50%) - 6px); top: -7px; width: 12px; height: 12px; background: var(--surface);
                  border-left: 1px solid var(--line); border-top: 1px solid var(--line); transform: rotate(45deg); }
.bubble.up::before { top: auto; bottom: -7px; transform: rotate(225deg); }
.bubble-btns { display: flex; gap: 8px; justify-content: flex-end; }
@keyframes bubbleIn { from { opacity: 0; transform: translateY(-4px); } }
.list-note { display: flex; align-items: flex-start; gap: 8px; margin: 0; padding: 12px 18px 4px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.list-note svg { width: 14px; height: 14px; flex: none; margin-top: 1px; color: var(--accent); }

/* ---------- 3 Ноты (approved stands of the notes and of the neck, 11.10.2026; notes.js)
   panel in the middle, one row (what does not fit goes into «>>») / tracks: header (name + «на клавиатуру»/«на гриф»,
   Соло/Вкл/Выкл + volume; clefs with key and time, or the key strip) + the notes / instruments: the neck above the keyboard */
.notes-pane { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; grid-template-columns: minmax(0, 1fr); background: var(--bg); }
.panel { display: flex; justify-content: center; align-items: center; gap: 10px 14px; flex-wrap: wrap; padding: 10px 18px; border-bottom: 1px solid var(--line);
         background: var(--bg); position: relative; z-index: 2;
         --ctl-h: calc(13.5px * 1.2 + 16px); }      /* the height of a button (.btn): the switches and the tempo are as high */
.panel .seg, .panel .tempo { height: var(--ctl-h); }
.panel .seg button { padding-block: 0; }
.pgroup { display: flex; align-items: center; gap: 8px; }
.plabel { font-size: 12px; color: var(--muted); }
.tempo { display: inline-flex; align-items: center; gap: 2px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); padding: 2px; }
.tempo button { width: 30px; height: 100%; border: 0; border-radius: 7px; background: none; color: var(--ink); font: 600 16px/1 var(--font); cursor: pointer; }
.tempo button:hover:not(:disabled) { background: var(--surface-2); }
.tempo button:disabled { color: var(--disabled-ink); cursor: default; }
.tempo .tval { width: auto; min-width: 8.5ch; padding: 0 6px; font: 600 13px var(--mono); font-variant-numeric: tabular-nums; color: var(--ink); cursor: text; }
.tempo.changed .tval { color: var(--accent); }
.tedit { display: inline-flex; align-items: center; gap: 4px; height: 100%; min-width: 8.5ch; padding: 0 6px; font: 600 13px var(--mono); }
.tedit input { width: 3.6ch; height: 22px; padding: 0 3px; border: 1px solid var(--accent); border-radius: 5px; background: var(--surface); color: var(--ink);
               font: inherit; font-variant-numeric: tabular-nums; text-align: right; outline: none; box-shadow: 0 0 0 2px var(--accent-soft); -webkit-user-select: text; user-select: text; }
.tempo .treset { width: 28px; color: var(--accent); display: grid; place-items: center; transition: opacity .15s; }
.tempo .treset.off { visibility: hidden; opacity: 0; pointer-events: none; }   /* its place stays: nothing moves when it shows */
.tempo .treset svg { width: 15px; height: 15px; }
.meter-info { font: 12px var(--mono); color: var(--muted); white-space: nowrap; }
.zoom input { width: 110px; accent-color: var(--accent); }
.menu .zoom input { width: 130px; }
.more { position: relative; }
.more > .btn { padding-inline: 11px; }
#nMoreBtn { letter-spacing: -.05em; }
.menu { position: absolute; right: 0; top: calc(100% + 6px); display: grid; gap: 10px; padding: 12px; min-width: 240px; border-radius: 12px; background: var(--surface);
        border: 1px solid var(--line); box-shadow: 0 14px 40px rgba(0, 0, 0, .18); z-index: 6; animation: bubbleIn .18s var(--ease); }
.menu .pgroup { justify-content: space-between; }
.menu.mlist { gap: 2px; padding: 6px; width: max-content; min-width: 240px; max-width: min(380px, calc(100vw - 32px)); }
#nMenu { width: max-content; max-width: calc(100vw - 32px); }
.menu .more > .btn { width: 100%; }                   /* «Скачать MIDI» inside «>>»: its list opens in place */
.menu .menu.mlist { position: static; box-shadow: none; border: 0; padding: 4px 0 0; width: auto; min-width: 0; animation: none; }
.mitem { display: grid; grid-template-columns: 2ch 8px minmax(0, 1fr); align-items: center; gap: 9px; width: 100%; text-align: left; font: var(--btn);
         padding: 8px 10px; border: 0; border-radius: 8px; background: none; color: var(--ink); cursor: pointer; transition: background-color .15s; }
.mitem:hover { background: var(--surface-2); }
.mitem .num { font: 12px var(--mono); color: var(--muted); text-align: right; }
.mitem .sw { width: 8px; height: 8px; border-radius: 2px; background: var(--c); }
.mitem .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mitem.all { display: block; white-space: nowrap; margin-top: 4px; border-top: 1px solid var(--line); border-radius: 0 0 8px 8px; padding-top: 10px; color: var(--muted); }

.tracks { overflow-y: auto; overflow-x: hidden; min-height: 0; position: relative; }
.thead { cursor: grab; }                            /* a track is moved by its header (notes.js movable) */
.thead :is(button, input, .vp) { cursor: pointer; }
/* the cursor while something is dragged: a cover over the page (notes.js dragCursor, 0.11.1) — not a class on the body:
   the cursor is inherited by every element, and with the whole score drawn changing it took 20–40 ms */
.dragcover { position: fixed; inset: 0; z-index: 2147483000; user-select: none; }
.dragcover[hidden] { display: none; }
.tracks.reorder .trow { opacity: .62; transition: opacity .15s; }
.tdrop { position: absolute; left: 0; right: 0; height: 2px; margin-top: -1px; border-radius: 1px; background: var(--accent); z-index: 6; pointer-events: none;
         box-shadow: 0 0 8px 1px color-mix(in srgb, var(--accent) 55%, transparent), 0 0 16px 3px color-mix(in srgb, var(--accent) 22%, transparent);
         transition: top .16s var(--ease); }
.tdrop.fresh { transition: none; }
.trow { display: grid; grid-template-columns: var(--headw, 240px) minmax(0, 1fr); border-bottom: 1px solid var(--line); background: var(--surface); position: relative; }
.trow::before { content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 4px; border-radius: 0 3px 3px 0; background: var(--c); z-index: 1; }
.thead { display: grid; grid-template-columns: minmax(0, 1fr) auto; min-height: 96px; border-right: 1px solid var(--line); }
.tracks.classic .thead { border-right-color: transparent; }   /* the header's staff lines run on into the bars */
/* one column as wide as Соло / Вкл / Выкл: the name with its button and the volume take exactly that width */
.tctrl { display: grid; grid-template-columns: max-content; align-content: center; gap: 7px; padding: 10px 12px 10px 18px; min-width: 0; transition: background-color .2s; }
.trow.sel .tctrl { background: color-mix(in srgb, var(--c) 9%, var(--surface)); }
.trow .tname { display: flex; align-items: flex-start; gap: 8px; width: 0; min-width: 100%; font: var(--track); }
.trow .tname span { flex: 1 1 auto; min-width: 0; overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow-wrap: anywhere; }
/* «на клавиатуру» (a guitar: «на гриф»): pressed — the track is shown there */
.kbbtn { flex: none; margin-left: auto; display: inline-grid; place-items: center; width: 28px; height: 20px; padding: 0; border-radius: 5px; border: 1px solid var(--line);
         color: var(--muted); background: var(--surface); cursor: pointer; transition: background-color .2s, color .2s, border-color .2s; }
.kbbtn:hover { border-color: var(--muted); color: var(--ink); }
.kbbtn svg { width: 16px; height: 10px; }
.kbbtn[aria-pressed="true"] { background: var(--c); border-color: var(--c); color: #fff; }
/* the instrument of the track (sound.js): one line under the name, as wide as Соло/Вкл/Выкл; opens .imenu */
.irow, .tune { display: flex; align-items: center; gap: 4px; width: 0; min-width: 100%; }
.irow .ibtn, .tune .tbtn { flex: 1 1 auto; width: auto; min-width: 0; }
.ireset, .tres { width: 24px; height: 24px; flex: none; border: 0; border-radius: 6px; background: none; color: var(--accent); display: grid; place-items: center; cursor: pointer; transition: opacity .15s; }
.ireset:hover, .tres:hover { background: var(--surface-2); }
.ireset.off, .tres.off { visibility: hidden; opacity: 0; pointer-events: none; }   /* its place stays, as the tempo's ↺ */
.ireset svg, .tres svg { width: 14px; height: 14px; }
.ifull { position: fixed; z-index: 35; display: flex; align-items: center; gap: 6px; padding: 0 8px; border-radius: 6px; border: 1px solid var(--muted);
         background: var(--surface); color: var(--ink); font: 600 12.5px/1 var(--font); white-space: nowrap; pointer-events: none; box-shadow: 0 6px 18px rgb(0 0 0 / .14); }
.ifull svg { width: 13px; height: 13px; flex: none; color: var(--c); }
.ibtn, .tbtn { display: flex; align-items: center; gap: 6px; width: 0; min-width: 100%; height: 24px; padding: 0 8px; border-radius: 6px;
        border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: 600 12.5px/1 var(--font); cursor: pointer; text-align: left; }
.ibtn:hover, .tbtn:hover { border-color: var(--muted); }
.ibtn[aria-expanded="true"], .tbtn[aria-expanded="true"] { border-color: var(--accent); background: var(--accent-soft); }
.ibtn svg, .tbtn svg { width: 13px; height: 13px; flex: none; color: var(--c); }
.ibtn span, .tbtn span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tbtn:disabled { opacity: .6; cursor: progress; }
.imenu { position: fixed; z-index: 45; width: 470px; max-width: calc(100vw - 24px); max-height: min(430px, calc(100vh - 24px));
         display: grid; grid-template-columns: 172px minmax(0, 1fr); background: var(--surface); border: 1px solid var(--line);
         border-radius: 10px; box-shadow: 0 10px 30px rgb(0 0 0 / .18); overflow: hidden; }
.imenu.kits { grid-template-columns: minmax(0, 1fr); width: 260px; }
.im-fam, .im-ins { overflow-y: auto; padding: 6px; }
.im-fam { border-right: 1px solid var(--line); background: var(--surface-2); }
.imenu button { display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 8px; text-align: left; border: 0;
                background: none; color: var(--ink); font: 13.5px/1.25 var(--font); padding: 7px 9px; border-radius: 6px; cursor: pointer; }
.imenu button:hover:not(:disabled) { background: var(--accent-soft); }
.imenu button:disabled { color: var(--disabled-ink); cursor: default; }
.imenu button small { font-size: 11px; color: var(--muted); }
.im-fam button[aria-current="true"] { background: var(--surface); font-weight: 600; }
.im-ins button[aria-checked="true"] { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.imenu.tunes { width: 250px; max-height: min(490px, calc(100vh - 24px)); }                    /* a guitar's tuning: the name, its strings on the right */
.imenu.tunes button small { font: 11px var(--mono); }
.im-ins button[aria-checked="true"] small { color: inherit; opacity: .8; }
.im-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); flex: none; }
.im-sec { font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 600; padding: 8px 9px 4px; }
.im-auto { font-size: 12px; color: var(--muted); padding: 6px 9px 8px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.im-auto button { padding: 6px 0 0; color: var(--accent); font-weight: 600; width: auto; }
.im-auto button:hover { background: none; text-decoration: underline; }
/* «Инструмент»: the bottom edge of a track is dragged for its height */
.hgrip { position: absolute; left: 0; width: var(--headw, 240px); bottom: -5px; height: 9px; cursor: row-resize; z-index: 3; touch-action: none; }   /* only under the headers: dragging the notes never catches it */
.hgrip::after { content: ""; position: absolute; left: 0; right: 0; top: 4px; height: 2px; background: var(--accent); opacity: 0; transition: opacity .15s; }
.hgrip:hover::after, .hgrip.on::after { opacity: .7; }
.clefbox { position: relative; min-width: 0; overflow: hidden; }
.clefbox canvas, .clefbox svg { display: block; }
.tbody { position: relative; min-width: 0; overflow: hidden; cursor: default; touch-action: pan-y; user-select: none; -webkit-user-select: none; display: grid; place-items: center;
         color: var(--muted); font-size: 13px; }
.tbody canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
/* no «will-change: transform» (0.11.2): the score of a whole long piece as one layer cost 10+ ms of every frame */
.score { position: absolute; left: 0; top: 0; }
.score .blk { position: absolute; top: 0; }
.score svg { display: block; overflow: visible; }
/* VexFlow draws in black: recolour to the theme; a sounding note takes its track's colour */
.score svg, .clefbox svg { fill: var(--ink); stroke: var(--ink); }
.score svg :is(path, rect, text):not([fill="none"]), .clefbox svg :is(path, rect, text):not([fill="none"]) { fill: var(--ink); }
.score svg [stroke]:not([stroke="none"]), .clefbox svg [stroke]:not([stroke="none"]) { stroke: var(--ink); }
.score svg .vf-on :is(path, rect):not([fill="none"]) { fill: var(--c); }
.score svg .vf-chord text:not([fill="none"]) { fill: var(--accent); }          /* chord names */
.score svg .vf-chord rect:not([fill="none"]) { fill: var(--surface); fill-opacity: .88; }
.score svg .vf-on [stroke]:not([stroke="none"]), .score svg .vf-on .vf-stem path { stroke: var(--c); }
.tbody .cursor { position: absolute; left: 0; top: 4px; bottom: 4px; width: 2px; margin-left: -1px; background: var(--accent); border-radius: 1px; pointer-events: none; }
.trow.off .tbody { opacity: .45; }
.tracks.orig .trio, .tracks.orig .tctrl .vp { opacity: .5; }

.instr { display: grid; justify-items: center; gap: 6px; padding: 10px 18px 10px; border-top: 1px solid var(--line); background: var(--surface); }
.ihead { display: flex; align-items: baseline; gap: 6px 10px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.ihead b { color: var(--ink); font-weight: 600; }
.ihead .sw { display: inline-block; width: 8px; height: 8px; border-radius: 2px; background: var(--c); margin-right: 5px; }
.ihead .plus { color: var(--muted); margin: 0 1px; }
.ihead .barbtn { margin-left: auto; }                 /* «Показать ноты такта»: a switch at the right end of the line */
.barbtn .sw { position: relative; width: 11px; height: 11px; background: none; box-shadow: inset 0 0 0 1.5px var(--ink-soft); }
.barbtn[aria-pressed="true"] .sw::after { content: ""; position: absolute; inset: 3px; border-radius: 1px; background: var(--ink); }   /* on: a square dot */
.barbtn[aria-pressed="false"] .sw { box-shadow: inset 0 0 0 1.5px var(--muted); }
.idiv { height: 1px; background: var(--line); }
.kbwrap, .instr > .ihead { position: relative; z-index: 1; background: var(--surface); }   /* the neck slides out from under them */
.instr > * { width: 100%; max-width: 1120px; }      /* a wide screen: the neck and the keyboard stop at this width, in the middle */      /* between the neck and the keyboard, as close as they go */
.kbwrap, .neckwrap { overflow-x: auto; }
.kb { position: relative; min-width: 680px; height: 92px; }
@media (max-width: 600px) and (orientation: portrait) { .kb { height: 60px; } }   /* a phone upright (0.10.4): keys 13 px wide — not 92 px tall */
.kb canvas, .neck canvas { width: 100%; height: 100%; display: block; }
.neck { position: relative; height: 150px; }          /* the whole neck, 24 frets, always (no fret numbers under it) */

/* «Падающие ноты» (0.7.0): black, the whole window; the tempo of the panel moves into its bar while it is open */
.fallbtn { display: inline-flex; align-items: center; gap: 7px; }
.fallbtn svg { width: 15px; height: 15px; fill: currentColor; flex: none; }
.fall { position: fixed; inset: 0; z-index: 25; display: grid; grid-template-rows: auto auto minmax(0, 1fr) auto auto; grid-template-columns: minmax(0, 1fr); background: #000; color: var(--ink);
        opacity: 0; transition: opacity .18s var(--ease);
        --bg: #000; --surface: #121419; --surface-2: #1e2229; --ink: #e6e8ed; --muted: #8d94a3; --line: #2a2f39; --accent: #7b98ff; --accent-ink: #0b0f1e;
        --accent-soft: #1d2540; --disabled-ink: #5d6372;
        --c-piano: #f2aa45; --c-vocals: #ef7196; --c-other: #9c8fff; --c-guitar: #6cbd70; --c-bass: #3fc3b3; --c-drums: #9aa3b6;
        --key-white: #e4e6eb; --key-black: #0c0d10; --kb-black: #2a2d33; --kb-gap: #3c4049; --key-line: #7d838f; --on-c: #101216; --vp-track: #1a1d22; --vk-1: #e3e6ea; --vk-2: #c2c6cc; --vk-3: #a6abb2; color-scheme: dark; }
.fall.on { opacity: 1; }
.fbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; padding: 10px 16px;
        --ctl-h: calc(13.5px * 1.2 + 16px); }                  /* ▶ and the name on the left; the sound, the tempo, the screen — at the right edge */
.fbar .tempo, .fbar .seg { height: var(--ctl-h); }
.fbar .seg button { padding-block: 0; }
.fside { display: flex; align-items: center; gap: 12px; min-width: 0; }
.fleft { flex: 1 1 140px; }                           /* the name gives way first; a narrow window — the rest wraps to a second row */
.fright { flex: 0 0 auto; justify-content: flex-end; gap: 18px; margin-left: auto; }
.fname { font: var(--track); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; flex: 0 1 auto; }
.fslot { display: flex; justify-content: center; }
.zreset { width: 28px; height: 28px; flex: none; border: 0; border-radius: 7px; background: none; color: var(--accent); display: grid; place-items: center; cursor: pointer; transition: opacity .15s; }
.zreset:hover { background: var(--surface-2); }
.zreset.off { visibility: hidden; opacity: 0; pointer-events: none; }   /* its place stays, as the tempo's ↺ */
.zreset svg { width: 15px; height: 15px; }
.fbar .play { flex: none; }                       /* always round, however narrow the window */
.fvol { display: flex; align-items: center; gap: 10px; }
.fvol .vp { width: 120px; flex: none; --vc: var(--accent); }
.fclose { width: 36px; height: 36px; flex: none; border-radius: 50%; border: 1.5px solid rgba(255, 255, 255, .62); background: none; color: var(--ink);
          display: grid; place-items: center; cursor: pointer; transition: box-shadow .22s var(--ease); }
.fclose:hover { box-shadow: 0 0 6px 1px rgba(255, 255, 255, .32), 0 0 16px 5px rgba(123, 152, 255, .28), 0 0 30px 10px rgba(123, 152, 255, .1); }   /* an aura; the button stays */
.fclose:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.fclose svg { width: 15px; height: 15px; }
.fprog { position: relative; height: 10px; cursor: pointer; touch-action: none; }      /* the song: click or drag to move */
.fprog::before, .fprog i { position: absolute; left: 0; top: 4px; height: 2px; transition: top .12s, height .12s; }
.fprog::before { content: ""; right: 0; background: rgba(255, 255, 255, .1); }
.fprog i { display: block; width: 0; background: var(--accent); }
.fprog:hover::before, .fprog:hover i { top: 3px; height: 4px; }
.htime { position: fixed; left: 0; top: 0; z-index: 40; pointer-events: none; padding: 3px 8px; border-radius: 6px; background: rgba(17, 19, 24, .92); color: #f2f4f8;
         border: 1px solid rgba(255, 255, 255, .14); font: 600 12px/1.3 var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap;
         box-shadow: 0 4px 14px rgb(0 0 0 / .25); opacity: 0; transition: opacity .15s, transform .14s var(--ease); }
.htime.on { opacity: 1; }
/* the notes' canvas lies over its box: its picture size never feeds back into the layout (Safari grew the row by it —
   the line where notes are struck went under the screen, notes showed under the keys) */
.fnwrap { position: relative; min-height: 0; overflow: hidden; }
.fnotes { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: grab; touch-action: none; }
.fkb { height: 120px; border-top: 2px solid #3a3f4a; }
.fkb canvas { width: 100%; height: 100%; display: block; }
.flegend { padding: 8px 16px 12px; align-items: center; gap: 4px 6px; }
.flegend .flab { margin-right: 2px; }
.fchip, .barbtn { display: inline-flex; align-items: center; gap: 6px; font: 600 12px/1.2 var(--font); color: var(--ink); background: none; border: 1px solid transparent;
         border-radius: 6px; padding: 3px 7px; cursor: pointer; transition: color .15s, border-color .15s, background-color .15s; }
.fchip:hover, .barbtn:hover { border-color: var(--line); background: var(--surface-2); }
.fchip:focus-visible, .barbtn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.fchip .sw, .barbtn .sw { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin: 0; }
.fchip[aria-pressed="false"], .barbtn[aria-pressed="false"] { color: var(--muted); font-weight: 500; }
.fchip[aria-pressed="false"] .sw { background: none; box-shadow: inset 0 0 0 1.5px var(--c); }

/* action bar: «Назад к загрузке» · what goes into the notes / progress / result · «Получить ноты» / «Далее» */
.actionbar { display: flex; align-items: center; gap: 12px 18px; flex-wrap: wrap; padding: 12px 18px; background: var(--surface); border-top: 1px solid var(--line); }
.ab-main { flex: 1 1 320px; min-width: 0; display: grid; gap: 6px; }
.ab-actions { display: flex; gap: 8px; margin-left: auto; }
.summary { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.summary b { font-weight: 600; }
.summary .sw { display: inline-block; width: 8px; height: 8px; border-radius: 2px; background: var(--c); margin-right: 5px; vertical-align: 1px; }
.summary .hint { color: var(--muted); }
.status { min-height: 26px; display: flex; align-items: center; min-width: 0; }
.status > * { flex: 1 1 auto; min-width: 0; }
/* notes progress: a sensible fixed length, not the whole width; a narrow window shortens the bar before the text */
.nproc { display: flex; align-items: center; gap: 12px; font-size: 13px; }
.nproc .meter { flex: 1 1 0; max-width: 300px; min-width: 90px; height: 6px; }
.nproc .msg { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nproc .t { flex: none; white-space: nowrap; font-size: 12px; }
/* «Стоп» → the question in the same line, soft warning tone; the answers are the buttons on the right */
.ask { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-soft); white-space: nowrap; overflow: hidden; }
.ask svg { width: 15px; height: 15px; flex: none; color: var(--warn-ink); }
.ask b { color: var(--warn-ink); font-weight: 600; }
.ask span { overflow: hidden; text-overflow: ellipsis; }
.result { font-size: 13px; display: flex; align-items: baseline; gap: 16px; white-space: nowrap; min-width: 0; }
.result > * { flex: none; }
.result .counts, .result .stale { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; color: var(--ink-soft); }
.result .ok { color: var(--ink); font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.result .ok svg { width: 14px; height: 14px; color: var(--ok-ink); align-self: center; }
.result .stale { color: var(--muted); }
.ab-actions .btn { padding-block: 8px; }
.result a, .result .link { color: var(--accent); cursor: pointer; text-decoration: underline; text-underline-offset: 2px;
  background: none; border: 0; padding: 0; font: inherit; }
.result .link:disabled { color: var(--muted); cursor: default; }
.mp3.busy { opacity: .6; cursor: progress; }

/* ---------- toasts */
.toasts { position: fixed; right: 18px; bottom: 76px; display: grid; gap: 8px; z-index: 30; }
/* «Нет связи с сервером»: above everything (the falling notes too), slides down; the page under it stays as it was */
.offline { position: fixed; top: 12px; left: 0; right: 0; margin-inline: auto; width: max-content; z-index: 60; display: flex; align-items: center; gap: 10px; max-width: calc(100vw - 24px);
           padding: 9px 14px; border-radius: 10px; background: var(--ink); color: var(--surface); font-size: 13px; box-shadow: 0 6px 20px rgb(0 0 0 / .22);
           transform: translateY(-16px); opacity: 0; pointer-events: none; transition: transform .26s ease, opacity .22s ease; }
.offline.show { transform: none; opacity: 1; }
.offline b { font-weight: 600; }
.offline .spin { width: 14px; height: 14px; flex: none; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; opacity: .8; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .offline { transition: none; } .offline .spin { animation: none; } }
.toast { background: var(--ink); color: var(--surface); padding: 9px 14px; border-radius: 8px; font-size: 13px; display: flex; gap: 14px; align-items: center; max-width: 460px; box-shadow: 0 6px 20px rgb(0 0 0 / .18); }
.toast.err { background: var(--danger); color: #fff; }
.toast button { font: var(--btn); background: none; border: 0; color: inherit; text-decoration: underline; cursor: pointer; padding: 0; }

@media (max-width: 1150px) {
  .list-head, .row { grid-template-columns: 18px var(--who-w, 170px) minmax(120px, 1fr) var(--listen-w, 174px) var(--notes-w, 180px) var(--dl-w, 96px); column-gap: 10px; }
  .row .chip, .trow .chip, .colprobe .chip { padding-inline: 8px; }
}
@media (max-width: 900px) {   /* top bar in two rows: logo + song name, then the steps */
  .topbar, .topbar.bare { grid-template-columns: minmax(0, 1fr); padding-inline: 12px; gap: 6px; }
  .topbar .top-right { display: none; }
  .fb-mini:not([hidden]) { display: grid; }
  .brand span { display: none; }
  .lead { gap: 10px; padding-right: 0; }
  .lead.off { display: none; }
  .flow ol { justify-content: center; gap: 4px; }
  .flow .sep { width: 12px; }
  .st { padding-right: 6px; column-gap: 6px; }
}
@media (max-width: 800px) {   /* narrow: three equal columns, descriptions wrap under circle + name */
  .flow ol { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
  .flow .sep { display: none; }
  .st { width: 100%; }
  .st .ds { grid-column: 1 / -1; }
  .st .ds > span, .flow.described .st .ds > span { max-width: none; white-space: normal; font-size: 11px; line-height: 1.35; }
}
@media (max-width: 800px) {   /* phone: one card per track, the page scrolls as a whole */
  body { overflow: auto; }
  .app { height: auto; min-height: 100%; }
  .review { display: block; height: auto; }
  .stems-pane { display: block; }
  .stems { overflow: visible; }
  .overview { grid-template-columns: auto auto minmax(0, 1fr) auto; padding-inline: 16px; }
  .overview .latch { grid-column: 1 / 3; justify-self: start; }
  .overview .master { grid-column: 3 / -1; }
  .master .vp { flex: 1 1 auto; width: auto; }
  main > .view.leaving { position: absolute; inset: 0 0 auto 0; }
  .notes-pane { display: block; }
  .panel { padding-inline: 16px; }
  .tracks { overflow: visible; }
  /* phone: the controls on top, the clefs / key strip stay left of the notes */
  .trow { grid-template-columns: auto minmax(0, 1fr) !important; grid-template-areas: "ctrl ctrl" "clef body"; }
  .thead { display: contents; }
  .tctrl { grid-area: ctrl; padding-inline: 16px; grid-template-columns: auto minmax(0, 1fr); align-items: center; border-bottom: 1px solid var(--line); }
  .tctrl .tname, .tctrl .irow, .tctrl .tune { grid-column: 1 / -1; }
  .clefbox { grid-area: clef; border-right: 1px solid var(--line); }
  .tracks.classic .clefbox { border-right-color: transparent; }
  .tbody { grid-area: body; }
  .instr { padding-inline: 16px; }
  .neck { min-width: 760px; }                  /* a phone: the neck stays whole and scrolls sideways */
  .fbar { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 10px; padding-inline: 12px; position: relative; }
  .fside { flex-wrap: wrap; justify-content: center; }
  .fleft { padding-right: 44px; }                 /* room for «выйти», which stays top right */
  .fname { flex-basis: calc(100% - 60px); }
  .fright { flex: 1 1 100%; margin-left: 0; gap: 8px 12px; }   /* wraps inside the window instead of running off both sides */
  .fbar .fclose { position: absolute; top: 12px; right: 12px; }
  .fbar .plabel { display: none; }
  .hgrip { width: 46px; }                      /* under the key strip */
  .list-head { display: none; }
  .row { grid-template-columns: 18px minmax(0, 1fr) auto; grid-template-areas: "num who dl" "wave wave wave" "listen listen listen" "notes notes notes";
         row-gap: 10px; padding-inline: 16px; }
  .row .listen { grid-template-columns: auto minmax(0, 1fr); grid-template-rows: none; align-items: center; gap: 12px; }
  .list-note, .mixbar { padding-inline: 16px; }
  .mixbar { flex-direction: column; align-items: stretch; padding-top: 14px; }   /* the button first, its hints under it */
  .mixbar #btnMix { order: -1; }
  .mixbar .mixinfo { flex: none; }               /* its 320 px basis is a height in a column */
  .actionbar { padding-inline: 16px; }
  .ab-actions { width: 100%; }
  .ab-actions .btn { flex: 1; }
}
@media (max-width: 620px) {
  .card { padding: 30px 18px 24px; }
  .find-box input { font-size: 16px; }          /* 16 px: iPhone does not zoom into the field */
  .doc-over { padding: 0; }
  .doc { max-height: 100vh; height: 100%; border-radius: 0; border: 0; }
  .doc-body { padding: 14px 18px 24px; }
  .cookie { flex-direction: column; align-items: stretch; }
  .lockup { font-size: 24px; } .lockup svg { width: 90px; height: 36px; }
  .greet .hello { font-size: 24px; }
  .greet .intro { font-size: 17px; }
  .greet .sub { font-size: 15px; }
  .dialog-btns { flex-direction: column-reverse; }
  .dialog-btns .btn { width: 100%; padding-block: 10px; }
}
@media (max-width: 600px) {   /* a phone upright: the notes panel in four rows — the labels «Звук» and «Темп» go, the switches tell it;
                                 view · sound + tempo · MIDI + falling notes · zoom + metre and key */
  .panel { gap: 8px; padding-block: 8px; }
  #nSoundGroup .plabel, #nTempoGroup .plabel { display: none; }
  .panel .seg button { padding-inline: 9px; }
  #nViewSeg { order: 1; } #nSoundGroup { order: 2; } #nTempoGroup { order: 3; } #nMidiWrap { order: 4; } #nFallBtn { order: 5; }
  #nZoomGroup { order: 6; } .panel .meter-info { order: 7; font-size: 12px; }
  #nZoomGroup input { width: 96px; }
}

/* a phone on its side (low window): the bars give the height to the content */
@media (max-height: 520px) and (min-width: 560px) and (max-width: 900px) {   /* the top bar in one row */
  .topbar, .topbar.bare { grid-template-columns: minmax(0, 1fr) auto; padding-block: 4px; gap: 12px; }
  .topbar.bare { grid-template-columns: minmax(0, 1fr); }
  .flow ol { display: flex; justify-content: center; gap: 4px; }
  .flow .sep { display: block; width: 12px; }
  .st { width: auto; padding-block: 4px; }
  .st .ds { display: none; }
}
@media (max-height: 520px) and (min-width: 560px) and (max-width: 800px) {   /* the song's bar in one row, a track in two */
  .overview { grid-template-columns: auto auto minmax(0, 1fr) auto auto auto; padding-block: 6px; gap: 8px 12px; }
  .overview .latch, .overview .master { grid-column: auto; }
  .master .vp { flex: none; width: 120px; }
  .row { grid-template-columns: 18px minmax(0, 150px) minmax(0, 1fr) auto; grid-template-areas: "num who wave dl" "num who listen notes"; row-gap: 8px; }
  .panel { padding-block: 6px; }
}
@media (max-height: 520px) {
  /* falling notes: one bar without the song's name, lower keys (sizeFall), the «На клавиатуре» switches over the notes */
  .fbar { flex-wrap: nowrap; padding: 6px 12px; gap: 10px; }
  .fbar .fname { display: none; }
  .fleft { flex: 0 0 auto; padding-right: 0; }
  .fright { flex: 1 1 auto; flex-wrap: nowrap; justify-content: flex-end; gap: 10px; }
  .fbar .plabel { display: none; }
  .fbar .fclose { position: static; }
  .fbar .play { width: 34px; height: 34px; }
  .fall > .fbar { grid-row: 1; } .fall > .fprog { grid-row: 2; } .fall > .fnwrap { grid-row: 3; grid-column: 1; } .fall > .fkb { grid-row: 4; }
  .fall > .flegend { grid-row: 3; grid-column: 1; align-self: start; justify-self: start; z-index: 2; margin: 6px 0 0 8px; padding: 3px 8px;
                     border-radius: 8px; background: rgba(0, 0, 0, .62); }
}
@media (prefers-reduced-motion: reduce) {
  .meter-fill, .reveal, .flow .sep, .st .ds, .st .ds > span, .mix-bar i, .btn, .check, .chip, .nbtn, .gchip, .latch, .row::before, .wave, .listen,
  .slide, .vp, .seg button, .kbbtn, .tctrl, .mitem, .fall, .fchip, .barbtn, .fclose, .htime, .trow, .tdrop, .play, .play svg, .fprog::before, .fprog i { transition: none; }
  .st.busy i, .st.pulse i, .view.enter, .overlay, .reveal.anim > div > *, .menu, .bubble, .play::after { animation: none; }
}
