/* Two playback rows on larger screens; phone controls stay in their sheet. */
#soundPracticeControls #practiceControlsTray { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:6px; }
#soundPracticeControls #practiceControlsTray button { width:100%; min-height:36px; height:36px; padding:5px 8px; margin:0; border:1px solid #71958e; border-radius:8px; background:#fff4df; color:#20201e; font:600 12px system-ui,sans-serif; box-sizing:border-box; }
#soundPracticeControls #practiceControlsTray button:hover { background:#fff4df; color:#20201e; border-color:#71958e; box-shadow:none; transform:none; filter:none; }
#soundPracticeControls #practiceControlsTray button[aria-pressed=true] { background:#4c8f8a; color:#fff4df; }
#practiceControlsTray [role=status] { position:absolute; width:1px; height:1px; clip-path:inset(50%); overflow:hidden; white-space:nowrap; }
@media (min-width:601px) and (min-height:501px), (min-width:1001px) {
  #GrooveWriter #playbackControls { display:grid; grid-template-columns:minmax(130px,1fr) auto minmax(100px,1fr); gap:3px 16px; align-items:center; }
  #GrooveWriter #playbackControls > h2 { grid-area:1 / 1 / 2 / -1; margin:0; }
  #GrooveWriter #playbackControls .sketchPlayback { display:contents; }
  #GrooveWriter #playbackControls #tempoAndProgress1 { grid-area:2 / 1; }
  #GrooveWriter #playbackControls .sketchTransport { grid-area:2 / 2; }
  #GrooveWriter #playbackControls .sketchPlayback > .swingRow { grid-area:2 / 3; }
  #GrooveWriter #playbackControls #soundPracticeControls { grid-area:3 / 1 / 4 / -1; display:grid; grid-template-columns:minmax(210px,1.4fr) repeat(3,minmax(100px,1fr)); gap:8px; margin:0; padding:4px 0 0; border:0; align-self:start; }
  #GrooveWriter #playbackControls #soundPracticeControls > .kitControl,
  #GrooveWriter #playbackControls #soundPracticeControls > .metronomeSelect,
  #GrooveWriter #playbackControls #soundPracticeControls #countInButton { grid-area:auto; width:100%; }
  #GrooveWriter #soundPracticeControls #practiceControlsTray { display:contents; }
}
#saveFeedback { margin:0; font:12px system-ui,sans-serif; color:#346b65; }
#practiceControlsDialog { width:min(480px,calc(100vw - 32px)); max-height:85dvh; overflow:auto; box-sizing:border-box; border:2px solid #71958e; border-radius:14px; padding:20px; background:#fff4df; color:#20201e; font:15px system-ui,sans-serif; }
#practiceControlsDialog::backdrop { background:#203c3b80; }
#practiceControlsDialog h2 { margin:0 0 10px; font:700 22px system-ui,sans-serif; color:#346b65; }
#practiceControlsDialog label { display:flex; align-items:center; justify-content:space-between; gap:16px; margin:12px 0; }
#practiceControlsDialog input[type=number] { width:76px; min-height:36px; font:inherit; }
#practiceControlsDialog input[type=checkbox] { width:24px; height:24px; accent-color:#4c8f8a; }
#practiceControlsDialog button { min-height:44px; margin-right:8px; padding:8px 12px; border-radius:8px; border:1px solid #71958e; background:#ffe9c6; font:600 14px system-ui,sans-serif; }
#musicalInput [role=button]:focus-visible { outline:3px solid #fa8a2a !important; outline-offset:1px; }
@media print { #practiceControlsTray,#saveFeedback,#practiceControlsDialog { display:none !important; } }

/* Count-O-Nome style tap pad, kept small for the compact playback row. */
#GrooveWriter #tapTempoButton,
#phonePlaybackDialog #practiceControlsTray #tapTempoButton {
  display:flex; flex-direction:column; align-items:center; justify-content:center;
  justify-self:center; width:54px; height:54px; min-height:54px; flex-shrink:0;
  padding:0; gap:3px; border:2px solid #71958e; border-radius:50%; line-height:1;
  background:#fff4df; text-align:center; touch-action:manipulation;
}
#tapTempoButton strong { font-size:15px; }
#tapTempoButton span { font-size:9px; letter-spacing:.04em; }
body #tapTempoButton:active { box-shadow:inset 0 2px 4px #20201e30; }

@media (min-width:601px) and (min-height:501px), (min-width:1001px) {
  #GrooveWriter #playbackControls .sketchTransport { gap:10px; align-items:center; }
  #GrooveWriter #playbackControls .sketchPlayback > .swingRow { width:100%; max-width:none; justify-self:stretch; }
  #GrooveWriter #playbackControls #soundPracticeControls { align-items:center; }
}

/* The switch is on whenever the editor is hidden. */
#modernHeader #presentationModeButton,
#phoneViewNav #phoneExitPresentation {
  display:inline-flex; align-items:center; justify-content:center; gap:9px;
  padding:7px 10px !important; border:1px solid #71958e !important;
  border-radius:8px; background:#fff4df !important; color:#20201e !important;
}
#modernHeader #presentationModeButton::before,
#phoneViewNav #phoneExitPresentation::before {
  content:""; display:inline-block; flex:0 0 32px; width:32px; height:18px;
  border:1px solid #71958e; border-radius:12px;
  background:radial-gradient(circle at 8px 9px,#fff4df 0 6px,transparent 7px),#71958e;
}
#modernHeader #presentationModeButton[aria-checked="true"],
#phoneViewNav #phoneExitPresentation[aria-checked="true"] {
  background:var(--selected) !important; color:var(--on-ink) !important;
  border-color:var(--selected-edge) !important; font-weight:750;
}
#modernHeader #presentationModeButton[aria-checked="true"]::before,
#phoneViewNav #phoneExitPresentation[aria-checked="true"]::before {
  background:radial-gradient(circle at 24px 9px,#fff4df 0 6px,transparent 7px),#346b65;
}

/* compact saving group, without changing the subdivision grid. */
@media (min-width:1051px) {
  #GrooveWriter #editingToolbar .sketchLibrary { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); align-content:start; align-items:start; gap:6px; }
  #GrooveWriter #editingToolbar .sketchLibrary button { white-space:normal; }
  #GrooveWriter #editingToolbar .sketchLibrary #editorStatus,
  #GrooveWriter #editingToolbar .sketchLibrary #saveFeedback { grid-column:1/-1; }
}

/* Shared vertical rhythm across the desktop editing groups. */
@media (min-width:1051px) {
  #GrooveWriter #editingToolbar .sketchEditGroups { gap:12px; align-items:start; }
  #GrooveWriter #editingToolbar .sketchLength,
  #GrooveWriter #editingToolbar .sketchSubdivisions,
  #GrooveWriter #editingToolbar #laneOptions.sketchRows { gap:6px; }
  #GrooveWriter #editingToolbar .sketchSubdivisions > .editActions { gap:6px; margin:0; }
  #GrooveWriter #editingToolbar .sketchSubdivisions > .editActions button,
  #GrooveWriter #editingToolbar .sketchRows button,
  #GrooveWriter #editingToolbar .sketchLibrary button { height:36px; min-height:36px; margin:0; padding:5px 8px; box-sizing:border-box; }
  #GrooveWriter #editingToolbar .sketchRows .rowToggles { gap:6px; }
  #GrooveWriter #editingToolbar .sketchRows .controlHeading { margin:0; min-height:18px; line-height:18px; }
  #GrooveWriter #editingToolbar .sketchLibrary { padding-top:24px; gap:6px; }
  #GrooveWriter #editingToolbar .sketchSubdivisions .subdivisionChoices { gap:6px; }
  #GrooveWriter #editingToolbar .sketchSubdivisions .controlHeading { margin:0; min-height:18px; line-height:18px; }
}
@media (min-width:1051px) {
  #GrooveWriter #editingToolbar .sketchLength #timeLabel { margin-top:12px; }
  #GrooveWriter #editingToolbar { min-height:0; }
  #GrooveWriter #editingToolbar .sketchEditGroups { min-height:0; }
}
/* Let the editor end at its content, rather than reserving an invisible hint row. */
@media screen and (min-width:1051px) {
  body #GrooveWriter { padding-bottom:4px; }
  body #GrooveWriter #RightHandContent { padding-bottom:0; }
  body #GrooveWriter #editingToolbar { margin-bottom:0; padding-bottom:6px; }
  #GrooveWriter #editingToolbar #laneOptions #editHint { height:auto; min-height:0; margin:0; font-size:11px; line-height:14px; text-wrap:initial; }
  #GrooveWriter #editingToolbar #laneOptions #editHint[hidden] { display:none !important; }
  #GrooveWriter #editingToolbar #saveFeedback:empty { display:none; }
}
/* Presets are a primary starting point, distinct from saving and sharing. */
#GrooveWriter #editingToolbar .sketchLibrary #groovesAnchor,
.phoneViews #phonePresetRow #groovesAnchor {
  background:#346b65 !important; color:#fff4df !important;
  border:2px solid #28554f !important; font-weight:750;
  box-shadow:0 2px 0 #28554f;
}
/* Separate starting a preset from keeping or sharing the current groove. */
@media (min-width:1051px) {
  #GrooveWriter #editingToolbar .sketchLibrary #groovesAnchor {
    grid-column:1/-1; margin-bottom:8px; position:relative;
  }
  #GrooveWriter #editingToolbar .sketchLibrary #saveGrooveButton,
  #GrooveWriter #editingToolbar .sketchLibrary #myGroovesButton { border-top-width:1px; }
  #GrooveWriter #editingToolbar .sketchLibrary #uniqueLinkButton { grid-column:1/-1; }
  #GrooveWriter #editingToolbar .sketchLibrary #groovesAnchor::after {
    content:""; position:absolute; left:0; right:0; bottom:-10px;
    border-bottom:1px solid #71958e80; pointer-events:none;
  }
}

@media (max-width:600px), (max-width:1000px) and (max-height:500px) {
 #phonePlaybackDialog #practiceControlsTray button { min-height:44px; height:auto; }
}

.phoneViews #phoneViewNav #phoneExitPresentation { display:none; }
.phoneViews.presentationMode #phoneViewNav #phoneExitPresentation { display:inline-flex; }
