/*! © 2026 Oner Studio — Melo Voice. All rights reserved. Copying, reuse or redistribution without written permission is prohibited. */
/* Melo Voice — vocal editor. Calm, low-contrast palette for long sessions (overrides the site tokens on this page). */
:root.ed-page {
  --night: #161a20;      /* canvas background */
  --night-2: #1b2028;    /* panels, black-key rows */
  --night-3: #232a34;    /* buttons, hover */
  --line: #2b323d;       /* borders, grid */
  --paper: #d6dbe2;      /* main text, edited pitch line */
  --mist: #858f9d;       /* secondary text */
  --sun: #c9a462;        /* notes, playhead — muted amber */
  --sky: #7eb0bd;        /* selection, original — muted teal */
  --ed-grid: rgba(214, 219, 226, 0.045);
  --ed-wave: rgba(214, 219, 226, 0.07);
  color-scheme: dark;
}
.ed-page body { -webkit-font-smoothing: antialiased; }
.ed-page .btn.primary { background: #b8955a; border-color: #b8955a; color: #161a20; }
.ed-page .btn.primary:hover { background: var(--sun); }
.ed-page .btn { transition: background .15s, border-color .15s; }
.ed-page .btn:hover, .ed-page .ghost:hover { border-color: #3a4350; background: var(--night-3); }
.ed-page .brand { color: var(--sun); }
html, body { height: 100%; }
.ed { height: 100%; overflow: hidden; display: grid; grid-template-rows: auto auto 1fr auto; }

.ed-top { display: flex; align-items: center; gap: 18px; padding: 10px 16px; border-bottom: 1px solid var(--line); }
.ed-top .brand span { font: 600 15px var(--text); color: var(--paper); }
.ed-top .brand svg { width: 26px; height: 26px; }
.transport { display: flex; align-items: center; gap: 12px; margin-left: 12px; }
.round { width: 38px; height: 38px; border-radius: 50%; border: 1px solid #3a4350; background: var(--night-3); color: var(--sun); cursor: pointer; display: grid; place-items: center; transition: background .15s; }
.round:hover { background: #2a323d; }
.round svg { width: 20px; height: 20px; fill: currentColor; }
.time { font: 500 15px var(--text); font-variant-numeric: tabular-nums; color: var(--paper); min-width: 64px; }
.ed-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.ed-actions .ghost { width: 36px; height: 36px; padding: 0; font-size: 18px; }
.tog { display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--mist); cursor: pointer; white-space: nowrap; }
.tog input, .insp-body input { accent-color: var(--sun); }

.ed-tools { display: flex; align-items: center; gap: 10px; padding: 8px 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; font-size: 14px; color: var(--mist); }
.ed-tools .btn { padding: 7px 14px; font-size: 14px; }
.ed-tools label { display: flex; align-items: center; gap: 6px; }
.ed-tools select { padding: 6px 8px; }
.ed-tools .sep { width: 1px; height: 22px; background: var(--line); }
.ed-tools .grow { flex: 1; }
.ed-tools .ghost { width: 34px; height: 34px; padding: 0; font-size: 18px; }

.ed-main { display: grid; grid-template-columns: 1fr 300px; min-height: 0; max-width: none; margin: 0; padding: 0; width: 100%; }
.roll-wrap { position: relative; min-width: 0; min-height: 0; }
#roll { width: 100%; height: 100%; display: block; touch-action: none; cursor: default; }
.ed-status { position: absolute; left: 50%; top: 40%; transform: translate(-50%, -50%); color: var(--mist); font-size: 15px; text-align: center; pointer-events: none; max-width: 80%; }

.inspector { border-left: 1px solid var(--line); background: var(--night-2); padding: 16px; overflow-y: auto; }
.inspector h2 { font: 600 15px var(--text); margin: 0 0 14px; color: var(--paper); }
.inspector h3 { font: 600 12px var(--text); letter-spacing: .06em; text-transform: uppercase; color: var(--mist); margin: 18px 0 8px; }
.insp-body label { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; font-size: 13px; color: var(--mist); margin-bottom: 10px; }
.insp-body label input[type=range] { grid-column: 1 / -1; }
.insp-body label.check { display: flex; color: var(--paper); }
.insp-body output { font-size: 13px; color: var(--paper); font-variant-numeric: tabular-nums; }
.row-btns { display: flex; gap: 8px; margin-bottom: 16px; }
.row-btns .btn { padding: 8px 12px; font-size: 13px; flex: 1; }
.inspector .hint { font-size: 13px; color: var(--mist); margin: 12px 0 0; }
.inspector.no-ref .needs-ref { display: none; }

.ed-help { margin: 0; padding: 6px 16px; font-size: 12px; color: #6f7886; border-top: 1px solid var(--line); }

@media (max-width: 860px) {
  .ed { height: auto; min-height: 100%; overflow: visible; grid-template-rows: auto auto auto auto; }
  .ed-top { flex-wrap: wrap; gap: 10px; }
  .ed-top .brand span { display: none; }
  .ed-actions { margin-left: 0; flex-wrap: wrap; }
  .ed-main { grid-template-columns: 1fr; }
  .roll-wrap { height: 58vh; }
  .inspector { border-left: 0; border-top: 1px solid var(--line); }
}

.export-menu { position: fixed; z-index: 10; background: var(--night-2); border: 1px solid var(--line); border-radius: var(--radius-s);
  padding: 6px; display: grid; min-width: 220px; box-shadow: 0 10px 30px rgba(0, 0, 0, .35); }
.export-menu button { background: none; border: 0; color: var(--paper); text-align: left; padding: 10px 12px; border-radius: 6px; font: 500 14px var(--text); cursor: pointer; }
.export-menu button:hover { background: var(--night-3); }

/* brightness: dim (night) and brighter (day) variants of the calm palette */
:root.ed-page.ed-dim { --night: #111418; --night-2: #15191e; --night-3: #1c2128; --line: #242a33; --paper: #b9c0c9; --mist: #737c89;
  --sun: #b39358; --sky: #6f9ca8; --ed-grid: rgba(185, 192, 201, 0.035); --ed-wave: rgba(185, 192, 201, 0.06); }
:root.ed-page.ed-bright { --night: #1f242c; --night-2: #252b34; --night-3: #2d343f; --line: #39414d; --paper: #e6eaef; --mist: #9aa3b0;
  --sun: #d8b26c; --sky: #8cc0cc; --ed-grid: rgba(230, 234, 239, 0.06); --ed-wave: rgba(230, 234, 239, 0.09); }

/* tool switch */
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; padding: 2px; gap: 2px; }
.seg button { display: flex; align-items: center; gap: 6px; background: none; border: 0; color: var(--mist); font: 500 13px var(--text);
  padding: 5px 12px; border-radius: 999px; cursor: pointer; }
.seg button svg { width: 15px; height: 15px; fill: currentColor; }
.seg button:hover { color: var(--paper); }
.seg button.on { background: var(--night-3); color: var(--paper); box-shadow: inset 0 0 0 1px #3a4350; }
.ed-tools .btn.quiet { background: none; color: var(--mist); }
.ed-tools .btn.quiet:hover { color: var(--paper); }
.ed-top .ghost svg { display: block; margin: auto; }

/* smart controls next to the selection */
.smart { position: absolute; z-index: 3; display: flex; gap: 2px; padding: 3px; background: var(--night-2); border: 1px solid var(--line);
  border-radius: 10px; box-shadow: 0 6px 18px rgba(0, 0, 0, .28); }
.smart button { background: none; border: 0; color: var(--paper); font: 500 12px var(--text); padding: 5px 9px; border-radius: 7px; cursor: pointer; white-space: nowrap; opacity: .85; }
.smart button:hover { background: var(--night-3); opacity: 1; }

.toast { position: absolute; left: 50%; bottom: 74px; transform: translateX(-50%); background: var(--night-2); border: 1px solid var(--line);
  color: var(--paper); font-size: 13px; padding: 8px 14px; border-radius: 999px; pointer-events: none; opacity: 0; transition: opacity .25s; white-space: nowrap; }
.toast.show { opacity: .95; }

.inspector .hint.first { margin: 0 0 6px; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 7px; vertical-align: 1px; }
.dot.sib { background: var(--sky); } .dot.breath { background: var(--mist); }
.legend { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 6px; font-size: 12px; color: var(--mist); margin: 0; }
.legend .sw { width: 12px; height: 8px; border-radius: 3px; display: inline-block; }
.legend .sw.ok { background: var(--sun); opacity: .55; } .legend .sw.mid { background: #c99a62; } .legend .sw.off { background: #bf7f72; }
.legend span { margin-right: 6px; }
.insp-body label output { grid-column: 2; grid-row: 1; text-align: right; color: var(--mist); }
.insp-body label { margin-bottom: 12px; }
.seg kbd { font: 600 10px var(--text); min-width: 16px; height: 16px; display: inline-grid; place-items: center; border-radius: 4px;
  background: var(--night); color: var(--mist); border: 1px solid var(--line); }
.seg button.on kbd { color: var(--sun); border-color: #4a4231; }

/* keys dialog */
.keys-dlg { width: min(520px, 94vw); }
.keys-dlg .hint { margin: -6px 0 14px; font-size: 13px; }
.keys-list { display: grid; gap: 2px; max-height: 60vh; overflow-y: auto; margin-bottom: 18px; }
.key-row { display: grid; grid-template-columns: 1fr auto auto; gap: 12px; align-items: center; padding: 7px 4px; border-bottom: 1px solid var(--line); font-size: 14px; }
.key-chips { display: flex; gap: 4px; }
.key-chips kbd { font: 600 12px var(--text); min-width: 24px; padding: 3px 7px; text-align: center; border-radius: 5px; background: var(--night-3); border: 1px solid #3a4350; color: var(--paper); }
.key-chips em { font-style: normal; color: var(--sun); font-size: 13px; }
.keys-dlg .actions { display: flex; justify-content: flex-end; gap: 10px; }
.keys-dlg .swipe-row { margin: -6px 0 18px; font-size: 14px; }

/* toolbar menus: Auto (one-click jobs) and View (what is shown) */
.menu-wrap { position: relative; }
.menu-btn { display: inline-flex; align-items: center; gap: 4px; }
.menu-btn svg { width: 14px; height: 14px; opacity: .7; }
.menu-btn[aria-expanded="true"] { background: #2a313c; border-color: #3a4350; }
.menu { position: absolute; top: calc(100% + 6px); left: 0; z-index: 20; min-width: 230px; display: grid; padding: 6px;
  background: var(--night-2); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 12px 30px rgba(0, 0, 0, .35); }
.menu.right { left: auto; right: 0; }
.menu > button { background: none; border: 0; color: var(--paper); text-align: left; font: 500 13.5px var(--text); padding: 9px 12px; border-radius: 7px; cursor: pointer; white-space: nowrap; }
.menu > button:hover { background: var(--night-3); }
.menu-check { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 7px; font-size: 13.5px; color: var(--paper); cursor: pointer; white-space: nowrap; }
.menu-check:hover { background: var(--night-3); }
.menu-check input { accent-color: var(--sun); }
.menu-sep { height: 1px; background: var(--line); margin: 5px 6px; }
.ed-tools { flex-wrap: nowrap; }
.ed-tools .keysel { white-space: nowrap; }
@media (max-width: 860px) { .ed-tools { flex-wrap: wrap; } }


/* ===================================================================== steppe studio (editor) */
:root.ed-page {
  --night: #10151d;      /* canvas */
  --night-2: #151b24;    /* panels, black-key rows */
  --night-3: #1d2530;
  --line: #263040;
  --paper: #e3e8ef;
  --mist: #8e9aab;
  --sun: #e2b15b;
  --sky: #5ec4d6;
  --ed-grid: rgba(227, 232, 239, 0.05);
  --ed-wave: rgba(94, 196, 214, 0.08);
}
:root.ed-page.ed-dim { --night: #0c1016; --night-2: #11161d; --night-3: #181f28; --line: #1f2733; --paper: #c3cad4; --mist: #77818f;
  --sun: #c79c52; --sky: #4fa8b8; --ed-grid: rgba(195, 202, 212, 0.04); --ed-wave: rgba(79, 168, 184, 0.07); }
:root.ed-page.ed-bright { --night: #17202b; --night-2: #1c2632; --night-3: #25303e; --line: #313d4d; --paper: #eef2f7; --mist: #a1acbb;
  --sun: #f0c06a; --sky: #6fd3e4; --ed-grid: rgba(238, 242, 247, 0.06); --ed-wave: rgba(111, 211, 228, 0.1); }
.ed-page .btn.primary { background: var(--grad); border-color: transparent; color: var(--on-grad); box-shadow: var(--btn-shadow); }
.ed-page .btn.primary:hover { filter: brightness(1.06); box-shadow: var(--glow); }
/* top bar: a soft gradient and the ram-horn ornament line */
.ed-top { position: relative; border-bottom: 0; background: var(--bar); }
.ed-top::after { content: ""; position: absolute; left: 0; right: 0; bottom: -8px; height: 16px; background: var(--ornament) repeat-x center / var(--orn-size); opacity: var(--orn-opacity); pointer-events: none; z-index: 2; }
.ed-top::before { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--sun) 40%, transparent), color-mix(in srgb, var(--sky) 40%, transparent), transparent); }
.ed-top .brand span { font: 700 15px var(--display); letter-spacing: .01em; }
.round { background: var(--grad); color: var(--on-grad); border: 0; box-shadow: var(--btn-shadow); }
.round:hover { filter: brightness(1.07); background: var(--grad); }
.time { font: 600 15px var(--display); letter-spacing: .02em; }
.ed-tools { background: var(--surface-flat); border-bottom-color: var(--line); padding-top: 12px; }
.seg { background: var(--seg-bg); border-color: var(--line); }
.seg button.on { background: var(--seg-on); box-shadow: inset 0 0 0 1px var(--accent-line), 0 0 14px var(--accent-soft); color: var(--paper); }
.seg button.on svg { color: var(--sun); }
.menu { background: var(--glass); backdrop-filter: blur(8px); }
.inspector { background: var(--bar); }
.inspector h3 { color: var(--sun); opacity: .8; letter-spacing: .04em; }
.smart { background: var(--glass); backdrop-filter: blur(8px); box-shadow: 0 8px 24px rgba(0,0,0,.3), 0 0 0 1px var(--accent-soft); }
.toast { background: var(--glass); box-shadow: 0 0 0 1px var(--accent-line), 0 8px 24px rgba(0,0,0,.3); }
.ed-help { background: var(--surface-flat); }
.menu-check.theme-row { justify-content: space-between; }
.menu-check.theme-row select { margin-left: 12px; }

/* ===================================================================== phone */
.sheet-handle { display: none; }
@media (max-width: 860px) {
  html, body { height: 100%; overflow: hidden; }
  .ed { height: 100dvh; min-height: 0; overflow: hidden; grid-template-rows: auto auto 1fr; }
  .ed-help { display: none; }
  /* top bar: one row, only what a thumb needs */
  .ed-top { flex-wrap: nowrap; gap: 8px; padding: 8px 10px; }
  .ed-top .brand span, #keys, #bright { display: none !important; }
  .transport { margin-left: 0; gap: 8px; }
  .round { width: 40px; height: 40px; }
  .time { min-width: 0; font-size: 14px; }
  .ed-actions { margin-left: auto; gap: 6px; flex-wrap: nowrap; }
  .ed-actions .ghost { width: 34px; height: 34px; }
  .ed-actions select { padding: 5px 6px; font-size: 13px; }
  #export { padding: 8px 12px; font-size: 13px; }
  /* tools: one row you can swipe sideways */
  .ed-tools { flex-wrap: nowrap !important; overflow-x: auto; overflow-y: hidden; gap: 8px; padding: 8px 10px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .ed-tools::-webkit-scrollbar { display: none; }
  .ed-tools > * { flex: none; }
  .seg button { padding: 6px 9px; }
  .seg button span, .seg kbd, .ed-tools .keysel > span, .ed-tools .sep { display: none; }
  .ed-tools .grow { display: none; }
  .menu { position: fixed; top: auto; left: 10px !important; right: 10px !important; bottom: 12px; min-width: 0; max-height: 60dvh; overflow-y: auto; }
  /* the roll takes the screen */
  .ed-main { grid-template-columns: 1fr; min-height: 0; }
  .roll-wrap { height: auto; min-height: 0; }
  /* the panel becomes a bottom sheet: a slim bar until you open it */
  .inspector { position: fixed; left: 0; right: 0; bottom: 0; z-index: 15; max-height: 62dvh; overflow-y: auto; border-left: 0;
    border-top: 1px solid var(--line); border-radius: 18px 18px 0 0; padding: 0 16px 20px; box-shadow: 0 -10px 30px rgba(0,0,0,.35);
    transform: translateY(calc(100% - 46px)); transition: transform .25s ease; }
  .inspector.open { transform: translateY(0); }
  .sheet-handle { display: flex; position: sticky; top: 0; z-index: 2; width: calc(100% + 32px); margin: 0 -16px 8px; height: 46px; align-items: center;
    justify-content: center; gap: 10px; background: inherit; border: 0; color: var(--paper); font: 600 14px var(--text); cursor: pointer; background: var(--night-2); }
  .sheet-handle i { position: absolute; top: 7px; left: 50%; width: 38px; height: 4px; margin-left: -19px; border-radius: 2px; background: var(--line); }
  .sheet-handle span { margin-top: 8px; }
  .inspector h2#selInfo { display: none; }
  .ed-main { padding-bottom: 46px; }
  .smart button { padding: 8px 10px; font-size: 13px; }
  /* only what editing needs: language is set on the main site, the key is found by Auto, zoom is two fingers */
  .ed-actions #lang, .ed-tools .keysel, .ed-tools #scale, #zoomIn, #zoomOut { display: none !important; }
  #noteWave, #devColors { pointer-events: none; }
  label:has(> #noteWave), label:has(> #devColors) { display: none !important; }
  /* bigger tools for a thumb */
  .seg button { padding: 8px 11px; }
  .seg button svg { width: 20px; height: 20px; }
  .ed-tools .menu-btn { padding: 8px 12px; }
  .ed-tools { justify-content: space-between; }
}
@media (max-width: 400px) {
  .ed-top .brand { display: none; }
  .ed-top { gap: 6px; padding: 8px; }
  .round { width: 36px; height: 36px; }
  .time { font-size: 13px; }
  .ed-actions { gap: 4px; }
  .ed-actions .ghost { width: 30px; height: 30px; font-size: 16px; }
  .ed-actions select { padding: 4px; font-size: 12px; }
  #export { padding: 7px 10px; font-size: 12px; }
}

/* Before / After: hear the recording without edits */
.ab-btn { height: 30px; padding: 0 12px; border-radius: 999px; border: 1px solid color-mix(in srgb, var(--paper) 22%, transparent);
  background: transparent; color: var(--paper); font: 600 12.5px var(--text); letter-spacing: .02em; cursor: pointer; opacity: .8; }
.ab-btn:hover { opacity: 1; }
.ab-btn[aria-pressed="true"] { background: var(--sun, #f5b83d); border-color: transparent; color: #1a1408; opacity: 1; }
body.ab-on #roll { filter: saturate(.35); }
@media (max-width: 400px) {
  .transport { gap: 6px; }
  .time { min-width: 0; font-size: 12px; }
  .ab-btn { padding: 0 8px; font-size: 11.5px; height: 28px; }
}
@media (max-width: 340px) {
  .time { display: none; }
}
/* small phones: the tools still fit in one row (View becomes a gear) */
@media (max-width: 400px) {
  .seg button { padding: 7px 8px; }
  .ed-tools { gap: 6px; padding: 8px; }
  .ed-tools .menu-btn { padding: 8px 10px; }
  #viewBtn > span { display: none; }
  #viewBtn::before { content: "⚙"; font-size: 17px; line-height: 1; }
}

/* ===================================================================== phone: a studio tool, not a toy
   flat, compact controls (small radius, thin lines, no glow), a slim top bar and a slim bottom sheet */
@media (max-width: 860px) {
  .ed-top { padding: 6px 10px; gap: 8px; }
  .ed-top::after { display: none; }
  .round { width: 34px; height: 34px; border-radius: 8px; box-shadow: none; }
  .round svg { width: 17px; height: 17px; }
  .time { font: 600 13px ui-monospace, SFMono-Regular, Menlo, monospace; font-variant-numeric: tabular-nums; letter-spacing: 0; opacity: .85; }
  .ab-btn { height: 28px; padding: 0 10px; border-radius: 6px; font-size: 12px; letter-spacing: .02em; }
  .ed-actions .ghost { width: 30px; height: 28px; border-radius: 6px; font-size: 15px; }
  .ed-page #export.btn.primary { padding: 0 12px; height: 28px; border-radius: 6px; font-size: 12.5px; box-shadow: none; }
  .ed-tools { padding: 6px 10px; gap: 6px; border-bottom: 1px solid var(--line); }
  .seg { border-radius: 8px; padding: 2px; background: transparent; }
  .seg button { padding: 6px 10px; border-radius: 6px; }
  .seg button svg { width: 17px; height: 17px; }
  .seg button.on { box-shadow: inset 0 0 0 1px var(--accent-line, #3a4350); }
  .ed-tools .menu-btn { height: 32px; padding: 0 10px; border-radius: 8px; font-size: 13px; box-shadow: none; }
  .sheet-handle { height: 36px; font: 600 12.5px var(--text); letter-spacing: .02em; color: var(--mist); }
  .sheet-handle i { top: 5px; width: 30px; height: 3px; margin-left: -15px; }
  .sheet-handle span { margin-top: 6px; }
  .inspector { transform: translateY(calc(100% - 36px)); border-radius: 12px 12px 0 0; }
  .ed-main { padding-bottom: 36px; }
  .smart { border-radius: 8px; }
  .smart button { padding: 6px 9px; font-size: 12.5px; border-radius: 6px; }
}
@media (max-width: 400px) {
  .seg button { padding: 6px 8px; }
  .ed-tools .menu-btn { padding: 0 9px; }
}
@media (max-width: 400px) { .seg button { padding: 6px 6px; } .ed-tools { gap: 4px; } }

/* the semitone step buttons on the note bar */
.smart .sm-step { min-width: 34px; font-size: 12px; }
@media (max-width: 860px) { .smart .sm-step { min-width: 40px; } }
@media (max-width: 860px) {
  .smart { flex-wrap: wrap; max-width: calc(100% - 56px); }
  .sheet-handle span { color: var(--paper); }
}

/* Cycle (loop) button */
.loop-btn { display: inline-grid; place-items: center; padding: 0 9px; }
.loop-btn svg { display: block; }
.ab-btn.loop-btn[aria-pressed="true"] { background: var(--sky, #46b8f0); color: #0b1620; }
@media (max-width: 400px) { .loop-btn { padding: 0 7px; } }


/* page buttons: jump to the next / previous piece without pinching; the time window in the corner */
.pg { position: absolute; top: 50%; transform: translateY(-50%); z-index: 3; width: 46px; height: 78px; border: 0; border-radius: 14px;
  background: rgba(10,10,20,.42); color: #fff; font: 600 34px/1 system-ui, sans-serif; cursor: pointer; display: flex; align-items: center; justify-content: center;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); box-shadow: inset 0 0 0 1px rgba(255,255,255,.14); touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.pg:active { background: rgba(10,10,20,.7); }
.pg:disabled { opacity: .25; }
.pg-prev { left: 50px; } .pg-next { right: 6px; }
.pg-label { position: absolute; right: 8px; top: 28px; z-index: 3; font: 500 11px/1 ui-monospace, monospace; color: #fff; background: rgba(10,10,20,.45); padding: 4px 7px; border-radius: 7px; pointer-events: none; }
.pg-label:empty { display: none; }
@media (hover: hover) and (pointer: fine) { .pg { width: 34px; height: 56px; font-size: 26px; opacity: .55; } .pg:hover { opacity: 1; } }
/* "earlier edits are saved — bring back" */
.restore-bar { position: absolute; z-index: 4; left: 50%; top: 32px; transform: translateX(-50%); display: flex; align-items: center; gap: 8px; max-width: calc(100% - 70px);
  padding: 6px 6px 6px 12px; border-radius: 12px; background: rgba(14,12,28,.9); box-shadow: 0 0 0 1px rgba(255,255,255,.12), 0 8px 24px rgba(0,0,0,.35); color: #fff; font-size: 13px; }
.restore-bar[hidden] { display: none; }
.restore-bar span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; opacity: .85; }
.restore-bar button { flex: none; border: 0; border-radius: 8px; padding: 7px 10px; font: 600 13px inherit; cursor: pointer; background: var(--sun); color: #160f22; }
.restore-bar #restoreX { background: none; color: #fff; opacity: .7; font-size: 18px; padding: 4px 8px; }
.menu-check.ref-style select { margin-left: auto; background: var(--night-3); color: var(--paper); border: 1px solid var(--line); border-radius: 8px; padding: 4px 6px; font: inherit; }
@media (max-width: 860px) {
  /* on a phone the note actions sit in one strip at the bottom of the roll, never over the notes */
  .smart.dock { left: 50px !important; right: 6px; max-width: none; flex-wrap: nowrap; top: auto !important; bottom: 6px; overflow-x: auto; scrollbar-width: none; flex-wrap: nowrap; }
  .smart.dock::-webkit-scrollbar { display: none; }
  .smart.dock button { flex: none; }
  .pg { width: 36px; height: 56px; font-size: 26px; top: auto; bottom: 58px; transform: none; opacity: .6; background: rgba(10,10,20,.3); }
  .pg-label { top: 30px; opacity: .8; }
}
@media (max-width: 860px) {
  /* phone: messages are a small line in the bottom corner of the roll, never a bubble over the notes */
  .toast { left: 52px; right: auto; bottom: 6px; top: auto; transform: none; max-width: calc(100% - 120px); padding: 3px 8px;
    font-size: 11.5px; line-height: 1.3; border: 0; border-radius: 6px; background: rgba(10,10,20,.55); box-shadow: none;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none; }
  .toast.show { opacity: .8; }
}
/* phone held sideways: the transport and the tools share ONE slim row, so the notes get the height */
@media (max-width: 960px) and (orientation: landscape) {
  .ed { grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
  .ed > .ed-top { grid-column: 1; grid-row: 1; padding: 4px 6px 4px 10px; gap: 6px; border-bottom: 1px solid var(--line); }
  .ed > .ed-tools { grid-column: 2; grid-row: 1; padding: 4px 10px 4px 4px; gap: 6px; border-bottom: 1px solid var(--line); justify-content: flex-start; }
  .ed > .ed-main { grid-column: 1 / -1; grid-row: 2; }
  .ed > .ed-help { display: none; }
  .ed-top .brand, .ed-top::after { display: none; }
  .ed-top .ed-actions { margin-left: 0; }
  .round { width: 30px; height: 30px; }
  .seg button { padding: 4px 8px; }
  .ed-tools .menu-btn { height: 30px; }
  .sheet-handle { height: 28px; }
  .sheet-handle i { top: 3px; }
  .sheet-handle span { margin-top: 4px; font-size: 12px; }
  .inspector { transform: translateY(calc(100% - 28px)); }
  .ed-main { padding-bottom: 28px; }
}
/* the studio's own layout for the play button (set on the layout board):
   upright — a tab on the left edge, a little below the middle; sideways — a tall strip down the whole left edge */
@media (max-width: 860px) and (orientation: portrait) {
  #play.round { position: fixed; left: 0; top: 45%; width: 14vw; height: 5vh; min-width: 50px; min-height: 42px; z-index: 30;
    border-radius: 0 14px 14px 0; box-shadow: 0 6px 18px rgba(0,0,0,.35); }
  #play.round svg { width: 22px; height: 22px; }
}
@media (max-width: 960px) and (orientation: landscape) {
  #play.round { position: fixed; left: 1vw; top: 1vh; width: 4vw; height: 96vh; min-width: 30px; z-index: 30; border-radius: 10px;
    box-shadow: 0 6px 18px rgba(0,0,0,.35); }
  #play.round svg { width: 22px; height: 22px; }
  .ed > .ed-top { padding-left: calc(5vw + 6px); }
}
/* the song map strip (phones only) */
#mini { display: none; }
@media (max-width: 960px) {
  .roll-wrap { display: flex; flex-direction: column; }
  #mini { display: block; flex: none; width: 100%; height: 22px; touch-action: none; cursor: pointer; border-bottom: 1px solid var(--line); }
  #roll { flex: 1 1 auto; min-height: 0; height: auto; }
  .pg-label { top: 52px; }
}
/* versions in the Auto menu */
.ver-list { display: grid; gap: 2px; }
.ver-row { display: flex; align-items: center; gap: 4px; }
.ver-row .ver-go { flex: 1; text-align: left; background: none; border: 0; color: var(--paper); font: 500 13.5px var(--text); padding: 8px 12px; border-radius: 7px; cursor: pointer; font-variant-numeric: tabular-nums; }
.ver-row .ver-go:hover { background: var(--night-3); }
.ver-row .ver-del { background: none; border: 0; color: var(--mist); font-size: 18px; width: 34px; height: 34px; border-radius: 7px; cursor: pointer; }
.ver-row .ver-del:hover { background: var(--night-3); color: var(--paper); }


/* phone, 8 tools in the row: the menu buttons drop their arrows and get tighter, so everything fits on 390 px */
@media (max-width: 430px) {
  #autoBtn svg, #viewBtn > svg { display: none; }
  #autoBtn, #viewBtn { padding-inline: 10px; }
}
