/* Oslo Mobile Orchestra — compact mobile layout (fits one screen) */
:root {
  --bg: #0d0f14;
  --surface: #1a1f2e;
  --accent: #6ee7b7;
  --accent-dim: #34d399;
  --text: #f1f5f9;
  --muted: #94a3b8;
  --danger: #f87171;
  --touch-min: 40px;
  --header-h: 40px;
  --status-h: 22px;
  --toolbar-h: 44px;
  --play-min: 140px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  height: 100%;
  height: 100dvh;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}

/* Instrument apps: no page scroll, flex fill viewport */
body.app-shell {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
}

a {
  color: var(--accent);
}

.app-header {
  flex-shrink: 0;
  height: var(--header-h);
  padding: 0 0.5rem;
  padding-top: env(safe-area-inset-top, 0px);
  background: var(--surface);
  border-bottom: 1px solid #2d3548;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  z-index: 10;
}

.app-header h1 {
  font-size: 0.9rem;
  font-weight: 600;
  margin: 0;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.back-link {
  font-size: 1.1rem;
  text-decoration: none;
  padding: 0.25rem;
  min-width: 36px;
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.main-stage {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.status-bar {
  flex-shrink: 0;
  min-height: var(--status-h);
  padding: 0.15rem 0.5rem;
  font-size: 0.68rem;
  line-height: 1.2;
  color: var(--muted);
  text-align: center;
  background: #111827;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.status-bar.ok {
  color: var(--accent);
}

.status-bar.warn {
  color: #fbbf24;
}

/* How-to and readouts live in Learn panels only */
body.app-shell .status-bar,
body.app-shell p.value-chip,
body.app-shell .breath-row > label,
body.app-shell [class*="-hint"],
body.app-shell .level-chip,
body.app-shell .pick-label,
body.app-shell .sampler-hint,
body.app-shell .pad-readout,
body.app-shell .theremin-play-label,
body.app-shell #sharePanel > p,
body.app-shell .readout-row {
  display: none !important;
}

body.app-shell .readout-row:has(.slide-toggle),
body.app-shell .readout-row:has(input:not([type="hidden"])),
body.app-shell .readout-row:has(select),
body.app-shell .readout-row:has(button) {
  display: flex !important;
}

.header-controls {
  margin-left: auto;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  z-index: 2;
}

.hub-header > p,
.hub-tips,
.axis-hint,
.qr-caption {
  display: none !important;
}

.learn-toggle {
  flex-shrink: 0;
  background: transparent;
  border: 1px solid #475569;
  color: var(--muted);
  border-radius: 6px;
  padding: 0.2rem 0.45rem;
  font-size: 0.62rem;
  font-weight: 600;
  min-height: 28px;
  cursor: pointer;
  touch-action: manipulation;
}

.learn-toggle[aria-expanded="true"],
.qr-toggle[aria-expanded="true"] {
  border-color: var(--accent);
  color: var(--accent);
}

.qr-panel {
  position: fixed;
  inset: 0;
  z-index: 250;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  padding-bottom: calc(1rem + var(--safe-b));
}

.qr-panel[hidden] {
  display: none !important;
}

.qr-panel-backdrop {
  position: absolute;
  inset: 0;
  border: none;
  padding: 0;
  margin: 0;
  background: rgba(2, 6, 23, 0.82);
  cursor: pointer;
}

.qr-panel-sheet {
  position: relative;
  z-index: 1;
  width: min(92vw, 320px);
  max-height: min(88vh, 520px);
  overflow-y: auto;
  padding: 0.75rem 0.65rem 0.85rem;
}

.qr-panel-sheet h2 {
  margin: 0 1.5rem 0.35rem 0;
  font-size: 0.95rem;
}

.qr-panel-close {
  position: absolute;
  top: 0.35rem;
  right: 0.35rem;
  width: 2rem;
  height: 2rem;
  border: none;
  border-radius: 6px;
  background: #1e293b;
  color: var(--muted);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}

.qr-panel-sheet .link-box {
  font-size: 0.62rem;
  word-break: break-all;
  margin: 0.35rem 0;
}

.qr-panel-sheet #qrCopyBtn {
  width: 100%;
  margin-top: 0.25rem;
}

.audio-toggle-wrap {
  flex-shrink: 0;
}

.audio-toggle {
  border-radius: 6px;
  padding: 0.2rem 0.45rem;
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
  min-height: 28px;
  border: 1px solid #475569;
  background: #1e293b;
  color: var(--muted);
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.audio-toggle.is-on {
  border-color: var(--accent);
  background: rgba(110, 231, 183, 0.12);
  color: var(--accent);
}

.audio-toggle.is-off {
  border-color: #64748b;
  color: #94a3b8;
}

.audio-toggle-label {
  pointer-events: none;
}

/* Overlay — does not push main UI down */
.learn-panel.panel {
  display: none;
  position: fixed;
  top: calc(var(--header-h) + env(safe-area-inset-top, 0px));
  left: 0;
  right: 0;
  margin: 0;
  padding: 0.5rem 0.65rem;
  max-height: 42vh;
  overflow-y: auto;
  z-index: 30;
  border-radius: 0 0 10px 10px;
  font-size: 0.78rem;
  line-height: 1.35;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.45);
}

.learn-panel.open {
  display: block;
}

.hub .learn-panel.panel {
  top: calc(3.25rem + env(safe-area-inset-top, 0px));
}

.fm-matrix-app .matrix-grid .muted {
  display: none;
}

.sampler-hint {
  display: none;
}

.sampler-app .sampler-stage {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 0;
}

.sampler-app .sampler-center {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.sampler-app .sampler-rec-btn {
  --tilt-h: 205;
  --tilt-s: 48%;
  --tilt-l: 46%;
  --tilt-glow: 0.22;
  appearance: none;
  padding: 0;
  cursor: pointer;
  font-family: inherit;
  width: min(52vmin, 240px);
  height: min(52vmin, 240px);
  border-radius: 50%;
  border: 4px solid hsl(var(--tilt-h), var(--tilt-s), calc(var(--tilt-l) + 8%));
  background: radial-gradient(
    circle at 38% 32%,
    hsl(var(--tilt-h), calc(var(--tilt-s) - 8%), calc(var(--tilt-l) - 6%)) 0%,
    #1a2233 68%
  );
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  touch-action: manipulation;
  color: var(--text);
  flex-shrink: 0;
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.45),
    0 0 40px hsla(var(--tilt-h), 70%, 50%, var(--tilt-glow));
  transition:
    border-color 0.1s ease,
    background 0.1s ease,
    box-shadow 0.1s ease,
    transform 0.08s ease;
}

.sampler-app .sampler-rec-btn:active {
  transform: scale(0.97);
}

.sampler-app .sampler-rec-btn .rec-icon {
  width: min(22vmin, 72px);
  height: min(22vmin, 72px);
  border-radius: 50%;
  background: hsl(var(--tilt-h), calc(var(--tilt-s) + 18%), var(--tilt-l));
  box-shadow: 0 0 0 min(2.2vmin, 10px) hsla(var(--tilt-h), 75%, 52%, var(--tilt-glow));
  flex-shrink: 0;
  transition: background 0.1s ease, box-shadow 0.1s ease, border-radius 0.15s ease;
}

.sampler-app .sampler-rec-btn.recording {
  border-color: #f87171;
  background: radial-gradient(circle at 38% 32%, #5c2a2a 0%, #1a2233 70%);
  box-shadow: 0 0 32px rgba(248, 113, 113, 0.35);
}

.sampler-app .sampler-rec-btn.recording .rec-icon {
  border-radius: 10px;
  width: min(18vmin, 52px);
  height: min(18vmin, 52px);
  background: #ef4444;
  box-shadow: 0 0 0 8px rgba(239, 68, 68, 0.28);
  animation: sampler-rec-pulse 0.85s ease-in-out infinite;
}

.sampler-app .sampler-rec-btn.looping:not(.recording) {
  border-color: hsl(var(--tilt-h), var(--tilt-s), calc(var(--tilt-l) + 12%));
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.4),
    0 0 36px hsla(var(--tilt-h), 65%, 55%, calc(var(--tilt-glow) + 0.08));
}

.sampler-app .sampler-rec-btn.looping:not(.recording) .rec-icon {
  background: hsl(var(--tilt-h), calc(var(--tilt-s) + 22%), calc(var(--tilt-l) + 8%));
  box-shadow: 0 0 0 min(2.2vmin, 10px) hsla(var(--tilt-h), 80%, 58%, calc(var(--tilt-glow) + 0.1));
}

.sampler-app .sampler-rec-label {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.sampler-app .sampler-hint-text {
  margin: 0;
  padding: 0.35rem 1rem 0.65rem;
  font-size: 0.75rem;
  color: var(--muted);
  text-align: center;
  max-width: 18rem;
  line-height: 1.35;
  flex-shrink: 0;
  align-self: center;
}

.sampler-app .sampler-live {
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
}

.sampler-app .sampler-live span {
  color: #cbd5e1;
  text-align: left;
  min-width: 2ch;
}

.sampler-app .sampler-live strong {
  color: #e2e8f0;
  font-weight: 700;
}

@keyframes sampler-rec-pulse {
  50% {
    opacity: 0.55;
    transform: scale(0.92);
  }
}

.learn-panel.panel h2 {
  font-size: 0.7rem;
  margin: 0 0 0.25rem;
}

.learn-panel.panel p {
  margin: 0.25rem 0;
}

.learn-pedagogy {
  margin-top: 0.55rem;
  padding-top: 0.5rem;
  border-top: 1px solid #2d3548;
}

.learn-pedagogy h3 {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--accent-dim, #6ee7b7);
  margin: 0 0 0.3rem;
}

.learn-pedagogy p {
  color: var(--muted);
  line-height: 1.45;
}

.app-toolbar {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.5rem;
  padding-bottom: calc(0.35rem + var(--safe-b));
  background: var(--surface);
  border-top: 1px solid #2d3548;
  min-height: var(--toolbar-h);
}

.app-toolbar .btn {
  flex: 1;
  min-height: 36px;
  padding: 0.35rem 0.5rem;
  font-size: 0.8rem;
  border-radius: 8px;
}

.app-toolbar .btn.icon-only {
  flex: 0 0 auto;
  min-width: 36px;
  padding: 0.35rem;
}

.control-row {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  background: #111827;
}

.control-row label {
  color: var(--muted);
  flex-shrink: 0;
}

.control-row select,
.control-row input[type="range"] {
  flex: 1;
  min-width: 0;
  min-height: 32px;
  font-size: 0.8rem;
}

.control-row select {
  background: var(--surface);
  color: var(--text);
  border: 1px solid #475569;
  border-radius: 6px;
  padding: 0.2rem 0.35rem;
}

.control-row span {
  color: var(--muted);
  min-width: 1.75rem;
  text-align: right;
  font-size: 0.75rem;
}

.btn {
  min-height: var(--touch-min);
  padding: 0.5rem 0.75rem;
  border: none;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  background: var(--accent-dim);
  color: #042f2e;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-secondary {
  background: #334155;
  color: var(--text);
}

.btn-danger {
  background: var(--danger);
  color: #1c1917;
}

.btn-sm {
  min-height: 34px;
  padding: 0.3rem 0.5rem;
  font-size: 0.75rem;
}

.panel {
  margin: 0.5rem;
  padding: 0.65rem;
  background: var(--surface);
  border-radius: 10px;
  font-size: 0.8rem;
  line-height: 1.4;
}

.panel h2 {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin: 0 0 0.35rem;
}

.panel p {
  margin: 0.35rem 0;
  color: var(--muted);
}

.panel strong {
  color: var(--text);
}

.meter {
  height: 6px;
  background: #334155;
  border-radius: 3px;
  overflow: hidden;
}

.meter-fill {
  height: 100%;
  background: var(--accent);
  width: 0%;
  transition: width 0.05s linear;
}

/* Hub (scrollable list) */
body.hub {
  min-height: 100dvh;
  overflow-y: auto;
}

.hub-header {
  position: relative;
  padding: 0.65rem 0.75rem 0.4rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}

.hub-header h1 {
  flex: 1 1 100%;
  font-size: 1.15rem;
  margin: 0;
  font-weight: 700;
  text-align: center;
}

.hub-header .header-controls {
  flex: 1 1 100%;
  justify-content: flex-end;
}

.hub-header .hub-section-select {
  margin-right: auto;
  flex: 0 1 auto;
  max-width: 9rem;
  min-height: 28px;
  padding: 0.2rem 0.45rem;
  font-size: 0.62rem;
  font-weight: 600;
  line-height: 1.2;
  box-sizing: border-box;
  background: transparent;
  color: var(--muted);
  border: 1px solid #475569;
  border-radius: 6px;
  cursor: pointer;
  touch-action: manipulation;
  appearance: none;
  -webkit-appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 0.65rem) calc(50% - 0.15rem), calc(100% - 0.45rem) calc(50% - 0.15rem);
  background-size: 0.35rem 0.35rem, 0.35rem 0.35rem;
  background-repeat: no-repeat;
  padding-right: 1.35rem;
}

html.omo-a11y .hub-header .hub-section-select {
  min-height: 52px;
  font-size: 0.85rem;
  padding-right: 1.5rem;
}

.app-list {
  list-style: none;
  padding: 0 0.5rem 0.5rem;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.app-list a {
  display: block;
  padding: 0.5rem 0.65rem;
  background: var(--surface);
  border-radius: 10px;
  text-decoration: none;
  color: var(--text);
  border: 1px solid #2d3548;
}

.app-list .tag {
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent);
  display: block;
}

.app-list .title {
  font-size: 0.95rem;
  font-weight: 600;
}

.app-list .meta {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.68rem;
  line-height: 1.35;
  color: var(--muted);
  font-weight: 400;
}

.app-list .meta-sensors {
  color: #7dd3fc;
}

.hub-tips {
  margin: 0 0.5rem 0.75rem;
  font-size: 0.72rem;
}

.hub-tips summary {
  cursor: pointer;
  color: var(--muted);
  padding: 0.35rem 0;
}

.hub-tips[open] summary {
  margin-bottom: 0.35rem;
}

.hub-tips p {
  margin: 0.25rem 0;
  color: var(--muted);
  line-height: 1.35;
}

.hub-tips strong {
  color: var(--text);
}

/* Shared instrument widgets — flex child that always has drawable area */
.stage-fill {
  flex: 1 1 auto;
  min-height: var(--play-min);
  margin: 0.35rem 0.5rem;
  border-radius: 10px;
  touch-action: none;
  position: relative;
  overflow: hidden;
  border: 1px solid #334155;
  background: linear-gradient(145deg, #1e293b 0%, #0f172a 100%);
}

.stage-fill.play-grid {
  background:
    linear-gradient(rgba(110, 231, 183, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(110, 231, 183, 0.06) 1px, transparent 1px),
    linear-gradient(145deg, #1e293b 0%, #0f172a 100%);
  background-size: 20px 20px, 20px 20px, auto;
}

.stage-fill.active,
.touch-zone.active {
  border-color: var(--accent-dim);
  box-shadow: inset 0 0 24px rgba(110, 231, 183, 0.08);
}

.touch-dot {
  position: absolute;
  width: 32px;
  height: 32px;
  margin: -16px 0 0 -16px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  background: rgba(110, 231, 183, 0.25);
  box-shadow: 0 0 12px rgba(110, 231, 183, 0.35);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.1s;
}

.stage-fill.active .touch-dot,
.play-grid.active .touch-dot {
  opacity: 1;
}

.readout-row {
  flex-shrink: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 0.35rem;
  padding: 0.25rem 0.5rem 0.35rem;
}

.value-chip {
  margin: 0;
  padding: 0.35rem 0.5rem;
  font-size: 0.72rem;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid #334155;
  border-radius: 8px;
  line-height: 1.3;
}

.value-chip strong {
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.control-row .btn-play {
  flex: 0 0 auto;
  min-height: 32px;
  padding: 0.25rem 0.65rem;
  font-size: 0.75rem;
}

.control-row .btn-play.active {
  background: var(--accent);
  color: #042f2e;
}

/* Piano — dark chrome, light keys */
.keyboard-scroll {
  flex: 1;
  min-height: 0;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  padding: 0.35rem 0.5rem;
  display: flex;
  align-items: flex-end;
}

.keyboard-wrap {
  position: relative;
  display: inline-flex;
  user-select: none;
  touch-action: manipulation;
  flex-shrink: 0;
}

.piano-key {
  position: relative;
  border-radius: 0 0 6px 6px;
  touch-action: manipulation;
}

.piano-key.white {
  width: 27px;
  height: 118px;
  background: #e2e8f0;
  border: 1px solid #64748b;
  border-top: none;
  margin-right: 1px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 4px;
}

.piano-key.white.active { background: #a7f3d0; }

.piano-key.black {
  position: absolute;
  width: 18px;
  height: 70px;
  background: #1e293b;
  border: 1px solid #0f172a;
  border-top: none;
  z-index: 1;
}

.piano-key.black.active { background: #065f46; }

.piano-key .key-note {
  font-size: 7px;
  pointer-events: none;
  color: #475569;
}

/* Drums — kit pad grid */
.drums-grid {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: 8px;
  padding: 0.35rem 0.5rem;
}

.drum-pad {
  border-radius: 10px;
  border: 1px solid #334155;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 0;
  touch-action: manipulation;
  background: var(--surface);
}

.drum-pad:active, .drum-pad.active {
  filter: brightness(1.25);
  transform: scale(0.96);
  border-color: var(--accent-dim);
}

.drum-pad .pad-icon { font-size: 1.3rem; pointer-events: none; }
.drum-pad .pad-name { font-size: 0.62rem; color: var(--muted); pointer-events: none; }

.drum-pad[data-pad="0"] { background: linear-gradient(135deg, #7f1d1d, #450a0a); }
.drum-pad[data-pad="1"] { background: linear-gradient(135deg, #9a3412, #431407); }
.drum-pad[data-pad="2"] { background: linear-gradient(135deg, #854d0e, #422006); }
.drum-pad[data-pad="3"] { background: linear-gradient(135deg, #166534, #052e16); }
.drum-pad[data-pad="4"] { background: linear-gradient(135deg, #1e40af, #172554); }
.drum-pad[data-pad="5"] { background: linear-gradient(135deg, #6b21a8, #3b0764); }
.drum-pad[data-pad="6"] { background: linear-gradient(135deg, #0f766e, #042f2e); }
.drum-pad[data-pad="7"] { background: linear-gradient(135deg, #475569, #1e293b); }

.tap-bloom-app .tap-bloom-stage {
  flex: 1;
  min-height: 0;
  background: radial-gradient(circle at 50% 40%, #141c28 0%, #050608 72%);
  touch-action: none;
}

.tap-bloom-app .tap-bloom-canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}

/* Compass Wah + Heading Choir — compass rose canvas */
.compass-wah-app .main-stage,
.heading-choir-app .main-stage {
  flex: 1 1 auto;
  min-height: min(52vh, var(--play-min));
  display: flex;
  flex-direction: column;
}

.compass-wah-app .canvas-fill,
.heading-choir-app .canvas-fill {
  touch-action: manipulation;
  flex: 1 1 auto;
  min-height: 12rem;
  width: 100%;
  display: block;
}

.compass-wah-app .canvas-fill.active,
.heading-choir-app .canvas-fill.active {
  outline: 2px solid rgba(110, 231, 183, 0.35);
  outline-offset: -2px;
}

/* Granular tilt — upload + record toolbar */
.granular-tilt-app .app-header h1 {
  font-size: 0.82rem;
}

.granular-tilt-app .header-controls {
  flex-shrink: 0;
  z-index: 11;
}

.granular-tilt-app .granular-toolbar {
  flex-wrap: wrap;
}

.granular-tilt-app .granular-upload {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  margin: 0;
}

.granular-tilt-app .granular-buf-tag {
  font-size: 0.7rem;
  color: var(--muted);
  flex: 1 1 auto;
  text-align: right;
  min-width: 3rem;
}

.granular-tilt-app .btn-rec.recording {
  border-color: #f87171;
  color: #fca5a5;
  background: rgba(127, 29, 29, 0.35);
}

.scrub-tape-app .scrub-stage {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 0;
}

.scrub-tape-app .scrub-center {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.scrub-tape-app .scrub-rec-btn {
  appearance: none;
  padding: 0;
  cursor: pointer;
  font-family: inherit;
  width: min(48vmin, 220px);
  height: min(48vmin, 220px);
  border-radius: 50%;
  border: 4px solid #475569;
  background: radial-gradient(circle at 38% 32%, #3d4f66 0%, #1a2233 68%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  touch-action: manipulation;
  color: var(--text);
  flex-shrink: 0;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
}

.scrub-tape-app .scrub-rec-btn:active {
  transform: scale(0.97);
}

.scrub-tape-app .scrub-rec-btn .rec-icon {
  width: min(20vmin, 64px);
  height: min(20vmin, 64px);
  border-radius: 50%;
  background: #ef4444;
  box-shadow: 0 0 0 min(2vmin, 8px) rgba(239, 68, 68, 0.22);
}

.scrub-tape-app .scrub-rec-btn.recording {
  border-color: #f87171;
  background: radial-gradient(circle at 38% 32%, #5c2a2a 0%, #1a2233 70%);
  box-shadow: 0 0 32px rgba(248, 113, 113, 0.25);
}

.scrub-tape-app .scrub-rec-btn.recording .rec-icon {
  border-radius: 10px;
  width: 44px;
  height: 44px;
  animation: sampler-rec-pulse 0.85s ease-in-out infinite;
}

.scrub-tape-app .scrub-rec-label {
  font-size: 0.76rem;
  font-weight: 600;
}

.scrub-tape-app .scrub-ribbon-wrap {
  width: 100%;
  flex-shrink: 0;
  padding: 0 0.5rem 0.35rem;
  box-sizing: border-box;
}

.scrub-tape-app .scrub-ribbon {
  position: relative;
  width: 100%;
  height: 3.5rem;
  min-height: 52px;
  border-radius: 10px;
  touch-action: none;
  cursor: ew-resize;
  overflow: hidden;
  border: 2px solid #6b5344;
  box-shadow:
    inset 0 3px 10px rgba(0, 0, 0, 0.45),
    0 4px 14px rgba(0, 0, 0, 0.25);
  background: linear-gradient(180deg, #6b5344 0%, #3d2e24 45%, #2a1f18 55%, #5c4638 100%);
}

.scrub-tape-app .scrub-ribbon.is-disabled {
  opacity: 0.38;
  pointer-events: none;
  cursor: not-allowed;
}

.scrub-tape-app .scrub-ribbon.active {
  border-color: var(--accent-dim);
  box-shadow:
    inset 0 3px 10px rgba(0, 0, 0, 0.45),
    0 0 0 2px rgba(110, 231, 183, 0.25);
}

.scrub-tape-app .tape-strip {
  position: absolute;
  inset: 18% 0;
  background: repeating-linear-gradient(
    90deg,
    #c4a574 0,
    #c4a574 10px,
    #a08050 10px,
    #a08050 11px,
    #d4b888 11px,
    #d4b888 22px,
    #8f7040 22px,
    #8f7040 23px
  );
  opacity: 0.85;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.scrub-tape-app .tape-head {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 4px;
  margin-left: -2px;
  background: var(--accent);
  box-shadow:
    0 0 10px rgba(110, 231, 183, 0.85),
    0 0 20px rgba(110, 231, 183, 0.35);
  pointer-events: none;
  z-index: 2;
}

.scrub-tape-app .tape-head::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 14px;
  height: 14px;
  margin: -7px 0 0 -7px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  background: rgba(13, 15, 20, 0.75);
}

.scrub-tape-app .scrub-hint-text {
  margin: 0;
  padding: 0.25rem 1rem 0.6rem;
  font-size: 0.75rem;
  color: var(--muted);
  text-align: center;
  max-width: 22rem;
  line-height: 1.35;
  flex-shrink: 0;
  align-self: center;
}

.scrub-tape-app .scrub-live {
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
}

.scrub-tape-app .scrub-live span {
  color: #cbd5e1;
  text-align: left;
  min-width: 2ch;
}

.scrub-tape-app .scrub-live strong {
  color: #e2e8f0;
  font-weight: 700;
}

.granular-tilt-app .stage-fill.play-grid {
  touch-action: manipulation;
}

/* Bow phone — selfie bow cam + pitch pad */
.bow-phone-app .bow-split {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.bow-phone-app .bow-cam-wrap {
  position: relative;
  flex: 1 1 40%;
  min-height: 5.5rem;
  max-height: 46vh;
  background: #0f172a;
  overflow: hidden;
  border-bottom: 1px solid #2d3548;
}

.bow-phone-app .bow-cam-wrap video,
.bow-phone-app .bow-cam-wrap canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.bow-phone-app .bow-cam-wrap video {
  opacity: 0;
  pointer-events: none;
}

.bow-phone-app .bow-cam-wrap canvas {
  z-index: 1;
}

.bow-phone-app .bow-cam-start {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
  background: rgba(15, 23, 42, 0.88);
}

.bow-phone-app .bow-cam-start.hidden {
  display: none;
}

.bow-phone-app .bow-cam-start .btn {
  max-width: 14rem;
}

.bow-phone-app .bow-cam-hint {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0.25rem;
  text-align: center;
  font-size: 0.62rem;
  color: var(--muted);
  pointer-events: none;
  z-index: 2;
  text-shadow: 0 1px 4px #000;
}

.bow-phone-app .pitch-pad {
  flex: 1 1 55%;
  min-height: 0;
  touch-action: none;
  position: relative;
}

.bow-phone-app .pitch-pad-hint {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0.35rem;
  text-align: center;
  font-size: 0.62rem;
  color: var(--muted);
  pointer-events: none;
  z-index: 1;
}

/* Tilt harp — slide across strings */
.tilt-harp-app .harp-strings {
  position: relative;
  touch-action: none;
  background: #0f172a;
}

.tilt-harp-app .harp-string {
  position: absolute;
  top: 8%;
  bottom: 8%;
  width: 28px;
  margin-left: -14px;
  pointer-events: none;
  background: linear-gradient(180deg, transparent, rgba(110, 231, 183, 0.35), transparent);
  border-radius: 4px;
}

.tilt-harp-app .harp-string.active {
  background: rgba(110, 231, 183, 0.55);
  box-shadow: 0 0 12px rgba(110, 231, 183, 0.35);
}

/* Gesture regression — tilt strip + live readout */
.gesture-regression-app .gr-toolbar {
  flex-shrink: 0;
  padding: 0 0.65rem 0.35rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.gesture-regression-app .gr-mode-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}

.gesture-regression-app .gr-guide {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.35;
  color: #cbd5e1;
  text-align: center;
}

.gesture-regression-app .gr-live {
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem 0.85rem;
}

.gesture-regression-app .gr-live span {
  font-size: 0.72rem;
  color: var(--muted);
}

.gesture-regression-app .gr-live strong {
  color: #e2e8f0;
  font-weight: 700;
}

.gesture-regression-app .gr-match[hidden] {
  display: none !important;
}

.gesture-regression-app #pad.play-grid {
  touch-action: none;
  position: relative;
}

.gesture-regression-app .gr-tilt-axis {
  position: absolute;
  right: 0.65rem;
  top: 0.75rem;
  bottom: 0.75rem;
  width: 2.6rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
  z-index: 2;
}

.gesture-regression-app .gr-tilt-label {
  flex-shrink: 0;
  font-size: 0.55rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--muted);
  line-height: 1.1;
  text-align: center;
}

.gesture-regression-app .gr-tilt-track {
  position: relative;
  flex: 1 1 auto;
  width: 0.5rem;
  margin: 0.25rem 0;
  border-radius: 999px;
  background: linear-gradient(180deg, #334155 0%, #1e293b 100%);
  border: 1px solid #475569;
  box-shadow: inset 0 0 0 1px rgba(110, 231, 183, 0.06);
}

.gesture-regression-app .gr-tilt-marker {
  position: absolute;
  left: 50%;
  width: 1.35rem;
  height: 1.35rem;
  margin-left: -0.675rem;
  margin-top: -0.675rem;
  border-radius: 50%;
  border: 2px solid #f8fafc;
  background: rgba(248, 250, 252, 0.2);
  box-shadow: 0 0 10px rgba(248, 250, 252, 0.35);
  transition: top 0.06s linear;
}

.gesture-regression-app .gr-tilt-samples {
  position: absolute;
  inset: 0;
}

.gesture-regression-app .gr-tilt-sample {
  position: absolute;
  left: 50%;
  width: 0.65rem;
  height: 0.65rem;
  margin-left: -0.325rem;
  margin-top: -0.325rem;
  border-radius: 50%;
  border: 1px solid rgba(15, 23, 42, 0.85);
  box-shadow: 0 0 6px currentColor;
  transition: transform 0.08s, box-shadow 0.08s;
}

.gesture-regression-app .gr-tilt-sample--active {
  transform: scale(1.45);
  box-shadow: 0 0 12px currentColor;
  z-index: 1;
}

.gesture-regression-app .gr-tilt-samples--flash .gr-tilt-sample:last-child {
  animation: gr-sample-pop 0.18s ease-out;
}

@keyframes gr-sample-pop {
  0% { transform: scale(0.4); }
  70% { transform: scale(1.5); }
  100% { transform: scale(1); }
}

.gesture-regression-app .gr-pad-hint {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  margin: 0;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
  pointer-events: none;
  z-index: 1;
  transition: opacity 0.12s;
}

.gesture-regression-app #pad.active .gr-pad-hint {
  opacity: 0.35;
}

.gesture-regression-app #pad.gr-pad--play .gr-tilt-marker {
  border-color: #6ee7b7;
  box-shadow: 0 0 12px rgba(110, 231, 183, 0.45);
}

/* Heading choir — sector readout under status */
.heading-choir-app .hc-live {
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  margin: 0 0.65rem 0.25rem;
}

.heading-choir-app .hc-live label {
  font-size: 0.72rem;
  color: var(--muted);
}

.heading-choir-app .hc-live span {
  font-size: 0.72rem;
  color: #cbd5e1;
}

.heading-choir-app .hc-live strong {
  color: #e2e8f0;
  font-weight: 700;
}

/* Filter ladder — tappable pad while tilting */
.filter-ladder-app .stage-fill.play-grid {
  touch-action: none;
}

/* Mic theremin — pitch keyboard + hold-to-play circle */
.mic-theremin-app .app-header h1 {
  font-size: 0.82rem;
}

.mic-theremin-app .header-controls {
  max-width: 52%;
}

.mic-theremin-app .theremin-keyboard-scroll {
  flex: 1 1 auto;
  min-height: 4.5rem;
  padding-bottom: 0.25rem;
}

.mic-theremin-app .piano-key.theremin-key {
  pointer-events: none;
}

.mic-theremin-app .piano-key.white.theremin-key {
  width: 22px;
  height: 76px;
}

.mic-theremin-app .piano-key.black.theremin-key {
  width: 14px;
  height: 46px;
}

.mic-theremin-app .piano-key.theremin-key.pitch-detected {
  box-shadow: 0 0 14px rgba(110, 231, 183, 0.55);
}

.mic-theremin-app .piano-key.white.theremin-key.pitch-detected {
  background: #6ee7b7;
}

.mic-theremin-app .piano-key.black.theremin-key.pitch-detected {
  background: #047857;
}

.mic-theremin-app .theremin-play-area {
  flex-shrink: 0;
  display: flex;
  justify-content: center;
  padding: 0.35rem 0.5rem calc(0.5rem + var(--safe-b));
}

.mic-theremin-app .theremin-play-btn {
  position: relative;
  width: 5.75rem;
  height: 5.75rem;
  border-radius: 50%;
  border: 2px solid var(--accent-dim);
  background: radial-gradient(circle at 32% 28%, #334155, #0f172a 72%);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mic-theremin-app .theremin-play-btn.active {
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 0 22px rgba(110, 231, 183, 0.35);
}

.mic-theremin-app .theremin-play-inner {
  position: absolute;
  inset: 5px;
  border-radius: 50%;
  border: 3px solid rgba(110, 231, 183, 0.2);
  opacity: 0;
  transform: scale(0.92);
  transition: opacity 0.12s, transform 0.12s;
}

.mic-theremin-app .theremin-play-inner.on {
  opacity: 1;
  transform: scale(1);
  border-color: var(--accent);
  animation: theremin-pulse 0.9s ease-in-out infinite;
}

.mic-theremin-app .theremin-play-label {
  position: relative;
  z-index: 1;
  pointer-events: none;
}

@keyframes theremin-pulse {
  0%,
  100% {
    box-shadow: inset 0 0 0 0 rgba(110, 231, 183, 0.15);
  }
  50% {
    box-shadow: inset 0 0 18px 4px rgba(110, 231, 183, 0.35);
  }
}

/* Additive bells — scroll partials + large strike pad */
.additive-bells-app .bells-layout {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.additive-bells-app .bells-scroll {
  flex: 0 1 auto;
  max-height: 48%;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.additive-bells-app .bells-partials {
  flex: none;
  overflow: visible;
  margin: 0;
  padding: 0;
}

.additive-bells-app .bells-partials .control-row {
  padding: 0.12rem 0.5rem;
}

.additive-bells-app .bells-partials .control-row input[type="range"] {
  min-height: 26px;
}

.additive-bells-app .bells-pad-wrap {
  flex: 1 1 auto;
  min-height: 6.5rem;
  display: flex;
  flex-direction: column;
  padding: 0.35rem 0.5rem calc(0.35rem + var(--safe-b));
}

.additive-bells-app .bells-pad {
  flex: 1 1 auto;
  width: 100%;
  min-height: 6rem;
  margin: 0;
  touch-action: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.03em;
}

/* Drum sequencer — 4 rows × 8 steps */
.drum-seq-app .seq-toolbar {
  flex-shrink: 0;
  background: #111827;
}

.drum-seq-app .seq-toolbar .control-row {
  padding: 0.2rem 0.5rem;
}

.drum-seq-app .seq-toolbar .control-row input[type="range"] {
  flex: 1 1 5rem;
  max-width: 8rem;
}

.drum-seq-app .main-stage {
  flex: 1;
  min-height: 0;
}

.drum-seq {
  flex: 1;
  min-height: 11rem;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0.35rem 0.5rem;
  overflow-y: auto;
}

.drum-seq-row {
  flex: 1 1 0;
  min-height: 44px;
  display: grid;
  grid-template-columns: 36px repeat(8, minmax(0, 1fr));
  gap: 5px;
}

.drum-row-label {
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.drum-row-label .pad-icon {
  font-size: 1.35rem;
  line-height: 1;
}

.drum-seq-cell {
  min-width: 0;
  min-height: 44px;
  width: 100%;
  border-radius: 8px;
  border: 1px solid #334155;
  background: #334155;
  padding: 0;
  touch-action: manipulation;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.drum-seq-cell.on {
  background: var(--accent-dim);
  border-color: var(--accent);
}

.drum-seq-cell.playing {
  box-shadow: 0 0 8px var(--accent);
}

.drum-seq-row:nth-child(1) .drum-seq-cell.on { background: linear-gradient(135deg, #991b1b, #7f1d1d); }
.drum-seq-row:nth-child(2) .drum-seq-cell.on { background: linear-gradient(135deg, #c2410c, #9a3412); }
.drum-seq-row:nth-child(3) .drum-seq-cell.on { background: linear-gradient(135deg, #a16207, #854d0e); }
.drum-seq-row:nth-child(4) .drum-seq-cell.on { background: linear-gradient(135deg, #15803d, #166534); }

/* Circular drum sequencer */
.circular-drum-app .seq-toolbar {
  flex-shrink: 0;
  background: #111827;
}

.circular-drum-app .seq-toolbar .control-row {
  padding: 0.2rem 0.5rem;
}

.circular-drum-app .seq-toolbar .control-row input[type="range"] {
  flex: 1 1 5rem;
  max-width: 8rem;
}

.circular-drum-app #ringPick {
  flex-wrap: wrap;
  gap: 0.25rem;
}

.circular-drum-app #ringPick .btn.active {
  border-color: var(--accent);
  color: var(--accent);
}

.circular-drum-app .main-stage.circular-drum-stage {
  flex: 1;
  min-height: 0;
  padding: 0.25rem 0.5rem calc(0.35rem + var(--safe-b));
}

.circular-drum-app #seq {
  touch-action: none;
  width: 100%;
  height: 100%;
  border-radius: 12px;
  background: #0f172a;
}

.circular-drum-app .circ-drum-legend {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.15rem 0.65rem 0;
  font-size: 1.1rem;
}

.circular-drum-app .circ-legend-hint {
  font-size: 0.7rem;
  color: var(--muted);
  margin-left: auto;
}

/* Evo drumkit */
.evo-drumkit-app .evo-toolbar {
  flex-shrink: 0;
  padding: 0 0.5rem 0.35rem;
  background: #111827;
}

.evo-drumkit-app .evo-toolbar .control-row {
  padding: 0.2rem 0;
}

.evo-drumkit-app .evo-toolbar .control-row input[type="range"] {
  flex: 1 1 4rem;
  max-width: 6rem;
}

.evo-drumkit-app .evo-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0.25rem 0;
}

.evo-drumkit-app .evo-stats {
  margin: 0.2rem 0 0.35rem;
  font-size: 0.72rem;
}

.evo-drumkit-app .evo-pattern-viz {
  width: 100%;
  height: 48px;
  border-radius: 8px;
  display: block;
  margin-bottom: 0.25rem;
}

.evo-drumkit-app #recordBtn.active {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(110, 231, 183, 0.12);
}

.evo-drumkit-app .main-stage {
  flex: 1;
  min-height: 0;
  padding: 0 0.5rem calc(0.35rem + var(--safe-b));
}

.evo-drumkit-app .evo-stage-wrap {
  position: relative;
}

.evo-drumkit-app .evo-countdown {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(3rem, 18vw, 5rem);
  font-weight: 800;
  color: var(--accent);
  background: rgba(2, 6, 23, 0.72);
  border-radius: 12px;
  z-index: 5;
  pointer-events: none;
}

.evo-drumkit-app .evo-countdown.hidden {
  display: none;
}

/* Firefly pulse sync */
.firefly-app .firefly-toolbar {
  flex-shrink: 0;
  padding: 0 0.5rem 0.35rem;
  background: #111827;
}

.firefly-app .firefly-toolbar .control-row {
  padding: 0.2rem 0;
}

.firefly-app .firefly-toolbar .control-row input[type="range"] {
  flex: 1 1 5rem;
  max-width: 8rem;
}

.firefly-app .firefly-live {
  justify-content: center;
  flex-wrap: wrap;
}

.firefly-app .firefly-live span {
  color: #cbd5e1;
  flex: 0 0 auto;
}

.firefly-app .evo-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0.25rem 0;
  align-items: center;
}

.firefly-app .firefly-stage {
  flex: 1;
  min-height: 10rem;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 0.5rem calc(0.35rem + var(--safe-b));
  border-radius: 16px;
  background: radial-gradient(ellipse at center, #0f172a 0%, #020617 75%);
  overflow: hidden;
}

.firefly-app .firefly-glow {
  width: min(55vw, 200px);
  height: min(55vw, 200px);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(250, 204, 21, 0.08) 0%, transparent 70%);
  transition: transform 0.05s ease-out, opacity 0.08s;
  opacity: 0.35;
}

.firefly-app .firefly-glow.on {
  opacity: 1;
  transform: scale(1.12);
  background: radial-gradient(circle, rgba(253, 224, 71, 0.55) 0%, rgba(250, 204, 21, 0.12) 45%, transparent 72%);
  box-shadow: 0 0 48px rgba(250, 204, 21, 0.35);
}

.firefly-app .firefly-stage.pulse {
  background: radial-gradient(ellipse at center, #1a2e1a 0%, #020617 75%);
}

.firefly-app .firefly-beat-flash.on {
  background: rgba(250, 204, 21, 0.22);
  opacity: 1;
}

.firefly-app .firefly-beat-flash.on-down {
  background: rgba(253, 224, 71, 0.62);
  opacity: 1;
}

/* Light Theremin */
.light-theremin-app .light-row {
  padding: 0 0.5rem 0.25rem;
}

.light-theremin-app .light-row input[type="range"] {
  flex: 1 1 6rem;
}

.light-theremin-app .light-lux {
  font-size: 0.75rem;
  color: var(--muted);
  min-width: 3.5rem;
  text-align: right;
}

.light-theremin-app .light-pad {
  position: relative;
}

.light-theremin-app .light-glow {
  position: absolute;
  inset: 10%;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(circle, rgba(253, 224, 71, 0.35) 0%, transparent 70%);
  opacity: 0.4;
  transition: opacity 0.08s;
}

.spectral-freeze-app .app-toolbar {
  flex-shrink: 0;
  padding: 0 0.5rem 0.35rem;
}

/* Markov melody */
.markov-melody-app .markov-stage {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.markov-melody-app .markov-keyboard-scroll {
  flex: 1;
  min-height: 140px;
}

.markov-melody-app .harm-select {
  font-size: 0.75rem;
  padding: 0.2rem 0.35rem;
  border-radius: 6px;
  border: 1px solid #334155;
  background: #0f172a;
  color: #e2e8f0;
}

.markov-melody-app .markov-toolbar {
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}

.markov-melody-app .markov-live {
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
}

.markov-melody-app .markov-live span {
  color: #cbd5e1;
  text-align: left;
  min-width: 2ch;
}

.markov-melody-app .markov-live strong {
  color: #e2e8f0;
  font-weight: 700;
}

.pinch-bass-app .pinch-live {
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
}

.pinch-bass-app .pinch-live span {
  color: #cbd5e1;
  text-align: left;
  min-width: 2ch;
}

.pinch-bass-app .pinch-live strong {
  color: #e2e8f0;
  font-weight: 700;
}

.shepard-glide-app .shepard-pad {
  touch-action: none;
}

.shepard-glide-app .shepard-live {
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
}

.shepard-glide-app .shepard-live span {
  color: #cbd5e1;
  text-align: left;
  min-width: 2ch;
}

.shepard-glide-app .shepard-live strong {
  color: #e2e8f0;
  font-weight: 700;
}

.vocoder-choir-app .vocoder-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
  padding: 1rem;
}

.vocoder-choir-app .vocoder-play-btn {
  appearance: none;
  padding: 0;
  cursor: pointer;
  font-family: inherit;
  width: min(54vw, 210px);
  height: min(54vw, 210px);
  border-radius: 50%;
  border: 3px solid #475569;
  background: radial-gradient(circle at 38% 32%, #3a4a62 0%, #151c28 68%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  touch-action: manipulation;
  color: var(--text);
  flex-shrink: 0;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
}

.vocoder-choir-app .vocoder-play-btn:active,
.vocoder-choir-app .vocoder-play-btn.active {
  transform: scale(0.97);
}

.vocoder-choir-app .vocoder-play-btn.active {
  border-color: var(--accent-dim);
  box-shadow: 0 0 32px rgba(110, 231, 183, 0.22);
}

.vocoder-choir-app .vocoder-play-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(145deg, #6ee7b7 0%, #2dd4bf 55%, #0d9488 100%);
  box-shadow: 0 0 0 8px rgba(110, 231, 183, 0.18);
}

.vocoder-choir-app .vocoder-play-btn.active .vocoder-play-icon {
  animation: vocoder-pulse 0.9s ease-in-out infinite;
}

.vocoder-choir-app .vocoder-play-label {
  font-size: 0.76rem;
  font-weight: 600;
}

.vocoder-choir-app .vocoder-hint-text {
  margin: 0;
  font-size: 0.75rem;
  color: var(--muted);
  text-align: center;
  max-width: 18rem;
  line-height: 1.35;
}

.vocoder-choir-app .vocoder-live {
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
}

.vocoder-choir-app .vocoder-live span {
  color: #cbd5e1;
  text-align: left;
  min-width: 2ch;
}

.vocoder-choir-app .vocoder-live strong {
  color: #e2e8f0;
  font-weight: 700;
}

.wind-bottle-app .wind-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
  padding: 1rem;
}

.wind-bottle-app .wind-play-btn {
  appearance: none;
  padding: 0;
  cursor: pointer;
  font-family: inherit;
  width: min(54vw, 210px);
  height: min(54vw, 210px);
  border-radius: 50%;
  border: 3px solid #475569;
  background: radial-gradient(circle at 38% 30%, #2d3f52 0%, #121820 70%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  touch-action: manipulation;
  color: var(--text);
  flex-shrink: 0;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
}

.wind-bottle-app .wind-play-btn:active,
.wind-bottle-app .wind-play-btn.active {
  transform: scale(0.97);
}

.wind-bottle-app .wind-play-btn.active {
  border-color: #7dd3fc;
  box-shadow: 0 0 32px rgba(125, 211, 252, 0.2);
}

.wind-bottle-app .wind-play-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #e0f2fe 0%, #38bdf8 45%, #0284c7 100%);
  box-shadow: 0 0 0 8px rgba(56, 189, 248, 0.18);
}

.wind-bottle-app .wind-play-btn.active .wind-play-icon {
  animation: wind-breathe 1.1s ease-in-out infinite;
}

.wind-bottle-app .wind-play-label {
  font-size: 0.76rem;
  font-weight: 600;
}

.wind-bottle-app .wind-hint-text {
  margin: 0;
  font-size: 0.75rem;
  color: var(--muted);
  text-align: center;
  max-width: 18rem;
  line-height: 1.35;
}

.wind-bottle-app .wind-live {
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
}

.wind-bottle-app .wind-live span {
  color: #cbd5e1;
  text-align: left;
  min-width: 2ch;
}

.wind-bottle-app .wind-live strong {
  color: #e2e8f0;
  font-weight: 700;
}

.kaoss-pad-app .kaoss-toolbar {
  flex-wrap: wrap;
  gap: 0.35rem 0.5rem;
  align-items: center;
}

.kaoss-pad-app .kaoss-toolbar label {
  font-size: 0.72rem;
  color: var(--muted);
}

.kaoss-pad-app .kaoss-toolbar select {
  background: var(--surface);
  color: var(--text);
  border: 1px solid #475569;
  border-radius: 6px;
  padding: 0.2rem 0.35rem;
  font-size: 0.78rem;
}

.kaoss-pad-app .kaoss-toolbar input[type="range"] {
  width: 5rem;
  max-width: 28vw;
  min-height: 32px;
}

.kaoss-pad-app .kaoss-toolbar #bpmVal {
  font-size: 0.75rem;
  color: var(--muted);
  min-width: 2rem;
}

.kaoss-pad-app .kaoss-live {
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
}

.kaoss-pad-app .kaoss-live span {
  color: #cbd5e1;
  text-align: left;
  min-width: 2ch;
}

.kaoss-pad-app .kaoss-live strong {
  color: #e2e8f0;
  font-weight: 700;
}

.kaoss-pad-app .kaoss-stage {
  min-height: 0;
}

.kaoss-pad-app .kaoss-pad {
  touch-action: none;
  background:
    linear-gradient(180deg, rgba(110, 231, 183, 0.06) 0%, transparent 40%),
    linear-gradient(90deg, rgba(148, 163, 184, 0.08) 1px, transparent 1px),
    linear-gradient(0deg, rgba(148, 163, 184, 0.08) 1px, transparent 1px),
    radial-gradient(ellipse at 50% 100%, rgba(45, 212, 191, 0.12) 0%, transparent 55%),
    var(--surface);
  background-size: 100% 100%, calc(100% / 8) 100%, 100% calc(100% / 8), 100% 100%, 100% 100%;
}

.kaoss-pad-app .kaoss-pad.active {
  box-shadow: inset 0 0 0 2px var(--accent-dim);
}

.kaoss-pad-app .kaoss-grid {
  position: absolute;
  inset: 12% 8%;
  border: 1px solid rgba(110, 231, 183, 0.25);
  border-radius: 8px;
  pointer-events: none;
  box-shadow: inset 0 0 24px rgba(110, 231, 183, 0.06);
}

@keyframes wind-breathe {
  50% {
    opacity: 0.7;
    transform: scale(0.92);
  }
}

@keyframes vocoder-pulse {
  50% {
    opacity: 0.65;
    transform: scale(0.94);
  }
}

.pluck-bowl-app .bowl-live {
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
}

.pluck-bowl-app .bowl-live span {
  color: #cbd5e1;
  text-align: left;
  min-width: 2ch;
}

.pluck-bowl-app .bowl-live strong {
  color: #e2e8f0;
  font-weight: 700;
}

.markov-melody-app .piano-key.markov-out-scale {
  opacity: 0.38;
}

.markov-melody-app .piano-key.markov-in-scale {
  opacity: 1;
}

.markov-melody-app .piano-key.markov-in-scale.white {
  border-color: #2dd4bf;
}

.markov-melody-app .piano-key.markov-in-scale.black {
  border-color: #5eead4;
}

/* L-system groove — compact toolbar + grid fits viewport */
.lsystem-groove-app .lsys-toolbar {
  flex-shrink: 0;
  padding: 0 0.45rem 0.25rem;
  gap: 0.2rem;
}

.lsystem-groove-app .lsys-toolbar .control-row {
  flex-wrap: wrap;
  gap: 0.25rem 0.4rem;
}

.lsystem-groove-app .lsys-toolbar input[type="range"] {
  flex: 1 1 4.5rem;
  max-width: 6.5rem;
}

.lsystem-groove-app .lsys-meta {
  margin: 0;
  text-align: center;
  font-size: 0.68rem;
  color: var(--muted);
  line-height: 1.3;
}

.lsystem-groove-app .lsys-meta strong {
  color: #cbd5e1;
  font-weight: 600;
}

.lsystem-groove-app #ruleOut {
  display: inline-block;
  max-width: min(14rem, 72vw);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: bottom;
}

.lsystem-groove-app .lsystem-stage {
  flex: 1;
  min-height: 0;
  padding: 0.2rem 0.35rem calc(0.25rem + var(--safe-b));
  overflow: hidden;
  display: flex;
  align-items: stretch;
  justify-content: center;
}

.lsystem-groove-app .lsystem-grid {
  display: grid;
  width: 100%;
  max-width: 100%;
  height: 100%;
  max-height: 100%;
  grid-template-columns: 1.2rem repeat(16, minmax(0, 1fr));
  grid-template-rows: repeat(4, minmax(0, 1fr));
  gap: 1px;
  min-width: 0;
  margin: 0;
}

.lsystem-groove-app .lsystem-row-label {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  min-width: 0;
}

.lsystem-groove-app .lsystem-cell {
  min-width: 0;
  min-height: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border-radius: 3px;
  border: 1px solid #334155;
  background: #0f172a;
}

.lsystem-cell.on {
  background: #b91c1c;
  border-color: #f87171;
}

.lsystem-cell.play {
  box-shadow: 0 0 0 2px #6ee7b7;
}

/* Chaos attractor */
.chaos-attractor-app #pad {
  position: relative;
}

.chaos-trail {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0.85;
}

/* Harmonizer + Swarm Bloom (shared chroma UI) */
.harmonizer-app .harm-toolbar,
.swarm-bloom-app .swarm-toolbar {
  flex-shrink: 0;
  padding: 0 0.5rem 0.35rem;
  background: #111827;
}

.harmonizer-app .harm-select,
.swarm-bloom-app .harm-select {
  font-size: 0.75rem;
  padding: 0.2rem 0.35rem;
  border-radius: 6px;
  border: 1px solid #334155;
  background: #0f172a;
  color: #e2e8f0;
}

.harmonizer-app .harm-scale,
.swarm-bloom-app .harm-scale {
  font-size: 0.75rem;
  color: #94a3b8;
}

.harmonizer-app .harm-toolbar .evo-actions,
.swarm-bloom-app .swarm-toolbar .evo-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
  margin: 0.25rem 0;
}

.harmonizer-app .harm-live {
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
  margin-top: 0.15rem;
}

.harmonizer-app .harm-live label {
  font-size: 0.72rem;
  color: var(--muted);
}

.harmonizer-app .harm-live span {
  font-size: 0.72rem;
  color: #cbd5e1;
}

.harmonizer-app .harm-live strong {
  color: #e2e8f0;
  font-weight: 700;
}

.harmonizer-app .harm-main {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.35rem 0.5rem calc(0.35rem + var(--safe-b));
  gap: 0.75rem;
}

.harmonizer-app .harm-chroma-wrap,
.swarm-bloom-app .harm-chroma-wrap {
  width: 100%;
  flex: 0 0 auto;
  min-height: 56px;
  border-radius: 8px;
  overflow: hidden;
  background: #0f172a;
  border: 1px solid #334155;
}

.harmonizer-app .harm-chroma-viz,
.swarm-bloom-app .harm-chroma-viz {
  width: 100%;
  height: 56px;
  display: block;
  vertical-align: top;
}

.harmonizer-app .harm-hold-btn {
  position: relative;
  flex: 0 0 auto;
  width: min(52vw, 200px);
  height: min(52vw, 200px);
  border-radius: 50%;
  border: 2px solid #475569;
  background: radial-gradient(circle at 35% 30%, #1e293b, #0f172a 70%);
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 600;
  touch-action: none;
  cursor: pointer;
  margin-top: auto;
}

.harmonizer-app .harm-hold-btn:disabled {
  opacity: 0.45;
}

.harmonizer-app .harm-hold-btn.active {
  border-color: var(--accent);
  color: var(--accent);
}

.harmonizer-app .harm-glow {
  position: absolute;
  inset: 12%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(110, 231, 183, 0.15), transparent 70%);
  opacity: 0.4;
  pointer-events: none;
}

.harmonizer-app .harm-hold-btn.active .harm-glow {
  opacity: 1;
  background: radial-gradient(circle, rgba(110, 231, 183, 0.45), transparent 72%);
  box-shadow: 0 0 40px rgba(110, 231, 183, 0.25);
}

.swarm-bloom-app .swarm-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.swarm-bloom-app .swarm-glow-stage {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at center, #1a1030 0%, #0d0f14 65%);
  transition: filter 0.08s ease;
}

.swarm-bloom-app .swarm-glow {
  width: min(70vw, 220px);
  height: min(70vw, 220px);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(167, 139, 250, 0.35) 0%, transparent 70%);
  opacity: 0.35;
  transition: opacity 0.1s ease, transform 0.1s ease;
}

.swarm-bloom-app .swarm-glow.on {
  opacity: 0.95;
  transform: scale(1.06);
}

.swarm-bloom-app .swarm-glow-stage.pulse {
  filter: brightness(1.12);
}

.swarm-bloom-app .swarm-beat-flash.on {
  background: rgba(167, 139, 250, 0.22);
}

.swarm-bloom-app .swarm-beat-flash.on-strong {
  background: rgba(196, 181, 253, 0.38);
}

.harmonizer-app .harm-hold-label {
  position: relative;
  z-index: 1;
}

.pluck-ripple {
  position: absolute;
  width: 48px;
  height: 48px;
  margin: -24px 0 0 -24px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  pointer-events: none;
  animation: ripple-out 0.55s ease-out forwards;
}

@keyframes ripple-out {
  from { transform: scale(0.4); opacity: 0.9; }
  to { transform: scale(2.2); opacity: 0; }
}

.breath-row {
  flex-shrink: 0;
  padding: 0.25rem 0.5rem 0;
}

.breath-row label {
  font-size: 0.68rem;
  color: var(--muted);
  display: block;
  margin-bottom: 0.15rem;
}

.breath-meter {
  height: 8px;
  background: #334155;
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.breath-meter-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #38bdf8, var(--accent));
  transition: width 0.05s linear;
}

.breath-meter-fill.blowing {
  background: linear-gradient(90deg, var(--accent-dim), var(--accent));
}

.breath-threshold::after {
  content: "";
  position: absolute;
  left: var(--thresh, 35%);
  top: 0;
  width: 2px;
  height: 100%;
  background: #fbbf24;
}

.flute-body {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  touch-action: manipulation;
  background: linear-gradient(180deg, #1e293b 0%, #0f172a 40%, #1a2332 100%);
}

.flute-body .pad-readout {
  position: static;
  transform: none;
  margin-top: 0.35rem;
}

.flute-tube {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  width: min(72px, 22vw);
  margin: 0.15rem 0;
  border-radius: 36px;
  background: linear-gradient(90deg, #334155, #475569 35%, #64748b 50%, #475569 65%, #334155);
  box-shadow: inset 0 0 12px rgba(0, 0, 0, 0.45), 0 4px 16px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column-reverse;
  align-items: center;
  justify-content: space-evenly;
  padding: 0.4rem 0;
  gap: 0.15rem;
}

.flute-hole {
  flex: 1 1 0;
  width: min(44px, 12vw);
  height: auto;
  max-width: 44px;
  max-height: 44px;
  min-width: 34px;
  min-height: 34px;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 2px solid #64748b;
  background: radial-gradient(circle at 35% 30%, #1e293b, #0f172a 70%);
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.6);
  padding: 0;
  position: relative;
  z-index: 2;
  touch-action: manipulation;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.flute-hole.open {
  border-color: var(--accent-dim);
  background: radial-gradient(circle at 35% 30%, #134e4a, #0f172a 60%);
  box-shadow: inset 0 0 8px rgba(110, 231, 183, 0.35);
}

.flute-hole.covered {
  border-color: #94a3b8;
  background: radial-gradient(circle at 35% 30%, #64748b, #334155);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.4), 0 0 0 2px rgba(148, 163, 184, 0.25);
}

.flute-hole.held {
  border-color: var(--accent);
  box-shadow: inset 0 0 10px rgba(110, 231, 183, 0.45), 0 0 0 3px rgba(110, 231, 183, 0.35);
}

.flute-hole-label {
  position: absolute;
  right: calc(50% + min(36px, 11vw) + 0.5rem);
  font-size: 0.55rem;
  color: var(--muted);
  pointer-events: none;
  opacity: 0.7;
}

.finger-dot {
  position: absolute;
  width: 28px;
  height: 28px;
  margin: -14px 0 0 -14px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid #042f2e;
  pointer-events: none;
  box-shadow: 0 0 12px rgba(110, 231, 183, 0.45);
}

.pad-readout {
  position: absolute;
  top: 0.35rem;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
  pointer-events: none;
}

.axis-hint {
  position: absolute;
  right: 0.35rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.6rem;
  color: var(--muted);
  line-height: 1.3;
  text-align: right;
  pointer-events: none;
}

.wi-controls {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: center;
  padding: 0.25rem 0.5rem;
  flex-shrink: 0;
  font-size: 0.75rem;
}

.wi-controls label { color: var(--muted); }

.wi-controls select,
.wi-controls input[type="range"] {
  min-height: 32px;
  font-size: 0.8rem;
  background: var(--surface);
  color: var(--text);
  border: 1px solid #475569;
  border-radius: 6px;
}

.wi-controls input[type="range"] { width: 72px; }

.wi-controls button {
  min-height: 32px;
  min-width: 32px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid #475569;
  border-radius: 6px;
}

.pick-label[aria-hidden="true"] {
  display: none;
}

.pick-label {
  font-size: 0.72rem;
  color: var(--muted);
  text-align: center;
  margin: 0.15rem 0 0;
  flex-shrink: 0;
}

.phone-icon {
  width: 64px;
  height: 108px;
  border: 2px solid var(--accent-dim);
  border-radius: 12px;
  transition: transform 0.1s ease-out;
  flex-shrink: 0;
}

.touch-zone {
  flex: 1 1 auto;
  min-height: var(--play-min);
  margin: 0.35rem 0.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.35rem;
  touch-action: none;
  border-radius: 10px;
  border: 1px solid #334155;
  background: var(--surface);
}

.touch-zone .meter { width: 70%; }

.motion-wah-app .touch-zone {
  touch-action: manipulation;
}

.motion-wah-app .motion-meters {
  width: 70%;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.motion-wah-app .motion-meter-label {
  font-size: 0.65rem;
  color: var(--muted);
  text-align: left;
  width: 100%;
}

.sound-saber-app .saber-beam {
  background: radial-gradient(ellipse 40% 80% at 50% 85%, rgba(110, 231, 183, 0.12), transparent 70%);
}

.sound-saber-app .meter-fill-warm {
  background: linear-gradient(90deg, #f59e0b, #ef4444);
}

.sound-saber-app .touch-zone.active {
  background: radial-gradient(ellipse 50% 90% at 50% 80%, rgba(110, 231, 183, 0.18), rgba(110, 231, 183, 0.04));
}

.touch-zone.active {
  background: rgba(110, 231, 183, 0.08);
  border-color: var(--accent-dim);
}

.hidden {
  display: none !important;
}

/* Touch pad (div) */
.play-surface {
  width: 100%;
  height: 100%;
  min-height: var(--play-min);
  touch-action: none;
}

/* Canvas must fill a sized box — flex alone does not size <canvas> */
.stage-fill canvas,
.canvas-fill {
  display: block;
  width: 100%;
  height: 100%;
  min-height: var(--play-min);
}

.pred-display {
  flex-shrink: 0;
  font-size: 1.25rem;
  font-weight: 700;
  text-align: center;
  padding: 0.35rem 0.5rem;
  margin: 0.25rem 0.5rem;
  border-radius: 8px;
  background: var(--surface);
}

.pred-display.still {
  color: #38bdf8;
}

.pred-display.shake {
  color: #fb923c;
}

.pred-display.sway {
  color: #a78bfa;
}

.pred-display.hum {
  color: #6ee7b7;
}

.pred-display.clap {
  color: #fb923c;
}

.pred-display.silence {
  color: #64748b;
}

html.omo-a11y {
  --touch-min: 52px;
  --header-h: 48px;
  --toolbar-h: 52px;
  --status-h: 26px;
}

html.omo-a11y .hub-header h1 {
  font-size: 1.35rem;
}

html.omo-a11y .app-list a {
  min-height: 56px;
  padding: 0.65rem 0.7rem;
}

html.omo-a11y .app-list .title {
  font-size: 1.05rem;
}

html.omo-a11y .app-list .meta {
  font-size: 0.78rem;
}

html.omo-a11y .app-list .tag {
  font-size: 0.68rem;
}

html.omo-a11y .control-row,
html.omo-a11y .slide-toggle {
  font-size: 0.85rem;
}

html.omo-a11y .slide-toggle input[type="checkbox"] {
  width: 1.2rem;
  height: 1.2rem;
  flex-shrink: 0;
}

html.omo-a11y .btn,
html.omo-a11y .cell,
html.omo-a11y .drum-pad,
html.omo-a11y .learn-toggle,
html.omo-a11y .qr-toggle,
html.omo-a11y .audio-toggle {
  min-height: 52px;
  font-size: 0.85rem;
}

html.omo-a11y .back-link {
  min-width: 44px;
  min-height: 44px;
}

html.omo-a11y .app-header h1 {
  font-size: 1rem;
}

html.omo-a11y .status-bar {
  font-size: 0.78rem;
}

html.omo-a11y .piano-key.white {
  width: 32px;
  height: 132px;
}

html.omo-a11y .piano-key.black {
  width: 21px;
  height: 78px;
}

html.omo-a11y .piano-key .key-note {
  font-size: 8px;
}

html.omo-a11y .drum-pad .pad-icon {
  font-size: 1.5rem;
}

html.omo-a11y .drum-pad .pad-name {
  font-size: 0.72rem;
}

.hub-banner {
  margin: 0.35rem 0.5rem;
  padding: 0.45rem 0.5rem;
  border-radius: 8px;
  font-size: 0.75rem;
  border: 1px solid var(--accent-dim);
  background: rgba(110, 231, 183, 0.08);
}

.countdown-flash {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: rgba(110, 231, 183, 0.25);
  opacity: 0;
  z-index: 100;
  transition: opacity 0.05s;
}

.countdown-flash.on {
  opacity: 1;
}

.slide-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
}

.semitone-ruler {
  position: absolute;
  left: 0.25rem;
  top: 8%;
  bottom: 8%;
  width: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  font-size: 0.55rem;
  color: var(--muted);
  pointer-events: none;
}

.btn-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.35rem;
  padding: 0 0.5rem 0.35rem;
  flex-shrink: 0;
}

.btn-grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.35rem;
  padding: 0 0.5rem 0.35rem;
  flex-shrink: 0;
}

.seq-grid {
  flex: 1 1 auto;
  min-height: var(--play-min);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(4, 1fr);
  gap: 4px;
  padding: 0.35rem 0.5rem;
}

.seq-grid .cell {
  min-height: 0;
  border-radius: 6px;
  background: #334155;
  border: none;
  padding: 0;
}

.seq-grid .cell.on {
  background: var(--accent-dim);
}

.seq-grid .cell.playing {
  box-shadow: 0 0 8px var(--accent);
}

.note-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.35rem;
  padding: 0.35rem 0.5rem;
  flex-shrink: 0;
}

.note-grid button {
  min-height: 38px;
  font-size: 0.85rem;
  border-radius: 8px;
  border: 2px solid #475569;
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
}

.note-grid button.selected {
  border-color: var(--accent);
  background: #064e3b;
}

.countdown-lg {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  font-weight: 800;
}

.role-tabs {
  display: flex;
  gap: 0.35rem;
  padding: 0.35rem 0.5rem 0;
  flex-shrink: 0;
}

.role-tabs button {
  flex: 1;
  min-height: 34px;
  border-radius: 6px;
  border: 1px solid #475569;
  background: var(--surface);
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 600;
}

.role-tabs button.active {
  border-color: var(--accent);
  background: #064e3b;
}

.scroll-panel {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  margin: 0.35rem 0.5rem;
  padding: 0.5rem;
}

.link-box {
  word-break: break-all;
  font-size: 0.7rem;
  background: #0f172a;
  padding: 0.4rem;
  border-radius: 6px;
  margin-top: 0.35rem;
}

.qr-share {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 0.5rem;
}

.qr-share canvas {
  display: block;
  border-radius: 10px;
  box-shadow: inset 0 0 0 2px #334155;
  max-width: min(78vw, 240px);
  width: 100%;
  height: auto;
}

.qr-caption {
  margin: 0;
  font-size: 0.72rem;
  color: var(--muted);
  text-align: center;
}
