/* StageFlow mobile layout overlay — loaded AFTER stageflow.css.
   Scoped exclusively to viewports < 690 px. Desktop and Stage View Classic untouched.
   Reversible: remove the <link> to disable.

   Simple mode priority: single-row header so setlist starts higher.
   Overflow is a real accessible button (#mobileOverflowToggle). */

@media (max-width: 690px) {
  header.sfHeader {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    height: 56px !important;
    min-height: 56px !important;
    max-height: 56px !important;
    padding: 6px 10px !important;
    gap: 8px !important;
    overflow: visible !important;
  }

  header.sfHeader .sfIdentity {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    overflow: hidden !important;
  }

  header.sfHeader .sfIdentity .brand h1 {
    font-size: 18px !important;
    margin: 0 !important;
    white-space: nowrap !important;
  }

  header.sfHeader .sfIdentity .brand small,
  header.sfHeader .sfSeparator,
  header.sfHeader .sfHub span,
  header.sfHeader #sfSyncLoginCaption {
    display: none !important;
  }

  header.sfHeader .row {
    position: relative !important;
    flex: 0 0 auto !important;
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    margin: 0 !important;
  }

  /* Hide secondary controls by default */
  header.sfHeader .row > *:not(#headerSetPlay):not(#mobileOverflowToggle):not(#mobileOverflowMenu) {
    display: none !important;
  }

  /* Stage button: keep hidden outside setlist view. */
  header.sfHeader #headerSetPlay.hide{display:none!important}
  /* Stage button */
  header.sfHeader #headerSetPlay:not(.hide) {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 48px !important;
    min-height: 44px !important;
    padding: 8px 14px !important;
    font-size: 18px !important;
    border-radius: 10px !important;
  }

  /* Real overflow toggle button */
  header.sfHeader #mobileOverflowToggle {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 44px !important;
    height: 44px !important;
    border: 1px solid #405166 !important;
    border-radius: 10px !important;
    background: #273241 !important;
    color: #eef5fa !important;
    font-size: 22px !important;
    cursor: pointer !important;
    flex-shrink: 0 !important;
  }

  /* Overflow menu (populated by moving controls or shown via JS later) */
  header.sfHeader #mobileOverflowMenu {
    position: absolute !important;
    right: 0 !important;
    top: 100% !important;
    margin-top: 4px !important;
    background: #131b26 !important;
    border: 1px solid #405166 !important;
    border-radius: 12px !important;
    padding: 8px !important;
    z-index: 200 !important;
    display: none !important;
    flex-direction: column !important;
    gap: 6px !important;
    min-width: 200px !important;
    max-width: 280px !important;
    box-shadow: 0 8px 24px #0009 !important;
  }

  header.sfHeader #mobileOverflowToggle[aria-expanded="true"] + #mobileOverflowMenu,
  header.sfHeader #mobileOverflowMenu:not([hidden]) {
    display: flex !important;
  }

  header.sfHeader button:focus-visible,
  header.sfHeader select:focus-visible {
    outline: 2px solid #10e9f2 !important;
    outline-offset: 2px !important;
  }
}

/* Hide the overflow button on desktop */
@media (min-width: 691px) {
  #mobileOverflowToggle,
  #mobileOverflowMenu {
    display: none !important;
  }
}
