:root {
  --primary-bg: linear-gradient(160deg, #0f0f0f 0%, #1a1a2e 55%, #16213e 100%);
  --secondary-bg: rgba(24, 24, 38, 0.98);
  --accent-color: #6366f1;
  --accent-hover: #4f46e5;
  --text-primary: #ffffff;
  --text-secondary: #a1a1aa;
  --border-color: rgba(255, 255, 255, 0.1);
  --shadow-color: rgba(0, 0, 0, 0.35);
  --glass-bg: rgba(255, 255, 255, 0.08);
  --glass-border: rgba(255, 255, 255, 0.12);
  --danger: #ef4444;
  --header-height: 40px;
  --player-bar-height: 42px;
  --touch-min: 40px;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --content-pad: 0.75rem;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  padding: 0;
  font-family: var(--font);
  background: #0f0f0f;
  background-image: var(--primary-bg);
  background-attachment: scroll;
  color: var(--text-primary);
  overflow-x: hidden;
  min-height: 100vh;
  min-height: 100dvh;
  padding-top: calc(var(--header-height) + var(--safe-top) + 0.5rem);
  padding-bottom: var(--safe-bottom);
}

[hidden] {
  display: none !important;
}

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

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  z-index: 3000;
  background: var(--accent-color);
  color: white;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
}

.skip-link:focus {
  left: 0.75rem;
  top: calc(var(--safe-top) + 0.5rem);
}

/* Header */
.header {
  position: fixed;
  top: calc(var(--safe-top) + 0.25rem);
  left: calc(var(--safe-left) + 0.4rem);
  right: calc(var(--safe-right) + 0.4rem);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
  min-height: var(--header-height);
  height: var(--header-height);
  padding: 0.2rem 0.45rem;
  background: rgba(20, 20, 32, 0.92);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  box-shadow: 0 6px 18px var(--shadow-color);
  transition: opacity 0.28s ease, transform 0.28s ease;
}

.header-left,
.header-controls {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  min-width: 0;
}

.header-left {
  flex: 1 1 auto;
}

.header-controls {
  flex: 0 0 auto;
}

.logo {
  font-size: 0.92rem;
  font-weight: 700;
  white-space: nowrap;
  background: linear-gradient(45deg, var(--accent-color), #8b5cf6);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.icon-button,
.back-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  min-height: 34px;
  padding: 0.2rem;
  border: 1px solid var(--glass-border);
  border-radius: 9px;
  background: var(--glass-bg);
  color: var(--text-primary);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.icon-button:hover,
.back-button:hover,
.icon-button:focus-visible,
.back-button:focus-visible {
  border-color: var(--accent-color);
  outline: none;
}

.icon-button:active,
.back-button:active,
.channel-button:active,
.category-chip:active,
.player-bar-button:active {
  transform: scale(0.97);
}

.back-button {
  min-width: auto;
  padding: 0.25rem 0.65rem;
  font-size: 0.8rem;
  background: var(--accent-color);
  border-color: var(--accent-color);
  white-space: nowrap;
}

.volume-control {
  display: none;
  align-items: center;
}

#volumeSlider,
#volumeSliderSheet {
  -webkit-appearance: none;
  appearance: none;
  width: 120px;
  height: 8px;
  border-radius: 999px;
  background: var(--glass-border);
  outline: none;
  cursor: pointer;
}

#volumeSlider::-webkit-slider-thumb,
#volumeSliderSheet::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent-color);
  border: 2px solid rgba(255, 255, 255, 0.35);
  cursor: pointer;
}

#volumeSlider::-moz-range-thumb,
#volumeSliderSheet::-moz-range-thumb {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent-color);
  border: 2px solid rgba(255, 255, 255, 0.35);
  cursor: pointer;
}

.support-link {
  display: none;
  align-items: center;
  justify-content: center;
  min-height: var(--touch-min);
  padding: 0.45rem 0.9rem;
  border-radius: 10px;
  background: linear-gradient(135deg, #8b5cf6, #6366f1);
  color: white;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
}

.icon-button.muted {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  border-color: #ef4444;
  color: white;
}

/* Layout */
.main-container {
  display: flex;
  min-height: calc(100vh - var(--header-height) - 1rem - var(--safe-top));
  min-height: calc(100dvh - var(--header-height) - 1rem - var(--safe-top));
}

.content-area {
  flex: 1;
  min-width: 0;
  width: 100%;
  margin-left: 0;
  padding-bottom: 1rem;
}

.browser-toolbar {
  position: sticky;
  top: calc(var(--header-height) + var(--safe-top) + 0.75rem);
  z-index: 40;
  display: grid;
  gap: 0.65rem;
  padding: 0 var(--content-pad) 0.65rem;
  background: linear-gradient(180deg, rgba(15, 15, 15, 0.96) 70%, rgba(15, 15, 15, 0));
}

.search-field {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: var(--touch-min);
  padding: 0 0.9rem;
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
}

.search-icon {
  color: var(--text-secondary);
  font-size: 1.1rem;
}

#channelSearch {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--text-primary);
  font: inherit;
  font-size: 1rem;
  padding: 0.7rem 0;
}

#channelSearch::placeholder {
  color: var(--text-secondary);
}

.category-chips {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.15rem;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}

.category-chip {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  color: var(--text-secondary);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  touch-action: manipulation;
}

.category-chip.active,
.category-chip:focus-visible {
  color: white;
  background: var(--accent-color);
  border-color: var(--accent-color);
  outline: none;
}

/* Side menu / drawer */
.drawer-scrim {
  position: fixed;
  inset: 0;
  z-index: 160;
  background: rgba(0, 0, 0, 0.55);
}

.side-menu {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 170;
  width: min(86vw, 320px);
  height: 100vh;
  height: 100dvh;
  padding: calc(var(--safe-top) + 0.75rem) 0.85rem calc(var(--safe-bottom) + 1rem);
  background: var(--secondary-bg);
  border-right: 1px solid var(--glass-border);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  transform: translateX(-105%);
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 8px 0 30px rgba(0, 0, 0, 0.35);
}

.side-menu.open {
  transform: translateX(0);
  visibility: visible;
  pointer-events: auto;
}

.side-menu.hidden {
  transform: translateX(-105%);
  visibility: hidden;
  pointer-events: none;
}

.side-menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.side-menu-title,
.side-menu-subtitle {
  margin: 0;
  color: var(--text-primary);
  font-size: 1.05rem;
  font-weight: 600;
}

.side-menu-subtitle {
  margin: 0.5rem 0;
  font-size: 0.95rem;
  color: var(--text-secondary);
}

.side-menu-divider {
  height: 1px;
  margin: 0.85rem 0;
  background: var(--glass-border);
}

.category-list,
.channel-list {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.category-item,
.channel-menu-item {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  width: 100%;
  min-height: var(--touch-min);
  padding: 0.65rem 0.75rem;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--text-secondary);
  font: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.category-item:hover,
.category-item.active,
.channel-menu-item:hover,
.channel-menu-item.active,
.category-item:focus-visible,
.channel-menu-item:focus-visible {
  background: var(--glass-bg);
  border-color: var(--accent-color);
  color: var(--text-primary);
  outline: none;
}

.channel-menu-item img {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.05);
}

.channel-menu-item span,
.category-item span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Channel grid */
#channelPicker {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  padding: 0.25rem var(--content-pad) 1.5rem;
  max-width: 1400px;
  margin: 0 auto;
}

.channel-button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  min-height: 128px;
  padding: 0.85rem 0.65rem;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  text-align: center;
  cursor: pointer;
  overflow: hidden;
  transition: border-color 0.2s ease, transform 0.15s ease, background 0.2s ease;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.channel-button:hover,
.channel-button:focus-visible {
  border-color: var(--accent-color);
  outline: none;
}

.channel-button img,
.channel-logo-fallback {
  width: 100%;
  height: 72px;
  object-fit: contain;
  border-radius: 12px;
  margin-bottom: 0.55rem;
  background: rgba(255, 255, 255, 0.04);
  padding: 0.25rem;
}

.channel-logo-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
}

.channel-button-name {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
  width: 100%;
  line-height: 1.25;
  font-size: 0.88rem;
  font-weight: 500;
}

.channel-empty,
.loading,
.error-state {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  min-height: 180px;
  padding: 1.5rem;
  color: var(--text-secondary);
  text-align: center;
  font-size: 1rem;
}

.loading::after {
  content: '';
  width: 22px;
  height: 22px;
  border: 2px solid var(--accent-color);
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.error-state button,
.tap-to-unmute,
.retry-overlay button {
  min-height: var(--touch-min);
  padding: 0.7rem 1.1rem;
  border: 0;
  border-radius: 999px;
  background: var(--accent-color);
  color: white;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

/* Video — always full-bleed; header/player bar overlay on top */
.video-container,
#videoContainer {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: #000;
}

body.is-playing .video-container,
body.is-playing #videoContainer {
  inset: 0;
}

.video-element {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}

.iframe-container,
.iframe-container iframe {
  width: 100%;
  height: 100%;
  border: 0;
  background: #000;
}

.tap-to-unmute,
.retry-overlay {
  position: absolute;
  inset: 0;
  z-index: 12;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.55);
  color: white;
  text-align: center;
}

.loading-status-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 10;
  display: none;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  padding: 0.85rem 1.5rem;
  border-radius: 999px;
  background: rgba(15, 15, 15, 0.8);
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  pointer-events: none;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

.loading-spinner {
  width: 1rem;
  height: 1rem;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

/* Player bar */
.player-bar {
  position: fixed;
  left: 50%;
  right: auto;
  bottom: calc(0.35rem + var(--safe-bottom));
  z-index: 120;
  display: grid;
  grid-template-columns: 1fr 1.15fr 1fr;
  gap: 0.3rem;
  width: min(360px, calc(100% - 1rem));
  min-height: var(--player-bar-height);
  padding: 0.28rem;
  background: rgba(12, 12, 20, 0.9);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  transform: translateX(-50%);
  transition: opacity 0.28s ease, transform 0.28s ease;
}

.player-bar-button {
  min-height: 34px;
  border: 1px solid var(--glass-border);
  border-radius: 9px;
  background: var(--glass-bg);
  color: var(--text-primary);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  touch-action: manipulation;
  padding: 0.2rem 0.35rem;
}

.player-bar-primary {
  background: var(--accent-color);
  border-color: var(--accent-color);
}

/* Playback chrome visibility */
body.is-playing .header {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

body.is-playing .player-bar {
  opacity: 1;
  transform: translate(-50%, 0);
  pointer-events: auto;
}

body.is-playing.chrome-idle .header {
  opacity: 0;
  transform: translateY(calc(-100% - 0.75rem));
  pointer-events: none;
}

body.is-playing.chrome-idle .player-bar {
  opacity: 0;
  transform: translate(-50%, calc(100% + 1.25rem));
  pointer-events: none;
}

/* More sheet / toast / overlays */
.more-sheet {
  position: fixed;
  inset: 0;
  z-index: 220;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(0, 0, 0, 0.55);
  padding: 0.75rem;
  padding-bottom: calc(0.75rem + var(--safe-bottom));
}

.more-sheet-panel {
  width: min(100%, 420px);
  border: 1px solid var(--glass-border);
  border-radius: 18px 18px 14px 14px;
  background: var(--secondary-bg);
  padding: 1rem;
  box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.35);
}

.more-sheet-header,
.help-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--glass-border);
}

.more-sheet-header h3,
.help-modal-header h3 {
  margin: 0;
  font-size: 1.05rem;
}

.more-sheet-body {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.more-volume {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.more-volume input {
  width: 100%;
}

.more-sheet-link,
.more-sheet-action {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: var(--touch-min);
  border-radius: 12px;
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  color: var(--text-primary);
  text-decoration: none;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(1rem + var(--safe-bottom) + var(--player-bar-height));
  transform: translateX(-50%);
  z-index: 240;
  max-width: min(92vw, 420px);
  padding: 0.85rem 1.1rem;
  border-radius: 12px;
  background: rgba(20, 20, 32, 0.96);
  border: 1px solid var(--glass-border);
  color: white;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.channel-input-display {
  position: fixed;
  top: calc(var(--safe-top) + 4.5rem);
  right: calc(var(--safe-right) + 1rem);
  z-index: 1001;
  padding: 0.65rem 1rem;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.75);
  color: white;
  font-family: 'Courier New', Courier, monospace;
  font-size: 1.6rem;
}

.channel-input-display.hidden,
.channel-info-overlay.hidden,
.help-modal-backdrop.hidden,
.help-panel.hidden {
  display: none;
}

.channel-input-display span {
  margin: 0 0.2rem;
}

.channel-info-overlay {
  position: fixed;
  left: 50%;
  bottom: calc(var(--player-bar-height) + var(--safe-bottom) + 1rem);
  transform: translateX(-50%);
  z-index: 1001;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  max-width: min(92vw, 480px);
  padding: 0.8rem 1.1rem;
  border-radius: 12px;
  border: 1px solid var(--glass-border);
  background: rgba(0, 0, 0, 0.82);
  color: white;
  transition: opacity 0.4s ease;
}

.channel-info-overlay.fade-out {
  opacity: 0;
}

.channel-info-number {
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--accent-color);
}

.channel-info-name {
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Help modal */
.help-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 230;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  padding-bottom: calc(1rem + var(--safe-bottom));
  background: rgba(0, 0, 0, 0.6);
}

.help-modal {
  width: min(100%, 420px);
  max-height: min(80dvh, 560px);
  overflow: auto;
  padding: 1.15rem;
  border-radius: 16px;
  border: 1px solid var(--glass-border);
  background: var(--secondary-bg);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4);
}

.help-modal-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.help-tab {
  min-height: 40px;
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  background: transparent;
  color: var(--text-secondary);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.help-tab.active {
  background: var(--accent-color);
  border-color: var(--accent-color);
  color: white;
}

.help-modal-body {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.help-shortcut {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.35rem 0;
}

.help-shortcut kbd,
.help-key {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  padding: 0.25rem 0.5rem;
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  background: var(--glass-bg);
  color: var(--accent-color);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  white-space: nowrap;
}

.help-key {
  min-width: 5.5rem;
}

.help-shortcut span:last-child {
  color: var(--text-secondary);
  font-size: 0.92rem;
}

.help-modal-close {
  font-size: 1.4rem;
  line-height: 1;
}

/* Scrollbars */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent-color);
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Larger phones / small tablets */
@media screen and (min-width: 480px) {
  #channelPicker {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 1rem;
  }

  .channel-button {
    min-height: 140px;
  }

  .channel-button img,
  .channel-logo-fallback {
    height: 80px;
  }
}

/* Tablet+ : persistent-ish sidebar optional, denser grid */
@media screen and (min-width: 768px) {
  :root {
    --header-height: 42px;
    --content-pad: 1.25rem;
  }

  body {
    padding-top: calc(var(--header-height) + var(--safe-top) + 0.6rem);
  }

  .header {
    top: calc(var(--safe-top) + 0.35rem);
    left: calc(var(--safe-left) + 0.6rem);
    right: calc(var(--safe-right) + 0.6rem);
  }

  .volume-control {
    display: flex;
  }

  .support-link {
    display: inline-flex;
    min-height: 34px;
    padding: 0.3rem 0.7rem;
    font-size: 0.78rem;
  }

  .more-button {
    display: none;
  }

  #channelPicker {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1.15rem;
    padding-top: 0.5rem;
  }

  .side-menu {
    width: 280px;
  }

  .player-bar {
    width: min(340px, calc(100% - 2rem));
    bottom: calc(0.6rem + var(--safe-bottom));
  }

  .channel-info-overlay {
    bottom: calc(4rem + var(--safe-bottom));
  }

  .toast {
    bottom: calc(4rem + var(--safe-bottom));
  }
}

/* Desktop sidebar open by default via JS; keep layout room when open */
@media screen and (min-width: 1024px) {
  .side-menu:not(.hidden).open {
    transform: translateX(0);
  }

  body.desktop-menu-open .content-area {
    margin-left: 280px;
  }

  body.desktop-menu-open .drawer-scrim {
    display: none !important;
  }

  body.desktop-menu-open .side-menu {
    top: calc(var(--header-height) + var(--safe-top) + 0.85rem);
    left: 0;
    height: calc(100vh - var(--header-height) - 1rem - var(--safe-top));
    height: calc(100dvh - var(--header-height) - 1rem - var(--safe-top));
    border-radius: 0 14px 14px 0;
    box-shadow: none;
  }

  .browser-toolbar {
    top: calc(var(--header-height) + var(--safe-top) + 0.85rem);
  }

  #closeMenuButton {
    display: none;
  }
}

/* Playback mode: hide browse chrome */
body.is-playing .browser-toolbar,
body.is-playing .main-container {
  visibility: hidden;
  pointer-events: none;
}

body.is-playing {
  overflow: hidden;
}

body.is-playing .support-link {
  display: none;
}

@media screen and (max-width: 767px) {
  body.is-playing .volume-control {
    display: none;
  }

  .logo {
    font-size: 0.85rem;
  }

  body.is-playing .logo {
    display: none;
  }
}
