/* Small iPhone adjustments. Keep the tab and tools in their own normal areas. */
@media (max-width: 700px) {
  .topbar,
  .transport,
  .editor-toolbar,
  .sidebar {
    position: static;
    top: auto;
  }

  .topbar {
    height: 54px;
    padding: 0 12px;
  }

  .brand {
    font-size: 20px;
  }

  .header-actions .primary {
    padding: 8px 10px;
    font-size: 12px;
  }

  .transport {
    flex-wrap: nowrap;
    gap: 10px;
    min-height: 50px;
    margin-bottom: 2px;
    padding: 5px 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .transport-left,
  .transport-right {
    flex: 0 0 auto;
    gap: 8px;
  }

  .transport-left .icon-button {
    width: 36px;
    min-width: 36px;
    padding: 6px;
  }

  .play {
    min-width: 72px;
    padding: 8px 10px;
  }

  .tempo input {
    width: 46px;
    font-size: 16px;
  }

  .transport-right .switch-label svg,
  .transport-right .switch-label span,
  .transport-right .transport-divider,
  .transport-right > svg,
  .transport-right .volume {
    display: none;
  }

  .paper {
    min-height: 0;
    overflow: auto !important;
    -webkit-overflow-scrolling: touch;
  }

  .song-heading {
    padding: 16px 20px 14px;
  }

  .song-title {
    margin: 4px 0 2px;
    font-size: 24px;
  }

  .paper-meta {
    gap: 9px;
    margin-top: 10px;
    font-size: 11px;
  }

  .paper-meta span + span:before {
    margin-right: 9px;
  }

  .sidebar,
  .side-section,
  .side-section.shortcuts {
    display: block !important;
    width: 100%;
  }

  .side-section:first-child {
    border-right: 0;
  }

  .editor-toolbar {
    display: flex;
    flex-wrap: nowrap;
    justify-content: flex-start;
    align-items: center;
    height: 48px;
    min-height: 48px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0 10px;
    -webkit-overflow-scrolling: touch;
  }

  .editor-toolbar > div {
    display: flex;
    flex: 0 0 auto;
    flex-wrap: nowrap;
    align-items: center;
    height: 48px;
    min-width: max-content;
  }

  .editor-toolbar button {
    min-width: 40px;
    min-height: 40px;
    padding: 7px 9px;
  }

  /* Lift the tab 8px so the low E string stays comfortably above Tools. */
  .tab-editor {
    padding: 6px 16px 8px;
  }

  .string-row,
  .note-cell {
    height: 30px;
    min-height: 30px;
  }

  .measure-head {
    margin-bottom: 6px;
  }

  .measure-head button,
  .pad-actions button,
  .tool-buttons button,
  .file-actions button,
  .repeat-button,
  .add-measure,
  .fret-pad button {
    min-height: 44px;
  }

  .song-notes {
    width: calc(100% - 40px);
    height: 34px;
    min-height: 34px;
    margin: 0 20px 14px;
    padding: 8px 0 0;
  }

  .song-notes::placeholder {
    color: transparent;
  }

  .tool-section-trigger {
    min-height: 48px;
  }

  .file-dialog {
    width: calc(100vw - 24px) !important;
    max-height: 82vh;
    overflow-y: auto;
  }

  input,
  select,
  textarea {
    font-size: 16px !important;
  }

  .tabalina-mobile-actions {
    display: none !important;
  }
}

@media (max-width: 700px) {
  /* Keep New available without crowding the iPhone header. */
  .header-actions .new-tab {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 34px;
    min-width: 34px;
    height: 34px;
    min-height: 34px;
    padding: 0;
    border: 1px solid #dce2df;
    border-radius: 7px;
  }

  .header-actions .new-tab span {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }
}
