/*
 * Transport bar (redesign 2026-11).
 *
 * From 1100 px the whole bar is one row: editing on the left, the transport
 * centred, grid and view options on the right. Every control keeps its id
 * and handler; this file only places and sizes them. Fixed widths and
 * nowrap keep the position display from jumping lines (the "BAR" bug).
 * Popovers (metronome setup, View) are shared with phones and tablets.
 */

.tp-caret svg,
.tp-view-menu > summary svg {
  width: 0.7rem;
  height: 0.7rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Metronome setup popover */

body .transport-strip .tp-popover {
  grid-template-columns: minmax(0, 1fr) !important;
  grid-auto-flow: row !important;
}

.tp-popover {
  position: absolute;
  z-index: 80;
  top: calc(100% + 0.45rem);
  left: 50%;
  display: grid;
  gap: 0.75rem;
  box-sizing: border-box;
  width: 17.5rem;
  padding: 0.85rem;
  border: 1px solid #504b40;
  border-radius: 0.75rem;
  background: #1b1a16;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.55);
  color: #f4efe4;
  text-align: left;
  transform: translateX(-50%);
}

.tp-popover[hidden] {
  display: none !important;
}

.tp-popover-title {
  font-size: 0.82rem;
  font-weight: 700;
}

.metro-popover .metro-volume-control {
  display: block !important;
  position: static !important;
}

.metro-popover #metroVolumePanel,
.metro-popover #metroVolumePanel[hidden] {
  position: static !important;
  display: grid !important;
  gap: 0.45rem !important;
  width: auto !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: none !important;
  box-shadow: none !important;
  transform: none !important;
}

.metro-popover .metro-volume-head {
  display: flex !important;
  justify-content: space-between !important;
  align-items: baseline !important;
  font-size: 0.75rem !important;
  color: #c9c2b3 !important;
}

.metro-popover .metro-volume-head strong {
  font-weight: 600 !important;
}

.metro-popover #metroVolumeValue {
  color: #f4efe4 !important;
  font-family: "JetBrains Mono", "SF Mono", ui-monospace, monospace !important;
  font-variant-numeric: tabular-nums;
}

.metro-popover #metroVolumeInput {
  width: 100% !important;
  accent-color: #d4a855;
}

body .transport-strip .metro-popover .metro-settings {
  grid-template-columns: minmax(0, 1fr) !important;
}

.metro-popover .metro-settings {
  position: static !important;
  display: grid !important;
  gap: 0.6rem !important;
  width: auto !important;
}

.metro-popover .metro-settings > label {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 0.6rem !important;
  margin: 0 !important;
}

.metro-popover .metro-settings > label > span:first-child {
  color: #c9c2b3 !important;
  font-size: 0.75rem !important;
  font-weight: 600 !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
}

.metro-popover .meter-signature {
  display: flex !important;
  align-items: center !important;
  gap: 0.35rem !important;
}

body .transport-strip .metro-popover .meter-signature input[type="number"],
body .transport-strip .metro-popover #countInSelect {
  box-sizing: border-box !important;
  width: 3rem !important;
  height: 1.9rem !important;
  min-height: 0 !important;
  padding: 0 0.3rem !important;
  border: 1px solid #504b40 !important;
  border-radius: 0.45rem !important;
  background: #121210 !important;
  color: #f4efe4 !important;
  font: 600 0.8rem "JetBrains Mono", "SF Mono", ui-monospace, monospace !important;
  text-align: center !important;
}

body .transport-strip .metro-popover #countInSelect {
  width: 5.2rem !important;
  font-family: inherit !important;
}

/* View menu: record Auto Q, record grid, cursor on stop, follow playhead */

.tp-view-menu {
  position: relative;
}

.tp-view-menu > summary {
  list-style: none;
}

.tp-view-menu > summary::-webkit-details-marker {
  display: none;
}

@media (max-width: 1099px) {
  .tp-view-menu,
  .tp-view-menu > .tp-view-body {
    display: contents !important;
  }

  .tp-view-menu > summary {
    display: none !important;
  }
}

/* Phones: the popover opens as a sheet above the bottom of the screen. */
@media (max-width: 760px) {
  .tp-popover {
    position: fixed;
    top: auto;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 5rem);
    left: 50%;
    width: min(22rem, calc(100vw - 1.5rem));
  }

  body .transport-strip .metro-control > .tp-caret {
    box-sizing: border-box !important;
    min-width: 0 !important;
    min-height: 0 !important;
    padding: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }
}

/* One-row workstation bar */
@media (min-width: 1100px) {
  body :is(.room, .sw-transport-row) > .transport-strip {
    display: grid !important;
    grid-template-columns: minmax(max-content, 1fr) auto auto auto auto auto minmax(max-content, 1fr) !important;
    grid-template-areas: "edit core loop metro position bpm right" !important;
    grid-template-rows: 3.5rem !important;
    align-items: center !important;
    align-content: center !important;
    column-gap: 0.5rem !important;
    row-gap: 0 !important;
    box-sizing: border-box !important;
    height: 3.5rem !important;
    min-height: 3.5rem !important;
    padding: 0 0.75rem !important;
    overflow: visible !important;
    flex-flow: initial !important;
  }

  body :is(.room, .sw-transport-row) > .transport-strip .transport-primary-row,
  body :is(.room, .sw-transport-row) > .transport-strip .transport-primary-row .transport,
  body :is(.room, .sw-transport-row) > .transport-strip .transport-secondary-row {
    display: contents !important;
  }

  /* The edit drawer is one grid item across the whole row, under the
     centre: tools on its left edge, grid and View on its right edge. A
     <details> cannot be flattened reliably (its content sits in a slot),
     so it stays a box and only its children take clicks. */
  body :is(.room, .sw-transport-row) > .transport-strip .mobile-edit-drawer {
    position: relative !important;
    z-index: 1 !important;
    display: block !important;
    grid-column: 1 / -1 !important;
    grid-row: 1 !important;
    align-self: center !important;
    justify-self: stretch !important;
    inset: auto !important;
    transform: none !important;
    width: auto !important;
    min-width: 0 !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    background: none !important;
    box-shadow: none !important;
    pointer-events: none !important;
  }

  body :is(.room, .sw-transport-row) > .transport-strip .mobile-edit-drawer > .mobile-edit-body {
    position: static !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 0.5rem !important;
    width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    background: none !important;
    box-shadow: none !important;
    transform: none !important;
  }

  body :is(.room, .sw-transport-row) > .transport-strip .mobile-edit-body > * {
    pointer-events: auto !important;
  }

  body :is(.room, .sw-transport-row) > .transport-strip .position-display,
  body :is(.room, .sw-transport-row) > .transport-strip .transport-core,
  body :is(.room, .sw-transport-row) > .transport-strip #loopBtn,
  body :is(.room, .sw-transport-row) > .transport-strip .metro-control,
  body :is(.room, .sw-transport-row) > .transport-strip .essential-bpm-control {
    z-index: 2 !important;
  }

  body :is(.room, .sw-transport-row) > .transport-strip .mobile-settings-drawer,
  body :is(.room, .sw-transport-row) > .transport-strip .mobile-edit-drawer > summary,
  body :is(.room, .sw-transport-row) > .transport-strip .mobile-clip-tools,
  body :is(.room, .sw-transport-row) > .transport-strip #selectionLabel,
  body :is(.room, .sw-transport-row) > .transport-strip #gridLabel {
    display: none !important;
  }

  body :is(.room, .sw-transport-row) > .transport-strip .position-display,
  body :is(.room, .sw-transport-row) > .transport-strip .transport-core,
  body :is(.room, .sw-transport-row) > .transport-strip #loopBtn,
  body :is(.room, .sw-transport-row) > .transport-strip .metro-control,
  body :is(.room, .sw-transport-row) > .transport-strip .essential-bpm-control,
  body :is(.room, .sw-transport-row) > .transport-strip .edit-tools,
  body :is(.room, .sw-transport-row) > .transport-strip .readout {
    position: relative !important;
    inset: auto !important;
    transform: none !important;
    margin: 0 !important;
    order: 0 !important;
  }

  /* Centre: transport keys 40 px, play 56 px */
  body :is(.room, .sw-transport-row) > .transport-strip .transport-core {
    grid-area: core !important;
    display: flex !important;
    align-items: center !important;
    gap: 0.25rem !important;
    padding: 0.2rem !important;
    border: 1px solid #2c2a24 !important;
    border-radius: 0.75rem !important;
    background: #0c0c0a !important;
  }

  body :is(.room, .sw-transport-row) > .transport-strip .transport-core .icon-button {
    box-sizing: border-box !important;
    width: 2.5rem !important;
    min-width: 2.5rem !important;
    height: 2.5rem !important;
    min-height: 2.5rem !important;
    margin: 0 !important;
    padding: 0 !important;
    border-radius: 0.55rem !important;
    font-size: 1rem !important;
    line-height: 1 !important;
  }

  body :is(.room, .sw-transport-row) > .transport-strip .transport-core #playBtn {
    width: 3.5rem !important;
    min-width: 3.5rem !important;
  }

  body :is(.room, .sw-transport-row) > .transport-strip #loopBtn {
    grid-area: loop !important;
  }

  body :is(.room, .sw-transport-row) > .transport-strip .metro-control {
    grid-area: metro !important;
    display: flex !important;
    align-items: stretch !important;
    height: 2.5rem !important;
  }

  body :is(.room, .sw-transport-row) > .transport-strip #loopBtn,
  body :is(.room, .sw-transport-row) > .transport-strip #metroBtn {
    box-sizing: border-box !important;
    width: 2.5rem !important;
    min-width: 2.5rem !important;
    height: 2.5rem !important;
    min-height: 2.5rem !important;
    padding: 0 !important;
    border-radius: 0.6rem !important;
  }

  body :is(.room, .sw-transport-row) > .transport-strip #metroBtn {
    border-top-right-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
  }

  body :is(.room, .sw-transport-row) > .transport-strip .tp-caret {
    box-sizing: border-box !important;
    width: 1.15rem !important;
    min-width: 1.15rem !important;
    height: 2.5rem !important;
    min-height: 2.5rem !important;
    margin: 0 0 0 -1px !important;
    padding: 0 !important;
    border-top-left-radius: 0 !important;
    border-bottom-left-radius: 0 !important;
    border-radius: 0 0.6rem 0.6rem 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  body :is(.room, .sw-transport-row) > .transport-strip .metro-control.is-open .tp-caret {
    background: #35322a !important;
    color: #f4efe4 !important;
  }

  /* Position display: fixed width, never wraps. First line BAR, second TIME. */
  body :is(.room, .sw-transport-row) > .transport-strip .position-display {
    grid-area: position !important;
    box-sizing: border-box !important;
    width: 7rem !important;
    min-width: 7rem !important;
    max-width: 7rem !important;
    height: 2.75rem !important;
    padding: 0.28rem 0.7rem !important;
    border: 1px solid #2c2a24 !important;
    border-right: 0 !important;
    border-radius: 0.7rem 0 0 0.7rem !important;
    background: #050504 !important;
    color: #f4efe4 !important;
    font: 600 0.72rem/1.15 "JetBrains Mono", "SF Mono", ui-monospace, monospace !important;
    font-variant-numeric: tabular-nums !important;
    letter-spacing: 0 !important;
    text-align: left !important;
    white-space: pre !important;
    overflow: hidden !important;
  }

  body :is(.room, .sw-transport-row) > .transport-strip .position-display::first-line {
    color: #d4a855;
    font-size: 1.05rem;
  }

  body :is(.room, .sw-transport-row) > .transport-strip .essential-bpm-control {
    grid-area: bpm !important;
    box-sizing: border-box !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    gap: 0.05rem !important;
    width: 4rem !important;
    height: 2.75rem !important;
    margin-left: -0.5rem !important;
    padding: 0.2rem 0.6rem !important;
    border: 1px solid #2c2a24 !important;
    border-left: 1px solid #24221c !important;
    border-radius: 0 0.7rem 0.7rem 0 !important;
    background: #050504 !important;
  }

  body :is(.room, .sw-transport-row) > .transport-strip .essential-bpm-control > span {
    color: #8f897c !important;
    font-size: 0.6rem !important;
    font-weight: 600 !important;
    letter-spacing: 0.1em !important;
    line-height: 1 !important;
  }

  body :is(.room, .sw-transport-row) > .transport-strip #bpmInput {
    box-sizing: border-box !important;
    width: 100% !important;
    min-width: 0 !important;
    height: 1.35rem !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    color: #f4efe4 !important;
    font: 600 1.05rem/1 "JetBrains Mono", "SF Mono", ui-monospace, monospace !important;
    font-variant-numeric: tabular-nums !important;
    -moz-appearance: textfield;
    appearance: textfield;
  }

  body :is(.room, .sw-transport-row) > .transport-strip #bpmInput::-webkit-inner-spin-button,
  body :is(.room, .sw-transport-row) > .transport-strip #bpmInput::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
  }

  /* Left: editing tools as one segmented group */
  body :is(.room, .sw-transport-row) > .transport-strip .edit-tools {
    flex: 0 0 auto !important;
    display: flex !important;
    align-items: center !important;
    gap: 0 !important;
    min-width: 0 !important;
    max-width: 100% !important;
    height: 2.25rem !important;
    padding: 0 !important;
    border: 1px solid #504b40 !important;
    border-radius: 0.6rem !important;
    background: #23221d !important;
    overflow: hidden !important;
  }

  body :is(.room, .sw-transport-row) > .transport-strip .edit-tools .icon-edit {
    box-sizing: border-box !important;
    flex: 0 0 2rem !important;
    width: 2rem !important;
    min-width: 2rem !important;
    height: 100% !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-right: 1px solid #2c2a24 !important;
    border-radius: 0 !important;
    background: transparent !important;
  }

  body :is(.room, .sw-transport-row) > .transport-strip .edit-tools .icon-edit:last-of-type {
    border-right: 0 !important;
  }

  body :is(.room, .sw-transport-row) > .transport-strip .edit-tools .icon-edit:hover {
    background: #2e2c25 !important;
  }

  /* Right: grid + snap, then View */
  body :is(.room, .sw-transport-row) > .transport-strip .readout {
    flex: 0 0 auto !important;
    display: flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
    min-width: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    background: none !important;
  }

  body :is(.room, .sw-transport-row) > .transport-strip .readout > label:has(#gridSelect) {
    display: flex !important;
    align-items: stretch !important;
    gap: 0 !important;
    height: 2.25rem !important;
    margin: 0 !important;
    border: 1px solid #504b40 !important;
    border-radius: 0.6rem !important;
    overflow: hidden !important;
  }

  body :is(.room, .sw-transport-row) > .transport-strip .readout > label:has(#gridSelect) > span {
    display: flex !important;
    align-items: center !important;
    padding: 0 0 0 0.55rem !important;
    background: #23221d !important;
    color: #a7a197 !important;
    font-size: 0.68rem !important;
    font-weight: 600 !important;
    letter-spacing: 0 !important;
    text-transform: none !important;
  }

  body :is(.room, .sw-transport-row) > .transport-strip #gridSelect {
    box-sizing: border-box !important;
    width: 4.2rem !important;
    min-width: 0 !important;
    height: 100% !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 0.3rem !important;
    border: 0 !important;
    border-radius: 0 !important;
    background-color: #23221d !important;
    color: #f4efe4 !important;
    font-size: 0.75rem !important;
    font-weight: 600 !important;
  }

  body :is(.room, .sw-transport-row) > .transport-strip #snapBtn {
    box-sizing: border-box !important;
    width: 3.2rem !important;
    min-width: 0 !important;
    height: 100% !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-left: 1px solid #504b40 !important;
    border-radius: 0 !important;
    font-size: 0.75rem !important;
    font-weight: 600 !important;
  }

  body :is(.room, .sw-transport-row) > .transport-strip .tp-view-menu > summary {
    box-sizing: border-box !important;
    display: flex !important;
    align-items: center !important;
    gap: 0.3rem !important;
    height: 2.25rem !important;
    padding: 0 0.7rem !important;
    border: 1px solid #504b40 !important;
    border-radius: 0.6rem !important;
    background: #23221d !important;
    color: #f4efe4 !important;
    cursor: pointer;
    font-size: 0.75rem !important;
    font-weight: 600 !important;
    white-space: nowrap !important;
  }

  body :is(.room, .sw-transport-row) > .transport-strip .tp-view-menu[open] > summary {
    background: #2a2316 !important;
    border-color: #8a6f37 !important;
    color: #e8bf6a !important;
  }

  body :is(.room, .sw-transport-row) > .transport-strip .tp-view-body {
    position: absolute !important;
    z-index: 80 !important;
    top: calc(100% + 0.45rem) !important;
    right: 0 !important;
    display: grid !important;
    gap: 0.55rem !important;
    box-sizing: border-box !important;
    width: 15rem !important;
    padding: 0.8rem !important;
    border: 1px solid #504b40 !important;
    border-radius: 0.75rem !important;
    background: #1b1a16 !important;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.55) !important;
  }

  body :is(.room, .sw-transport-row) > .transport-strip .tp-view-body > label,
  body :is(.room, .sw-transport-row) > .transport-strip .tp-view-body > .record-grid-field {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 0.5rem !important;
    margin: 0 !important;
  }

  body :is(.room, .sw-transport-row) > .transport-strip .tp-view-body > label > span,
  body :is(.room, .sw-transport-row) > .transport-strip .tp-view-body > .record-grid-field > span {
    color: #c9c2b3 !important;
    font-size: 0.75rem !important;
    font-weight: 600 !important;
    letter-spacing: 0 !important;
    text-transform: none !important;
  }

  body :is(.room, .sw-transport-row) > .transport-strip .tp-view-body select {
    box-sizing: border-box !important;
    width: 7rem !important;
    height: 1.9rem !important;
    min-height: 0 !important;
    margin: 0 !important;
    border: 1px solid #504b40 !important;
    border-radius: 0.45rem !important;
    background-color: #121210 !important;
    color: #f4efe4 !important;
    font-size: 0.75rem !important;
  }

  body :is(.room, .sw-transport-row) > .transport-strip .tp-view-body > .mini-button {
    box-sizing: border-box !important;
    width: 100% !important;
    height: 2rem !important;
    min-height: 0 !important;
    margin: 0 !important;
    font-size: 0.75rem !important;
  }
}

/* The room column is narrower than the one-row bar (side panel open on a
   laptop): the transport keeps the first row, editing and view the second. */
@media (min-width: 1100px) {
  body .room {
    container: sw-room / inline-size;
  }
}

@container sw-room (max-width: 1010px) {
  body :is(.room, .sw-transport-row) > .transport-strip {
    grid-template-rows: 3.25rem 2.6rem !important;
    height: 6.1rem !important;
    min-height: 6.1rem !important;
    padding-bottom: 0.25rem !important;
  }

  body :is(.room, .sw-transport-row) > .transport-strip .mobile-edit-drawer {
    grid-row: 2 !important;
  }
}

/* The popover stacks its blocks; legacy grid areas on these controls
   (timing, settings) must not leak in. */
body .transport-strip .tp-popover {
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
}

body .transport-strip .tp-popover[hidden] {
  display: none !important;
}

body .transport-strip .tp-popover > *,
body .transport-strip .tp-popover .metro-settings,
body .transport-strip .tp-popover .metro-settings > label,
body .transport-strip .tp-popover #metroVolumePanel {
  grid-area: auto !important;
  box-sizing: border-box !important;
  width: 100% !important;
  max-width: none !important;
  min-width: 0 !important;
}

body .transport-strip .tp-popover #metroVolumePanel {
  grid-template-columns: minmax(0, 1fr) !important;
}

body .transport-strip .tp-popover #metroVolumeInput {
  margin: 0 !important;
}

@media (min-width: 1100px) {
  body :is(.room, .sw-transport-row) > .transport-strip .mobile-edit-drawer,
  body :is(.room, .sw-transport-row) > .transport-strip .mobile-edit-drawer > .mobile-edit-body,
  body :is(.room, .sw-transport-row) > .transport-strip .readout,
  body :is(.room, .sw-transport-row) > .transport-strip .tp-view-menu {
    overflow: visible !important;
    max-height: none !important;
    clip-path: none !important;
  }

  body :is(.room, .sw-transport-row) > .transport-strip .tp-view-menu:not([open]) > .tp-view-body {
    display: none !important;
  }
}

@media (min-width: 1100px) {
  body :is(.room, .sw-transport-row) > .transport-strip .tp-view-menu[open] > .tp-view-body {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0.55rem !important;
  }

  body :is(.room, .sw-transport-row) > .transport-strip .tp-view-body > *,
  body :is(.room, .sw-transport-row) > .transport-strip .tp-view-body #autoQuantizeBtn,
  body :is(.room, .sw-transport-row) > .transport-strip .tp-view-body #followPlayheadBtn,
  body :is(.room, .sw-transport-row) > .transport-strip .tp-view-body .record-grid-field {
    position: static !important;
    inset: auto !important;
    grid-area: auto !important;
    order: 0 !important;
    box-sizing: border-box !important;
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    margin: 0 !important;
    transform: none !important;
  }

  body :is(.room, .sw-transport-row) > .transport-strip .tp-view-body > label,
  body :is(.room, .sw-transport-row) > .transport-strip .tp-view-body > .record-grid-field {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 0.5rem !important;
    height: 2rem !important;
  }

  body :is(.room, .sw-transport-row) > .transport-strip .tp-view-body > label > span,
  body :is(.room, .sw-transport-row) > .transport-strip .tp-view-body > .record-grid-field > span {
    display: block !important;
    position: static !important;
    white-space: nowrap !important;
  }

  body :is(.room, .sw-transport-row) > .transport-strip .tp-view-body #autoQuantizeBtn,
  body :is(.room, .sw-transport-row) > .transport-strip .tp-view-body #followPlayheadBtn {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    height: 2rem !important;
    min-height: 0 !important;
    padding: 0 0.6rem !important;
    border-radius: 0.5rem !important;
    font-size: 0.75rem !important;
  }
}

/* Inside the popover nothing floats: legacy phone rules positioned the
   click-volume head and gave the panel a fixed height. */
body .transport-strip .tp-popover *:not(option) {
  position: static !important;
  inset: auto !important;
  transform: none !important;
}

body .transport-strip .tp-popover .metro-volume-control,
body .transport-strip .tp-popover #metroVolumePanel,
body .transport-strip .tp-popover .metro-settings {
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
}

/* Phones: the ▾ sits on the metronome's corner so the transport row keeps
   its width; tapping it opens the setup sheet. */
@media (max-width: 760px) {
  body .transport-strip .metro-control {
    position: relative !important;
    left: auto !important;
    top: auto !important;
  }

  body .transport-strip .metro-control > .tp-caret {
    position: absolute !important;
    z-index: 3 !important;
    right: -0.45rem !important;
    bottom: -0.35rem !important;
    width: 1.35rem !important;
    height: 1.35rem !important;
    margin: 0 !important;
    border: 1px solid #504b40 !important;
    border-radius: 999px !important;
    background: #23221d !important;
    color: #f4efe4 !important;
    box-shadow: 0 0 0 0.6rem transparent;
  }

  body .transport-strip .metro-control > .tp-caret::after {
    content: "";
    position: absolute;
    inset: -0.45rem;
  }
}

/* Cursor on stop, next to Stop: arrow back to the marker, or a pinned
   playhead when it stays where it stopped. */
.tp-stop-return .tp-stop-return-stay,
.tp-stop-return[aria-pressed="true"] .tp-stop-return-back {
  display: none;
}

.tp-stop-return[aria-pressed="true"] .tp-stop-return-stay {
  display: block;
}

.tp-stop-return svg,
.tp-focus-button svg {
  width: 1rem;
  height: 1rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

body .transport-strip .transport-core > .tp-stop-return {
  box-sizing: border-box !important;
  width: 1.9rem !important;
  min-width: 1.9rem !important;
  height: 2.5rem !important;
  min-height: 2.5rem !important;
  margin: 0 !important;
  padding: 0 !important;
  display: inline-grid !important;
  place-items: center !important;
  border-radius: 0.55rem !important;
  color: #a7a197 !important;
}

body .transport-strip .transport-core > .tp-stop-return[aria-pressed="true"] {
  color: #e8bf6a !important;
}

body .transport-strip .tp-focus-button {
  display: inline-grid !important;
  place-items: center !important;
  width: 2.25rem !important;
  min-width: 2.25rem !important;
  height: 2.25rem !important;
  margin: 0 !important;
  padding: 0 !important;
}

body .transport-strip .tp-focus-button[aria-pressed="true"] {
  border-color: #e8bf6a !important;
  color: #e8bf6a !important;
}

@media (max-width: 760px) {
  body .transport-strip .tp-focus-button {
    display: none !important;
  }

  body .transport-strip .transport-core > .tp-stop-return {
    width: 1.7rem !important;
    min-width: 1.7rem !important;
    height: 2.2rem !important;
    min-height: 2.2rem !important;
  }
}

/* Full screen: the room takes the whole window, transport and tracks stay. */
html body.sw-focus-mode .topbar,
html body.sw-focus-mode .workspace > .inspector-side,
html body.sw-focus-mode .workspace > .room-side,
html body.sw-focus-mode .workspace > .side-restore-button {
  display: none !important;
}

html body.sw-focus-mode .workspace,
html body.sw-focus-mode .workspace.inspector-panel-collapsed,
html body.sw-focus-mode .workspace.room-panel-collapsed {
  --inspector-rail-width: 0px !important;
  --inspector-rail-offset: 0px !important;
  --inspector-top-space: 0px !important;
  grid-template-columns: 0 minmax(0, 1fr) 0 !important;
}

/* With Cursor on stop and Full screen in the bar, the word "Grid" gives way
   below 1600 px; the select keeps it as its title and accessible name. */
@media (min-width: 1100px) and (max-width: 1599px) {
  body :is(.room, .sw-transport-row) > .transport-strip .readout > label > span:first-child {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
    clip: rect(0 0 0 0) !important;
    white-space: nowrap !important;
  }
}

.tp-view-menu > summary .tp-view-icon {
  display: none;
  width: 1rem;
  height: 1rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

@media (min-width: 1100px) and (max-width: 1599px) {
  body :is(.room, .sw-transport-row) > .transport-strip .tp-view-menu > summary .tp-view-word {
    display: none !important;
  }

  body :is(.room, .sw-transport-row) > .transport-strip .tp-view-menu > summary .tp-view-icon {
    display: block !important;
  }
}

/* Play was pressed and is getting ready: the button says so at once. */
html body #playBtn.is-starting {
  animation: sw-play-starting 0.6s ease-in-out infinite alternate;
}

@keyframes sw-play-starting {
  from { opacity: 1; }
  to { opacity: 0.4; }
}

@media (prefers-reduced-motion: reduce) {
  html body #playBtn.is-starting {
    animation: none;
    opacity: 0.6;
  }
}
