/*!/wp-content/themes/audiogearz/tools/random-notes/tool.css*//*
 * Random Notes in the site's "After dark" look.
 *
 * Colours and typefaces come from the site's theme (its custom properties), with the dark
 * values as fall-backs so the tool also looks right on a page of its own. Sizes are in px:
 * nothing here depends on the page's root font size.
 */
/* The site's heavy typeface has no sharp, flat or natural sign, and the stand-in a browser picks is thin.
   This 1 KB file holds just those three signs in a matching weight (Noto Sans Symbols, SIL Open Font License). */
@font-face{font-family:'RN Accidentals';font-style:normal;font-weight:800;font-display:swap;src:url(/wp-content/themes/audiogearz/tools/random-notes/fonts/accidentals-800.woff2?v=8c6682d3fe) format('woff2');unicode-range:U+266D-266F;}

.rn {
  --rn-card: var(--card, #17191E);
  --rn-line: var(--card-line, #2E323A);
  --rn-line-strong: var(--line, #3A3F48);
  --rn-soft: var(--soft, #1F2228);
  --rn-ink: var(--ink, #F2F0EA);
  --rn-text: var(--text, #C7CAD1);
  --rn-muted: var(--muted, #B9BCC4);
  --rn-accent: var(--accent, #FF6A1A);
  --rn-accent-hover: var(--accent-hover, #FF8442);
  --rn-accent-ink: var(--accent-ink, #0E0F12);
  --rn-label: var(--label, #FF9A62);
  --rn-alt: var(--label-alt, #4FD1C5);
  --rn-display: 'RN Accidentals', var(--font-display, 'Archivo', 'Arial Black', sans-serif);
  --rn-body: var(--font-body, 'Figtree', 'Segoe UI', system-ui, sans-serif);
  --rn-mono: var(--font-mono, 'IBM Plex Mono', ui-monospace, Consolas, monospace);
  /* a piano and a sheet of music keep their own colours in both modes */
  --rn-key-white: #F4F2EC;
  --rn-key-black: #121419;
  --rn-paper: #F7F6F2;
  --rn-played: #F0595E;
  --rn-correct: #3CCB7F;

  font-family: var(--rn-body);
  font-size: 16px;
  line-height: 1.4;
  color: var(--rn-text);
  text-align: left;
}
.rn, .rn *, .rn *::before, .rn *::after { box-sizing: border-box; }
.rn label { font-size: 15px; }
.rn .disabled { opacity: 0.45; pointer-events: none; cursor: not-allowed; }
.rn .no-highlight { user-select: none; }

/* The tool's pieces become direct parts of one grid, so the layout can place them freely
   without the markup changing. */
.rn { display: grid; }
.rn > .top-container, .rn > .metronome, .rn .main-btn-console { display: contents; }
.rn .speed-box { grid-area: tempo; }
.rn .segmented-control-container { grid-area: modes; }
.rn > .rn-stage { grid-area: stage; min-width: 0; }
.rn .tempo-settings { grid-area: slider; }
.rn .measures { grid-area: beats; }
.rn .start-stop { grid-area: start; }
.rn .settings { grid-area: settings; min-width: 0; }

/* ---------- Modes ---------- */
.rn .segmented-control-container { display: flex; justify-content: center; min-width: 0; }
.rn .segmented-control { display: inline-flex; max-width: 100%; padding: 4px; border-radius: 999px; background: var(--rn-soft); border: 1px solid var(--rn-line); }
.rn .segmented-control-btn {
  flex: 0 1 auto; min-width: 0; min-height: 40px; padding: 0 18px; border: 0; border-radius: 999px; background: transparent;
  color: var(--rn-text); font-family: var(--rn-body); font-size: 15px; font-weight: 600; white-space: nowrap; cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}
.rn .segmented-control-btn:hover { color: var(--rn-ink); }
.rn .segmented-control-btn.active { background: var(--rn-ink); color: var(--rn-card); }

/* ---------- Tempo read-out ---------- */
.rn .speed-box { display: flex; flex-direction: column-reverse; align-items: flex-start; justify-content: center; gap: 2px; min-width: 104px; }
.rn #tempo { font-family: var(--rn-display); font-stretch: 112%; font-weight: 800; font-size: 26px; line-height: 1; color: var(--rn-ink); white-space: nowrap; }
.rn .speed-name { font-family: var(--rn-mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--rn-muted); white-space: nowrap; }

/* ---------- The note, the keyboard and the staff ---------- */
.rn .random-note {
  display: flex; align-items: center; justify-content: center; height: 176px; margin: 0;
  font-family: var(--rn-display); font-stretch: 118%; font-weight: 800; font-size: 150px; line-height: 1; letter-spacing: -0.02em;
  color: var(--rn-ink); white-space: nowrap; will-change: transform;
}
.rn .random-note.advanced-font { font-size: 84px; }
.rn .random-note.correct-effect { color: var(--rn-correct); transform: scale(1.12); transition: transform 0.05s ease-in-out; }

.rn .view-carousel { display: flex; flex-wrap: wrap; justify-content: center; width: 100%; margin: 6px auto 0; }
.rn .carousel-container { order: 3; flex: 0 0 100%; display: flex; justify-content: center; width: 100%; min-width: 0; min-height: 100px; margin-top: 18px; }
.rn .carousel-slide { display: none; width: 100%; }
.rn .carousel-slide.active { display: flex; justify-content: center; align-items: flex-start; }
/* The tool's two arrows both flip between the keyboard and the staff. Here they are drawn as a
   "Piano | Staff" pair, and the one for the view already showing is switched off. */
.rn .carousel-arrow {
  position: static; transform: none; display: flex; align-items: center; justify-content: center; width: auto; height: 36px; padding: 0 16px;
  border: 1px solid var(--rn-line); background: var(--rn-soft); color: var(--rn-text); font-size: 0; cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}
.rn .carousel-arrow::after { font-family: var(--rn-body); font-size: 14px; font-weight: 600; }
.rn .left-arrow { order: 1; border-right: 0; border-radius: 999px 0 0 999px; }
.rn .left-arrow::after { content: "Piano"; }
.rn .right-arrow { order: 2; border-left: 0; border-radius: 0 999px 999px 0; }
.rn .right-arrow::after { content: "Staff"; }
.rn .carousel-arrow:hover { color: var(--rn-ink); }
.rn .view-carousel:has(.keyboard-view.active) .left-arrow, .rn .view-carousel:has(.staff-view.active) .right-arrow { background: var(--rn-ink); border-color: var(--rn-ink); color: var(--rn-card); pointer-events: none; }

.rn .piano {
  --white-key-width: 34px; --white-key-height: 150px !important;
  display: flex; width: fit-content; max-width: 100%; height: var(--white-key-height); min-height: var(--white-key-height); margin: 0 auto;
  overflow: hidden; border-radius: 0 0 10px 10px; border-top: 5px solid var(--rn-key-black);
  box-shadow: 0 18px 30px rgba(0, 0, 0, 0.28);
}
.rn .piano:not(.one-octave):not(:has(.key-set:nth-child(15))) { --white-key-width: 46px; --white-key-height: 164px !important; }
.rn .piano.one-octave.one-octave { --white-key-width: 72px; --white-key-height: 186px !important; }
.rn .key-set { position: relative; display: flex; flex-direction: column; height: 100%; }
.rn .white-keys { display: flex; height: 100%; }
.rn .black-keys { position: absolute; top: 0; z-index: 1; display: flex; height: 60%; }
.rn .black-key-group { position: absolute; top: 0; left: calc(var(--white-key-width) * 0.23); z-index: 1; height: 60%; }
.rn .piano .white-key, .rn .piano .black-key { display: flex; flex-direction: column; justify-content: flex-end; align-items: center; }
.rn .piano .white-key {
  flex: 1; width: var(--white-key-width); background: var(--rn-key-white);
  border-right: 1px solid rgba(18, 20, 25, 0.28); border-radius: 0 0 6px 6px;
  box-shadow: inset 0 -10px 12px -8px rgba(18, 20, 25, 0.22);
}
.rn .piano .white-key:last-child { border-right: 0; }
.rn .piano .black-key {
  position: absolute; width: calc(var(--white-key-width) * 0.55); height: 100%; margin-left: calc(var(--white-key-width) * 0.5);
  background: var(--rn-key-black); border-radius: 0 0 5px 5px; box-shadow: inset 0 -6px 0 rgba(255, 255, 255, 0.07);
}
.rn .piano .white-key-label { padding-bottom: 10px; font-family: var(--rn-mono); font-size: 13px; font-weight: 500; color: #4A4E57; }
.rn .piano .black-key-label { padding-bottom: 6px; font-family: var(--rn-mono); font-size: 11px; font-weight: 500; line-height: 1.15; text-align: center; color: #D9D7D1; max-width: 2.4em; word-spacing: 3em; }
/* the note to play, a key held on a MIDI keyboard, and a key held correctly */
.rn .piano .active-display { background: var(--rn-accent); box-shadow: none; }
.rn .piano .active-midi { background: var(--rn-played); box-shadow: none; }
.rn .piano .correct-midi { background: var(--rn-correct); box-shadow: none; }
.rn .piano .active-display > .note-label, .rn .piano .active-midi > .note-label, .rn .piano .correct-midi > .note-label { color: #0E0F12; }

.rn .staff-view.active { max-width: 560px; min-height: 250px; margin: 0 auto; border-radius: 18px; background: var(--rn-paper); overflow: hidden; }
.rn .vexbox { display: flex; flex-direction: column; align-items: center; justify-content: flex-start; width: 100%; margin: 62px 0 34px; transform: scale(2.3); }

.rn #status-message { display: block; min-height: 0; text-align: center; font-size: 15px; font-weight: 600; color: var(--rn-played); opacity: 0; visibility: hidden; transition: opacity 0.25s ease-in-out, visibility 2s ease-in-out; }
.rn #status-message.show { margin-top: 12px; opacity: 1; visibility: visible; }

.rn #next-note-container { display: flex; align-items: baseline; justify-content: center; gap: 10px; height: 40px; margin: 18px 0 0; white-space: nowrap; }
.rn #next-note-word { font-family: var(--rn-mono); font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--rn-alt); }
.rn #next-note { font-family: var(--rn-display); font-stretch: 112%; font-weight: 800; font-size: 28px; line-height: 1; color: var(--rn-ink); }

/* ---------- Tempo slider, beats, start ---------- */
.rn .tempo-settings { display: flex; align-items: center; gap: 12px; min-width: 0; }
.rn .adjust-tempo-btn, .rn .measures .stepper {
  flex: none; display: flex; align-items: center; justify-content: center; border: 1px solid var(--rn-line-strong); border-radius: 50%;
  background: transparent; color: var(--rn-ink); font-family: var(--rn-mono); font-weight: 400; line-height: 1 !important; cursor: pointer; user-select: none;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.rn .adjust-tempo-btn { width: 44px; height: 44px; font-size: 22px; }
.rn .measures .stepper { width: 36px; height: 36px; font-size: 18px; }
.rn .adjust-tempo-btn:hover, .rn .measures .stepper:hover { background: var(--rn-ink); border-color: var(--rn-ink); color: var(--rn-card); }
.rn .tempo-settings > .slider { flex: 1; min-width: 0; width: auto; height: 28px; margin: 0; background: transparent; cursor: pointer; -webkit-appearance: none; appearance: none; }
.rn .tempo-settings > .slider::-webkit-slider-runnable-track { height: 6px; border-radius: 999px; background: var(--rn-line-strong); }
.rn .tempo-settings > .slider::-moz-range-track { height: 6px; border-radius: 999px; background: var(--rn-line-strong); }
.rn .tempo-settings > .slider::-webkit-slider-thumb { -webkit-appearance: none; width: 24px; height: 24px; margin-top: -9px; border: 0; border-radius: 50%; background: var(--rn-accent); box-shadow: 0 0 0 5px color-mix(in srgb, var(--rn-accent) 22%, transparent); }
.rn .tempo-settings > .slider::-moz-range-thumb { width: 24px; height: 24px; border: 0; border-radius: 50%; background: var(--rn-accent); box-shadow: 0 0 0 5px color-mix(in srgb, var(--rn-accent) 22%, transparent); }
.rn .tempo-tooltip { position: absolute; z-index: 3; padding: 4px 8px; border-radius: 8px; background: var(--rn-ink); color: var(--rn-card); font-family: var(--rn-mono); font-size: 13px; white-space: nowrap; pointer-events: none; opacity: 0; transition: opacity 0.2s; }

.rn .measures { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; }
.rn .measure-stepper { display: flex; align-items: center; gap: 12px; }
.rn .measure-count { min-width: 22px; font-family: var(--rn-display); font-stretch: 112%; font-weight: 800; font-size: 22px; line-height: 1; text-align: center; color: var(--rn-ink); }
.rn .beats-per-measure-text { font-family: var(--rn-mono); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; white-space: nowrap; color: var(--rn-muted); }

.rn .start-stop {
  display: flex; align-items: center; justify-content: center; min-width: 148px; height: 56px; padding: 0 28px; border-radius: 999px;
  background: var(--rn-accent); color: var(--rn-accent-ink); font-family: var(--rn-display); font-stretch: 112%; font-weight: 800; font-size: 17px;
  letter-spacing: 0.06em; line-height: 1 !important; cursor: pointer; user-select: none; transition: background-color 0.2s ease, transform 0.15s ease;
}
.rn .start-stop:hover { background: var(--rn-accent-hover); }
.rn .start-stop:active { transform: scale(0.97); }

/* ---------- Settings ---------- */
.rn .settings { display: flex; flex-direction: column; gap: 10px; }
.rn .settings > * { flex: none; }
.rn .display-settings, .rn .functionality-settings, .rn .midi-settings { border: 1px solid var(--rn-line); border-radius: 16px; background: var(--rn-soft); overflow: hidden; }
.rn .collapsible {
  display: flex; align-items: center; justify-content: space-between; flex-direction: row-reverse; gap: 12px; width: 100%; margin: 0; padding: 15px 18px;
  background: transparent; color: var(--rn-ink) !important; font-family: var(--rn-body); font-size: 16px; font-weight: 700; line-height: 1.2; text-align: left; cursor: pointer;
}
.rn .collapsible:hover { background: color-mix(in srgb, var(--rn-ink) 5%, transparent); }
.rn .collapsible .arrow { flex: none; display: inline-block; width: 9px; height: 9px; margin: 0 4px 3px 0; border-right: 2px solid var(--rn-label); border-bottom: 2px solid var(--rn-label); font-size: 0; transform: rotate(45deg); transition: transform 0.3s; }
.rn .collapsible.active .arrow { margin-bottom: -3px; transform: rotate(225deg); }
.rn .settings-content { max-height: 0; padding: 0 18px; overflow: hidden; transition: max-height 0.3s ease-out; }
.rn .settings-content.show { max-height: 1400px; transition: max-height 0.45s ease-in; }
.rn .settings-content > :last-child { margin-bottom: 16px; }

.rn .toggle-switch label, .rn .midi-settings label { display: flex; align-items: center; gap: 12px; min-height: 40px; margin: 0; color: var(--rn-text); font-size: 15px; cursor: pointer; }
.rn .midi-settings .settings-content > div { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.rn .midi-advance { flex-wrap: wrap; }
.rn .midi-advance span { margin: 0 !important; font-size: 13px; color: var(--rn-muted); }
.rn .midi-advance br { display: none; }
/* each tick box is drawn as a switch; it is still the same tick box underneath */
.rn .toggle-switch input[type="checkbox"], .rn .midi-settings input[type="checkbox"] {
  flex: none; position: relative; width: 40px; height: 24px; margin: 0; border: 0; border-radius: 999px; background: var(--rn-line-strong);
  -webkit-appearance: none; appearance: none; cursor: pointer; transition: background-color 0.2s ease;
}
.rn .toggle-switch input[type="checkbox"]::after, .rn .midi-settings input[type="checkbox"]::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--rn-ink); transition: transform 0.2s ease;
}
.rn .toggle-switch input[type="checkbox"]:checked, .rn .midi-settings input[type="checkbox"]:checked { background: var(--rn-accent); }
.rn .toggle-switch input[type="checkbox"]:checked::after, .rn .midi-settings input[type="checkbox"]:checked::after { transform: translateX(16px); background: var(--rn-accent-ink); }
.rn input:focus-visible, .rn select:focus-visible, .rn button:focus-visible, .rn .collapsible:focus-visible { outline: 3px solid var(--focus, #4FD1C5); outline-offset: 2px; }

.rn select {
  max-width: 100%; min-height: 38px; margin: 0 !important; padding: 6px 12px; border: 1px solid var(--rn-line-strong); border-radius: 10px;
  background: var(--rn-card); color: var(--rn-ink); font-family: var(--rn-body); font-size: 15px;
}
.rn .difficulty-settings { display: none; margin: 4px 0 10px; }
.rn .difficulty-settings label { display: flex; align-items: center; gap: 12px; color: var(--rn-text); font-size: 15px; font-weight: 400; }
.rn #voice-announcement-settings { margin: 2px 0 10px 52px; }
.rn #voice-announcement-settings > div { padding: 4px 0 !important; font-size: 15px !important; }
.rn #voice-announcement-settings label { gap: 10px; min-height: 0; font-size: 14px !important; color: var(--rn-muted); white-space: nowrap; }
.rn #voice-announcement-settings select { flex: 1 1 0; min-width: 0; width: auto !important; max-width: 280px; margin: 0 !important; }

.rn .note-range-slider, .rn .chord-range-slider { width: auto !important; margin: 18px 6px 6px !important; }
.rn .note-range-slider > label, .rn .chord-range-slider > label, .rn .note-selection > label, .rn .scale-selection > label {
  display: block; margin: 0 !important; font-family: var(--rn-mono); font-size: 11px !important; font-weight: 500 !important; letter-spacing: 0.1em; text-transform: uppercase; color: var(--rn-label) !important;
}
.rn #note-range, .rn #chord-range { height: 6px !important; margin: 20px 12px 0 !important; border: 0 !important; border-radius: 999px !important; background: var(--rn-line-strong) !important; box-shadow: none !important; }
.rn .noUi-connects { border-radius: 999px; }
.rn .noUi-connect { background: var(--rn-accent) !important; }
.rn .noUi-horizontal .noUi-handle { top: -9px !important; right: -12px !important; width: 24px !important; height: 24px !important; border: 0 !important; border-radius: 50% !important; background: var(--rn-ink) !important; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35) !important; cursor: grab; }
.rn .noUi-handle::before, .rn .noUi-handle::after { display: none !important; }
.rn .range-labels { display: flex !important; justify-content: space-between !important; margin: 14px 0 6px !important; font-family: var(--rn-mono); font-size: 12px; color: var(--rn-muted); }

.rn .note-selection, .rn .scale-selection { margin-top: 16px !important; padding-top: 16px !important; border-top: 1px solid var(--rn-line) !important; }
.rn .piano-checkboxes { display: flex; justify-content: center; margin: 14px 0 4px; }
.rn .piano-checkboxes .white-key, .rn .piano-checkboxes .black-key { position: relative; }
.rn .piano-checkboxes .white-key { width: 34px; height: 104px; background: var(--rn-key-white); border-right: 1px solid rgba(18, 20, 25, 0.28); border-radius: 0 0 5px 5px; }
.rn .piano-checkboxes .black-key { z-index: 1; width: 26px; height: 62px; margin: 0 -13px; background: var(--rn-key-black); border-radius: 0 0 4px 4px; }
.rn .piano-checkboxes label { position: absolute; left: 50%; bottom: 26px; transform: translateX(-50%); margin: 0 !important; font-family: var(--rn-mono); font-size: 11px !important; font-weight: 500 !important; line-height: 1.2 !important; letter-spacing: 0; text-transform: none; text-align: center; color: #4A4E57 !important; }
.rn .piano-checkboxes .black-key label { bottom: 24px; color: #D9D7D1 !important; }
.rn .piano-checkboxes input[type="checkbox"] { position: absolute; left: 50%; bottom: 5px; transform: translateX(-50%); width: 16px; height: 16px; margin: 0 !important; accent-color: var(--rn-accent); cursor: pointer; }

.rn .scale-content { margin: 12px 0 0 !important; padding: 0 !important; gap: 10px !important; }
.rn .scale-selection-item label, .rn .scale-content label { width: 100px; margin: 0 !important; font-size: 15px !important; font-weight: 400 !important; color: var(--rn-text) !important; }
.rn .scale-content select { flex: 1 1 auto !important; max-width: 280px; }
.rn .scale-content > div:last-child { margin-top: 4px !important; }
.rn .scale-content > div:last-child > label { width: auto; font-weight: 400 !important; color: var(--rn-muted) !important; }
.rn #scale-notes-preview { width: 100%; margin-top: 8px !important; padding: 10px 12px !important; border-radius: 10px !important; background: var(--rn-card) !important; color: var(--rn-ink) !important; font-family: var(--rn-mono) !important; font-size: 13px !important; }

.rn .reset-settings-container { display: flex; justify-content: center; margin-top: 6px; }
.rn .reset-settings-btn { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; padding: 0 14px; border: 0; border-radius: 999px; background: transparent; color: var(--rn-muted); font-family: var(--rn-body); font-size: 14px; font-weight: 600; cursor: pointer; }
.rn .reset-settings-btn:hover { background: color-mix(in srgb, var(--rn-ink) 7%, transparent); color: var(--rn-ink); }
.rn .reset-settings-btn span { color: var(--rn-accent) !important; font-size: 17px !important; }

/* ---------- Phones ---------- */
@media (max-width: 700px) {
  .rn .segmented-control-btn { min-height: 38px; padding: 0 13px; font-size: 14px; }
  .rn .random-note { height: 132px; font-size: 112px; }
  .rn .random-note.advanced-font { font-size: 56px; }
  /* an interval ("A♭ ↑TT") or a chord ("G♯dim") is longer than a note name and has to fit the screen */
  .rn:has(.segmented-control-btn.active:is([data-mode="intervals"], [data-mode="chords"])) .random-note:not(.advanced-font) { font-size: 84px; }
  .rn { --rn-room: calc(100vw - 80px); }
  .rn .piano { --white-key-width: calc(var(--rn-room) / 21); --white-key-height: 92px !important; }
  .rn .piano:not(.one-octave):not(:has(.key-set:nth-child(15))) { --white-key-width: calc(var(--rn-room) / 14); --white-key-height: 112px !important; }
  .rn .piano.one-octave.one-octave { --white-key-width: min(calc(var(--rn-room) / 7), 60px); --white-key-height: 150px !important; }
  .rn .piano .white-key-label { font-size: 12px; }
  .rn .piano:not(.one-octave) .note-label { display: none; }
  .rn .staff-view.active { min-height: 200px; }
  .rn .vexbox { margin: 46px 0 26px; transform: scale(1.7); }
  .rn .start-stop { min-width: 128px; }
  .rn .piano-checkboxes .white-key { width: 30px; }
  .rn .piano-checkboxes .black-key { width: 24px; margin: 0 -12px; }
  .rn #voice-announcement-settings { margin-left: 0; }
}

/* ---------- Focus ----------
   Nothing on screen but the note, the keyboard and the controls. Every setting is one tap away in a
   sheet (a side drawer on a wide screen, a bottom sheet on a phone). */
.rn {
  position: relative; max-width: 860px; margin: 10px auto 0;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  grid-template-areas:
    "modes modes  modes modes"
    "stage stage  stage stage"
    "tempo slider beats start"
    "open  open   open  open";
  align-items: center; gap: 26px 22px;
}
.rn .random-note { height: 216px; font-size: 190px; }
.rn .random-note.advanced-font { font-size: 96px; }
.rn .piano.one-octave { --white-key-height: 230px !important; }

/* the control bar: one rounded strip behind the four controls of that row */
.rn::after { content: ""; grid-row: 3; grid-column: 1 / -1; align-self: stretch; margin: -12px 0; border: 1px solid var(--rn-line); border-radius: 999px; background: var(--rn-card); }
.rn .speed-box, .rn .tempo-settings, .rn .measures, .rn .start-stop { position: relative; z-index: 1; grid-row: 3; }
.rn .speed-box { margin-left: 30px; }
.rn .start-stop { margin-right: 10px; }

.rn .rn-sheet-open {
  grid-area: open; justify-self: center; display: inline-flex; align-items: center; gap: 10px; min-height: 46px; padding: 0 22px;
  border: 1px solid var(--rn-line-strong); border-radius: 999px; color: var(--rn-ink); font-size: 15px; font-weight: 700; cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.rn .rn-sheet-open::before { content: ""; width: 16px; height: 12px; border-top: 2px solid currentColor; border-bottom: 2px solid currentColor; background: linear-gradient(currentColor, currentColor) center / 100% 2px no-repeat; }
.rn .rn-sheet-open:hover { background: var(--rn-ink); border-color: var(--rn-ink); color: var(--rn-card); }

.rn .rn-sheet-shade { position: fixed; z-index: 50; top: 0; left: 0; width: 100%; height: 100%; background: rgba(8, 9, 11, 0.6); opacity: 0; pointer-events: none; transition: opacity 0.3s ease; }
.rn .settings {
  position: fixed; z-index: 60; top: 0; right: 0; bottom: 0; width: min(440px, 100%); gap: 10px; padding: 0 20px 24px;
  border-left: 1px solid var(--rn-line); background: var(--bg, #0E0F12); overflow-y: auto; box-shadow: -24px 0 48px rgba(0, 0, 0, 0.4);
  transform: translateX(105%); visibility: hidden; transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1), visibility 0s 0.35s;
}
.rn .rn-sheet-head { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; margin: 0 -20px 4px; padding: 18px 20px 14px; background: var(--bg, #0E0F12); border-bottom: 1px solid var(--rn-line); }
.rn .rn-sheet-head span { font-family: var(--rn-display); font-stretch: 112%; font-weight: 800; font-size: 22px; color: var(--rn-ink); }
.rn .rn-sheet-close { display: inline-flex; align-items: center; min-height: 40px; padding: 0 18px; border: 0; border-radius: 999px; font-family: var(--rn-body); background: var(--rn-ink); color: var(--rn-card); font-size: 14px; font-weight: 700; cursor: pointer; }
.rn.rn--sheet-open .rn-sheet-shade { opacity: 1; pointer-events: auto; }
.rn.rn--sheet-open .settings { transform: none; visibility: visible; transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1), visibility 0s; }

@media (max-width: 700px) {
  .rn {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "modes  modes"
      "stage  stage"
      "tempo  start"
      "slider slider"
      "beats  open";
    gap: 18px 12px;
  }
  .rn .random-note { height: 150px; font-size: 128px; }
  .rn .random-note.advanced-font { font-size: 60px; }
  .rn .piano.one-octave { --white-key-height: 50vw !important; }
  .rn::after { grid-row: 3 / 5; margin: -10px 0; border-radius: 26px; }
  .rn .speed-box, .rn .start-stop { grid-row: 3; }
  .rn .tempo-settings { grid-row: 4; margin: 0 12px 4px; }
  .rn .speed-box { margin-left: 22px; }
  .rn .measures { grid-row: 5; flex-direction: row; justify-content: flex-start; gap: 12px; padding-left: 6px; }
  .rn .beats-per-measure-text { white-space: normal; max-width: 62px; line-height: 1.2; }
  .rn .rn-sheet-open { grid-row: 5; justify-self: end; }
  /* the sheet rises from the bottom and leaves the top of the tool in view */
  .rn .settings { top: 14vh; left: 0; width: 100%; border-left: 0; border-top: 1px solid var(--rn-line); border-radius: 24px 24px 0 0; box-shadow: 0 -24px 48px rgba(0, 0, 0, 0.45); transform: translateY(105%); }
  .rn .rn-sheet-head { border-radius: 24px 24px 0 0; }
}

/* ---------- Beat lights, and the gear on the Settings button ---------- */
.rn {
  --rn-note-h: 216px;
  --rn-gear: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill-rule='evenodd' d='M19.78 10.13L22.90 10.54L22.90 13.46L19.78 13.87L18.82 16.18L20.74 18.67L18.67 20.74L16.18 18.82L13.87 19.78L13.46 22.90L10.54 22.90L10.13 19.78L7.82 18.82L5.33 20.74L3.26 18.67L5.18 16.18L4.22 13.87L1.10 13.46L1.10 10.54L4.22 10.13L5.18 7.82L3.26 5.33L5.33 3.26L7.82 5.18L10.13 4.22L10.54 1.10L13.46 1.10L13.87 4.22L16.18 5.18L18.67 3.26L20.74 5.33L18.82 7.82ZM8.70 12.00a3.30 3.30 0 1 0 6.60 0a3.30 3.30 0 1 0 -6.60 0Z'/%3E%3C/svg%3E");
}
.rn .random-note { height: var(--rn-note-h); }

/* beat lights: one per beat of the measure, in the gap under the note */
.rn .view-carousel { margin-top: 42px; }
.rn .rn-beats {
  grid-area: stage; align-self: start; justify-self: center; display: flex; align-items: center; gap: 10px; height: 16px;
  margin-top: calc(var(--rn-note-h) + 12px); pointer-events: none;
}
.rn .rn-beats i { display: block; width: 10px; height: 10px; border-radius: 50%; background: var(--rn-line-strong); transition: background-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease; }
/* a light comes on at once and fades out */
.rn .rn-beats i.on { background: var(--rn-accent); transform: scale(1.35); transition-duration: 0s; }

/* the Settings button carries a gear, like the one in the logo */
.rn .rn-sheet-open::before {
  width: 18px; height: 18px; border: 0; background: currentColor;
  -webkit-mask: var(--rn-gear) center / contain no-repeat; mask: var(--rn-gear) center / contain no-repeat;
  transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.rn .rn-sheet-open:hover::before, .rn.rn--sheet-open .rn-sheet-open::before { transform: rotate(90deg); }

@media (max-width: 700px) {
  .rn { --rn-note-h: 150px; }
}

/* ---------- A colour per mode ----------
   Each mode has its own colour, as the tool always had, and that colour runs through everything: the
   mode button, the note, the lit key, the beat lights, the slider and START. */
@property --rn-mode { syntax: '<color>'; inherits: true; initial-value: #FF6A1A; }
@property --rn-mode-text { syntax: '<color>'; inherits: true; initial-value: #FF7A33; }

.rn {
  /* the colour as a fill, and as lettering on the page */
  --m-notes: #FF6A1A; --m-intervals: #4FD1C5; --m-chords: #B79CFF; --m-ear: #FFC53D;
  --t-notes: #FF7A33; --t-intervals: #4FD1C5; --t-chords: #B79CFF; --t-ear: #FFC53D;
  --rn-mode: var(--m-notes); --rn-mode-text: var(--t-notes);
  --rn-accent: var(--rn-mode); --rn-accent-hover: color-mix(in srgb, var(--rn-mode) 80%, #fff); --rn-accent-ink: #0E0F12;
  --rn-label: var(--rn-mode-text);
  transition: --rn-mode 0.45s ease, --rn-mode-text 0.45s ease;
}
:root[data-theme="light"] .rn {
  --m-intervals: #3CC7BA; --m-chords: #A98BFA; --m-ear: #F9B62B;
  --t-notes: #C2410C; --t-intervals: #0B6B63; --t-chords: #5A3BC9; --t-ear: #8A5A00;
}
.rn:has(.segmented-control-btn.active[data-mode="intervals"]) { --rn-mode: var(--m-intervals); --rn-mode-text: var(--t-intervals); }
.rn:has(.segmented-control-btn.active[data-mode="chords"]) { --rn-mode: var(--m-chords); --rn-mode-text: var(--t-chords); }
.rn:has(.segmented-control-btn.active[data-mode="ear"]) { --rn-mode: var(--m-ear); --rn-mode-text: var(--t-ear); }

/* the mode buttons: each label in its own colour, the chosen one filled with it */
.rn .segmented-control-btn[data-mode="notes"] { --own: var(--m-notes); --own-text: var(--t-notes); }
.rn .segmented-control-btn[data-mode="intervals"] { --own: var(--m-intervals); --own-text: var(--t-intervals); }
.rn .segmented-control-btn[data-mode="chords"] { --own: var(--m-chords); --own-text: var(--t-chords); }
.rn .segmented-control-btn[data-mode="ear"] { --own: var(--m-ear); --own-text: var(--t-ear); }
.rn .segmented-control-btn { color: var(--own-text); }
.rn .segmented-control-btn:hover { color: var(--own-text); background: color-mix(in srgb, var(--own) 16%, transparent); }
.rn .segmented-control-btn.active { background: var(--own); color: #0E0F12; }

/* the note in the mode's colour, on a soft wash of it */
.rn::before {
  content: ""; grid-area: stage; align-self: start; justify-self: center; width: min(680px, 100%); height: calc(var(--rn-note-h) + 90px); margin-top: -46px;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--rn-mode) 26%, transparent), transparent); pointer-events: none;
}
.rn .random-note { color: var(--rn-mode-text); }
.rn #next-note-word, .rn .speed-name { color: var(--rn-mode-text); }

.rn .rn-beats i.on.down { transform: scale(1.8); }

/* the control strip takes a tint of the colour */
.rn::after { background: color-mix(in srgb, var(--rn-mode) 9%, var(--rn-card)); border-color: color-mix(in srgb, var(--rn-mode) 42%, var(--rn-line)); }
.rn .adjust-tempo-btn:hover, .rn .measures .stepper:hover { background: var(--rn-mode); border-color: var(--rn-mode); color: #0E0F12; }
/* running: the button empties to an outline, so START is the loud one */
.rn.rn--running .start-stop { background: transparent; color: var(--rn-mode-text); box-shadow: inset 0 0 0 2px var(--rn-mode); }
.rn .rn-sheet-open:hover { background: var(--rn-mode); border-color: var(--rn-mode); color: #0E0F12; }

/* ---------- The frame ----------
   The tool takes the whole first screen, edge to edge: a slim bar with its name, the stage, and a dock along
   the bottom with the main button. Settings open as a sheet. Designed for a phone first; a computer gets the
   same thing with more room. The page around it (its title, text, comments) starts below that screen. */
.rn {
  --app-top: 0px;                                /* how far down the page the tool starts; the script measures it */
  --app-pad: max(16px, calc(50vw - 600px));      /* content stays within 1200px, backgrounds run to the edges */
  --app-c: #FF6A1A; --app-ct: #FF7A33;           /* the tool's own colour: as a fill, and as lettering */
  --app-expand: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 9V4h5M15 4h5v5M20 15v5h-5M9 20H4v-5'/%3E%3C/svg%3E");
  --app-gear: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill-rule='evenodd' d='M19.78 10.13L22.90 10.54L22.90 13.46L19.78 13.87L18.82 16.18L20.74 18.67L18.67 20.74L16.18 18.82L13.87 19.78L13.46 22.90L10.54 22.90L10.13 19.78L7.82 18.82L5.33 20.74L3.26 18.67L5.18 16.18L4.22 13.87L1.10 13.46L1.10 10.54L4.22 10.13L5.18 7.82L3.26 5.33L5.33 3.26L7.82 5.18L10.13 4.22L10.54 1.10L13.46 1.10L13.87 4.22L16.18 5.18L18.67 3.26L20.74 5.33L18.82 7.82ZM8.70 12.00a3.30 3.30 0 1 0 6.60 0a3.30 3.30 0 1 0 -6.60 0Z'/%3E%3C/svg%3E");
  box-sizing: border-box; width: 100%; max-width: none; margin: 0;
  min-height: max(540px, calc(100vh - var(--app-top)));
  min-height: max(540px, calc(100dvh - var(--app-top)));
  padding: 6px var(--app-pad) 14px;
}

/* full screen: nothing above the tool */
:fullscreen > .rn, .rn:fullscreen, html.rn-full .rn { --app-top: 0px; }
.rn:fullscreen { overflow-y: auto; background: var(--bg, #0E0F12); }

/* the name, and the buttons beside it */
.rn .rn-name {
  display: flex; align-items: center; gap: 10px; min-height: 40px;
  font-family: var(--rn-mono); font-size: 12px; font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase; white-space: nowrap; color: var(--app-ct);
}
.rn .rn-name::before { content: ""; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--app-c); }
.rn .rn-full, .rn .rn-sheet-open {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 40px; min-width: 40px; height: 40px; min-height: 40px; margin: 0; padding: 0;
  border: 1px solid var(--rn-line-strong); border-radius: 999px; background: transparent; color: var(--rn-ink); font-family: var(--rn-body); font-size: 0; font-weight: 700; cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.rn .rn-full:hover, .rn .rn-sheet-open:hover { background: var(--app-c); border-color: var(--app-c); color: #0E0F12; }
.rn .rn-full::before { content: ""; width: 16px; height: 16px; background: currentColor; -webkit-mask: var(--app-expand) center / contain no-repeat; mask: var(--app-expand) center / contain no-repeat; }

/* the layout in the frame (phone first) */
.rn {
  --app-c: var(--rn-mode); --app-ct: var(--rn-mode-text);
  /* the note and the keyboard share whatever height the screen leaves */
  --rn-note-h: clamp(66px, calc(42dvh - 231px), 170px);
  --rn-kb-h: clamp(92px, calc(58dvh - 320px), 230px);
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  grid-template-rows: auto auto auto 1fr auto auto;
  grid-template-areas:
    "bar   bar    bar    bar"
    "modes modes  modes  modes"
    "setup setup  setup  setup"
    "stage stage  stage  stage"
    "tempo slider slider slider"
    "beats beats  start  start";
  gap: 8px 12px; align-items: center;
}
/* the name on the left of the bar, the two buttons together on its right */
.rn .rn-name { grid-area: bar; justify-self: start; }
.rn .rn-sheet-open { grid-area: bar; justify-self: end; margin-right: 52px; }
.rn .rn-full { grid-area: bar; justify-self: end; }
.rn .segmented-control-container { grid-area: modes; }
.rn > .rn-stage { grid-area: stage; align-self: start; }
.rn .speed-box { grid-area: tempo; margin: 0; }
.rn .tempo-settings { grid-area: slider; margin: 0; }
.rn .measures { grid-area: beats; justify-self: start; flex-direction: row; gap: 12px; padding: 0; }
.rn .beats-per-measure-text { white-space: normal; max-width: 62px; line-height: 1.2; }
.rn .start-stop { grid-area: start; min-width: 150px; height: 52px; margin: 0; }
/* the dock: one bar across the bottom of the screen, behind the two rows of controls */
.rn::after { grid-area: 5 / 1 / 7 / -1; align-self: stretch; margin: -10px calc(-1 * var(--app-pad)) -14px; border-width: 1px 0 0; border-radius: 0; }

.rn .random-note { font-size: calc(var(--rn-note-h) * 0.86); }
.rn .random-note.advanced-font { font-size: min(60px, calc(var(--rn-note-h) * 0.44)); }
.rn.rn:has(.segmented-control-btn.active:is([data-mode="intervals"], [data-mode="chords"])) .random-note:not(.advanced-font) { font-size: min(84px, calc(var(--rn-note-h) * 0.62)); }
.rn .view-carousel { margin-top: 36px; }
.rn .carousel-container { margin-top: 14px; }
.rn #next-note-container { height: 34px; margin-top: 14px; }
.rn.rn .piano { --white-key-height: min(var(--rn-kb-h), 160px) !important; }
.rn.rn .piano:not(.one-octave):not(:has(.key-set:nth-child(15))) { --white-key-height: min(var(--rn-kb-h), 170px) !important; }
.rn.rn .piano.one-octave.one-octave { --white-key-height: var(--rn-kb-h) !important; }
.rn .staff-view.active { min-height: max(150px, var(--rn-kb-h)); }
.rn .adjust-tempo-btn { width: 40px; height: 40px; }

@media (min-width: 900px) {
  .rn { --app-pad: max(24px, calc(50vw - 600px)); padding-top: 12px; padding-bottom: 18px; }
  .rn {
    --rn-note-h: clamp(88px, calc(42dvh - 197px), 216px);
    --rn-kb-h: clamp(122px, calc(58dvh - 272px), 240px);
    grid-template-rows: auto auto 1fr auto;
    grid-template-areas:
      "bar   bar    bar   bar"
      "setup setup  setup setup"
      "stage stage  stage stage"
      "tempo slider beats start";
    gap: 14px 22px;
  }
  /* the modes sit in the middle of the bar, between the name and the two buttons */
  .rn .segmented-control-container { grid-area: 1 / 1 / 2 / -1; justify-self: center; }
  .rn .rn-sheet-open { width: auto; padding: 0 16px 0 13px; font-size: 14px; }
  .rn .measures { flex-direction: column; gap: 6px; justify-self: center; }
  .rn .beats-per-measure-text { white-space: nowrap; max-width: none; }
  .rn .start-stop { height: 56px; }
  .rn::after { grid-area: 4 / 1 / 5 / -1; margin: -14px calc(-1 * var(--app-pad)) -18px; }
  .rn .rn-setup { flex-direction: row; justify-content: center; }
  /* a chip's control opens as a small panel under the bar, not as the full-height drawer */
  .rn[data-setup] .settings { top: calc(var(--app-top) + 64px); right: var(--app-pad); bottom: auto; width: 420px; max-height: calc(100dvh - var(--app-top) - 96px); border: 1px solid var(--rn-line); border-radius: 20px; }
  .rn .random-note.advanced-font { font-size: min(96px, calc(var(--rn-note-h) * 0.46)); }
  .rn.rn:has(.segmented-control-btn.active:is([data-mode="intervals"], [data-mode="chords"])) .random-note:not(.advanced-font) { font-size: calc(var(--rn-note-h) * 0.8); }
  .rn.rn .piano { --white-key-height: min(var(--rn-kb-h), 190px) !important; }
  .rn.rn .piano:not(.one-octave):not(:has(.key-set:nth-child(15))) { --white-key-height: min(var(--rn-kb-h), 200px) !important; }
  .rn .view-carousel { margin-top: 42px; }
  .rn .adjust-tempo-btn { width: 44px; height: 44px; }
}

/* ---------- The set-up on the main screen ----------
   What is practised (scale, range, notes, chord difficulty) and how it plays (repeat, sound, voice) sit
   under the mode buttons, each showing its current value. Repeat, Sound and Inversions switch at a tap:
   they work the tool's own tick boxes. The others open the settings sheet at just their own control. */
.rn .rn-setup { grid-area: setup; display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; }
.rn .rn-setup > div { display: flex; justify-content: center; gap: 6px; max-width: 100%; }
.rn .rn-chip {
  display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 3px; height: 40px; margin: 0; padding: 0 11px;
  border: 1px solid var(--rn-line-strong); border-radius: 12px; background: transparent; color: var(--rn-ink); font-family: var(--rn-body); text-align: left; white-space: nowrap; cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.rn .rn-chip b { font-size: 13px; font-weight: 700; line-height: 1; }
.rn .rn-chip:hover { border-color: var(--app-c); }
/* which chips a mode has */
.rn:not(:has(.segmented-control-btn.active[data-mode="chords"])) .rn-chip--chords { display: none; }
.rn:has(.segmented-control-btn.active[data-mode="ear"]) .rn-chip[data-for="mute-notes-toggle"] { display: none; }
/* a chip's own control: the sheet, showing nothing else (on a phone it is only as tall as that control) */
@media (max-width: 899px) { .rn[data-setup] .settings { top: auto; max-height: 86dvh; } }
.rn[data-setup] .settings > :not(.rn-sheet-head):not(.functionality-settings) { display: none; }
.rn[data-setup] .functionality-settings { border: 0; background: none; overflow: visible; }
.rn[data-setup] .functionality-settings > .collapsible { display: none; }
.rn[data-setup] .functionality-settings > .settings-content { max-height: none !important; padding: 0; overflow: visible; }
.rn[data-setup] .functionality-settings > .settings-content > * { display: none !important; }
.rn[data-setup="scale"] .settings-content > .scale-selection,
.rn[data-setup="notes"] .settings-content > .note-selection,
.rn[data-setup="difficulty"] .settings-content > .difficulty-settings,
.rn[data-setup="difficulty"] .settings-content > .toggle-switch[data-mode="chords"],
.rn[data-setup="range"] .settings-content > .toggle-switch[data-functionality],
.rn[data-setup="voice"] .settings-content > .toggle-switch[data-functionality] { display: block !important; }
.rn[data-setup="range"] .toggle-switch[data-functionality] > :not(.note-range-slider):not(.chord-range-slider),
.rn[data-setup="voice"] .toggle-switch[data-functionality] > :not(:first-child):not(#voice-announcement-settings) { display: none !important; }
.rn[data-setup] .note-selection, .rn[data-setup] .scale-selection { margin-top: 0 !important; padding-top: 4px !important; border-top: 0 !important; }
.rn[data-setup] .note-range-slider, .rn[data-setup] .chord-range-slider { margin-top: 6px !important; }

/* a short phone screen: the chips share one line and slide sideways */
@media (max-width: 899px) and (max-height: 740px) {
  .rn .rn-setup { flex-direction: row; justify-content: flex-start; overflow-x: auto; scrollbar-width: none; margin: 0 calc(-1 * var(--app-pad)); padding: 0 var(--app-pad); }
  .rn .rn-setup::-webkit-scrollbar { display: none; }
  .rn .rn-setup > div { flex: none; max-width: none; }
  .rn { --rn-note-h: clamp(66px, calc(42dvh - 211px), 170px); --rn-kb-h: clamp(92px, calc(58dvh - 294px), 230px); }
}

/* on a phone the sheet of music is drawn a little smaller, so staff view is one screen tall as well */
@media (max-width: 899px) {
  .rn .vexbox { margin: 16px 0 2px; transform: scale(1.45); }
}
/* on a computer the chips are one row */
@media (min-width: 900px) {
  .rn .rn-setup { flex-direction: row; justify-content: center; gap: 6px; }
  .rn .rn-chip { height: 44px; padding: 0 13px; }
  .rn .rn-chip b { font-size: 14px; }
}

/* the set-up's icons */
.rn {
  --ico-scale: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 20h5v-5h5v-5h5V5h3'/%3E%3C/svg%3E");
  --ico-range: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 12h18M7 8l-4 4 4 4M17 8l4 4-4 4'/%3E%3C/svg%3E");
  --ico-notes: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 5h18v14H3zM9 13v6M15 13v6M9 5v8M15 5v8'/%3E%3C/svg%3E");
  --ico-difficulty: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.8' stroke-linecap='round'%3E%3Cpath d='M5 20v-3M10 20v-7M15 20V9M20 20V5'/%3E%3C/svg%3E");
  --ico-inversions: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 20V4M3 8l4-4 4 4M17 4v16M13 16l4 4 4-4'/%3E%3C/svg%3E");
  --ico-repeat: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12v-1a3 3 0 0 1 3-3h10M15 5l3 3-3 3M19 12v1a3 3 0 0 1-3 3H6M9 13l-3 3 3 3'/%3E%3C/svg%3E");
  --ico-sound: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 10v4h3l5 4V6l-5 4zM16 9a4.5 4.5 0 0 1 0 6M18.5 6.5a8 8 0 0 1 0 11'/%3E%3C/svg%3E");
  --ico-muted: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 10v4h3l5 4V6l-5 4zM16 9.5l5 5M21 9.5l-5 5'/%3E%3C/svg%3E");
  --ico-voice: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 5h14a2 2 0 0 1 2 2v7a2 2 0 0 1-2 2h-8l-5 4v-4H5a2 2 0 0 1-2-2V7a2 2 0 0 1 2-2z'/%3E%3C/svg%3E");
}
/* an icon shows only where a rule below asks for it: on Scale and on the switches */
.rn .rn-ico { display: none; flex: none; width: 16px; height: 16px; background: currentColor; -webkit-mask: var(--ico) center / contain no-repeat; mask: var(--ico) center / contain no-repeat; }
.rn .rn-ico--scale { --ico: var(--ico-scale); }
.rn .rn-ico--range { --ico: var(--ico-range); }
.rn .rn-ico--notes { --ico: var(--ico-notes); }
.rn .rn-ico--difficulty { --ico: var(--ico-difficulty); }
.rn .rn-ico--inversions { --ico: var(--ico-inversions); }
.rn .rn-ico--repeat { --ico: var(--ico-repeat); }
.rn .rn-ico--sound { --ico: var(--ico-sound); }
.rn:has(#mute-notes-toggle:checked) .rn-ico--sound { --ico: var(--ico-muted); }
.rn .rn-ico--voice { --ico: var(--ico-voice); }

/* the tiles: what is practised, each drawn */
.rn .rn-setup, .rn .rn-setup > div { gap: 7px; align-items: center; }
.rn .rn-chip { flex-direction: row; align-items: center; gap: 9px; height: 42px; padding: 0 13px 0 11px; border: 0; border-radius: 13px; background: var(--rn-soft); color: var(--rn-ink); }
.rn .rn-chip:hover { background: color-mix(in srgb, var(--app-c) 18%, var(--rn-soft)); }
.rn .rn-chip small { display: none; }
.rn .rn-chip b { font-size: 13px; }
.rn .rn-chip[data-setup="scale"] .rn-ico { display: block; width: 18px; height: 18px; color: var(--app-ct); }
/* the range: a bar with the chosen stretch filled in */
.rn .rn-pic--range { display: block; position: relative; flex: none; width: 40px; height: 6px; border-radius: 3px; background: var(--rn-line-strong); }
.rn .rn-pic--range i { position: absolute; top: 0; bottom: 0; left: var(--from, 20%); right: calc(100% - var(--to, 70%)); min-width: 6px; border-radius: 3px; background: var(--app-c); }
.rn .rn-pic--range i::before, .rn .rn-pic--range i::after { content: ""; position: absolute; top: -3px; width: 12px; height: 12px; border-radius: 50%; background: var(--rn-ink); }
.rn .rn-pic--range i::before { left: -6px; }
.rn .rn-pic--range i::after { right: -6px; }
/* the notes: one octave of keys, the ones in play lit */
.rn .rn-pic--keys { display: flex; flex: none; align-items: flex-start; height: 22px; }
.rn .rn-pic--keys i { display: block; flex: none; }
.rn .rn-pic--keys i.w { width: 6px; height: 22px; margin-right: 1px; border-radius: 0 0 2px 2px; background: color-mix(in srgb, var(--rn-ink) 22%, transparent); }
.rn .rn-pic--keys i.b { position: relative; z-index: 1; width: 5px; height: 13px; margin: 0 -2px 0 -3px; border-radius: 0 0 2px 2px; background: color-mix(in srgb, var(--rn-ink) 45%, var(--rn-soft)); }
.rn .rn-pic--keys i.w.on { background: var(--app-c); }
.rn .rn-pic--keys i.b.on { background: color-mix(in srgb, var(--app-c) 55%, #0E0F12); }
/* the difficulty: five bars, lit up to the level chosen */
.rn .rn-pic--level { display: flex; flex: none; align-items: flex-end; gap: 2px; height: 18px; }
.rn .rn-pic--level i { display: block; width: 4px; border-radius: 1px; background: var(--rn-line-strong); }
.rn .rn-pic--level i:nth-child(1) { height: 6px; }
.rn .rn-pic--level i:nth-child(2) { height: 9px; }
.rn .rn-pic--level i:nth-child(3) { height: 12px; }
.rn .rn-pic--level i:nth-child(4) { height: 15px; }
.rn .rn-pic--level i:nth-child(5) { height: 18px; }
.rn .rn-pic--level i.on { background: var(--app-c); }
@media (min-width: 900px) {
  .rn .rn-chip { height: 44px; }
}
/* one flow that wraps where it must, so Chords can take a third line on a phone */
.rn .rn-setup { flex-direction: row; flex-wrap: wrap; justify-content: center; gap: 8px; }
.rn .rn-setup > div { display: contents; }
.rn .rn-chip { padding: 0 12px 0 10px; }
/* the switches: the same height as the tiles, named, hollow when off and filled when on */
.rn .rn-chip--switch, .rn .rn-chip[data-setup="voice"] { gap: 7px; padding: 0 14px 0 11px; background: transparent; box-shadow: inset 0 0 0 1.5px var(--rn-line-strong); color: var(--rn-muted); }
.rn .rn-chip--switch:hover, .rn .rn-chip[data-setup="voice"]:hover { background: transparent; box-shadow: inset 0 0 0 1.5px var(--app-c); }
.rn .rn-chip--switch .rn-ico, .rn .rn-chip[data-setup="voice"] .rn-ico { display: block; color: inherit; }
.rn .rn-chip--switch small, .rn .rn-chip[data-setup="voice"] small { display: block; font-family: var(--rn-body); font-size: 14px; font-weight: 700; line-height: 1; letter-spacing: 0; text-transform: none; color: inherit; }
.rn .rn-chip--switch b, .rn .rn-chip[data-setup="voice"] b { display: none; }
.rn:has(#repeat-note-toggle:checked) .rn-chip[data-for="repeat-note-toggle"],
.rn:has(#inversions-toggle:checked) .rn-chip[data-for="inversions-toggle"],
.rn:has(#voice-announcement-toggle:checked) .rn-chip[data-setup="voice"],
.rn:not(:has(#mute-notes-toggle:checked)) .rn-chip[data-for="mute-notes-toggle"] { background: var(--app-c); box-shadow: none; color: #0E0F12; }
.rn:has(#mute-notes-toggle:checked) .rn-chip[data-for="mute-notes-toggle"] { background: transparent; box-shadow: inset 0 0 0 1.5px var(--rn-line-strong); color: var(--rn-muted); }
.rn:has(#mute-notes-toggle:checked) .rn-chip[data-for="mute-notes-toggle"] small { color: inherit; }

/* tooltips, only where there is a mouse to point with: what it is, and what a click does */
@media (hover: hover) and (pointer: fine) {
  .rn .rn-chip { position: relative; }
  .rn .rn-chip::before, .rn .rn-chip::after { position: absolute; left: 50%; z-index: 30; opacity: 0; pointer-events: none; transition: opacity 0.15s ease, transform 0.15s ease; }
  .rn .rn-chip::before { content: ""; top: calc(100% + 4px); border: 6px solid transparent; border-top: 0; border-bottom-color: var(--rn-ink); transform: translate(-50%, -4px); }
  .rn .rn-chip::after {
    content: attr(data-tip); top: calc(100% + 10px); width: max-content; max-width: 250px; padding: 8px 11px; border-radius: 10px; background: var(--rn-ink); color: var(--rn-card);
    font-family: var(--rn-body); font-size: 13px; font-weight: 600; line-height: 1.35; letter-spacing: 0; text-transform: none; text-align: left; white-space: normal;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35); transform: translate(-50%, -4px);
  }
  .rn .rn-chip:hover::before, .rn .rn-chip:hover::after, .rn .rn-chip:focus-visible::before, .rn .rn-chip:focus-visible::after { opacity: 1; transform: translate(-50%, 0); transition-delay: 0.25s; }
  .rn:has(.segmented-control-btn.active[data-mode="chords"]) .rn-chip[data-tip-chords]::after { content: attr(data-tip-chords); }
  .rn:has(#inversions-toggle:checked) .rn-chip[data-for="inversions-toggle"]::after,
  .rn:has(#repeat-note-toggle:checked) .rn-chip[data-for="repeat-note-toggle"]::after,
  .rn:has(#mute-notes-toggle:checked) .rn-chip[data-for="mute-notes-toggle"]::after { content: attr(data-tip-on); }
  /* while a sheet is open, no tooltips */
  .rn.rn--sheet-open .rn-chip::before, .rn.rn--sheet-open .rn-chip::after { display: none; }
}

@media (min-width: 900px) {
  .rn .rn-chip--switch small, .rn .rn-chip[data-setup="voice"] small { font-size: 15px; }
}
/* Chords has two more settings, so on a phone its row is a line taller: the note and keyboard give that up */
@media (max-width: 899px) and (min-height: 741px) {
  .rn.rn:has(.segmented-control-btn.active[data-mode="chords"]) { --rn-note-h: clamp(66px, calc(42dvh - 250px), 170px); --rn-kb-h: clamp(92px, calc(58dvh - 346px), 230px); }
}
/* a short phone screen: one line that slides sideways */
@media (max-width: 899px) and (max-height: 740px) {
  .rn.rn .rn-setup { flex-wrap: nowrap; justify-content: flex-start; }
  .rn.rn .rn-chip { flex: none; }
}

/* the narrowest phones (320px): beats and START share the bottom row, so both give up a little room */
@media (max-width: 359px) {
  .rn .measures { gap: 8px; }
  .rn .measure-stepper { gap: 6px; }
  .rn .measures .stepper { width: 32px; height: 32px; }
  .rn .start-stop { min-width: 0; padding: 0 22px; }
  .rn #tempo { font-size: 22px; }
}

/* the shortest phone screens (640px and under): the rows sit a little closer, so the tool still fits */
@media (max-width: 899px) and (max-height: 660px) {
  .rn { row-gap: 6px; }
  .rn .view-carousel { margin-top: 30px; }
  .rn #next-note-container { height: 30px; margin-top: 8px; }
}

/* ---------- the volumes (VolumePanel.js): a speaker beside full screen, and a panel dropped from it with the
   click's volume and the piano's, in the tool's own colour ---------- */
.rn { --app-speaker: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 9.5h3.5L12 5.5v13l-4.5-4H4z' fill='black'/%3E%3Cpath d='M15.5 9a4 4 0 0 1 0 6M18 6.5a7.5 7.5 0 0 1 0 11'/%3E%3C/svg%3E"); }
.rn .rn-sheet-open { margin-right: 104px; }
.rn .rn-vol { grid-area: bar; justify-self: end; position: relative; z-index: 30; margin-right: 52px; }
.rn .rn-vol__open {
  display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; margin: 0; padding: 0;
  border: 1px solid var(--rn-line-strong); border-radius: 999px; background: transparent; color: var(--rn-ink); cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.rn .rn-vol__open::before {
  content: ""; width: 18px; height: 18px; background: currentColor;
  -webkit-mask: var(--app-speaker) center / contain no-repeat; mask: var(--app-speaker) center / contain no-repeat;
}
.rn .rn-vol__open:hover, .rn .rn-vol__open[aria-expanded="true"] { background: var(--app-c); border-color: var(--app-c); color: #0E0F12; }
.rn .rn-vol__open:focus-visible { outline: 3px solid var(--focus, #4FD1C5); outline-offset: 2px; }
/* (lined up with the bar's right end, so on a phone it can't run off the left) */
.rn .rn-vol__panel {
  position: absolute; top: calc(100% + 8px); right: -52px; display: grid; gap: 4px; width: min(300px, calc(100vw - 32px));
  padding: 10px 16px; border: 1px solid var(--rn-line-strong); border-radius: 16px; background: var(--rn-card); color: var(--rn-ink);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.35);
}
.rn .rn-vol__panel[hidden] { display: none; }
.rn .rn-vol__row { display: grid; grid-template-columns: 74px minmax(0, 1fr) 30px; align-items: center; gap: 10px; min-height: 44px; cursor: pointer; }
.rn .rn-vol__word { display: inline-flex; align-items: center; gap: 8px; font-family: var(--rn-body); font-size: 14px; font-weight: 700; }
.rn .rn-vol__word svg { flex: none; width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; color: var(--app-ct); }
.rn .rn-vol__row output { font-family: var(--rn-mono); font-size: 12px; font-weight: 500; text-align: right; color: var(--rn-muted); font-variant-numeric: tabular-nums; }
.rn .rn-vol__row.is-off input { opacity: 0.4; }
.rn .rn-vol input[type="range"] {
  --fill: 60%; width: 100%; height: 30px; margin: 0; padding: 0; background: transparent; cursor: pointer; -webkit-appearance: none; appearance: none;
}
.rn .rn-vol input[type="range"]::-webkit-slider-runnable-track { height: 6px; border-radius: 3px; background: linear-gradient(90deg, var(--app-c) var(--fill), var(--rn-line-strong) var(--fill)); }
.rn .rn-vol input[type="range"]::-moz-range-track { height: 6px; border-radius: 3px; background: var(--rn-line-strong); }
.rn .rn-vol input[type="range"]::-moz-range-progress { height: 6px; border-radius: 3px; background: var(--app-c); }
.rn .rn-vol input[type="range"]::-webkit-slider-thumb {
  width: 20px; height: 20px; margin-top: -7px; border: 3px solid var(--rn-card); border-radius: 50%; background: var(--app-c); -webkit-appearance: none; appearance: none;
}
.rn .rn-vol input[type="range"]::-moz-range-thumb { width: 14px; height: 14px; border: 3px solid var(--rn-card); border-radius: 50%; background: var(--app-c); }
.rn .rn-vol input[type="range"]:focus-visible { outline: 3px solid var(--focus, #4FD1C5); outline-offset: 2px; border-radius: 4px; }

/* ---------- the grand staff (Staff Clef: Both) is two staves tall: it is drawn smaller, from the top, so the
   staff view keeps the height it has with one staff and the tool is still one screen tall. It shows
   from C6 above the treble staff to C2 below the bass staff ---------- */
.rn .vexbox.vexbox--grand { transform-origin: 50% 0; transform: scale(1.47); margin: -30px 0 76px; }
@media (max-width: 899px) {
  .rn .vexbox.vexbox--grand { transform: scale(1.02); margin: -21px 0 -11px; }
}