/* Keep playback controls stable when their labels change. */
.leo-media-actions > button {
  box-sizing: border-box;
  flex: none;
  height: 44px;
  min-height: 44px;
  white-space: nowrap;
  transform: none;
}
.leo-media-actions > button:first-child { width: 158px; }
.leo-media-actions > button:nth-child(2) { width: 142px; }
.leo-media-actions > button > span { text-box: trim-both cap alphabetic; }

@media (max-width: 767px) {
  /* Reserve room for the signature and three 44px touch controls. */
  .primary-navigation .rrmc-primary-nav--menu-wrapper { left: 8px !important; }
  .primary-navigation .rrmc-primary-nav .rrmc-logo {
    position: absolute;
    left: 56px;
    width: clamp(104px, calc(100vw - 224px), 140px);
    display: flex;
    align-items: center;
  }
  .primary-navigation .rrmc-primary-nav .rrmc-logo-link,
  .primary-navigation .rrmc-primary-nav .rrmc-logo-full {
    width: 100%;
    height: 50px;
  }
  .primary-navigation .rrmc-primary-nav .global-enquire-button { right: 8px; }
  .primary-navigation .leo-header-account { right: 60px; gap: 4px; }
  .primary-navigation .leo-header-account .lc-help,
  .primary-navigation .leo-header-account .lc-signin,
  .primary-navigation .leo-header-account .lc-inbox-trigger {
    width: 44px;
    min-width: 44px;
    height: 44px;
    padding: 0;
    gap: 0;
  }
  .primary-navigation .leo-header-account .lc-help span {
    position: absolute; width: 1px; height: 1px;
    overflow: hidden; clip-path: inset(50%); white-space: nowrap;
  }
  .primary-navigation .leo-header-account .lc-mail-pop { right: -52px; }
  .primary-navigation button.leo-theme-toggle[data-theme-toggle] {
    width: 44px; min-width: 44px; max-width: 44px; flex-basis: 44px;
  }
  .primary-navigation button.leo-theme-toggle[data-theme="dark"] .leo-theme-sun,
  .primary-navigation button.leo-theme-toggle[data-theme="light"] .leo-theme-moon { display: none; }
  .primary-navigation button.leo-theme-toggle[data-theme-toggle] span {
    width: 34px; flex-basis: 34px;
  }
  .leo-media-actions {
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr);
    width: min(100%, 360px);
    gap: 8px;
  }
  .leo-media-actions > button:nth-child(n) { width: 100%; min-width: 0; padding: 10px 8px; }
  .leo-media-actions > button:last-child { grid-column: 1 / -1; }
  .leo-media-controls { bottom: max(16px, env(safe-area-inset-bottom)); }
  .leo-speaker-header button { width: 44px; height: 44px; min-height: 44px; }
  .leo-speaker-picker { max-height: calc(100svh - 196px); overflow-y: auto; overscroll-behavior: contain; }
}

/* Short landscape screens need a single row to preserve room for the footage. */
@media (min-width: 480px) and (max-width: 767px) and (max-height: 479px) {
  .leo-media-actions { width: 100%; grid-template-columns: 1fr 1fr 1.15fr; }
  .leo-media-actions > button:last-child { grid-column: auto; }
  .leo-speaker-picker { max-height: calc(100svh - 144px); }
}
