@media (max-width: 950px) {
  .deck-main {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .deck-arrangement {
    grid-column: 1 / -1;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 6px;
    border: 0;
    padding: 0;
  }

  .automation-layout {
    grid-template-columns: minmax(210px, 1fr) minmax(0, 2fr);
  }

  .automation-options {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 700px) {
  body.beat-maker[data-dashboard-theme] {
    --track-width: 148px;
    --step-min: 35px;
    --step-height: 43px;
  }

  .studio-header {
    grid-template-columns: minmax(0, 1fr) auto;
    column-gap: 6px;
  }

  .project-status {
    grid-area: 2 / 1 / 3 / -1;
    min-height: 13px;
    text-align: left;
    font-size: 11px;
  }

  .deck-info {
    align-items: flex-start;
    flex-direction: column;
  }

  .deck-info > strong {
    max-width: 100%;
  }

  .deck-pattern > span,
  .action-extra,
  .keyboard-hint {
    display: none;
  }

  .deck-transport,
  .deck-timing,
  .deck-bpm {
    gap: 4px;
  }

  .deck-timing {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .scroll-hint {
    display: inline;
  }

  .preset-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .memory-grid,
  .project-controls > .io-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .groove-controls {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .automation-layout {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 540px) {
  .studio-tabs {
    gap: 1px;
  }

  body.beat-maker .studio-tabs [role="tab"] {
    flex: 1 1 auto;
    padding-inline: 3px;
    font-size: 11px;
  }

  .studio-tabs i,
  .tab-extra {
    display: none;
  }

  .deck-main {
    column-gap: 6px;
    padding-inline: 6px;
  }

  .deck-info > strong {
    font-size: 12px;
  }

  body.beat-maker .deck-play {
    width: 34px;
    min-height: 34px;
  }

  body.beat-maker .deck-stop {
    width: 30px;
    min-height: 30px;
  }

  body.beat-maker .deck-ab button,
  body.beat-maker .deck-bpm button {
    min-width: 23px;
    min-height: 27px;
  }

  body.beat-maker #tapTempoBtn {
    padding-inline: 4px;
    font-size: 11px;
  }

  .deck-bpm b {
    font-size: 15px;
  }

  .deck-bpm small {
    font-size: 8px;
  }

  .deck-arrangement-meta {
    gap: 2px;
  }

  body.beat-maker .deck-arrangement-meta .control-btn {
    min-height: 26px;
    padding-inline: 5px;
    font-size: 10px;
  }

  body.beat-maker :where(.deck-section, .deck-bar) {
    padding-inline: 3px;
    font-size: 9px;
  }

  .sequencer-header,
  .sequencer-footer {
    padding: 5px 7px;
  }

  .sequencer-title h2 {
    font-size: 13px;
  }

  .seq-actions {
    gap: 4px;
  }

  body.beat-maker .seq-actions .control-btn {
    min-height: 32px;
    gap: 4px;
    padding-inline: 5px;
    font-size: 11px;
  }

  .panel-scroll {
    padding: 8px;
  }

  .panel-head {
    padding: 6px 8px;
  }

  .preset-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.beat-maker .preset-card {
    min-height: 49px;
    padding: 6px 8px;
  }

  .preset-tools {
    flex: 1 1 auto;
    justify-content: flex-end;
  }

  body.beat-maker #presetSearch {
    width: clamp(125px, 35vw, 190px);
  }
}

@media (max-width: 360px) {
  .studio-title,
  .export-tools {
    gap: 5px;
  }

  body.beat-maker .studio-mark {
    width: 23px;
    height: 23px;
  }

  body.beat-maker .export-btn {
    padding-inline: 6px;
  }

  .deck-arrangement .beat-pulse {
    display: none;
  }

  .scroll-hint {
    font-size: 9px;
  }
}

@media (pointer: coarse) {
  body.beat-maker[data-dashboard-theme] {
    --step-min: 38px;
  }

  body.beat-maker .studio-tabs [role="tab"],
  body.beat-maker .deck-ab button,
  body.beat-maker .deck-bpm button {
    min-height: 32px;
  }

  body.beat-maker .lane-tools .tiny-btn {
    min-height: 24px;
  }
}
