@font-face {
  font-family: SFLocal;
  src: local("SFProTHEN-Regular");
}
@font-face {
  font-family: SFLocal;
  src: local("SFProTHEN-Semibold");
  font-weight: 600;
}
:root {
  --accent: #e3ae54;
  --bg: #100e0b;
  --surface: #18140f;
  --card: #15110d;
  --text: #f5ead6;
  --muted: #b9ac97;
  --line: #423624;
  --soft: #292117;
  color-scheme: dark;
  font-family:
    SFLocal,
    -apple-system,
    BlinkMacSystemFont,
    sans-serif;
  font-size: 13px;
}
* {
  box-sizing: border-box;
}
html {
  scrollbar-gutter: stable;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
}
button,
input,
select {
  font: inherit;
}
button,
select {
  color: var(--control-text);
  background: var(--soft);
  border: 1px solid var(--control-border);
  border-radius: 7px;
  min-height: 34px;
  padding: 6px 12px;
}
button {
  cursor: pointer;
  white-space: nowrap;
}
button:hover {
  border-color: var(--muted);
}
button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 3px;
}
button:disabled {
  opacity: 0.4;
}
.primary,
button[aria-pressed="true"] {
  background: var(--primary-bg);
  color: var(--primary-text);
  border-color: var(--primary-bg);
}
.quiet {
  background: transparent;
}
.muted {
  color: var(--muted);
}
.hidden {
  display: none !important;
}
label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
input[type="range"] {
  accent-color: var(--input-accent);
  width: 110px;
  cursor: pointer;
}
input[type="checkbox"] {
  accent-color: var(--input-accent);
  width: 15px;
  height: 15px;
}
input[type="number"] {
  background: var(--soft);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 7px;
  width: 65px;
}
input[type="color"] {
  border: 0;
  background: none;
  width: 37px;
  height: 29px;
  padding: 1px;
}
select {
  max-width: 225px;
}
.topbar {
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 28px;
  border-bottom: 1px solid var(--line);
  gap: 18px;
  background: var(--header-bg);
}
.brand {
  text-decoration: none;
  color: var(--header-text);
  display: flex;
  align-items: center;
  gap: 12px;
  white-space: nowrap;
}
.brand-mark {
  width: 43px;
  height: 43px;
  border-radius: 10px;
}
.brand strong {
  display: block;
  font-size: 18px;
  letter-spacing: 0.1px;
}
.brand div > span {
  display: block;
  font-size: 8px;
  letter-spacing: 3px;
  color: var(--brand-detail);
  margin-top: 5px;
}
.top-actions {
  display: flex;
  flex-wrap: wrap;
  max-width: 100%;
  align-items: center;
  gap: 10px;
}
.top-actions select {
  min-width: 105px;
}
.toolbar {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 46px;
  padding: 8px 28px;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
  background: var(--input-bg);
}
.inputbar {
  min-height: 58px;
}
#midi-status {
  flex: 1;
  font-size: 11px;
  min-width: 60px;
}
.status-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  background: var(--muted);
  border-radius: 50%;
  margin-right: 7px;
}
.midi-button {
  color: var(--accent);
}
.connected .status-dot {
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent);
}
.switch {
  font-size: 12px;
  white-space: nowrap;
}
#library-count {
  background: var(--soft);
  border-radius: 4px;
  padding: 2px 5px;
  color: var(--muted);
}
#editbar {
  border-bottom-color: var(--accent);
}
#editbar strong {
  color: var(--accent);
}
#editbar > .muted:first-of-type {
  flex: 1;
}
#rangebar {
  min-height: 42px;
}
#rangebar button {
  min-height: 28px;
  font-size: 11px;
}
.range-help {
  margin-left: auto;
  font-size: 11px;
}
#range-label {
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}
#melody-preview {
  width: 100%;
  display: flex;
  gap: 5px;
  overflow: auto;
  padding: 5px 0;
}
.melody-chip {
  padding: 5px 8px;
  background: var(--soft);
  border-radius: 4px;
  white-space: nowrap;
}
.melody-chip.active {
  background: var(--primary-bg);
  color: var(--primary-text);
}
#clip-seek {
  flex: 1;
  min-width: 100px;
}
#capture-status {
  font-size: 11px;
}
progress {
  width: 100px;
  accent-color: var(--input-accent);
}
#workspace {
  padding: 20px 24px 24px;
  min-height: 400px;
}
.workspace-caption {
  display: flex;
  justify-content: space-between;
  padding: 0 2px 14px;
  gap: 10px;
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 2px;
}
#canvas-wrap {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  min-height: 200px;
}
#scene {
  /* Live notes must never become scroll anchors while the page is scrolled. */
  overflow-anchor: none;
  position: relative;
  isolation: isolate;
  flex-shrink: 0;
  background: var(--workspace-bg);
}
#scene.full {
  width: 100%;
  height: max(650px, calc((100vw - 48px) * 0.736));
  min-height: 650px;
}
#scene.vertical {
  height: min(960px, calc(100vh - 360px));
  min-height: 360px;
  aspect-ratio: 9/16;
  max-width: 100%;
}
.component {
  contain: layout size;
  position: absolute;
  min-width: 0;
  min-height: 0;
  touch-action: none;
}
.full .component {
  background: var(--widget-panel);
  border: 1px solid var(--widget-border);
  border-radius: 12px;
  overflow: hidden;
}
.component-title {
  font-size: 10px;
  line-height: 25px;
  height: 25px;
  color: var(--widget-title);
  padding: 0 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.component-content {
  position: absolute;
  inset: 25px 0 0;
}
.vertical .component-content {
  inset: 0;
}
.vertical .component-title {
  display: none;
}
.name-content,
.roman-content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 8px;
  overflow: hidden;
  text-align: center;
}
.chord-symbol {
  color: var(--chord-text);
  line-height: 1.1;
  white-space: nowrap;
  letter-spacing: -1.5px;
  font-weight: 500;
  max-width: 100%;
}
.roman-symbol {
  color: var(--roman-text);
  line-height: 1.2;
  white-space: nowrap;
}
.full .name-content .roman-symbol {
  font-size: clamp(15px, 1.8vw, 24px);
  margin-top: 15px;
}
.circle-svg,
.staff-svg,
.keys-svg {
  display: block;
  width: 100%;
  height: 100%;
}
.circle-svg {
  overflow: visible;
  padding: 3px;
}
.circle-node {
  cursor: pointer;
}
.circle-svg text {
  font-family: inherit;
  dominant-baseline: central;
  text-anchor: middle;
  font-weight: 600;
}
.roll-canvas {
  display: block;
  width: 100%;
  height: 56%;
  position: absolute;
  left: 0;
  top: 0;
}
.piano-surface {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 8px;
  height: 42%;
  overflow: hidden;
  touch-action: none;
}
.vertical .piano-surface {
  inset: 0;
  height: 100%;
}
.piano-surface.range-adjust {
  cursor: grab;
}
.range-adjust:active {
  cursor: grabbing;
}
.key-rect {
  cursor: pointer;
}
.range-adjust .key-rect {
  cursor: grab;
}
.key-label {
  font-size: 10px;
  fill: var(--key-label);
  font-family: inherit;
  pointer-events: none;
  text-anchor: middle;
}
.sustain-state {
  font-size: 9px;
  border-radius: 20px;
  padding: 0 6px;
  background: var(--soft);
  line-height: 17px;
}
.sustain-state.on {
  color: var(--accent);
}
.frequency-list {
  scrollbar-gutter: stable;
  height: 100%;
  overflow: auto;
  padding: 14px;
}
.frequency-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
  font-variant-numeric: tabular-nums;
}
.frequency-row strong {
  color: var(--accent);
  font-weight: 500;
}
.empty-hint {
  height: 100%;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 12px;
}
.history-list {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 12px;
  height: 100%;
  overflow: auto;
}
.history-list span {
  font-size: 17px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 5px;
  white-space: nowrap;
}
#center-guide {
  display: none;
  position: absolute;
  left: 50%;
  height: 100%;
  top: 0;
  border-left: 1px dashed var(--focus-ring);
  opacity: 0.45;
  z-index: 30;
  pointer-events: none;
}
.editing #center-guide {
  display: block;
}
#center-guide.attached {
  border-left: 2px solid var(--focus-ring);
  opacity: 1;
}
.edit-label,
.resize-handle {
  display: none;
}
.editing .component {
  outline: 1px dashed var(--focus-ring);
  background: color-mix(in srgb, var(--accent) 4%, transparent);
  cursor: move;
  overflow: visible;
}
.editing .component-content {
  pointer-events: none;
}
.editing .edit-label {
  display: block;
  position: absolute;
  left: 0;
  top: 0;
  padding: 3px 6px;
  background: var(--soft);
  font-size: 10px;
  z-index: 12;
  pointer-events: none;
}
.editing .resize-handle {
  display: grid;
  place-items: center;
  position: absolute;
  right: 0;
  bottom: 0;
  width: 25px;
  height: 25px;
  border-radius: 5px;
  background: var(--primary-bg);
  color: var(--primary-text);
  font-size: 16px;
  cursor: nwse-resize;
  z-index: 15;
}
.editing.full .component-title {
  opacity: 0;
}
.editing.full .component-content {
  inset: 0;
}
#controlbar {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 25px;
  justify-content: space-between;
  padding: 16px 26px;
  border-top: 1px solid var(--line);
  background: var(--surface);
  position: sticky;
  bottom: 0;
  z-index: 40;
}
.control-group {
  display: flex;
  align-items: center;
  gap: 9px;
}
.control-group label {
  color: var(--muted);
  font-size: 11px;
}
.control-group select {
  max-width: 155px;
}
.control-group input[type="range"] {
  width: 85px;
}
#volume-label {
  font-size: 10px;
  color: var(--muted);
  min-width: 28px;
}
.credits {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 18px 28px;
  color: var(--muted);
  font-size: 10px;
  border-top: 1px solid var(--line);
}
.credits strong {
  font-weight: 500;
}
.credits nav {
  display: flex;
  gap: 18px;
}
.credits a {
  color: var(--footer-links);
  text-decoration: none;
}
.credits a:hover {
  color: var(--accent);
}
#exit-focus {
  position: fixed;
  right: 15px;
  top: 15px;
  z-index: 100;
  opacity: 0.7;
}
.focus .topbar,
.focus .toolbar,
.focus #controlbar,
.focus .workspace-caption,
.focus .credits {
  display: none !important;
}
.focus #workspace {
  padding: 0;
  min-height: 100vh;
}
.focus #canvas-wrap {
  min-height: 100vh;
  align-items: center;
}
.focus #scene.vertical {
  height: 100vh;
  min-height: 0;
  max-width: 100vw;
}
.focus #scene.full {
  width: 100%;
  height: max(100vh, 74vw);
}
.focus #exit-focus {
  display: block !important;
}
.focus {
  background: var(--focus-bg);
}
#toast {
  position: fixed;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--notice-bg);
  color: var(--text);
  padding: 12px 20px;
  max-width: 90vw;
  border: 1px solid var(--line);
  border-radius: 9px;
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: 0.2s;
}
#toast.visible {
  opacity: 1;
}
dialog {
  border: 1px solid var(--line);
  background: var(--dialog-bg);
  color: var(--text);
  border-radius: 16px;
  max-width: min(600px, 94vw);
  width: 500px;
  padding: 24px;
  box-shadow: 0 30px 100px #0009;
}
dialog::backdrop {
  background: color-mix(in srgb, var(--overlay) 48%, transparent);
  backdrop-filter: blur(5px);
}
.dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.dialog-head h2 {
  margin: 0;
  font-size: 21px;
}
.dialog-head button {
  background: transparent;
}
dialog form > label {
  display: flex;
  justify-content: space-between;
  width: 100%;
  padding: 12px 0;
}
dialog p {
  line-height: 1.7;
}
dialog form > .primary {
  margin-top: 18px;
  width: 100%;
}
#help-spotlight {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 109;
  pointer-events: none;
  fill: rgb(0 0 0 / 72%);
}
#help-dialog {
  position: fixed;
  inset: auto 14px 14px auto;
  z-index: 110;
  margin: 0;
  padding: 16px 18px;
  width: min(380px, calc(100vw - 28px));
  max-height: min(290px, 49dvh);
  overflow: auto;
  border-color: var(--focus-ring);
}
#help-dialog.tour-above {
  top: 14px;
  bottom: auto;
}
#help-dialog .dialog-head {
  gap: 10px;
  margin-bottom: 8px;
}
#help-dialog h2 { font-size: 15px; }
#help-dialog h3 { margin: 6px 0; font-size: 16px; }
#help-dialog p { margin: 0; }
#help-progress { font-size: 11px; }
.help-actions {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 13px;
}
.tour-highlight {
  outline: 2px solid var(--focus-ring);
  outline-offset: -2px;
}
.library-item {
  padding: 13px 0;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 8px;
  align-items: center;
}
.library-item div {
  flex: 1;
  min-width: 0;
}
.library-item input {
  background: transparent;
  color: var(--text);
  border: 1px solid transparent;
  padding: 6px;
  width: 100%;
  font: inherit;
  border-radius: 4px;
}
.library-item input:focus {
  border-color: var(--accent);
}
.library-item small {
  color: var(--muted);
  display: block;
  padding-left: 6px;
}
.library-empty {
  padding: 32px 0;
  text-align: center;
  color: var(--muted);
}
@media (min-width: 1600px) {
  #workspace {
    max-width: 1900px;
    margin: auto;
  }
}
@media (max-width: 1100px) {
  #midi-status {
    display: none;
  }
  #controlbar {
    justify-content: flex-start;
  }
  .toolbar {
    gap: 10px;
  }
  .range-help {
    display: none;
  }
  .control-group select {
    max-width: 140px;
  }
}
@media (max-width: 700px) {
  .topbar {
    padding: 12px 14px;
    gap: 8px;
    flex-wrap: wrap;
  }
  .brand strong {
    font-size: 15px;
  }
  .brand-mark {
    width: 34px;
    height: 34px;
  }
  .top-actions {
    gap: 5px;
  }
  .top-actions button {
    padding: 5px 8px;
    font-size: 11px;
  }
  .top-actions select {
    min-width: 75px;
  }
  .toolbar {
    padding: 8px 14px;
    font-size: 11px;
    gap: 9px;
  }
  .toolbar select {
    max-width: 160px;
  }
  #workspace {
    padding: 14px 8px;
  }
  .workspace-caption {
    font-size: 8px;
    letter-spacing: 1px;
  }
  #controlbar {
    padding: 12px 14px;
    gap: 10px;
    position: relative;
  }
  .control-group {
    flex-wrap: wrap;
    gap: 7px;
  }
  .control-group input[type="range"] {
    width: 70px;
  }
  #scene.full {
    height: 1350px;
    min-height: 0;
  }
  .full .component {
    left: 0 !important;
    width: 100% !important;
  }
  .full [data-component="name"] {
    top: 0 !important;
    height: 180px !important;
  }
  .full [data-component="staff"] {
    top: 194px !important;
    height: 220px !important;
  }
  .full [data-component="circle"] {
    top: 428px !important;
    height: 300px !important;
  }
  .full [data-component="keyboard"] {
    top: 742px !important;
    height: 310px !important;
  }
  .full [data-component="frequency"] {
    top: 1066px !important;
    height: 180px !important;
  }
  .full [data-component="history"] {
    top: 1260px !important;
    height: 90px !important;
  }
  #scene.vertical {
    height: calc(100vh - 450px);
    min-height: 420px;
  }
  .focus #scene.vertical {
    height: 100dvh;
    min-height: 0;
  }
  .focus #scene.full {
    height: 1350px;
  }
  #editbar > span:nth-child(2) {
    display: none;
  }
  .credits {
    padding: 18px 14px;
    line-height: 1.7;
  }
}

/* Keep the key edges sharp and blur the combined highlight layer once. */
.neon .key-active .key-rect {
  --active-glow: var(--keyboard-pressed, var(--key-glow));
  stroke: color-mix(in srgb, var(--active-glow) 35%, white);
  stroke-width: 1px;
  vector-effect: non-scaling-stroke;
}
.key-halo {
  filter: blur(calc(8px * var(--glow-strength)));
  opacity: min(0.65, calc(0.45 * var(--glow-strength)));
}
/* Keep key range controls with their keyboard, including after layout changes. */
.component[data-component="keyboard"] {
  overflow: visible;
}
.component[data-component="keyboard"] > #rangebar {
  position: absolute;
  inset: auto 0 0;
  height: 44px;
  min-height: 44px;
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  gap: 12px;
  padding: 6px 10px;
  border-top: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 0 0 12px 12px;
  white-space: nowrap;
  touch-action: auto;
}
#rangebar > * {
  flex-shrink: 0;
}
#rangebar .range-help {
  display: none;
}
.full [data-component="keyboard"] > .component-content {
  bottom: 44px;
}
.vertical .component[data-component="keyboard"] > #rangebar {
  top: 100%;
  bottom: auto;
  border-radius: 0 0 8px 8px;
}
.focus.full [data-component="keyboard"] > .component-content {
  bottom: 0;
}

.support-section {
  padding: clamp(20px, 4vw, 36px) clamp(14px, 3vw, 24px);
  border-top: 1px solid var(--line);
}
.support-content {
  display: grid;
  grid-template-columns: clamp(84px, 29vw, 220px) minmax(0, max-content);
  gap: clamp(12px, 4vw, 44px);
  align-items: center;
  width: fit-content;
  max-width: min(100%, 790px);
  margin: 0 auto;
}
.support-copy {
  display: grid;
  justify-items: start;
  gap: 12px;
  color: var(--support-text);
  line-height: 1.7;
  font-size: 14px;
}
.support-copy p {
  margin: 0;
}
.support-feedback p + p {
  margin-top: 4px;
}
.support-qr {
  width: 100%;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
}
.support-qr img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 12px;
}
#support-expand {
  white-space: normal;
  text-align: left;
}
#support-dialog {
  max-width: min(520px, 94vw);
}
#support-dialog > img {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: 70vh;
  height: auto;
  margin: 0 auto;
  border-radius: 10px;
}
.focus .support-section {
  display: none;
}

.credits nav {
  gap: 10px;
  align-items: center;
}
.credits nav a {
  display: inline-flex;
  width: 34px;
  height: 34px;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
}
.credits nav a:hover {
  background: var(--soft);
}
.credits nav svg {
  width: 18px;
  height: 18px;
}
.credits {
  align-items: center;
}

.settings-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 12px 0;
}
#settings-dialog hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 20px 0;
}
#settings-dialog h3 {
  font-size: 15px;
  margin: 0;
}
#app-version {
  display: block;
  margin: 10px 0;
}
.update-banner {
  position: fixed;
  z-index: 100;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%);
  max-width: calc(100vw - 24px);
  padding: 12px;
  border: 1px solid var(--accent);
  border-radius: 12px;
  background: var(--notice-bg);
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 8px 30px #0006;
}
.update-banner[hidden],
[hidden] {
  display: none !important;
}
.focus .update-banner {
  display: none;
}


#workspace { background: var(--workspace-bg); }
.focus #workspace { background: var(--focus-bg); }
#controlbar { background: var(--control-bg); }
#rangebar { background: var(--range-bg); }
.support-section { background: var(--support-bg); }
.credits { background: var(--footer-bg); color: var(--footer-text); }
.vertical .component { background: var(--widget-vertical); }
.live-hz { color: var(--live-hz); }
.detected-note { color: var(--live-note); }
.key-active .key-label { fill: var(--keyboard-pressed-ink, var(--active-key-label)); }
.history-list, .frequency-row, .frequency-list .empty-hint { color: var(--widget-text); }
.frequency-row strong { color: var(--frequency-text); }

.colors-trigger { display: inline-flex; align-items: center; gap: 7px; }
.color-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  border: 1px solid var(--control-border);
}
#colors-dialog {
  width: 560px;
  max-height: calc(100dvh - 32px);
  padding: clamp(12px, 3vw, 24px);
}
#colors-dialog[open] {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
#colors-dialog .dialog-head { margin: 0; }
.palette-picker { justify-content: space-between; }
.palette-picker select { min-width: min(210px, 56vw); }
#color-preview {
  display: flex;
  min-height: 24px;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
}
#color-fields {
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
}
#color-fields details { border-bottom: 1px solid var(--line); }
#color-fields summary { cursor: pointer; padding: 9px 2px; font-weight: 600; }
.color-entry {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px 7ch 30px;
  align-items: center;
  column-gap: 7px;
  padding: 3px 2px;
}
.color-entry input { width: 34px; cursor: pointer; }
.color-entry code { color: var(--muted); font-size: 11px; }
.color-entry button { padding: 3px; min-height: 28px; }
.colors-actions { display: flex; justify-content: space-between; gap: 8px; }

.note-gradient .circle-node {
  --circle-pressed: var(--pitch-color);
  --circle-pressed-ink: var(--pitch-ink);
}
.note-gradient .keys-svg [data-note] {
  --keyboard-pressed: var(--pitch-color);
  --keyboard-pressed-ink: var(--pitch-ink);
}
.circle-halo {
  filter: blur(calc(8px * var(--glow-strength)));
  opacity: min(0.9, calc(0.82 * var(--glow-strength)));
}
.neon .circle-links {
  filter: drop-shadow(0 0 calc(5px * var(--glow-strength)) var(--circle-glow))
    drop-shadow(0 0 calc(10px * var(--glow-strength)) var(--circle-glow));
}
.note-gradient .neon .circle-links {
  filter: none;
}
#color-preview span { flex: 1; }

.note-gradient body { background-image: var(--page-gradient); }
.note-gradient .support-section { background-image: var(--support-gradient); }
.note-gradient .credits { background-image: var(--footer-gradient); }
.note-gradient #workspace,
.note-gradient #scene {
  background-image: var(--workspace-gradient);
}
.note-gradient body.focus,
.note-gradient .focus #workspace {
  background-image: none;
}
.gradient-readout {
  color: transparent;
  background-clip: text;
}

#theorybar {
  display: grid;
  align-items: start;
  gap: 9px;
}
.theory-controls, #theory-examples {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
#theory-lesson {
  max-width: min(48vw, 330px);
}
#theory-title, #theorybar p {
  margin: 0;
}
#theory-title {
  font-size: 16px;
}
#theory-description {
  max-width: 80ch;
}
#theory-examples button {
  min-height: 29px;
  padding: 4px 8px;
}
#theory-examples button[aria-pressed="true"] {
  background: var(--primary-bg);
  color: var(--primary-text);
}
.theory-mode #rangebar {
  display: none;
}

.theory-mode .roll-canvas,
.theory-mode #midi-status {
  display: none;
}
.theory-mode .full [data-component="keyboard"] > .component-content {
  bottom: 0;
}
.theory-mode .full .piano-surface {
  top: 6px;
  height: auto;
}
@media (min-width: 701px) {
  .theory-mode:not(.focus) #scene.full {
    height: clamp(410px, 57dvh, 620px);
    min-height: 0;
  }
}
