/* Keep the center label independent of the side actions. */
.launch-ribbon {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 0 24px;
  background: #29423e;
  border-bottom: 1px solid #8cf4de;
  color: #ecfff8;
  font: 14px/1.3 system-ui;
}
.launch-ribbon [hidden] { display: none !important; }
.launch-ribbon a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  color: inherit;
  text-underline-offset: 4px;
  white-space: nowrap;
}
.launch-home { grid-column: 1; justify-self: start; }
#launch-state { grid-column: 2; text-align: center; font-weight: 750; }
.launch-ribbon-actions {
  grid-column: 3;
  display: flex;
  justify-content: flex-end;
  min-width: 0;
}
.launch-ribbon form { margin: 0; }
.launch-ribbon .ribbon-unlock {
  min-height: 36px;
  padding: 6px 12px;
  border: 1px solid #7ebaa7;
  background: transparent;
  color: inherit;
  font-size: 14px;
  white-space: nowrap;
}
.focus .launch-ribbon {
  position: fixed;
  z-index: 15;
  inset: auto 0 0;
  border-top: 1px solid #688f82;
  border-bottom: 0;
  background: #183934ed;
}

/* Break out only the music viewport; controls keep their existing gutters. */
body #viewport,
body.focus #viewport,
body.performance.performance-stage-ready #viewport {
  width: var(--launch-page-width, 100%);
  margin-inline: calc((100% - var(--launch-page-width, 100%)) / 2);
  border-left: 0;
  border-right: 0;
  border-radius: 0;
}
#playhead,
body[data-theme=dark] #playhead { box-shadow: none; }
body:not(.focus) > header .header-menus { max-width: none; }

/* The transport starts directly beneath, and at the same inset as, the title. */
body:not(.focus) .intro {
  flex-direction: column;
  align-items: stretch;
  gap: 16px;
}
body:not(.focus) .song-playback {
  margin-left: 0;
  width: 100%;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 10px;
}
.position > div:first-child {
  display: flex;
  align-items: baseline;
  flex-wrap: nowrap;
  justify-content: space-between;
  gap: 16px;
}
.position #location { min-width: 0; }
.position #time {
  flex: none;
  margin-left: auto;
  white-space: nowrap;
}
.transport .size-controls .zoom output { display: none !important; }
.transport .size-controls .zoom,
.transport .size-controls .zoom .size-slider {
  user-select: none;
  -webkit-user-select: none;
}
.transport .size-controls .zoom input[type=range] {
  --launch-range-thumb: 28px;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.transport .size-controls .zoom input[type=range]::-webkit-slider-thumb {
  width: var(--launch-range-thumb);
  height: 44px;
  margin-top: 7px;
  border-radius: 7px;
}
.transport .size-controls .zoom input[type=range]::-moz-range-thumb {
  width: var(--launch-range-thumb);
  height: 44px;
  border-radius: 7px;
}
body.launch-range-dragging {
  user-select: none;
  -webkit-user-select: none;
  cursor: ew-resize;
}
.launch-opening-rest > use { visibility: hidden; }
.launch-opening-rest > .halo { opacity: 0; pointer-events: all; }

/* Scope the embedded shell to the page header, leaving Library headers intact. */
body.embedded-player:not(.focus) > header > .brand { display: none; }
body.embedded-player:not(.focus) > header {
  max-width: 1160px;
  margin-inline: auto;
  min-height: 0;
  padding: 24px;
}
body.embedded-player:not(.focus) > main {
  max-width: 1160px;
  margin-inline: auto;
  padding: 28px 24px 32px;
}
body.embedded-player:not(.focus) > header .header-menus {
  width: 100%;
  margin-left: 0;
}
.embedded-player .controls-row { gap: 22px 18px; }
.embedded-player:not(.focus) .controls-row button { min-height: 54px; }
.embedded-player:not(.focus) .select-trigger { min-height: 60px; }
.embedded-player:not(.focus) .control-label { font-size: 20px; }
.embedded-player .options { row-gap: 18px; padding-top: 26px; padding-bottom: 26px; }

.music-browser .mb-header { width: 100%; max-width: none; margin: 0; flex-wrap: nowrap; }
.music-browser .mb-heading { min-width: 0; }
.music-browser .mb-track-status {
  font-size: 12px;
  font-weight: 650;
  padding: 4px 6px;
  border: 0;
  background: transparent;
}
.music-browser .mb-quick-practice,
.music-browser .mb-selected .mb-quick-practice {
  align-self: center;
  min-width: 80px;
  min-height: 44px;
  font-size: 13px;
  margin-right: 10px;
  border-color: #6b9296;
  background: #244550;
  color: #e9fff6;
}

@media (min-width: 821px) {
  .music-browser .mb-sidebar { padding-inline: 0; }
  .music-browser .mb-sidebar-title { margin-inline: 0; padding-inline: var(--mb-inset); }
  .music-browser .mb-group {
    width: 100%;
    margin: 0;
    padding-inline: var(--mb-inset);
    border: 0;
    border-radius: 0;
  }
}

@media (max-width: 680px) {
  body.embedded-player:not(.focus) > main { padding: 26px 18px 36px; }
  body.embedded-player:not(.focus) > header { padding: 22px 18px; }
  .launch-ribbon { padding-inline: 16px; gap: 8px; font-size: 13px; }
  .launch-ribbon .ribbon-unlock { padding-inline: 9px; font-size: 13px; }
  .music-browser .mb-track-status { font-size: 11px; padding: 4px 6px; }
  .music-browser .mb-quick-practice,
  .music-browser .mb-selected .mb-quick-practice { min-width: 75px; font-size: 12px; margin-right: 7px; }
}

/* Keep narrow library titles readable; give the separate quick action its own row. */
@media (max-width: 540px) {
  .music-browser .mb-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; }
  .music-browser .mb-track { grid-column: 1 / -1; display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 10px; padding: 14px; }
  .music-browser .mb-track .mb-cover { grid-column: 1; grid-row: 1 / 3; align-self: start; }
  .music-browser .mb-track-copy { grid-column: 2; }
  .music-browser .mb-track-title { font-size: 17px; }
  .music-browser .mb-track-subtitle { font-size: 13px; }
  .music-browser .mb-track-status { grid-column: 2; justify-self: start; padding: 0; font-size: 12px; }
  .music-browser .mb-quick-practice,
  .music-browser .mb-selected .mb-quick-practice { grid-column: 2; margin: 0 12px 12px 0; min-width: 90px; font-size: 13px; }
}
