/* stamps.cl — UX 2026 · layer B (2026-09-27). Loaded LAST.
   1) Thematic taxonomy UI (chips, ficha band, hero, sidebar, gallery, editors).
   2) Ficha on phones: natural vertical scroll (the description and characteristics are always
      reachable; no tiny inner scroll box).
   3) Twelve new skins + per-visitor "scenario" options (card style, density, typeface, corners,
      motion) exposed as html[data-*] attributes by app.js.
   4) Phone catalogue: collapsible filters and a bottom navigation bar.
   Every colour comes from the theme tokens, so all skins, Senior mode and high contrast keep working. */

/* ============================== 1 · Theme chips ============================== */
.th-chip {
  --th: #6b7a90;
  display: inline-flex; align-items: center; gap: 6px; max-width: 100%; min-width: 0;
  border: 1px solid color-mix(in srgb, var(--th) 55%, transparent);
  background: color-mix(in srgb, var(--th) 16%, var(--bg-2));
  color: var(--text); border-radius: 999px; cursor: pointer; font-weight: 700; line-height: 1.1;
  transition: transform .15s ease, background .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.th-chip:hover { background: color-mix(in srgb, var(--th) 30%, var(--bg-2)); border-color: var(--th); transform: translateY(-1px); }
.th-chip .th-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.th-chip .th-ico { flex: 0 0 auto; }
.th-sm { font-size: 11px; padding: 3px 9px 3px 7px; margin-top: 8px; }
.th-lg { font-size: 13.5px; padding: 7px 14px 7px 11px; min-height: 36px; }
.th-lg .th-ico { font-size: 16px; }
.th-lg.primary {
  background: linear-gradient(135deg, color-mix(in srgb, var(--th) 42%, var(--bg-2)), color-mix(in srgb, var(--th) 18%, var(--bg-2)));
  border-color: var(--th); box-shadow: 0 8px 22px -12px var(--th);
}
.th-lg.curated { --th: #d2ad5b; border-style: dashed; }

/* Card: a hairline of the theme colour on top of the picture + the chip under the meta line. */
.card-stamp[style*="--th"]::after {
  content: ''; position: absolute; left: 0; right: 0; top: 0; height: 3px; z-index: 2;
  background: linear-gradient(90deg, var(--th), color-mix(in srgb, var(--th) 20%, transparent));
}
.card-body .card-theme { display: flex; width: fit-content; }
.card-emblem {
  position: absolute; z-index: 3; left: 42px; top: 38px;
  width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: 14px;
  background: linear-gradient(135deg, #f5d98a, #c9962e); box-shadow: 0 3px 10px rgba(0, 0, 0, .35);
  border: 1px solid rgba(255, 255, 255, .5);
}

/* Ficha header: theme band + short description. */
.dx-themes { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 2px 0 10px; }
.dx-themes-k {
  font-size: 11px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; color: var(--muted);
  margin-right: 2px;
}
.dx-lead { margin: 10px 0 0; }
.dx-lead p {
  margin: 0; font-size: 14px; line-height: 1.55; color: var(--text);
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
  border-left: 3px solid color-mix(in srgb, var(--accent) 70%, transparent); padding-left: 10px;
}
.dx-lead.open p { -webkit-line-clamp: unset; display: block; }
.dx-lead-more {
  margin: 4px 0 0 13px; padding: 4px 0; border: 0; background: none; color: var(--accent);
  font-weight: 800; font-size: 13px; cursor: pointer;
}
.dx-lead-more:hover { text-decoration: underline; }

/* ============================== Theme hero (active filter) ============================== */
.theme-hero {
  --th: var(--accent);
  position: relative; overflow: hidden; display: grid; grid-template-columns: minmax(0, 260px) minmax(0, 1fr);
  gap: 22px; align-items: center; margin: 0 0 20px; padding: 18px 22px; border-radius: 20px;
  border: 1px solid color-mix(in srgb, var(--th) 50%, var(--panel-border));
  background:
    radial-gradient(120% 140% at 0% 0%, color-mix(in srgb, var(--th) 30%, transparent), transparent 60%),
    linear-gradient(135deg, color-mix(in srgb, var(--th) 14%, var(--bg-2)), var(--bg-2));
  box-shadow: 0 20px 50px -30px var(--th);
  animation: thHeroIn .35s cubic-bezier(.16, 1, .3, 1);
}
@keyframes thHeroIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.th-hero-art { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.th-hero-art img {
  width: 100%; aspect-ratio: 4 / 3; object-fit: contain; border-radius: 10px; padding: 6px;
  background: color-mix(in srgb, var(--tile) 80%, transparent); border: 1px solid var(--panel-border);
}
.th-hero-art img:nth-child(1) { transform: rotate(-3deg); }
.th-hero-art img:nth-child(4) { transform: rotate(2deg); }
.th-hero-kicker { font-size: 11px; font-weight: 800; letter-spacing: 1.4px; text-transform: uppercase; color: var(--th); filter: brightness(1.25); }
.th-hero-title { margin: 4px 0 6px; font-size: clamp(22px, 2.2vw + 10px, 34px); font-weight: 800; line-height: 1.1; display: flex; align-items: center; gap: 10px; }
.th-hero-ico { font-size: 1.1em; }
.th-hero-desc { margin: 0 0 8px; color: var(--muted); font-size: 14.5px; max-width: 60ch; }
.th-hero-meta { font-weight: 800; font-size: 14px; }
.th-hero-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.th-hero-btn {
  min-height: 42px; padding: 0 16px; border-radius: 999px; cursor: pointer; font-weight: 800; font-size: 13.5px;
  border: 1px solid var(--th); color: var(--text); background: color-mix(in srgb, var(--th) 26%, var(--bg-2));
}
.th-hero-btn.ghost { background: transparent; border-color: var(--panel-border); }
.th-hero-btn:hover { border-color: var(--text); }
@media (max-width: 760px) {
  .theme-hero { grid-template-columns: 1fr; padding: 16px; gap: 14px; }
  .th-hero-art { grid-template-columns: repeat(4, 1fr); order: 2; }
  .th-hero-btn { flex: 1 1 auto; }
}

/* ============================== Sidebar · Temáticas ============================== */
.theme-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 3px; }
.theme-list a {
  --th: var(--accent);
  display: flex; align-items: center; gap: 9px; padding: 7px 10px; border-radius: 10px; cursor: pointer;
  color: var(--text); text-decoration: none; font-size: 13px; border: 1px solid transparent; transition: .15s;
}
.theme-list a:hover { background: var(--card); border-color: color-mix(in srgb, var(--th) 50%, var(--panel-border)); }
.theme-list a.active {
  background: color-mix(in srgb, var(--th) 24%, var(--bg-2)); border-color: var(--th);
}
.tn-ico { width: 22px; text-align: center; font-size: 15px; }
.tn-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tn-n {
  font-size: 11px; font-weight: 800; color: var(--muted); padding: 1px 7px; border-radius: 999px;
  background: color-mix(in srgb, var(--th) 14%, transparent);
}
.theme-all-btn {
  width: 100%; margin-top: 6px; min-height: 38px; border-radius: 10px; cursor: pointer; font-weight: 800; font-size: 13px;
  border: 1px dashed color-mix(in srgb, var(--accent) 60%, var(--panel-border)); background: transparent; color: var(--text);
}
.theme-all-btn:hover { background: color-mix(in srgb, var(--accent) 12%, transparent); }

/* ============================== Gallery "Explorar por temática" ============================== */
.thg-overlay {
  position: fixed; inset: 0; z-index: 1600; display: none; place-items: center; padding: 3vh 3vw;
  background: rgba(3, 8, 16, .66); backdrop-filter: blur(8px);
}
.thg-overlay.open { display: grid; animation: thgIn .25s ease; }
@keyframes thgIn { from { opacity: 0; } to { opacity: 1; } }
.thg-panel {
  width: min(1240px, 100%); max-height: 94vh; max-height: 94dvh; display: flex; flex-direction: column;
  background: var(--bg-2); color: var(--text); border: 1px solid var(--panel-border); border-radius: 22px;
  box-shadow: 0 40px 120px -40px rgba(0, 0, 0, .8); overflow: hidden;
}
.thg-head { display: flex; justify-content: space-between; gap: 16px; padding: 22px 24px 8px; }
.thg-head h2 { margin: 0; font-size: 24px; font-weight: 800; }
.thg-head p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.thg-close {
  flex: 0 0 auto; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--panel-border);
  background: var(--card); color: var(--text); font-size: 24px; cursor: pointer;
}
.thg-tools { padding: 8px 24px 14px; }
.thg-tools input {
  width: 100%; min-height: 46px; padding: 0 16px; border-radius: 14px; font-size: 16px;
  background: var(--tile); color: var(--text); border: 1px solid var(--panel-border); outline: none;
}
.thg-tools input:focus { border-color: var(--accent); }
.thg-grid {
  flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 4px 24px 26px; display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); grid-auto-rows: max-content; align-content: start;
  overscroll-behavior: contain;
}
.thg-card {
  --th: var(--accent); min-height: max-content;
  display: flex; flex-direction: column; text-align: left; padding: 0; cursor: pointer; overflow: hidden;
  border-radius: 18px; color: var(--text); border: 1px solid color-mix(in srgb, var(--th) 35%, var(--panel-border));
  background: linear-gradient(170deg, color-mix(in srgb, var(--th) 18%, var(--bg-2)), var(--bg-2) 70%);
  transition: transform .2s cubic-bezier(.16, 1, .3, 1), box-shadow .2s, border-color .2s;
}
.thg-card:hover, .thg-card:focus-visible { transform: translateY(-4px); border-color: var(--th); box-shadow: 0 22px 44px -24px var(--th); }
.thg-card.curated { --th: #d2ad5b; }
.thg-art {
  display: grid; gap: 4px; padding: 10px; aspect-ratio: 16 / 10;
  background: color-mix(in srgb, var(--th) 12%, var(--tile));
}
.thg-art.n4, .thg-art.n3 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }
.thg-art.n2 { grid-template-columns: 1fr 1fr; }
.thg-art.n3 .thg-cell:first-child { grid-row: span 2; }
.thg-cell { display: grid; place-items: center; min-height: 0; overflow: hidden; border-radius: 8px; background: color-mix(in srgb, var(--bg) 35%, transparent); }
.thg-cell img { width: 100%; height: 100%; object-fit: contain; padding: 3px; transition: transform .35s ease; }
.thg-card:hover .thg-cell img { transform: scale(1.06); }
.thg-empty { font-size: 42px; }
.thg-body { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px 14px; }
.thg-title { display: flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 800; line-height: 1.2; }
.thg-ico { font-size: 20px; }
.thg-desc { font-size: 12.5px; color: var(--muted); line-height: 1.4; }
.thg-n { font-size: 12.5px; font-weight: 800; color: var(--text); margin-top: 2px; }
.thg-none { grid-column: 1 / -1; text-align: center; color: var(--muted); padding: 30px; }
@media (max-width: 640px) {
  .thg-overlay { padding: 0; }
  .thg-panel { max-height: 100vh; max-height: 100dvh; height: 100dvh; border-radius: 0; }
  .thg-head { padding: 16px 16px 4px; }
  .thg-head h2 { font-size: 20px; }
  .thg-tools { padding: 8px 16px 12px; }
  .thg-grid { padding: 4px 16px 24px; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .thg-body { padding: 10px 11px 12px; }
  .thg-desc { display: none; }
  .thg-title { font-size: 14px; }
}

/* ============================== Admin editors ============================== */
.ste-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 6px; }
.ste-row {
  --th: var(--accent);
  display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 10px; cursor: pointer;
  border: 1px solid var(--panel-border); background: var(--card); font-size: 13px; font-weight: 600;
}
.ste-row:has(input:checked) { border-color: var(--th); background: color-mix(in srgb, var(--th) 16%, var(--bg-2)); }
.ste-row input { width: 18px; height: 18px; min-height: 0 !important; accent-color: var(--th); }
.ste-name { flex: 1 1 auto; min-width: 0; }
.ste-tag { font-size: 10.5px; font-weight: 800; padding: 1px 7px; border-radius: 999px; background: color-mix(in srgb, #d2ad5b 22%, transparent); color: var(--text); }
.ste-tag.off { background: color-mix(in srgb, #e5484d 22%, transparent); }
.ste-primary { font-size: 10.5px; font-weight: 800; padding: 1px 7px; border-radius: 999px; background: var(--th); color: #fff; }
.ste-sub { margin: 14px 0 6px; font-size: 11px; font-weight: 800; letter-spacing: .8px; text-transform: uppercase; color: var(--muted); }
.ste-actions, .bot-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 14px; }
.ste-auto {
  min-height: 42px; padding: 0 16px; border-radius: 11px; cursor: pointer; font-weight: 700;
  border: 1px solid var(--panel-border); background: var(--card); color: var(--text);
}
.ste-msg { font-size: 13px; color: var(--muted); }
.bot-list { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.bot-row { --th: var(--accent); border: 1px solid var(--panel-border); border-left: 4px solid var(--th); border-radius: 12px; background: var(--card); }
.bot-row summary { display: flex; align-items: center; gap: 10px; padding: 10px 14px; cursor: pointer; list-style: none; }
.bot-row summary::-webkit-details-marker { display: none; }
.bot-ico { font-size: 18px; width: 24px; text-align: center; }
.bot-n { margin-left: auto; font-weight: 800; font-size: 12.5px; color: var(--muted); }
.bot-form { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px 12px; padding: 4px 14px 14px; }
.bot-form label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 700; color: var(--muted); }
.bot-form .wide { grid-column: 1 / -1; }
.bot-form input, .bot-form textarea {
  background: var(--tile); color: var(--text); border: 1px solid var(--panel-border); border-radius: 9px; padding: 8px 10px; font-size: 13.5px;
}
.bot-form input[type="color"] { padding: 2px; height: 38px; }
.bot-form .bot-chk { flex-direction: row; align-items: center; gap: 8px; color: var(--text); }
.bot-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.bo-h { font-size: 18px; font-weight: 800; margin: 0 0 6px; }
@media (max-width: 640px) { .bot-form { grid-template-columns: 1fr 1fr; } }

/* ============================== 2 · Ficha on phones: natural scroll ============================== */
/* The desktop ficha keeps its fixed-height layout. On phones the ONE scroll is the whole modal:
   picture, header, theme, description, tabs and the full content flow downwards, so everything
   (description, characteristics, prices…) is readable; the tab bar sticks to the top while reading. */
@media (max-width: 760px) {
  #detailModal .detail-content { height: 100vh; height: 100dvh; overflow: hidden; }
  #detailModal .detail-body {
    display: block; overflow-y: auto; overflow-x: hidden; height: 100%;
    -webkit-overflow-scrolling: touch; overscroll-behavior: contain; padding: 64px 14px 28px;
  }
  #detailModal .detail-gallery { margin-bottom: 14px; }
  #detailModal .detail-gallery .main-img { height: clamp(210px, 42vh, 380px); }
  #detailModal .detail-info { display: block; padding-right: 0; min-height: 0; }
  #detailModal .detail-info .ficha-tabs, #detailModal .ficha-tabs.ft2 { display: block; min-height: 0; margin-top: 14px; }
  #detailModal .ft-main {
    position: sticky; top: -64px; z-index: 6;
    box-shadow: 0 10px 18px -12px rgba(0, 0, 0, .55);
    background: color-mix(in srgb, var(--bg-2) 94%, transparent); backdrop-filter: blur(10px);
  }
  #detailModal .ft-group.active { display: block; }
  #detailModal .ft-group > .tab-pane.active,
  #detailModal .detail-info .tab-pane.active { overflow: visible; height: auto; max-height: none; flex: none; padding: 2px 0 8px; }
  #detailModal .dx-lead p { -webkit-line-clamp: 5; font-size: 15px; }
  #detailModal .modal-x, #detailModal .detail-nav { z-index: 8; }
  /* Fixed header strip behind the ‹ › × buttons so content scrolling underneath stays legible. */
  #detailModal .detail-content::before {
    content: ''; position: absolute; left: 0; right: 0; top: 0; height: 64px; z-index: 7; pointer-events: none;
    background: linear-gradient(var(--bg-2) 70%, transparent);
  }
  #detailModal .spec-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 420px) { #detailModal .spec-grid { grid-template-columns: 1fr; } }

/* ============================== 3 · New skins ============================== */
[data-theme="atacama"] { --bg:#1a120d; --bg-2:#2a1b12; --panel:rgba(255,220,190,.05); --panel-border:rgba(242,193,140,.18); --text:#f6e9dc; --muted:#c9ab92; --accent:#e07a3f; --accent-2:#f2c14e; --tile:rgba(255,235,215,.045); --card:rgba(255,235,215,.055); --shadow:0 24px 60px -28px rgba(0,0,0,.8); --on-accent:#1a120d; --accent-shade:transparent; }
[data-theme="patagonia"] { --bg:#eef5f9; --bg-2:#dcebf3; --panel:rgba(16,40,58,.04); --panel-border:rgba(16,40,58,.14); --text:#10283a; --muted:#4f6b80; --accent:#1f6fa3; --accent-2:#2f8f87; --tile:#ffffff; --card:#ffffff; --shadow:0 12px 30px rgba(16,60,90,.14); }
[data-theme="pacifico"] { --bg:#041a24; --bg-2:#0a2f3f; --panel:rgba(180,240,255,.05); --panel-border:rgba(120,220,235,.18); --text:#e4f6fb; --muted:#9cc3cf; --accent:#2ec4c6; --accent-2:#ffb86b; --tile:rgba(210,245,255,.045); --card:rgba(210,245,255,.055); --shadow:0 24px 60px -28px rgba(0,0,0,.8); --on-accent:#041a24; --accent-shade:transparent; }
[data-theme="bosque"] { --bg:#0c1a12; --bg-2:#15301f; --panel:rgba(200,255,210,.05); --panel-border:rgba(150,210,160,.18); --text:#e8f5ea; --muted:#a7c7ae; --accent:#5cc27a; --accent-2:#d9b44a; --tile:rgba(220,255,225,.045); --card:rgba(220,255,225,.055); --shadow:0 24px 60px -28px rgba(0,0,0,.8); --on-accent:#0c1a12; --accent-shade:transparent; }
[data-theme="copihue"] { --bg:#fff6f4; --bg-2:#fbe6e2; --panel:rgba(120,20,30,.04); --panel-border:rgba(140,30,45,.15); --text:#3a1116; --muted:#7d4f55; --accent:#b3122e; --accent-2:#2f7d4f; --tile:#ffffff; --card:#ffffff; --shadow:0 12px 30px rgba(140,30,45,.14); }
[data-theme="antartica"] { --bg:#f5fbff; --bg-2:#e3f2fb; --panel:rgba(13,34,51,.035); --panel-border:rgba(13,60,90,.13); --text:#0d2233; --muted:#51697b; --accent:#0b6f9e; --accent-2:#5b4bd6; --tile:#ffffff; --card:#ffffff; --shadow:0 12px 30px rgba(11,90,140,.13); }
[data-theme="rapanui"] { --bg:#15110f; --bg-2:#2a211c; --panel:rgba(255,230,210,.05); --panel-border:rgba(217,143,78,.2); --text:#f3ebe4; --muted:#bda99a; --accent:#d98f4e; --accent-2:#58b0a8; --tile:rgba(255,240,225,.045); --card:rgba(255,240,225,.055); --shadow:0 24px 60px -28px rgba(0,0,0,.8); --on-accent:#15110f; --accent-shade:transparent; }
[data-theme="museo"] { --bg:#f7f5f0; --bg-2:#ebe7de; --panel:rgba(20,20,20,.035); --panel-border:rgba(20,20,20,.14); --text:#151515; --muted:#57544e; --accent:#1c1c1c; --accent-2:#8f6d25; --tile:#ffffff; --card:#ffffff; --shadow:0 14px 34px rgba(30,25,15,.14); }
[data-theme="noche"] { --bg:#0b0b1e; --bg-2:#1a1840; --panel:rgba(200,195,255,.05); --panel-border:rgba(160,150,255,.2); --text:#ecebff; --muted:#aaa7d6; --accent:#8c7bff; --accent-2:#ffd479; --tile:rgba(230,228,255,.045); --card:rgba(230,228,255,.055); --shadow:0 24px 60px -28px rgba(0,0,0,.85); --on-accent:#0b0b1e; --accent-shade:transparent; }
[data-theme="sepia"] { --bg:#f1e7d6; --bg-2:#e6d6bb; --panel:rgba(59,42,23,.05); --panel-border:rgba(90,60,30,.2); --text:#3b2a17; --muted:#6e5a3e; --accent:#8a5a2b; --accent-2:#9c6b2f; --tile:#fbf5ea; --card:#fbf5ea; --shadow:0 12px 28px rgba(90,60,30,.18); }
[data-theme="grafito"] { --bg:#000000; --bg-2:#111214; --panel:rgba(255,255,255,.04); --panel-border:rgba(255,255,255,.12); --text:#f2f2f2; --muted:#a0a4ab; --accent:#e6e6e6; --accent-2:#9aa0a6; --tile:#0b0b0c; --card:#0e0f11; --shadow:0 18px 40px -24px rgba(0,0,0,.9); --on-accent:#000000; --accent-shade:transparent; }
[data-theme="vino"] { --bg:#1a0a10; --bg-2:#2e1220; --panel:rgba(255,210,225,.05); --panel-border:rgba(214,75,122,.22); --text:#f8e9ee; --muted:#caa3b1; --accent:#d64b7a; --accent-2:#e8c07a; --tile:rgba(255,230,238,.045); --card:rgba(255,230,238,.055); --shadow:0 24px 60px -28px rgba(0,0,0,.85); --on-accent:#1a0a10; --accent-shade:transparent; }

/* Ambient background for the new skins: two soft glows of the skin's own accents. */
:is([data-theme="atacama"], [data-theme="patagonia"], [data-theme="pacifico"], [data-theme="bosque"], [data-theme="copihue"],
    [data-theme="antartica"], [data-theme="rapanui"], [data-theme="museo"], [data-theme="noche"], [data-theme="sepia"],
    [data-theme="vino"]) body {
  background:
    radial-gradient(58% 50% at 16% 6%, color-mix(in srgb, var(--accent) 13%, transparent), transparent 60%),
    radial-gradient(60% 55% at 90% 2%, color-mix(in srgb, var(--accent-2) 11%, transparent), transparent 62%),
    radial-gradient(120% 120% at 80% 110%, var(--bg-2), var(--bg)) fixed;
}
[data-theme="grafito"] body { background: #000; }
[data-theme="noche"] body {
  background:
    radial-gradient(1.5px 1.5px at 12% 18%, #fff8, transparent), radial-gradient(1px 1px at 42% 8%, #fff7, transparent),
    radial-gradient(1.5px 1.5px at 78% 22%, #fff9, transparent), radial-gradient(1px 1px at 63% 44%, #fff6, transparent),
    radial-gradient(1px 1px at 88% 66%, #fff6, transparent), radial-gradient(1.5px 1.5px at 24% 72%, #fff7, transparent),
    radial-gradient(60% 50% at 80% 0%, rgba(140,123,255,.18), transparent 60%),
    radial-gradient(120% 120% at 80% 110%, var(--bg-2), var(--bg)) fixed;
}
[data-theme="museo"] .topbar-title h1, [data-theme="museo"] .dx-head h2, [data-theme="museo"] .th-hero-title { font-family: Georgia, 'Times New Roman', serif; letter-spacing: .2px; }
/* Sidebar surfaces follow the skin (the default one is translucent over the body gradient). */
:is([data-theme="patagonia"], [data-theme="copihue"], [data-theme="antartica"], [data-theme="museo"], [data-theme="sepia"]) .sidebar {
  background: color-mix(in srgb, var(--bg-2) 70%, #fff 30%);
}
/* Skin previews in Configuración. */
.skin-prev.t-patrimonio { background: linear-gradient(135deg, #0c1420, #36c6d3 70%, #d2ad5b); }
.skin-prev.t-atacama { background: linear-gradient(135deg, #1a120d, #e07a3f 65%, #f2c14e); }
.skin-prev.t-patagonia { background: linear-gradient(135deg, #eef5f9, #1f6fa3 70%, #2f8f87); }
.skin-prev.t-pacifico { background: linear-gradient(135deg, #041a24, #2ec4c6 65%, #ffb86b); }
.skin-prev.t-bosque { background: linear-gradient(135deg, #0c1a12, #5cc27a 65%, #d9b44a); }
.skin-prev.t-copihue { background: linear-gradient(135deg, #fff6f4, #b3122e 60%, #2f7d4f); }
.skin-prev.t-antartica { background: linear-gradient(135deg, #f5fbff, #9fd3ef 45%, #0b6f9e 80%, #5b4bd6); }
.skin-prev.t-rapanui { background: linear-gradient(135deg, #15110f, #d98f4e 60%, #58b0a8); }
.skin-prev.t-museo { background: linear-gradient(135deg, #f7f5f0 40%, #1c1c1c 70%, #8f6d25); }
.skin-prev.t-noche { background: radial-gradient(1.5px 1.5px at 20% 30%, #fff, transparent), radial-gradient(1px 1px at 70% 20%, #fff, transparent), linear-gradient(135deg, #0b0b1e, #1a1840 50%, #8c7bff); }
.skin-prev.t-sepia { background: linear-gradient(135deg, #f1e7d6, #b08b5a 60%, #8a5a2b); }
.skin-prev.t-grafito { background: linear-gradient(135deg, #000, #2a2b2e 60%, #e6e6e6); }
.skin-prev.t-vino { background: linear-gradient(135deg, #1a0a10, #d64b7a 60%, #e8c07a); }

/* ============================== Scenario options (html[data-*]) ============================== */
/* Card style. */
html[data-cards="flat"] .card-stamp { background: var(--bg-2); backdrop-filter: none; box-shadow: none; }
html[data-cards="paper"] .card-stamp {
  background: color-mix(in srgb, var(--bg-2) 80%, #fffaf0 20%); backdrop-filter: none;
  box-shadow: 0 1px 0 rgba(0,0,0,.08), 0 10px 22px -16px rgba(0,0,0,.45);
}
html[data-cards="paper"] .card-thumb { background: color-mix(in srgb, var(--tile) 60%, #fffdf7 40%); }
html[data-cards="polaroid"] .card-stamp { background: #fbfaf7; color: #1d1d1d; border-color: rgba(0,0,0,.12); padding: 10px 10px 0; box-shadow: 0 14px 28px -18px rgba(0,0,0,.6); }
html[data-cards="polaroid"] .card-thumb { background: #eceae4; border-radius: 3px; }
html[data-cards="polaroid"] .card-name { color: #1d1d1d; font-family: 'Segoe Print', 'Bradley Hand', 'Comic Sans MS', cursive; }
html[data-cards="polaroid"] .card-year { color: #555; }
html[data-cards="polaroid"] .card-stamp:nth-child(odd) { transform: rotate(-.8deg); }
html[data-cards="polaroid"] .card-stamp:nth-child(even) { transform: rotate(.7deg); }
html[data-cards="polaroid"] .card-stamp:hover { transform: rotate(0) translateY(-5px); }
html[data-cards="polaroid"] .card-stamp .th-chip { color: #1d1d1d; background: color-mix(in srgb, var(--th) 18%, #fff); }
/* "Estampilla": perforated edges (a dotted mask on a 7px margin ring around the card). */
html[data-cards="stamp"] .card-stamp {
  padding: 7px; border: 0; border-radius: 2px;
  background: color-mix(in srgb, var(--bg-2) 86%, var(--text) 14%);
  -webkit-mask: radial-gradient(circle 4px at 7px 7px, #0000 97%, #000) -7px -7px / 14px 14px, linear-gradient(#000 0 0) content-box;
  mask: radial-gradient(circle 4px at 7px 7px, #0000 97%, #000) -7px -7px / 14px 14px, linear-gradient(#000 0 0) content-box;
  box-shadow: none;
}
html[data-cards="stamp"] .card-stamp > .card-thumb, html[data-cards="stamp"] .card-stamp > .card-body { background: var(--bg-2); }
html[data-cards="stamp"] .card-stamp:hover { transform: translateY(-4px) rotate(-.4deg); }
html[data-cards="stamp"] .card-stamp::after { top: 7px; left: 7px; right: 7px; }

/* Density. */
html[data-density="compact"] .grid { gap: 10px; }
html[data-density="compact"] .card-body { padding: 7px 9px 9px; }
html[data-density="compact"] .card-thumb { padding: 6px; }
html[data-density="comfy"] .grid { gap: 26px; }
html[data-density="comfy"] .card-body { padding: 14px 16px 16px; }
html[data-density="comfy"] .card-name { font-size: 14px; }

/* Typeface. */
html[data-font="serif"] body { font-family: Georgia, 'Iowan Old Style', 'Palatino Linotype', 'Times New Roman', serif; }
html[data-font="rounded"] body { font-family: 'Questrial', 'Nunito', 'Varela Round', 'Segoe UI', system-ui, sans-serif; }
html[data-font="system"] body { font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif; }

/* Corners. */
html[data-radius="square"] :is(.card-stamp, .sotd, .theme-hero, .thg-card, .modal-content, .main-img, .dx-act, .th-chip, .btn-3d, .btn-reset, .yf-apply, .sort-filter, .scott-filter, .year-filter) { border-radius: 4px !important; }
html[data-radius="pill"] :is(.card-stamp, .thg-card, .theme-hero, .sotd) { border-radius: 26px; }

/* Motion. */
html[data-motion="reduce"] *, html[data-motion="reduce"] *::before, html[data-motion="reduce"] *::after {
  animation: none !important; transition: none !important; scroll-behavior: auto !important;
}

/* Settings modal: scenario cards + option rows. */
#settingsModal .modal-dialog { max-width: 720px; }
#settingsModal .settings-content { max-height: 90vh; max-height: 90dvh; overflow-y: auto; }
.skin-grid { grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); }
.scn-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.scn-card {
  display: flex; flex-direction: column; align-items: flex-start; gap: 4px; text-align: left; padding: 12px;
  border-radius: 14px; cursor: pointer; color: var(--text); border: 1px solid var(--panel-border); background: var(--card);
  transition: border-color .15s, transform .15s;
}
.scn-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.scn-card.active { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent) inset; }
.scn-ico { font-size: 22px; }
.scn-name { font-weight: 800; font-size: 13.5px; }
.scn-desc { font-size: 11.5px; color: var(--muted); line-height: 1.35; }
.set-seg.wrap { flex-wrap: wrap; }
.set-seg.wrap button { flex: 1 1 88px; }
.set-custom .custom-row label { flex-wrap: nowrap; }
@media (max-width: 640px) {
  #settingsModal .modal-dialog { margin: 0; max-width: 100%; min-height: 100%; }
  #settingsModal .settings-content { border-radius: 0; max-height: 100dvh; min-height: 100dvh; padding: 18px 16px 28px; }
  .scn-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .skin-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ============================== 4 · Phone catalogue ============================== */
/* Filters collapse behind one "Filtros" button; a bottom bar gives thumb reach to the main areas. */
.filters-toggle { display: none; }
.mnav { display: none; }
@media (max-width: 760px) {
  .filters-toggle {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 46px;
    border-radius: 12px; border: 1px solid var(--panel-border); background: var(--card); color: var(--text);
    font-weight: 800; font-size: 15px; cursor: pointer;
  }
  .filters-toggle .ft-count { min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; font-size: 12px; display: inline-grid; place-items: center; background: var(--accent); color: var(--on-accent); }
  .filters-toggle .ft-count:empty { display: none; }
  body:not(.filters-open) .topbar-actions > :not(.filters-toggle):not(#newBtn):not(.mine-filter) { display: none !important; }
  body.filters-open .filters-toggle { border-color: var(--accent); }
  .topbar-actions { gap: 8px; }
  #newBtn { width: 100%; }
  .content { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
  .asst-fab { bottom: calc(82px + env(safe-area-inset-bottom)) !important; }

  .mnav {
    display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); position: fixed; left: 8px; right: 8px;
    bottom: calc(8px + env(safe-area-inset-bottom)); z-index: 1200; padding: 6px; gap: 2px; border-radius: 20px;
    background: color-mix(in srgb, var(--bg-2) 88%, transparent); backdrop-filter: blur(16px) saturate(1.2);
    border: 1px solid var(--panel-border); box-shadow: 0 16px 40px -16px rgba(0, 0, 0, .6);
  }
  .mnav button {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 54px;
    border: 0; border-radius: 14px; background: transparent; color: var(--muted); font-size: 11px; font-weight: 800; cursor: pointer;
  }
  .mnav button .mn-ico { font-size: 20px; line-height: 1; }
  .mnav button.active, .mnav button:active { color: var(--text); background: color-mix(in srgb, var(--accent) 18%, transparent); }
  body.modal-open .mnav, body.album-printing .mnav { display: none; }
}
@media print { .mnav, .filters-toggle { display: none !important; } }

/* While a theme filter is active its hero replaces the daily banner; on phones the banner is compact. */
body.theme-filtering #stampOfDay { display: none; }
@media (max-width: 760px) {
  .sotd { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 12px; padding: 12px; align-items: center; }
  .sotd .sotd-thumb { width: 96px; height: 120px; padding: 6px; }
  .sotd .sotd-thumb img { max-height: 108px; }
  .sotd .sotd-name { font-size: 16px; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .sotd .sotd-blurb { display: none; }
  .sotd .sotd-meta { font-size: 13px; }
  .sotd .sotd-btn { min-height: 38px; padding: 0 12px; font-size: 13px; margin-top: 6px; }
  .sotd .sotd-tag { font-size: 11px; }
}

/* ============================== 5 · Album builder: covers, footer, direct PDF ============================== */
.alb-foot {
  flex: 0 0 auto; display: flex; align-items: center; gap: 14px; padding: 12px 18px;
  border-top: 1px solid var(--panel-border); background: color-mix(in srgb, var(--bg-2) 92%, var(--text) 8%); position: relative;
}
.alb-foot-info { flex: 1 1 auto; min-width: 0; }
.alb-foot .alb-count { margin: 0; text-align: left; font-size: 13px; color: var(--text); font-weight: 700; }
.alb-foot .alb-hint { margin: 2px 0 0; text-align: left; }
.alb-foot-btns { display: flex; gap: 8px; flex: 0 0 auto; }
.alb-foot .alb-pdf { width: auto; min-width: 190px; min-height: 46px; }
.alb-print {
  min-height: 46px; padding: 0 16px; border-radius: 10px; cursor: pointer; font-weight: 800; font-size: 14px;
  border: 1px solid var(--panel-border); background: var(--card); color: var(--text);
}
.alb-print:disabled { opacity: .45; cursor: not-allowed; }
.alb-print:hover:not(:disabled) { border-color: var(--accent); }
.alb-foot.busy .alb-foot-btns, .alb-foot.busy .alb-foot-info { visibility: hidden; }
.alb-progress {
  position: absolute; inset: 0; display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto auto;
  align-items: center; gap: 6px 14px; padding: 10px 18px; background: inherit;
}
.alb-progress[hidden] { display: none; }
.alb-progress-txt { font-weight: 800; font-size: 14px; color: var(--text); }
.alb-progress-bar { grid-column: 1; height: 8px; border-radius: 999px; background: var(--card); overflow: hidden; border: 1px solid var(--panel-border); }
.alb-progress-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #22c55e, var(--accent)); transition: width .25s ease; }
.alb-cancel { grid-column: 2; grid-row: 1 / span 2; min-height: 40px; padding: 0 14px; border-radius: 10px; cursor: pointer; font-weight: 700;
  border: 1px solid var(--panel-border); background: transparent; color: var(--text); }
.alb-select {
  width: 100%; min-height: 40px; padding: 0 10px; border-radius: 8px; font-size: 13.5px; cursor: pointer;
  background-color: var(--bg-2); color: var(--text); border: 1px solid var(--panel-border);
}
.alb-select option { background-color: var(--bg-2); color: var(--text); }
.alb-cover-thumbs {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); gap: 8px; margin: 4px 0 14px;
  max-height: 330px; overflow-y: auto; padding: 2px 4px 2px 2px;
}
.alb-cthumb {
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 5px; border-radius: 10px; cursor: pointer;
  border: 1px solid var(--panel-border); background: var(--card); color: var(--muted); font-size: 11px; font-weight: 700; line-height: 1.15;
}
.alb-cthumb canvas { width: 100%; height: auto; aspect-ratio: 210 / 297; border-radius: 4px; box-shadow: 0 3px 10px rgba(0,0,0,.3); background: var(--tile); }
.alb-cthumb:hover { border-color: var(--accent); color: var(--text); }
.alb-cthumb.on { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent) inset; color: var(--text); }
.alb-note-inline { font-weight: 400; color: var(--muted); }
.alb-field input[type="range"] { width: 100%; accent-color: var(--accent); min-height: 32px; }
.alb-cover-img { padding: 0 !important; display: block !important; overflow: hidden; }
.alb-cover-img img { display: block; width: 210mm; height: 296mm; }
.alb-cover-wait { display: grid; place-items: center; height: 296mm; color: var(--a-soft); font-size: 14px; }
.alb-pdfstage { position: fixed !important; left: -12000px; top: 0; width: 794px; visibility: hidden; pointer-events: none; z-index: -1; }
@media (max-width: 760px) {
  .alb-foot { flex-direction: column; align-items: stretch; gap: 8px; padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); }
  .alb-foot .alb-hint { display: none; }
  .alb-foot .alb-count { text-align: center; font-size: 12.5px; }
  .alb-foot-btns { width: 100%; }
  .alb-foot-btns > * { flex: 1 1 0; }
  .alb-foot .alb-pdf { min-width: 0; font-size: 15px; }
  .alb-cover-thumbs { grid-template-columns: repeat(4, minmax(0, 1fr)); max-height: none; overflow: visible; }
  .alb-select { min-height: 46px; font-size: 16px; }
}

/* ============================== 6 · Sidebar collapsible sections ============================== */
.side-sec { border-bottom: 1px solid var(--panel-border); padding: 2px 0 6px; }
.side-sec > summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: 6px; min-height: 40px;
  margin: 6px 0 0; padding: 0 6px; border-radius: 10px; user-select: none;
}
.side-sec > summary::-webkit-details-marker { display: none; }
.side-sec > summary::after {
  content: ''; margin-left: auto; flex: 0 0 auto; width: 7px; height: 7px;
  border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted);
  transform: rotate(45deg) translateY(-2px); transition: transform .2s ease;
}
.side-sec[open] > summary::after { transform: rotate(-135deg) translateY(-1px); }
.side-sec > summary:hover { background: var(--card); color: var(--text); }
.side-sec-hint { text-transform: none; letter-spacing: 0; font-weight: 700; color: var(--accent); font-size: 11.5px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.side-sec > :not(summary) { margin-top: 6px; animation: secIn .18s ease; }
@keyframes secIn { from { opacity: 0; transform: translateY(-3px); } to { opacity: 1; transform: none; } }
.theme-list { max-height: 46vh; overflow-y: auto; padding-right: 2px; }
.tn-dot { flex: 0 0 auto; width: 10px; height: 10px; border-radius: 50%; background: var(--th); box-shadow: 0 0 0 3px color-mix(in srgb, var(--th) 22%, transparent); }
.tn-ico { display: none; }
@media (pointer: coarse) {
  .side-sec > summary { min-height: 48px; }
  .theme-list a, .link-list li a { min-height: 44px; display: flex; align-items: center; }
}

/* ============================== 7 · Compact filter bar + chips ============================== */
.fbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.fbar .fb-group {
  display: flex; align-items: center; gap: 6px; height: 40px; padding: 0 6px 0 10px;
  background: var(--card); border: 1px solid var(--panel-border); border-radius: 12px;
}
.fbar .fb-k { font-size: 12px; font-weight: 700; color: var(--muted); margin: 0; }
.fbar select, .fbar input {
  height: 30px; background: var(--tile); border: 1px solid var(--panel-border); color: var(--text);
  border-radius: 8px; padding: 0 8px; font-size: 13px; outline: none;
}
.fbar select { background-color: var(--bg-2); cursor: pointer; }
.fbar select:focus, .fbar input:focus { border-color: var(--accent); }
.fbar .fb-dir {
  height: 30px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--panel-border); cursor: pointer;
  background: color-mix(in srgb, var(--accent) 16%, var(--bg-2)); color: var(--text); font-weight: 700; font-size: 12.5px; white-space: nowrap;
}
.fbar .fb-range { padding-left: 4px; }
.fb-seg { display: flex; background: var(--tile); border-radius: 9px; padding: 2px; border: 1px solid var(--panel-border); }
.fb-seg button {
  height: 26px; padding: 0 10px; border: 0; border-radius: 7px; background: transparent; color: var(--muted);
  font-size: 12.5px; font-weight: 700; cursor: pointer; white-space: nowrap;
}
.fb-seg button.on { background: color-mix(in srgb, var(--accent) 26%, var(--bg-2)); color: var(--text); }
.fbar .scott-filter, .fbar .year-filter { display: flex; align-items: center; gap: 5px; background: none; border: 0; padding: 0; border-radius: 0; }
.fbar .scott-filter[hidden], .fbar .year-filter[hidden] { display: none; }
.fbar .scott-filter input, .fbar .year-filter input { width: 70px; text-align: center; }
.fbar .yf-dash { color: var(--muted); }
.fbar .yf-apply { height: 30px; padding: 0 12px; border: 0; border-radius: 8px; font-weight: 800; font-size: 12.5px; cursor: pointer; }
.fbar .yf-clear { height: 30px; width: 26px; border: 0; background: transparent; color: var(--muted); font-size: 16px; cursor: pointer; border-radius: 8px; }
.fbar .yf-clear:hover { color: var(--text); background: var(--tile); }
.fbar .btn-3d, .fbar .btn-reset { height: 40px; padding: 0 14px; border-radius: 12px; font-size: 13px; font-weight: 800; white-space: nowrap; }
.fchips { display: flex; flex-wrap: wrap; gap: 6px; margin: -8px 0 14px; }
.fchip {
  display: inline-flex; align-items: center; gap: 8px; min-height: 32px; padding: 0 6px 0 12px; border-radius: 999px; cursor: pointer;
  border: 1px solid color-mix(in srgb, var(--accent) 55%, var(--panel-border)); background: color-mix(in srgb, var(--accent) 14%, var(--bg-2));
  color: var(--text); font-size: 12.5px; font-weight: 700;
}
.fchip span { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: color-mix(in srgb, var(--text) 12%, transparent); font-size: 13px; }
.fchip:hover span { background: #e5484d; color: #fff; }
.fchip-all { background: transparent; border-style: dashed; padding: 0 12px; }
/* Explained empty grid: which filters are combined + one-tap way out. */
.empty-state .empty-title { font-size: 17px; font-weight: 800; margin: 0 0 6px; }
.empty-state .empty-combo { margin: 0 0 12px; font-size: 14px; }
.empty-state .empty-acts { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; align-items: center; }
@media (max-width: 760px) {
  .fbar { width: 100%; }
  .fbar .fb-group { width: 100%; height: auto; min-height: 46px; flex-wrap: wrap; padding: 6px 8px; }
  .fbar .sort-filter select { flex: 1 1 auto; height: 38px; font-size: 16px; }
  .fbar .fb-dir, .fbar .yf-apply { height: 38px; }
  .fbar .fb-range { flex-direction: column; align-items: stretch; }
  .fb-seg button { flex: 1 1 0; height: 34px; font-size: 14px; }
  .fbar .scott-filter, .fbar .year-filter { width: 100%; }
  .fbar .scott-filter input, .fbar .year-filter input { flex: 1 1 0; width: auto; min-width: 0; height: 38px; font-size: 16px; }
  .fbar .btn-3d, .fbar .btn-reset { flex: 1 1 0; }
  .fchips { margin: 0 0 12px; }
}

/* ============================== 8 · Album: cover-only mode switch ============================== */
.alb-mode {
  width: 100%; margin: 12px 0 4px; min-height: 42px; border-radius: 10px; cursor: pointer; font-weight: 800; font-size: 13.5px;
  border: 1px dashed color-mix(in srgb, var(--accent) 60%, var(--panel-border)); background: transparent; color: var(--text);
}
.alb-mode:hover { background: color-mix(in srgb, var(--accent) 12%, transparent); }

/* ============================== 9 · Album sheets: several years per sheet ============================== */
.alb-body { display: flex; flex-direction: column; gap: 5mm; }
.alb-body.alb-vcenter { justify-content: center; }
.alb-yblock { display: flex; flex-direction: column; gap: 2mm; }
.alb-yband { display: flex; align-items: center; gap: 4mm; height: 7mm; color: var(--a-title); font-family: var(--a-font); }
.alb-yband i { flex: 1 1 auto; border-top: .35mm solid var(--a-line); }
.alb-yband span { font-size: 15px; font-weight: 700; letter-spacing: .6px; white-space: nowrap; }
.alb-rows.grid { gap: 8mm; }
.alb-grow { display: flex; justify-content: center; gap: 8mm; }
.alb-gcell { flex: 0 0 auto; min-width: 0; }

/* Cover design families (Todos · Paisajes · Temáticas · Diseño). */
.alb-cgroups { display: flex; flex-wrap: wrap; gap: 6px; margin: 2px 0 8px; }
.alb-cgroups button {
  flex: 1 1 auto; min-height: 32px; padding: 0 10px; border-radius: 999px; cursor: pointer; font-size: 12.5px; font-weight: 700;
  border: 1px solid var(--panel-border); background: var(--card); color: var(--muted);
}
.alb-cgroups button.on { color: var(--text); border-color: var(--accent); background: color-mix(in srgb, var(--accent) 18%, var(--bg-2)); }
@media (max-width: 760px) { .alb-cgroups button { min-height: 40px; font-size: 14px; } }

/* ============================== 10 · Phone side menu: SOLID ============================== */
/* The slide-in menu used the translucent glass of the desktop sidebar; over the catalogue its
   entries were hard to read. On phones/tablets it is now an opaque sheet of the skin colour. */
@media (max-width: 992px) {
  .sidebar, [data-theme] .sidebar {
    background: var(--bg-2) !important;
    backdrop-filter: none !important; -webkit-backdrop-filter: none !important;
    box-shadow: 14px 0 44px rgba(0, 0, 0, .5);
    border-right: 1px solid var(--panel-border);
  }
  .sidebar .side-search input { background: var(--bg); }
}

/* ============================== 11 · Album: letters, placement, frames ============================== */
.alb-doc .alb-sh-title { font-family: var(--a-font); font-size: var(--a-head-size, 21px); }
.alb-doc .alb-yband span { font-family: var(--a-font); font-size: calc(var(--a-head-size, 21px) * .72); }
.alb-doc .alb-cap { font-family: var(--a-cap-font, var(--a-font)); font-size: var(--a-cap-size, 10px); }
.alb-doc .alb-cap .alb-nm { font-size: calc(var(--a-cap-size, 10px) - .5px); }
.alb-doc .alb-cover h1, .alb-doc .alb-cover h2 { font-family: var(--a-font); }
.alb-body.alb-v-top { justify-content: flex-start; }
.alb-body.alb-v-center { justify-content: center; }
.alb-body.alb-v-bottom { justify-content: flex-end; }
.alb-gcell .alb-frame { height: var(--a-gh, 38mm); }
.alb-gimg { position: relative; display: inline-flex; max-width: 100%; max-height: 100%; }
.alb-gimg img { max-width: 100%; max-height: calc(var(--a-gh, 38mm) - 8mm); object-fit: contain; }
.alb-rimg { position: relative; }
/* Frame styles */
.alb-doc[data-frame="none"] .alb-rframe, .alb-doc[data-frame="none"] .alb-frame { border: 0; background: transparent; box-shadow: none; }
.alb-doc[data-frame="none"] .alb-rframe { padding: 0; }
.alb-doc[data-frame="shadow"] .alb-rframe, .alb-doc[data-frame="shadow"] .alb-frame { border: 0; box-shadow: .9mm 1.2mm 0 rgba(0, 0, 0, .28); }
.alb-doc[data-frame="corners"] .alb-rframe, .alb-doc[data-frame="corners"] .alb-frame { border: 0; background: transparent; box-shadow: none; }
.alb-pc { position: absolute; width: 3.2mm; height: 3.2mm; z-index: 2; }
.alb-pc.tl { left: -.8mm; top: -.8mm; background: linear-gradient(135deg, #1b1b1b 50%, transparent 50%); }
.alb-pc.tr { right: -.8mm; top: -.8mm; background: linear-gradient(225deg, #1b1b1b 50%, transparent 50%); }
.alb-pc.bl { left: -.8mm; bottom: -.8mm; background: linear-gradient(45deg, #1b1b1b 50%, transparent 50%); }
.alb-pc.br { right: -.8mm; bottom: -.8mm; background: linear-gradient(315deg, #1b1b1b 50%, transparent 50%); }
/* Typeface picker and small link button in the builder */
.alb-fonts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.alb-fonts button { min-height: 40px; padding: 0 8px; border-radius: 9px; cursor: pointer; font-size: 15px; background: var(--card); color: var(--muted); border: 1px solid var(--panel-border); }
.alb-fonts button.on { color: var(--text); border-color: var(--accent); background: color-mix(in srgb, var(--accent) 20%, var(--bg-2)); }
.alb-link { border: 0; background: none; color: var(--accent); font-weight: 800; cursor: pointer; padding: 0; }
.alb-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (min-width: 761px) { .alb-controls { width: 390px; flex-basis: 390px; } .alb-tabs { grid-template-columns: repeat(6, minmax(0, 1fr)); } .alb-tabs button { padding: 7px 2px; font-size: 12px; } }
@media (max-width: 760px) { .alb-fonts button { min-height: 46px; } }

/* ---------- «Impresiones especiales»: empty real-size boxes per Scott number (album.js) ---------- */
.alb-sp-thead, .alb-sp-trow { display: grid; grid-template-columns: 62px 50px minmax(0, 1fr) 96px 28px; gap: 5px; align-items: center; }
.alb-sp-thead { font-size: 11px; color: var(--muted); margin: 4px 0 4px; }
.alb-sp-table { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.alb-sp-trow { padding: 6px; border: 1px solid var(--panel-border); border-radius: 9px; background: color-mix(in srgb, var(--card) 60%, transparent); }
.alb-sp-trow input, .alb-sp-qrow input { width: 100%; min-width: 0; background: var(--card); border: 1px solid var(--panel-border); border-radius: 7px; padding: 6px 6px; color: var(--text); font-size: 13px; }
.alb-sp-trow .alb-select, .alb-sp-qrow .alb-select { width: 100%; min-width: 0; padding: 6px 4px; font-size: 12.5px; border-radius: 7px; }
.alb-sp-dim { display: flex; align-items: center; gap: 2px; color: var(--muted); font-size: 12px; }
.alb-sp-dim input { text-align: center; padding: 6px 2px; }
.alb-sp-del { border: 1px solid var(--panel-border); background: var(--card); color: var(--muted); border-radius: 7px; height: 30px; cursor: pointer; font-size: 17px; line-height: 1; }
.alb-sp-del:hover { color: var(--text); border-color: var(--accent); }
.alb-sp-info { grid-column: 1 / -1; font-size: 11.5px; color: var(--muted); line-height: 1.4; }
.alb-sp-info:empty { display: none; }
.alb-sp-warn { color: var(--danger, #e5484d); font-weight: 700; }
.alb-sp-actions { display: grid; grid-template-columns: 1fr auto auto; gap: 6px; margin-bottom: 12px; }
.alb-sp-actions .alb-load { margin: 0; }
.alb-sp-btn { background: var(--card); border: 1px solid var(--panel-border); color: var(--text); border-radius: 9px; padding: 8px 10px; font-size: 12.5px; cursor: pointer; }
.alb-sp-btn:hover { border-color: var(--accent); }
.alb-sp-qrow { display: grid; grid-template-columns: 1fr 1fr 52px minmax(0, 1.4fr) auto; gap: 5px; align-items: center; }
/* Sheet markup (preview, print and PDF share it). */
.alb-sp-seg { display: flex; flex-direction: column; gap: 2.5mm; }
.alb-sp-lbl { text-align: center; font-weight: 700; line-height: 1.35; overflow-wrap: anywhere;
  font-family: var(--a-cap-font, var(--a-font)); font-size: var(--a-cap-size, 10px); color: var(--a-title); }
.alb-sp-rows { display: flex; flex-direction: column; }
.alb-sp-row { display: flex; align-items: center; }
.alb-sp-cell { flex: 0 0 auto; }
.alb-slot { position: relative; box-sizing: border-box; border: .3mm solid var(--a-soft); background: var(--a-mount); }
.alb-sd { position: absolute; }
.alb-si { position: absolute; display: block; object-fit: contain; }
.alb-sp-rot { position: relative; }
.alb-sp-rot > .alb-slot { position: absolute; left: 50%; top: 50%; }
.alb-sd.v { border-left: .2mm dashed var(--a-frame); }
.alb-sd.h { border-top: .2mm dashed var(--a-frame); }
.alb-slot-n { height: 4mm; line-height: 4mm; text-align: center; font-size: 8px; color: var(--a-soft); font-family: var(--a-cap-font, var(--a-font)); }
@media (max-width: 760px) {
  .alb-sp-thead, .alb-sp-trow { grid-template-columns: 70px 56px minmax(0, 1fr) 36px; }
  .alb-sp-thead span:nth-child(4) { display: none; }
  .alb-sp-dim { grid-column: 1 / span 3; grid-row: 2; }
  .alb-sp-dim::before { content: 'Medida mm (opcional):'; margin-right: 6px; white-space: nowrap; }
  .alb-sp-del { grid-column: 4; grid-row: 1; height: 42px; }
  .alb-sp-trow input, .alb-sp-trow .alb-select, .alb-sp-qrow input, .alb-sp-qrow .alb-select { font-size: 16px; min-height: 42px; }
  .alb-sp-qrow { grid-template-columns: 1fr 1fr 64px; }
  .alb-sp-qrow .alb-select { grid-column: 1 / span 2; }
  .alb-sp-actions { grid-template-columns: 1fr 1fr; }
  .alb-sp-actions .alb-load { grid-column: 1 / -1; }
  .alb-sp-btn { min-height: 42px; }
}

/* ---------- Private purchase cost on each card (logged-in only, app.js costInputHtml) ---------- */
.card-meta .card-cost { margin-left: auto; width: 86px; min-width: 0; flex: 0 1 86px; text-align: right; font-size: 11.5px; font-variant-numeric: tabular-nums;
  padding: 2px 6px; border-radius: 6px; border: 1px solid var(--panel-border); background: var(--bg-2); color: var(--text); }
.card-meta .card-cost::placeholder { color: var(--muted); opacity: .8; }
.card-meta .card-cost:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 30%, transparent); }
.card-cost.ok { border-color: #22c55e; }
.card-cost.err { border-color: var(--danger, #e5484d); }
.coll-cost { text-align: right; font-variant-numeric: tabular-nums; }
.card-meta { flex-wrap: wrap; row-gap: 4px; }
@media (max-width: 760px) { .card-meta .card-cost { width: 96px; flex-basis: 96px; font-size: 16px; padding: 3px 6px; } }

/* ---------- Valuation: private purchase log (insights.js) ---------- */
.ins-private { font-size: 11px; font-weight: 600; color: var(--muted); margin-left: 6px; text-transform: none; letter-spacing: 0; }
.ins-cost { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 6px 0 4px; }
.ins-cost-box { border: 1px solid var(--panel-border); border-radius: 12px; padding: 12px 14px; background: var(--card); display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ins-cost-box small { color: var(--muted); font-size: 12px; }
.ins-cost-box b { font-size: 22px; color: var(--text); font-variant-numeric: tabular-nums; }
.ins-cost-box span { color: var(--muted); font-size: 12px; }
.ins-cost-box.up b { color: #22c55e; }
.ins-cost-box.down b { color: var(--danger, #e5484d); }
.ins-piece-val { text-align: right; }
.ins-piece-cost { display: block; font-size: 11px; font-weight: 600; color: var(--muted); }
@media (max-width: 760px) { .ins-cost { grid-template-columns: 1fr; } }

/* ---------- Album «Excepciones»: varieties / blocks inside a normal album (album.js) ---------- */
@media (min-width: 761px) { .alb-tabs.alb-tabs-7 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.alb-exc-head, .alb-exc-row { grid-template-columns: 74px 62px minmax(0, 1fr) 30px; }
.alb-exc-chips { margin-top: 6px; display: flex; flex-wrap: wrap; align-items: center; gap: 5px; }
.alb-exc-chip { border: 1px solid var(--panel-border); background: var(--card); color: var(--muted); border-radius: 999px; padding: 2px 9px; font-size: 12px; cursor: pointer; }
.alb-exc-chip.on { color: var(--text); border-color: var(--accent); background: color-mix(in srgb, var(--accent) 22%, var(--bg-2)); font-weight: 700; }
@media (max-width: 760px) {
  .alb-exc-head, .alb-exc-row { grid-template-columns: 78px 64px minmax(0, 1fr) 42px; }
  .alb-exc-head span:nth-child(4) { display: inline; }
  .alb-exc-row .alb-sp-del { grid-column: 4; grid-row: 1; }
  .alb-exc-chip { min-height: 34px; padding: 4px 12px; font-size: 14px; }
}
