.navigation-icon {
  display: none;
}

@media (pointer: coarse), (max-width: 639px) {
  #request-text,
  .listener-form input {
    font-size: 16px;
  }
  .recent-prompt,
  .my-song-play,
  .my-songs-pages .text-action,
  .archive-actions button,
  #reuse-prompt {
    min-height: 44px;
  }
  .my-song {
    grid-template-columns: minmax(0, 1fr) 44px;
  }
  .my-song-archive,
  .details-trigger,
  .share-song,
  .details-close,
  #copy-prompt {
    width: 44px;
    height: 44px;
  }
  .details-trigger,
  .share-song {
    margin: 0;
  }
  .song-byline {
    gap: 4px;
    min-height: 44px;
  }
  .creator-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }
  .creator {
    justify-content: center;
  }
  .timeline {
    margin-top: 0;
  }
  #seek {
    height: 44px;
  }
  .tooltip {
    display: none;
  }
  #song-details {
    padding-top: 16px;
  }
  .popover-top {
    top: 6px;
    right: 6px;
    z-index: 1;
  }
  .prompt-heading {
    padding-right: 44px;
  }
  #copy-prompt {
    margin: 0;
  }
  .queue-byline {
    flex-wrap: wrap;
  }
  .queue-requester {
    flex-basis: 40%;
  }
  .queue-cancel {
    font-size: 12px;
  }
  .queue-description,
  .my-song-play {
    font-size: 13px;
  }
  .queue-byline,
  .queue-estimate {
    font-size: 11px;
  }
}

@media (max-width: 639px) {
  main {
    --page-padding: 20px;
    padding-left: max(20px, env(safe-area-inset-left));
    padding-right: max(20px, env(safe-area-inset-right));
    padding-bottom: max(20px, env(safe-area-inset-bottom));
  }
  .station-sidebar {
    left: max(20px, env(safe-area-inset-left));
    right: max(20px, env(safe-area-inset-right));
    width: auto;
    top: calc(46px + env(safe-area-inset-top));
    gap: 4px;
  }
  .station-name {
    top: calc(14px + env(safe-area-inset-top));
    left: max(20px, env(safe-area-inset-left));
  }
  .corner-actions {
    top: calc(14px + env(safe-area-inset-top));
    right: max(20px, env(safe-area-inset-right));
  }
  .station-panel {
    padding: 16px;
  }
  .title-stack {
    gap: 16px;
  }
  .title-frame {
    height: 132px;
  }
  .request-area {
    margin-top: 44px;
  }
  #recent-prompts {
    padding-top: 8px;
  }
  .toast {
    right: max(20px, env(safe-area-inset-right));
    bottom: max(20px, env(safe-area-inset-bottom));
  }
}

@media (max-width: 639px) and (max-height: 700px) {
  .station-sidebar {
    top: calc(10px + env(safe-area-inset-top));
    gap: 0;
  }
  .title-frame {
    height: 112px;
  }
  .title-stack {
    gap: 8px;
  }
  .request-area {
    margin-top: 28px;
  }
  .recent-prompt {
    padding-top: 4px;
    padding-bottom: 4px;
  }
}

@media (max-height: 500px) and (min-width: 500px) and (max-width: 1100px) {
  main {
    padding-inline: max(20px, env(safe-area-inset-left))
      max(20px, env(safe-area-inset-right));
  }
  .station-name {
    display: none;
  }
  .station-sidebar {
    top: calc(8px + env(safe-area-inset-top));
    left: max(20px, env(safe-area-inset-left));
    width: min(360px, calc(100vw - 40px));
    gap: 0;
  }
  .listener-identity {
    position: static;
    width: auto;
    max-width: 100%;
  }
  .corner-actions {
    top: calc(8px + env(safe-area-inset-top));
    right: max(20px, env(safe-area-inset-right));
  }
  .player {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: start;
    width: min(760px, 100%);
    gap: 24px;
    padding-bottom: 0;
  }
  .title-frame {
    height: 106px;
  }
  .title-stack {
    gap: 8px;
  }
  .signal {
    height: 20px;
  }
  h1 {
    font-size: 20px;
  }
  .request-area {
    margin-top: 0;
  }
  .recent-prompt {
    min-height: 44px;
  }
}

@media (max-width: 639px), (max-width: 1100px) and (max-height: 500px) {
  main {
    --bottom-navigation: 1;
    padding-top: var(--player-top, 108px);
  }
  .station-sidebar {
    bottom: calc(84px + env(safe-area-inset-bottom));
    max-height: none;
    gap: 12px;
  }
  .station-navigation {
    position: fixed;
    z-index: 6;
    bottom: 0;
    left: 0;
    right: 0;
    max-width: none;
    justify-content: space-around;
    gap: 0;
    padding: 0 max(12px, env(safe-area-inset-right))
      max(8px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
    border-top: 1px solid var(--border);
    background: var(--paper);
  }
  .station-navigation .panel-tab,
  .station-navigation #open-favourites {
    flex: 1;
    flex-direction: column;
    justify-content: center;
    min-width: 44px;
    min-height: 60px;
    gap: 4px;
    padding: 6px 0;
    border: 0;
    background: none;
    font-size: 11px;
    line-height: 14px;
  }
  .station-navigation .panel-tab[aria-expanded="true"] {
    color: var(--active);
  }
  .navigation-icon {
    display: block;
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.6;
    stroke-linecap: round;
    stroke-linejoin: round;
  }
  .panel-tab[aria-expanded="true"] .navigation-icon {
    stroke-width: 2.2;
  }
  .queue-badge {
    position: absolute;
    top: 4px;
    left: calc(50% + 12px);
    font-size: 9px;
    line-height: 12px;
  }
  .queue-toggle[data-ready="true"]::after {
    position: absolute;
    top: 8px;
    left: calc(50% - 20px);
    flex: none;
  }
  .station-panel {
    margin-top: auto;
    padding: 16px;
  }
  #recent-prompts {
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
  }
  .toast {
    bottom: calc(84px + env(safe-area-inset-bottom));
  }
}

@media (pointer: coarse) {
  :root[data-keyboard] .station-sidebar {
    top: calc(var(--visual-top) + 8px);
    bottom: auto;
    max-height: calc(var(--visual-height) - 24px);
  }
  :root[data-keyboard] .station-navigation,
  :root[data-keyboard] .station-name,
  :root[data-keyboard] .corner-actions,
  :root[data-keyboard] #recent-prompts {
    display: none;
  }
  :root[data-keyboard="request"] .request-area {
    position: fixed;
    z-index: 5;
    left: max(20px, env(safe-area-inset-left));
    right: max(20px, env(safe-area-inset-right));
    top: calc(var(--visual-top) + var(--visual-height) - 14px);
    transform: translateY(-100%);
    margin: 0;
  }
  :root[data-keyboard="request"] .request-meta {
    display: none;
  }
  :root[data-keyboard="name"] .request-area,
  :root[data-keyboard][data-keyboard-compact] #listening-view {
    visibility: hidden;
  }
}

@media (max-height: 400px) and (min-width: 500px) and (max-width: 1100px) {
  .signal {
    display: none;
  }
  .title-frame {
    height: 76px;
  }
  .title-stack {
    gap: 0;
  }
  .song-heading h1 {
    font-size: 18px;
    -webkit-line-clamp: 1;
  }
}
