/* ersy. — phone / small-tablet layer */

@media (max-width: 860px) {
  :root {
    --bar-h: 64px;
  }

  html, body {
    background: #07040f;
  }

  .app-frame,
  .app-frame.artist-mode,
  .app-frame.wide-main {
    padding: 0;
    gap: 0;
    height: 100dvh;
  }

  .main-scroll,
  .side-nav,
  .right-rail {
    border-radius: 0;
    border: 0;
    box-shadow: none;
    backdrop-filter: none;
  }

  .main-scroll {
    padding-top: calc(58px + env(safe-area-inset-top, 0px));
    padding-bottom: calc(var(--bar-h) + env(safe-area-inset-bottom, 0px) + 28px);
    background: #0a0612;
  }

  .nav-toggle { display: none !important; }

  .nav-scrim {
    z-index: 60;
    background: rgba(0, 0, 0, 0.55);
  }

  .side-nav {
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 70;
    width: min(86vw, 320px);
    border-radius: 0;
    padding: calc(8px + env(safe-area-inset-top, 0px)) 8px calc(20px + env(safe-area-inset-bottom, 0px));
    background: #000 !important;
    border: 0 !important;
    box-shadow: 8px 0 40px rgba(0, 0, 0, 0.55);
  }

  .side-nav .nav-link,
  .side-nav .side-nav-links button,
  .side-nav a.nav-link {
    color: #fff;
    font-size: 16px;
    font-weight: 400;
    padding: 12px 16px;
    border-radius: 0;
    gap: 22px;
  }

  .side-nav .nav-link:hover,
  .side-nav .nav-link.on,
  .side-nav-links button.on {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
  }

  .side-nav .ico {
    width: 24px;
    opacity: 1;
  }

  .side-section.yt-pl-section {
    border-top: 1px solid #2a2a2a;
    padding-top: 16px;
    margin-top: 8px;
    overflow: visible;
    max-height: none;
  }

  .side-section.yt-artist-section {
    border-top: 1px solid #2a2a2a;
    max-height: none;
    overflow: visible;
  }

  .side-user { display: none; }

  /* ── pages ── */
  .page {
    padding: 8px 16px 32px;
  }

  .h-page {
    font-size: 34px;
    margin: 2px 0 6px;
    letter-spacing: -0.05em;
  }

  .page-lede {
    display: none;
  }

  .page-toolbar {
    gap: 8px;
    margin: 10px 0 6px;
  }

  .page-toolbar .field {
    width: 100% !important;
    flex: 1 1 100%;
    min-height: 44px;
    border-radius: 14px;
  }

  .page-toolbar .chip,
  .chip {
    flex: 0 0 auto;
  }

  .eyebrow {
    font-size: 10px;
  }

  /* ── library: 2-up compact tiles, not one giant photo ── */
  .lib-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px 12px;
    padding: 14px 0 8px;
  }

  .lib-art,
  .lib-card .art {
    aspect-ratio: 3 / 4;
    border-radius: 18px;
    margin-bottom: 8px;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.32);
  }

  .lib-hit img,
  .lib-card .art img {
    object-position: center 18%;
  }

  .lib-meta strong,
  .lib-card strong {
    font-size: 14px;
    line-height: 1.2;
    padding-right: 4px;
  }

  .lib-meta em,
  .lib-card em {
    font-size: 11.5px;
    margin-top: 2px;
  }

  .lib-card-wrap .play-fab {
    opacity: 1;
    transform: none;
    width: 36px;
    height: 36px;
    right: 8px;
    bottom: 8px;
    top: auto;
    font-size: 12px;
  }

  .lib-card-wrap .heart-float {
    width: 32px;
    height: 32px;
    top: 8px;
    right: 8px;
  }

  /* ── home ── */
  .cine-hero {
    min-height: min(48vh, 400px);
    border-radius: 0;
  }
  .cine-hero-shot {
    width: 100%;
    -webkit-mask-image: none;
    mask-image: none;
    object-position: center 8%;
  }

  .cine-hero-copy {
    padding: 28px 18px 26px;
    max-width: none;
  }

  .home-brand {
    font-size: clamp(52px, 18vw, 84px);
  }

  .cine-hero-copy .lede {
    font-size: 16px;
    max-width: 28ch;
  }

  .cine-hero-copy .sub {
    display: none;
  }

  .cine-cta {
    gap: 8px;
    margin-top: 18px;
  }

  .cine-cta .btn,
  .cine-cta .btn-ghost {
    padding: 11px 16px;
    font-size: 13.5px;
  }

  .cine-meta {
    gap: 14px;
    margin-top: 18px;
    padding-top: 12px;
  }

  .cine-meta b {
    font-size: 16px;
  }

  .home-section {
    padding: 18px 0 4px;
  }

  .home-section .nf-row-head,
  .home-featured .nf-row-head {
    padding: 0 16px;
    margin-bottom: 10px !important;
  }

  .feat-card {
    flex-basis: 132px;
    width: 132px;
  }

  .feat-marquee {
    mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent);
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent);
  }

  .release-rail {
    padding-left: 16px;
    padding-right: 16px;
  }

  .rail {
    padding-left: 16px;
    padding-right: 16px;
  }

  /* ── music bar: layout owned by player-bar.css ── */
  .bar-vol,
  .vh.audio .vh-controls .bar-vol {
    display: none !important;
  }

  /* ── video player on phones ── */
  .vh.full {
    z-index: 240;
  }

  .vh.mini .vh-box {
    left: auto;
    right: 10px;
    top: auto;
    width: min(280px, calc(100vw - 20px));
    height: auto !important;
    min-height: 0;
    max-width: none;
    bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    border-radius: 16px;
  }

  .vh.mini .vh-now-head .vh-btn {
    width: 40px;
    height: 40px;
  }

  .vh.mini .vh-meta img,
  .vh.mini .vh-text em {
    display: none;
  }

  .vh.mini .vh-text strong {
    font-size: 11px;
  }

  .vh.full .vh-box {
    inset: 0;
    width: 100%;
    height: 100%;
    max-height: 100dvh;
    border-radius: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: calc(8px + env(safe-area-inset-top, 0px)) 14px calc(14px + env(safe-area-inset-bottom, 0px));
    overflow: hidden;
  }

  .vh.full .vh-grip {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: none;
    min-width: 0;
  }

  .vh.full .vh-lyrics-live {
    order: 3;
    min-height: 52px;
    padding: 2px 4px 0;
  }

  .vh.full .vh-lyric-on {
    font-size: 17px;
  }

  .vh.full .vh-center {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
  }

  .vh.full .vh-stage {
    flex: 1 1 auto;
    width: 100%;
    min-height: 160px;
    max-height: 48dvh;
    align-self: stretch;
  }

  .vh.full.face-video iframe,
  .vh.full iframe {
    width: 100%;
    max-width: none;
    height: auto;
    max-height: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 12px;
  }

  .vh.full .vh-text strong {
    font-size: 18px;
    letter-spacing: -0.03em;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    white-space: normal;
  }

  .vh.full .vh-text em {
    font-size: 13px;
  }

  .vh.full .vh-meta {
    padding: 0;
  }

  .vh.full .vh-transport {
    width: 100%;
    justify-content: space-between;
    padding: 6px 4px;
    gap: 4px;
  }

  .vh.full .vh-play-main {
    width: 52px;
    height: 52px;
  }

  .vh.full .vh-btn {
    width: 44px;
    height: 44px;
  }

  .vh.full .vh-box {
    overflow: hidden;
  }

  .vh.full .vh-panel {
    flex: 1 1 auto;
    max-height: none;
    min-height: 0;
  }

  .vh.full.has-panel .vh-stage,
  .vh.has-panel.full .vh-stage {
    flex: 0 0 auto;
    max-height: 34dvh;
    min-height: 120px;
  }

  .grid-videos {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    padding: 2px 2px 8px;
    margin-top: 12px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .grid-videos::-webkit-scrollbar { display: none; }

  .grid-videos .vid-wrap {
    flex: 0 0 min(72vw, 240px);
    max-width: 240px;
    scroll-snap-align: start;
  }

  .vid .thumb { aspect-ratio: 16 / 9; }

  .vid .play {
    width: 36px;
    height: 36px;
    font-size: 13px;
  }

  .vid .meta { padding: 8px 10px 10px; }

  .vid-kicker { font-size: 9px; }

  .vid-title {
    font-size: 13.5px;
    margin: 3px 0 2px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .vid-sub { font-size: 11px; }

  .vid-shelf {
    padding: 12px;
    margin-top: 14px;
    contain-intrinsic-size: auto 220px;
  }

  .vid-shelf-head {
    gap: 10px;
    margin-bottom: 4px;
  }

  .toast {
    left: 16px;
    right: 16px;
    width: auto;
    max-width: none;
    transform: none;
    bottom: calc(var(--bar-h) + 12px + env(safe-area-inset-bottom, 0px));
  }

  .cmd-wrap {
    padding: 12px;
    align-items: flex-start;
  }

  .cmd {
    width: 100%;
    max-height: 80dvh;
  }

  .auth {
    width: calc(100vw - 20px);
    max-height: 90dvh;
  }
}

@media (max-width: 860px) and (orientation: landscape) {
  .vh.full .vh-box {
    flex-direction: row;
    flex-wrap: wrap;
    align-content: stretch;
    gap: 8px 16px;
    padding: 8px 16px 8px calc(12px + env(safe-area-inset-left, 0px));
  }

  .vh.full .vh-now-head {
    flex: 1 0 100%;
  }

  .vh.full .vh-stage {
    flex: 1 1 58%;
    max-height: none;
    min-height: 0;
    align-self: center;
  }

  .vh.full .vh-grip {
    flex: 1 1 34%;
    justify-content: center;
  }
}

@media (max-width: 860px) and (hover: none) {
  .feat-marquee:hover .feat-track {
    animation-play-state: running;
  }
}

@media (max-width: 860px) {
  .np-panel.lyrics-exp {
    height: 100dvh;
  }

  .np-body {
    padding-bottom: calc(48px + env(safe-area-inset-bottom, 0px));
  }

  .np-panel.lyrics-exp .np-body {
    padding-bottom: 20px;
  }
}

@media (max-width: 420px) {
  .lib-grid {
    gap: 14px 10px;
  }

  .h-page {
    font-size: 30px;
  }

  .cine-hero {
    min-height: 44vh;
  }
}
