/* Canonical editor: paged controls and one bounded note window on every screen. */
.gwe-workspace {
  --gwe-panel: #17212a;
  --gwe-edge: #3c515d;
  --gwe-ink: #eef5ed;
  --gwe-accent: #d3f478;
  display: grid;
  gap: 1rem;
  min-width: 0;
  color: var(--gwe-ink);
}
.gwe-workspace * { box-sizing: border-box; }
.gwe-workspace h2, .gwe-workspace h3, .gwe-workspace h4 { margin: 0; }
.gwe-workspace button, .gwe-workspace input, .gwe-workspace select {
  min-height: 44px;
  max-width: 100%;
  border: 1px solid var(--gwe-edge);
  border-radius: .4rem;
  background: #0d171e;
  color: var(--gwe-ink);
  font: inherit;
  padding: .55rem .7rem;
}
.gwe-workspace button { cursor: pointer; }
.gwe-workspace button:hover { border-color: var(--gwe-accent); }
.gwe-workspace :focus-visible { outline: 2px solid var(--gwe-accent); outline-offset: 3px; }
.gwe-workspace button:disabled, .gwe-workspace input:disabled, .gwe-workspace select:disabled { opacity: .5; cursor: default; }
.gwe-workspace button[aria-pressed="true"], .gwe-workspace .is-selected {
  border-color: var(--gwe-accent);
  background: #2b3d22;
  color: var(--gwe-accent);
}
.gwe-workspace .gwe-field { display: grid; gap: .35rem; min-width: 0; font-size: .85rem; }
.gwe-field input, .gwe-field select { width: 100%; min-width: 0; }
.gwe-field input[type="range"] { min-width: 7rem; padding-inline: .25rem; accent-color: var(--gwe-accent); }
.gwe-field input[type="checkbox"] { width: 44px; accent-color: var(--gwe-accent); }
.gwe-heading, .gwe-pagination, .gwe-pitch-tools { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .6rem; }
.gwe-heading span, .gwe-pagination span, .gwe-help, .gwe-map-count { color: #b4c5ce; font-size: .85rem; line-height: 1.5; }
.gwe-help { flex-basis: 100%; margin: .35rem 0 0; }
.gwe-arrange, .gwe-track-controls, .gwe-clip-controls, .gwe-maps, .gwe-piano, .gwe-step, .gwe-notes {
  min-width: 0;
  padding: 1rem;
  border: 1px solid var(--gwe-edge);
  border-radius: .65rem;
  background: var(--gwe-panel);
}
.gwe-track-controls, .gwe-clip-controls, .gwe-range-form, .gwe-window-form, .gwe-note-form, .gwe-map-form, .gwe-clip-form {
  display: flex;
  align-items: end;
  flex-wrap: wrap;
  gap: .65rem;
  min-width: 0;
}
.gwe-track-controls > .gwe-field, .gwe-clip-controls > .gwe-field, .gwe-range-form > .gwe-field,
.gwe-window-form > .gwe-field, .gwe-note-form > .gwe-field, .gwe-map-form > .gwe-field, .gwe-clip-form > .gwe-field { flex: 1 1 8rem; }
.gwe-clip-form { flex-basis: 100%; }
.gwe-arrange-drawing { display: grid; grid-template-columns: minmax(72px, 15%) minmax(0, 1fr); margin-block: .75rem; }
.gwe-lanes { display: grid; grid-auto-rows: 44px; }
.gwe-workspace .gwe-lane { min-height: 44px; padding: .4rem; border-radius: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gwe-arrangement { display: block; width: 100%; height: auto; min-height: 44px; touch-action: pan-y; }
.gwe-maps > summary { cursor: pointer; min-height: 44px; padding-block: .6rem; font-weight: 600; }
.gwe-map { display: flex; flex-wrap: wrap; align-items: center; gap: .65rem; padding-block: .8rem; border-top: 1px solid var(--gwe-edge); }
.gwe-map h4, .gwe-map-form { flex-basis: 100%; }
.gwe-piano-svg { display: block; width: 100%; height: 288px; margin-block: .75rem; border: 1px solid var(--gwe-edge); touch-action: pan-y; }
.gwe-white-key { fill: #263943; stroke: #405761; stroke-width: .5; }
.gwe-black-key { fill: #15232c; stroke: #405761; stroke-width: .5; }
.gwe-note { fill: #5cb8bb; cursor: pointer; }
.gwe-note.is-selected { fill: var(--gwe-accent); stroke: #f4ffc9; stroke-width: 2; }
.gwe-step { display: flex; align-items: end; flex-wrap: wrap; gap: .65rem; }
.gwe-step > .gwe-field { flex: 1 1 8rem; }
.gwe-step-grid { display: grid; grid-template-columns: repeat(16, minmax(44px, 1fr)); gap: .3rem; width: 100%; overflow-x: auto; overscroll-behavior-inline: contain; padding-bottom: .3rem; }
.gwe-workspace .gwe-step-cell { min-width: 44px; padding-inline: .2rem; font-variant-numeric: tabular-nums; font-size: .8rem; }
.gwe-workspace .gwe-step-cell.is-active { background: #2b3d22; color: var(--gwe-accent); border-color: var(--gwe-accent); }
.gwe-note-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr)); gap: .4rem; max-height: 22rem; overflow-y: auto; overscroll-behavior: contain; margin-bottom: .75rem; }
.gwe-workspace .gwe-event { text-align: left; font-size: .85rem; overflow-wrap: anywhere; }
.gwe-sounding { margin: 0; color: var(--gwe-accent); }
.gwe-status { min-height: 1.5rem; margin: 0; overflow-wrap: anywhere; }
@media (max-width: 600px) {
  .gwe-arrange, .gwe-track-controls, .gwe-clip-controls, .gwe-maps, .gwe-piano, .gwe-step, .gwe-notes { padding: .65rem; }
  .gwe-heading { align-items: start; }
  .gwe-heading h2 { font-size: 1.15rem; }
  .gwe-workspace form > button, .gwe-track-controls > button, .gwe-clip-controls > button { flex: 1 1 8rem; }
  .gwe-pagination { justify-content: start; }
  .gwe-pagination span { flex-basis: 100%; order: 1; }
  .gwe-step-grid { grid-template-columns: repeat(8, minmax(44px, 1fr)); }
  .gwe-arrange-drawing { grid-template-columns: 72px minmax(0, 1fr); }
}

/* The instrument comes first: the preserved Gridworks grid on SongV4. */
.gwe-workspace{--gwe-panel:#0e1210;--gwe-edge:#29342c;--gwe-ink:#e0e8df;--gwe-accent:#b7f34c;gap:0;border:1px solid var(--gwe-edge);background:#0a0d0b;font-size:13px}
.gwe-workspace section{margin:0;border-top:0;padding-top:0}
.gwe-editor-bar{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:8px 12px;border-bottom:1px solid var(--gwe-edge);background:#111711;flex-wrap:wrap}
.gwe-editor-tabs{display:flex;gap:4px;min-width:0;flex-wrap:wrap}
.gwe-workspace .gwe-editor-tab{font:700 11px/1 ui-monospace,SFMono-Regular,Consolas,monospace;letter-spacing:.07em;border:0;border-radius:2px;background:transparent;color:#92a18f;min-height:40px;padding:10px 14px}
.gwe-workspace .gwe-editor-tab[aria-selected=true]{background:#b7f34c;color:#10170a}
.gwe-editor-count{font:10px ui-monospace,SFMono-Regular,Consolas,monospace;color:#82927f;letter-spacing:.08em}
.gwe-desk{display:grid;grid-template-columns:minmax(0,1fr) 260px;align-items:start;min-width:0}
.gwe-center{min-width:0;padding:12px;background:#0b0f0c}
.gwe-grid-tools,.gwe-grid-pagination{display:flex;align-items:center;gap:8px;flex-wrap:wrap;font:10px ui-monospace,SFMono-Regular,Consolas,monospace;color:#93a28e}
.gwe-grid-tools{margin:0 0 14px}.gwe-grid-tools .gwe-field{display:flex;align-items:center;gap:8px;margin-left:auto;font-size:10px}.gwe-grid-tools select{width:auto;min-width:130px;min-height:36px;padding:6px}.gwe-grid-position{font-size:11px;letter-spacing:.05em}
.gwe-workspace .gwe-grid-prev,.gwe-workspace .gwe-grid-next{min-height:36px;min-width:36px;padding:6px}
.gwe-grid-scroll{max-width:100%;overflow-x:auto;overscroll-behavior-inline:contain;padding-bottom:12px;scrollbar-color:#435d35 #101810}
.gwe-track-grid{min-width:920px;width:100%}
.gwe-grid-ruler,.gwe-grid-row{display:grid;grid-template-columns:184px repeat(16,minmax(40px,1fr));gap:4px;align-items:center}
.gwe-grid-ruler{height:26px;font:10px ui-monospace,SFMono-Regular,Consolas,monospace;text-align:center;color:#667b61}
.gwe-grid-corner{text-align:left;padding-left:8px;letter-spacing:.1em}.gwe-grid-ruler .is-quarter{color:#bdcdb3}
.gwe-grid-row{--row-color:#b7f34c;min-height:64px;padding:4px 0;border-bottom:1px solid #1c261d}
.gwe-grid-row.gwe-color-1{--row-color:#f7ad69}.gwe-grid-row.gwe-color-2{--row-color:#ebdb76}.gwe-grid-row.gwe-color-3{--row-color:#8dccd6}.gwe-grid-row.gwe-color-4{--row-color:#b4a0e3}.gwe-grid-row.gwe-color-5{--row-color:#e69fb8}.gwe-grid-row.gwe-color-6{--row-color:#86c7aa}.gwe-grid-row.gwe-color-7{--row-color:#d6b585}
.gwe-grid-row.is-selected{background:#121b11}
.gwe-grid-track{position:sticky;left:0;z-index:2;min-width:0;background:#0b0f0c;padding-right:6px;border-left:3px solid var(--row-color)}
.gwe-grid-row.is-selected .gwe-grid-track{background:#121b11}
.gwe-workspace .gwe-grid-select{width:100%;border:0;background:transparent;text-align:left;color:#d6dfd1;min-height:30px;padding:4px 8px;border-radius:0;font-size:12px;font-weight:700;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.gwe-workspace .gwe-grid-select[aria-pressed=true]{color:var(--row-color)}
.gwe-grid-track-actions{display:flex;gap:3px;padding-left:5px}
.gwe-workspace .gwe-grid-track-actions button{min-height:26px;min-width:28px;padding:4px 6px;font:9px ui-monospace,SFMono-Regular,Consolas,monospace;border-radius:2px;background:#141d15}
.gwe-workspace .gwe-grid-remix{margin-left:auto;color:#b6d49f}
.gwe-workspace .gwe-grid-pad{min-width:40px;min-height:44px;padding:0;border:1px solid #2b3929;border-radius:4px;background:#172016;color:#273a20;font-size:15px;box-shadow:inset 0 -3px #10180f}
.gwe-workspace .gwe-grid-pad:nth-child(8n+2),.gwe-workspace .gwe-grid-pad:nth-child(8n+3),.gwe-workspace .gwe-grid-pad:nth-child(8n+4),.gwe-workspace .gwe-grid-pad:nth-child(8n+5){background:#1d2919}
.gwe-workspace .gwe-grid-pad.is-quarter{border-left:2px solid #527045}
.gwe-workspace .gwe-grid-pad.is-active{background:var(--row-color);border-color:var(--row-color);color:#142010;box-shadow:inset 0 -3px #0003,0 0 10px #c7ff6720}
.gwe-workspace .gwe-grid-pad:hover{border-color:#d4f4b8;filter:brightness(1.12)}
.gwe-grid-pagination{justify-content:space-between;margin-top:6px}.gwe-workspace .gwe-grid-pagination button{min-height:34px;font:9px ui-monospace,SFMono-Regular,Consolas,monospace;padding:6px 8px;border-radius:2px}
.gwe-inspector{min-width:0;border-left:1px solid var(--gwe-edge);background:#101610;padding:0 10px;max-height:760px;overflow-y:auto}
.gwe-inspector>details{border-bottom:1px solid #2b3728;padding:8px 0}.gwe-inspector>details>summary{padding:10px 2px;min-height:40px;cursor:pointer;font:700 11px ui-monospace,SFMono-Regular,Consolas,monospace;letter-spacing:.08em;color:#b7cf9c}
.gwe-inspector .gwe-track-controls,.gwe-inspector .gwe-clip-controls,.gwe-inspector .gwe-notes,.gwe-inspector .gwe-step{border:0;border-radius:0;padding:8px 0;background:transparent}
.gwe-inspector .gwe-field{font-size:11px;gap:4px}.gwe-inspector .gwe-field input,.gwe-inspector .gwe-field select{font-size:12px;min-height:38px;padding:6px 8px}.gwe-inspector .gwe-help{font-size:10px;color:#7d9476}.gwe-inspector .gwe-sounding{font-size:11px}.gwe-inspector .gwe-note-form>button{width:100%;font-size:11px}
.gwe-inspector .gwe-step-grid{grid-template-columns:repeat(4,minmax(40px,1fr))}.gwe-inspector .gwe-note-list{grid-template-columns:1fr}
.gwe-workspace .gwe-status{font-size:11px;min-height:0;padding:0 12px}.gwe-status:empty{display:none}
.gwe-workspace.is-performing{display:none}
@media(max-width:1100px){.gwe-desk{grid-template-columns:minmax(0,1fr)}.gwe-inspector{border-left:0;border-top:1px solid var(--gwe-edge);max-height:none;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}.gwe-inspector>details{min-width:0}}
@media(max-width:600px){.gwe-editor-bar{padding:6px;gap:4px}.gwe-editor-count{display:none}.gwe-workspace .gwe-editor-tab{font-size:10px;padding:10px}.gwe-center{padding:8px}.gwe-track-grid{min-width:896px}.gwe-grid-ruler,.gwe-grid-row{grid-template-columns:160px repeat(16,42px);gap:4px}.gwe-grid-row{min-height:72px}.gwe-grid-track-actions{gap:4px}.gwe-workspace .gwe-grid-track-actions button{min-height:32px;min-width:32px}.gwe-grid-tools{gap:6px}.gwe-grid-tools .gwe-field{margin-left:0;flex-direction:row;flex-basis:100%;justify-content:space-between}.gwe-grid-tools select{min-width:0;max-width:180px}.gwe-inspector{display:block}.gwe-workspace .gwe-grid-pad{min-height:48px}}
.gwe-tracker{width:100%;border-collapse:collapse;font:12px/1.5 ui-monospace,SFMono-Regular,Consolas,monospace}.gwe-tracker th{text-align:left;padding:10px 8px;color:#8da57e;font-size:10px;letter-spacing:.06em;border-bottom:1px solid #3a5030}.gwe-tracker td{padding:4px 8px;border-bottom:1px solid #202d1f}.gwe-tracker tr.is-selected td{background:#25371d;color:#d1fc8c}.gwe-workspace .gwe-tracker-note{font:inherit;min-height:36px;min-width:56px;padding:4px 8px;border:0;border-radius:2px;background:#172114;color:#bbec86}
.gwe-inspector .gwe-field input[type=range]{width:100%!important;min-width:0;max-width:100%;padding:0}.gwe-workspace .gwe-grid-pad.is-unknown{background:#342d18;color:#ddc57c;border-color:#6f6038;opacity:1;cursor:help}
@media(max-width:600px){.gwe-grid-tools .gwe-field{flex-basis:auto;margin-left:auto;font-size:0}.gwe-grid-tools .gwe-field select{width:112px;min-width:112px;max-width:112px;font-size:11px}}
.gwe-workspace .gwe-grid-pad.is-playhead{outline:2px solid #f4ffcc;outline-offset:1px;filter:brightness(1.45)}.gwe-grid-hint{font-size:10px;color:#7d9371;margin:4px 0 10px}
@media(max-width:600px){.gwe-track-grid{min-width:848px}.gwe-grid-ruler,.gwe-grid-row{grid-template-columns:112px repeat(16,42px)}.gwe-workspace .gwe-grid-remix{font-size:0;min-width:32px;max-width:32px}.gwe-workspace .gwe-grid-remix::after{content:'↻';font-size:14px}.gwe-grid-hint{font-size:9px}}
.gwe-inspector .gwe-field input:not([type=checkbox]),.gwe-inspector .gwe-field select{width:100%!important;min-width:0;max-width:100%}
@media(max-width:600px){.gwe-workspace .gwe-grid-track-actions .gwe-grid-remix{font-size:0}}
