/* Entrega de artes finales — mismo lenguaje que Historias:
   carbón, píldoras, sombras profundas y el lima solo para lo principal. */
:root {
  --fondo: #171717;
  --panel: #1d1d1d;
  --borde: #2c2c2c;
  --texto: #f2f2f2;
  --suave: #9a9a9a;
  --lima: #e1fb52;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--fondo);
  color: var(--texto);
  font: 14px/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
button { font: inherit; color: inherit; }
button:focus:not(:focus-visible) { outline: none; }
:focus-visible { outline: 2px solid var(--lima); outline-offset: 2px; }

/* ---------- Barra superior ---------- */
.barra {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  padding: 12px 28px;
  background: rgba(23, 23, 23, 0.82);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  backdrop-filter: blur(14px) saturate(1.4);
  border-bottom: 1px solid var(--borde);
}
.marca { display: flex; align-items: center; gap: 10px; min-width: 0; font-weight: 700; letter-spacing: -0.01em; }
.marca span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.punto { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--lima); }

/* ---------- Selector de marca ---------- */
.marcas { display: flex; gap: 6px; padding-top: 28px; overflow-x: auto; scrollbar-width: none; }
.marcas::-webkit-scrollbar { display: none; }
.marcas[hidden] { display: none; }
.marcas button {
  flex: none;
  padding: 8px 18px;
  border: 1px solid var(--borde);
  border-radius: 999px;
  background: none;
  color: var(--suave);
  font: inherit;
  font-size: 14px;
  font-weight: 650;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
}
.marcas button:hover { color: var(--texto); background: #262626; }
.marcas button[aria-pressed="true"] { background: var(--texto); border-color: var(--texto); color: #171717; }
.marcas + .hero { padding-top: 24px; }

.selector-mes { display: flex; align-items: center; gap: 4px; }
.flecha {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--suave);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}
.flecha:hover:not(:disabled) { color: var(--texto); background: #262626; }
.flecha:disabled { opacity: 0.3; cursor: default; }
.mes-nombre {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 16px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: none;
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.mes-nombre:hover, .mes-nombre[aria-expanded="true"] { background: #262626; border-color: var(--borde); }
.flechita { color: var(--lima); font-size: 11px; }

.search { position: relative; display: flex; align-items: center; justify-self: end; width: min(260px, 100%); }
.search svg { position: absolute; left: 13px; width: 15px; height: 15px; color: var(--suave); pointer-events: none; }
.search input {
  width: 100%;
  height: 36px;
  padding: 0 36px;
  border: 1px solid var(--borde);
  border-radius: 999px;
  background: #111;
  color: var(--texto);
  font: inherit;
  transition: border-color 0.15s;
}
.search input::placeholder { color: var(--suave); }
.search input:focus { outline: none; border-color: #555; }
.search input::-webkit-search-cancel-button { display: none; }
.search kbd {
  position: absolute;
  right: 10px;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border: 1px solid var(--borde);
  border-radius: 5px;
  color: var(--suave);
  font: 11px var(--font);
}
.search input:not(:placeholder-shown) ~ kbd, .search input:focus ~ kbd { display: none; }

/* ---------- Menús desplegables ---------- */
.menu-wrap { position: relative; }
.menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 40;
  min-width: 260px;
  max-height: min(60vh, 420px);
  overflow-y: auto;
  padding: 6px;
  background: var(--panel);
  border: 1px solid #333;
  border-radius: 14px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55);
}
.menu-centro { left: 50%; transform: translateX(-50%); }
.menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-radius: 9px;
  background: none;
  text-align: left;
  cursor: pointer;
}
.menu-item:hover { background: #2a2a2a; }
.menu-item .tick { flex: none; width: 7px; height: 7px; border-radius: 50%; background: transparent; }
.menu-item[aria-selected="true"] .tick { background: var(--lima); }
.menu-item .nom { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-item .det { color: var(--suave); font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.menu-sep { height: 1px; margin: 6px 4px; background: var(--borde); }

/* ---------- Cabecera del mes ---------- */
.pagina { max-width: 1480px; margin: 0 auto; padding: 0 28px 96px; }
.hero { padding: 30px 0 4px; }
.eyebrow { margin: 0 0 8px; font-size: 11px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--suave); }
.hero h1 { margin: 0; font-size: clamp(34px, 5vw, 60px); line-height: 1; font-weight: 650; letter-spacing: -0.04em; }
.hero h1 .anio { color: #5a5a5a; font-weight: 500; }
.hero-meta { margin: 10px 0 0; color: var(--suave); font-size: 14px; }

/* ---------- Filtros ---------- */
.filtros { display: flex; flex-direction: column; gap: 10px; padding: 22px 0 0; }
.fila { display: flex; align-items: baseline; gap: 14px; }
.fila-label { flex: none; width: 74px; color: var(--suave); font-size: 11px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; min-width: 0; }
.chip { display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 14px; border: 1px solid var(--borde); border-radius: 999px; background: none; color: var(--texto); font-size: 13px; cursor: pointer; white-space: nowrap; transition: background 0.15s, border-color 0.15s, color 0.15s; }
.chip small { color: var(--suave); font-size: 12px; font-variant-numeric: tabular-nums; }
.chip:hover { border-color: #555; }
.chip[aria-pressed="true"] { border-color: #f2f2f2; background: #f2f2f2; color: #171717; font-weight: 600; }
.chip[aria-pressed="true"] small { color: #555; }
/* «Todos» (estado por defecto) en voz baja: lo más llamativo de la página debe ser el arte, no un filtro. */
.chip.todos[aria-pressed="true"] { border-color: #3a3a3a; background: #232323; color: var(--texto); font-weight: 600; }
.chip.todos[aria-pressed="true"] small { color: var(--suave); }
.pildora {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 16px;
  border: 1px solid var(--borde);
  border-radius: 999px;
  background: #111;
  color: var(--texto);
  font-size: 13px;
  cursor: pointer;
  transition: border-color 0.15s;
}
.pildora:hover, .pildora[aria-expanded="true"] { border-color: #555; }
.pildora.activa { border-color: var(--lima); }

/* Segmentado (lo usa el visor para cambiar entre post y story). */
.seg { display: inline-flex; padding: 3px; background: #111; border: 1px solid var(--borde); border-radius: 999px; }
.seg button {
  height: 32px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--suave);
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.15s, background 0.15s;
}
.seg button:hover { color: var(--texto); }
.seg button[aria-pressed="true"] { background: #f2f2f2; color: #171717; font-weight: 600; }

.status { margin: 40px 0 0; color: var(--suave); }
.status:empty { display: none; }

/* ---------- Catálogo: una tarjeta por pieza, todas del mismo tamaño ---------- */
/* Entre grupos hay mucho más aire que dentro de uno, y el encabezado va ligero: es una etiqueta, no un título. */
.grupos { display: flex; flex-direction: column; gap: 76px; margin-top: 30px; }
.grupo-head { display: flex; align-items: baseline; gap: 12px; margin: 0 0 22px; padding-bottom: 12px; border-bottom: 1px solid #242424; }
.grupo-head h2 { margin: 0; color: var(--suave); font-size: 12px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; }
.grupo-head span { color: #6d6d6d; font-size: 12px; font-variant-numeric: tabular-nums; }
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 16px 26px;
}
.card { display: flex; flex-direction: column; gap: 14px; min-width: 0; padding-top: 20px; } /* el espacio de arriba es para el mazo de láminas */

/* Portada: un solo arte, como un póster. Todo lo demás (copy, formatos) está al abrirla. */
.cover {
  --radius: 16px;
  position: relative;
  isolation: isolate;
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  padding: 0;
  border: 0;
  border-radius: var(--radius);
  background: none;
  color: var(--suave);
  cursor: zoom-in;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.42), 0 2px 6px rgba(0, 0, 0, 0.3);
  transition: transform 0.45s cubic-bezier(0.2, 0.7, 0.2, 1), box-shadow 0.45s;
}
.cover:hover, .cover:focus-visible { transform: translateY(-6px); box-shadow: 0 30px 60px -14px var(--glow, rgba(0, 0, 0, 0.6)), 0 8px 18px rgba(0, 0, 0, 0.4); }
.face { position: absolute; inset: 0; overflow: hidden; border-radius: inherit; background: linear-gradient(160deg, var(--c0, #262626), var(--c1, #1a1a1a)); }
.face img { display: block; width: 100%; height: 100%; object-fit: contain; opacity: 0; transition: opacity 0.45s ease; }
.face img.is-in { opacity: 1; }
.face .ph { display: grid; place-items: center; height: 100%; font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; }
.play { position: absolute; left: 12px; top: 12px; width: 24px; height: 24px; color: #fff; filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.6)); pointer-events: none; }
.play svg { width: 100%; height: 100%; fill: currentColor; stroke: none; }

/* Mazo: si la carpeta tiene más diseños, asoman láminas detrás de la portada y se abren al pasar el cursor. */
.card.multi .cover::before, .card.multi .cover::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: var(--radius);
  background: linear-gradient(160deg, var(--c0, #2a2a2a), var(--c1, #1c1c1c));
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
  transform-origin: 50% 100%;
  transition: transform 0.5s cubic-bezier(0.2, 0.7, 0.2, 1), opacity 0.5s;
}
.card.multi .cover::before { transform: translateY(-9px) scale(0.94); opacity: 0.7; filter: brightness(0.8); }
.card.multi .cover::after { transform: translateY(-18px) scale(0.88); opacity: 0.4; filter: brightness(0.6); }
.card.multi .cover:hover::before { transform: translateY(-13px) scale(0.95) rotate(-1.6deg); }
.card.multi .cover:hover::after { transform: translateY(-24px) scale(0.9) rotate(1.4deg); }

.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.card-text { min-width: 0; }
.card-title { margin: 0; overflow: hidden; font-size: 19px; font-weight: 650; letter-spacing: -0.02em; line-height: 1.25; text-overflow: ellipsis; white-space: nowrap; }
.card-meta { margin: 2px 0 0; color: var(--suave); font-size: 13px; }

/* Botón de descarga de la tarjeta: siempre visible, discreto; con dos formatos abre un menú. */
/* La descarga aparece cuando se necesita (cursor sobre la tarjeta o foco de teclado); en pantallas táctiles, siempre. */
.card-dl-wrap { position: relative; flex: none; opacity: 0; transition: opacity 0.2s; }
.card:hover .card-dl-wrap, .card:focus-within .card-dl-wrap, .card-dl-wrap:has(.card-menu:not([hidden])) { opacity: 1; }
@media (hover: none) { .card-dl-wrap { opacity: 1; } }
.card-dl { display: grid; place-items: center; width: 34px; height: 34px; border: 1px solid var(--borde); border-radius: 50%; background: none; color: var(--texto); cursor: pointer; text-decoration: none; transition: background 0.15s, border-color 0.15s, color 0.15s; }
.card-dl svg { width: 16px; height: 16px; }
.card-dl:hover, .card-dl[aria-expanded="true"] { border-color: var(--lima); background: var(--lima); color: #171717; }
.card-menu { left: auto; right: 0; min-width: 210px; }
a.menu-item { color: var(--texto); text-decoration: none; }

/* ---------- Visor: escena cinematográfica ---------- */
dialog#viewer {
  width: 100vw;
  max-width: 100vw;
  height: 100dvh;
  max-height: 100dvh;
  margin: 0;
  padding: 0;
  border: 0;
  overflow: hidden;
  background: transparent; /* el fondo lo pone .v-ambient, para poder apagarlo sin tocar la imagen */
  color: var(--texto);
}
dialog#viewer::backdrop { background: transparent; }
dialog#viewer[open] { display: grid; grid-template-rows: auto minmax(0, 1fr); }

.v-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 40px; }
.v-month { color: rgba(255, 255, 255, 0.72); font-size: 12px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; }
.v-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.07);
  color: inherit;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.v-icon:hover { background: rgba(255, 255, 255, 0.18); }
.v-icon svg { width: 20px; height: 20px; }

/* Escena: el arte grande a la izquierda; a la derecha, título, ficha, descarga y el carril. */
.v-scene { display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(360px, 0.88fr); gap: 64px; min-height: 0; padding: 0 64px 40px; }
.v-stage { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); place-items: center; min-width: 0; min-height: 0; overflow: visible; } /* visible: la sombra del arte sobresale de su caja y no debe recortarse */
.v-stage img, .v-stage video {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 10px;
  box-shadow: 0 28px 64px -8px rgba(0, 0, 0, 0.6), 0 6px 18px rgba(0, 0, 0, 0.35);
}
.v-cargando { position: absolute; left: 50%; bottom: 18%; transform: translateX(-50%); padding: 8px 16px; border-radius: 999px; background: rgba(0, 0, 0, 0.62); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); color: #fff; font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; pointer-events: none; }
.v-stage iframe { width: min(100%, 980px); aspect-ratio: 16 / 9; border: 0; border-radius: 10px; background: #000; }

/* Posiciones fijas: el contenido va arriba y el carril abajo, así que no se mueve haya o no descripción. */
.v-side {
  --ficha-h: clamp(112px, 19vh, 190px);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 18px;
  min-width: 0;
  min-height: 0;
  padding: 8px 8px 12px 28px; /* el relleno deja sitio a las sombras, que si no se recortan */
  margin-left: -28px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
}
.v-side::-webkit-scrollbar { display: none; }
.v-foot { display: flex; flex-direction: column; gap: 16px; margin-top: auto; padding-top: 8px; }
.v-eyebrow { margin: 0; height: 1.3em; overflow: hidden; color: rgba(255, 255, 255, 0.75); font-size: 12px; font-weight: 600; letter-spacing: 0.16em; line-height: 1.3; text-overflow: ellipsis; text-transform: uppercase; white-space: nowrap; }
.v-title {
  --title-max: clamp(48px, min(6.4vw, 11vh), 104px);
  display: flex;
  align-items: center;
  margin: 0;
  min-height: calc(var(--title-max) * 0.92); /* siempre la misma altura, aunque el título se achique para caber */
  font-family: var(--display, "Barlow Condensed", "Inter", system-ui, sans-serif);
  font-size: var(--title-max);
  font-weight: var(--d-w, 700);
  line-height: 0.92;
  letter-spacing: var(--d-track, -0.005em);
  text-transform: uppercase;
  white-space: nowrap; /* una sola línea; si no cabe, JS reduce el tamaño */
}

/* Ficha de la hoja: estado, campaña, tipo y copy. */
.v-chips { display: flex; flex: none; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.v-chip { display: inline-flex; align-items: center; gap: 7px; height: 28px; padding: 0 12px; border: 1px solid rgba(255, 255, 255, 0.2); border-radius: 999px; color: var(--texto); font-size: 12px; white-space: nowrap; }
.v-chip i { width: 7px; height: 7px; border-radius: 50%; background: #777; }
.v-chip.on i { background: var(--lima); }
.v-ficha { display: flex; flex-direction: column; height: var(--ficha-h); min-height: var(--ficha-h); }
.v-ficha.vacia { justify-content: flex-start; }
.v-ficha.compacta { height: auto; min-height: 42px; } /* solo las etiquetas: sin la altura que se reserva para el copy */
.v-ficha.compacta .v-chips { margin-bottom: 0; }
.v-copy-text { flex: 1; min-height: 0; margin: 0 0 14px; padding-right: 8px; overflow-y: auto; color: rgba(255, 255, 255, 0.86); font-size: 14px; line-height: 1.6; white-space: pre-wrap; scrollbar-width: thin; }
.v-copy-vacio { margin: 0; color: rgba(255, 255, 255, 0.6); font-size: 13px; }
.v-copiar { flex: none; align-self: flex-start; height: 40px; padding: 0 18px; border: 1px solid rgba(255, 255, 255, 0.24); border-radius: 999px; background: none; color: var(--texto); font-size: 13px; font-weight: 600; cursor: pointer; transition: background 0.15s, border-color 0.15s, color 0.15s; }
.v-copiar:hover { border-color: var(--lima); background: var(--lima); color: #171717; }
.v-copiar.hecho { border-color: var(--lima); color: var(--lima); }
.v-copiar.hecho:hover { color: #171717; }

/* Tira de miniaturas: todos los diseños de la carpeta, para saltar de uno a otro. */
.v-strip { display: flex; gap: 10px; max-width: 100%; min-height: 88px; padding: 2px 4px 6px 0; overflow-x: auto; scrollbar-width: none; }
.v-strip.vacia { visibility: hidden; } /* con un solo diseño se reserva el sitio, para que nada se mueva */
.v-strip::-webkit-scrollbar { display: none; }
.v-strip button { flex: none; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 6px 8px 7px; border: 1px solid transparent; border-radius: 12px; background: rgba(255, 255, 255, 0.07); color: rgba(255, 255, 255, 0.7); font-size: 11px; cursor: pointer; transition: background 0.15s, border-color 0.15s, color 0.15s; }
.v-strip button:hover { background: rgba(255, 255, 255, 0.14); color: var(--texto); }
.v-strip button[aria-pressed="true"] { border-color: var(--lima); color: var(--texto); }
.v-strip img { display: block; height: 52px; width: auto; border-radius: 6px; }

.v-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.v-download {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 50px;
  padding: 0 28px;
  border-radius: 999px;
  background: var(--lima);
  color: #171717;
  font-weight: 700;
  text-decoration: none;
  transition: transform 0.15s, filter 0.15s;
}
.v-download:hover { transform: translateY(-1px); filter: brightness(1.06); }
.v-download svg { width: 18px; height: 18px; }

/* Carril de las siguientes piezas, flechas, barra de progreso y contador. */
.v-rail { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 10px 12px; padding-bottom: 6px; }
.v-rail-title { flex: 0 0 100%; margin: 0; overflow: hidden; color: rgba(255, 255, 255, 0.7); font-size: 11px; font-weight: 650; letter-spacing: 0.14em; text-overflow: ellipsis; text-transform: uppercase; white-space: nowrap; }
.v-railcard {
  display: flex;
  flex: none;
  flex-direction: column;
  gap: 4px;
  width: clamp(76px, min(7.4vw, 12vh), 112px);
  padding: 0;
  border: 0;
  background: none;
  color: var(--texto);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.v-railpic {
  position: relative;
  display: block;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 12px;
  background: #202020;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.45);
  transition: transform 0.35s cubic-bezier(0.2, 0.7, 0.2, 1), box-shadow 0.35s;
}
.v-railcard:hover .v-railpic { transform: translateY(-4px); box-shadow: 0 22px 40px rgba(0, 0, 0, 0.55); }
.v-railpic img { display: block; width: 100%; height: 100%; object-fit: cover; }
.v-railcard strong { overflow: hidden; font-size: 12px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.v-railcard small { overflow: hidden; color: rgba(255, 255, 255, 0.6); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.v-nav-row { display: flex; align-items: center; gap: 14px; }
.v-progress { flex: 1; min-width: 40px; height: 2px; border-radius: 2px; background: rgba(255, 255, 255, 0.22); overflow: hidden; }
.v-progress i { display: block; width: 0; height: 100%; background: var(--lima); transition: width 0.7s cubic-bezier(0.2, 0.8, 0.2, 1); }
.v-count-box { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.v-count-label { max-width: 16em; overflow: hidden; color: rgba(255, 255, 255, 0.6); font-size: 11px; font-weight: 600; letter-spacing: 0.12em; text-overflow: ellipsis; text-transform: uppercase; white-space: nowrap; }
.v-count { min-width: 3.4em; font-family: var(--display, "Barlow Condensed", "Inter", system-ui, sans-serif); font-size: 30px; font-weight: var(--d-w, 600); font-variant-numeric: tabular-nums; letter-spacing: 0.02em; text-align: right; }

/* ---------- Movimiento y ambiente ---------- */
@keyframes aparece { from { opacity: 0; } to { opacity: 1; } }
@keyframes sube { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* Entrada escalonada de las tarjetas (solo al abrir, al cambiar de mes o de modelo). */
.animar .card { animation: sube 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) both; animation-delay: calc(var(--i, 0) * 40ms); }
.animar .grupo-head { animation: sube 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) both; }

/* Fondo del visor: el propio arte difuminado y saturado, con una viñeta que protege la lectura. */
.v-ambient { position: fixed; inset: 0; z-index: 0; overflow: hidden; background: #0a0a0a; pointer-events: none; }
.v-ambient::after { content: ""; position: absolute; inset: 0; background: radial-gradient(120% 100% at 30% 40%, rgba(10, 10, 10, 0.12), rgba(10, 10, 10, 0.74)); }
/* El fondo es una imagen diminuta ya desenfocada (se genera al sincronizar): el navegador solo la estira. */
.v-ambient i { position: absolute; inset: 0; opacity: 0; background-position: center; background-size: cover; transition: opacity 0.8s ease; will-change: opacity; }
.v-ambient i.on { opacity: 1; }
/* Respaldo si no hay imagen ya desenfocada: el desenfoque lo hace el navegador (más caro). */
.v-ambient i.pesado { inset: -12%; filter: blur(70px) saturate(1.7) brightness(0.8); transform: scale(1.15); }
.v-top, .v-scene { position: relative; z-index: 1; }
.v-stage > * { grid-area: 1 / 1; } /* los diseños se superponen mientras se funden */

dialog#viewer[open] .v-ambient { animation: aparece 0.45s ease both; }
dialog#viewer[open] .v-top { animation: sube 0.5s 0.1s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
dialog#viewer[open] .v-side > * { animation: sube 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
dialog#viewer[open] .v-side > :nth-child(1) { animation-delay: 0.14s; }
dialog#viewer[open] .v-side > :nth-child(2) { animation-delay: 0.2s; }
dialog#viewer[open] .v-side > :nth-child(3) { animation-delay: 0.26s; }
dialog#viewer[open] .v-side > :nth-child(4) { animation-delay: 0.32s; }
dialog#viewer[open] .v-side > :nth-child(5) { animation-delay: 0.38s; }
dialog#viewer[open] .v-side > :nth-child(6) { animation-delay: 0.44s; }
dialog#viewer[open] .v-side > :nth-child(7) { animation-delay: 0.5s; }

.aviso { position: fixed; left: 0; right: 0; bottom: 28px; z-index: 100; width: max-content; max-width: calc(100vw - 32px); margin: 0 auto; padding: 12px 20px; border: 1px solid #444; border-radius: 999px; background: #2a2a2a; color: #fff; font-size: 13px; box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5); animation: sube 0.4s cubic-bezier(0.2, 0.8, 0.2, 1) both; }

/* ---------- Cuenta de Google (solo con DOWNLOAD_MODE=drive) ---------- */
.link {
  padding: 0;
  border: 0;
  background: none;
  color: var(--texto);
  font: inherit;
  text-decoration: underline;
  text-decoration-color: #5a5a5a;
  text-underline-offset: 3px;
  cursor: pointer;
}
.link:hover { text-decoration-color: var(--lima); }

dialog#cuenta {
  width: min(440px, 92vw);
  padding: 26px;
  border: 1px solid #333;
  border-radius: 20px;
  background: var(--panel);
  color: var(--texto);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.65);
}
dialog#cuenta::backdrop { background: rgba(0, 0, 0, 0.6); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
#cuenta-titulo { margin: 0 0 10px; font-size: 19px; font-weight: 650; letter-spacing: -0.02em; }
.cuenta-texto { margin: 0 0 18px; color: var(--suave); font-size: 13.5px; }
#cuenta-email {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border: 1px solid var(--borde);
  border-radius: 12px;
  background: #111;
  color: var(--texto);
  font: inherit;
}
#cuenta-email:focus { outline: none; border-color: var(--lima); }
.cuenta-error { min-height: 20px; margin: 8px 0 0; color: #ff8a80; font-size: 12.5px; }
.cuenta-acciones { display: flex; gap: 10px; margin-top: 8px; }
.btn-lima, .btn-suave { height: 44px; padding: 0 22px; border-radius: 999px; font-weight: 600; cursor: pointer; transition: filter 0.15s, background 0.15s; }
.btn-lima { border: 0; background: var(--lima); color: #171717; font-weight: 700; }
.btn-lima:hover { filter: brightness(1.06); }
.btn-suave { border: 1px solid var(--borde); background: none; color: var(--texto); }
.btn-suave:hover { background: #262626; }
.cuenta-abrir { display: inline-block; margin-top: 16px; color: var(--suave); font-size: 12.5px; }

@media (max-height: 840px) and (min-width: 901px) {
  .v-side { --ficha-h: 140px; gap: 14px; }
  .v-strip { min-height: 76px; }
  .v-strip img { height: 44px; }
  .v-nav-row { gap: 12px; }
}

/* En pantallas amplias el panel cabe entero: sin desplazamiento (la flecha abajo no debe llevar a ningún lado). */
@media (min-width: 901px) and (min-height: 760px) {
  .v-side { overflow: hidden; }
}

/* ---------- Visor en pantallas medianas y móviles: todo en una columna que se desplaza ---------- */
@media (max-width: 900px) {
  dialog#viewer[open] { display: block; overflow-y: auto; }
  .v-top { position: sticky; top: 0; z-index: 3; padding: 12px 16px; background: linear-gradient(rgba(10, 10, 10, 0.85), transparent); }
  .v-scene { display: flex; flex-direction: column; gap: 22px; padding: 0 16px 32px; }
  .v-stage { flex: none; height: 58vh; }
  .v-side { --ficha-h: auto; overflow: visible; margin-left: 0; padding: 0 0 8px; }
  .v-ficha { height: auto; min-height: 0; }
  .v-foot { margin-top: 8px; }
  .v-title { font-size: clamp(44px, 13vw, 72px); }
  .v-rail { margin: 8px -16px 0; padding: 0 16px 4px; overflow-x: auto; scrollbar-width: none; }
  .v-rail::-webkit-scrollbar { display: none; }
}

/* ---------- Móvil ---------- */
@media (max-width: 760px) {
  .barra { grid-template-columns: 1fr auto; grid-template-areas: "marca search" "mes mes"; gap: 8px 12px; padding: 10px 16px; }
  .marca { grid-area: marca; }
  .search { grid-area: search; width: 150px; }
  .search kbd { display: none; }
  .selector-mes { grid-area: mes; justify-self: center; }
  .pagina { padding: 0 16px 72px; }
  .marcas { margin: 0 -16px; padding: 18px 16px 0; }
  .hero { padding-top: 32px; }
  .filtros { padding-top: 16px; }
  .fila { flex-direction: column; align-items: stretch; gap: 6px; }
  .fila-label { width: auto; }
  .chips { flex-wrap: nowrap; margin: 0 -16px; padding: 0 16px 2px; overflow-x: auto; scrollbar-width: none; }
  .chips::-webkit-scrollbar { display: none; }
  .grupos { gap: 36px; margin-top: 20px; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
  .cover { --radius: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
