:root {
  --bg: #1a120b;
  --fg: #f0e6d3;
  --muted: #8a7a66;
  --accent: #c9a84c;
  --accent-dim: rgba(201, 168, 76, 0.15);
  --card: #2a1e12;
  --border: #3d2e1e;
  --wood-light: #7a4a2a;
  --wood-dark: #5c3a1e;
  --wood-deeper: #3a2210;
  --ivory: #f5f0e8;
  --ivory-pressed: #e0d8c8;
  --ebony: #1e1008;
  --crimson: #8b1a1a;
  --graph-bg: #120c07;
  --graph-line: #c9a84c;
  --graph-fill: rgba(201, 168, 76, 0.08);
}

:root[data-theme="light"] {
  --bg: #d1c5b4;
  --fg: #2a1e12;
  --muted: #736352;
  --accent: #b56012;
  --accent-dim: rgba(181, 96, 18, 0.15);
  --card: #dfd4c5;
  --border: #c2b19e;
  --wood-light: #a67c52;
  --wood-dark: #8b5a2b;
  --wood-deeper: #e8d0bd;
  --ivory: #ffffff;
  --ivory-pressed: #e8e2d5;
  --ebony: #2a1e12;
  --crimson: #a52a2a;
  --graph-bg: #ece5d6;
  --graph-line: #d57e20;
  --graph-fill: rgba(213, 126, 32, 0.15);
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  overflow-x: hidden;
}

body {
  font-family: "DM Sans", sans-serif;
  background: var(--bg);
  color: var(--fg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow-x: hidden;
  position: relative;
}

/* Startup */
#startup-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: radial-gradient(ellipse at center, #2a1e12 0%, #0d0805 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition:
    opacity 0.6s,
    visibility 0.6s;
}

#startup-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

#startup-overlay h1 {
  font-family: "Playfair Display", serif;
  font-weight: 900;
  font-size: clamp(3rem, 8vw, 6rem);
  color: var(--accent);
  letter-spacing: 0.05em;
  margin-bottom: 0.3em;
  text-shadow: 0 0 40px rgba(201, 168, 76, 0.3);
}

#startup-overlay p {
  color: var(--muted);
  font-size: 1.1rem;
  font-weight: 300;
  animation: pulse-txt 2s ease-in-out infinite;
}

.ornament-line {
  width: 200px;
  height: 2px;
  margin: 1.5rem 0;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
}

@keyframes pulse-txt {
  0%,
  100% {
    opacity: 0.5;
  }

  50% {
    opacity: 1;
  }
}

#particles-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

#app {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1150px;
  padding: 0.8rem 0.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.7rem;
}

#app.hidden {
  display: none;
}

.app-header {
  text-align: center;
  padding: 0.5rem 0 0;
  position: relative;
  width: 100%;
}

.theme-toggle {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: var(--card);
  border: 1px solid var(--accent);
  color: var(--accent);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  z-index: 10;
}

.theme-toggle:hover {
  transform: scale(1.05);
  box-shadow: 0 0 8px rgba(201, 168, 76, 0.4);
}

.app-header h1 {
  font-family: "Playfair Display", serif;
  font-weight: 900;
  font-size: 1.8rem;
  color: var(--accent);
  letter-spacing: 0.04em;
}

.app-header p {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 300;
  margin-top: 0.15rem;
}

/* Controls */
.controls-panel {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 0.9rem;
  justify-content: center;
  align-items: flex-end;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 0.95rem 1.05rem;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.02),
    0 18px 40px rgba(0, 0, 0, 0.18);
}

.main-controls {
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.ctrl-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  align-items: center;
}

.ctrl-group--wide {
  min-width: 100%;
}

.ctrl-group--compact {
  min-width: 132px;
}

.main-controls__copy {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  align-items: flex-start;
}

.control-kicker {
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--muted);
  font-weight: 700;
}

.control-deck {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
}

.control-deck > .control-module:last-child {
  grid-column: 1 / -1;
}

.control-module {
  align-items: stretch;
  justify-content: flex-start;
}

.control-module__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  width: 100%;
  margin-bottom: 0.1rem;
}

.control-module__header h2 {
  font-family: "Playfair Display", serif;
  font-size: 1.1rem;
  color: var(--accent);
  letter-spacing: 0.02em;
}

.control-module__header p {
  max-width: 220px;
  font-size: 0.72rem;
  line-height: 1.45;
  color: var(--muted);
  text-align: right;
}

.control-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.8rem 0.9rem;
  width: 100%;
}

.ctrl-group label {
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  font-weight: 500;
  white-space: nowrap;
}

.ctrl-group label i {
  color: var(--accent);
  margin-right: 0.2em;
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  min-width: 92px;
  height: 5px;
  background: var(--border);
  border-radius: 3px;
  outline: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  background: var(--accent);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 0 6px rgba(201, 168, 76, 0.4);
}

input[type="range"]::-moz-range-thumb {
  width: 14px;
  height: 14px;
  background: var(--accent);
  border-radius: 50%;
  cursor: pointer;
  border: none;
}

.octave-controls {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.octave-controls span {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--accent);
  min-width: 2.2rem;
  text-align: center;
}

.oct-btn {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--wood-deeper);
  color: var(--fg);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  transition: all 0.2s;
}

.oct-btn:hover {
  background: var(--wood-dark);
  border-color: var(--accent);
}

select {
  background: var(--wood-deeper);
  color: var(--fg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.25rem 0.4rem;
  font-size: 0.75rem;
  font-family: "DM Sans", sans-serif;
  cursor: pointer;
  outline: none;
}

select:focus {
  border-color: var(--accent);
}

.toggle-btn {
  padding: 0.3rem 0.65rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--wood-deeper);
  color: var(--muted);
  cursor: pointer;
  font-size: 0.75rem;
  font-family: "DM Sans", sans-serif;
  font-weight: 500;
  transition: all 0.25s;
  letter-spacing: 0.02em;
}

.toggle-btn:hover {
  border-color: var(--accent);
  color: var(--fg);
}

.toggle-btn.active {
  background: linear-gradient(135deg, var(--accent), #a88a3a);
  color: #1a120b;
  border-color: var(--accent);
  font-weight: 600;
  box-shadow: 0 0 12px rgba(201, 168, 76, 0.3);
}

.toggle-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 0.45rem;
  width: 100%;
}

.toggle-row .toggle-btn {
  min-width: 64px;
}

.toggle-row--modes .toggle-btn {
  min-width: 92px;
}

.toggle-row--utility {
  justify-content: flex-end;
}

.value-chip {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.04em;
  min-height: 0.95rem;
}

.engine-status {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 34px;
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  border: 1px solid rgba(201, 168, 76, 0.28);
  background: linear-gradient(
    135deg,
    rgba(201, 168, 76, 0.14),
    rgba(42, 30, 18, 0.92)
  );
  color: var(--fg);
  font-size: 0.74rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.engine-status::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #5fc98c;
  box-shadow: 0 0 10px rgba(95, 201, 140, 0.55);
}

.engine-status.fallback::before {
  background: #d28a44;
  box-shadow: 0 0 10px rgba(210, 138, 68, 0.45);
}

.control-module[aria-label="Mode and atmosphere controls"] {
  background:
    radial-gradient(circle at top right, rgba(201, 168, 76, 0.1), transparent 34%),
    linear-gradient(135deg, rgba(42, 30, 18, 0.98), rgba(24, 17, 11, 0.96));
}

.transpose-display {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
  min-width: 2.5rem;
  text-align: center;
}

.ctrl-divider {
  width: 1px;
  height: 36px;
  background: var(--border);
  align-self: center;
}

/* Visualizer Row */
.visualizer-row {
  display: flex;
  width: 100%;
  gap: 0.8rem;
  align-items: stretch;
  height: 80px;
  margin-bottom: 0.2rem;
}

/* Note Display / History */
.history-display {
  flex: 1;
  background: var(--graph-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  min-width: 260px;
  overflow: hidden;
}

.history-label {
  position: absolute;
  top: 6px;
  left: 10px;
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
}

.history-keys {
  display: flex;
  gap: 0.4rem;
  margin-top: 10px;
  height: 38px;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 0 10px;
}

.history-key {
  font-family: "Playfair Display", serif;
  font-size: 1.1rem;
  color: var(--accent);
  font-weight: 700;
  padding: 0 0.5rem;
  background: var(--wood-deeper);
  border: 1px solid var(--border);
  border-radius: 4px;
  min-width: 38px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  text-shadow: 0 0 6px rgba(201, 168, 76, 0.4);
  animation: slideIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
  transform-origin: center;
}

.history-key.removing {
  animation: slideOut 0.3s ease-in forwards;
}

@keyframes slideIn {
  0% {
    transform: translateX(20px) scale(0.6);
    opacity: 0;
  }

  100% {
    transform: translateX(0) scale(1);
    opacity: 1;
  }
}

@keyframes slideOut {
  0% {
    transform: scale(1);
    opacity: 1;
    margin-right: 0.4rem;
  }

  100% {
    transform: scale(0.6);
    opacity: 0;
    min-width: 0;
    width: 0;
    padding: 0;
    margin-right: 0;
    border: none;
  }
}

.note-display {
  display: none;
  /* replaced by visualizer row */
}

/* Waveform Graph */
.waveform-section {
  flex: 2;
  border-radius: 10px;
  overflow: hidden;
  background: var(--graph-bg);
  border: 1px solid var(--border);
  position: relative;
  height: 100%;
}

.waveform-section canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.waveform-label {
  position: absolute;
  top: 6px;
  left: 10px;
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  pointer-events: none;
}

.waveform-label-right {
  position: absolute;
  top: 6px;
  right: 10px;
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  pointer-events: none;
}

/* Envelope Canvas */
.envelope-canvas-container {
  width: 60px;
  height: 30px;
  background: var(--graph-bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  margin-left: 0.5rem;
  margin-bottom: 0.25rem;
  align-self: center;
}

.envelope-canvas-container canvas {
  display: block;
  width: 100%;
  height: 100%;
}

/* Harmonium Body */
.harmonium-body {
  width: 100%;
  border-radius: 14px;
  overflow: hidden;
  background:
    repeating-linear-gradient(
      90deg,
      transparent,
      rgba(0, 0, 0, 0.04) 1px,
      transparent 2px,
      transparent 10px
    ),
    linear-gradient(
      180deg,
      var(--wood-light) 0%,
      var(--wood-dark) 30%,
      var(--wood-light) 60%,
      var(--wood-dark) 100%
    );
  border: 3px solid var(--wood-deeper);
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  position: relative;
}

.harmonium-bottom-strip {
  height: 32px;
  background: linear-gradient(180deg, #2a1a0e, var(--wood-deeper));
  border-top: 2px solid rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: inset 0 4px 8px rgba(0, 0, 0, 0.5);
  position: relative;
  z-index: 2;
}

.brass-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: radial-gradient(
    circle at 35% 35%,
    #e8d08c,
    var(--accent),
    #8a6e2a
  );
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}

.keys-wrapper {
  overflow-x: auto;
  overflow-y: hidden;
  padding: 10px 14px 0;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.keys-wrapper::-webkit-scrollbar {
  height: 5px;
}

.keys-wrapper::-webkit-scrollbar-track {
  background: transparent;
}

.keys-wrapper::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

.keys-container {
  position: relative;
  margin: 0 auto;
  height: 200px;
  user-select: none;
  -webkit-user-select: none;
}

/* White Keys */
.white-key {
  position: absolute;
  top: 0;
  width: 46px;
  height: 195px;
  background: linear-gradient(
    180deg,
    var(--ivory) 0%,
    #ede5d5 85%,
    #d8cfc0 100%
  );
  border: 1px solid #c0b8a8;
  border-radius: 0 0 5px 5px;
  cursor: pointer;
  z-index: 1;
  box-shadow:
    0 4px 6px rgba(0, 0, 0, 0.2),
    inset 0 -2px 3px rgba(0, 0, 0, 0.05);
  transition:
    background 0.08s,
    box-shadow 0.08s,
    transform 0.08s;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding-bottom: 6px;
}

.white-key:hover {
  background: linear-gradient(180deg, #fff 0%, #f5efe3 85%, #e0d8c8 100%);
}

.white-key.pressed {
  background: linear-gradient(180deg, var(--ivory-pressed) 0%, #d8d0c0 100%);
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.15),
    inset 0 2px 4px rgba(0, 0, 0, 0.08);
  transform: translateY(2px);
}

.white-key .key-label {
  font-size: 0.8rem;
  color: #3a2210;
  font-weight: 800;
  opacity: 0.85;
  pointer-events: none;
  margin-bottom: 4px;
}

.white-key .scale-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  position: absolute;
  bottom: 3px;
  box-shadow: 0 0 4px rgba(201, 168, 76, 0.5);
  display: none;
}

.white-key.in-scale .scale-dot {
  display: block;
}

.key-shortcut {
  position: absolute;
  bottom: 1px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.45rem;
  color: rgba(138, 122, 102, 0.5);
  pointer-events: none;
  font-weight: 400;
}

/* Black Keys */
.black-key {
  position: absolute;
  top: 0;
  width: 28px;
  height: 125px;
  background: linear-gradient(
    180deg,
    #2a1a0e 0%,
    var(--ebony) 60%,
    #0d0805 100%
  );
  border-radius: 0 0 4px 4px;
  cursor: pointer;
  z-index: 2;
  box-shadow:
    0 4px 8px rgba(0, 0, 0, 0.4),
    inset 0 -1px 2px rgba(255, 255, 255, 0.05);
  transition:
    background 0.08s,
    box-shadow 0.08s,
    transform 0.08s;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding-bottom: 4px;
}

.black-key:hover {
  background: linear-gradient(180deg, #3a2a18 0%, #1e1008 60%, #0d0805 100%);
}

.black-key.pressed {
  background: linear-gradient(180deg, #1e1008 0%, #0a0503 100%);
  box-shadow:
    0 1px 3px rgba(0, 0, 0, 0.3),
    inset 0 2px 4px rgba(0, 0, 0, 0.3);
  transform: translateY(2px);
}

.black-key .key-label {
  font-size: 0.6rem;
  color: #f0e6d3;
  font-weight: 700;
  opacity: 0.95;
  pointer-events: none;
  margin-bottom: 4px;
}

.black-key .scale-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  position: absolute;
  bottom: 2px;
  box-shadow: 0 0 4px rgba(201, 168, 76, 0.5);
  display: none;
}

.black-key.in-scale .scale-dot {
  display: block;
}

.black-key .key-shortcut {
  position: absolute;
  bottom: 2px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.4rem;
  color: rgba(200, 180, 150, 0.35);
  pointer-events: none;
}

/* Bellows */
.bellows-section {
  position: relative;
  height: 20px;
  overflow: hidden;
  border-top: 2px solid var(--wood-deeper);
}

.bellows-pleats {
  width: 100%;
  height: 14px;
  background:
    repeating-linear-gradient(
      0deg,
      #8b1a1a 0px,
      #a52a2a 3px,
      #6b0f0f 5px,
      #8b1a1a 8px
    ),
    linear-gradient(90deg, #5a0e0e, #8b1a1a, #5a0e0e);
  transition: height 0.35s ease;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.4);
}

.bellows-pleats.expanded {
  height: 40px;
}

.bellows-bottom {
  height: 8px;
  background: linear-gradient(180deg, var(--wood-deeper), #2a1a0e);
  border-top: 1px solid rgba(0, 0, 0, 0.3);
}

/* Keyboard Guide */
.keyboard-guide {
  text-align: center;
  padding: 0.4rem;
  color: var(--muted);
  font-size: 0.65rem;
  line-height: 1.8;
}

.keyboard-guide kbd {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 0.05rem 0.3rem;
  font-family: "DM Sans", sans-serif;
  font-size: 0.6rem;
  color: var(--fg);
}

.toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--card);
  border: 1px solid var(--accent);
  color: var(--fg);
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-size: 0.8rem;
  z-index: 999;
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.toast.show {
  opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
  .bellows-pleats {
    transition: none;
  }

  .white-key,
  .black-key {
    transition: none;
  }

  @keyframes pulse-txt {
    0%,
    100% {
      opacity: 0.7;
    }
  }
}

@media (max-width: 640px) {
  .controls-panel {
    gap: 0.4rem 0.5rem;
    padding: 0.6rem;
  }

  .main-controls {
    align-items: flex-start;
  }

  .control-deck {
    grid-template-columns: 1fr;
  }

  .control-deck > .control-module:last-child {
    grid-column: auto;
  }

  .control-module__header {
    flex-direction: column;
    gap: 0.35rem;
  }

  .control-module__header p {
    max-width: none;
    text-align: left;
  }

  .control-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.6rem;
  }

  input[type="range"] {
    min-width: 0;
  }

  .app-header h1 {
    font-size: 1.4rem;
  }

  .ctrl-divider {
    display: none;
  }

  .visualizer-row {
    flex-direction: column;
    height: auto;
  }

  .waveform-section {
    height: 60px;
  }

  .history-display {
    height: 60px;
    min-width: 100%;
  }

  .envelope-canvas-container {
    display: none;
  }
}

/* --- Mobile Mode & Sidebar --- */
.hamburger-btn {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  background: var(--card);
  border: 1px solid var(--accent);
  color: var(--accent);
  width: 36px;
  height: 36px;
  border-radius: 6px;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 1000;
  font-size: 1.2rem;
  transition: all 0.2s;
}

.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 998;
  display: none;
  opacity: 0;
  transition: opacity 0.3s;
}

#sidebar {
  display: contents; /* Allows control panels to flow naturally on main screen on desktop */
}

body.mobile-mode .hamburger-btn {
  display: flex;
}

body.mobile-mode #sidebar {
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: -320px;
  width: 300px;
  bottom: 0;
  background: var(--bg);
  border-right: 2px solid var(--border);
  z-index: 999;
  padding: 4rem 1rem 1rem;
  box-shadow: 10px 0 30px rgba(0, 0, 0, 0.8);
  transition: left 0.3s cubic-bezier(0.175, 0.885, 0.32, 1);
  overflow-y: auto;
  gap: 1rem;
}

body.mobile-mode .control-deck {
  grid-template-columns: 1fr;
}

body.mobile-mode.sidebar-open #sidebar {
  left: 0;
}

body.mobile-mode.sidebar-open .sidebar-overlay {
  display: block;
  opacity: 1;
}

body.mobile-mode .waveform-section {
  height: 50px !important;
  margin-bottom: 0;
}

body.mobile-mode .history-display {
  display: none;
}

body.mobile-mode .app-header h1 {
  margin-left: 2.5rem;
}

body.mobile-mode .keys-wrapper {
  padding: 12px 18px 4px;
}

body.mobile-mode .white-key {
  border-radius: 0 0 6px 6px;
}

body.mobile-mode .black-key {
  border-radius: 0 0 5px 5px;
}

body.mobile-mode .white-key .key-label {
  font-size: 0.86rem;
}

body.mobile-mode .black-key .key-label {
  font-size: 0.7rem;
}
