* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { width: 100%; height: 100%; overflow: hidden; background: #000; touch-action: manipulation; }
@supports (padding: env(safe-area-inset-bottom)) {
  .main-footer { padding-bottom: calc(20px + env(safe-area-inset-bottom)); }
  .main-header { padding-top: calc(8px + env(safe-area-inset-top)); }
}

/* ─── Shared ─── */
.font { font-family: 'Segoe UI', system-ui, -apple-system, sans-serif; }
.fade { transition: opacity 0.6s ease; }
.hidden { opacity: 0; pointer-events: none; }

/* ─── Main Screen ─── */
#main {
  position: fixed; inset: 0; z-index: 10;
  display: flex; flex-direction: column; align-items: center;
  pointer-events: auto; overflow: hidden;
  background: radial-gradient(ellipse at center, rgba(0,0,0,0.2) 0%, rgba(0,0,0,0.6) 100%);
}
#main.hidden { opacity: 0; pointer-events: none; }

/* ─── Header ─── */
.main-header {
  padding: 20px 0 8px;
  text-align: center;
  flex-shrink: 0;
}
.main-header h1 {
  font-size: 28px; font-weight: 200; letter-spacing: 8px;
  color: rgba(255,255,255,0.9);
  text-transform: uppercase;
  text-shadow: 0 0 40px rgba(255,255,255,0.2);
}
.subtitle {
  font-size: 11px; font-weight: 300; color: rgba(255,255,255,0.5);
  letter-spacing: 3px; text-transform: uppercase;
  margin-top: 2px;
}

/* ─── Toolbar ─── */
.main-toolbar {
  display: flex; align-items: center; justify-content: center;
  gap: 12px; padding: 8px 16px; width: 100%;
  max-width: 620px; flex-shrink: 0;
}
.toolbar-btn {
  background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.2);
  border-radius: 8px; padding: 8px 16px;
  color: rgba(255,255,255,0.75); font-size: 11px; font-weight: 300;
  letter-spacing: 2px; text-transform: uppercase; cursor: pointer;
  transition: all 0.3s; -webkit-tap-highlight-color: transparent;
  min-height: 36px;
}
.toolbar-btn.active {
  background: rgba(255,255,255,0.12); border-color: rgba(255,255,255,0.3);
  color: rgba(255,255,255,0.9);
}
@media (hover: hover) {
  .toolbar-btn:hover {
    background: rgba(255,255,255,0.12); border-color: rgba(255,255,255,0.3);
    color: rgba(255,255,255,0.9);
  }
}
.toolbar-btn:active {
  background: rgba(255,255,255,0.15); border-color: rgba(255,255,255,0.35);
}
.toolbar-label {
  font-size: 10px; font-weight: 300; color: rgba(255,255,255,0.5);
  letter-spacing: 2px; text-transform: uppercase;
}
.master-volume-wrap {
  display: flex; align-items: center; gap: 8px;
  flex: 1;
}
.master-volume-wrap input[type="range"] {
  flex: 1; width: auto;
}

/* ─── Range Slider ─── */
input[type="range"] {
  -webkit-appearance: none; appearance: none;
  width: 80px; height: 6px;
  background: rgba(255,255,255,0.15);
  border-radius: 3px; outline: none;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 22px; height: 22px; border-radius: 50%;
  background: rgba(255,255,255,0.8);
  border: 1px solid rgba(255,255,255,0.3);
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}
input[type="range"]::-moz-range-thumb {
  width: 22px; height: 22px; border-radius: 50%;
  background: rgba(255,255,255,0.8);
  border: 1px solid rgba(255,255,255,0.3);
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

/* ─── Pad Grid ─── */
.pad-grid {
  flex: 1; min-height: 0;
  overflow-y: auto; overflow-x: hidden;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  align-content: start;
  gap: 8px; padding: 12px;
  width: 100%; max-width: 440px;
  -webkit-overflow-scrolling: touch;
}

/* ─── Sound Pad ─── */
.pad {
  aspect-ratio: 1;
  background: rgba(255,255,255,0.06);
  border: 1.5px solid rgba(255,255,255,0.18);
  border-radius: 12px;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative; overflow: hidden;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.pad.empty {
  border-style: dashed;
  background: rgba(255,255,255,0.03);
}
.pad .pad-label {
  font-size: 10px; font-weight: 400; color: rgba(255,255,255,0.85);
  letter-spacing: 1px; text-transform: uppercase;
  text-align: center; padding: 0 4px;
  overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; max-width: 100%;
}
.pad .pad-add-icon {
  font-size: 24px; font-weight: 200; color: rgba(255,255,255,0.35);
}

/* Pad hover */
@media (hover: hover) {
  .pad:hover {
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.25);
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.3);
  }
}
.pad:active {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.25);
}

/* Pad playing state */
.pad.playing {
  border-color: rgba(255,255,255,0.45);
  box-shadow: 0 0 20px rgba(255,255,255,0.1);
}

/* Progress bar at bottom of pad */
.pad-progress {
  position: absolute; bottom: 0; left: 0; right: 0;
  height: 3px;
  background: rgba(255,255,255,0.1);
  border-radius: 0 0 12px 12px;
  overflow: hidden;
}
.pad-progress-fill {
  height: 100%; width: 0%;
  background: rgba(255,255,255,0.5);
  border-radius: 0 0 0 12px;
  transition: none;
}
/* Color-matched progress fills */
.pad[data-color="red"] .pad-progress-fill    { background: rgba(255,80,80,0.5); }
.pad[data-color="orange"] .pad-progress-fill { background: rgba(255,160,60,0.5); }
.pad[data-color="yellow"] .pad-progress-fill { background: rgba(255,220,60,0.5); }
.pad[data-color="green"] .pad-progress-fill  { background: rgba(80,200,120,0.5); }
.pad[data-color="blue"] .pad-progress-fill   { background: rgba(80,140,255,0.5); }
.pad[data-color="purple"] .pad-progress-fill { background: rgba(160,100,220,0.5); }
.pad[data-color="pink"] .pad-progress-fill   { background: rgba(220,100,180,0.5); }
.pad[data-color="white"] .pad-progress-fill  { background: rgba(255,255,255,0.4); }

/* Loop indicator */
.pad .loop-indicator {
  position: absolute; top: 5px; right: 6px;
  font-size: 12px; color: rgba(255,255,255,0.3);
  line-height: 1;
}
.pad.looping .loop-indicator {
  color: rgba(255,255,255,0.75);
}

/* Looping state — pad floats up and has subtle glow */
.pad.looping {
  transform: translateY(-4px);
  transition: transform 0.6s ease, box-shadow 0.6s ease;
}

/* Drag-to-rearrange */
.pad.drag-source {
  opacity: 0.3;
  transform: scale(0.95);
}
.pad.drag-over {
  border-color: rgba(255,255,255,0.5);
  transform: scale(1.05);
}
.pad-ghost {
  position: fixed;
  z-index: 100;
  pointer-events: none;
  opacity: 0.85;
  transform: scale(1.08);
  box-shadow: 0 12px 40px rgba(0,0,0,0.5);
  transition: none;
}
.pad.drag-ready {
  animation: pad-lift 0.2s ease forwards;
}
@keyframes pad-lift {
  0% { transform: scale(1); }
  100% { transform: scale(1.06); box-shadow: 0 8px 30px rgba(0,0,0,0.4); }
}

/* Pad color accents — full border + subtle bg tint */
.pad[data-color="red"]    { border-color: rgba(255,80,80,0.45);   background: rgba(255,80,80,0.06); }
.pad[data-color="orange"] { border-color: rgba(255,160,60,0.45);  background: rgba(255,160,60,0.06); }
.pad[data-color="yellow"] { border-color: rgba(255,220,60,0.4);   background: rgba(255,220,60,0.05); }
.pad[data-color="green"]  { border-color: rgba(80,200,120,0.45);  background: rgba(80,200,120,0.06); }
.pad[data-color="blue"]   { border-color: rgba(80,140,255,0.45);  background: rgba(80,140,255,0.06); }
.pad[data-color="purple"] { border-color: rgba(160,100,220,0.45); background: rgba(160,100,220,0.06); }
.pad[data-color="pink"]   { border-color: rgba(220,100,180,0.45); background: rgba(220,100,180,0.06); }
.pad[data-color="white"]  { border-color: rgba(255,255,255,0.35); background: rgba(255,255,255,0.05); }

/* Playing + color accent glow */
.pad.playing[data-color="red"]    { box-shadow: 0 0 20px rgba(255,80,80,0.15); }
.pad.playing[data-color="orange"] { box-shadow: 0 0 20px rgba(255,160,60,0.15); }
.pad.playing[data-color="yellow"] { box-shadow: 0 0 20px rgba(255,220,60,0.15); }
.pad.playing[data-color="green"]  { box-shadow: 0 0 20px rgba(80,200,120,0.15); }
.pad.playing[data-color="blue"]   { box-shadow: 0 0 20px rgba(80,140,255,0.15); }
.pad.playing[data-color="purple"] { box-shadow: 0 0 20px rgba(160,100,220,0.15); }
.pad.playing[data-color="pink"]   { box-shadow: 0 0 20px rgba(220,100,180,0.15); }
.pad.playing[data-color="white"]  { box-shadow: 0 0 20px rgba(255,255,255,0.12); }

/* Looping + color glow (intensified) */
.pad.looping[data-color="red"]    { box-shadow: 0 0 28px rgba(255,80,80,0.25); }
.pad.looping[data-color="orange"] { box-shadow: 0 0 28px rgba(255,160,60,0.25); }
.pad.looping[data-color="yellow"] { box-shadow: 0 0 28px rgba(255,220,60,0.25); }
.pad.looping[data-color="green"]  { box-shadow: 0 0 28px rgba(80,200,120,0.25); }
.pad.looping[data-color="blue"]   { box-shadow: 0 0 28px rgba(80,140,255,0.25); }
.pad.looping[data-color="purple"] { box-shadow: 0 0 28px rgba(160,100,220,0.25); }
.pad.looping[data-color="pink"]   { box-shadow: 0 0 28px rgba(220,100,180,0.25); }
.pad.looping[data-color="white"]  { box-shadow: 0 0 28px rgba(255,255,255,0.2); }
.pad.looping:not([data-color])    { box-shadow: 0 0 24px rgba(255,255,255,0.12); }

/* ─── Footer ─── */
.main-footer {
  display: flex; justify-content: center; gap: 10px;
  padding: 20px 16px; flex-shrink: 0;
}
.footer-btn {
  background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.15);
  border-radius: 10px; padding: 14px 20px;
  color: rgba(255,255,255,0.65); font-size: 12px; font-weight: 300;
  letter-spacing: 2px; text-transform: uppercase; cursor: pointer;
  transition: all 0.3s; -webkit-tap-highlight-color: transparent;
  min-height: 44px;
}
@media (hover: hover) {
  .footer-btn:hover {
    background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.25);
    color: rgba(255,255,255,0.9);
  }
}
.footer-btn:active {
  background: rgba(255,255,255,0.12); border-color: rgba(255,255,255,0.3);
}

/* ─── Modal Overlays (shared) ─── */
#pad-modal, #profile-modal, #name-modal, #settings-modal, #source-modal, #record-modal, #help-overlay {
  position: fixed; inset: 0; z-index: 40;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(ellipse at center, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.95) 100%);
  pointer-events: auto;
}
#pad-modal.hidden, #profile-modal.hidden, #name-modal.hidden,
#settings-modal.hidden, #source-modal.hidden, #record-modal.hidden,
#help-overlay.hidden { opacity: 0; pointer-events: none; }

.modal-content {
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  width: 280px;
}
.modal-title {
  font-size: 16px; font-weight: 300; color: rgba(255,255,255,0.9);
  letter-spacing: 3px; text-transform: uppercase; margin-bottom: 8px;
  text-align: center;
}
.modal-btn {
  width: 100%;
  background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.2);
  border-radius: 10px; padding: 14px 20px;
  color: rgba(255,255,255,0.8); font-size: 14px; font-weight: 300;
  letter-spacing: 2px; text-transform: uppercase; cursor: pointer;
  transition: all 0.3s; -webkit-tap-highlight-color: transparent;
  min-height: 44px;
}
@media (hover: hover) {
  .modal-btn:hover {
    background: rgba(255,255,255,0.12); border-color: rgba(255,255,255,0.3);
    color: rgba(255,255,255,0.95);
  }
}
.modal-btn:active {
  background: rgba(255,255,255,0.15); border-color: rgba(255,255,255,0.35);
}
.modal-cancel {
  background: none; border-color: rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.45); font-size: 12px; margin-top: 4px;
}

/* ─── Pad Settings ─── */
.pad-settings {
  width: 320px; max-height: 82vh; overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 20px 16px;
}
.pad-setting-row {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; padding: 8px 0;
}
.pad-setting-label {
  font-size: 12px; font-weight: 300; color: rgba(255,255,255,0.65);
  letter-spacing: 1px; text-transform: uppercase;
  min-width: 60px;
}
.pad-setting-value {
  font-size: 12px; font-weight: 300; color: rgba(255,255,255,0.65);
  min-width: 36px; text-align: right;
}
.pad-text-input {
  background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.2);
  border-radius: 8px; padding: 10px 14px;
  color: rgba(255,255,255,0.9); font-size: 13px; font-weight: 300;
  letter-spacing: 1px; outline: none; width: 100%;
  transition: border-color 0.3s;
  flex: 1; margin-left: 12px;
}
.pad-text-input:focus { border-color: rgba(255,255,255,0.35); }
.pad-text-input::placeholder { color: rgba(255,255,255,0.3); }

/* ─── Toggle Button ─── */
.toggle-btn {
  background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.2);
  border-radius: 8px; padding: 8px 18px;
  color: rgba(255,255,255,0.65); font-size: 12px; font-weight: 300;
  letter-spacing: 2px; text-transform: uppercase; cursor: pointer;
  transition: all 0.3s; min-width: 60px;
  -webkit-tap-highlight-color: transparent;
}
.toggle-btn.active {
  background: rgba(255,255,255,0.12); border-color: rgba(255,255,255,0.3);
  color: rgba(255,255,255,0.9);
}

/* ─── Filter Toggles ─── */
.filter-toggles {
  display: flex; gap: 6px;
}
.filter-btn {
  background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.15);
  border-radius: 6px; padding: 6px 12px;
  color: rgba(255,255,255,0.5); font-size: 11px; font-weight: 300;
  letter-spacing: 1px; text-transform: uppercase; cursor: pointer;
  transition: all 0.3s; -webkit-tap-highlight-color: transparent;
}
.filter-btn.active {
  background: rgba(255,255,255,0.12); border-color: rgba(255,255,255,0.3);
  color: rgba(255,255,255,0.9);
}
.pad-setting-row.hidden { display: none; }

/* ─── Collapsible Section ─── */
.collapsible-header {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; padding: 12px 16px;
  cursor: pointer; -webkit-tap-highlight-color: transparent;
  font-size: 12px; font-weight: 300; color: rgba(255,255,255,0.7);
  letter-spacing: 2px; text-transform: uppercase;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 10px;
  margin-top: 8px;
  transition: all 0.3s;
  min-height: 44px;
}
.collapsible-header:active {
  background: rgba(255,255,255,0.12);
  border-color: rgba(255,255,255,0.25);
}
@media (hover: hover) {
  .collapsible-header:hover {
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.25);
    color: rgba(255,255,255,0.9);
  }
}
.collapsible-header.open {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.25);
  color: rgba(255,255,255,0.9);
  border-radius: 10px 10px 0 0;
  margin-bottom: 0;
}
.collapsible-arrow {
  font-size: 12px; transition: transform 0.3s;
}
.collapsible-header.open .collapsible-arrow {
  transform: rotate(180deg);
}
.collapsible-header.hint-pulse {
  animation: hint-pulse 1.5s ease-in-out 2;
}
@keyframes hint-pulse {
  0%, 100% { border-color: rgba(255,255,255,0.15); }
  50% { border-color: rgba(255,255,255,0.45); background: rgba(255,255,255,0.1); }
}
.collapsible-body {
  width: 100%;
}
.collapsible-body.collapsed {
  display: none;
}

/* ─── Color Palette ─── */
.color-palette {
  display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end;
}
.color-swatch {
  width: 24px; height: 24px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.18);
  cursor: pointer; transition: all 0.3s;
  -webkit-tap-highlight-color: transparent;
}
.color-swatch.selected {
  border-color: rgba(255,255,255,0.7);
  transform: scale(1.2);
}
.color-swatch:first-child {
  background: none;
  border-style: dashed;
  position: relative;
}

/* ─── Profile Manager ─── */
.profile-manager { width: 320px; }
.profile-list {
  width: 100%; max-height: 300px; overflow-y: auto;
  display: flex; flex-direction: column; gap: 8px;
  -webkit-overflow-scrolling: touch;
}
.profile-item {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 12px; padding: 12px 16px;
  display: flex; align-items: center; justify-content: space-between;
  cursor: pointer; transition: all 0.3s;
  -webkit-tap-highlight-color: transparent;
}
@media (hover: hover) {
  .profile-item:hover {
    background: rgba(255,255,255,0.08);
    border-color: rgba(255,255,255,0.2);
  }
}
.profile-item.active {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.25);
}
.profile-item-left {
  display: flex; flex-direction: column; gap: 2px;
  overflow: hidden;
}
.profile-item-name {
  font-size: 14px; font-weight: 400; color: rgba(255,255,255,0.9);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.profile-item-info {
  font-size: 10px; font-weight: 300; color: rgba(255,255,255,0.45);
  letter-spacing: 1px; text-transform: uppercase;
}
.profile-item-actions {
  display: flex; gap: 10px; flex-shrink: 0;
}
.profile-item-action {
  background: none; border: none;
  color: rgba(255,255,255,0.45); font-size: 10px; font-weight: 300;
  cursor: pointer; transition: color 0.3s;
  letter-spacing: 1px; text-transform: uppercase;
  -webkit-tap-highlight-color: transparent;
  padding: 4px;
}
.profile-item-action:hover { color: rgba(255,255,255,0.7); }
.profile-item-action.delete:hover { color: rgba(255,80,80,0.8); }

/* ─── About Page ─── */
#about {
  position: fixed; inset: 0; z-index: 35;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(ellipse at center, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.95) 100%);
  pointer-events: auto;
}
#about.hidden { opacity: 0; pointer-events: none; }
.about-content {
  max-width: 440px; width: 88%; text-align: center;
}
.about-content h2 {
  font-size: 30px; font-weight: 200; letter-spacing: 6px;
  color: rgba(255,255,255,0.9); text-transform: uppercase;
  margin-bottom: 4px;
}
.about-tagline {
  font-size: 12px; font-weight: 300; color: rgba(255,255,255,0.5);
  letter-spacing: 3px; text-transform: uppercase; margin-bottom: 32px;
}
.about-body { margin-bottom: 32px; }
.about-body p {
  font-size: 13px; font-weight: 300; color: rgba(255,255,255,0.7);
  line-height: 1.7; margin-bottom: 12px;
}
.about-body strong { font-weight: 500; color: rgba(255,255,255,0.9); }

#bmc-link {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(255,221,0,0.12); border: 1px solid rgba(255,221,0,0.3);
  border-radius: 10px; padding: 12px 28px;
  color: rgba(255,221,0,0.9); font-size: 14px; font-weight: 400;
  letter-spacing: 1px; text-decoration: none;
  transition: all 0.3s;
}
#bmc-link:hover {
  background: rgba(255,221,0,0.22); border-color: rgba(255,221,0,0.5);
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(255,221,0,0.1);
}
.bmc-icon { font-size: 18px; }
.help-bmc {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(255,221,0,0.08); border: 1px solid rgba(255,221,0,0.2);
  border-radius: 10px; padding: 10px 22px; margin-top: 8px;
  color: rgba(255,221,0,0.7); font-size: 12px; font-weight: 400;
  letter-spacing: 1px; text-decoration: none;
  transition: all 0.3s;
}
.help-bmc:hover {
  background: rgba(255,221,0,0.16); border-color: rgba(255,221,0,0.4);
}

#about-back { margin-top: 24px; }
.about-version {
  margin-top: 16px; font-size: 10px; font-weight: 300;
  color: rgba(255,255,255,0.25); letter-spacing: 2px;
}
.about-stats {
  margin-top: 16px; font-size: 11px; font-weight: 300;
  color: rgba(255,255,255,0.4); letter-spacing: 1px;
}

/* ─── Mobile Responsive ─── */
@media (max-width: 600px) {
  .main-header h1 { font-size: 20px; letter-spacing: 5px; }
  .subtitle { font-size: 9px; letter-spacing: 2px; }
  .main-toolbar { gap: 8px; padding: 6px 12px; }
  .toolbar-btn { padding: 6px 10px; font-size: 10px; }
  .pad-grid { gap: 6px; padding: 8px; }
  .pad .pad-label { font-size: 8px; }
  .pad .pad-add-icon { font-size: 20px; }
  .main-footer { gap: 8px; padding: 16px 10px; }
  .footer-btn { font-size: 11px; letter-spacing: 1px; padding: 12px 14px; }

  .modal-content { width: 260px; }
  .pad-settings { width: 280px; max-height: 78vh; }
  .profile-manager { width: 280px; }
  .modal-btn { padding: 12px 16px; font-size: 13px; }
  .modal-title { font-size: 14px; letter-spacing: 2px; }

  .about-content h2 { font-size: 24px; letter-spacing: 4px; }
  .about-tagline { font-size: 11px; margin-bottom: 24px; }
  .about-body p { font-size: 12px; }
  #bmc-link { padding: 10px 22px; font-size: 13px; }

  input[type="range"] { width: 60px; }
}

/* ─── Prevent selection & callouts ─── */
#main, #pad-modal, #profile-modal, #name-modal, #settings-modal, #source-modal, #record-modal, #help-overlay, #about {
  -webkit-touch-callout: none;
  -webkit-user-select: none; user-select: none;
}

/* ─── Record Sound ─── */
.record-content { align-items: center; }
.record-timer {
  font-size: 36px; font-weight: 200; color: rgba(255,255,255,0.8);
  letter-spacing: 4px; font-variant-numeric: tabular-nums;
  margin: 8px 0;
}
.record-btn {
  width: 72px; height: 72px; border-radius: 50%;
  background: rgba(255,60,60,0.7); border: 3px solid rgba(255,80,80,0.5);
  cursor: pointer; transition: all 0.3s;
  -webkit-tap-highlight-color: transparent;
  position: relative; margin: 8px 0;
}
.record-btn::after {
  content: ''; position: absolute;
  top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 28px; height: 28px; border-radius: 50%;
  background: rgba(255,255,255,0.9);
  transition: all 0.2s;
}
.record-btn.recording {
  background: rgba(255,60,60,0.9); border-color: rgba(255,80,80,0.8);
  animation: record-pulse 1.2s ease-in-out infinite;
}
.record-btn.recording::after {
  width: 22px; height: 22px; border-radius: 4px;
}
@keyframes record-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255,60,60,0.4); }
  50% { box-shadow: 0 0 0 14px rgba(255,60,60,0); }
}
.record-hint {
  font-size: 11px; font-weight: 300; color: rgba(255,255,255,0.45);
  letter-spacing: 2px; text-transform: uppercase;
  margin-bottom: 4px;
}
.record-option { width: 100%; max-width: 240px; padding: 4px 0; }

/* ─── Review / Trim Phase ─── */
.review-phase {
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  width: 100%;
}
.review-phase.hidden, #record-phase.hidden { display: none; }
#record-phase {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  width: 100%;
}
.waveform-wrap {
  position: relative; width: 100%; height: 88px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 8px; overflow: hidden;
  touch-action: none;
}
#waveform-canvas {
  display: block; width: 100%; height: 100%;
}
.waveform-overlay {
  position: absolute; top: 0; height: 100%;
  background: rgba(0,0,0,0.55);
  pointer-events: none; z-index: 1;
  transition: width 0.05s, left 0.05s;
}
.waveform-ol { left: 0; }
.waveform-or { right: 0; }
.waveform-handle {
  position: absolute; top: 0; z-index: 3;
  width: 3px; height: 100%;
  background: rgba(255,255,255,0.9);
  cursor: ew-resize;
}
.waveform-handle::before {
  content: ''; position: absolute;
  top: 0; left: -14px;
  width: 32px; height: 100%;
}
.waveform-handle::after {
  content: ''; position: absolute;
  top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 11px; height: 11px; border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 6px rgba(0,0,0,0.5);
}
.waveform-playhead {
  position: absolute; top: 0; z-index: 2;
  width: 2px; height: 100%;
  background: rgba(255,180,60,0.9);
  pointer-events: none;
  transition: none;
}
.waveform-playhead.hidden { display: none; }

/* ─── Pad Trim Waveform ─── */
.pad-trim-section { width: 100%; padding: 4px 0; }
.pad-trim-section.hidden { display: none; }
.pad-trim-label {
  font-size: 11px; font-weight: 300; color: rgba(255,255,255,0.5);
  letter-spacing: 2px; text-transform: uppercase; margin-bottom: 6px;
}
#pad-waveform-wrap { height: 72px; }
.trim-times {
  display: flex; justify-content: space-between; width: 100%;
  padding: 0 2px;
}
.trim-time {
  font-size: 10px; font-weight: 300; color: rgba(255,255,255,0.5);
  letter-spacing: 1px; font-variant-numeric: tabular-nums;
}
.trim-time-dur { color: rgba(255,255,255,0.7); }

/* ─── Help Overlay ─── */
.help-content {
  max-width: 320px; width: 88%;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
}
.help-list {
  width: 100%; max-height: 60vh; overflow-y: auto;
  display: flex; flex-direction: column; gap: 6px;
  -webkit-overflow-scrolling: touch;
}
.help-section {
  font-size: 10px; font-weight: 300; color: rgba(255,255,255,0.45);
  letter-spacing: 2px; text-transform: uppercase;
  padding: 6px 0 0;
}
.help-section:first-child { padding-top: 0; }
.help-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 12px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px;
}
.help-gesture {
  font-size: 12px; font-weight: 400; color: rgba(255,255,255,0.85);
  letter-spacing: 1px;
}
.help-desc {
  font-size: 12px; font-weight: 300; color: rgba(255,255,255,0.55);
  letter-spacing: 1px; text-align: right;
}
