:root {
  --bg: #121212;
  --surface: #181818;
  --surface-2: #282828;
  --text: #ffffff;
  --text-dim: #a7a7a7;
  /* Verde por defecto (estilo Spotify) — se usa en el navegador/PWA. Dentro
     de la app Android, applyThemeColors() los pisa con los colores de
     Material You del wallpaper del usuario (ver app.js / WebAppInterface). */
  --accent: #1ed760;
  --accent-light: #64e896;
  --danger: #e74c3c;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --bottom-nav-height: 58px;
  --mini-player-height: 64px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  overscroll-behavior: none;
  -webkit-font-smoothing: antialiased;
}

.screen {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  /* Sin esto, cualquier pantalla que no fije su propio fondo (Dispositivos,
     Cola, Letras, EQ) queda 100% transparente y se ve todo lo que hay
     detrás mezclado — #player-screen sigue con su propio degradé porque
     una regla más específica le gana a esta. */
  background: var(--bg);
}

/* Sin esto, el atributo HTML "hidden" no alcanza a ganarle en la cascada
   a ".screen{display:flex}" (misma especificidad, y una regla de autor le
   gana a la hoja de estilos del navegador) — las pantallas quedaban todas
   superpuestas al mismo tiempo en vez de ocultarse de verdad. */
.screen[hidden] {
  display: none;
}

/* ── Login ───────────────────────────────────────────────── */

#login-screen {
  align-items: center;
  justify-content: center;
  padding: 24px;
}

#login-form {
  width: 100%;
  max-width: 320px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-align: center;
}

#login-form h1 { margin-bottom: 12px; }

#login-form input, #login-form button {
  padding: 14px 16px;
  border-radius: 12px;
  border: none;
  font-size: 16px;
}

#password-input {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--surface-2);
}

#login-form button {
  background: var(--accent);
  color: white;
  font-weight: 600;
  cursor: pointer;
}

.error { color: var(--danger); min-height: 20px; font-size: 14px; }

/* ── App shell ───────────────────────────────────────────── */

#app { padding-top: var(--safe-top); }

#top-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
}

#header-title {
  flex: 1;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.icon-btn {
  background: none;
  border: none;
  color: var(--text);
  cursor: pointer;
  padding: 6px 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Mismo problema que .screen[hidden]: sin esto, ".icon-btn{display:inline-flex}"
   le gana en la cascada al "hidden" de HTML y el botón de atrás queda
   visible siempre, aunque no haya a dónde volver. */
.icon-btn[hidden] {
  display: none;
}

.icon-btn svg {
  width: 22px;
  height: 22px;
  display: block;
}

#content {
  flex: 1;
  overflow-y: auto;
  padding: 4px 0 calc(var(--bottom-nav-height) + var(--mini-player-height) + var(--safe-bottom) + 20px);
}

/* ── Buscar ──────────────────────────────────────────────── */

#search-input {
  display: block;
  width: calc(100% - 32px);
  margin: 4px 16px 16px;
  padding: 14px 16px 14px 46px;
  border-radius: 4px;
  border: none;
  background: #ffffff;
  color: #000000;
  font-size: 15px;
  font-weight: 600;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='11' cy='11' r='7' fill='none' stroke='%23000000' stroke-width='2.2'/%3E%3Cline x1='16.2' y1='16.2' x2='21' y2='21' stroke='%23000000' stroke-width='2.2' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 14px center;
  background-size: 20px 20px;
}

#search-input::placeholder {
  color: #6a6a6a;
  font-weight: 400;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  padding: 4px 16px 16px;
}

.category-card {
  aspect-ratio: 16 / 10;
  border-radius: 8px;
  padding: 14px;
  color: #ffffff;
  font-size: 17px;
  font-weight: 800;
  cursor: pointer;
  overflow: hidden;
}

/* ── Biblioteca: filtros ─────────────────────────────────── */

#library-filters, .sub-filter-row {
  display: flex;
  overflow-x: auto;
  gap: 6px;
  padding: 4px 16px 12px;
}

.filter-btn {
  flex: none;
  background: var(--surface);
  color: var(--text-dim);
  border: none;
  border-radius: 16px;
  padding: 8px 16px;
  font-size: 14px;
  cursor: pointer;
}

.filter-btn.active {
  background: var(--accent);
  color: white;
}

/* ── DJ con IA ────────────────────────────────────────────── */

#dj-card {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 12px 16px 4px;
  padding: 14px 18px;
  border-radius: 30px;
  background: var(--accent);
  color: #000000;
  font-weight: 800;
  font-size: 15px;
  cursor: pointer;
}

.dj-card-icon svg { width: 20px; height: 20px; display: block; }

/* ── Acceso rápido (Inicio) ───────────────────────────────── */

.quick-pick-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  padding: 12px 16px 8px;
}

.quick-pick {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 56px;
  background: var(--surface-2);
  border-radius: 4px;
  overflow: hidden;
  cursor: pointer;
}

.quick-pick-art, .quick-pick-icon {
  width: 56px;
  height: 56px;
  flex: none;
  object-fit: cover;
  background: var(--surface);
}

.quick-pick-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
}
.quick-pick-icon svg { width: 24px; height: 24px; }

.quick-pick-title {
  font-size: 14px;
  font-weight: 700;
  padding-right: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Tiles (Inicio: filas grandes de scroll) ─────────────── */

.tile-section { margin-bottom: 8px; }

.tile-row {
  display: flex;
  overflow-x: auto;
  gap: 14px;
  padding: 4px 16px 16px;
}

.tile {
  flex: none;
  width: 140px;
  cursor: pointer;
}

.tile-art {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 8px;
  background: var(--surface-2);
  object-fit: cover;
  display: block;
}

.tile-icon {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 8px;
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
}
.tile-icon svg { width: 40%; height: 40%; }

.tile-title {
  margin-top: 8px;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tile-sub {
  font-size: 12px;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.list-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  cursor: pointer;
}

.list-row:active { background: var(--surface); }

.row-kebab-btn {
  flex: none;
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 6px;
  display: flex;
  align-items: center;
}
.row-kebab-btn svg { width: 20px; height: 20px; display: block; }

.list-row-art {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: var(--surface-2);
  object-fit: cover;
  flex: none;
}

.list-row-icon {
  width: 44px;
  height: 44px;
  border-radius: 4px;
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  flex: none;
}
.list-row-icon svg { width: 22px; height: 22px; }

.list-row-text { min-width: 0; flex: 1; }
.list-row-title {
  font-size: 15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.list-row-sub {
  font-size: 13px;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.section-title {
  padding: 18px 16px 10px;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--text);
}

/* ── Header grande de álbum/artista/playlist ──────────────────────── */

.detail-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 24px 24px 20px;
  background: var(--surface);
  transition: background 0.6s ease;
}

.detail-header-art {
  width: min(50vw, 180px);
  height: min(50vw, 180px);
  border-radius: 10px;
  background: var(--surface-2);
  object-fit: cover;
  box-shadow: 0 16px 32px rgba(0,0,0,0.4);
}

.detail-header-icon {
  width: min(50vw, 180px);
  height: min(50vw, 180px);
  border-radius: 10px;
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
}
.detail-header-icon svg { width: 30%; height: 30%; }

.detail-header-title {
  font-size: 22px;
  font-weight: 800;
  margin-top: 16px;
}

.detail-header-sub {
  font-size: 14px;
  color: var(--text-dim);
  margin-top: 4px;
}

.detail-header-actions {
  display: flex;
  align-items: center;
  gap: 22px;
  margin-top: 18px;
}

.detail-header-play {
  background: var(--accent);
  color: #000;
  border: none;
  border-radius: 50%;
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.detail-header-play svg { width: 26px; height: 26px; }

.detail-header-shuffle svg { width: 22px; height: 22px; }

/* ── Filas de canción numeradas (dentro de álbum/playlist) ────────── */

.track-row-num {
  width: 28px;
  flex: none;
  text-align: center;
  color: var(--text-dim);
  font-size: 14px;
}

.empty-state {
  text-align: center;
  color: var(--text-dim);
  padding: 60px 20px;
}

/* ── Mini player ─────────────────────────────────────────── */

#mini-player {
  position: fixed;
  left: 0; right: 0;
  bottom: calc(var(--safe-bottom) + var(--bottom-nav-height));
  height: var(--mini-player-height);
  background: var(--surface-2);
  cursor: pointer;
  z-index: 5;
  overflow: hidden;
}

#mini-progress {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: rgba(255,255,255,0.15);
}

#mini-progress-fill {
  height: 100%;
  width: 0%;
  background: var(--accent);
}

#mini-player-inner {
  height: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px 6px;
}

#mini-art {
  width: 44px;
  height: 44px;
  border-radius: 4px;
  background: var(--surface-2);
  object-fit: cover;
}

#mini-info { flex: 1; min-width: 0; }
#mini-title {
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#mini-artist {
  font-size: 12px;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Full player ─────────────────────────────────────────── */

#player-screen {
  align-items: center;
  padding: calc(var(--safe-top) + 12px) 24px calc(var(--safe-bottom) + 24px);
  /* --player-tint lo fija app.js (extractDominantColor) con el color
     promedio de la carátula actual, como el fondo adaptativo de Spotify. */
  background: radial-gradient(circle at 50% -10%, var(--player-tint, var(--surface)) 0%, var(--bg) 65%);
  transition: background 0.6s ease, transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);
  transform: translateY(100%);
  pointer-events: none;
  /* El reproductor en sí no scrollea — carátula/controles quedan fijos.
     Solo #player-inline-lyrics (más abajo) tiene su propio scroll interno,
     como la tarjeta de letras de Spotify. */
  overflow: hidden;
}

/* Animación estilo Spotify (desliza desde abajo) en vez del corte abrupto
   de mostrar/ocultar: #player-screen se queda siempre en display:flex (el
   selector por id le gana en especificidad a ".screen[hidden]") y la
   visibilidad real la controla la clase .player-visible + transform, que
   app.js coordina con el atributo hidden real (openPlayerScreen/closePlayerScreen). */
#player-screen[hidden] {
  display: flex;
}

#player-screen.player-visible {
  transform: translateY(0);
  pointer-events: auto;
}

#collapse-btn { align-self: flex-start; }
#collapse-btn svg { width: 26px; height: 26px; }

#player-art {
  width: min(70vw, 320px);
  height: min(70vw, 320px);
  border-radius: 10px;
  background: var(--surface-2);
  object-fit: cover;
  margin: 20px auto;
  box-shadow: 0 20px 40px rgba(0,0,0,0.4);
}

#player-title {
  font-size: 20px;
  font-weight: 600;
  text-align: center;
  margin-top: 8px;
}

#player-artist {
  font-size: 15px;
  color: var(--text-dim);
  text-align: center;
  margin-top: 4px;
}

#progress-wrap { width: 100%; margin-top: 28px; }

#progress {
  width: 100%;
  accent-color: var(--accent);
}

#time-row {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 4px;
}

#player-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-top: 24px;
  width: 100%;
}

.icon-btn.big svg { width: 34px; height: 34px; }
.icon-btn.ghost svg { width: 20px; height: 20px; }
.icon-btn.ghost { color: var(--text-dim); }
.icon-btn.ghost.active { color: var(--accent); }

#playpause-btn {
  background: var(--text);
  color: var(--bg);
  border-radius: 50%;
  padding: 14px;
}
#playpause-btn svg { width: 26px; height: 26px; }

/* ── Navegación inferior ─────────────────────────────────── */

#bottom-nav {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  height: calc(var(--bottom-nav-height) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: var(--surface);
  border-top: 1px solid var(--surface-2);
  display: flex;
  z-index: 6;
}

.nav-btn {
  flex: 1;
  background: none;
  border: none;
  color: var(--text-dim);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  cursor: pointer;
}

.nav-btn .nav-icon { display: block; }
.nav-btn .nav-icon svg { width: 22px; height: 22px; display: block; }
.nav-btn .nav-label { font-size: 11px; font-weight: 600; }

.nav-btn.active { color: var(--accent); }

/* ── Volumen ──────────────────────────────────────────────── */

#volume-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin-top: 18px;
}

#volume-row .icon-btn svg { width: 20px; height: 20px; }

#volume-slider {
  flex: 1;
  accent-color: var(--accent, #1db954);
}

/* ── Controles secundarios del reproductor ───────────────── */

#player-secondary-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 28px;
  margin-top: 18px;
  width: 100%;
}

#player-secondary-controls .icon-btn svg { width: 20px; height: 20px; }

/* ── Paneles secundarios (cola / letras / EQ) ────────────── */

.sub-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: calc(var(--safe-top) + 10px) 12px 10px;
}

.sub-header-title {
  font-size: 20px;
  font-weight: 800;
}

#queue-list, #eq-bands, #eq-presets, #lyrics-content {
  overflow-y: auto;
  flex: 1;
}

.queue-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  cursor: grab;
}

.queue-row.dragging { opacity: 0.4; }

.queue-row-art {
  width: 44px;
  height: 44px;
  border-radius: 4px;
  object-fit: cover;
  background: var(--surface-2);
  flex: none;
}

.queue-row-text { flex: 1; min-width: 0; }
.queue-row-title {
  font-size: 15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.queue-row-sub {
  font-size: 13px;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.queue-row-remove {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 20px;
  cursor: pointer;
  padding: 6px 10px;
}

/* ── Letras ───────────────────────────────────────────────── */

#lyrics-content {
  padding: 12px 24px calc(var(--safe-bottom) + 24px);
  text-align: center;
}

.lyrics-line {
  padding: 8px 0;
  font-size: 17px;
  color: var(--text-dim);
  transition: color 0.2s ease, transform 0.2s ease;
}

.lyrics-line.active {
  color: var(--text);
  font-weight: 700;
  transform: scale(1.04);
}

/* ── Ecualizador ──────────────────────────────────────────── */

#eq-presets {
  display: flex;
  flex: none;
  overflow-x: auto;
  gap: 8px;
  padding: 4px 16px 12px;
}

#eq-bands {
  display: flex;
  align-items: flex-end;
  justify-content: space-around;
  padding: 12px 12px calc(var(--safe-bottom) + 24px);
  gap: 6px;
}

.eq-band {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  flex: 1;
}

.eq-band input[type="range"] {
  writing-mode: vertical-lr;
  direction: rtl;
  width: 24px;
  height: 160px;
  accent-color: var(--accent);
}

.eq-band-label {
  font-size: 10px;
  color: var(--text-dim);
}

/* ── Dispositivos ─────────────────────────────────────────── */

.device-row-status {
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.device-row-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-dim);
  flex: none;
}

.device-row.active .device-row-dot { background: var(--accent, #1db954); }
.device-row-status.online .device-row-dot { background: #1db954; }

/* ── Editor de tags (modal) ──────────────────────────────── */

#edit-track-modal, #playlist-picker-modal, #track-context-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20;
  padding: 24px;
}

#edit-track-modal[hidden], #playlist-picker-modal[hidden], #track-context-modal[hidden] { display: none; }

.playlist-picker-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 4px;
  cursor: pointer;
}

#playlist-picker-list { max-height: 240px; overflow-y: auto; margin-bottom: 12px; }

#like-btn.liked { color: #e91429; }

#edit-track-card, #playlist-picker-card, #track-context-card {
  background: var(--surface);
  border-radius: 12px;
  padding: 20px;
  width: 100%;
  max-width: 340px;
}

#edit-track-card h3, #playlist-picker-card h3, #track-context-card h3 { margin: 0 0 2px; }

#track-context-sub {
  color: var(--text-dim);
  font-size: 13px;
  margin-bottom: 14px;
}

.track-context-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 4px;
  cursor: pointer;
}
.track-context-row svg { width: 20px; height: 20px; flex: none; color: var(--text-dim); }

#edit-track-card input, #playlist-picker-card input {
  display: block;
  width: 100%;
  margin-bottom: 10px;
  padding: 12px 14px;
  border-radius: 8px;
  border: none;
  background: var(--surface-2);
  color: var(--text);
  font-size: 15px;
}

#edit-track-actions, #playlist-picker-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 8px;
}

#edit-track-actions button, #playlist-picker-actions button {
  padding: 10px 16px;
  border-radius: 20px;
  border: none;
  font-weight: 600;
  cursor: pointer;
}

#edit-cancel-btn { background: var(--surface-2); color: var(--text); }
#edit-save-btn { background: var(--accent); color: #000; }

/* ── Letras embebidas en el reproductor (como Spotify, en toda pantalla) ── */
/* Se muestran siempre debajo de los controles, angosta o ancha la
   pantalla — el ícono de letras sigue sirviendo para abrirlas en grande. */

#player-inline-lyrics {
  display: block;
  width: 100%;
  margin-top: 20px;
  text-align: center;
  padding-bottom: 12px;
  /* Recuadro propio con su scroll: el resto del reproductor (carátula,
     controles) queda fijo, solo esto se mueve — flex:1 + min-height:0 es
     lo que le permite ocupar el espacio que sobra y scrollear ahí adentro
     en vez de estirar todo #player-screen. */
  flex: 1;
  min-height: 90px;
  overflow-y: auto;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, black 16px, black calc(100% - 16px), transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0, black 16px, black calc(100% - 16px), transparent 100%);
}

/* ── Pantalla ancha (celular plegable desplegado / tablet) ────────── */
/* Igual que Spotify en la pantalla interna del Z Fold: más columnas en
   Inicio/Buscar, y el reproductor completo se acopla como panel lateral
   en vez de taparlo todo, dejando la sección de atrás visible. */

@media (min-width: 700px) {
  .quick-pick-grid { grid-template-columns: repeat(4, 1fr); }
  .category-grid { grid-template-columns: repeat(4, 1fr); }

  /* Cuando el reproductor completo está abierto, se acopla a la derecha
     como un panel fijo (ancho 420px) en vez de cubrir toda la pantalla:
     #app se angosta para dejarle lugar, la sección de atrás (Inicio,
     Biblioteca, etc.) sigue visible a la izquierda. */
  body:has(#player-screen:not([hidden])) #app {
    right: 420px;
  }
  body:has(#player-screen:not([hidden])) #player-screen {
    left: auto;
    width: 420px;
    border-left: 1px solid var(--surface-2);
  }
  /* #bottom-nav es position:fixed con left/right:0 propios — al no ser
     hijo posicionado de #app, angostar #app no lo angosta a él solo, así
     que sin esto seguía estirándose por debajo del panel del reproductor
     y tapaba Inicio/Biblioteca. Se lo achica al mismo ancho que #app. */
  body:has(#player-screen:not([hidden])) #bottom-nav {
    right: 420px;
  }
}

/* El mini-player (la barra angosta de "reproduciendo ahora") queda
   siempre debajo del reproductor completo — en mobile ya quedaba tapado
   porque el reproductor cubre toda la pantalla, pero en el panel acoplado
   de pantalla ancha seguía asomando del lado izquierdo si no se ocultaba
   explícitamente acá. */
body:has(#player-screen:not([hidden])) #mini-player {
  display: none;
}

/* ── Toast (avisos cortos, ej. "no se pudo iniciar el DJ") ────────── */

#toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--bottom-nav-height) + var(--safe-bottom) + 16px);
  transform: translateX(-50%);
  background: var(--surface-2);
  color: var(--text);
  padding: 12px 20px;
  border-radius: 24px;
  font-size: 14px;
  max-width: calc(100% - 48px);
  text-align: center;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  z-index: 30;
  opacity: 1;
  transition: opacity 0.3s ease;
}

#toast[hidden] { display: none; }
#toast.fading { opacity: 0; }
