/* 4WOPIX · Front para clientes
   Un solo sistema de componentes para todas las líneas. Las variables de color (dos juegos: claro y
   oscuro, en html[data-mode]), fuentes, logo y densidad las inyecta PHP; themes.css solo cambia la
   composición de portada, cabecera, títulos y tarjetas de cada línea. */
:root {
    --bg: #ffffff;
    --surface: #fafaf9;
    --text: #1c1917;
    --muted: #78716c;
    --line: #e7e5e4;
    --accent: #1c1917;
    --accent-text: #ffffff;
    --tile-bg: #f5f5f4;
    --fav: #d9304c;
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-title: var(--font);
    --title-weight: 500;
    --gap: 8px;
    --max: 1400px;
    --pad-scale: 1;
    --pad: calc(clamp(16px, 3.2vw, 40px) * var(--pad-scale));
    --logo-h: 44px;
    --tile-radius: 0px;
    --ui-radius: 3px;
    --row-scale: 1;
    --hdr-h: 68px;
    --ease: cubic-bezier(.2, .7, .2, 1);
    --label-track: .14em;
}
* { box-sizing: border-box; }
/* overflow-x: clip evita scroll horizontal por las portadas a sangre (100vw) sin crear contexto de scroll: sticky sigue funcionando. */
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; overflow-x: clip; }
body { margin: 0; font: 16px/1.6 var(--font); color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; overflow-x: clip; transition: background-color .3s, color .3s; }
a { color: inherit; }
img { max-width: 100%; height: auto; display: block; }
svg { display: block; }
[hidden] { display: none !important; }
h1, h2 { margin: 0; font-family: var(--font-title); font-weight: var(--title-weight); line-height: 1.15; }
h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); }
h2 { font-size: 1.3rem; }
p { margin: 0 0 .6em; }
.muted { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
/* Etiqueta pequeña en mayúsculas: misma voz en migas, contadores, filtros, botones y pie */
.eyebrow, .card-meta, .section-title, .crumbs, .chip, .btn, .cover-cta, .site-footer, .reviewer-chip { letter-spacing: var(--label-track); }

/* ---- Cabecera ------------------------------------------------------------------------------ */
.site-header { position: sticky; top: 0; z-index: 30; background: color-mix(in srgb, var(--bg) 94%, transparent); backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); transition: background-color .35s, color .35s, border-color .35s; }
.hdr-inner { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 20px; min-height: 64px; padding: 10px var(--pad); max-width: calc(var(--max) + 2 * var(--pad)); margin: 0 auto; }
.site-brand { text-decoration: none; display: inline-flex; align-items: center; min-height: 36px; min-width: 0; }
.site-logo { height: var(--logo-h); width: auto; max-width: 240px; object-fit: contain; transition: filter .35s; }
.site-name { font-family: var(--font-title); font-weight: var(--title-weight); font-size: 1rem; text-transform: uppercase; letter-spacing: .18em; white-space: nowrap; }
.site-name .thin { font-weight: 300; }
.crumbs { display: none; justify-content: flex-end; flex-wrap: wrap; gap: 8px; font-size: .7rem; text-transform: uppercase; color: var(--muted); min-width: 0; }
@media (min-width: 760px) { .crumbs { display: flex; } }
.crumbs a { text-decoration: none; transition: color .15s; }
.crumbs a:hover { color: var(--text); }
.crumbs .sep { opacity: .45; }
.crumbs .current { color: var(--text); }
.hdr-actions { display: flex; align-items: center; gap: 4px; justify-content: flex-end; }
.icon-btn { width: 38px; height: 38px; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 50%; background: transparent; color: inherit; cursor: pointer; padding: 0; transition: background-color .15s, opacity .15s; }
.icon-btn:hover { background: color-mix(in srgb, currentColor 10%, transparent); }
.icon-btn svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.mode-toggle .i-sun { display: none; }
html[data-mode="dark"] .mode-toggle .i-sun { display: block; }
html[data-mode="dark"] .mode-toggle .i-moon { display: none; }

/* ---- Contenido y secciones -------------------------------------------------------------------- */
.site-main { max-width: calc(var(--max) + 2 * var(--pad)); margin: 0 auto; padding: 0 var(--pad) 48px; }
.page-hero { padding: clamp(40px, 8vw, 96px) 0 clamp(24px, 4vw, 48px); text-align: center; }
.page-title { font-size: clamp(2rem, 5vw, 3.4rem); }
.eyebrow { text-transform: uppercase; font-size: .7rem; color: var(--muted); margin: 0 0 12px; }
.eyebrow a { text-decoration: none; }
.eyebrow a:hover { color: var(--text); }
.lead { color: var(--muted); max-width: 60ch; margin: 14px auto 0; }
.section { padding: clamp(40px, 7vw, 88px) 0 clamp(24px, 4vw, 48px); }
.section-tight { padding-top: 0; }
.section-head { text-align: center; margin-bottom: clamp(24px, 4vw, 44px); }
.section-title { font-family: var(--font); font-size: .72rem; font-weight: 600; text-transform: uppercase; color: var(--muted); }
.section-title::after { content: ""; display: block; width: 32px; height: 1px; background: currentColor; margin: 14px auto 0; opacity: .6; }
.empty { color: var(--muted); padding: 48px 0; text-align: center; }

/* ---- Tarjetas de sesiones y galerías ----------------------------------------------------------- */
.cards { display: grid; gap: clamp(28px, 3.4vw, 48px) clamp(16px, 2.4vw, 32px); grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 420px)); justify-content: center; }
.card-link { position: relative; display: flex; flex-direction: column; text-decoration: none; color: inherit; }
.card-cover { position: relative; display: block; aspect-ratio: 3 / 2; background: var(--tile-bg); overflow: hidden; border-radius: var(--tile-radius); }
.card-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease), opacity .3s; }
.card-link:hover .card-cover img { transform: scale(1.04); }
.card-link:not(.has-img) .card-cover::after { content: ""; position: absolute; inset: 0; background: linear-gradient(135deg, var(--tile-bg), color-mix(in srgb, var(--line) 70%, var(--tile-bg))); }
.card-body { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 18px 8px 0; }
.card-index { display: none; font-size: .7rem; color: var(--muted); letter-spacing: .1em; }
.card-title { font-family: var(--font-title); font-weight: var(--title-weight); font-size: 1.15rem; line-height: 1.25; }
.card-meta { font-size: .66rem; text-transform: uppercase; color: var(--muted); }

/* ---- Botones y formularios -------------------------------------------------------------------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: inherit; font-size: .74rem; font-weight: 600; text-transform: uppercase; padding: 12px 22px; border-radius: var(--ui-radius); border: 1px solid var(--line); background: transparent; color: var(--text); cursor: pointer; text-decoration: none; min-height: 44px; white-space: nowrap; transition: background-color .15s, border-color .15s, color .15s, opacity .15s; }
.btn:hover { border-color: var(--text); }
.btn-primary { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.btn-primary:hover { opacity: .88; border-color: var(--accent); }
.btn-ghost { border-color: transparent; }
.btn-ghost:hover { border-color: var(--line); }
.btn-lg { padding: 14px 28px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.input { width: 100%; font: inherit; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--ui-radius); background: var(--bg); color: var(--text); transition: border-color .15s; }
.input::placeholder { color: var(--muted); opacity: .8; }
.input:focus { outline: none; border-color: var(--text); }
.input-lg { padding: 14px 16px; font-size: 1.02rem; }
textarea.input { resize: vertical; }
.field-label { font-size: .8rem; color: var(--muted); }
.notice { padding: 10px 14px; border-radius: var(--ui-radius); margin-bottom: 12px; font-size: .92rem; }
.notice.error, .form-error { color: #c0392b; }
.notice.error { background: color-mix(in srgb, #c0392b 10%, var(--bg)); }
.form-error { font-size: .88rem; margin: 0; }

/* ---- Acceso con código ------------------------------------------------------------------------ */
.access-wrap { min-height: calc(100svh - var(--hdr-h) - 140px); display: flex; align-items: center; justify-content: center; padding: 40px 0; }
.access-card { width: 100%; max-width: 400px; text-align: center; }
.access-card h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); margin-bottom: 10px; }
.access-card .lead { margin: 0 auto 26px; font-size: .95rem; }
.access-card .input { text-align: center; letter-spacing: .12em; }

/* ---- Portadas: la composición la decide la línea (themes.css); aquí el contenido común ---------- */
.cover { position: relative; isolation: isolate; width: 100vw; margin-left: calc(50% - 50vw); overflow: hidden; }
.cover-media { position: absolute; inset: 0; overflow: hidden; background: var(--tile-bg); }
.cover-text { position: relative; z-index: 3; padding: 32px var(--pad); max-width: 900px; }
.cover-eyebrow { font-size: .7rem; text-transform: uppercase; letter-spacing: .3em; margin: 0 0 16px; opacity: .9; }
.cover-title { font-size: clamp(2.2rem, 6vw, 4.6rem); line-height: 1.05; overflow-wrap: anywhere; }
.cover-rule { display: block; width: 56px; height: 1px; background: currentColor; opacity: .7; margin: 22px auto; }
.cover-sub { font-size: clamp(.78rem, 1.3vw, .92rem); text-transform: uppercase; letter-spacing: .2em; max-width: 60ch; margin: 0 auto; opacity: .92; }
.cover-sub.long { text-transform: none; letter-spacing: 0; font-size: clamp(.95rem, 1.5vw, 1.08rem); line-height: 1.6; }
.cover-cta { display: inline-flex; align-items: center; gap: 10px; margin-top: 30px; padding: 13px 30px; border: 1px solid currentColor; border-radius: var(--ui-radius); font-size: .7rem; font-weight: 600; text-transform: uppercase; text-decoration: none; color: inherit; transition: background-color .2s, color .2s; }
.cover-cta:hover { background: color-mix(in srgb, currentColor 14%, transparent); }
.scroll-cue { position: absolute; left: 50%; bottom: 20px; z-index: 3; width: 40px; height: 40px; margin-left: -20px; display: flex; align-items: center; justify-content: center; color: #fff; opacity: .85; animation: cue 2.2s ease-in-out infinite; }
.scroll-cue svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.4; }
@keyframes cue { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(6px); } }

/* Foto con parallax */
.parallax-media { position: absolute; inset: 0; overflow: hidden; }
.parallax-img { width: 100%; height: 100%; object-fit: cover; transform: translate3d(0, var(--py, 0px), 0) scale(1.08); will-change: transform; }
/* Diapositivas con fundido y zoom lento */
.slides { position: absolute; inset: 0; overflow: hidden; }
.slide { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 1.4s ease; }
.slide.on { opacity: 1; animation: kenburns 7.5s ease-out forwards; }
@keyframes kenburns { from { transform: scale(1); } to { transform: scale(1.08); } }
.slide-dots { position: absolute; bottom: 70px; left: 0; right: 0; display: flex; justify-content: center; gap: 8px; z-index: 4; }
.slide-dots i { width: 6px; height: 6px; border-radius: 50%; background: rgba(255,255,255,.45); cursor: pointer; transition: background .3s, transform .3s; }
.slide-dots i.on { background: #fff; transform: scale(1.3); }
/* Fotos apiladas (estilo recortes) */
.cover-collage .cover-media { background: #242424; }
.stack-layer { position: absolute; left: 0; right: 0; top: 8%; bottom: 8%; }
.stack-item { position: absolute; top: 0; bottom: 0; left: 50%; margin: 0; height: 100%; transform: translateX(calc(-50% + var(--dx, 0%))); opacity: 0; box-shadow: 0 30px 80px rgba(0,0,0,.5); }
.stack-item img { height: 100%; width: auto; max-width: 88vw; object-fit: cover; }
.stack-item.in { animation: stack-in .32s var(--ease) forwards; }
@keyframes stack-in {
    0%   { opacity: 0; transform: translateX(calc(-50% + var(--dx, 0%))) scale(1.06); }
    100% { opacity: 1; transform: translateX(calc(-50% + var(--dx, 0%))) scale(1); }
}
@media (prefers-reduced-motion: reduce) { .slide.on, .scroll-cue { animation: none; } .stack-item.in { animation: none; opacity: 1; } }

/* ---- Galería: barra de vistas y herramientas ---------------------------------------------------- */
.gallery-toolbar { position: sticky; top: var(--hdr-real, var(--hdr-h)); z-index: 20; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px 20px; padding: 10px 0; margin: 0 0 18px; background: color-mix(in srgb, var(--bg) 96%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.toolbar-title { display: none; font-family: var(--font-title); font-weight: var(--title-weight); font-size: 1.05rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (min-width: 1100px) { .gallery-toolbar { grid-template-columns: minmax(0, 220px) minmax(0, 1fr) auto; } .toolbar-title { display: block; } }
.views { display: flex; gap: 2px 20px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; min-width: 0; }
.views::-webkit-scrollbar { display: none; }
.chip { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 7px; font: inherit; font-size: .7rem; font-weight: 600; text-transform: uppercase; padding: 10px 0; border: 0; border-bottom: 1px solid transparent; background: transparent; color: var(--muted); cursor: pointer; white-space: nowrap; transition: color .15s, border-color .15s; -webkit-tap-highlight-color: transparent; }
.chip .n { font-weight: 400; opacity: .8; letter-spacing: .04em; }
.chip .ico { display: inline-flex; }
.chip svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.chip:hover { color: var(--text); }
.chip.active { color: var(--text); border-bottom-color: var(--text); }
.chip-fav.active svg { fill: currentColor; }
.toolbar-right { display: flex; align-items: center; gap: 10px; }
.layout-switch { display: none; gap: 0; }
@media (min-width: 640px) { .layout-switch { display: flex; } }
.layout-switch button { width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: var(--ui-radius); background: transparent; cursor: pointer; color: var(--muted); padding: 0; transition: color .15s, background-color .15s; }
.layout-switch button:hover { color: var(--text); }
.layout-switch button.active { color: var(--text); background: color-mix(in srgb, var(--text) 8%, transparent); }
.layout-switch svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linejoin: round; }
.reviewer-chip { display: inline-flex; align-items: center; gap: 8px; font: inherit; font-size: .68rem; font-weight: 600; text-transform: uppercase; padding: 8px 12px; border-radius: var(--ui-radius); border: 1px solid var(--line); background: transparent; color: var(--text); cursor: pointer; max-width: 230px; min-height: 36px; transition: border-color .15s; }
.reviewer-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-transform: none; letter-spacing: .02em; font-weight: 500; font-size: .8rem; }
.reviewer-chip svg { flex: 0 0 auto; width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.reviewer-chip:hover, .reviewer-chip.set { border-color: var(--text); }
.collection-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--ui-radius); background: var(--surface); margin-bottom: 18px; }
.collection-bar h2 { display: flex; align-items: center; gap: 8px; font-size: 1.15rem; }
.collection-bar h2 .ico svg { width: 16px; height: 16px; fill: var(--fav); stroke: var(--fav); stroke-width: 2; }
.collection-bar .meta { color: var(--muted); font-size: .86rem; margin: 4px 0 0; }
.pending { color: #b7791f; font-weight: 600; }
.banner { padding: 10px 14px; border-radius: var(--ui-radius); background: var(--surface); font-size: .92rem; margin-bottom: 14px; }

/* ---- Galería: mosaicos ------------------------------------------------------------------------ */
.gallery { position: relative; min-height: 120px; }
.layout-justified .tile { position: absolute; }
.layout-masonry { column-gap: var(--gap); column-count: 2; }
@media (min-width: 640px) { .layout-masonry { column-count: 3; } }
@media (min-width: 1000px) { .layout-masonry { column-count: 4; } }
@media (min-width: 1500px) { .layout-masonry { column-count: 5; } }
.layout-masonry .tile { break-inside: avoid; margin-bottom: var(--gap); width: 100%; }
.layout-grid { display: grid; gap: var(--gap); grid-template-columns: repeat(2, 1fr); }
@media (min-width: 560px) { .layout-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 900px) { .layout-grid { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 1300px) { .layout-grid { grid-template-columns: repeat(5, 1fr); } }
.layout-grid .tile { aspect-ratio: 1 / 1; }
.layout-single { display: grid; gap: calc(var(--gap) * 4 + 12px); max-width: 1100px; margin: 0 auto; }

.tile { position: relative; margin: 0; overflow: hidden; background: var(--tile-bg); border-radius: var(--tile-radius); cursor: zoom-in; }
.tile img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease), filter .3s; }
.tile::before { content: ""; position: absolute; inset: 0; z-index: 1; background: linear-gradient(rgba(0,0,0,.28), transparent 38%); opacity: 0; transition: opacity .2s; pointer-events: none; }
.tile:hover::before, .tile:focus-within::before { opacity: 1; }
.tile .tile-name { display: none; }
.tile-actions { position: absolute; z-index: 2; top: 8px; right: 8px; display: flex; gap: 6px; opacity: 0; transition: opacity .2s; }
.tile-actions-left { right: auto; left: 8px; }
.tile:hover .tile-actions, .tile:focus-within .tile-actions, .tile.is-fav .tile-actions, .tile.is-selected .tile-actions { opacity: 1; }
.tile.is-fav .tile-actions-left, .tile.is-selected .tile-actions-left { opacity: 0; }
.tile.is-fav:hover .tile-actions-left, .tile.is-selected:hover .tile-actions-left, .tile.is-hidden .tile-actions-left { opacity: 1; }
@media (hover: none) { .tile-actions, .tile-actions-left { opacity: 1 !important; } }
.act { width: 34px; height: 34px; border-radius: 50%; border: 0; background: rgba(255,255,255,.94); color: #2a2a2a; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; padding: 0; box-shadow: 0 1px 4px rgba(0,0,0,.2); transition: transform .15s, background-color .15s, color .15s; -webkit-tap-highlight-color: transparent; }
.act:hover { transform: scale(1.06); background: #fff; }
.act svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.tile.is-fav .act-fav { color: var(--fav); }
.tile.is-fav .act-fav svg { fill: currentColor; }
.tile.is-hidden .act-hide { background: #2a2a2a; color: #fff; }
.tile.is-selected .act-pick { background: var(--accent); color: var(--accent-text); }
.tile.is-selected::after { content: ""; position: absolute; inset: 0; z-index: 1; box-shadow: inset 0 0 0 3px var(--accent); pointer-events: none; border-radius: var(--tile-radius); }
.tile.is-picked::before { display: none; }
.sentinel { height: 1px; }
.loading { text-align: center; padding: 20px 0; font-size: .85rem; }

/* Entrada suave de fotos y tarjetas (el JS añade .in al entrar en pantalla) */
.tile:not(.in), .card-link:not(.in) { opacity: 0; transform: translateY(14px); }
.tile.in, .card-link.in { opacity: 1; transform: none; transition: opacity .6s ease, transform .7s var(--ease); }
@media (prefers-reduced-motion: reduce) { .tile:not(.in), .card-link:not(.in) { opacity: 1; transform: none; } }

/* ---- Barras inferiores: envío y selección ------------------------------------------------------- */
.submit-bar { position: sticky; bottom: 0; z-index: 15; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 0 max(14px, env(safe-area-inset-bottom)); margin-top: 24px; background: color-mix(in srgb, var(--bg) 96%, transparent); backdrop-filter: blur(10px); border-top: 1px solid var(--line); }
.submit-info { font-size: .88rem; color: var(--muted); }
@media (max-width: 560px) { .submit-bar .btn { width: 100%; } }
.select-bar { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 60; display: flex; align-items: center; gap: 18px; padding: 8px 8px 8px 22px; border-radius: 8px; background: var(--text); color: var(--bg); box-shadow: 0 16px 48px rgba(0,0,0,.3); max-width: calc(100% - 24px); }
body.has-submit .select-bar { bottom: 96px; }
.select-info { display: flex; align-items: center; gap: 12px; white-space: nowrap; font-size: .95rem; }
.select-info strong { font-weight: 700; }
.link-btn { font: inherit; background: none; border: 0; color: inherit; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; padding: 0; }
.select-actions { display: flex; align-items: center; gap: 2px; }
.select-action { display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 64px; padding: 7px 8px; border-radius: 6px; border: 0; background: transparent; color: inherit; font: inherit; font-size: .72rem; cursor: pointer; }
.select-action:hover, .select-action.open { background: color-mix(in srgb, var(--bg) 16%, transparent); }
.select-action svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.select-close { min-width: 44px; font-size: 1.1rem; padding: 11px 8px; }
.select-divider { width: 1px; height: 36px; background: color-mix(in srgb, var(--bg) 30%, transparent); margin: 0 4px; }
.select-action[data-select-remove] span { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 560px) {
    .select-bar { gap: 8px; padding-left: 14px; bottom: 12px; }
    .select-info { font-size: .88rem; gap: 8px; }
    .select-action { min-width: 52px; }
    body.has-submit .select-bar { bottom: 120px; }
}
.save-popover { position: absolute; right: 8px; bottom: calc(100% + 12px); width: min(300px, calc(100vw - 32px)); background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 14px 10px 8px; box-shadow: 0 16px 48px rgba(0,0,0,.25); text-align: left; }
.popover-title { font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: var(--label-track); color: var(--muted); margin: 0 8px 8px; }
.popover-list { display: flex; flex-direction: column; gap: 2px; max-height: 40vh; overflow: auto; }
.popover-item, .popover-new { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 8px; border: 0; border-radius: 6px; background: transparent; font: inherit; font-size: .95rem; color: inherit; cursor: pointer; text-align: left; }
.popover-item:hover, .popover-new:hover { background: var(--tile-bg); }
.popover-item .ico { display: inline-flex; }
.popover-item svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; }
.popover-item .n { margin-left: auto; color: var(--muted); font-size: .85rem; }
.popover-new { color: var(--muted); margin-top: 4px; border-top: 1px solid var(--line); border-radius: 0 0 6px 6px; }

/* ---- Modales y aviso -------------------------------------------------------------------------- */
.modal { position: fixed; inset: 0; z-index: 100001; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(0,0,0,.5); backdrop-filter: blur(3px); }
.modal-card { position: relative; width: 100%; max-width: 440px; background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 30px 28px 26px; box-shadow: 0 24px 64px rgba(0,0,0,.3); }
.modal-card h2 { font-size: 1.6rem; margin-bottom: 8px; }
.modal-card .muted { margin-bottom: 18px; font-size: .92rem; }
.modal-x { position: absolute; top: 12px; right: 12px; width: 36px; height: 36px; border: 0; background: transparent; font-size: 1rem; cursor: pointer; border-radius: 50%; color: var(--muted); }
.modal-x:hover { background: var(--tile-bg); color: var(--text); }
.picker-list { display: flex; flex-direction: column; gap: 6px; max-height: 42vh; overflow: auto; margin-bottom: 12px; }
.picker-list label { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--ui-radius); cursor: pointer; }
.picker-list label:hover { background: var(--tile-bg); }
.picker-list input { width: 18px; height: 18px; accent-color: var(--accent); }
.picker-list .n { margin-left: auto; color: var(--muted); font-size: .85rem; }
.toast { position: fixed; left: 50%; bottom: 88px; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 11px 18px; border-radius: 6px; font-size: .9rem; z-index: 100002; max-width: calc(100% - 32px); text-align: center; box-shadow: 0 8px 24px rgba(0,0,0,.2); }
.toast.err { background: #c0392b; color: #fff; }

/* ---- Lightbox: sigue el modo claro u oscuro ----------------------------------------------------- */
.pswp { --pswp-bg: var(--bg); --pswp-icon-color: var(--text); --pswp-icon-color-secondary: var(--bg); --pswp-icon-stroke-color: var(--bg); --pswp-placeholder-bg: var(--tile-bg); }
.pswp__counter { color: var(--muted); text-shadow: none; font-size: .8rem; letter-spacing: .1em; }
.pswp__button--pix { display: flex; align-items: center; justify-content: center; }
.pswp__button--pix svg { width: 22px; height: 22px; fill: none; stroke: var(--text); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.pswp__button--pix.on-fav svg { fill: var(--fav); stroke: var(--fav); }
.pswp__button--pix.on-hide svg { fill: var(--text); }
.pswp__button--pix.on-pick svg { stroke: var(--accent-text); }
.pswp__button--pix.on-pick { background: var(--accent); border-radius: 50%; width: 40px; height: 40px; margin-top: 5px; }
.pswp__pix-caption { position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 16px calc(14px + env(safe-area-inset-bottom)); text-align: center; color: var(--muted); font-size: .76rem; letter-spacing: .08em; pointer-events: none; }

/* ---- Pie ---------------------------------------------------------------------------------------- */
.site-footer { border-top: 1px solid var(--line); color: var(--muted); font-size: .66rem; text-transform: uppercase; }
.foot-inner { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px 10px; padding: 32px var(--pad) 36px; text-align: center; }
.foot-name { color: var(--text); font-weight: 600; }
.foot-note { flex-basis: 100%; text-transform: none; letter-spacing: .02em; font-size: .78rem; opacity: .8; }

/* ---- Varios --------------------------------------------------------------------------------------- */
.error-page { text-align: center; padding: 16vh 0; }
.error-code { font-family: var(--font-title); font-size: 4rem; color: var(--muted); margin: 0 0 8px; }
.error-page .btn { margin-top: 20px; }
.preview-badge { position: fixed; bottom: 12px; left: 12px; z-index: 200; background: #8a5a00; color: #fff; font-size: .7rem; font-weight: 600; padding: 5px 10px; border-radius: 999px; pointer-events: none; box-shadow: 0 2px 8px rgba(0,0,0,.3); }

/* ---- Ancho de página "casi completo": mosaico y portadas con el mismo margen pequeño -------------- */
body[data-width="ancho"] { --max: none; --pad: clamp(8px, 1.2vw, 16px); }
body[data-width="ancho"] .cover { width: auto; margin-left: 0; margin-right: 0; }
body[data-width="ancho"] .hdr-inner { padding-left: clamp(16px, 2vw, 28px); padding-right: clamp(16px, 2vw, 28px); }
@media (max-width: 480px) { .reviewer-chip span { display: none; } .reviewer-chip { padding: 8px 10px; } }
