/* Music symbols for the sheet view: a subset of Bravura (SIL Open Font
   License, see fonts/OFL.txt), renamed as the license asks. */
@font-face {
  font-family: "NoteWorthy Music";
  src: url("fonts/noteworthy-music.woff2") format("woff2");
  font-display: block;
}
@font-face {
  font-family: "Pacifico";
  src: url("fonts/pacifico.woff2") format("woff2");
  font-display: swap;
}

:root {
  --bg: #0b0c10;
  --panel: #14161d;
  --panel-edge: #232631;
  --fg: #eceef4;
  --muted: #8b90a0;
  --accent: #5b9dff;
  --accent-strong: #3c78d8;
  --live: #ffd35c;
  --danger: #ff6b6b;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 15px/1.4 Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

.app {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
}

.toolbar, .transport {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: var(--panel);
  border-color: var(--panel-edge);
  border-style: solid;
  border-width: 0;
}
.toolbar { border-bottom-width: 1px; flex-wrap: wrap; row-gap: 8px; }
.transport { border-top-width: 1px; }

.brand {
  display: flex;
  align-items: center;
  gap: 6px;
  font: 400 22px/1 "Pacifico", cursive;
  white-space: nowrap;
}
.brand-mark { display: flex; }
.brand-mark svg { width: 40px; height: 40px; margin: -8px 0; }
.song-title {
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.spacer { flex: 1; }
.midi-status { color: var(--live); font-size: 0.9em; white-space: nowrap; }

button {
  font: inherit;
  padding: 7px 14px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: var(--accent);
  color: white;
  cursor: pointer;
  transition: background 120ms, border-color 120ms, transform 80ms;
  white-space: nowrap;
}
button:hover:not(:disabled) { background: var(--accent-strong); }
button:active:not(:disabled) { transform: scale(0.97); }
button:disabled { opacity: 0.4; cursor: default; }
button.ghost { background: transparent; border-color: var(--panel-edge); color: var(--fg); }
button.ghost:hover:not(:disabled) { background: var(--panel-edge); }
button.play { width: 44px; height: 36px; padding: 0; font-size: 14px; }

.stage-area {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
}
.stage {
  flex: 1;
  min-height: 0;
  width: 100%;
  display: block;
}

/* Seek bar with the looped section drawn behind it. */
.seek-wrap { position: relative; flex: 1; min-width: 60px; display: flex; align-items: center; }
.seek { flex: 1; min-width: 0; margin: 0; }
/* Inset by half the range thumb so percentages line up with the thumb. */
.loop-track { position: absolute; inset: 0 8px; pointer-events: none; z-index: 1; }
.loop-band {
  position: absolute;
  top: 50%;
  height: 14px;
  transform: translateY(-50%);
  border-radius: 4px;
  background: rgba(255, 211, 92, 0.28);
  border: 1px solid rgba(255, 211, 92, 0.6);
}
.loop-band.off { background: rgba(139, 144, 160, 0.15); border-color: rgba(139, 144, 160, 0.4); }
.loop-handle {
  position: absolute;
  top: 50%;
  width: 10px;
  height: 24px;
  transform: translate(-50%, -50%);
  border-radius: 3px;
  background: var(--live);
  box-shadow: 0 0 0 2px var(--panel);
  cursor: ew-resize;
  touch-action: none;
  pointer-events: auto;
  z-index: 2;
  transition: transform 80ms;
}
.loop-handle:hover, .loop-handle.grabbed { transform: translate(-50%, -50%) scaleY(1.15); }

.loop-controls { display: flex; align-items: center; gap: 4px; }
.loop-controls button.mark { padding: 7px 10px; min-width: 34px; }
button.loop-toggle.active,
button.loop-toggle.active:hover:not(:disabled) { background: rgba(255, 211, 92, 0.18); border-color: var(--live); color: var(--live); }
.pause { display: flex; align-items: center; gap: 6px; margin-left: 8px; color: var(--muted); white-space: nowrap; }
.pause input {
  width: 4.2em;
  font: inherit;
  padding: 5px 6px;
  border-radius: 6px;
  border: 1px solid var(--panel-edge);
  background: var(--bg);
  color: var(--fg);
}

.countdown {
  position: absolute;
  left: 50%;
  top: 40%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 14px 28px;
  border-radius: 16px;
  background: rgba(20, 22, 29, 0.85);
  border: 1px solid rgba(255, 211, 92, 0.5);
  backdrop-filter: blur(6px);
  pointer-events: none;
  animation: rise 160ms ease-out;
}
.countdown .label { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }
.countdown .value { font-size: 44px; font-weight: 700; color: var(--live); font-variant-numeric: tabular-nums; line-height: 1.1; }

.loops {
  position: absolute;
  top: 78px;
  right: 16px;
  min-width: 150px;
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(20, 22, 29, 0.82);
  border: 1px solid var(--panel-edge);
  backdrop-filter: blur(6px);
  font-variant-numeric: tabular-nums;
  animation: rise 160ms ease-out;
}
.loops ul { list-style: none; margin: 0; padding: 0; }
.loops li { display: flex; justify-content: space-between; gap: 16px; color: var(--muted); font-size: 13px; }
.loops li .value { color: var(--fg); }
.loops .best { padding-bottom: 6px; margin-bottom: 6px; border-bottom: 1px solid var(--panel-edge); }
.loops .best .label { font-size: 11px; color: var(--live); text-transform: uppercase; letter-spacing: 0.06em; }
.loops .best li .value { color: var(--live); font-weight: 650; }
.time { font-variant-numeric: tabular-nums; color: var(--muted); white-space: nowrap; }
.speed { display: flex; align-items: center; gap: 8px; color: var(--muted); white-space: nowrap; }
.speed input { width: 120px; }
.metronome { display: flex; align-items: center; gap: 8px; }
.metronome input { width: 80px; }
button.ghost.active,
button.ghost.active:hover:not(:disabled) { background: var(--accent); border-color: var(--accent); color: white; }

.speed-value { width: 3.5em; text-align: right; color: var(--fg); font-variant-numeric: tabular-nums; }

input[type="range"] { accent-color: var(--accent); }

.empty {
  position: absolute;
  inset: 57px 0 57px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  pointer-events: none;
  color: var(--muted);
}
.empty .big { font-size: 1.5rem; color: var(--fg); margin: 0; }
.empty p { margin: 0; }
.empty button { pointer-events: auto; margin-top: 8px; }

/* Songs opened before: on the empty stage, and dropping down from the toolbar. */
.recent-home {
  pointer-events: auto;
  width: min(440px, calc(100% - 32px));
  margin-top: 28px;
  text-align: left;
}
.recent-home h2 {
  margin: 0 0 8px 4px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.recent-home .recent-list {
  max-height: 38vh;
  overflow-y: auto;
  padding: 6px;
  border-radius: 14px;
  background: var(--panel);
  border: 1px solid var(--panel-edge);
}
.recent-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.recent-row { display: flex; align-items: center; gap: 4px; border-radius: 10px; }
.recent-row:hover, .recent-row:focus-within { background: var(--panel-edge); }
.recent-row.current { box-shadow: inset 3px 0 0 var(--accent); }
.empty .recent-list button { margin-top: 0; }
button.recent-open {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 8px 10px;
  border: none;
  background: transparent;
  color: var(--fg);
  text-align: left;
}
button.recent-open:hover:not(:disabled) { background: transparent; }
.recent-title { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 550; }
.recent-meta { display: flex; gap: 10px; font-size: 0.78em; color: var(--muted); }
.recent-tier { color: var(--tier); font-weight: 600; }
button.recent-remove {
  flex: none;
  margin-right: 6px;
  padding: 4px 8px;
  border-color: transparent;
  color: var(--muted);
  opacity: 0;
}
.recent-row:hover .recent-remove, .recent-remove:focus-visible { opacity: 1; }
button.recent-remove:hover:not(:disabled) { color: var(--danger); background: transparent; border-color: var(--danger); }
@media (hover: none) { button.recent-remove { opacity: 1; } }

.recent-menu { position: relative; }
.recent-backdrop { position: fixed; inset: 0; z-index: 39; }
.recent-popover {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 40;
  width: min(380px, calc(100vw - 32px));
  max-height: min(60vh, 520px);
  overflow-y: auto;
  padding: 6px;
  border-radius: 14px;
  background: var(--panel);
  border: 1px solid var(--panel-edge);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.5);
  animation: drop 120ms ease-out;
}
@keyframes drop { from { opacity: 0; transform: translateY(-4px); } }
@media (prefers-reduced-motion: reduce) { .recent-popover { animation: none; } }
@media (max-width: 640px) {
  .recent-menu { position: static; }
  .recent-popover { top: calc(100% + 6px); left: 16px; right: 16px; width: auto; }
}

.app.dragging::after {
  content: "Drop to load";
  position: absolute;
  inset: 12px;
  display: grid;
  place-items: center;
  font-size: 1.5rem;
  border: 2px dashed var(--accent);
  border-radius: 16px;
  background: rgba(91, 157, 255, 0.08);
  pointer-events: none;
}

.toast {
  position: absolute;
  left: 50%;
  bottom: 76px;
  transform: translateX(-50%);
  max-width: calc(100% - 32px);
  padding: 10px 16px;
  border-radius: 10px;
  background: #2a1517;
  border: 1px solid var(--danger);
  color: #ffd9d9;
  cursor: pointer;
  animation: rise 160ms ease-out;
}
@keyframes rise { from { opacity: 0; transform: translate(-50%, 8px); } }

@media (max-width: 640px) {
  .toolbar, .transport { flex-wrap: wrap; gap: 8px; }
  .song-title { order: 10; width: 100%; }
  .speed input { width: 80px; }
}

.segmented {
  display: flex;
  padding: 3px;
  gap: 2px;
  border-radius: 10px;
  background: var(--bg);
  border: 1px solid var(--panel-edge);
}
.segmented button {
  background: transparent;
  color: var(--muted);
  padding: 5px 12px;
  border-radius: 7px;
}
.segmented button:hover:not(:disabled) { background: var(--panel-edge); color: var(--fg); }
.segmented button.active,
.segmented button.active:hover { background: var(--accent); color: white; }

.hud {
  position: absolute;
  top: 8px;
  right: 16px;
  display: flex;
  align-items: stretch;
  gap: 6px;
  pointer-events: none;
  animation: rise 160ms ease-out;
}
.hud .stat, .hud .waiting {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 64px;
  padding: 6px 10px;
  border-radius: 10px;
  background: rgba(20, 22, 29, 0.82);
  border: 1px solid var(--panel-edge);
  backdrop-filter: blur(6px);
  text-align: center;
}
.hud .label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.hud .value { font-size: 20px; font-weight: 650; font-variant-numeric: tabular-nums; }
.hud .good .value { color: #7dffb0; }
.hud .bad .value { color: #ff5c6c; }
.hud .waiting {
  color: var(--live);
  font-weight: 600;
  border-color: rgba(255, 211, 92, 0.5);
  animation: pulse 1.2s ease-in-out infinite;
}
@keyframes pulse { 50% { opacity: 0.55; } }

@media (max-width: 640px) {
  .hud { right: 8px; left: 8px; justify-content: center; flex-wrap: wrap; }
  .hud .stat, .hud .waiting { min-width: 0; padding: 4px 8px; }
  .hud .value { font-size: 16px; }
}

/* End-of-song summary */
.summary-backdrop {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(5, 6, 9, 0.55);
  backdrop-filter: blur(3px);
  z-index: 20;
  animation: fade-in 200ms ease-out;
}
.summary {
  width: min(420px, calc(100vw - 32px));
  padding: 28px 28px 22px;
  border-radius: 18px;
  background: var(--panel);
  border: 1px solid var(--panel-edge);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
  text-align: center;
  animation: pop-in 320ms cubic-bezier(0.2, 1.3, 0.4, 1);
}
.summary h2 { margin: 6px 0 12px; font-size: 1.4rem; }
.summary .stars { display: flex; justify-content: center; gap: 6px; font-size: 40px; line-height: 1; }
.summary .star { color: var(--panel-edge); }
.summary .star.lit {
  color: var(--live);
  text-shadow: 0 0 18px rgba(255, 211, 92, 0.55);
  animation: star-pop 420ms cubic-bezier(0.2, 1.5, 0.4, 1) both;
}
.summary .accuracy { font-size: 56px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.summary .accuracy-label { color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; font-size: 12px; margin-top: 4px; }
.summary-stats { display: flex; justify-content: center; gap: 10px; margin: 20px 0 14px; }
.summary-stats > div {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 6px;
  border-radius: 10px;
  background: var(--bg);
  border: 1px solid var(--panel-edge);
}
.summary-stats .value { font-size: 22px; font-weight: 650; font-variant-numeric: tabular-nums; }
.summary-stats .label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.summary-stats .good .value { color: #7dffb0; }
.summary-stats .bad .value { color: #ff5c6c; }
.summary .details { color: var(--muted); font-size: 0.9em; margin: 0 0 18px; }
.summary .piano-hint, .key-intro .piano-hint { color: var(--muted); font-size: 0.85em; margin: 0 0 14px; }
.summary .actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.summary .actions button { min-width: 110px; }
.summary .actions button:has(.piano-icon) { display: inline-flex; flex-direction: column; align-items: center; gap: 4px; padding-top: 8px; }
.piano-icon { flex: none; }
.piano-icon .white { fill: none; stroke: currentColor; stroke-opacity: 0.7; }
.piano-icon .black { fill: currentColor; }
.piano-icon .lit { fill: var(--live); }
.piano-icon .black.lit { stroke: currentColor; stroke-width: 0.6; }
.piano-icon .arrow { fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

@keyframes fade-in { from { opacity: 0; } }
@keyframes pop-in { from { opacity: 0; transform: translateY(12px) scale(0.96); } }
@keyframes star-pop { from { opacity: 0; transform: scale(0.3) rotate(-30deg); } }
@media (prefers-reduced-motion: reduce) {
  .summary-backdrop, .summary, .summary .star.lit { animation: none; }
}

/* Difficulty rating: a tier badge whose card breaks the score down. */
.tier-very-easy { --tier: #4cd889; }
.tier-easy { --tier: #3fc7c2; }
.tier-intermediate { --tier: #5b9dff; }
.tier-master { --tier: #b07cff; }
.tier-grand-master { --tier: #ff8a4c; }

.difficulty { position: relative; outline: none; }
.difficulty-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.8em;
  font-weight: 600;
  white-space: nowrap;
  color: var(--tier);
  background: color-mix(in srgb, var(--tier) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--tier) 40%, transparent);
  cursor: help;
  transition: background 120ms;
}
.difficulty:hover .difficulty-badge,
.difficulty:focus-within .difficulty-badge {
  background: color-mix(in srgb, var(--tier) 24%, transparent);
}
.difficulty:focus-visible .difficulty-badge { outline: 2px solid var(--accent); outline-offset: 2px; }

.difficulty-card {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  z-index: 30;
  width: min(340px, calc(100vw - 32px));
  padding: 16px 16px 12px;
  border-radius: 14px;
  background: var(--panel);
  border: 1px solid var(--panel-edge);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.5);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 140ms, transform 140ms, visibility 0s 140ms;
}
/* Keeps the card open while the pointer crosses the gap to it. */
.difficulty-card::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -12px;
  height: 12px;
}
.difficulty:hover .difficulty-card,
.difficulty:focus-within .difficulty-card {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition: opacity 140ms, transform 140ms;
}
.difficulty-total {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 12px;
}
.tier-text { color: var(--tier); font-weight: 700; font-size: 1.15rem; }
.difficulty-score { font-weight: 700; font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.difficulty-score small { color: var(--muted); font-weight: 400; font-size: 0.75em; }
.factors { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.factor-head { display: flex; justify-content: space-between; font-size: 0.9em; }
.factor-score { font-variant-numeric: tabular-nums; color: var(--muted); }
.factor-bar {
  height: 6px;
  margin: 4px 0 3px;
  border-radius: 3px;
  background: var(--panel-edge);
  overflow: hidden;
}
.factor-fill { height: 100%; border-radius: 3px; background: var(--tier); }
.factor-detail { color: var(--muted); font-size: 0.78em; }
.difficulty-hardest {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--panel-edge);
  font-size: 0.85em;
}
.difficulty-hardest button { padding: 4px 10px; }
.difficulty-note {
  margin: 12px 0 0;
  padding: 8px 10px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--live) 10%, transparent);
  color: color-mix(in srgb, var(--live) 70%, var(--fg));
  font-size: 0.75em;
}
.beta {
  margin-left: 6px;
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 0.65em;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  vertical-align: 0.15em;
  color: var(--muted);
  border: 1px solid var(--panel-edge);
}

@media (max-width: 640px) {
  /* Hang the card under the whole toolbar, full width. */
  .toolbar { position: relative; }
  .difficulty { order: 11; position: static; }
  .difficulty-card { top: calc(100% + 6px); left: 16px; right: 16px; width: auto; }
}

.font-warmup {
  position: absolute;
  left: -9999px;
  font-family: "NoteWorthy Music";
}

/* Sight reading: setup panel, key intro and reading stats */
.sight-setup, .key-intro {
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  padding: 24px 26px 20px;
  border-radius: 18px;
  background: var(--panel);
  border: 1px solid var(--panel-edge);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
  animation: pop-in 320ms cubic-bezier(0.2, 1.3, 0.4, 1);
}
.sight-setup h2, .key-intro h2 { margin: 0 0 14px; font-size: 1.4rem; }
.sight-setup .field { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; margin-bottom: 16px; }
.field-label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.field-note { margin: 0; color: var(--muted); font-size: 0.88em; }
.sight-setup .segmented { flex-wrap: wrap; }
.key-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.key-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(58px, 1fr));
  gap: 6px;
  width: 100%;
}
button.key {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  padding: 6px 4px;
  background: var(--bg);
  border-color: var(--panel-edge);
  color: var(--fg);
}
button.key:hover:not(:disabled) { background: var(--panel-edge); }
button.key.active, button.key.active:hover:not(:disabled) { background: var(--accent); border-color: var(--accent); color: white; }
button.key:disabled { opacity: 0.45; }
.key-name { font-weight: 650; }
.key-best { font-size: 11px; min-height: 1.2em; color: var(--muted); font-variant-numeric: tabular-nums; }
button.key.active .key-best { color: rgba(255, 255, 255, 0.85); }
.check { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.check input { accent-color: var(--accent); width: 16px; height: 16px; }
.trouble { margin: 0; padding-left: 18px; color: var(--fg); font-size: 0.92em; }
.sight-setup .actions, .key-intro .actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 6px; }
.sight-setup .actions button, .key-intro .actions button { min-width: 110px; }

.key-intro { text-align: center; width: min(440px, calc(100vw - 32px)); }
.key-intro .eyebrow { margin: 0 0 4px; color: #ff9b4a; font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; }
.key-intro .signature { font-size: 1.1rem; font-weight: 600; margin: 0 0 8px; }
.key-intro .details { color: var(--muted); font-size: 0.9em; }
.key-intro .actions { justify-content: center; }
.mini-keys {
  position: relative;
  display: flex;
  height: 92px;
  margin: 16px 0;
  border-radius: 6px;
  overflow: hidden;
}
.mini-keys .white {
  flex: 1;
  background: #f4f1ea;
  border-right: 1px solid #b9b4aa;
}
.mini-keys .black {
  position: absolute;
  top: 0;
  width: 4.6%;
  height: 58%;
  transform: translateX(-50%);
  background: #1d1d22;
  border-radius: 0 0 3px 3px;
}
.mini-keys .lit { background: #ff9b4a; }
.mini-keys .black.lit { background: #e46f12; }

.reading {
  margin: 0 0 14px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--bg);
  border: 1px solid var(--panel-edge);
  text-align: left;
  font-size: 0.92em;
}
.reading-row { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); }
.reading-row .value { color: var(--fg); font-variant-numeric: tabular-nums; font-weight: 600; }
.reading-row.bad .value { color: #ff9b4a; }
.reading .trouble { margin-top: 6px; color: var(--muted); }
.reading .unlocked { margin: 8px 0 0; color: var(--live); font-weight: 600; text-align: center; }
.reading .level-up { margin: 8px 0 0; color: var(--accent); font-weight: 600; text-align: center; }

/* Edit mode: its own strip of tools under the toolbar. */
.edit-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  row-gap: 6px;
  padding: 8px 16px;
  background: var(--panel);
  border-bottom: 1px solid var(--panel-edge);
}
.edit-bar .spacer { flex: 1; }
.edit-bar button.note-length { display: inline-flex; align-items: center; justify-content: center; min-width: 2.2em; }
.note-icon { display: block; }
.edit-sound-label { color: var(--muted); font-size: 0.9em; }
.edit-hint {
  flex-basis: 100%;
  margin: 0;
  color: var(--muted);
  font-size: 0.85em;
}
.app.editing .stage { touch-action: none; cursor: crosshair; }
@media (max-width: 640px) {
  .edit-bar { padding: 8px; gap: 6px; }
  .edit-bar .spacer, .edit-sound-label { display: none; }
}
