/* ==========================================================================
   Poly Music Mobile Web — Material 3 Expressive Design System (Android 1:1)
   Single source of truth for themes, Glass/Vivid backdrop, components, and
   responsive breakpoints (280px Fold .. 900px Tablet + Landscape).
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. DESIGN TOKENS, THEMES, AMOLED, GLASS & VIVID BROWSER-STYLE GRADIENT
   -------------------------------------------------------------------------- */
:root {
  color-scheme: dark;

  /* Solid surface hierarchy (JS updates --pm-* dynamically from accent seed) */
  --s-lowest-solid: var(--pm-s-lowest, #0F0F0F);
  --surface-solid: var(--pm-surface, #141414);
  --s-low-solid: var(--pm-s-low, #191919);
  --s-container-solid: var(--pm-s-container, #1E1E1E);
  --s-high-solid: var(--pm-s-high, #262626);
  --s-highest-solid: var(--pm-s-highest, #303030);
  --outline-var-solid: var(--pm-outline-var, #454545);

  /* Text & outlines */
  --on-surface: var(--pm-on-surface, #EAEAEF);
  --on-surface-var: var(--pm-on-surface-var, #C7C7CF);
  --outline: var(--pm-outline, #91919A);

  /* Accent & semantic roles (default: Android violet #8B6CFF) */
  --primary: var(--pm-primary, #8B6CFF);
  --on-primary: var(--pm-on-primary, #FFFFFF);
  --primary-c-solid: var(--pm-primary-c, #312169);
  --on-primary-c: var(--pm-on-primary-c, #E8E0FF);

  --secondary: var(--pm-secondary, #B5A8E0);
  --on-secondary: var(--pm-on-secondary, #221A40);
  --secondary-c-solid: var(--pm-secondary-c, #2E2849);
  --on-secondary-c: var(--pm-on-secondary-c, #E8E0FF);

  --tertiary: var(--pm-tertiary, #D99CE8);
  --on-tertiary: var(--pm-on-tertiary, #361640);
  --tertiary-c-solid: var(--pm-tertiary-c, #492356);
  --on-tertiary-c: var(--pm-on-tertiary-c, #FADCF8);

  --error: var(--pm-error, #F2B8B5);
  --on-error: var(--pm-on-error, #601410);
  --error-c: var(--pm-error-c, #8C1D18);
  --on-error-c: var(--pm-on-error-c, #F9DEDC);

  --ok: #3DDC84;
  --online: #34D399;
  --warn: #F59E0B;
  --streak-grad: linear-gradient(135deg, #FFE047 0%, #FF7A00 52%, #FF2E54 100%);
  --beta-grad: linear-gradient(90deg, #FF5C9A 0%, #FF983D 17%, #FFE066 34%, #4BE3A2 51%, #54C7FF 68%, #9C7BFF 85%, #FF5C9A 100%);

  /* Active surface aliases (100% opaque when Glass is off) */
  --surface: var(--surface-solid);
  --s-lowest: var(--s-lowest-solid);
  --s-low: var(--s-low-solid);
  --s-container: var(--s-container-solid);
  --s-high: var(--s-high-solid);
  --s-highest: var(--s-highest-solid);
  --outline-var: var(--outline-var-solid);
  --primary-c: var(--primary-c-solid);
  --secondary-c: var(--secondary-c-solid);
  --tertiary-c: var(--tertiary-c-solid);
  --nav-bg: var(--s-low-solid);
  --card-border: transparent;
  --glass-blur: none;
  --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.24);
  --shadow-md: 0 8px 26px rgba(0, 0, 0, 0.36);
  --shadow-lg: 0 18px 48px rgba(0, 0, 0, 0.52);

  /* Ambient backdrop colors (driven by core.js when gradient active) */
  --bg-glow: var(--pm-glow, #503399);
  --bg-glow-2: var(--pm-glow-2, #7A3E99);
  --bg-fade: 1200ms;

  /* Typography — exact @font-face names from /desktop/fonts/fonts.css */
  --font: 'Twemoji Country Flags', 'Onest', system-ui, -apple-system, 'Segoe UI', 'Yu Gothic UI', 'Microsoft YaHei UI', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, Consolas, monospace;

  /* Radii & Motion */
  --r-xs: 6px;
  --r-sm: 12px;
  --r-md: 16px;
  --r-lg: 20px;
  --r-xl: 24px;
  --r-2xl: 28px;
  --r-pill: 999px;
  --ease-spring: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-m3: cubic-bezier(0.2, 0, 0, 1);
  --ease-inout: cubic-bezier(0.65, 0, 0.35, 1);

  /* Layout & Safe Areas */
  --gutter: 16px;
  --player-gutter: 22px;
  --nav-h: 74px;
  --mini-h: 66px;
  --mini-offset: 0px;
  --max-w: 900px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
}

/* AMOLED Pure Black mode */
html[data-amoled="1"]:not([data-theme="light"]) {
  --surface-solid: #000000;
  --s-lowest-solid: #000000;
  --s-low-solid: #08080A;
  --s-container-solid: #0E0E12;
  --s-high-solid: #16161B;
  --s-highest-solid: #1F1F26;
  --outline-var-solid: #2E2E36;
}

/* Light Theme */
html[data-theme="light"] {
  color-scheme: light;
  --s-lowest-solid: var(--pm-s-lowest, #FFFFFF);
  --surface-solid: var(--pm-surface, #F6F6FA);
  --s-low-solid: var(--pm-s-low, #EFEFF6);
  --s-container-solid: var(--pm-s-container, #E8E8F1);
  --s-high-solid: var(--pm-s-high, #DFDFE9);
  --s-highest-solid: var(--pm-s-highest, #D5D5E2);
  --outline-var-solid: var(--pm-outline-var, #C5C5D4);

  --on-surface: var(--pm-on-surface, #16161E);
  --on-surface-var: var(--pm-on-surface-var, #4B4B5B);
  --outline: var(--pm-outline, #767687);

  --primary: var(--pm-primary, #6B4EE6);
  --on-primary: var(--pm-on-primary, #FFFFFF);
  --primary-c-solid: var(--pm-primary-c, #E7DEFF);
  --on-primary-c: var(--pm-on-primary-c, #241457);

  --secondary: var(--pm-secondary, #5C547A);
  --on-secondary: var(--pm-on-secondary, #FFFFFF);
  --secondary-c-solid: var(--pm-secondary-c, #E3DDF4);
  --on-secondary-c: var(--pm-on-secondary-c, #1E1933);

  --tertiary: var(--pm-tertiary, #8B4C7D);
  --on-tertiary: var(--pm-on-tertiary, #FFFFFF);
  --tertiary-c-solid: var(--pm-tertiary-c, #FADBF2);
  --on-tertiary-c: var(--pm-on-tertiary-c, #34112E);

  --error: var(--pm-error, #BA1A1A);
  --on-error: var(--pm-on-error, #FFFFFF);
  --error-c: var(--pm-error-c, #FFDAD6);
  --on-error-c: var(--pm-on-error-c, #410002);

  --shadow-sm: 0 2px 10px rgba(18, 18, 32, 0.08);
  --shadow-md: 0 8px 24px rgba(18, 18, 32, 0.14);
  --shadow-lg: 0 18px 44px rgba(18, 18, 32, 0.22);
}

/* Glass Theme (normal gradient alpha tokens — exact Android app_gradient.dart) */
html[data-glass="1"] {
  --surface: transparent;
  --s-lowest: color-mix(in srgb, var(--s-lowest-solid) 45%, transparent);
  --s-low: color-mix(in srgb, var(--s-low-solid) 50%, transparent);
  --s-container: color-mix(in srgb, var(--s-container-solid) 55%, transparent);
  --s-high: color-mix(in srgb, var(--s-high-solid) 60%, transparent);
  --s-highest: color-mix(in srgb, var(--s-highest-solid) 65%, transparent);
  --primary-c: color-mix(in srgb, var(--primary-c-solid) 62%, transparent);
  --secondary-c: color-mix(in srgb, var(--secondary-c-solid) 72%, transparent);
  --tertiary-c: color-mix(in srgb, var(--tertiary-c-solid) 75%, transparent);
  --outline-var: color-mix(in srgb, var(--outline-var-solid) 45%, transparent);
  --nav-bg: color-mix(in srgb, var(--s-container-solid) 72%, transparent);
  --card-border: rgba(255, 255, 255, 0.08);
  --glass-blur: blur(20px) saturate(140%);
}

/* Vivid Browser-Style Gradient (clearer glass + saturated glow lobes) */
html[data-vivid="1"],
html[data-glass="1"][data-vivid="1"] {
  --surface: transparent;
  --s-lowest: color-mix(in srgb, var(--s-lowest-solid) 30%, transparent);
  --s-low: color-mix(in srgb, var(--s-low-solid) 35%, transparent);
  --s-container: color-mix(in srgb, var(--s-container-solid) 40%, transparent);
  --s-high: color-mix(in srgb, var(--s-high-solid) 46%, transparent);
  --s-highest: color-mix(in srgb, var(--s-highest-solid) 52%, transparent);
  --primary-c: color-mix(in srgb, var(--primary-c-solid) 54%, transparent);
  --secondary-c: color-mix(in srgb, var(--secondary-c-solid) 62%, transparent);
  --tertiary-c: color-mix(in srgb, var(--tertiary-c-solid) 66%, transparent);
  --outline-var: color-mix(in srgb, var(--outline-var-solid) 45%, transparent);
  --nav-bg: color-mix(in srgb, var(--s-container-solid) 58%, transparent);
  --card-border: rgba(255, 255, 255, 0.12);
  --glass-blur: blur(20px) saturate(140%);
}

html[data-theme="light"][data-glass="1"] {
  --card-border: rgba(18, 18, 32, 0.08);
}
html[data-theme="light"][data-vivid="1"] {
  --card-border: rgba(18, 18, 32, 0.12);
}

/* --------------------------------------------------------------------------
   2. GLOBAL RESET, TYPOGRAPHY & ICON HELPERS
   -------------------------------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  height: 100%;
  background: var(--surface-solid);
  color: var(--on-surface);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.45;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  overscroll-behavior: none;
}

body {
  margin: 0;
  min-height: 100%;
  height: 100dvh;
  background: var(--surface);
  color: var(--on-surface);
  font-family: var(--font);
  overflow: hidden;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}

/* Keep scaffold transparent when Glass/Vivid backdrop is active even if JS sets --surface */
html[data-glass="1"] body,
html[data-vivid="1"] body,
html[data-glass="1"] #pmAuthScreen,
html[data-vivid="1"] #pmAuthScreen {
  background: transparent !important;
}

body.has-mini { --mini-offset: 78px; }
body.has-select { --mini-offset: 78px; }
body.player-open,
body.sheet-open,
body.pm-sheet-open,
body.aod-open { overflow: hidden; }

button, input, textarea, select {
  font: inherit;
  color: inherit;
}

button {
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
  cursor: pointer;
  text-align: inherit;
  touch-action: manipulation;
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

input, textarea {
  user-select: text;
  -webkit-user-select: text;
}

a {
  color: var(--primary);
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.hidden { display: none !important; }

/* Material Symbols Rounded icon helper */
.mi {
  font-family: 'Material Symbols Rounded';
  font-weight: 400;
  font-style: normal;
  font-size: 24px;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  flex: none;
  user-select: none;
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
  -webkit-font-smoothing: antialiased;
}
.mi.fill { font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24; }
.mi.xs { font-size: 16px; }
.mi.sm { font-size: 20px; }
.mi.lg { font-size: 28px; }
.mi.xl { font-size: 36px; }

/* Typography utility classes (matching Android theme.dart) */
.pm-h1 {
  margin: 0;
  font-size: 28px;
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: -0.6px;
}
.pm-h2 {
  margin: 0;
  font-size: 20px;
  line-height: 1.22;
  font-weight: 700;
  letter-spacing: -0.3px;
}
.pm-h3 {
  margin: 0;
  font-size: 17px;
  line-height: 1.25;
  font-weight: 800;
}
.pm-kicker {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary);
}
.pm-muted { color: var(--on-surface-var); }
.pm-outline-txt { color: var(--outline); }
.pm-num, .tabular { font-variant-numeric: tabular-nums; }
.pm-mono { font-family: var(--mono); }
.pm-ellipsis {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pm-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.pm-clamp-4 {
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Marquee scrolling text (Android Marquee: 2s pause -> smooth continuous scroll) */
.pm-marquee {
  position: relative;
  overflow: hidden;
  white-space: nowrap;
  min-width: 0;
  display: block;
}
.pm-marquee-inner {
  display: inline-block;
  white-space: nowrap;
  will-change: transform;
}
.pm-marquee.overflowing {
  mask-image: linear-gradient(90deg, transparent 0, #000 10px, #000 calc(100% - 14px), transparent 100%);
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 10px, #000 calc(100% - 14px), transparent 100%);
}
.pm-marquee.overflowing .pm-marquee-inner {
  animation: pm-marquee-scroll var(--marquee-dur, 10s) linear infinite;
}
@keyframes pm-marquee-scroll {
  0%, 18% { transform: translateX(0); }
  88%, 100% { transform: translateX(var(--marquee-shift, -40%)); }
}

/* --------------------------------------------------------------------------
   3. AMBIENT GRADIENT & VIVID BACKDROP (#pmBackdrop)
   Exact Android app_gradient.dart lobes, blur, and portrait/landscape scrims
   -------------------------------------------------------------------------- */
#pmBackdrop,
.pm-backdrop {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  background: var(--surface-solid);
  contain: strict;
}

.pm-bg-lobe {
  position: absolute;
  inset: -10%;
  opacity: 0;
  transition: opacity var(--bg-fade) var(--ease-inout);
  will-change: opacity;
}

/* Active in glass / vivid mode */
html[data-glass="1"] .pm-bg-lobe-1,
html[data-vivid="1"] .pm-bg-lobe-1 { opacity: 1; }
html[data-glass="1"] .pm-bg-lobe-2,
html[data-glass="1"] .pm-bg-lobe-3,
html[data-vivid="1"] .pm-bg-lobe-2,
html[data-vivid="1"] .pm-bg-lobe-3 { opacity: 1; }

/* Portrait Color Mode — Normal Glass (α: 0.44 / 0.28 / 0.22) */
.pm-bg-lobe-1 {
  background: radial-gradient(
    142% 142% at 14% 21%,
    color-mix(in srgb, var(--bg-glow) 44%, transparent) 0%,
    color-mix(in srgb, var(--bg-glow) 28.6%, transparent) 25%,
    color-mix(in srgb, var(--bg-glow) 12.3%, transparent) 52%,
    color-mix(in srgb, var(--bg-glow) 2.6%, transparent) 78%,
    transparent 100%
  );
}
.pm-bg-lobe-2 {
  background: radial-gradient(
    128% 128% at 84% 17%,
    color-mix(in srgb, var(--bg-glow-2) 28%, transparent) 0%,
    color-mix(in srgb, var(--bg-glow-2) 18.2%, transparent) 25%,
    color-mix(in srgb, var(--bg-glow-2) 7.8%, transparent) 52%,
    color-mix(in srgb, var(--bg-glow-2) 1.7%, transparent) 78%,
    transparent 100%
  );
}
.pm-bg-lobe-3 {
  background: radial-gradient(
    122% 122% at 23% 89%,
    color-mix(in srgb, var(--bg-glow) 22%, transparent) 0%,
    color-mix(in srgb, var(--bg-glow) 14.3%, transparent) 25%,
    color-mix(in srgb, var(--bg-glow) 6.2%, transparent) 52%,
    color-mix(in srgb, var(--bg-glow) 1.3%, transparent) 78%,
    transparent 100%
  );
}

/* Portrait Color Mode — Vivid Browser-Style (α: 0.70 / 0.46 / 0.34) */
html[data-vivid="1"] .pm-bg-lobe-1 {
  background: radial-gradient(
    142% 142% at 14% 21%,
    color-mix(in srgb, var(--bg-glow) 70%, transparent) 0%,
    color-mix(in srgb, var(--bg-glow) 45.5%, transparent) 25%,
    color-mix(in srgb, var(--bg-glow) 19.6%, transparent) 52%,
    color-mix(in srgb, var(--bg-glow) 4.2%, transparent) 78%,
    transparent 100%
  );
}
html[data-vivid="1"] .pm-bg-lobe-2 {
  background: radial-gradient(
    128% 128% at 84% 17%,
    color-mix(in srgb, var(--bg-glow-2) 46%, transparent) 0%,
    color-mix(in srgb, var(--bg-glow-2) 29.9%, transparent) 25%,
    color-mix(in srgb, var(--bg-glow-2) 12.9%, transparent) 52%,
    color-mix(in srgb, var(--bg-glow-2) 2.8%, transparent) 78%,
    transparent 100%
  );
}
html[data-vivid="1"] .pm-bg-lobe-3 {
  background: radial-gradient(
    122% 122% at 23% 89%,
    color-mix(in srgb, var(--bg-glow) 34%, transparent) 0%,
    color-mix(in srgb, var(--bg-glow) 22.1%, transparent) 25%,
    color-mix(in srgb, var(--bg-glow) 9.5%, transparent) 52%,
    color-mix(in srgb, var(--bg-glow) 2.0%, transparent) 78%,
    transparent 100%
  );
}

/* Art Mode (pinned / track cover backdrop) */
html[data-bg-mode="art"] .pm-bg-lobe-1,
html[data-bg-mode="pinned"] .pm-bg-lobe-1,
html[data-bg-mode="track"] .pm-bg-lobe-1 {
  background: radial-gradient(
    148% 148% at 22.5% 17.5%,
    color-mix(in srgb, var(--bg-glow) 38%, transparent) 0%,
    color-mix(in srgb, var(--bg-glow) 24.7%, transparent) 25%,
    color-mix(in srgb, var(--bg-glow) 10.6%, transparent) 52%,
    color-mix(in srgb, var(--bg-glow) 2.3%, transparent) 78%,
    transparent 100%
  );
}
html[data-vivid="1"][data-bg-mode="art"] .pm-bg-lobe-1,
html[data-vivid="1"][data-bg-mode="pinned"] .pm-bg-lobe-1,
html[data-vivid="1"][data-bg-mode="track"] .pm-bg-lobe-1 {
  background: radial-gradient(
    148% 148% at 22.5% 17.5%,
    color-mix(in srgb, var(--bg-glow) 58%, transparent) 0%,
    color-mix(in srgb, var(--bg-glow) 37.7%, transparent) 25%,
    color-mix(in srgb, var(--bg-glow) 16.2%, transparent) 52%,
    color-mix(in srgb, var(--bg-glow) 3.5%, transparent) 78%,
    transparent 100%
  );
}
html[data-bg-mode="art"] .pm-bg-lobe-2,
html[data-bg-mode="art"] .pm-bg-lobe-3,
html[data-bg-mode="pinned"] .pm-bg-lobe-2,
html[data-bg-mode="pinned"] .pm-bg-lobe-3,
html[data-bg-mode="track"] .pm-bg-lobe-2,
html[data-bg-mode="track"] .pm-bg-lobe-3 {
  opacity: 0;
}

/* Blurred artwork layer (#pmBgArt) */
#pmBgArt,
.pm-bg-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.14);
  filter: blur(16px) saturate(1.15);
  opacity: 0;
  transition: opacity var(--bg-fade) var(--ease-inout);
  will-change: opacity;
}
#pmBgArt[src=""],
#pmBgArt:not([src]) {
  opacity: 0 !important;
}
html[data-glass="1"] #pmBgArt.active,
html[data-glass="1"] #pmBgArt.is-visible,
html[data-bg-mode="art"] #pmBgArt[src]:not([src=""]),
html[data-bg-mode="pinned"] #pmBgArt[src]:not([src=""]),
html[data-bg-mode="track"] #pmBgArt[src]:not([src=""]) {
  opacity: 0.44;
}
html[data-vivid="1"] #pmBgArt.active,
html[data-vivid="1"] #pmBgArt.is-visible,
html[data-vivid="1"][data-bg-mode="art"] #pmBgArt[src]:not([src=""]),
html[data-vivid="1"][data-bg-mode="pinned"] #pmBgArt[src]:not([src=""]),
html[data-vivid="1"][data-bg-mode="track"] #pmBgArt[src]:not([src=""]) {
  filter: blur(18px) saturate(1.28);
  opacity: 0.68;
}

/* Scrim overlay (Portrait linear top->bottom, exact 5-stop Android curve) */
.pm-bg-scrim {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity var(--bg-fade) var(--ease-inout);
  background: linear-gradient(
    to bottom,
    color-mix(in srgb, var(--surface-solid) 6%, transparent) 0%,
    color-mix(in srgb, var(--surface-solid) 15.9%, transparent) 26%,
    color-mix(in srgb, var(--surface-solid) 40.7%, transparent) 54%,
    color-mix(in srgb, var(--surface-solid) 61.8%, transparent) 80%,
    color-mix(in srgb, var(--surface-solid) 68%, transparent) 100%
  );
}
html[data-glass="1"] .pm-bg-scrim,
html[data-vivid="1"] .pm-bg-scrim { opacity: 1; }

html[data-vivid="1"] .pm-bg-scrim {
  background: linear-gradient(
    to bottom,
    color-mix(in srgb, var(--surface-solid) 3%, transparent) 0%,
    color-mix(in srgb, var(--surface-solid) 10.2%, transparent) 26%,
    color-mix(in srgb, var(--surface-solid) 28.2%, transparent) 54%,
    color-mix(in srgb, var(--surface-solid) 43.5%, transparent) 80%,
    color-mix(in srgb, var(--surface-solid) 48%, transparent) 100%
  );
}
html[data-bg-mode="art"] .pm-bg-scrim,
html[data-bg-mode="pinned"] .pm-bg-scrim,
html[data-bg-mode="track"] .pm-bg-scrim {
  background: linear-gradient(
    to bottom,
    color-mix(in srgb, var(--surface-solid) 10%, transparent) 0%,
    color-mix(in srgb, var(--surface-solid) 19.9%, transparent) 26%,
    color-mix(in srgb, var(--surface-solid) 44.7%, transparent) 54%,
    color-mix(in srgb, var(--surface-solid) 65.8%, transparent) 80%,
    color-mix(in srgb, var(--surface-solid) 72%, transparent) 100%
  );
}
html[data-vivid="1"][data-bg-mode="art"] .pm-bg-scrim,
html[data-vivid="1"][data-bg-mode="pinned"] .pm-bg-scrim,
html[data-vivid="1"][data-bg-mode="track"] .pm-bg-scrim {
  background: linear-gradient(
    to bottom,
    color-mix(in srgb, var(--surface-solid) 6%, transparent) 0%,
    color-mix(in srgb, var(--surface-solid) 13.7%, transparent) 26%,
    color-mix(in srgb, var(--surface-solid) 32.9%, transparent) 54%,
    color-mix(in srgb, var(--surface-solid) 49.2%, transparent) 80%,
    color-mix(in srgb, var(--surface-solid) 54%, transparent) 100%
  );
}

/* Landscape Backdrop overrides (exact Android landscape alignment & radial scrim) */
@media (orientation: landscape) {
  .pm-bg-lobe-1 {
    background: radial-gradient(
      156% 156% at 22.5% 17.5%,
      color-mix(in srgb, var(--bg-glow) 48%, transparent) 0%,
      color-mix(in srgb, var(--bg-glow) 31.2%, transparent) 25%,
      color-mix(in srgb, var(--bg-glow) 13.4%, transparent) 52%,
      color-mix(in srgb, var(--bg-glow) 2.9%, transparent) 78%,
      transparent 100%
    );
  }
  html[data-vivid="1"] .pm-bg-lobe-1 {
    background: radial-gradient(
      156% 156% at 22.5% 17.5%,
      color-mix(in srgb, var(--bg-glow) 74%, transparent) 0%,
      color-mix(in srgb, var(--bg-glow) 48.1%, transparent) 25%,
      color-mix(in srgb, var(--bg-glow) 20.7%, transparent) 52%,
      color-mix(in srgb, var(--bg-glow) 4.4%, transparent) 78%,
      transparent 100%
    );
  }
  .pm-bg-scrim {
    background: radial-gradient(
      158% 158% at 22.5% 17.5%,
      color-mix(in srgb, var(--surface-solid) 10%, transparent) 0%,
      color-mix(in srgb, var(--surface-solid) 18.3%, transparent) 26%,
      color-mix(in srgb, var(--surface-solid) 39.1%, transparent) 54%,
      color-mix(in srgb, var(--surface-solid) 56.8%, transparent) 80%,
      color-mix(in srgb, var(--surface-solid) 62%, transparent) 100%
    );
  }
  html[data-vivid="1"] .pm-bg-scrim {
    background: radial-gradient(
      158% 158% at 22.5% 17.5%,
      color-mix(in srgb, var(--surface-solid) 4%, transparent) 0%,
      color-mix(in srgb, var(--surface-solid) 10.4%, transparent) 26%,
      color-mix(in srgb, var(--surface-solid) 26.4%, transparent) 54%,
      color-mix(in srgb, var(--surface-solid) 40%, transparent) 80%,
      color-mix(in srgb, var(--surface-solid) 44%, transparent) 100%
    );
  }
  html[data-bg-mode="art"] .pm-bg-scrim,
  html[data-bg-mode="pinned"] .pm-bg-scrim,
  html[data-bg-mode="track"] .pm-bg-scrim {
    background: radial-gradient(
      158% 158% at 22.5% 17.5%,
      color-mix(in srgb, var(--surface-solid) 14%, transparent) 0%,
      color-mix(in srgb, var(--surface-solid) 22.3%, transparent) 26%,
      color-mix(in srgb, var(--surface-solid) 43.1%, transparent) 54%,
      color-mix(in srgb, var(--surface-solid) 60.8%, transparent) 80%,
      color-mix(in srgb, var(--surface-solid) 66%, transparent) 100%
    );
  }
  html[data-vivid="1"][data-bg-mode="art"] .pm-bg-scrim,
  html[data-vivid="1"][data-bg-mode="pinned"] .pm-bg-scrim,
  html[data-vivid="1"][data-bg-mode="track"] .pm-bg-scrim {
    background: radial-gradient(
      158% 158% at 22.5% 17.5%,
      color-mix(in srgb, var(--surface-solid) 8%, transparent) 0%,
      color-mix(in srgb, var(--surface-solid) 15%, transparent) 26%,
      color-mix(in srgb, var(--surface-solid) 32.6%, transparent) 54%,
      color-mix(in srgb, var(--surface-solid) 47.6%, transparent) 80%,
      color-mix(in srgb, var(--surface-solid) 52%, transparent) 100%
    );
  }
}

/* --------------------------------------------------------------------------
   4. ANIMATION TIERS (smooth / reduced / off + prefers-reduced-motion)
   -------------------------------------------------------------------------- */
html[data-anim="reduced"] {
  --bg-fade: 220ms;
}
html[data-anim="reduced"] .pm-bg-lobe-2,
html[data-anim="reduced"] .pm-bg-lobe-3 {
  display: none;
}
html[data-anim="reduced"] #pmBgArt {
  filter: blur(10px) saturate(1.1);
}

html[data-anim="off"] {
  --bg-fade: 0ms;
}
html[data-anim="off"] *,
html[data-anim="off"] *::before,
html[data-anim="off"] *::after {
  animation-duration: 0.01ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.01ms !important;
  scroll-behavior: auto !important;
}
html[data-anim="off"] .pm-bg-lobe-2,
html[data-anim="off"] .pm-bg-lobe-3,
html[data-anim="off"] #pmBgArt {
  display: none !important;
}
html[data-anim="off"] .pm-marquee.overflowing {
  mask-image: none;
  -webkit-mask-image: none;
  text-overflow: ellipsis;
}
html[data-anim="off"] .pm-marquee.overflowing .pm-marquee-inner {
  animation: none !important;
  transform: none !important;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
}
html[data-anim="off"] .pm-beta-badge-fill {
  animation: none !important;
  background-position: 18% 50%;
}

@media (prefers-reduced-motion: reduce) {
  html:not([data-anim="smooth"]) *,
  html:not([data-anim="smooth"]) *::before,
  html:not([data-anim="smooth"]) *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  html:not([data-anim="smooth"]) .pm-bg-lobe-2,
  html:not([data-anim="smooth"]) .pm-bg-lobe-3 {
    display: none;
  }
  html:not([data-anim="smooth"]) .pm-beta-badge-fill {
    animation: none !important;
    background-position: 18% 50%;
  }
}

/* Glass card helper applied automatically to cards/panels when Glass/Vivid is ON */
html[data-glass="1"] .pm-card,
html[data-vivid="1"] .pm-card,
html[data-glass="1"] .pm-settings-group,
html[data-vivid="1"] .pm-settings-group,
html[data-glass="1"] .pm-settings-folder,
html[data-vivid="1"] .pm-settings-folder,
html[data-glass="1"] .pm-stat-tile,
html[data-vivid="1"] .pm-stat-tile,
html[data-glass="1"] .pm-stat-card,
html[data-vivid="1"] .pm-stat-card,
html[data-glass="1"] .pm-track-row,
html[data-vivid="1"] .pm-track-row,
html[data-glass="1"] .pm-notif-card,
html[data-vivid="1"] .pm-notif-card,
html[data-glass="1"] .pm-ticket-card,
html[data-vivid="1"] .pm-ticket-card,
html[data-glass="1"] .pm-showcase-featured,
html[data-vivid="1"] .pm-showcase-featured,
html[data-glass="1"] .pm-showcase-empty,
html[data-vivid="1"] .pm-showcase-empty,
html[data-glass="1"] .pm-mini-player,
html[data-vivid="1"] .pm-mini-player,
html[data-glass="1"] .pm-nav,
html[data-vivid="1"] .pm-nav {
  border-color: var(--card-border);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
}

/* --------------------------------------------------------------------------
   5. APP SHELL, PERSISTENT TABS & PUSHED SUB-PAGE STACK
   -------------------------------------------------------------------------- */
#pmApp,
.pm-app {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: transparent;
}

#pmMain,
.pm-main {
  position: relative;
  flex: 1 1 0;
  min-height: 0;
  width: 100%;
  overflow: hidden;
}

.pm-view {
  position: absolute;
  inset: 0;
  display: none;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  scrollbar-width: none;
}
.pm-view::-webkit-scrollbar { display: none; }
.pm-view.active {
  display: block;
  animation: pm-view-in 160ms var(--ease-m3);
}
@keyframes pm-view-in {
  from { opacity: 0.4; }
  to { opacity: 1; }
}

.pm-page-inner {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding:
    calc(var(--safe-top) + 12px)
    calc(var(--gutter) + var(--safe-right))
    calc(var(--nav-h) + var(--safe-bottom) + var(--mini-offset) + 28px)
    calc(var(--gutter) + var(--safe-left));
  min-width: 0;
}
.pm-page-inner.narrow { max-width: 680px; }
.pm-page-inner.profile-w { max-width: 640px; }

/* Full-screen pushed sub-pages (#pmStackHost — z-index 31 covers #pmNav 30, below MiniPlayer 32) */
#pmStackHost,
.pm-stack-host {
  position: fixed;
  inset: 0;
  z-index: 31;
  pointer-events: none;
}
#pmStackHost.has-views { pointer-events: auto; }
#pmStackHost.has-views ~ #pmMiniPlayer,
#pmStackHost.has-views ~ #pmSelectBar {
  bottom: calc(var(--safe-bottom) + 10px);
}

.pm-page,
.pm-stack-page {
  position: absolute;
  inset: 0;
  pointer-events: auto;
  background: var(--surface-solid);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  scrollbar-width: none;
  opacity: 0;
  transform: translateY(16px) scale(0.988);
  transition: opacity 200ms ease, transform 240ms var(--ease-spring);
}
.pm-page::-webkit-scrollbar,
.pm-stack-page::-webkit-scrollbar { display: none; }
.pm-page.open,
.pm-stack-page.open {
  opacity: 1;
  transform: translateY(0) scale(1);
}
.pm-page.is-under,
.pm-stack-page.is-under {
  pointer-events: none;
  opacity: 0;
}
html[data-glass="1"] .pm-page,
html[data-vivid="1"] .pm-page,
html[data-glass="1"] .pm-stack-page,
html[data-vivid="1"] .pm-stack-page {
  background: color-mix(in srgb, var(--surface-solid) 62%, transparent);
  backdrop-filter: blur(24px) saturate(135%);
  -webkit-backdrop-filter: blur(24px) saturate(135%);
}
.pm-stack-page.closing {
  opacity: 0;
  transform: translateY(16px) scale(0.985);
}

.pm-stack-scroll {
  flex: 1 1 0;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  scrollbar-width: none;
}
.pm-stack-scroll::-webkit-scrollbar { display: none; }

/* Sticky sub-page topbar */
.pm-topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: calc(56px + var(--safe-top));
  padding: calc(var(--safe-top) + 8px) calc(var(--gutter) + var(--safe-right)) 8px calc(var(--gutter) + var(--safe-left));
  background: color-mix(in srgb, var(--surface-solid) 84%, transparent);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  transition: background 180ms ease;
}
.pm-topbar.transparent {
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.pm-topbar.scrolled {
  background: color-mix(in srgb, var(--s-container-solid) 92%, transparent);
}
.pm-topbar-title {
  flex: 1;
  min-width: 0;
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pm-topbar-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: none;
}

/* Tab page header */
.pm-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
  min-width: 0;
}
.pm-header-title-wrap {
  min-width: 0;
  flex: 1;
}
.pm-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
}

/* --------------------------------------------------------------------------
   6. SHARED PRIMITIVES: BUTTONS, INPUTS, PILL SWITCH, CHIPS, SWITCH, CARDS
   -------------------------------------------------------------------------- */
.pm-card {
  background: var(--s-container);
  border: 1px solid var(--card-border);
  border-radius: var(--r-xl);
  padding: 16px;
  min-width: 0;
}
.pm-card.r28 { border-radius: var(--r-2xl); }
.pm-card.high { background: var(--s-high); }

.pm-icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  flex: none;
  color: var(--on-surface);
  transition: transform 130ms var(--ease-m3), background 160ms ease, color 160ms ease;
}
.pm-icon-btn:active { transform: scale(0.92); }
.pm-icon-btn.sm { width: 36px; height: 36px; }
.pm-icon-btn.sm .mi { font-size: 20px; }
.pm-icon-btn.lg { width: 48px; height: 48px; }
.pm-icon-btn.tonal {
  background: var(--s-high);
  color: var(--on-surface);
}
.pm-icon-btn.tonal-sec {
  background: var(--secondary-c);
  color: var(--on-secondary-c);
}
.pm-icon-btn.filled,
.pm-icon-btn.active {
  background: var(--primary);
  color: var(--on-primary);
}
.pm-icon-btn.danger {
  background: color-mix(in srgb, var(--error) 16%, transparent);
  color: var(--error);
}
.pm-icon-btn .pm-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: var(--r-pill);
  background: var(--primary);
  color: var(--on-primary);
  font-size: 10px;
  font-weight: 800;
  line-height: 18px;
  text-align: center;
  font-variant-numeric: tabular-nums;
  border: 2px solid var(--surface-solid);
}
.pm-icon-btn .pm-badge-dot {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--primary);
  border: 2px solid var(--surface-solid);
}

/* Stadium M3 Buttons */
.pm-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 20px;
  border-radius: var(--r-pill);
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  flex-shrink: 0;
  transition: transform 130ms var(--ease-m3), background 160ms ease, opacity 160ms ease;
}
.pm-btn:active { transform: scale(0.96); }
.pm-btn .mi { font-size: 20px; }
.pm-btn-sm { height: 36px; padding: 0 14px; font-size: 13px; gap: 6px; }
.pm-btn-sm .mi { font-size: 18px; }
.pm-btn-lg { height: 50px; padding: 0 26px; font-size: 15px; }
.pm-btn-block,
.pm-btn-full { width: 100%; }

.pm-btn-primary {
  background: var(--primary);
  color: var(--on-primary);
}
.pm-btn-tonal {
  background: var(--secondary-c);
  color: var(--on-secondary-c);
}
.pm-btn-surface {
  background: var(--s-high);
  color: var(--on-surface);
}
.pm-btn-outlined {
  background: transparent;
  color: var(--on-surface);
  border: 1.5px solid var(--outline-var-solid);
}
.pm-btn-danger {
  background: var(--error);
  color: var(--on-error);
}
.pm-btn-danger-outline {
  background: color-mix(in srgb, var(--error) 12%, transparent);
  color: var(--error);
  border: 1px solid color-mix(in srgb, var(--error) 35%, transparent);
}
.pm-btn-ghost,
.pm-btn-link {
  background: transparent;
  color: var(--primary);
  padding: 0 12px;
}
.pm-btn-tg {
  background: #2AABEE;
  color: #FFFFFF;
}

/* Input with trailing inline suffix (e.g. country flag picker) */
.pm-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}
.pm-input-wrap .pm-input { padding-right: 48px; }
.pm-input-suffix {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 19px;
  color: var(--on-surface-var);
}
.pm-input-suffix:active { background: color-mix(in srgb, var(--on-surface) 12%, transparent); }

/* Universal Cover Container (PM.createCover) */
.pm-cover {
  position: relative;
  overflow: hidden;
  border-radius: 14px;
  background: var(--s-high);
  flex: none;
  display: block;
}
.pm-cover > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.pm-cover-fb {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--primary-c-solid) 0%, var(--secondary-c-solid) 100%);
  color: var(--on-primary-c);
}

.pm-row { display: flex; align-items: center; gap: 10px; min-width: 0; }
.pm-row.wrap { flex-wrap: wrap; }
.pm-row.between { justify-content: space-between; }
.pm-col { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.pm-spacer { flex: 1; }

/* M3 Stadium Search Bar (r=24, 46px..56px) */
.pm-search-wrap { position: relative; width: 100%; }
.pm-search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 0 14px;
  border-radius: var(--r-xl);
  background: var(--s-high);
  border: 1px solid var(--card-border);
  transition: box-shadow 180ms ease, background 180ms ease;
}
.pm-search-bar.tall { min-height: 54px; border-radius: var(--r-2xl); padding: 0 16px; }
.pm-search-bar:focus-within {
  box-shadow: inset 0 0 0 1.5px var(--primary);
}
.pm-search-bar .mi { color: var(--on-surface-var); font-size: 22px; }
.pm-search-bar input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  outline: none;
  font-size: 15px;
  color: var(--on-surface);
  padding: 10px 0;
}
.pm-search-bar input::placeholder { color: var(--outline); }
.pm-search-clear {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--on-surface-var);
  background: color-mix(in srgb, var(--on-surface) 10%, transparent);
}
.pm-search-clear .mi { font-size: 16px; color: inherit; }

/* Opaque Suggest Dropdown */
.pm-suggest-dropdown,
.pm-popup,
.pm-menu {
  background: var(--s-container-solid);
  border: 1px solid color-mix(in srgb, var(--outline-var-solid) 55%, transparent);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}
.pm-suggest-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 30;
  padding: 6px;
}
.pm-suggest-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border-radius: 14px;
  color: var(--on-surface);
  font-size: 14px;
  font-weight: 500;
}
.pm-suggest-item:active { background: var(--s-high-solid); }
.pm-suggest-item .mi { color: var(--outline); font-size: 19px; }

/* Form fields */
.pm-field { display: flex; flex-direction: column; gap: 6px; width: 100%; }
.pm-field-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--on-surface-var);
  padding-left: 4px;
}
.pm-input,
.pm-textarea {
  width: 100%;
  border: 1.5px solid var(--outline-var-solid);
  border-radius: 16px;
  background: var(--s-high);
  color: var(--on-surface);
  padding: 12px 14px;
  font-size: 15px;
  outline: none;
  transition: border-color 160ms ease, background 160ms ease;
}
.pm-input:focus,
.pm-textarea:focus {
  border-color: var(--primary);
}
.pm-input::placeholder,
.pm-textarea::placeholder { color: var(--outline); }
.pm-textarea { resize: vertical; min-height: 92px; line-height: 1.45; }
.pm-input-row { display: flex; align-items: center; gap: 8px; }
.pm-input-row .pm-input { flex: 1; min-width: 0; }

/* PillSwitch (Android player_extras.dart: h=44/38/32, p=4, active primary/onPrimary) */
.pm-pill-switch {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 4px;
  height: 44px;
  border-radius: var(--r-pill);
  background: var(--s-high);
  border: 1px solid var(--card-border);
  width: 100%;
  min-width: 0;
}
.pm-pill-switch.compact { height: 38px; padding: 3px; }
.pm-pill-switch.dense { height: 34px; padding: 3px; }
.pm-pill-opt {
  flex: 1 1 0;
  min-width: 0;
  height: 100%;
  border-radius: var(--r-pill);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 0 10px;
  font-size: 13px;
  font-weight: 700;
  color: var(--on-surface-var);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background 220ms var(--ease-m3), color 220ms var(--ease-m3), transform 120ms ease;
}
.pm-pill-opt .mi { font-size: 17px; }
.pm-pill-opt.active {
  background: var(--primary);
  color: var(--on-primary);
}
.pm-pill-opt:active { transform: scale(0.97); }

/* Filter Chips */
.pm-chip-row {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 2px 0;
}
.pm-chip-row::-webkit-scrollbar { display: none; }
.pm-chip-row.wrap { flex-wrap: wrap; overflow-x: visible; }
.pm-chip {
  height: 34px;
  padding: 0 14px;
  border-radius: var(--r-pill);
  background: var(--s-high);
  border: 1px solid var(--card-border);
  color: var(--on-surface-var);
  font-size: 13px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  flex: none;
  transition: background 160ms ease, color 160ms ease, transform 120ms ease;
}
.pm-chip:active { transform: scale(0.95); }
.pm-chip .mi { font-size: 17px; }
.pm-chip.active {
  background: var(--primary-c);
  color: var(--on-primary-c);
  border-color: color-mix(in srgb, var(--primary) 42%, transparent);
}
.pm-chip.primary-active.active {
  background: var(--primary);
  color: var(--on-primary);
}

/* M3 Switch */
.pm-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  width: 52px;
  height: 32px;
  flex: none;
  cursor: pointer;
}
.pm-switch input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.pm-switch-track {
  width: 52px;
  height: 32px;
  border-radius: var(--r-pill);
  background: var(--s-highest-solid);
  border: 2px solid var(--outline);
  position: relative;
  transition: background 180ms var(--ease-m3), border-color 180ms var(--ease-m3);
}
.pm-switch-track::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 5px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--outline);
  transform: translateY(-50%);
  transition: transform 200ms var(--ease-spring), width 160ms ease, height 160ms ease, background 160ms ease;
}
.pm-switch input:checked + .pm-switch-track {
  background: var(--primary);
  border-color: var(--primary);
}
.pm-switch input:checked + .pm-switch-track::after {
  width: 22px;
  height: 22px;
  background: var(--on-primary);
  transform: translate(20px, -50%);
}

/* --------------------------------------------------------------------------
   7. M3 EXPRESSIVE GROUPED TRACK LIST (.pm-track-group, .pm-track-row)
   24px outer / 6px inner radii, 2px gap, active EQ bars, offline & multi-select
   -------------------------------------------------------------------------- */
.pm-track-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
  min-width: 0;
}
.pm-track-group.is-virtual {
  gap: 0;
}
.pm-vrows {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
  min-width: 0;
}
.pm-vspacer {
  flex: none;
  width: 100%;
  pointer-events: none;
}

.pm-track-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 10px 9px 10px;
  background: var(--s-container);
  border: 1px solid var(--card-border);
  border-radius: var(--r-xs);
  min-width: 0;
  position: relative;
  cursor: pointer;
  transition: background 160ms ease, transform 120ms var(--ease-m3), border-radius 160ms ease;
}
.pm-track-group:not(.is-virtual) .pm-track-row:first-child,
.pm-track-row.is-first { border-radius: var(--r-xl) var(--r-xl) var(--r-xs) var(--r-xs); }
.pm-track-group:not(.is-virtual) .pm-track-row:last-child,
.pm-track-row.is-last { border-radius: var(--r-xs) var(--r-xs) var(--r-xl) var(--r-xl); }
.pm-track-group:not(.is-virtual) .pm-track-row:only-child,
.pm-track-row.is-only { border-radius: var(--r-xl); }

.pm-track-row:active { transform: scale(0.985); }
.pm-track-row.playing,
.pm-track-row.is-playing { background: var(--secondary-c); }
.pm-track-row.selected,
.pm-track-row.is-selected { background: var(--tertiary-c); }
.pm-track-row.dragging {
  opacity: 0.92;
  transform: scale(1.02);
  box-shadow: var(--shadow-md);
  z-index: 5;
  border-radius: var(--r-lg);
}
.pm-track-row.drop-above::before,
.pm-track-row.drop-below::after {
  content: '';
  position: absolute;
  left: 14px;
  right: 14px;
  height: 3px;
  border-radius: 2px;
  background: var(--primary);
}
.pm-track-row.drop-above::before { top: -2px; }
.pm-track-row.drop-below::after { bottom: -2px; }

.pm-track-art-wrap,
.pm-cover.pm-track-art {
  position: relative;
  width: 50px;
  height: 50px;
  border-radius: 14px;
  overflow: hidden;
  flex: none;
  background: var(--s-high);
}
img.pm-track-art {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.pm-track-art-fallback {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  background: var(--primary-c);
  color: var(--on-primary-c);
}

.pm-track-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.46);
  color: #FFFFFF;
}
.pm-track-row.selected .pm-track-overlay,
.pm-track-row.is-selected .pm-track-overlay,
.pm-track-overlay.is-sel {
  background: color-mix(in srgb, var(--tertiary) 62%, transparent);
  color: var(--on-tertiary);
}

/* Animated 3-bar Now Playing EQ (Android _NowPlayingBars: 3.2px, 2.5px gap, 0.85s) */
.pm-eq-bars {
  display: inline-flex;
  align-items: flex-end;
  justify-content: center;
  gap: 2.5px;
  height: 16px;
}
.pm-eq-bars i {
  display: block;
  width: 3.2px;
  height: 14px;
  border-radius: 2px;
  background: #FFFFFF;
  transform-origin: bottom center;
  animation: pm-eq-bounce 0.85s ease-in-out infinite;
}
.pm-eq-bars i:nth-child(1) { animation-delay: 0s; }
.pm-eq-bars i:nth-child(2) { animation-delay: -0.28s; }
.pm-eq-bars i:nth-child(3) { animation-delay: -0.56s; }
.pm-eq-bars.paused i,
.pm-track-row.is-paused .pm-eq-bars i { animation-play-state: paused; transform: scaleY(0.35); }
.pm-eq-bars.primary i,
.pm-track-num .pm-eq-bars i { background: var(--primary); }
@keyframes pm-eq-bounce {
  0%, 100% { transform: scaleY(0.28); }
  50% { transform: scaleY(1); }
}

.pm-track-num {
  width: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--on-surface-var);
  font-variant-numeric: tabular-nums;
  flex: none;
}
.pm-track-row.playing .pm-track-num,
.pm-track-row.is-playing .pm-track-num { color: var(--primary); }
.pm-sel-ic { color: var(--primary); font-size: 20px !important; }

.pm-track-info,
.pm-track-meta {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.pm-track-title {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.25;
  color: var(--on-surface);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pm-track-row.playing .pm-track-title,
.pm-track-row.is-playing .pm-track-title {
  color: var(--primary);
  font-weight: 800;
}
.pm-track-sub {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  line-height: 1.25;
  color: var(--on-surface-var);
  min-width: 0;
}
.pm-track-sub-txt {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.pm-track-offline,
.pm-track-offline-ic {
  color: var(--primary);
  font-size: 15px !important;
  flex: none;
}
.pm-track-trail {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: none;
}
.pm-track-like.is-liked { color: var(--primary); }
.pm-track-dur {
  font-size: 12px;
  font-weight: 600;
  color: var(--outline);
  font-variant-numeric: tabular-nums;
  flex: none;
  padding: 0 4px;
}
.pm-track-check {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid var(--outline);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  color: transparent;
  transition: background 140ms ease, border-color 140ms ease;
}
.pm-track-row.selected .pm-track-check,
.pm-track-row.is-selected .pm-track-check {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--on-primary);
}
.pm-track-check .mi { font-size: 16px; }
.pm-track-drag,
.pm-drag-handle {
  color: var(--outline);
  width: 32px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  touch-action: none;
  cursor: grab;
  flex: none;
}
.pm-track-more {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--on-surface-var);
  flex: none;
}
.pm-track-more:active { background: color-mix(in srgb, var(--on-surface) 12%, transparent); }

/* --------------------------------------------------------------------------
   8. BOTTOM NAVIGATION BAR (#pmNav — M3 Expressive 64x32 r=16 pill)
   -------------------------------------------------------------------------- */
#pmNav,
.pm-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  display: flex;
  align-items: stretch;
  justify-content: space-around;
  height: calc(var(--nav-h) + var(--safe-bottom));
  padding: 8px calc(8px + var(--safe-right)) calc(8px + var(--safe-bottom)) calc(8px + var(--safe-left));
  background: var(--nav-bg);
  border-top: 1px solid var(--card-border);
}

.pm-nav-item {
  flex: 1 1 0;
  max-width: 148px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: var(--on-surface-var);
  min-width: 0;
  transition: color 180ms ease;
}
.pm-nav-item:active .pm-nav-pill { transform: scale(0.92); }

.pm-nav-pill {
  width: 64px;
  height: 32px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: var(--on-surface-var);
  transition: background 220ms var(--ease-spring), color 180ms ease, transform 150ms var(--ease-m3);
}
.pm-nav-item.active .pm-nav-pill {
  background: var(--primary);
  color: var(--on-primary);
}
.pm-nav-item.active .pm-nav-pill .mi {
  font-variation-settings: 'FILL' 1, 'wght' 500, 'GRAD' 0, 'opsz' 24;
}
.pm-nav-label {
  font-size: 12px;
  font-weight: 700;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.pm-nav-item.active .pm-nav-label {
  color: var(--on-surface);
}

/* --------------------------------------------------------------------------
   9. MINI-PLAYER (#pmMiniPlayer — docked frosted pill above #pmNav)
   -------------------------------------------------------------------------- */
#pmMiniPlayer,
.pm-mini-player {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(var(--nav-h) + var(--safe-bottom) + 8px);
  z-index: 32;
  width: calc(100% - 20px - var(--safe-left) - var(--safe-right));
  max-width: calc(var(--max-w) - 20px);
  background: var(--s-highest);
  border: 1px solid var(--card-border);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-md);
  overflow: visible;
  transition: transform 220ms var(--ease-spring), opacity 180ms ease;
}
.pm-mini-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 8px 8px 8px;
  min-width: 0;
  cursor: pointer;
}

/* Top hairline scrubber (2.5px -> 5px while scrubbing + floating time pill) */
.pm-mini-scrub {
  position: absolute;
  top: -6px;
  left: 18px;
  right: 18px;
  height: 16px;
  display: flex;
  align-items: center;
  cursor: pointer;
  touch-action: none;
}
.pm-mini-scrub-track {
  width: 100%;
  height: 2.5px;
  border-radius: 99px;
  background: color-mix(in srgb, var(--on-surface) 12%, transparent);
  overflow: hidden;
  transition: height 120ms ease;
}
.pm-mini-scrub.scrubbing .pm-mini-scrub-track { height: 5px; }
.pm-mini-scrub-fill {
  height: 100%;
  width: var(--progress, 0%);
  background: var(--primary);
  border-radius: 99px;
}
.pm-mini-scrub-tip {
  position: absolute;
  bottom: calc(100% + 4px);
  left: var(--progress, 0%);
  transform: translateX(-50%);
  min-width: 48px;
  padding: 3px 8px;
  border-radius: var(--r-pill);
  background: var(--primary);
  color: var(--on-primary);
  font-size: 11px;
  font-weight: 800;
  text-align: center;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
  opacity: 0;
  transition: opacity 120ms ease;
}
.pm-mini-scrub.scrubbing .pm-mini-scrub-tip { opacity: 1; }

.pm-mini-art {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  object-fit: cover;
  flex: none;
  background: var(--s-container);
}
.pm-mini-meta {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.pm-mini-title {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.25;
  color: var(--on-surface);
}
.pm-mini-artist {
  font-size: 12.5px;
  line-height: 1.2;
  color: var(--on-surface-var);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pm-mini-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: none;
}

/* Morphing Play/Pause FAB (paused 50% circle <-> playing 30% squircle) */
.pm-play-fab {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--on-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  transition: border-radius 240ms var(--ease-m3), transform 130ms var(--ease-m3), box-shadow 240ms ease;
}
.pm-play-fab:active { transform: scale(0.92); }
.pm-play-fab.playing { border-radius: 30%; }
.pm-play-fab.sm { width: 42px; height: 42px; }
.pm-play-fab.sm .mi { font-size: 24px; }
.pm-play-fab.lg {
  width: 72px;
  height: 72px;
  box-shadow: 0 10px 28px color-mix(in srgb, var(--primary) 42%, transparent);
}
.pm-play-fab.lg.playing { border-radius: 24px; }
.pm-play-fab.lg .mi { font-size: 36px; }

/* --------------------------------------------------------------------------
   10. FULL-SCREEN PLAYER (#pmFullPlayer)
   -------------------------------------------------------------------------- */
#pmFullPlayer,
.pm-full-player {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  flex-direction: column;
  background: var(--surface-solid);
  overflow: hidden;
  transform: translateY(var(--drag-y, 0px)) scale(var(--drag-scale, 1));
  border-radius: var(--drag-radius, 0px);
  transition: transform 340ms var(--ease-spring), opacity 260ms ease, border-radius 240ms ease;
  will-change: transform, opacity;
}
.pm-full-player.opening {
  animation: pm-fp-open 420ms var(--ease-spring);
}
.pm-full-player.closing {
  animation: pm-fp-close 280ms var(--ease-m3) forwards;
}
.pm-full-player.dragging {
  transition: none !important;
}
@keyframes pm-fp-open {
  from { opacity: 0; transform: translateY(6vh) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes pm-fp-close {
  to { opacity: 0; transform: translateY(10vh) scale(0.96); }
}

/* Adaptive player backdrop (blurred track art + cover radial glow + scrim) */
.pm-fp-backdrop {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  background: var(--surface-solid);
}
.pm-fp-art-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.25);
  filter: blur(56px) saturate(1.3);
  opacity: 0.48;
  transition: opacity 420ms ease;
}
.pm-fp-glow {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(130% 90% at 50% 24%, color-mix(in srgb, var(--fp-accent, var(--primary)) 44%, transparent) 0%, color-mix(in srgb, var(--fp-accent, var(--primary)) 16%, transparent) 48%, transparent 100%),
    radial-gradient(100% 80% at 88% 18%, color-mix(in srgb, var(--tertiary) 22%, transparent) 0%, transparent 100%);
  transition: opacity 420ms ease;
}
.pm-fp-scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    color-mix(in srgb, var(--surface-solid) 12%, transparent) 0%,
    color-mix(in srgb, var(--surface-solid) 48%, transparent) 52%,
    var(--surface-solid) 94%
  );
}

.pm-fp-content {
  position: relative;
  z-index: 1;
  flex: 1 1 0;
  min-height: 0;
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  padding:
    calc(var(--safe-top) + 8px)
    calc(var(--player-gutter) + var(--safe-right))
    calc(var(--safe-bottom) + 14px)
    calc(var(--player-gutter) + var(--safe-left));
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
}
.pm-fp-content::-webkit-scrollbar { display: none; }

.pm-fp-handle {
  width: 36px;
  height: 4px;
  border-radius: 99px;
  background: color-mix(in srgb, var(--on-surface) 28%, transparent);
  margin: 2px auto 8px;
  flex: none;
}

.pm-fp-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
  flex: none;
}
.pm-fp-top-center {
  flex: 1;
  min-width: 0;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--on-surface-var);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.pm-fp-top-right {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Cover stage */
.pm-fp-stage {
  position: relative;
  width: 100%;
  max-width: 356px;
  aspect-ratio: 1;
  margin: 4px auto 18px;
  flex: none;
  touch-action: pan-y;
}
.pm-fp-cover-wrap {
  width: 100%;
  height: 100%;
  border-radius: clamp(20px, 8vw, 36px);
  overflow: hidden;
  background: var(--s-container-solid);
  box-shadow: 0 20px 54px rgba(0, 0, 0, 0.48), 0 6px 24px color-mix(in srgb, var(--fp-accent, var(--primary)) 26%, transparent);
  transform: translateX(var(--swipe-x, 0px)) scale(0.94);
  transition: transform 320ms var(--ease-spring), box-shadow 320ms ease;
}
.pm-fp-cover-wrap.playing {
  transform: translateX(var(--swipe-x, 0px)) scale(1);
}
.pm-fp-cover-wrap.swiping { transition: none; }
.pm-fp-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 260ms ease;
}
.pm-fp-fast-pill {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  padding: 5px 12px;
  border-radius: var(--r-pill);
  background: rgba(0, 0, 0, 0.65);
  color: #FFFFFF;
  font-size: 12px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  pointer-events: none;
}

/* Title & Like Row */
.pm-fp-meta-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}
.pm-fp-titles {
  flex: 1 1 0;
  min-width: 0;
}
.pm-fp-title {
  font-size: 22px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.3px;
  color: var(--on-surface);
  cursor: pointer;
}
.pm-fp-artist {
  font-size: 15px;
  font-weight: 600;
  color: var(--on-surface-var);
  margin-top: 3px;
  cursor: pointer;
}
.pm-like-btn {
  color: var(--on-surface-var);
}
.pm-like-btn.liked {
  color: var(--primary);
  animation: pm-heart-pop 460ms var(--ease-spring);
}
.pm-like-btn.liked .mi {
  font-variation-settings: 'FILL' 1, 'wght' 500, 'GRAD' 0, 'opsz' 24;
}
@keyframes pm-heart-pop {
  0% { transform: scale(1); }
  35% { transform: scale(1.34); }
  70% { transform: scale(0.92); }
  100% { transform: scale(1); }
}

/* Wavy Canvas Scrubber + Snippet Heatmap */
.pm-fp-scrubber {
  width: 100%;
  margin-bottom: 14px;
}
.pm-wave-scrub-wrap {
  position: relative;
  width: 100%;
  height: 36px;
  display: flex;
  align-items: center;
  touch-action: none;
  cursor: pointer;
}
.pm-wave-canvas {
  width: 100%;
  height: 32px;
  display: block;
}
.pm-snippet-bar {
  position: relative;
  width: 100%;
  height: 10px;
  margin-top: 2px;
  display: flex;
  align-items: flex-end;
  gap: 1.5px;
  opacity: 0.72;
}
.pm-snippet-bin {
  flex: 1;
  min-height: 2px;
  border-radius: 2px;
  background: color-mix(in srgb, var(--on-surface) 22%, transparent);
}
.pm-snippet-bin.hot { background: var(--primary); }

.pm-fp-times {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 4px;
  font-size: 12px;
  font-weight: 700;
  color: var(--on-surface-var);
  font-variant-numeric: tabular-nums;
}
.pm-snippet-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: var(--r-pill);
  background: var(--s-high);
  border: 1px solid var(--card-border);
  color: var(--on-surface-var);
  font-size: 11.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  transition: background 180ms ease, border-color 180ms ease, color 180ms ease;
}
.pm-snippet-pill.in-snippet {
  background: color-mix(in srgb, var(--primary) 18%, transparent);
  border-color: color-mix(in srgb, var(--primary) 40%, transparent);
  color: var(--primary);
}
.pm-snippet-pill .mi { font-size: 15px; }

/* Transport Row */
.pm-fp-transport {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 6px 0 14px;
}
.pm-fp-skip-btn {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--s-high);
  color: var(--on-surface);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 130ms ease, background 150ms ease;
}
.pm-fp-skip-btn:active { transform: scale(0.92); }
.pm-fp-skip-btn .mi { font-size: 30px; }

/* Secondary Action Row (Repeat, Speed, EQ, Sleep, AOD, Devices, Share) */
.pm-fp-actions {
  display: flex;
  align-items: center;
  justify-content: space-around;
  gap: 6px;
  padding: 6px 0 12px;
}
.pm-fp-act-btn {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 6px 8px;
  border-radius: 14px;
  color: var(--on-surface-var);
  font-size: 11px;
  font-weight: 700;
  min-width: 48px;
}
.pm-fp-act-btn.active { color: var(--primary); }
.pm-fp-act-btn .mi { font-size: 21px; }

/* Player 3-Tab Drawer (Queue / Lyrics / Similar) */
.pm-fp-drawer {
  margin-top: 8px;
  padding-top: 10px;
  border-top: 1px solid color-mix(in srgb, var(--outline-var-solid) 35%, transparent);
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 220px;
}
.pm-fp-tab-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 180px;
}

/* Synced LRC Lyrics */
.pm-lyrics-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}
.pm-lyrics-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: var(--r-pill);
  background: var(--s-high);
  color: var(--on-surface-var);
  font-size: 11.5px;
  font-weight: 700;
}
.pm-lyrics-offset {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px;
  border-radius: var(--r-pill);
  background: var(--s-high);
}
.pm-lyrics-offset button {
  padding: 4px 8px;
  border-radius: var(--r-pill);
  font-size: 11.5px;
  font-weight: 700;
  color: var(--on-surface-var);
  font-variant-numeric: tabular-nums;
}
.pm-lyrics-offset button.active {
  background: var(--primary-c);
  color: var(--on-primary-c);
}

.pm-lyrics-scroll {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 46dvh;
  overflow-y: auto;
  padding: 16px 4px 36px;
  scrollbar-width: none;
}
.pm-lyrics-scroll::-webkit-scrollbar { display: none; }

.pm-lyric-line {
  font-size: 20px;
  line-height: 1.35;
  font-weight: 700;
  color: color-mix(in srgb, var(--on-surface) 44%, transparent);
  transform-origin: left center;
  transition: color 240ms ease, transform 260ms var(--ease-spring), padding-left 240ms var(--ease-spring), filter 260ms ease, opacity 240ms ease;
  cursor: pointer;
}
.pm-lyric-line.passed {
  color: color-mix(in srgb, var(--on-surface) 28%, transparent);
}
.pm-lyric-line.distant {
  filter: blur(0.8px);
  opacity: 0.72;
}
.pm-lyric-line.active {
  color: var(--on-surface);
  transform: scale(1.03);
  padding-left: 8px;
  filter: none;
  opacity: 1;
}
.pm-lyric-dual {
  display: block;
  margin-top: 3px;
  font-size: 0.82em;
  font-weight: 600;
  opacity: 0.76;
}
.pm-lyrics-plain {
  white-space: pre-wrap;
  font-size: 16px;
  line-height: 1.65;
  color: var(--on-surface);
  user-select: text;
  -webkit-user-select: text;
}

/* 5-Band / 7-Band Vertical Equalizer (Universal + Per-Track) */
.pm-eq-scope {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  border-radius: 16px;
  background: var(--s-container-solid);
  border: 1px solid color-mix(in srgb, var(--outline-var) 35%, transparent);
  margin-bottom: 10px;
}
.pm-eq-scope-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  padding: 0 8px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--on-surface-var);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease, border-color 160ms ease;
}
.pm-eq-scope-btn.active {
  background: color-mix(in srgb, var(--primary-c-solid) 86%, transparent);
  border-color: color-mix(in srgb, var(--primary) 42%, transparent);
  color: var(--on-primary-c);
  font-weight: 800;
}
.pm-eq-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary);
  flex: none;
  display: inline-block;
}
.pm-eq-ctx-host:not(:empty) {
  margin-bottom: 10px;
}
.pm-eq-ctx {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  border-radius: 15px;
  background: var(--s-container-solid);
  border: 1px solid color-mix(in srgb, var(--outline-var) 30%, transparent);
}
.pm-eq-ctx.custom {
  background: color-mix(in srgb, var(--primary-c-solid) 38%, var(--s-container-solid));
  border-color: color-mix(in srgb, var(--primary) 38%, transparent);
}
.pm-eq-ctx-art {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  object-fit: cover;
  flex: none;
}
.pm-eq-ctx-art-ph {
  display: grid;
  place-items: center;
  background: var(--s-highest-solid);
  color: var(--on-surface-var);
}
.pm-eq-ctx-tx {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.pm-eq-ctx-tx strong {
  font-size: 13px;
}
.pm-eq-ctx-tx span {
  font-size: 11.5px;
}
.pm-eq-badge {
  padding: 4px 9px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 700;
  background: var(--s-highest-solid);
  color: var(--on-surface-var);
  white-space: nowrap;
}
.pm-eq-ctx.custom .pm-eq-badge {
  background: color-mix(in srgb, var(--primary) 20%, transparent);
  color: var(--primary);
}
.pm-eq-controls.disabled {
  opacity: 0.45;
  pointer-events: none;
}
.pm-eq-presets {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}
.pm-eq-preset-card {
  display: flex;
  flex-direction: column;
  padding: 10px 10px;
  border-radius: 16px;
  background: var(--s-container-solid);
  border: 1px solid color-mix(in srgb, var(--outline-var) 30%, transparent);
  color: var(--on-surface-var);
  text-align: left;
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease;
}
.pm-eq-preset-card.active {
  background: linear-gradient(135deg, color-mix(in srgb, var(--primary) 24%, var(--s-container-solid)), color-mix(in srgb, var(--primary-c-solid) 55%, var(--s-container-solid)));
  border-color: color-mix(in srgb, var(--primary) 78%, transparent);
  color: var(--on-surface);
}
.pm-eq-preset-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 7px;
}
.pm-eq-preset-ico {
  width: 25px;
  height: 25px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--s-highest-solid);
  color: var(--on-surface-var);
  flex: none;
}
.pm-eq-preset-ico .mi {
  font-size: 15px;
}
.pm-eq-preset-card.active .pm-eq-preset-ico {
  background: color-mix(in srgb, var(--primary) 22%, transparent);
  color: var(--primary);
}
.pm-eq-preset-name {
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
}
.pm-eq-preset-card.active .pm-eq-preset-name {
  font-weight: 800;
}
.pm-eq-preset-sub {
  font-size: 10.5px;
  line-height: 1.2;
  margin-top: 2px;
  color: color-mix(in srgb, var(--on-surface-var) 78%, transparent);
}
.pm-eq-preset-card.active .pm-eq-preset-sub {
  color: color-mix(in srgb, var(--on-surface) 75%, transparent);
}
.pm-eq-console {
  padding: 14px 12px 14px 8px;
  border-radius: 22px;
  background: var(--s-container-solid);
  border: 1px solid color-mix(in srgb, var(--outline-var) 28%, transparent);
}
.pm-eq-grid-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
}
.pm-eq-pills-row,
.pm-eq-hz-row {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 2px;
}
.pm-eq-stage-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  height: 148px;
  margin: 10px 0 8px;
}
.pm-eq-scale {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-end;
  padding: 3px 5px 3px 0;
  font-size: 10.5px;
  font-weight: 600;
  color: color-mix(in srgb, var(--on-surface-var) 74%, transparent);
  font-variant-numeric: tabular-nums;
}
.pm-eq-scale .z {
  color: var(--primary);
  font-weight: 800;
}
.pm-eq-stage {
  position: relative;
  height: 148px;
}
.pm-eq-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: visible;
}
.pm-eq-faders {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  height: 100%;
}
.pm-eq-fader-hit {
  position: relative;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  touch-action: none;
  user-select: none;
}
.pm-eq-fader-track {
  position: relative;
  width: 6px;
  height: calc(100% - 20px);
  border-radius: 999px;
  background: var(--s-highest-solid);
}
.pm-eq-fader-zero {
  position: absolute;
  left: -4px;
  right: -4px;
  top: 50%;
  height: 1px;
  background: color-mix(in srgb, var(--on-surface) 18%, transparent);
  pointer-events: none;
}
.pm-eq-fader-fill {
  position: absolute;
  left: 0;
  right: 0;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--primary), color-mix(in srgb, var(--primary) 70%, #7c4dff));
  pointer-events: none;
}
.pm-eq-fader-thumb {
  position: absolute;
  left: 50%;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #ffffff;
  border: 3px solid var(--primary);
  box-shadow: 0 0 11px color-mix(in srgb, var(--primary) 55%, transparent);
  transform: translate(-50%, -50%);
  pointer-events: none;
}
.pm-eq-db {
  justify-self: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--on-surface-var);
  background: color-mix(in srgb, var(--s-highest-solid) 60%, transparent);
  padding: 2px 6px;
  border-radius: 9px;
  font-variant-numeric: tabular-nums;
  min-width: 34px;
  text-align: center;
}
.pm-eq-db.on {
  color: var(--primary);
  background: color-mix(in srgb, var(--primary) 16%, transparent);
}
.pm-eq-hz {
  text-align: center;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--on-surface-var);
  font-variant-numeric: tabular-nums;
}
.pm-eq-slider-wrap {
  height: 148px;
  width: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pm-eq-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 140px;
  height: 6px;
  border-radius: 99px;
  background: var(--s-highest-solid);
  transform: rotate(-90deg);
  accent-color: var(--primary);
  outline: none;
}
.pm-eq-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--primary);
  border: 3px solid var(--on-primary);
  cursor: pointer;
}
.pm-eq-hz {
  font-size: 11px;
  font-weight: 700;
  color: var(--on-surface-var);
  font-variant-numeric: tabular-nums;
}

/* Sleep Timer Grid */
.pm-sleep-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 12px;
}
.pm-sleep-chip {
  height: 46px;
  border-radius: 16px;
  background: var(--s-container-solid);
  color: var(--on-surface);
  font-size: 14px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.pm-sleep-chip.active {
  background: var(--primary);
  color: var(--on-primary);
}
.pm-sleep-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 18px;
  background: var(--primary-c-solid);
  color: var(--on-primary-c);
  font-size: 13.5px;
  font-weight: 700;
  margin-bottom: 12px;
}

/* --------------------------------------------------------------------------
   11. AUTH SCREEN (#pmAuthScreen)
   -------------------------------------------------------------------------- */
#pmAuthScreen,
.pm-auth-screen {
  position: fixed;
  inset: 0;
  z-index: 50;
  overflow-y: auto;
  background: var(--surface);
  padding:
    calc(var(--safe-top) + 24px)
    calc(var(--gutter) + var(--safe-right))
    calc(var(--safe-bottom) + 32px)
    calc(var(--gutter) + var(--safe-left));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.pm-auth {
  width: 100%;
  max-width: 420px;
  margin: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.pm-auth-top {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}
.pm-auth-lang-btn { margin-left: auto; }
.pm-auth-brand,
.pm-auth-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  margin-bottom: 4px;
}
.pm-auth-title {
  margin: 0;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.6px;
}
.pm-auth-sub {
  margin: 0;
  font-size: 14px;
  color: var(--on-surface-var);
}
.pm-auth-logo {
  width: 68px;
  height: 68px;
  border-radius: 22px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--tertiary) 100%);
  color: var(--on-primary);
  display: grid;
  place-items: center;
  box-shadow: 0 14px 36px color-mix(in srgb, var(--primary) 40%, transparent);
}
.pm-auth-logo-svg {
  width: 42px;
  height: 42px;
  display: block;
}
.pm-auth-card {
  background: var(--s-container);
  border: 1px solid var(--card-border);
  border-radius: var(--r-2xl);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.pm-auth-error {
  padding: 10px 14px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--error) 16%, transparent);
  color: var(--error);
  font-size: 13.5px;
  font-weight: 600;
}
.pm-auth-flow,
.pm-auth-form,
.pm-auth-providers {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.pm-auth-section-title {
  margin: 0;
  font-size: 17px;
  font-weight: 800;
  text-align: center;
}
.pm-auth-hint {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--on-surface-var);
  text-align: center;
}
.pm-auth-code-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--on-surface-var);
  text-align: center;
}
.pm-auth-forgot {
  align-self: flex-end;
  font-size: 13px;
  font-weight: 700;
}
.pm-auth-tg-open { width: 100%; }

.pm-provider-btn {
  width: 100%;
  height: 48px;
  border-radius: var(--r-pill);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 14.5px;
  font-weight: 700;
  transition: transform 130ms ease, filter 160ms ease;
}
.pm-provider-btn:active { transform: scale(0.97); }
.pm-provider-tg { background: #2AABEE; color: #FFFFFF; }
.pm-provider-google { background: #FFFFFF; color: #1F1F1F; }
.pm-provider-qr {
  background: var(--s-high);
  color: var(--on-surface);
  border: 1px solid var(--outline-var);
}

.pm-auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--outline);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}
.pm-auth-divider::before,
.pm-auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--outline-var);
}

/* OTP & QR */
.pm-otp-row {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
}
.pm-otp-box {
  height: 52px;
  border-radius: 14px;
  border: 1.5px solid var(--outline-var-solid);
  background: var(--s-high);
  text-align: center;
  font-size: 22px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  outline: none;
}
.pm-otp-box:focus { border-color: var(--primary); }

.pm-qr-box,
.pm-auth-qr-box {
  width: 216px;
  height: 216px;
  margin: 4px auto;
  padding: 14px;
  border-radius: var(--r-xl);
  background: #FFFFFF;
  display: grid;
  place-items: center;
  box-shadow: var(--shadow-md);
}
.pm-qr-box canvas,
.pm-qr-box img,
.pm-auth-qr-box canvas,
.pm-auth-qr-box img { width: 100%; height: 100%; }

.pm-confirm-code,
.pm-auth-big-code {
  text-align: center;
  font-family: var(--mono);
  font-size: 30px;
  font-weight: 800;
  letter-spacing: 0.24em;
  padding: 12px 16px;
  border-radius: 18px;
  background: var(--primary-c-solid);
  color: var(--on-primary-c);
}

/* Country Flag Picker (46 flags) */
.pm-flag-trigger {
  height: 46px;
  min-width: 48px;
  padding: 0 12px;
  border-radius: 14px;
  background: var(--s-high);
  border: 1.5px solid var(--outline-var-solid);
  font-size: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.pm-flag-search { margin-bottom: 10px; }
.pm-flag-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: 8px;
  max-height: 52dvh;
  overflow-y: auto;
  padding: 4px 0;
}
.pm-flag-chip {
  min-height: 54px;
  padding: 6px 4px;
  border-radius: 14px;
  background: var(--s-container-solid);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-size: 20px;
  line-height: 1;
}
.pm-flag-emoji { font-size: 22px; line-height: 1; }
.pm-flag-chip span,
.pm-flag-name {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--on-surface-var);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pm-flag-chip:active { background: var(--primary-c-solid); }

.pm-install-banner,
.pm-auth-pwa {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--r-xl);
  background: var(--primary-c);
  color: var(--on-primary-c);
}
.pm-auth-pwa-copy {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 13px;
}
.pm-auth-pwa-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: none;
}

/* --------------------------------------------------------------------------
   12. HOME, LIVE SILK-WAVE HERO, STREAK FIRE, WAVE HUB, STATS BENTO & WEEK
   -------------------------------------------------------------------------- */
.pm-section {
  margin-bottom: 24px;
  min-width: 0;
}
.pm-shelf-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}
.pm-hscroll {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 2px 2px 6px;
  margin: 0 -2px;
  scrollbar-width: none;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
}
.pm-hscroll::-webkit-scrollbar { display: none; }

/* Streak Fire Pill (#FFE047 -> #FF7A00 -> #FF2E54) */
.pm-streak-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  border-radius: var(--r-pill);
  background: var(--streak-grad);
  color: #1A0A04;
  font-size: 12.5px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 4px 16px rgba(255, 102, 24, 0.36);
  flex: none;
}
.pm-streak-pill.compact { padding: 3px 9px; font-size: 11.5px; }
.pm-streak-pill.cold {
  background: var(--s-high);
  color: var(--on-surface-var);
  box-shadow: none;
}
.pm-streak-pill svg {
  display: block;
  flex: none;
}

/* Live Silk-Wave Canvas Hero Card (r=28) */
.pm-wave-hero {
  position: relative;
  border-radius: var(--r-2xl);
  overflow: hidden;
  min-height: 192px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
  background: linear-gradient(135deg, var(--primary-c-solid) 0%, color-mix(in srgb, var(--tertiary-c-solid) 75%, var(--surface-solid)) 100%);
  border: 1px solid var(--card-border);
  box-shadow: var(--shadow-md);
}
.pm-wave-canvas-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}
.pm-wave-hero-top,
.pm-wave-hero-bottom {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.pm-wave-hero-title {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.6px;
  line-height: 1.1;
  color: var(--on-primary-c);
}
.pm-wave-hero-sub {
  font-size: 13px;
  font-weight: 600;
  color: color-mix(in srgb, var(--on-primary-c) 80%, transparent);
  margin-top: 4px;
}
.pm-wave-play-btn {
  height: 48px;
  padding: 0 22px;
  border-radius: var(--r-pill);
  background: var(--on-primary-c);
  color: var(--primary-c-solid);
  font-size: 15px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.25);
}
.pm-wave-tune-btn {
  height: 44px;
  padding: 0 14px;
  border-radius: var(--r-pill);
  background: rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #FFFFFF;
  font-size: 13px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* Home Hero M3 Weighted Carousel (Android main.dart:2112-2190) */
.pm-hero-carousel {
  display: flex;
  align-items: stretch;
  gap: 10px;
  height: 224px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: var(--gutter);
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 0 var(--gutter);
  margin: 0 calc(var(--gutter) * -1) 4px;
}
.pm-hero-carousel::-webkit-scrollbar { display: none; }
.pm-hero-card,
.pm-hero-carousel > .pm-wave-carousel-card,
.pm-hero-carousel > button,
.pm-hero-carousel > div {
  position: relative;
  flex: 0 0 74%;
  max-width: 340px;
  height: 100%;
  border-radius: var(--r-2xl);
  overflow: hidden;
  background: var(--s-high);
  border: 0;
  padding: 0;
  text-align: left;
  cursor: pointer;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  transition: transform 160ms var(--ease-m3);
}
.pm-hero-card:active,
.pm-hero-carousel > .pm-wave-carousel-card:active {
  transform: scale(0.985);
}
.pm-hero-card > img,
.pm-hero-card-art,
.pm-hero-carousel .pm-wave-carousel-card > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.pm-hero-scrim,
.pm-hero-card-scrim,
.pm-hero-carousel .pm-wave-carousel-scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    transparent 32%,
    rgba(0, 0, 0, 0.42) 66%,
    rgba(0, 0, 0, 0.86) 100%
  );
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 2px;
  padding: 16px;
  pointer-events: none;
}
.pm-hero-card:has(.pm-hero-play, .pm-hero-card-play) .pm-hero-scrim,
.pm-hero-card:has(.pm-hero-play, .pm-hero-card-play) .pm-hero-card-scrim {
  padding-right: 60px;
}
.pm-hero-kicker {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.8);
  line-height: 1.2;
}
.pm-hero-title {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.3px;
  line-height: 1.18;
  color: #FFFFFF;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pm-hero-artist,
.pm-hero-sub {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.25;
  color: rgba(255, 255, 255, 0.78);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pm-hero-play,
.pm-hero-card-play {
  position: absolute;
  right: 12px;
  bottom: 12px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--on-primary);
  display: grid;
  place-items: center;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.38);
  z-index: 2;
  pointer-events: auto;
}
.pm-hero-play .mi,
.pm-hero-card-play .mi {
  font-size: 22px;
}

/* Wave Carousel (Android M3 weighted look) */
.pm-wave-carousel-card {
  position: relative;
  flex: none;
  width: 220px;
  height: 176px;
  border-radius: var(--r-xl);
  overflow: hidden;
  background: var(--s-high);
  scroll-snap-align: start;
}
.pm-wave-carousel-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.pm-wave-carousel-scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.84) 0%, rgba(0, 0, 0, 0.2) 55%, transparent 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 14px;
}

/* Favorites Shelf (alternating r=24 even / r=50% odd — exact Android FavoritesShelf!) */
.pm-fav-card {
  flex: none;
  width: 142px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  scroll-snap-align: start;
}
.pm-fav-card-art,
.pm-fav-art {
  width: 142px;
  height: 142px;
  border-radius: var(--r-xl);
  overflow: hidden;
  background: var(--s-high);
  position: relative;
}
.pm-fav-card:nth-child(even) .pm-fav-card-art,
.pm-fav-card:nth-child(even) .pm-fav-art,
.pm-fav-card.is-circle .pm-fav-card-art,
.pm-fav-card.is-circle .pm-fav-art,
.pm-fav-card-art.is-circle,
.pm-fav-art.is-circle {
  border-radius: 50%;
}
.pm-fav-card-art img,
.pm-fav-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.pm-fav-card-title { font-size: 13.5px; font-weight: 700; color: var(--on-surface); }
.pm-fav-card-sub { font-size: 12px; color: var(--on-surface-var); margin-top: -5px; }

/* Blend Shelf («Общая волна» 72px friend circles) */
.pm-blend-item {
  flex: none;
  width: 74px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
}
.pm-blend-av {
  position: relative;
  width: 64px;
  height: 64px;
}
.pm-blend-av img,
.pm-blend-av .pm-av-fallback {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
}
.pm-blend-badge {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--on-primary);
  border: 2px solid var(--surface-solid);
  display: grid;
  place-items: center;
}
.pm-blend-badge .mi { font-size: 14px; }

/* Wave Hub «Собрано для тебя» Cards (clean Android 2x2 collage — wave_collection_page.dart:115-180) */
.pm-mix-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.pm-mix-card {
  flex: none;
  width: 148px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  scroll-snap-align: start;
}
.pm-mix-grid .pm-mix-card { width: 100%; }
.pm-mix-cover {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  border-radius: 22px;
  overflow: hidden;
  background: linear-gradient(
    135deg,
    var(--s-highest-solid) 0%,
    color-mix(in srgb, var(--primary) 24%, var(--s-highest-solid)) 100%
  );
  color: var(--on-surface-var);
  display: grid;
  place-items: center;
}
.pm-mix-cover > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.pm-mix-cover > .mi {
  font-size: 38px;
  color: var(--on-surface-var);
}
.pm-mix-collage,
.pm-mix-cover .pm-mosaic {
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: 1.5px;
  background: var(--surface-solid);
}
.pm-mix-collage img,
.pm-mix-cover .pm-mosaic img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.pm-mix-play {
  position: absolute;
  right: 8px;
  bottom: 8px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--surface-solid) 82%, transparent);
  backdrop-filter: blur(8px);
  color: var(--on-surface);
  display: grid;
  place-items: center;
}
.pm-mix-play .mi { font-size: 20px; }
.pm-mix-badge { display: none; }
.pm-mix-title { font-size: 14px; font-weight: 700; color: var(--on-surface); }
.pm-mix-sub { font-size: 12px; color: var(--on-surface-var); margin-top: -4px; }

/* Artists For You Shelf (88px circles + 28px play button) */
.pm-artist-card {
  flex: none;
  width: 96px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
}
.pm-artist-card-av {
  position: relative;
  width: 88px;
  height: 88px;
}
.pm-artist-card-av img,
.pm-artist-card-av .pm-av-fallback {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  object-fit: cover;
}
.pm-artist-card-play {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--on-primary);
  border: 2px solid var(--surface-solid);
  display: grid;
  place-items: center;
}
.pm-artist-card-play .mi { font-size: 16px; }

/* Wave Settings Radio Rows & Lock Badge */
.pm-radio-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.pm-radio-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  border-radius: 18px;
  background: var(--s-container-solid);
  color: var(--on-surface);
  transition: background 150ms ease;
}
.pm-radio-row.active {
  background: var(--primary-c-solid);
  color: var(--on-primary-c);
}
.pm-radio-row.locked { opacity: 0.62; }
.pm-radio-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--outline);
  display: grid;
  place-items: center;
  flex: none;
}
.pm-radio-row.active .pm-radio-dot {
  border-color: var(--primary);
  background: var(--primary);
  color: var(--on-primary);
}
.pm-lock-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: var(--r-pill);
  background: var(--s-highest-solid);
  color: var(--on-surface-var);
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* Stats Bento 5-Tile Grid (.pm-stats-grid — Android stats_tiles.dart) */
.pm-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: 112px;
  grid-auto-flow: dense;
  gap: 10px;
}
.pm-stat-tile {
  position: relative;
  border-radius: 26px;
  background: var(--s-container);
  border: 1px solid var(--card-border);
  padding: 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  min-width: 0;
  cursor: pointer;
  transition: transform 160ms var(--ease-m3), border-color 160ms ease;
}
.pm-stat-tile.size-s { grid-column: span 1; grid-row: span 1; }
.pm-stat-tile.size-w { grid-column: span 2; grid-row: span 1; }
.pm-stat-tile.size-l { grid-column: span 2; grid-row: span 2; }

.pm-stats-grid.editing .pm-stat-tile {
  border: 1.5px solid var(--outline);
  animation: pm-wiggle 260ms ease-in-out infinite alternate;
}
.pm-stats-grid.editing .pm-stat-tile:nth-child(even) {
  animation-delay: -130ms;
}
@keyframes pm-wiggle {
  from { transform: rotate(-1.1deg); }
  to { transform: rotate(1.1deg); }
}

.pm-stat-size-pill {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 3;
  padding: 3px 8px;
  border-radius: var(--r-pill);
  background: var(--primary);
  color: var(--on-primary);
  font-size: 10.5px;
  font-weight: 800;
}
.pm-stat-val {
  font-size: 26px;
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.5px;
  font-variant-numeric: tabular-nums;
}
.pm-stat-lbl {
  font-size: 12px;
  font-weight: 700;
  color: var(--on-surface-var);
}

/* Spinning Splatter Vinyl + Animated Tonearm (5s/rev, 34.5% label, 900ms tonearm) */
.pm-vinyl-wrap {
  position: relative;
  width: 92px;
  height: 92px;
  flex: none;
}
.pm-stat-tile.size-l .pm-vinyl-wrap { width: 136px; height: 136px; }
.pm-vinyl-disc {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background:
    repeating-radial-gradient(circle at center, #141418 0 2px, #1D1D24 2px 4px),
    radial-gradient(circle at 30% 30%, color-mix(in srgb, var(--primary) 34%, transparent), transparent 60%);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.08), 0 8px 20px rgba(0, 0, 0, 0.45);
  animation: pm-vinyl-spin 5s linear infinite;
  animation-play-state: paused;
}
.pm-vinyl-disc.spinning { animation-play-state: running; }
@keyframes pm-vinyl-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
.pm-vinyl-label {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 34.5%;
  height: 34.5%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  overflow: hidden;
  background: var(--primary);
  box-shadow: 0 0 0 2px #111;
}
.pm-vinyl-label img { width: 100%; height: 100%; object-fit: cover; }
.pm-vinyl-spindle {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 7px;
  height: 7px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: #EAEAEF;
  box-shadow: 0 0 0 2px #111;
  z-index: 2;
}
.pm-vinyl-sheen {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  pointer-events: none;
  background: conic-gradient(from 30deg, transparent 0deg, rgba(255, 255, 255, 0.14) 36deg, transparent 78deg, transparent 180deg, rgba(255, 255, 255, 0.1) 216deg, transparent 260deg);
}
.pm-vinyl-tonearm {
  position: absolute;
  top: -4px;
  right: -6px;
  width: 36%;
  height: 62%;
  transform-origin: 78% 12%;
  transform: rotate(0deg);
  transition: transform 900ms var(--ease-spring);
  pointer-events: none;
  z-index: 3;
}
.pm-vinyl-tonearm.playing { transform: rotate(-18deg); }

/* 9:16 Week in Music Story Card (.pm-week-card) */
.pm-week-card {
  position: relative;
  width: 100%;
  max-width: 380px;
  aspect-ratio: 9 / 16;
  margin: 0 auto;
  border-radius: var(--r-2xl);
  padding: 22px 20px;
  background: var(--s-high-solid);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
  box-shadow: var(--shadow-lg);
}
.pm-week-card::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(95% 65% at 92% 6%, color-mix(in srgb, var(--primary) 58%, transparent) 0%, transparent 72%),
    radial-gradient(90% 60% at 6% 94%, color-mix(in srgb, var(--tertiary) 48%, transparent) 0%, transparent 72%);
}
.pm-week-card > * { position: relative; z-index: 1; }
.pm-week-hours {
  font-size: 60px;
  font-weight: 800;
  line-height: 0.95;
  letter-spacing: -2px;
  font-variant-numeric: tabular-nums;
}
.pm-week-bars {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  align-items: end;
  gap: 8px;
  height: 64px;
  padding-top: 8px;
}
.pm-week-bar-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  height: 100%;
  justify-content: flex-end;
}
.pm-week-bar {
  width: 100%;
  min-height: 4px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.28);
}
.pm-week-bar.peak { background: rgba(255, 255, 255, 0.92); }
.pm-week-day {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--on-surface-var);
}
.pm-week-artist-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--r-lg);
  background: rgba(0, 0, 0, 0.26);
}
.pm-week-artist-card img {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
}
.pm-week-watermark {
  text-align: center;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  opacity: 0.7;
}

/* --------------------------------------------------------------------------
   13. LIBRARY, PLAYLISTS GRID/LIST, MOSAIC, ARTIST/ALBUM HERO & IMPORT
   -------------------------------------------------------------------------- */
/* 3-Card Library Stats Strip */
.pm-stats-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}
.pm-stat-card {
  background: var(--s-container);
  border: 1px solid var(--card-border);
  border-radius: var(--r-xl);
  padding: 12px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  cursor: pointer;
}
.pm-stat-card.accent {
  background: var(--tertiary-c);
  color: var(--on-tertiary-c);
}
.pm-stat-card-val {
  font-size: 17px;
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-variant-numeric: tabular-nums;
}
.pm-stat-card-lbl {
  font-size: 11.5px;
  font-weight: 600;
  opacity: 0.78;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Playlists 2/3/4-Col Grid (r=28 1:1 covers) */
.pm-pl-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.pm-pl-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  cursor: pointer;
  transition: transform 150ms var(--ease-m3), opacity 150ms ease;
}
.pm-pl-card:active { transform: scale(0.97); }
.pm-pl-card.ghost { transform: scale(1.06); z-index: 10; }
.pm-pl-card.placeholder { opacity: 0.25; }

.pm-pl-cover {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  border-radius: var(--r-2xl);
  overflow: hidden;
  background: var(--primary-c);
  display: grid;
  place-items: center;
}
.pm-pl-cover img { width: 100%; height: 100%; object-fit: cover; }

.pm-pl-badge-pin,
.pm-pl-badge-offline {
  position: absolute;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--surface-solid) 86%, transparent);
  backdrop-filter: blur(8px);
  display: grid;
  place-items: center;
}
.pm-pl-badge-pin { top: 8px; right: 8px; color: var(--on-surface); }
.pm-pl-badge-offline { bottom: 8px; right: 8px; color: var(--primary); }
.pm-pl-badge-pin .mi,
.pm-pl-badge-offline .mi { font-size: 16px; }

.pm-pl-title { font-size: 14.5px; font-weight: 700; color: var(--on-surface); }
.pm-pl-sub { font-size: 12px; color: var(--on-surface-var); margin-top: -5px; }

/* Dashed + New Playlist Card */
.pm-pl-new {
  aspect-ratio: 1;
  border-radius: var(--r-2xl);
  border: 2px dashed var(--outline-var-solid);
  background: color-mix(in srgb, var(--s-container) 55%, transparent);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--on-surface-var);
  font-size: 13.5px;
  font-weight: 700;
  text-align: center;
  padding: 12px;
}
.pm-pl-new .mi { font-size: 32px; color: var(--primary); }

/* Playlists List Mode */
.pm-pl-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.pm-pl-list-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 18px;
  background: var(--s-container);
  border: 1px solid var(--card-border);
  cursor: pointer;
}
.pm-pl-list-cover {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  overflow: hidden;
  flex: none;
  background: var(--primary-c);
  display: grid;
  place-items: center;
}

/* 2x2 Mosaic Cover */
.pm-mosaic {
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 1.5px;
  background: var(--surface-solid);
}
.pm-mosaic img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.pm-fav-cover {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--fav-c1, #C4ABFF) 0%, var(--fav-c2, #5835C4) 100%);
  color: var(--fav-fg, #FFFFFF);
  display: grid;
  place-items: center;
}
.pm-fav-cover .mi { font-size: 46%; }

/* Customize Fav / Cover Sheet */
.pm-cust-preview {
  width: 88px;
  height: 88px;
  border-radius: 22px;
  overflow: hidden;
  flex: none;
  box-shadow: var(--shadow-sm);
}
.pm-icon-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.pm-icon-choice {
  height: 48px;
  border-radius: 16px;
  background: var(--s-container-solid);
  color: var(--on-surface-var);
  display: grid;
  place-items: center;
}
.pm-icon-choice.active {
  background: var(--primary-c-solid);
  color: var(--on-primary-c);
  box-shadow: inset 0 0 0 2px var(--primary);
}
.pm-swatch-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.pm-swatch {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 2px solid transparent;
  display: grid;
  place-items: center;
  position: relative;
  flex: none;
  transition: transform 140ms ease;
}
.pm-swatch:active { transform: scale(0.9); }
.pm-swatch.active {
  box-shadow: 0 0 0 2px var(--surface-solid), 0 0 0 4px var(--on-surface);
}
.pm-swatch-pills {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
.pm-swatch-pill {
  height: 44px;
  padding: 0 12px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--s-container-solid);
  font-size: 13px;
  font-weight: 700;
}
.pm-swatch-pill.active { box-shadow: inset 0 0 0 2px var(--primary); }
.pm-swatch-dot {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  flex: none;
}

/* Artist, Album & Collection Hero Pages (ArtistTheme gradient header) */
.pm-hero-header {
  position: relative;
  padding: 16px var(--gutter) 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
  background: linear-gradient(
    to bottom,
    color-mix(in srgb, var(--hero-c, var(--primary-c-solid)) 88%, transparent) 0%,
    transparent 100%
  );
}
.pm-artist-avatar {
  width: 152px;
  height: 152px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: var(--shadow-lg);
  background: var(--s-high);
}
.pm-album-art {
  width: 180px;
  height: 180px;
  border-radius: var(--r-xl);
  object-fit: cover;
  box-shadow: var(--shadow-lg);
  background: var(--s-high);
}
.pm-hero-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  max-width: 420px;
  margin-top: 6px;
}
.pm-hero-actions .pm-btn { flex: 1; }
.pm-follow-btn.following {
  background: transparent;
  color: var(--on-surface);
  border: 1.5px solid var(--outline-var-solid);
}

/* Search Extras: Friends Listening Now, Lyric Hit, Artist Hit */
.pm-friend-now {
  flex: none;
  width: 72px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  text-align: center;
}
.pm-friend-now-av {
  position: relative;
  width: 58px;
  height: 58px;
}
.pm-friend-now-av > img,
.pm-friend-now-av > .pm-av-fallback {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  object-fit: cover;
}
.pm-friend-now-track {
  position: absolute;
  right: -4px;
  bottom: -2px;
  width: 24px;
  height: 24px;
  border-radius: 7px;
  object-fit: cover;
  border: 2px solid var(--surface-solid);
}
.pm-friend-now-eq {
  position: absolute;
  left: -2px;
  bottom: -2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--primary);
  border: 2px solid var(--surface-solid);
  display: grid;
  place-items: center;
}

.pm-lyric-hit-card {
  border-radius: var(--r-lg);
  padding: 14px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--primary-c) 80%, var(--s-container)) 0%, var(--s-container) 100%);
  border: 1px solid color-mix(in srgb, var(--primary) 30%, var(--card-border));
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
}
.pm-lyric-match { color: var(--primary); font-weight: 800; }
.pm-artist-hit {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border-radius: var(--r-2xl);
  background: linear-gradient(135deg, var(--primary-c) 0%, var(--s-container) 100%);
  border: 1px solid var(--card-border);
  margin-bottom: 12px;
}
.pm-artist-hit img {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  object-fit: cover;
  flex: none;
}

/* Search Inline Source Switcher (Android main.dart:2476-2536 _sourceRow) */
.pm-source-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  padding: 0 4px;
  margin: 4px 0 10px;
  min-height: 32px;
}
.pm-source-left {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  align-items: center;
}
.pm-source-title {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.25;
  color: var(--on-surface);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background-color 220ms var(--ease-m3), color 220ms var(--ease-m3), padding 220ms var(--ease-m3), transform 220ms var(--ease-m3);
}
.pm-source-flash,
.pm-source-title.pm-source-flash {
  flex: 0 1 auto;
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 5px 10px;
  border-radius: 12px;
  background: var(--primary-c);
  color: var(--on-primary-c);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  animation: pm-source-flash-in 220ms var(--ease-m3);
}
@keyframes pm-source-flash-in {
  from { opacity: 0.45; transform: scale(0.92); transform-origin: left center; }
  to { opacity: 1; transform: scale(1); transform-origin: left center; }
}
.pm-source-btns {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: none;
}
.pm-source-btn {
  padding: 6px 8px;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.2;
  color: var(--on-surface-var);
  background: transparent;
  border: 0;
  cursor: pointer;
  flex: none;
  white-space: nowrap;
  transition: color 180ms ease, background-color 140ms ease;
}
.pm-source-btn:active {
  background: color-mix(in srgb, var(--on-surface) 8%, transparent);
}
.pm-source-btn.active {
  font-weight: 800;
  color: var(--primary);
}

/* Import Page */
.pm-progress-bar {
  width: 100%;
  height: 8px;
  border-radius: var(--r-pill);
  background: var(--s-highest-solid);
  overflow: hidden;
}
.pm-progress-fill {
  height: 100%;
  width: var(--pct, 0%);
  background: var(--primary);
  border-radius: var(--r-pill);
  transition: width 240ms ease;
}
.pm-accordion {
  border-radius: 18px;
  background: var(--s-container);
  border: 1px solid var(--card-border);
  overflow: hidden;
}
.pm-accordion summary {
  padding: 13px 16px;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.pm-accordion-body {
  padding: 0 16px 14px;
  font-size: 13px;
  color: var(--on-surface-var);
}

/* --------------------------------------------------------------------------
   14. PROFILE, SOCIAL, CROPPER, COLOR PIPETTE & THEME SOURCE
   -------------------------------------------------------------------------- */
.pm-profile-banner-wrap {
  position: relative;
  width: 100%;
}
.pm-profile-banner {
  position: relative;
  width: 100%;
  height: 150px;
  border-radius: 0 0 32px 32px;
  overflow: hidden;
  background: linear-gradient(135deg, var(--primary-c-solid) 0%, var(--tertiary-c-solid) 100%);
}
.pm-profile-banner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.pm-profile-banner img.is-fallback {
  opacity: 0.35;
  filter: none;
}
.pm-profile-banner-edit {
  position: absolute;
  right: 12px;
  bottom: 12px;
  height: 34px;
  padding: 0 12px;
  border-radius: var(--r-pill);
  background: rgba(0, 0, 0, 0.56);
  backdrop-filter: blur(10px);
  color: #FFFFFF;
  font-size: 12.5px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.pm-profile-floating-actions {
  position: sticky;
  top: calc(var(--safe-top) + 8px);
  z-index: 12;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  padding: 8px var(--gutter) 0;
  margin-bottom: -48px;
  pointer-events: none;
}
.pm-profile-floating-actions > * { pointer-events: auto; }
.pm-float-pill {
  height: 36px;
  padding: 0 12px;
  border-radius: var(--r-pill);
  background: color-mix(in srgb, var(--surface-solid) 78%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--on-surface);
  font-size: 13px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.pm-float-pill.primary { background: var(--primary); color: var(--on-primary); }
.pm-float-pill.icon-only { width: 36px; padding: 0; justify-content: center; }

.pm-profile-hero-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  padding: 0 var(--gutter);
  margin-top: -48px;
  position: relative;
  z-index: 2;
}
.pm-avatar-wrap {
  position: relative;
  width: 96px;
  height: 96px;
  flex: none;
}
.pm-avatar,
.pm-av-fallback {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: grid;
  place-items: center;
  background: var(--primary-c-solid);
  color: var(--on-primary-c);
  font-weight: 800;
}
.pm-avatar-wrap .pm-avatar,
.pm-avatar-wrap .pm-av-fallback {
  border: 4px solid var(--surface-solid);
  font-size: 32px;
}
.pm-status-dot {
  position: absolute;
  right: 2px;
  bottom: 2px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 5px solid var(--surface-solid);
  display: grid;
  place-items: center;
}
.pm-status-dot.online {
  width: 26px;
  height: 26px;
  border: 5px solid var(--surface-solid);
  background: var(--ok);
}
.pm-status-dot.listening {
  width: 22px;
  height: 22px;
  border: 4px solid var(--surface-solid);
  background: var(--primary);
  color: var(--on-primary);
}
.pm-status-dot .mi { font-size: 12px; }
.pm-people-av .pm-status-dot.online {
  width: 15px;
  height: 15px;
  border-width: 2.5px;
  right: 0;
  bottom: 0;
}
.pm-people-av .pm-status-dot.listening {
  width: 16px;
  height: 16px;
  border-width: 2px;
  right: -1px;
  bottom: -1px;
}
.pm-people-av .pm-status-dot .mi { font-size: 10px; }
.pm-avatar-edit-btn {
  position: absolute;
  top: 0;
  right: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--on-primary);
  border: 2px solid var(--surface-solid);
  display: grid;
  place-items: center;
}
.pm-avatar-edit-btn .mi { font-size: 16px; }

.pm-profile-counters {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-bottom: 6px;
}
.pm-counter-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  min-width: 56px;
}
.pm-counter-val {
  font-size: 20px;
  font-weight: 800;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.pm-counter-lbl {
  font-size: 12px;
  font-weight: 600;
  color: var(--on-surface-var);
}

.pm-profile-identity {
  padding: 12px var(--gutter) 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.pm-profile-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.pm-profile-name {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.4px;
  line-height: 1.15;
}
.pm-profile-handle-text {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: 4px;
  margin-top: 2px;
  padding: 2px 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--on-surface-var);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.3;
  text-align: left;
  cursor: pointer;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color 140ms ease, opacity 140ms ease;
}
.pm-profile-handle-text:active {
  opacity: 0.72;
  color: var(--primary);
}
/* Exact Android Rainbow-Masked Beta Tester Badge (avatar.dart:57-355) */
.pm-beta-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  margin: 0;
  border: 0;
  background: transparent;
  flex: none;
  flex-shrink: 0;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  vertical-align: middle;
  transition: transform 140ms var(--ease-m3);
}
.pm-beta-badge:active { transform: scale(0.9); }
.pm-beta-badge.sz-32 { width: 32px; height: 32px; }
.pm-beta-badge.compact,
.pm-beta-badge.sz-22 { width: 22px; height: 22px; }
.pm-beta-badge-fill {
  --beta-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 84 84'%3E%3Cdefs%3E%3Cmask id='m' maskUnits='userSpaceOnUse' x='0' y='0' width='84' height='84'%3E%3Crect x='0' y='0' width='84' height='84' fill='%23000'/%3E%3Cpath d='M71.9,43.2 L57.7,48.5 L76.1,59.8 L54.3,58.8 L57.1,73.6 L46.9,60.1 L45.3,73.9 L39.5,63.0 L16.8,83.1 L31.5,55.0 L7.8,67.6 L25.3,48.7 L14.6,42.4 L26.4,40.1 L16.4,29.6 L32.4,34.6 L23.6,1.4 L39.1,29.8 L47.0,4.7 L49.3,28.1 L61.4,13.3 L54.8,33.8 L70.9,25.7 L57.4,42.3 Z' fill='%23fff'/%3E%3Ccircle cx='43' cy='45' r='17' fill='%23fff'/%3E%3Cpath d='M29,47 Q43,29 57,45 Q43,39 29,47 Z' fill='%23000'/%3E%3Ccircle cx='45' cy='42' r='3.2' fill='%23fff'/%3E%3C/mask%3E%3C/defs%3E%3Crect x='0' y='0' width='84' height='84' fill='%23fff' mask='url(%23m)'/%3E%3C/svg%3E");
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
  background: linear-gradient(90deg, #FF5C9A, #FF983D, #FFE066, #4BE3A2, #54C7FF, #9C7BFF, #FF5C9A);
  background-size: 300% 100%;
  animation: pm-rainbow-shift 3.2s linear infinite;
  -webkit-mask: var(--beta-mask) center / contain no-repeat;
  mask: var(--beta-mask) center / contain no-repeat;
}
@keyframes pm-rainbow-shift {
  from { background-position: 0% 50%; }
  to { background-position: 150% 50%; }
}
@media (forced-colors: active) {
  .pm-beta-badge-fill {
    background: Highlight;
    forced-color-adjust: none;
  }
}

.pm-listening-now {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 18px;
  background: color-mix(in srgb, var(--primary-c) 65%, var(--s-container));
  color: var(--on-surface);
  margin-top: 8px;
  cursor: pointer;
}
.pm-listening-now .mi { color: var(--primary); }
.pm-visitor-listening {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: 6px;
  margin-top: 8px;
  padding: 2px 0;
  border: 0;
  background: transparent;
  color: var(--primary);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  max-width: 100%;
  cursor: pointer;
  text-align: left;
  transition: opacity 140ms ease;
}
.pm-visitor-listening:active { opacity: 0.72; }
.pm-visitor-listening .mi {
  font-size: 16px;
  color: var(--primary);
  flex: none;
}
.pm-visitor-listening > span:not(.mi) {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pm-profile-bio {
  font-size: 15px;
  line-height: 1.45;
  color: var(--on-surface);
  margin-top: 6px;
  white-space: pre-wrap;
  word-break: break-word;
}
.pm-profile-bio-edit {
  width: 100%;
  margin-top: 10px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid var(--outline-var);
  background: var(--s-container);
  color: var(--on-surface);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  text-align: left;
  font-size: 14.5px;
  line-height: 1.45;
  cursor: pointer;
  transition: background 140ms ease, border-color 140ms ease, transform 140ms var(--ease-m3);
}
.pm-profile-bio-edit:active {
  transform: scale(0.99);
  border-color: var(--primary);
}
.pm-profile-bio-edit.empty,
.pm-profile-bio-edit .is-empty {
  color: var(--on-surface-var);
}
.pm-profile-bio-edit .mi {
  font-size: 18px;
  color: var(--on-surface-var);
  flex: none;
}

/* Showcase Featured #1 (112px r=28) + Compact #2..#5 (64px r=16) */
.pm-showcase-featured {
  display: flex;
  align-items: center;
  gap: 14px;
  height: 112px;
  padding-right: 12px;
  border-radius: var(--r-2xl);
  background: var(--s-container);
  border: 1px solid var(--card-border);
  overflow: hidden;
  cursor: pointer;
}
.pm-showcase-featured img {
  width: 112px;
  height: 112px;
  object-fit: cover;
  flex: none;
}
.pm-showcase-row {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 64px;
  padding: 8px 10px;
  border-radius: var(--r-md);
  background: var(--s-container);
  border: 1px solid var(--card-border);
  cursor: pointer;
}
.pm-showcase-row img {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  object-fit: cover;
  flex: none;
}
.pm-showcase-empty {
  padding: 24px 20px;
  border-radius: var(--r-xl);
  background: var(--s-container);
  border: 1px solid var(--card-border);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 12px;
}
.pm-showcase-empty > .mi,
.pm-showcase-empty-ic {
  font-size: 40px;
  color: var(--on-surface-var);
  opacity: 0.85;
}
.pm-showcase-empty-sub,
.pm-showcase-empty p {
  margin: 0;
  max-width: 280px;
  font-size: 14px;
  line-height: 1.45;
  color: var(--on-surface-var);
}
.pm-showcase-empty .pm-btn {
  margin-top: 4px;
}

.pm-profile-pl-card {
  flex: none;
  width: 140px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.pm-profile-pl-art {
  width: 140px;
  height: 140px;
  border-radius: var(--r-xl);
  overflow: hidden;
  background: var(--primary-c);
}

/* Comments (Android flat rows — profile_view.dart:1681-1788) */
.pm-comment-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.pm-comment-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 8px 0;
  border-radius: 0;
  background: transparent;
  border: 0;
}
.pm-comment-item.optimistic { opacity: 0.65; }
.pm-comment-av {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  flex: none;
}
.pm-comment-body { flex: 1; min-width: 0; }
.pm-comment-text {
  font-size: 15px;
  line-height: 1.4;
  margin-top: 4px;
  word-break: break-word;
  user-select: text;
  -webkit-user-select: text;
}
.pm-comment-like {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: var(--r-pill);
  font-size: 12px;
  font-weight: 700;
  color: var(--on-surface-var);
  font-variant-numeric: tabular-nums;
}
.pm-comment-like.liked { color: var(--primary); }
.pm-comment-like .mi { font-size: 16px; }
.pm-comment-input-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 6px 6px 14px;
  border-radius: var(--r-lg);
  background: var(--s-high);
  border: 1px solid var(--card-border);
}
.pm-comment-input-bar input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  outline: none;
  font-size: 14px;
}

/* People & Friends Rows */
.pm-people-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 18px;
  background: var(--s-container);
  border: 1px solid var(--card-border);
  cursor: pointer;
}
.pm-people-av {
  position: relative;
  width: 44px;
  height: 44px;
  flex: none;
}
.pm-people-av img,
.pm-people-av .pm-av-fallback {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
}
.pm-online-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--online);
  display: inline-block;
  flex: none;
}

/* Interactive Canvas Cropper & Color Pipette Loupe (84px ring) */
.pm-crop-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  max-height: 54dvh;
  border-radius: var(--r-xl);
  overflow: hidden;
  background: #0A0A0C;
  touch-action: none;
}
.pm-crop-stage canvas {
  width: 100%;
  height: 100%;
  display: block;
}
.pm-crop-mask {
  position: absolute;
  inset: 0;
  pointer-events: none;
  display: grid;
  place-items: center;
}
.pm-crop-cutout {
  border: 2px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.58);
}
.pm-crop-cutout.circle { width: 78%; aspect-ratio: 1; border-radius: 50%; }
.pm-crop-cutout.square { width: 82%; aspect-ratio: 1; border-radius: 20px; }
.pm-crop-cutout.banner { width: 92%; aspect-ratio: 3 / 1; border-radius: 16px; }

.pm-pipette-stage {
  position: relative;
  width: 100%;
  max-height: 52dvh;
  border-radius: var(--r-xl);
  overflow: hidden;
  background: #0A0A0C;
  touch-action: none;
}
.pm-pipette-crosshair {
  position: absolute;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2.5px solid #FFFFFF;
  box-shadow: 0 0 0 1.5px rgba(0, 0, 0, 0.7);
  transform: translate(-50%, -50%);
  pointer-events: none;
}
.pm-pipette-loupe {
  position: absolute;
  width: 84px;
  height: 84px;
  border-radius: 50%;
  border: 5px solid var(--loupe-color, var(--primary));
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.65), inset 0 0 0 1px rgba(255, 255, 255, 0.45);
  overflow: hidden;
  pointer-events: none;
  transform: translate(-50%, -125%);
  image-rendering: pixelated;
}
.pm-pipette-loupe.below { transform: translate(-50%, 35%); }

.pm-hsv-pad {
  position: relative;
  width: 100%;
  height: 176px;
  border-radius: 18px;
  overflow: hidden;
  touch-action: none;
  background:
    linear-gradient(to top, #000, transparent),
    linear-gradient(to right, #FFF, hsl(var(--hsv-h, 255), 100%, 50%));
}
.pm-hue-slider {
  width: 100%;
  height: 28px;
  border-radius: var(--r-pill);
  -webkit-appearance: none;
  appearance: none;
  background: linear-gradient(90deg, #F00, #FF0, #0F0, #0FF, #00F, #F0F, #F00);
  outline: none;
}
.pm-hue-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #FFFFFF;
  border: 3px solid #141414;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
}

/* Multi-Device Theme Source & Active Sessions */
.pm-session-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 18px;
  background: var(--s-container);
  border: 1px solid var(--card-border);
}
.pm-session-row.selected {
  background: var(--primary-c);
  border-color: color-mix(in srgb, var(--primary) 45%, transparent);
}
.pm-device-pill {
  padding: 2px 8px;
  border-radius: var(--r-pill);
  background: var(--primary-c-solid);
  color: var(--on-primary-c);
  font-size: 11px;
  font-weight: 800;
}

/* --------------------------------------------------------------------------
   15. LISTEN TOGETHER, NOTIFICATIONS, SETTINGS & FEEDBACK
   -------------------------------------------------------------------------- */
/* Floating Together Invite Banner (#pmInviteBanner) */
#pmInviteBanner,
.pm-invite-banner {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  top: calc(var(--safe-top) + 10px);
  z-index: 45;
  width: calc(100% - 24px);
  max-width: 520px;
  padding: 12px 14px;
  border-radius: var(--r-xl);
  background: var(--primary-c-solid);
  color: var(--on-primary-c);
  border: 1px solid color-mix(in srgb, var(--primary) 45%, transparent);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: pm-toast-in 240ms var(--ease-spring);
}

.pm-together-hero {
  border-radius: 26px;
  padding: 10px 18px 20px;
  background: radial-gradient(circle at 50% 18%, color-mix(in srgb, var(--primary) 24%, transparent), transparent 58%), var(--s-container-solid);
  border: 1px solid color-mix(in srgb, var(--outline-var) 28%, transparent);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  overflow: hidden;
}
.pm-tg-stage {
  height: 126px;
  width: 100%;
  display: grid;
  place-items: center;
}
.pm-tg-orb-wrap {
  position: relative;
  width: 184px;
  height: 92px;
  display: grid;
  place-items: center;
}
.pm-tg-ring {
  position: absolute;
  border-radius: 50%;
  border: 1px solid color-mix(in srgb, var(--primary) 26%, transparent);
  pointer-events: none;
}
.pm-tg-ring.r1 { width: 88px; height: 88px; border-width: 1.3px; }
.pm-tg-ring.r2 { width: 132px; height: 132px; border-color: color-mix(in srgb, var(--primary) 16%, transparent); }
.pm-tg-ring.r3 { width: 178px; height: 178px; border-color: color-mix(in srgb, var(--primary) 9%, transparent); }
.pm-tg-orb {
  position: relative;
  z-index: 1;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--primary), color-mix(in srgb, var(--primary) 68%, #7c4dff));
  color: var(--on-primary);
  box-shadow: 0 6px 24px color-mix(in srgb, var(--primary) 38%, transparent);
}
.pm-tg-orb .mi { font-size: 28px; }
.pm-tg-orbit {
  position: absolute;
  z-index: 2;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--s-high-solid);
  border: 1px solid color-mix(in srgb, var(--primary) 38%, transparent);
  color: var(--primary);
}
.pm-tg-orbit .mi { font-size: 14px; }
.pm-tg-orbit.l { left: 12px; bottom: 10px; }
.pm-tg-orbit.r { right: 12px; top: 8px; }
.pm-tg-live-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  border-radius: 99px;
  background: color-mix(in srgb, var(--primary) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--primary) 26%, transparent);
  color: var(--primary);
  font-size: 11.5px;
  font-weight: 700;
}
.pm-tg-live-pill i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary);
  display: inline-block;
}
.pm-tg-dock {
  width: 100%;
  display: flex;
  align-items: center;
  border-radius: 18px;
  background: color-mix(in srgb, var(--s-high-solid) 76%, transparent);
  border: 1px solid color-mix(in srgb, var(--outline-var) 24%, transparent);
}
.pm-tg-dock-item {
  flex: 1;
  min-width: 0;
  padding: 11px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.pm-tg-dock-item .mi {
  font-size: 17px;
  color: var(--primary);
  margin-bottom: 3px;
}
.pm-tg-dock-item strong {
  font-size: 12px;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.pm-tg-dock-item small {
  font-size: 10.5px;
  color: var(--on-surface-var);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.pm-tg-dock-div {
  width: 1px;
  height: 28px;
  background: color-mix(in srgb, var(--outline-var) 36%, transparent);
  flex: none;
}
.pm-together-members {
  display: flex;
  align-items: center;
  gap: 10px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 4px 0;
}
.pm-together-members::-webkit-scrollbar { display: none; }

.pm-chat-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 46dvh;
  overflow-y: auto;
  padding: 6px 2px;
}
.pm-chat-msg {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  max-width: 86%;
}
.pm-chat-msg.mine {
  align-self: flex-end;
  flex-direction: row-reverse;
}
.pm-chat-bubble {
  padding: 10px 14px;
  border-radius: 18px 18px 18px 6px;
  background: var(--s-high-solid);
  color: var(--on-surface);
  font-size: 14px;
  line-height: 1.4;
  word-break: break-word;
}
.pm-chat-msg.mine .pm-chat-bubble {
  border-radius: 18px 18px 6px 18px;
  background: var(--primary-c-solid);
  color: var(--on-primary-c);
}
.pm-chat-time {
  font-size: 10.5px;
  color: var(--outline);
  margin-top: 3px;
}

/* Notifications Inbox */
.pm-notif-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 13px 14px;
  border-radius: 22px;
  background: var(--s-container);
  border: 1px solid var(--card-border);
  position: relative;
  cursor: pointer;
}
.pm-notif-card.unread::before {
  content: '';
  position: absolute;
  top: 14px;
  left: 6px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary);
}

/* Settings M3 Grouped Cards (r=28, 38x38 r=12 icon, 68px indented dividers) */
.pm-settings-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 18px;
}
.pm-settings-title {
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary);
  padding: 0 14px;
}
.pm-settings-group {
  border-radius: var(--r-2xl);
  background: var(--s-container);
  border: 1px solid var(--card-border);
  overflow: hidden;
}
.pm-settings-row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 16px;
  position: relative;
  min-height: 62px;
  cursor: pointer;
  transition: background 140ms ease;
}
.pm-settings-row:active {
  background: color-mix(in srgb, var(--on-surface) 7%, transparent);
}
.pm-settings-row + .pm-settings-row::before {
  content: '';
  position: absolute;
  top: 0;
  left: 68px;
  right: 16px;
  height: 1px;
  background: color-mix(in srgb, var(--outline-var-solid) 38%, transparent);
}
.pm-settings-icon {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--secondary-c-solid) 68%, transparent);
  color: var(--on-secondary-c);
  display: grid;
  place-items: center;
  flex: none;
}
.pm-settings-icon .mi { font-size: 21px; }
.pm-settings-icon svg { display: block; flex: none; }
.pm-settings-brand-ic {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--secondary-c-solid) 65%, transparent);
  color: var(--on-secondary-c);
  display: grid;
  place-items: center;
  flex: none;
}
.pm-settings-brand-ic svg {
  display: block;
  flex: none;
}
.pm-settings-folders {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}
.pm-settings-folder {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: var(--r-xl);
  background: var(--s-container);
  border: 1px solid var(--card-border);
  color: var(--on-surface);
  text-align: left;
  cursor: pointer;
  transition: background 140ms ease, transform 140ms var(--ease-m3);
}
.pm-settings-folder + .pm-settings-folder {
  margin-top: 8px;
}
.pm-settings-folders .pm-settings-folder + .pm-settings-folder {
  margin-top: 0;
}
.pm-settings-folder:active {
  transform: scale(0.988);
  background: color-mix(in srgb, var(--on-surface) 6%, var(--s-container));
}
.pm-settings-folder-ic {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--secondary-c-solid) 68%, transparent);
  color: var(--on-secondary-c);
  display: grid;
  place-items: center;
  flex: none;
}
.pm-settings-folder-ic .mi { font-size: 22px; }
.pm-settings-folder-ic svg { display: block; flex: none; }
.pm-settings-folder-body {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.pm-settings-folder-title {
  font-size: 15.5px;
  font-weight: 700;
  color: var(--on-surface);
  line-height: 1.25;
}
.pm-settings-folder-sub {
  font-size: 12.5px;
  color: var(--on-surface-var);
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pm-settings-folder > .mi:last-child,
.pm-settings-folder-chev {
  font-size: 22px;
  color: var(--on-surface-var);
  flex: none;
  margin-left: auto;
}
.pm-settings-text {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.pm-settings-label { font-size: 15px; font-weight: 700; color: var(--on-surface); }
.pm-settings-desc { font-size: 12.5px; color: var(--on-surface-var); line-height: 1.3; }
.pm-settings-control {
  padding: 0 16px 14px;
}

/* Feedback & My Tickets */
.pm-ticket-card {
  border-radius: 22px;
  background: var(--s-container);
  border: 1px solid var(--card-border);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.pm-ticket-status {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--r-pill);
  font-size: 11px;
  font-weight: 800;
}
.pm-ticket-status.open { background: rgba(79, 141, 255, 0.2); color: #7EB3FF; }
.pm-ticket-status.in_progress,
.pm-ticket-status.work { background: rgba(245, 158, 11, 0.2); color: #FCD34D; }
.pm-ticket-status.planned { background: rgba(139, 108, 255, 0.22); color: #C4B5FD; }
.pm-ticket-status.beta_check,
.pm-ticket-status.review { background: rgba(46, 196, 182, 0.2); color: #5EEAD4; }
.pm-ticket-status.resolved,
.pm-ticket-status.fixed,
.pm-ticket-status.done { background: rgba(61, 220, 132, 0.2); color: #6EE7B7; }
.pm-ticket-status.closed,
.pm-ticket-status.rejected { background: rgba(242, 184, 181, 0.18); color: var(--error); }

.pm-diag-pre {
  margin: 0;
  padding: 10px 12px;
  border-radius: 14px;
  background: var(--s-lowest-solid);
  font-family: var(--mono);
  font-size: 11.5px;
  line-height: 1.45;
  color: var(--on-surface-var);
  overflow-x: auto;
  max-height: 160px;
  user-select: text;
  -webkit-user-select: text;
}

/* QR Camera Scanner */
.pm-qr-scanner {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  border-radius: var(--r-2xl);
  overflow: hidden;
  background: #000000;
}
.pm-qr-scanner video { width: 100%; height: 100%; object-fit: cover; }
.pm-qr-reticle {
  position: absolute;
  inset: 18%;
  border: 3px solid var(--primary);
  border-radius: 22px;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.45);
  pointer-events: none;
}

/* --------------------------------------------------------------------------
   16. AOD STUDIO (#pmAodOverlay — Pure #000 OLED, Smart Pixels, Burn-In Guard)
   -------------------------------------------------------------------------- */
#pmAodOverlay,
.pm-aod-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: #000000;
  color: var(--aod-tint, #FFFFFF);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  touch-action: none;
}
.pm-aod-dim {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  padding:
    calc(var(--safe-top) + 24px)
    24px
    calc(var(--safe-bottom) + 28px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  filter: brightness(var(--aod-bright, 0.85));
  transition: filter 220ms ease;
}
.pm-aod-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  text-align: center;
  max-width: 340px;
  width: 100%;
  transform: translate(var(--aod-dx, 0px), var(--aod-dy, 0px));
  transition: transform 600ms ease;
}
.pm-aod-clock {
  font-size: 56px;
  font-weight: 400;
  line-height: 1;
  letter-spacing: -1.5px;
  font-variant-numeric: tabular-nums;
}
.pm-aod-date {
  font-size: 13px;
  font-weight: 600;
  opacity: 0.66;
}
.pm-aod-canvas {
  width: 184px;
  height: 184px;
  display: block;
}
.pm-aod-cover {
  width: 184px;
  height: 184px;
  border-radius: 22px;
  object-fit: cover;
  opacity: 0.88;
}
.pm-aod-cover.vinyl {
  border-radius: 50%;
  animation: pm-vinyl-spin 1.8s linear infinite;
  animation-play-state: paused;
}
.pm-aod-cover.vinyl.playing { animation-play-state: running; }

.pm-aod-track-title {
  font-size: 16px;
  font-weight: 700;
  opacity: 0.92;
  max-width: 100%;
}
.pm-aod-track-artist {
  font-size: 13.5px;
  opacity: 0.6;
  max-width: 100%;
}
.pm-aod-progress {
  width: 100%;
  max-width: 240px;
  height: 1.6px;
  background: rgba(255, 255, 255, 0.16);
  border-radius: 99px;
  overflow: hidden;
}
.pm-aod-progress-fill {
  height: 100%;
  width: var(--progress, 0%);
  background: currentColor;
}
.pm-aod-lyrics {
  font-size: 14px;
  line-height: 1.45;
  opacity: 0.72;
  max-height: 44px;
  overflow: hidden;
}
.pm-aod-controls {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-top: 6px;
  opacity: 0.65;
}
.pm-aod-controls button { color: inherit; width: 44px; height: 44px; display: grid; place-items: center; }
.pm-aod-exit-hint {
  position: absolute;
  bottom: calc(var(--safe-bottom) + 18px);
  left: 50%;
  transform: translateX(-50%);
  font-size: 12px;
  font-weight: 600;
  opacity: 0.42;
  pointer-events: none;
  transition: opacity 600ms ease;
}
.pm-aod-exit-hint.faded { opacity: 0; }

/* crDroid-style Smart Pixels physical-pixel checkerboard burn-in guard */
.pm-aod-smart-pixels {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background-size: 2px 2px;
}
.pm-aod-smart-pixels.sp-25 {
  background-image: linear-gradient(90deg, #000 50%, transparent 50%), linear-gradient(0deg, #000 50%, transparent 50%);
  background-blend-mode: multiply;
  opacity: 0.45;
}
.pm-aod-smart-pixels.sp-50 {
  background-image: conic-gradient(#000 90deg, transparent 90deg 180deg, #000 180deg 270deg, transparent 270deg);
}
.pm-aod-smart-pixels.sp-75 {
  background-image: conic-gradient(#000 270deg, transparent 270deg);
}
.pm-aod-smart-pixels.phase-1 { background-position: 1px 0; }
.pm-aod-smart-pixels.phase-2 { background-position: 1px 1px; }
.pm-aod-smart-pixels.phase-3 { background-position: 0 1px; }

/* AOD Live Preview inside Settings */
.pm-aod-preview {
  width: 100%;
  aspect-ratio: 16 / 10;
  border-radius: var(--r-2xl);
  background: #000000;
  border: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  overflow: hidden;
  position: relative;
}

/* --------------------------------------------------------------------------
   17. OVERLAYS: MULTI-SELECT BAR, 100% OPAQUE SHEETS, DIALOGS, SKELETONS, TOASTS
   -------------------------------------------------------------------------- */
/* Multi-Select Floating Bar (#pmSelectBar) */
#pmSelectBar,
.pm-select-bar {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(var(--nav-h) + var(--safe-bottom) + 8px);
  z-index: 42;
  width: calc(100% - 20px);
  max-width: 640px;
  padding: 8px 10px;
  border-radius: var(--r-2xl);
  background: var(--secondary-c-solid);
  color: var(--on-secondary-c);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 6px;
}
.pm-select-count {
  font-size: 13.5px;
  font-weight: 800;
  white-space: nowrap;
  padding: 0 4px;
  font-variant-numeric: tabular-nums;
}
.pm-select-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 2px;
  overflow-x: auto;
  scrollbar-width: none;
}
.pm-select-actions::-webkit-scrollbar { display: none; }

/* 100% OPAQUE Bottom Sheets (#pmSheetHost, .pm-sheet-backdrop, .pm-sheet) */
#pmSheetHost,
.pm-sheet-host {
  position: fixed;
  inset: 0;
  z-index: 75;
  pointer-events: none;
}
.pm-sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.56);
  pointer-events: auto;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  transition: opacity 200ms ease;
}
.pm-sheet-backdrop.open { opacity: 1; }
.pm-sheet-backdrop.closing { opacity: 0; }

/* CRITICAL ANDROID RULE: Bottom sheets stay 100% OPAQUE even in Glass/Vivid */
.pm-sheet {
  width: 100%;
  max-width: 600px;
  max-height: 92dvh;
  background: var(--s-low-solid) !important;
  color: var(--on-surface);
  border-radius: var(--r-2xl) var(--r-2xl) 0 0;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding-bottom: var(--safe-bottom);
  transform: translateY(100%);
  transition: transform 280ms var(--ease-spring);
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
.pm-sheet-backdrop.open .pm-sheet {
  transform: translateY(var(--sheet-drag-y, 0px));
}
.pm-sheet.tall { min-height: 76dvh; }
.pm-sheet.dragging { transition: none; }

.pm-sheet-handle-wrap {
  padding: 10px 0 4px;
  display: flex;
  justify-content: center;
  cursor: grab;
  touch-action: none;
  flex: none;
}
.pm-sheet-handle {
  width: 36px;
  height: 4px;
  border-radius: 99px;
  background: color-mix(in srgb, var(--on-surface) 26%, transparent);
  display: block;
}
.pm-sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 18px 12px;
  flex: none;
}
.pm-sheet-title-wrap {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.pm-sheet-title {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.2px;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pm-sheet-sub {
  font-size: 13px;
  color: var(--on-surface-var);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pm-sheet-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 4px 16px 20px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.pm-sheet-body::-webkit-scrollbar { display: none; }

/* Sheet Action Menu List */
.pm-sheet-action,
.pm-sheet-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 14px;
  border-radius: 16px;
  color: var(--on-surface);
  font-size: 15px;
  font-weight: 600;
}
.pm-sheet-action:active,
.pm-sheet-item:active { background: var(--s-high-solid); }
.pm-sheet-action.danger,
.pm-sheet-item.danger,
.pm-sheet-item.is-danger { color: var(--error); }
.pm-sheet-action .mi,
.pm-sheet-item .mi { font-size: 22px; color: var(--on-surface-var); }
.pm-sheet-action.danger .mi,
.pm-sheet-item.danger .mi,
.pm-sheet-item.is-danger .mi { color: var(--error); }

/* 100% OPAQUE Native Dialog (dialog#pmDialog.pm-dialog — Android ConfirmDialog r=28) */
dialog.pm-dialog,
.pm-dialog {
  width: min(calc(100% - 32px), 400px);
  max-height: 86dvh;
  margin: auto;
  padding: 22px 20px 18px;
  border-radius: var(--r-2xl);
  border: 1px solid color-mix(in srgb, var(--outline-var-solid) 45%, transparent);
  background: var(--s-high-solid) !important;
  color: var(--on-surface);
  box-shadow: var(--shadow-lg);
  overflow-y: auto;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
dialog.pm-dialog.danger,
dialog.pm-dialog.is-danger {
  border-color: color-mix(in srgb, var(--error) 35%, transparent);
}
dialog.pm-dialog.wide {
  width: min(calc(100% - 24px), 560px);
}
dialog.pm-dialog::backdrop {
  background: rgba(0, 0, 0, 0.62);
}
.pm-dlg-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}
.pm-dialog-icon,
.pm-dlg-icon {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--primary-c-solid);
  color: var(--on-primary-c);
  display: grid;
  place-items: center;
  flex: none;
}
.pm-dialog-icon { margin-bottom: 12px; }
dialog.pm-dialog.danger .pm-dialog-icon,
dialog.pm-dialog.is-danger .pm-dlg-icon,
.pm-dlg-icon.is-danger {
  background: color-mix(in srgb, var(--error) 18%, transparent);
  color: var(--error);
}
.pm-dialog-title,
.pm-dlg-title { font-size: 19px; font-weight: 800; margin: 0; line-height: 1.25; }
.pm-dialog-title { margin-bottom: 8px; }
.pm-dialog-text,
.pm-dlg-text { font-size: 14px; line-height: 1.48; color: var(--on-surface-var); margin: 0 0 18px; }
.pm-dlg-label {
  display: block;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--on-surface-var);
  margin-bottom: 6px;
}
.pm-dlg-form { display: flex; flex-direction: column; gap: 12px; }
.pm-dlg-input-row { display: flex; align-items: center; gap: 8px; }
.pm-dlg-input-row .pm-input { flex: 1; min-width: 0; }
.pm-dialog-actions,
.pm-dlg-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
}

/* 100% OPAQUE Floating Toasts (#pmToastHost, .pm-toast — Android SnackBar r=16) */
#pmToastHost,
.pm-toast-host {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(var(--nav-h) + var(--safe-bottom) + var(--mini-offset) + 14px);
  z-index: 95;
  width: calc(100% - 28px);
  max-width: 480px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.pm-toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 16px;
  border-radius: var(--r-md);
  background: var(--s-highest-solid) !important;
  color: var(--on-surface);
  font-size: 14px;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(14px) scale(0.96);
  transition: opacity 200ms ease, transform 220ms var(--ease-spring);
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
.pm-toast.open {
  opacity: 1;
  transform: translateY(0) scale(1);
}
.pm-toast-msg { flex: 1; min-width: 0; }
.pm-toast.error,
.pm-toast.is-error {
  border-left: 4px solid var(--error);
}
.pm-toast.leaving {
  opacity: 0;
  transform: translateY(10px) scale(0.96);
}
.pm-toast-action {
  color: var(--primary);
  font-weight: 800;
  white-space: nowrap;
  padding: 4px 6px;
}

/* Skeleton Shimmer Loaders, Empty States & Spinner */
.pm-skeleton {
  border-radius: 14px;
  background: linear-gradient(
    90deg,
    var(--s-container) 25%,
    var(--s-high) 50%,
    var(--s-container) 75%
  );
  background-size: 200% 100%;
  animation: pm-shimmer 1.35s ease-in-out infinite;
}
@keyframes pm-shimmer {
  from { background-position: 200% 0; }
  to { background-position: -200% 0; }
}

.pm-empty {
  padding: 36px 20px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  color: var(--on-surface-var);
}
.pm-empty .mi { font-size: 44px; opacity: 0.55; }
.pm-empty-title { font-size: 16px; font-weight: 800; color: var(--on-surface); }
.pm-empty-sub { font-size: 13.5px; max-width: 300px; line-height: 1.45; }

.pm-offline-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 16px;
  background: color-mix(in srgb, var(--warn) 16%, var(--s-container-solid));
  color: var(--on-surface);
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 12px;
}

.pm-spinner {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2.5px solid color-mix(in srgb, currentColor 25%, transparent);
  border-top-color: currentColor;
  animation: pm-spin 700ms linear infinite;
  display: inline-block;
  flex: none;
}
@keyframes pm-spin { to { transform: rotate(360deg); } }

/* --------------------------------------------------------------------------
   18. RESPONSIVE BREAKPOINTS (Fold 280px .. Phones .. Tablets .. Landscape)
   -------------------------------------------------------------------------- */

/* Ultra-narrow phones (<= 360px) */
@media (max-width: 360px) {
  :root {
    --gutter: 12px;
    --player-gutter: 14px;
    --nav-h: 68px;
  }
  .pm-h1 { font-size: 24px; }
  .pm-nav-pill { width: 54px; height: 30px; }
  .pm-nav-label { font-size: 11px; }
  .pm-icon-btn { width: 36px; height: 36px; }
  .pm-track-art-wrap { width: 46px; height: 46px; border-radius: 12px; }
  .pm-avatar-wrap { width: 82px; height: 82px; }
  .pm-profile-hero-row { margin-top: -41px; gap: 10px; }
  .pm-stat-card { border-radius: 20px; padding: 10px; }
  .pm-fp-stage { max-width: 290px; }
  .pm-play-fab.lg { width: 64px; height: 64px; }
  .pm-fp-skip-btn { width: 46px; height: 46px; }
  .pm-source-btn { padding: 6px 6px; }
  .pm-comment-av { width: 36px; height: 36px; }
  .pm-hero-carousel { height: 204px; }
}

/* Fold Cover Screen (<= 310px, down to 280px) */
@media (max-width: 310px) {
  :root {
    --gutter: 10px;
    --player-gutter: 12px;
    --nav-h: 64px;
  }
  .pm-nav-pill { width: 46px; height: 28px; }
  .pm-nav-label { font-size: 10px; }
  .pm-track-dur { display: none; }
  .pm-track-art-wrap { width: 42px; height: 42px; }
  .pm-mini-art { width: 38px; height: 38px; }
  .pm-play-fab.sm { width: 38px; height: 38px; }
  .pm-avatar-wrap { width: 72px; height: 72px; }
  .pm-profile-banner { height: 132px; }
  .pm-profile-hero-row { margin-top: -36px; }
  .pm-profile-counters { gap: 8px; }
  .pm-counter-btn { min-width: 44px; }
  .pm-counter-val { font-size: 17px; }
  .pm-counter-lbl { font-size: 11px; }
  .pm-source-btn { padding: 5px 5px; font-size: 12.5px; }
  .pm-album-art { width: 148px; height: 148px; }
  .pm-artist-avatar { width: 124px; height: 124px; }
  .pm-pl-grid { gap: 8px; }
  .pm-stats-strip { gap: 6px; }
}

/* Mid-width / Small Tablet (480px+) */
@media (min-width: 480px) {
  .pm-pl-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .pm-mix-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* Tablet (600px+) */
@media (min-width: 600px) {
  :root {
    --gutter: 24px;
    --player-gutter: 28px;
  }
  .pm-stats-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .pm-hero-card,
  .pm-hero-carousel > .pm-wave-carousel-card,
  .pm-hero-carousel > button,
  .pm-hero-carousel > div { flex: 0 0 46%; max-width: 360px; }
  .pm-sheet-backdrop { align-items: center; padding: 20px; }
  .pm-sheet {
    border-radius: var(--r-2xl);
    max-height: 86dvh;
    padding-bottom: 0;
  }
}

/* Wide Tablet (700px+ / 860px+) */
@media (min-width: 700px) {
  .pm-pl-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (min-width: 860px) {
  .pm-stats-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* Landscape Phones (max-height: 460px) & 2-Pane Full Player */
@media (max-height: 460px) and (orientation: landscape) {
  :root {
    --nav-h: 56px;
    --mini-h: 56px;
  }
  .pm-nav { padding-top: 4px; padding-bottom: calc(4px + var(--safe-bottom)); }
  .pm-nav-pill { width: 52px; height: 26px; }
  .pm-nav-label { font-size: 10.5px; }
  .pm-mini-inner { padding: 6px 8px; }
  .pm-mini-art { width: 38px; height: 38px; }
  .pm-play-fab.sm { width: 38px; height: 38px; }
  .pm-profile-banner { height: 112px; }
  .pm-wave-hero { min-height: 136px; padding: 14px 18px; }
  .pm-hero-carousel { height: 156px; }
}

@media (min-width: 560px) and (max-height: 560px) {
  .pm-fp-content {
    max-width: 880px;
    display: grid;
    grid-template-columns: minmax(200px, 340px) minmax(0, 1fr);
    grid-template-rows: auto 1fr;
    column-gap: 24px;
    align-items: start;
  }
  .pm-fp-handle { display: none; }
  .pm-fp-topbar { grid-column: 1 / -1; margin-bottom: 8px; }
  .pm-fp-stage {
    grid-column: 1;
    max-width: min(260px, 56dvh);
    margin: 0 auto;
  }
  .pm-fp-controls-pane {
    grid-column: 2;
    min-width: 0;
  }
  .pm-fp-drawer {
    grid-column: 1 / -1;
  }
}

/* Split pills inside «Подписки» (Друзья | Исполнители) */
.pm-sub-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}
.pm-sub-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 40px;
  padding: 6px 10px;
  border-radius: 14px;
  border: 1px solid color-mix(in srgb, var(--on-surface) 8%, transparent);
  background: var(--s-high);
  color: var(--on-surface-var);
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  transition: background 150ms ease, color 150ms ease, border-color 150ms ease;
}
.pm-sub-pill.active {
  background: var(--primary-container);
  color: var(--on-primary-container);
  border-color: color-mix(in srgb, var(--primary) 48%, transparent);
}
.pm-sub-cnt {
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 800;
  background: color-mix(in srgb, var(--on-surface) 10%, transparent);
}
.pm-sub-pill.active .pm-sub-cnt {
  background: color-mix(in srgb, var(--primary) 24%, transparent);
}
