:root {
  color-scheme: dark;
  --bg: #07070c;
  --surface: #13131d;
  --surface-2: #1c1c2b;
  --surface-hover: #252538;
  --border: rgba(255, 255, 255, 0.08);
  --text: #f8fafc;
  --muted: #9ca3af;
  --purple: #a855f7;
  --purple-bright: #c084fc;
  --pink: #ec4899;
  --green: #10b981;
  --danger: #f43f5e;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --tabbar-h: 64px;
  --fp-color-1: #b83268;
  --fp-color-2: #3b0d2c;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, system-ui, sans-serif;
  overflow: hidden;
  user-select: none;
}

button,
input {
  font-family: inherit;
}

.app-layout {
  display: grid;
  grid-template-columns: 248px 1fr;
  height: 100vh;
  height: 100dvh;
}

/* Sidebar Desktop */
.desktop-sidebar {
  background: #0d0d16;
  border-right: 1px solid var(--border);
  padding: 20px 14px 110px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  overflow-y: auto;
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 6px;
}

.brand-badge,
.avatar-pill {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--purple), var(--pink));
  color: #fff;
  font-weight: 900;
  font-size: 13px;
  letter-spacing: -0.03em;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.brand-title {
  font-size: 19px;
  font-weight: 900;
  letter-spacing: -0.03em;
}

.brand-sub {
  font-size: 11.5px;
  color: var(--muted);
}

.side-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.side-nav-btn {
  border: none;
  background: transparent;
  color: var(--muted);
  padding: 10px 12px;
  border-radius: 10px;
  text-align: left;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.14s, color 0.14s;
}

.side-nav-btn:hover {
  background: var(--surface-2);
  color: var(--text);
}

.side-nav-btn.is-active {
  background: rgba(168, 85, 247, 0.18);
  color: var(--purple-bright);
}

.side-section {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.side-section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 10px 6px;
  font-size: 11.5px;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--muted);
}

.side-playlist-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
  overflow-y: auto;
}

.side-footer {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.crossfade-mini {
  background: var(--surface);
  border-radius: 10px;
  padding: 9px 11px;
  font-size: 12px;
}

.crossfade-mini-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
}

.accent-slider {
  width: 100%;
  accent-color: var(--purple);
  cursor: pointer;
}

.import-label {
  display: block;
  text-align: center;
  padding: 8px;
  border-radius: 9px;
  border: 1px dashed var(--border);
  font-size: 12.5px;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
}

.import-label:hover {
  color: var(--text);
  border-color: var(--purple);
}

/* Zone principale */
.main-scroll {
  height: 100%;
  overflow-y: auto;
  padding: calc(16px + var(--safe-top)) 22px calc(155px + var(--safe-bottom));
  scroll-behavior: smooth;
}

.tab-view {
  max-width: 960px;
  margin: 0 auto;
}

.tab-view[hidden] {
  display: none;
}

.page-top {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.page-heading {
  margin: 0;
  font-size: 26px;
  font-weight: 900;
  letter-spacing: -0.03em;
  flex: 1 1 auto;
}

.top-actions {
  display: flex;
  gap: 8px;
}

.circle-top-btn {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 17px;
  font-weight: 700;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.circle-top-btn.is-purple {
  background: var(--purple);
  border-color: var(--purple);
  color: #fff;
}

/* Grille rapide Accueil (2 colonnes sur mobile, 4 sur grand écran) */
.quick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
  gap: 10px;
  margin-bottom: 26px;
}

.quick-tile {
  background: var(--surface);
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 10px;
  padding-right: 10px;
  cursor: pointer;
  border: 1px solid var(--border);
  transition: background 0.14s, transform 0.12s;
}

.quick-tile:hover {
  background: var(--surface-hover);
}

.quick-tile:active {
  transform: scale(0.98);
}

.quick-tile-cover {
  width: 54px;
  height: 54px;
  background: linear-gradient(135deg, #6d28d9, #db2777);
  flex-shrink: 0;
  display: grid;
  place-items: center;
  font-size: 20px;
  overflow: hidden;
}

.quick-tile-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.quick-tile-title {
  font-size: 12.5px;
  font-weight: 800;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Carrousel horizontal (Écouté récemment & Playlists) */
.home-block {
  margin-bottom: 28px;
}

.block-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.block-title {
  margin: 0;
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.block-sub {
  margin: 2px 0 0;
  font-size: 12.5px;
  color: var(--muted);
}

.h-carousel,
.playlists-carousel {
  display: flex;
  gap: 13px;
  overflow-x: auto;
  padding-bottom: 6px;
  scrollbar-width: none;
}

.h-carousel::-webkit-scrollbar,
.playlists-carousel::-webkit-scrollbar {
  display: none;
}

.square-card {
  width: 128px;
  flex-shrink: 0;
  cursor: pointer;
}

.square-art {
  width: 128px;
  height: 128px;
  border-radius: 10px;
  background: var(--surface-2);
  overflow: hidden;
  margin-bottom: 7px;
  display: grid;
  place-items: center;
  font-size: 28px;
  position: relative;
}

.square-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Mosaïque 2x2 pour les playlists (comme Deezer Capture 5) */
.mosaic-grid {
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
}

.mosaic-grid img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.square-card-title {
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.square-card-sub {
  font-size: 11.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Liste média (Recherches, Bibliothèque, Suggestions) */
.media-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.media-row {
  display: grid;
  grid-template-columns: 50px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 7px 8px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.12s;
}

.media-row:hover {
  background: var(--surface);
}

.media-row.is-active {
  background: rgba(168, 85, 247, 0.15);
}

.media-row.is-active .media-title {
  color: var(--purple-bright);
}

.media-thumb {
  width: 50px;
  height: 50px;
  border-radius: 7px;
  background: var(--surface-2);
  overflow: hidden;
  display: grid;
  place-items: center;
  font-size: 18px;
  position: relative;
}

.media-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.media-info {
  min-width: 0;
}

.media-title {
  font-size: 14.5px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.media-sub {
  font-size: 12.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 6px;
}

.offline-dot {
  color: var(--green);
  font-weight: 800;
  font-size: 11px;
}

.media-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.ghost-icon-btn {
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 17px;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.ghost-icon-btn:hover {
  color: var(--text);
  background: var(--surface-2);
}

.ghost-icon-btn.is-fav {
  color: var(--purple);
}

/* Coups de cœur showcase (Capture 5) */
.fav-showcase-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px;
  margin-bottom: 24px;
}

.fav-showcase-head {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  margin-bottom: 8px;
}

.fav-heart-box {
  width: 54px;
  height: 54px;
  border-radius: 12px;
  background: linear-gradient(135deg, #7e22ce, #a855f7);
  display: grid;
  place-items: center;
  font-size: 24px;
}

.fav-showcase-meta {
  flex: 1 1 auto;
}

.fav-showcase-title {
  font-size: 16px;
  font-weight: 800;
}

.play-round-sm {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  border: none;
  background: #fff;
  color: #09090f;
  font-size: 14px;
  font-weight: 900;
  cursor: pointer;
}

/* Collection Detail */
.back-btn {
  border: none;
  background: transparent;
  color: var(--purple-bright);
  font-size: 14px;
  font-weight: 700;
  padding: 4px 0 14px;
  cursor: pointer;
}

.collection-hero {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}

.collection-hero-cover {
  width: 104px;
  height: 104px;
  border-radius: 14px;
  background: linear-gradient(135deg, #7e22ce, #ec4899);
  display: grid;
  place-items: center;
  font-size: 38px;
  overflow: hidden;
  flex-shrink: 0;
}

.collection-title {
  margin: 0;
  font-size: 22px;
  font-weight: 900;
}

.collection-btns {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

/* Explorer & Studio Cards */
.hero-mix-card {
  background: linear-gradient(135deg, #581c87, #9d174d);
  border-radius: 18px;
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 16px;
}

.eyebrow {
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.08em;
  opacity: 0.85;
}

.hero-mix-title {
  margin: 4px 0 6px;
  font-size: 20px;
  font-weight: 900;
}

.hero-mix-desc {
  margin: 0;
  font-size: 13px;
  opacity: 0.9;
  max-width: 480px;
}

.settings-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 15px;
  padding: 16px;
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.settings-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.settings-title {
  font-weight: 800;
  font-size: 14.5px;
}

.settings-desc {
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 2px;
  word-break: break-all;
}

.switch-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  padding-top: 6px;
  border-top: 1px solid var(--border);
  cursor: pointer;
}

.server-input-row {
  display: flex;
  gap: 8px;
}

.dark-input {
  flex: 1 1 auto;
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 13.5px;
}

.tiny-hint {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}

.badge-purple {
  background: rgba(168, 85, 247, 0.2);
  color: var(--purple-bright);
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.badge-status {
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 800;
  background: var(--surface-2);
  color: var(--muted);
  white-space: nowrap;
}

.badge-status.is-ok {
  background: rgba(16, 185, 129, 0.2);
  color: var(--green);
}

/* Recherche (Capture 2) */
.search-sticky-bar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(7, 7, 12, 0.9);
  backdrop-filter: blur(12px);
  padding: 4px 0 14px;
}

.search-form-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.search-input-wrap {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface-2);
  border-radius: 12px;
  padding: 0 12px;
}

.search-icon {
  font-size: 14px;
  opacity: 0.7;
}

.search-pill-input {
  width: 100%;
  border: none;
  background: transparent;
  color: var(--text);
  padding: 11px 0;
  font-size: 15px;
}

.search-pill-input:focus {
  outline: none;
}

.cancel-search-btn {
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

/* Boutons communs */
.primary-pill-btn {
  border: none;
  background: #fff;
  color: #09090f;
  padding: 9px 18px;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 800;
  cursor: pointer;
}

.pill-btn {
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
}

.pill-btn.is-danger {
  color: var(--danger);
}

.filter-chips {
  display: flex;
  gap: 6px;
}

.chip {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.chip.is-active {
  background: var(--purple);
  border-color: var(--purple);
  color: #fff;
}

/* MINI-PLAYER FLOTTANT (Capture 2 & 4) */
.mini-player {
  position: fixed;
  left: 262px;
  right: 16px;
  bottom: 14px;
  height: 58px;
  background: rgba(28, 28, 43, 0.96);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  padding: 0 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  z-index: 30;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.55);
  overflow: hidden;
}

.mini-player[hidden] {
  display: none;
}

.mini-tap-zone {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  height: 100%;
}

.mini-cover {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: var(--surface);
  overflow: hidden;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.mini-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.mini-info {
  min-width: 0;
}

.mini-title {
  font-size: 13.5px;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mini-artist {
  font-size: 11.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mini-actions {
  display: flex;
  align-items: center;
  gap: 2px;
}

.mini-play-btn {
  border: none;
  background: transparent;
  color: #fff;
  font-size: 19px;
  width: 36px;
  height: 36px;
  cursor: pointer;
}

.mini-progress-track {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2.5px;
  background: rgba(255, 255, 255, 0.1);
}

.mini-progress-fill {
  height: 100%;
  width: 0%;
  background: var(--purple-bright);
}

/* Barre d'onglets Mobile (cachée sur Desktop) */
.mobile-tabbar {
  display: none;
}

/* LECTEUR PLEIN ÉCRAN COULEUR DYNAMIQUE (Style Deezer Capture 3) */
.full-player {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: linear-gradient(180deg, var(--fp-color-1) 0%, var(--fp-color-2) 100%);
  padding: calc(14px + var(--safe-top)) 22px calc(18px + var(--safe-bottom));
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: background 0.5s ease;
}

.full-player[hidden] {
  display: none;
}

.fp-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.fp-header-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
}

.fp-eyebrow {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.09em;
  opacity: 0.8;
}

.fp-header-sub {
  font-size: 13px;
  font-weight: 800;
  max-width: 220px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fp-stage {
  flex: 1 1 auto;
  display: grid;
  place-items: center;
  min-height: 0;
  padding: 14px 0;
}

.fp-stage[hidden],
.fp-queue-stage[hidden],
.fp-cf-drawer[hidden] {
  display: none;
}

.fp-cover-wrap {
  width: min(330px, 76vw, 42vh);
  height: min(330px, 76vw, 42vh);
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.28);
  box-shadow: 0 24px 50px rgba(0, 0, 0, 0.48);
  overflow: hidden;
  display: grid;
  place-items: center;
}

.fp-cover-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.fp-cover-placeholder {
  font-size: 42px;
  font-weight: 900;
  opacity: 0.65;
}

/* Vue File d'attente & Suggestions intégrée dans le lecteur */
.fp-queue-stage {
  flex: 1 1 auto;
  overflow-y: auto;
  margin: 10px 0;
  padding-right: 4px;
}

.fp-queue-block {
  margin-bottom: 18px;
}

.fp-queue-row-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.fp-queue-heading {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 800;
}

.fp-tiny {
  font-size: 11px;
  opacity: 0.75;
}

.fp-queue-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.fp-bottom {
  max-width: 480px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.fp-quick-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.fp-quick-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.fp-icon-btn {
  border: none;
  background: transparent;
  color: #fff;
  font-size: 20px;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  cursor: pointer;
  opacity: 0.9;
}

.fp-icon-btn.is-active {
  color: #fff;
  background: rgba(255, 255, 255, 0.22);
}

.fp-cf-pill {
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(0, 0, 0, 0.2);
  color: #fff;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
}

.fp-cf-drawer {
  background: rgba(0, 0, 0, 0.28);
  padding: 9px 12px;
  border-radius: 12px;
  font-size: 12px;
}

.fp-cf-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 5px;
}

.fp-times {
  display: flex;
  justify-content: space-between;
  font-size: 11.5px;
  opacity: 0.82;
  font-variant-numeric: tabular-nums;
  margin-bottom: 4px;
}

.fp-range {
  width: 100%;
  accent-color: #fff;
  cursor: pointer;
  height: 4px;
}

.fp-track-titles {
  text-align: center;
}

.fp-title {
  font-size: 19px;
  font-weight: 900;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fp-artist {
  font-size: 14px;
  opacity: 0.85;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fp-transport {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 10px;
}

.fp-skip-btn {
  border: none;
  background: transparent;
  color: #fff;
  font-size: 25px;
  cursor: pointer;
}

.fp-play-btn {
  width: 62px;
  height: 62px;
  border-radius: 999px;
  border: none;
  background: #fff;
  color: #09090f;
  font-size: 24px;
  font-weight: 900;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.fp-footer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.fp-mix-pill {
  border: none;
  background: rgba(0, 0, 0, 0.25);
  color: rgba(255, 255, 255, 0.85);
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.fp-mix-pill.is-on {
  color: #fff;
  background: rgba(255, 255, 255, 0.2);
}

/* Dialogs & Bottom Sheets */
.sheet-dialog {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 20px;
  padding: 0;
  width: min(400px, 94vw);
}

.sheet-dialog::backdrop {
  background: rgba(0, 0, 0, 0.68);
}

.sheet-card {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sheet-title {
  margin: 0;
  font-size: 17px;
  font-weight: 800;
}

.sheet-header {
  font-weight: 800;
  font-size: 14.5px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.sheet-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 280px;
  overflow-y: auto;
}

.sheet-action-btn {
  border: none;
  background: var(--surface-2);
  color: var(--text);
  padding: 11px 14px;
  border-radius: 11px;
  text-align: left;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.sheet-action-btn.is-danger {
  color: var(--danger);
}

.sheet-cancel-btn {
  border: none;
  background: transparent;
  color: var(--muted);
  padding: 8px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.sheet-btn-row {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.empty-msg {
  padding: 24px 16px;
  text-align: center;
  color: var(--muted);
  font-size: 13.5px;
  background: var(--surface);
  border-radius: 12px;
}

.toast-area {
  position: fixed;
  top: calc(14px + var(--safe-top));
  left: 50%;
  transform: translateX(-50%);
  z-index: 80;
  display: flex;
  flex-direction: column;
  gap: 6px;
  pointer-events: none;
}

.toast-pill {
  background: rgba(28, 28, 43, 0.96);
  border: 1px solid rgba(168, 85, 247, 0.45);
  color: #fff;
  padding: 9px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
}

/* Adaptation Mobile (iPhone PWA / Safari) */
@media (max-width: 820px) {
  .app-layout {
    grid-template-columns: 1fr;
  }

  .desktop-sidebar {
    display: none;
  }

  .main-scroll {
    padding: calc(12px + var(--safe-top)) 16px calc(150px + var(--safe-bottom));
  }

  .quick-grid {
    grid-template-columns: 1fr 1fr;
  }

  .mini-player {
    left: 10px;
    right: 10px;
    bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 8px);
  }

  .mobile-tabbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    height: calc(var(--tabbar-h) + var(--safe-bottom));
    padding-bottom: var(--safe-bottom);
    background: rgba(13, 13, 22, 0.94);
    backdrop-filter: blur(18px);
    border-top: 1px solid var(--border);
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    z-index: 40;
  }

  .tabbar-item {
    border: none;
    background: transparent;
    color: var(--muted);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
  }

  .tabbar-icon {
    font-size: 20px;
    line-height: 1;
  }

  .tabbar-item.is-active {
    color: #fff;
  }

  .tabbar-item.is-active .tabbar-icon {
    background: rgba(168, 85, 247, 0.28);
    color: var(--purple-bright);
    padding: 3px 14px;
    border-radius: 999px;
  }
}
