/* (11-20) Grey's singing editor: one component for the studio (site/studio/, Sing view) and the website (sing.html).
   Colours come from the host page's tokens (--bg, --panel, --ink, --accent ...) with fallbacks of its own.
   (11-21 v2, Designer) two views: Simple (lyrics, singer, mood, length, speed, Sing: the default, and all a phone
   shows) and Edit notes (the piano roll). The sliders are the site's: a filled track up to a round thumb (--p, set by
   sing.js), here bigger and easier to grab. Nothing changes size under the pointer when it is pressed. */
.gsing { --s-bg: var(--bg, #111214); --s-panel: var(--panel, #17181b); --s-panel2: var(--panel2, #1d1f23);
  --s-raise: var(--raise, #24262b); --s-line: var(--line, #2a2c31); --s-line2: var(--line2, #34373d);
  --s-ink: var(--ink, #e8e8ea); --s-ink2: var(--ink2, #b4b5ba); --s-muted: var(--muted, #7d7f86);
  --s-accent: var(--accent, #e5322d); --s-accent2: var(--accent2, #ff5a52); --s-sel: var(--sel, rgba(229, 50, 45, .14));
  display: flex; flex-direction: column; min-height: 0; color: var(--s-ink); font: 14px/1.45 var(--sans, system-ui, sans-serif); }
.gsing.gs-is-edit { height: 100%; }
.gsing.gs-is-simple { overflow-y: auto; }
.gsing * { box-sizing: border-box; }
.gsing .hidden { display: none !important; }
/* (:where: as weak as the host page's own resets, so every button's colour below wins) */
:where(.gsing) :is(button, select, input, textarea) { font: inherit; color: inherit; margin: 0; }
:where(.gsing) button { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.gsing :focus-visible { outline: 2px solid var(--s-accent); outline-offset: 2px; }
.gsing svg { stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* fields: the component's own look (host pages style every field; these win inside it) */
.gsing select, .gsing input[type="text"], .gsing input[type="number"], .gsing textarea { width: auto; min-height: 0; background: var(--s-panel2);
  border: 1px solid var(--s-line2); border-radius: 8px; padding: 5px 8px; color: var(--s-ink); font-size: 13px; line-height: 1.4; }
.gsing select { cursor: pointer; }
.gsing :is(select, input, textarea):focus { outline: none; border-color: var(--s-accent); }
.gsing :is(select, input, textarea):focus-visible { outline: none; border-color: var(--s-accent); box-shadow: 0 0 0 3px var(--s-sel); }

/* buttons */
.gs-btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 34px; padding: 6px 12px; border-radius: 9px;
  border: 1px solid var(--s-line2); background: var(--s-raise); color: var(--s-ink); cursor: pointer; white-space: nowrap; font-size: 13.5px;
  text-decoration: none; }
.gs-btn:hover { border-color: var(--s-muted); }
.gs-btn:disabled { opacity: .5; cursor: default; }
.gs-btn.primary { background: var(--s-accent); border-color: var(--s-accent); color: #fff; font-weight: 600; }
.gs-btn.primary:hover { background: var(--s-accent2); border-color: var(--s-accent2); }
.gs-btn svg { width: 16px; height: 16px; flex: none; }
.gs-btn.icon { padding: 6px 8px; }
.gs-link { border: 0; background: none; padding: 0; color: var(--s-accent); cursor: pointer; font-size: 13px; font-weight: 500; text-decoration: underline;
  text-underline-offset: 2px; text-decoration-thickness: 1px; }
.gs-link:hover { color: var(--s-accent2); }
.gs-err { color: #d93a36; font-size: 13px; line-height: 1.45; padding: 9px 12px; border: 1px solid rgba(239, 83, 80, .55); border-radius: 10px;
  background: rgba(239, 83, 80, .08); }

/* ================= Simple ================= */
.gs-simple { width: 100%; max-width: 1100px; }
.gs-s-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 360px); gap: 24px 28px; align-items: stretch; }
.gs-s-words { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.gs-s-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 26px; }
.gs-s-name { font-weight: 600; font-size: 14.5px; color: var(--s-ink); }
.gs-s-sub { font-size: 12.5px; color: var(--s-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gsing .gs-s-words textarea { flex: 1 1 auto; width: 100%; min-height: 260px; resize: vertical; padding: 16px 18px; border-radius: 14px;
  border: 1px solid var(--s-line2); background: var(--s-panel2); font-size: 17px; line-height: 1.65; }
.gs-s-note { font-size: 12.5px; color: var(--s-muted); min-height: 18px; }
.gs-s-note.warn { color: #d93a36; }
.gs-s-side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.gs-s-f { display: flex; flex-direction: column; gap: 8px; }
.gsing .gs-s-head select { padding: 3px 8px; border-radius: 999px; font-size: 13px; }

/* singers: one card each (name + what it sounds like) */
.gs-chips { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 8px; min-height: 52px; }
.gs-chip { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 1px; min-height: 52px; padding: 7px 12px;
  border-radius: 12px; border: 1px solid var(--s-line2); background: var(--s-panel2); cursor: pointer; text-align: left; }
.gs-chip b { font-size: 14px; font-weight: 600; }
.gs-chip small { font-size: 12px; color: var(--s-muted); line-height: 1.3; }
.gs-chip:hover, .gs-mood:hover { border-color: var(--s-muted); }
.gs-chip[aria-checked="true"] { border-color: var(--s-ink); box-shadow: inset 0 0 0 1px var(--s-ink); }

/* moods: four tiles with a little picture, tinted in their colour when picked */
.gs-moods { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.gs-mood { --mc: var(--s-ink2); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 66px;
  padding: 8px 4px; border-radius: 12px; border: 1px solid var(--s-line2); background: var(--s-panel2); cursor: pointer; font-size: 13.5px; }
.gs-mood svg { width: 24px; height: 24px; stroke: var(--mc); }
.gs-mood[data-v="happy"] { --mc: #e0940b; }
.gs-mood[data-v="calm"] { --mc: #1f95c6; }
.gs-mood[data-v="sad"] { --mc: #6574d6; }
.gs-mood[data-v="epic"] { --mc: #b047d0; }
.gs-mood[aria-checked="true"] { border-color: var(--mc); box-shadow: inset 0 0 0 1px var(--mc); font-weight: 600;
  background: color-mix(in srgb, var(--mc) 12%, var(--s-panel2)); }

/* length, speed: a segmented switch */
.gs-seg2 { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 2px; padding: 3px; border-radius: 12px; background: var(--s-raise);
  border: 1px solid var(--s-line); }
.gs-seg2 button { min-height: 36px; padding: 6px 4px; border: 0; border-radius: 9px; background: transparent; color: var(--s-ink2); cursor: pointer; font-size: 13.5px; }
.gs-seg2 button:hover { color: var(--s-ink); }
.gs-seg2 button[aria-checked="true"] { background: var(--s-panel2); color: var(--s-ink); font-weight: 600; box-shadow: 0 1px 3px rgba(0, 0, 0, .14), 0 0 0 1px var(--s-line); }

.gs-s-edited { font-size: 13px; line-height: 1.45; padding: 9px 12px; border-radius: 10px; background: var(--s-sel); color: var(--s-ink2); }

/* Sing: one big button that fills up as the take is made */
.gs-go { position: relative; overflow: hidden; display: flex; align-items: center; justify-content: center; width: 100%; min-height: 56px; margin-top: 2px;
  padding: 0 16px; border: 0; border-radius: 14px; background: var(--s-accent); color: #fff; font-size: 17px; font-weight: 600; cursor: pointer;
  box-shadow: 0 2px 10px rgba(200, 36, 31, .25); }
.gs-go:hover { background: var(--s-accent2); }
.gs-go:active { transform: translateY(1px); }
.gs-go > i { position: absolute; inset: 0 auto 0 0; width: var(--prog, 0%); background: rgba(255, 255, 255, .22); transition: width .3s ease; pointer-events: none; }
.gs-go > span { position: relative; display: inline-flex; align-items: center; gap: 10px; }
.gs-go svg { width: 18px; height: 18px; }
.gs-go.busy { cursor: progress; }
.gs-go.busy:hover { background: var(--s-accent); }
.gs-s-stat { min-height: 18px; margin-top: -8px; font-size: 12.5px; color: var(--s-muted); text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gs-s-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: -4px; }
.gs-s-row .gs-btn { min-height: 42px; border-radius: 11px; }
.gs-s-row .gs-btn { white-space: normal; line-height: 1.2; text-align: left; }
.gs-simple .gs-slot { margin-top: -4px; }
.gs-simple .gs-slot:has(> .gs-takes:empty) { display: none; }
.gs-older { align-self: flex-start; margin-top: -8px; }

/* ================= takes: play, waveform (click to jump), time, Download ================= */
.gs-takes { display: flex; flex-direction: column; gap: 8px; }
.gs-takes:empty { display: none; }
.gs-take { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 12px 14px; border: 1px solid var(--s-line);
  border-radius: 14px; background: var(--s-panel); }
.gs-take.on { border-color: var(--s-line2); }
.gs-tplay { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; border: 0; background: var(--s-ink); color: var(--s-bg); cursor: pointer; flex: none; }
.gs-tplay svg { width: 18px; height: 18px; fill: currentColor; stroke: none; }
.gs-tplay:hover { opacity: .88; }
.gs-tmain { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.gs-ttop { display: flex; align-items: baseline; gap: 12px; min-width: 0; }
.gs-ttitle { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14.5px; font-weight: 600; }
.gs-ttime { flex: none; font: 12px var(--mono, ui-monospace, monospace); color: var(--s-muted); font-variant-numeric: tabular-nums; }
.gs-twave { display: block; width: 100%; height: 34px; cursor: pointer; touch-action: pan-y; }
.gs-tmeta { display: flex; flex-wrap: wrap; gap: 2px 12px; font-size: 12px; color: var(--s-muted); }
.gs-ai::before { content: ""; display: inline-block; width: 6px; height: 6px; margin: 0 5px 1px 0; border-radius: 50%; background: var(--s-accent); vertical-align: middle; }
.gs-tdl { min-height: 38px; border-radius: 10px; }

/* ================= Edit notes ================= */
.gs-adv { flex: 1 1 auto; min-height: 0; display: grid; grid-template-rows: auto auto minmax(0, 1fr) auto; gap: 10px; }
.gs-bar { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.gs-bar .sep { width: 1px; height: 22px; background: var(--s-line); }
.gs-f { display: inline-flex; align-items: center; gap: 6px; color: var(--s-muted); font-size: 12.5px; }
.gs-f input[type="number"] { width: 64px; }
.gs-bar .gs-right { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-left: auto; }
.gs-bar [data-r="preview"] { min-width: 92px; }
.gs-gob { position: relative; overflow: hidden; min-width: 104px; }
.gs-gob > i { position: absolute; inset: 0 auto 0 0; width: var(--prog, 0%); background: rgba(255, 255, 255, .22); transition: width .3s ease; pointer-events: none; }
.gs-gob > svg, .gs-gob > span { position: relative; }
/* what is happening and what went wrong float under the toolbar's right end: nothing below moves when they come */
.gs-toast { position: absolute; z-index: 6; top: calc(100% + 6px); right: 0; display: flex; flex-direction: column; align-items: flex-end; gap: 6px;
  max-width: min(560px, 100%); pointer-events: none; }
.gs-toast .gs-stat { font-size: 12.5px; color: var(--s-ink2); background: var(--s-panel2); border-radius: 8px; padding: 0 8px; }
.gs-toast .gs-stat:empty { display: none; }
.gs-toast .gs-err { pointer-events: auto; cursor: pointer; background: var(--s-panel2); box-shadow: 0 6px 18px rgba(0, 0, 0, .18);
  background-image: linear-gradient(rgba(239, 83, 80, .1), rgba(239, 83, 80, .1)); }

/* Song menu (time, key, seed, chords, MIDI, remove all) */
.gs-more { position: relative; }
.gs-more > summary { list-style: none; }
.gs-more > summary::-webkit-details-marker { display: none; }
.gs-more > summary .chev { width: 14px; height: 14px; transition: transform .15s; }
.gs-more[open] > summary .chev { transform: rotate(180deg); }
.gs-menu { position: absolute; z-index: 8; right: 0; top: calc(100% + 6px); display: grid; gap: 10px; width: 280px; padding: 14px; border-radius: 12px;
  border: 1px solid var(--s-line2); background: var(--s-panel2); box-shadow: 0 12px 32px rgba(0, 0, 0, .22); }
.gs-mf { display: grid; grid-template-columns: 70px minmax(0, 1fr); align-items: center; gap: 10px; font-size: 13px; color: var(--s-ink2); }
.gsing .gs-mf :is(select, input) { width: 100%; }
.gs-mrow { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.gs-danger { color: #d93a36; }

/* lyrics row */
.gs-ly { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: stretch; }
.gsing .gs-ly textarea { width: 100%; min-height: 64px; max-height: 200px; resize: vertical; padding: 8px 10px; border-radius: 10px; font-size: 14px; line-height: 1.5; }
.gs-lyside { display: flex; flex-direction: column; gap: 6px; width: 260px; }
.gs-lyopts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
.gsing .gs-lyopts select { width: 100%; font-size: 12px; padding: 4px 4px; }

/* roll + note panel */
.gs-ed { display: grid; grid-template-columns: minmax(0, 1fr) 250px; grid-template-rows: minmax(0, 1fr); gap: 10px; min-height: 260px; }
.gs-roll { position: relative; border: 1px solid var(--s-line); border-radius: 10px; overflow: hidden; background: var(--s-panel); min-height: 260px; }
.gs-roll canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: crosshair; touch-action: none; }
.gs-roll .gs-empty { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); text-align: center; color: var(--s-muted); pointer-events: none;
  max-width: 440px; font-size: 13px; }
.gs-roll .gs-empty b { color: var(--s-ink2); display: block; font-size: 15px; margin-bottom: 4px; }
.gs-roll .gs-empty em { font-style: normal; font-weight: 600; color: var(--s-ink2); }
.gsing .gs-lyedit { position: absolute; z-index: 3; width: 110px; padding: 1px 5px; border: 1px solid var(--s-accent); border-radius: 5px;
  background: var(--s-panel2); color: var(--s-ink); font-size: 12px; outline: none; }
.gs-insp { display: flex; flex-direction: column; gap: 10px; padding: 12px 14px; border: 1px solid var(--s-line); border-radius: 10px; background: var(--s-panel);
  overflow: auto; overscroll-behavior: contain; }
.gs-ih { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.gs-insp h4 { margin: 0; font-size: 14px; font-weight: 600; color: var(--s-ink); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gs-insp h4 q { quotes: "\201C" "\201D"; }
.gs-inote { font: 600 12px var(--mono, ui-monospace, monospace); color: var(--s-ink2); background: var(--s-raise); border-radius: 6px; padding: 1px 7px; }
.gs-lyf { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--s-muted); }
.gsing .gs-lyf input { width: 100%; font-size: 14px; padding: 6px 9px; }
.gs-ibtns { display: flex; flex-wrap: wrap; gap: 6px; }
.gs-ibtns .gs-btn { min-height: 32px; padding: 4px 10px; font-size: 13px; }
.gs-insp .gs-help { color: var(--s-muted); font-size: 12px; line-height: 1.5; }
.gs-insp kbd { font: 11px var(--mono, monospace); border: 1px solid var(--s-line2); border-radius: 4px; padding: 0 4px; color: var(--s-ink2); }

/* the panel's folding groups */
.gs-sec { border-top: 1px solid var(--s-line); }
.gs-sec > summary { list-style: none; display: flex; align-items: center; gap: 8px; min-height: 38px; cursor: pointer; font-size: 13.5px; font-weight: 600; color: var(--s-ink); }
.gs-sec > summary::-webkit-details-marker { display: none; }
.gs-sec > summary .chev { width: 16px; height: 16px; margin-left: auto; color: var(--s-muted); transition: transform .15s; }
.gs-sec[open] > summary .chev { transform: rotate(180deg); }
.gs-badge { font-size: 11.5px; font-weight: 600; color: var(--s-accent); background: var(--s-sel); border-radius: 999px; padding: 1px 8px; }
.gs-secb { display: flex; flex-direction: column; gap: 12px; padding: 2px 0 12px; }

/* sliders: name and value on one line (the value in a readable pill), the track under it */
.gs-sl { display: flex; flex-direction: column; gap: 0; }
.gs-sl.off { opacity: .5; }
.gs-slh { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--s-ink2); }
.gs-slh b { min-width: 52px; padding: 1px 7px; border-radius: 6px; background: var(--s-raise); color: var(--s-ink); text-align: center;
  font: 600 12px var(--mono, ui-monospace, monospace); font-variant-numeric: tabular-nums; }
.gs-rng { position: relative; touch-action: pan-y; cursor: pointer; -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; }
.gs-sl.off .gs-rng { cursor: default; }
.gsing input[type="range"] { -webkit-appearance: none; appearance: none; display: block; width: 100%; height: 30px; margin: 0; padding: 0; border: 0;
  background: transparent; cursor: pointer; touch-action: pan-y; accent-color: var(--s-ink); pointer-events: none; }
.gsing input[type="range"]::-webkit-slider-runnable-track { height: 6px; border-radius: 3px;
  background: linear-gradient(var(--s-ink), var(--s-ink)) 0 / var(--p, 50%) 100% no-repeat, var(--s-line2); }
.gsing input[type="range"]::-moz-range-track { height: 6px; border-radius: 3px; background: var(--s-line2); }
.gsing input[type="range"]::-moz-range-progress { height: 6px; border-radius: 3px; background: var(--s-ink); }
.gsing input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; margin-top: -8px; border-radius: 50%;
  background: var(--s-panel2); border: 2px solid var(--s-ink); box-shadow: 0 1px 4px rgba(0, 0, 0, .22); }
.gsing input[type="range"]::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: var(--s-panel2); border: 2px solid var(--s-ink); }
.gsing input[type="range"]:hover::-webkit-slider-thumb { box-shadow: 0 0 0 5px var(--s-sel), 0 1px 4px rgba(0, 0, 0, .22); }
.gsing input[type="range"]:active::-webkit-slider-thumb, .gsing input[type="range"]:focus-visible::-webkit-slider-thumb { border-color: var(--s-accent);
  box-shadow: 0 0 0 6px var(--s-sel); }
.gsing input[type="range"]:active::-moz-range-thumb, .gsing input[type="range"]:focus-visible::-moz-range-thumb { border-color: var(--s-accent); }
.gsing input[type="range"]:focus-visible { outline: none; }
.gsing input[type="range"]:disabled { cursor: default; }

/* Notes | Fine pitch switch */
.gs-seg { display: inline-flex; border: 1px solid var(--s-line2); border-radius: 9px; overflow: hidden; }
.gs-seg button { border: 0; background: var(--s-raise); color: var(--s-ink2); min-height: 32px; padding: 5px 11px; cursor: pointer; font-size: 13px; }
.gs-seg button + button { border-left: 1px solid var(--s-line2); }
.gs-seg button.on { background: var(--s-sel); color: var(--s-ink); font-weight: 600; }

/* vibrato dials (Fine pitch) */
.gs-dials { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.gs-dial { display: flex; flex-direction: column; align-items: center; gap: 1px; cursor: ns-resize; user-select: none; touch-action: none; }
.gs-dial svg { width: 46px; height: 46px; }
.gs-dial .tr { fill: none; stroke: var(--s-line2); stroke-width: 4; stroke-linecap: round; }
.gs-dial .val { fill: none; stroke: var(--s-accent); stroke-width: 4; stroke-linecap: round; }
.gs-dial circle { fill: var(--s-raise); stroke: var(--s-line2); }
.gs-dial line { stroke: var(--s-ink); stroke-width: 2.2; stroke-linecap: round; }
.gs-dial b { font-size: 11.5px; color: var(--s-ink); font-weight: 600; }
.gs-dial span { font-size: 11px; color: var(--s-muted); }
.gs-dial.off { opacity: .45; cursor: default; }
.gs-dial:hover circle { stroke: var(--s-muted); }
.gs-vibpop { position: absolute; z-index: 4; width: 196px; padding: 6px 6px 4px; border-radius: 9px; background: var(--s-panel2);
  border: 1px solid var(--s-accent); box-shadow: 0 6px 18px rgba(0, 0, 0, .35); }
.gs-vibpop::after { content: ""; position: absolute; left: var(--tip, 50%); bottom: -6px; width: 10px; height: 10px; margin-left: -5px;
  background: var(--s-panel2); border-right: 1px solid var(--s-accent); border-bottom: 1px solid var(--s-accent); transform: rotate(45deg); }
.gs-vibpop.below::after { bottom: auto; top: -6px; transform: rotate(225deg); }
.gs-vibpop .gs-dial svg { width: 36px; height: 36px; }
.gs-vibpop .gs-dial b { font-size: 10.5px; }
.gs-vibpop .gs-dial span { font-size: 10px; }

/* the takes under the roll: smaller, two in view */
.gs-is-edit .gs-takes { max-height: 152px; overflow: auto; overscroll-behavior: contain; }
.gs-is-edit .gs-take { padding: 8px 12px; gap: 12px; }
.gs-is-edit .gs-tplay { width: 38px; height: 38px; }
.gs-is-edit .gs-twave { height: 26px; }

/* touch screens: the hints talk about taps, bigger targets */
.gsing .gs-touch { display: none; }
@media (hover: none) and (pointer: coarse) {
  .gsing .gs-touch { display: inline; }
  .gsing .gs-mouse { display: none; }
  .gs-roll { min-height: 340px; }
  .gs-btn, .gs-seg button { min-height: 40px; }
  .gsing input[type="range"] { height: 40px; }
  .gsing input[type="range"]::-webkit-slider-thumb { width: 28px; height: 28px; margin-top: -11px; }
  .gsing input[type="range"]::-moz-range-thumb { width: 24px; height: 24px; }
}

/* narrower screens */
@media (max-width: 900px) {
  .gs-s-grid { grid-template-columns: minmax(0, 1fr) minmax(280px, 320px); gap: 20px; }
  .gs-ed { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto; }
  .gs-ly { grid-template-columns: minmax(0, 1fr); }
  .gs-lyside { width: auto; }
  .gs-insp { overflow: visible; }
}
/* phones: Simple only, one column */
@media (max-width: 699px) {
  .gs-s-grid { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .gsing .gs-s-words textarea { min-height: 170px; font-size: 16px; padding: 14px 15px; }
  .gs-go { min-height: 58px; }
  .gs-take { grid-template-columns: auto minmax(0, 1fr); gap: 10px 12px; padding: 12px; }
  .gs-tdl { grid-column: 1 / -1; }
}

/* ================= v3 (11-21, Solver) ================= */
/* Simple: the newest take sits right under Sing (nothing scrolls the page to it); earlier ones fold away */
.gs-is-simple .gs-takes:not(.gs-allt) > .gs-take:nth-child(n+2) { display: none; }
.gs-is-simple .gs-take { grid-template-columns: auto minmax(0, 1fr); gap: 10px 12px; padding: 12px; }
.gs-is-simple .gs-tdl { grid-column: 1 / -1; }
/* the lyrics box is as tall as its words (sing.js growLyrics): the page scrolls, not a box inside it */
.gsing .gs-s-words textarea { overflow: hidden; resize: none; }

/* the note panel's one-line hint (phones, nothing chosen) */
.gs-dockhint { display: none; }
.gs-bar2, .gs-sheeth, .gs-scrim { display: none; }
.gs-tools { display: contents; }

/* the melody editor fills the window on the website (the page behind cannot scroll: see also sing-page.css) */
html.gs-editing-full, html.gs-editing-full body { overflow: hidden !important; overscroll-behavior: none; }

/* ---- phones and small tablets, on a host marked data-full: the editor takes the whole screen ---- */
.gsing.gs-compact.gs-is-edit { position: fixed; inset: 0; z-index: 400; height: auto; background: var(--s-bg); padding: 8px 10px;
  padding-bottom: max(8px, env(safe-area-inset-bottom)); }
.gs-compact .gs-adv { display: flex; flex-direction: column; gap: 8px; min-height: 0; }
.gs-compact .gs-bar { flex: none; flex-wrap: nowrap; gap: 6px; }
.gs-compact .gs-bar .sep { display: none; }
.gs-compact .gs-bar .gs-right { flex-wrap: nowrap; gap: 6px; }
.gs-compact .gs-bar .gs-btn { min-height: 44px; min-width: 44px; padding: 6px 10px; }
.gs-compact .gs-bar [data-r="toSimple"] span, .gs-compact .gs-bar [data-r="more"] > summary span, .gs-compact .gs-bar [data-r="more"] > summary .chev { display: none; }
.gs-compact .gs-bar [data-r="preview"] { min-width: 0; }
.gs-compact .gs-bar .gs-gob { min-width: 96px; font-size: 15px; }
.gs-compact .gs-bar2 { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.gs-compact .gs-seg button { min-height: 40px; padding: 6px 16px; font-size: 14px; }
.gs-zoom { display: inline-flex; gap: 6px; }
.gs-compact .gs-zoom .gs-btn { min-height: 40px; min-width: 44px; }
.gs-compact .gs-ed { display: contents; }
.gs-compact .gs-roll { flex: 1 1 0; min-height: 150px; }
.gs-compact .gs-roll .gs-empty { width: 86%; font-size: 14px; }
.gs-compact .gs-slot { flex: none; }
.gs-compact.gs-is-edit .gs-takes { max-height: 70px; }
.gs-compact.gs-is-edit .gs-take { grid-template-columns: auto minmax(0, 1fr) auto; padding: 6px 10px; }
.gs-compact.gs-is-edit .gs-tmeta { display: none; }
.gs-compact.gs-is-edit .gs-tdl span { display: none; }
/* the dock: the chosen note's word, buttons and folding slider groups; it scrolls inside itself, never the page */
.gs-compact .gs-insp { flex: none; max-height: 46%; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding: 10px 12px; gap: 8px; }
.gs-compact .gs-insp.gs-all .gs-ih, .gs-compact .gs-insp.gs-all .gs-allhelp, .gs-compact .gs-insp.gs-all .gs-sec { display: none; }
.gs-compact .gs-insp.gs-all .gs-dockhint { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 13.5px; color: var(--s-ink2); }
.gs-compact .gs-insp .gs-lyf { flex-direction: row; align-items: center; gap: 10px; }
.gs-compact .gs-insp .gs-lyf span { flex: none; }
.gsing.gs-compact .gs-lyf input { font-size: 16px; min-height: 40px; }
.gs-compact .gs-ibtns .gs-btn { min-height: 42px; min-width: 46px; font-size: 14px; }
.gs-compact .gs-sec > summary { min-height: 46px; font-size: 14.5px; }
.gs-compact .gs-secb { gap: 16px; }
.gs-compact .gs-slh { font-size: 14px; }
/* the Song sheet: singer, tempo, snap, the lyrics and Write a melody, time, key, seed, chords, MIDI */
.gs-compact .gs-more { position: static; }
.gs-compact .gs-more[open] .gs-scrim { display: block; position: fixed; inset: 0; z-index: 7; background: rgba(0, 0, 0, .45); }
.gs-compact .gs-menu { position: fixed; left: 0; right: 0; bottom: 0; top: auto; width: auto; max-height: 86%; overflow-y: auto; overscroll-behavior: contain;
  border-radius: 18px 18px 0 0; border-width: 1px 0 0; padding: 12px 16px max(18px, env(safe-area-inset-bottom)); gap: 14px; }
.gs-compact .gs-sheeth { display: flex; align-items: center; justify-content: space-between; position: sticky; top: -12px; z-index: 1; margin: -12px -16px 0; padding: 10px 16px;
  background: var(--s-panel2); border-bottom: 1px solid var(--s-line); font-size: 16px; }
.gs-compact .gs-menutop { display: grid; gap: 14px; }
.gs-compact .gs-tools { display: grid; gap: 10px; }
.gs-compact .gs-tools .gs-f, .gs-compact .gs-mf { display: grid; grid-template-columns: 76px minmax(0, 1fr); align-items: center; gap: 10px; font-size: 14px; color: var(--s-ink2); }
.gsing.gs-compact .gs-menu :is(select, input[type="text"], input[type="number"]) { width: 100%; min-height: 44px; font-size: 16px; }
.gs-compact .gs-ly { grid-template-columns: minmax(0, 1fr); gap: 8px; padding-top: 12px; border-top: 1px solid var(--s-line); }
.gsing.gs-compact .gs-ly textarea { min-height: 110px; font-size: 16px; }
.gs-compact .gs-lyside { width: auto; gap: 8px; }
.gs-compact .gs-lyside .gs-btn, .gs-compact .gs-mrow .gs-btn, .gs-compact .gs-menu > .gs-btn { min-height: 46px; font-size: 14.5px; }
.gsing.gs-compact .gs-lyopts select { font-size: 15px; min-height: 42px; }
.gs-compact .gs-toast { top: calc(100% + 4px); left: 0; right: 0; align-items: stretch; max-width: none; }

/* fingers: sliders with a thumb you can hold, a taller track to land on */
@media (pointer: coarse) {
  .gs-rng { padding: 4px 0; }
  .gsing input[type="range"] { height: 44px; }
  .gsing input[type="range"]::-webkit-slider-runnable-track { height: 8px; border-radius: 4px; }
  .gsing input[type="range"]::-moz-range-track, .gsing input[type="range"]::-moz-range-progress { height: 8px; border-radius: 4px; }
  .gsing input[type="range"]::-webkit-slider-thumb { width: 30px; height: 30px; margin-top: -11px; }
  .gsing input[type="range"]::-moz-range-thumb { width: 26px; height: 26px; }
  .gs-dial svg { width: 54px; height: 54px; }
  .gs-vibpop { width: 236px; }
  .gs-vibpop .gs-dial svg { width: 46px; height: 46px; }
}
.gs-compact .gs-ly::before { content: "Lyrics"; font-size: 14px; font-weight: 600; color: var(--s-ink); }
/* a phone on its side: little height, so the take strip steps aside and the dock stays low */
@media (max-height: 480px) {
  .gsing.gs-compact.gs-is-edit { padding-top: 6px; }
  .gs-compact .gs-adv { gap: 6px; }
  .gs-compact.gs-is-edit .gs-slot { display: none; }
  .gs-compact .gs-roll { min-height: 90px; }
  .gs-compact .gs-insp { max-height: 42%; padding: 8px 10px; }
}

/* ================= Grey Studio desk (11-21, you: "GUI can be desktop based and look more sophisticated") =================
   One workspace like a music program: transport bar on top, song panel left, piano roll in the middle, the note's
   controls right, takes along the bottom. Only on a host marked data-desk (Grey Studio's Sing view). */
.gsing.gs-desk { position: relative; height: 100%; overflow: hidden; }
.gs-desk .gs-simple { display: none !important; }
.gs-desk .gs-adv { height: 100%; gap: 0; grid-template-columns: 284px minmax(0, 1fr) 268px; grid-template-rows: auto minmax(0, 1fr) auto;
  grid-template-areas: "bar bar bar" "side roll insp" "side slot insp"; border: 1px solid var(--s-line2); border-radius: 12px; overflow: hidden;
  background: var(--s-bg); box-shadow: 0 1px 0 rgba(255, 255, 255, .03) inset, 0 10px 30px rgba(0, 0, 0, .18); }
.gs-desk .gs-ed { display: contents; }
.gs-desk .gs-bar2, .gs-desk .gs-bar > .sep.hidden { display: none; }
.gs-desk .gs-bar { grid-area: bar; flex-wrap: nowrap; gap: 6px; padding: 8px 10px; min-height: 54px; border-bottom: 1px solid var(--s-line2);
  background: linear-gradient(180deg, var(--s-raise), var(--s-panel2)); }
.gs-desk .gs-bar .gs-btn { min-height: 32px; border-radius: 8px; }
.gs-desk .gs-bar .gs-btn.icon { width: 34px; padding: 0; }
.gs-desk .gs-bar .gs-zoom { display: inline-flex; gap: 4px; }
.gs-desk .gs-bar .gs-seg button { min-height: 30px; }
.gs-desk .gs-bar [data-r="sing"] { min-width: 104px; min-height: 36px; font-size: 14px; letter-spacing: .01em; box-shadow: 0 4px 14px rgba(229, 50, 45, .28); }
.gs-desk .gs-bar .gs-f select { padding: 4px 6px; }
/* the readout: song length, bars, notes, time, tempo, in figures that don't jump */
.gs-lcd { display: inline-flex; align-items: stretch; margin: 0 4px 0 8px; border: 1px solid var(--s-line2); border-radius: 9px; overflow: hidden;
  background: var(--s-bg); box-shadow: 0 1px 2px rgba(0, 0, 0, .35) inset; }
.gs-lcd > span { display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 52px; padding: 3px 10px; }
.gs-lcd > span + span { border-left: 1px solid var(--s-line); }
.gs-lcd b { font: 600 14px/1.15 var(--mono, ui-monospace, monospace); color: var(--s-ink); font-variant-numeric: tabular-nums; }
.gs-lcd i { font: 600 9px/1.2 var(--sans, system-ui); font-style: normal; letter-spacing: .1em; text-transform: uppercase; color: var(--s-muted); }
.gs-lcd > span:first-child b { color: var(--s-accent2); }
.gs-desk .gs-toast { right: 10px; }
/* left: the song panel */
.gs-dside { grid-area: side; min-height: 0; overflow-y: auto; overflow-x: hidden; border-right: 1px solid var(--s-line2); background: var(--s-panel); }
.gs-dsec { display: flex; flex-direction: column; gap: 9px; padding: 13px 14px 14px; border-bottom: 1px solid var(--s-line); }
.gs-dsec h5 { margin: 0; font: 700 10.5px/1 var(--sans, system-ui); letter-spacing: .11em; text-transform: uppercase; color: var(--s-muted); }
.gsing .gs-dside select, .gsing .gs-dside input[type="number"], .gsing .gs-dside input[type="text"] { width: 100%; min-height: 32px; }
.gs-desk .gs-ly { display: flex; flex-direction: column; gap: 8px; }
.gsing.gs-desk .gs-ly textarea { width: 100%; min-height: 150px; max-height: 40vh; resize: vertical; padding: 10px 12px; font-size: 13.5px; line-height: 1.6; border-radius: 9px; }
.gs-desk .gs-lyside { width: auto; gap: 8px; }
.gs-desk .gs-lyopts { grid-template-columns: 1fr 1fr; gap: 6px; }
.gs-desk .gs-lyopts select:first-child { grid-column: 1 / -1; }
.gsing.gs-desk .gs-lyopts select { font-size: 12.5px; min-height: 30px; }
.gs-desk .gs-lyside [data-r="compose"] { background: var(--s-sel); border-color: var(--s-accent); font-weight: 600; }
.gs-dgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.gs-desk .gs-dside .gs-mf { display: flex; flex-direction: column; align-items: stretch; gap: 4px; font-size: 11.5px; color: var(--s-muted); }
.gs-dfile { display: flex; flex-direction: column; gap: 8px; }
.gs-dfile .gs-btn { width: 100%; }
/* middle and right */
.gs-desk .gs-roll { grid-area: roll; min-height: 0; border: 0; border-radius: 0; }
.gs-desk .gs-insp { grid-area: insp; min-height: 0; overflow-y: auto; border: 0; border-left: 1px solid var(--s-line2); border-radius: 0; background: var(--s-panel); }
/* bottom: the takes, a strip under the roll */
.gs-desk [data-r="eslot"] { grid-area: slot; min-height: 0; max-height: 30vh; overflow-y: auto; padding: 8px 10px; border-top: 1px solid var(--s-line2); background: var(--s-panel2); }
.gs-desk [data-r="eslot"]:has(> .gs-takes:empty) { display: none; }
.gs-desk .gs-take { padding: 8px 12px; gap: 12px; border-radius: 9px; }
/* the add-on isn't installed yet */
.gs-missing { position: absolute; inset: 0; z-index: 20; display: grid; place-items: center; background: color-mix(in srgb, var(--s-bg) 82%, transparent);
  backdrop-filter: blur(3px); }
.gs-mcard { width: min(440px, calc(100% - 40px)); display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 28px 28px 24px; text-align: center;
  border: 1px solid var(--s-line2); border-radius: 14px; background: var(--s-panel); box-shadow: 0 18px 50px rgba(0, 0, 0, .3); }
.gs-mcard b { font-size: 16px; }
.gs-mcard p { margin: 0 0 6px; color: var(--s-ink2); font-size: 13.5px; line-height: 1.55; }
.gs-micon { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 12px; background: var(--s-sel); color: var(--s-accent); }
.gs-micon svg { width: 24px; height: 24px; }
.gs-mcard .gs-mrow { width: 100%; }
/* small app windows: sized by the editor's own width (the app's sidebar takes part of the window) */
.gsing.gs-desk { container-type: inline-size; container-name: gsdesk; }
@container gsdesk (max-width: 1180px) {
  .gs-desk .gs-adv { grid-template-columns: 236px minmax(0, 1fr) 236px; }
  .gs-lcd > span:nth-child(n+4) { display: none; }
  .gs-desk .gs-bar [data-r="preview"] { min-width: 0; }
}
@container gsdesk (max-width: 1000px) {
  .gs-desk .gs-adv { grid-template-columns: 224px minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto auto;
    grid-template-areas: "bar bar" "side roll" "side insp" "side slot"; }
  .gs-desk .gs-insp { max-height: 24vh; border-left: 0; border-top: 1px solid var(--s-line2); }
  .gs-desk .gs-bar { flex-wrap: wrap; }
  .gs-lcd > span:nth-child(n+3) { display: none; }
  .gs-desk .gs-bar .gs-btn span { display: none; }
  .gs-desk .gs-bar [data-r="sing"] span, .gs-desk .gs-bar [data-r="preview"] span { display: inline; }
}
@container gsdesk (max-width: 720px) {
  .gs-desk .gs-adv { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto minmax(320px, 1fr) auto auto;
    grid-template-areas: "bar" "side" "roll" "insp" "slot"; overflow-y: auto; }
  .gs-dside { max-height: 38vh; border-right: 0; border-bottom: 1px solid var(--s-line2); }
}
