/* ==================================================================
   Cacadewombat — hoja de estilo única.

   Paleta y tipografías del documento de diseño v1.0. Un solo sistema
   de piezas que funciona sobre dos superficies —papel y wombat— y
   que el modo oscuro del sistema invierte sin tocar una clase.

   Orden: tokens · base · utilidades · cabecera · portada · piezas ·
   cubos · depósito · expedientes · barras · tablas · precios · fichas ·
   formularios · manifiesto · pie · easter · movimiento.
   ================================================================== */

/* ------------------------------------------------------------------
   0. Tokens
   ------------------------------------------------------------------ */

:root {
    /* La paleta, literal. */
    --wombat:  #3E2723;
    --fresca:  #5D4037;
    --tierra:  #795548;
    --arcilla: #A1887F;
    --papel:   #D7CCC8;
    --hueso:   #EFEBE9;
    --cacao:   #BD6E63;
    --oro:     #C9A227;

    /* Derivados: tonos de papel para leer encima y un oro que aguante
       como texto sobre claro (el de la paleta no llega al contraste). */
    --crema:      #F3EDE7;
    --nata:       #FBF8F4;
    --papel-nota: #E9E0D9;
    --oro-tinta:  #7A5F0E;
    --tinta-2:    #6D4C41;

    --titulo: 'Bebas Neue', 'Oswald', 'Arial Narrow', Impact, sans-serif;
    --texto:  'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --mono:   ui-monospace, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace;

    --esp-1: 4px;  --esp-2: 8px;  --esp-3: 12px; --esp-4: 16px;
    --esp-5: 24px; --esp-6: 32px; --esp-7: 48px; --esp-8: 64px; --esp-9: 96px;

    --radio:   6px;
    --radio-l: 10px;
    --ancho:   1160px;

    /* Superficie por defecto: papel. */
    --s-fondo:        var(--crema);
    --s-tarjeta:      var(--nata);
    --s-papel:        var(--papel-nota);
    --s-tinta:        var(--wombat);
    --s-tinta-2:      var(--tinta-2);
    --s-tinta-3:      #8D6E63;
    --s-linea:        #E2D8D1;
    --s-linea-fuerte: var(--papel);
    --s-enlace:       var(--fresca);
    --s-acento:       var(--oro-tinta);
    --s-cifra:        var(--wombat);
    --s-hueco:        rgba(62, 39, 35, .06);
    --s-foco:         var(--oro-tinta);
    --s-sombra:       0 1px 2px rgba(62, 39, 35, .06), 0 10px 30px -14px rgba(62, 39, 35, .25);
    --s-sombra-alta:  0 2px 4px rgba(62, 39, 35, .08), 0 22px 44px -18px rgba(62, 39, 35, .35);

    --boton-fondo:  var(--wombat);
    --boton-tinta:  var(--hueso);
    --boton-hover:  var(--fresca);

    --cubo-trazo-vacio: #B9A59C;

    color-scheme: light;
}

/* Superficie wombat: la cabecera, la portada, el pie y las bandas. */
.oscuro {
    --s-fondo:        var(--wombat);
    --s-tarjeta:      rgba(93, 64, 55, .42);
    --s-papel:        var(--papel);
    --s-tinta:        var(--hueso);
    --s-tinta-2:      #C7B4AB;
    --s-tinta-3:      var(--arcilla);
    --s-linea:        rgba(161, 136, 127, .22);
    --s-linea-fuerte: rgba(161, 136, 127, .4);
    --s-enlace:       var(--oro);
    --s-acento:       var(--oro);
    --s-cifra:        var(--oro);
    --s-hueco:        rgba(0, 0, 0, .22);
    --s-foco:         var(--oro);
    --s-sombra:       0 2px 12px rgba(0, 0, 0, .28);
    --s-sombra-alta:  0 18px 50px -16px rgba(0, 0, 0, .6);

    --boton-fondo:  var(--oro);
    --boton-tinta:  var(--wombat);
    --boton-hover:  #D9B23A;

    --cubo-trazo-vacio: rgba(215, 204, 200, .5);

    color: var(--s-tinta);
    color-scheme: dark;
}

/* El sistema pide oscuro: toda la página pasa a wombat. */
@media (prefers-color-scheme: dark) {
    :root:not([data-tema="claro"]) {
        --s-fondo:        #33201C;
        --s-tarjeta:      rgba(93, 64, 55, .38);
        --s-papel:        var(--papel);
        --s-tinta:        var(--hueso);
        --s-tinta-2:      #C7B4AB;
        --s-tinta-3:      var(--arcilla);
        --s-linea:        rgba(161, 136, 127, .2);
        --s-linea-fuerte: rgba(161, 136, 127, .38);
        --s-enlace:       var(--oro);
        --s-acento:       var(--oro);
        --s-cifra:        var(--oro);
        --s-hueco:        rgba(0, 0, 0, .22);
        --s-foco:         var(--oro);
        --s-sombra:       0 2px 12px rgba(0, 0, 0, .28);
        --s-sombra-alta:  0 18px 50px -16px rgba(0, 0, 0, .6);
        --boton-fondo:    var(--oro);
        --boton-tinta:    var(--wombat);
        --boton-hover:    #D9B23A;
        --cubo-trazo-vacio: rgba(215, 204, 200, .5);
        color-scheme: dark;
    }
}

/* ------------------------------------------------------------------
   1. Base
   ------------------------------------------------------------------ */

*, *::before, *::after { box-sizing: border-box; }

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
    scroll-padding-top: 88px;
}

body {
    margin: 0;
    font-family: var(--texto);
    font-size: 16px;
    line-height: 1.6;
    color: var(--s-tinta);
    background: var(--s-fondo);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    font-feature-settings: 'kern', 'liga', 'calt';
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* Grano de papel. Muy poco: se nota, no se ve. */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    opacity: .05;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .9 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    mix-blend-mode: multiply;
}

main { flex: 1 0 auto; position: relative; z-index: 1; }

img, svg { max-width: 100%; height: auto; vertical-align: middle; }

a {
    color: var(--s-enlace);
    text-decoration: underline;
    text-decoration-color: color-mix(in srgb, currentColor 35%, transparent);
    text-underline-offset: .18em;
    text-decoration-thickness: 1px;
    transition: text-decoration-color .15s ease, color .15s ease;
}
a:hover { text-decoration-color: currentColor; }

h1, h2, h3, h4 {
    font-family: var(--titulo);
    font-weight: 400;
    letter-spacing: .015em;
    line-height: 1;
    margin: 0 0 .35em;
    color: var(--s-tinta);
    text-wrap: balance;
}
h1 { font-size: clamp(2.8rem, 6.5vw, 4.6rem); }
h2 { font-size: clamp(1.9rem, 3.4vw, 2.7rem); }
h3 { font-size: clamp(1.35rem, 2.2vw, 1.7rem); }
h4 { font-size: 1.15rem; letter-spacing: .04em; }

h1 a, h2 a, h3 a { color: inherit; text-decoration: none; }
h1 a:hover, h2 a:hover, h3 a:hover { color: var(--s-enlace); }

p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

small { font-size: .84em; }
strong { font-weight: 600; }
code { font-family: var(--mono); font-size: .9em; background: var(--s-hueco); padding: .1em .35em; border-radius: 3px; }
hr { border: 0; border-top: 1px solid var(--s-linea); margin: var(--esp-6) 0; }

ul, ol { padding-left: 1.3em; }

::selection { background: var(--oro); color: var(--wombat); }

:focus-visible { outline: 2px solid var(--s-foco); outline-offset: 3px; border-radius: 2px; }

/* ------------------------------------------------------------------
   2. Utilidades
   ------------------------------------------------------------------ */

.contenedor {
    width: 100%;
    max-width: var(--ancho);
    margin-inline: auto;
    padding-inline: clamp(16px, 4vw, 32px);
}
.contenedor--medio    { max-width: 920px; }
.contenedor--estrecho { max-width: 700px; }

.seccion      { padding-block: clamp(40px, 6vw, 72px); }
.seccion--fina{ padding-block: clamp(24px, 4vw, 40px); }
.seccion + .seccion--fina, .seccion--fina + .seccion--fina { padding-top: 0; }

.bloque     { margin-top: var(--esp-5); }
.bloque--l  { margin-top: var(--esp-7); }
.bloque--xl { margin-top: var(--esp-8); }

.rejilla {
    display: grid;
    gap: var(--esp-5);
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
}
.rejilla > * { min-width: 0; }
.rejilla--2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
.rejilla--lateral { grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); align-items: start; }
.rejilla--exp { grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); }

@media (max-width: 860px) {
    .rejilla--lateral { grid-template-columns: minmax(0, 1fr); }
}

.acciones {
    display: flex;
    flex-wrap: wrap;
    gap: var(--esp-3);
    align-items: center;
    margin-top: var(--esp-6);
}
.acciones--centro { justify-content: center; }
.fila { display: inline-flex; align-items: center; gap: var(--esp-2); flex-wrap: wrap; }

.centrado { text-align: center; }
.prosa { max-width: 66ch; }
.prosa p { margin-bottom: 1.1em; }
.prosa--grande { font-size: 1.1rem; }
.prosa--centrada { margin-inline: auto; }
.cita { font-style: italic; font-size: 1.15rem; line-height: 1.5; }
.acento { color: var(--s-acento); font-weight: 600; }
.bloque--s { margin-top: var(--esp-3); }
.tarjeta__intro { margin-bottom: var(--esp-5); }
.tarjeta__icono { display: block; margin-bottom: var(--esp-3); }

.visually-hidden {
    position: absolute; width: 1px; height: 1px;
    padding: 0; margin: -1px; overflow: hidden;
    clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.saltar {
    position: absolute; left: -9999px; top: 8px;
    background: var(--oro); color: var(--wombat);
    padding: 8px 16px; z-index: 100; border-radius: var(--radio);
    font-weight: 600; text-decoration: none;
}
.saltar:focus { left: 8px; }

/* Rótulo: la etiqueta pequeña en versalitas que encabeza cada pieza. */
.rotulo {
    font-family: var(--texto);
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--s-tinta-3);
    margin: 0 0 var(--esp-2);
}
.rotulo--oro { color: var(--s-acento); }

.apunte { color: var(--s-tinta-2); font-size: .88rem; }
.apunte--fino { font-style: italic; }
.mono { font-family: var(--mono); font-size: .85em; letter-spacing: .04em; }
.num  { font-variant-numeric: tabular-nums; }

/* Cifras grandes. */
.cifra {
    font-family: var(--titulo);
    font-size: clamp(2.4rem, 5vw, 3.6rem);
    line-height: .95;
    color: var(--s-cifra);
    font-variant-numeric: tabular-nums;
    letter-spacing: .01em;
    margin: 0;
}
.cifra--xl { font-size: clamp(3.4rem, 8vw, 5.6rem); }
.cifra--s  { font-size: 1.9rem; }
.cifra small { font-family: var(--texto); font-size: .95rem; color: var(--s-tinta-2); letter-spacing: 0; margin-left: .35em; }
.cifra__resto { color: var(--s-tinta-3); }

/* Encabezado de página: rótulo, título, lema. */
.encabezado { max-width: 62ch; }
.encabezado h1 { margin-bottom: .25em; }
.lema {
    font-size: clamp(1.05rem, 1.6vw, 1.22rem);
    line-height: 1.55;
    color: var(--s-tinta-2);
    max-width: 58ch;
    text-wrap: pretty;
}

/* Fichas de dato: rótulo, cifra grande, nota. */
.datos {
    display: grid;
    gap: var(--esp-4);
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
}
.dato {
    background: var(--s-tarjeta);
    border: 1px solid var(--s-linea);
    border-radius: var(--radio);
    padding: var(--esp-4) var(--esp-5);
    box-shadow: var(--s-sombra);
}
.dato .rotulo { margin-bottom: var(--esp-2); }
.dato .apunte { margin-top: var(--esp-2); }

/* ------------------------------------------------------------------
   3. Cabecera
   ------------------------------------------------------------------ */

.cabecera {
    background: color-mix(in srgb, var(--wombat) 92%, transparent);
    backdrop-filter: blur(10px) saturate(1.1);
    -webkit-backdrop-filter: blur(10px) saturate(1.1);
    border-bottom: 1px solid rgba(255, 255, 255, .06);
    position: sticky;
    top: 0;
    z-index: 40;
    transition: box-shadow .2s ease;
}
.cabecera.con-sombra { box-shadow: 0 6px 24px -12px rgba(0, 0, 0, .55); }

.cabecera__fila {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: var(--esp-4);
    min-height: 68px;
}

.marca {
    font-family: var(--titulo);
    font-size: 1.75rem;
    letter-spacing: .07em;
    color: var(--hueso);
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    white-space: nowrap;
    line-height: 1;
}
.marca:hover { color: #fff; }

/* La O de WOMBAT es un cubo. No es decoración: es la unidad. */
.marca__cubo {
    --cubo: .72em;
    margin: 0 .04em 0 .06em;
    transform: translateY(-.04em);
    transition: transform .4s cubic-bezier(.2, .8, .2, 1);
}
.marca:hover .marca__cubo { transform: translateY(-.04em) rotate(-12deg) scale(1.08); }

.menu {
    display: flex;
    gap: 0;
    justify-self: center;
    font-size: .875rem;
    font-weight: 500;
    max-width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
}
.menu::-webkit-scrollbar { display: none; }
.menu a {
    color: var(--papel);
    text-decoration: none;
    padding: 8px 10px;
    border-radius: 999px;
    position: relative;
    white-space: nowrap;
    transition: color .15s ease, background .15s ease;
}
.menu a:hover { color: var(--hueso); background: rgba(255, 255, 255, .06); }
.menu a.es-activo { color: var(--oro); }
.menu a.es-activo::after {
    content: '';
    position: absolute;
    left: 50%; bottom: 1px;
    width: 5px; height: 5px;
    background: var(--oro);
    transform: translateX(-50%) rotate(45deg);
}

.cabecera__estado {
    display: flex;
    align-items: center;
    gap: var(--esp-3);
    justify-self: end;
}

.contador {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(0, 0, 0, .28);
    border: 1px solid rgba(161, 136, 127, .35);
    border-radius: 999px;
    padding: 5px 14px 5px 8px;
    color: var(--hueso);
    text-decoration: none;
    transition: border-color .15s ease, background .15s ease;
}
.contador:hover { border-color: var(--oro); background: rgba(0, 0, 0, .4); }
.contador .cubo { --cubo: 20px; }
.contador__cifra { font-family: var(--titulo); font-size: 1.45rem; color: var(--oro); line-height: 1; }
.contador__rotulo { font-size: .68rem; color: var(--arcilla); text-transform: uppercase; letter-spacing: .08em; }
.contador--vacio .contador__cifra { color: var(--cacao); }

.wombat-mini {
    color: var(--papel);
    font-size: .86rem;
    line-height: 1.15;
    text-align: right;
    text-decoration: none;
    font-weight: 500;
}
.wombat-mini small { display: block; color: var(--arcilla); font-weight: 400; font-family: var(--mono); font-size: .68rem; letter-spacing: .06em; }
.wombat-mini:hover { color: var(--hueso); }

.menu-entrar {
    color: var(--papel);
    font-size: .88rem;
    font-weight: 500;
    text-decoration: none;
    padding: 7px 14px;
    border: 1px solid rgba(161, 136, 127, .4);
    border-radius: 999px;
    transition: border-color .15s ease, color .15s ease;
}
.menu-entrar:hover { color: var(--oro); border-color: var(--oro); }

/* Avisos de sesión debajo de la cabecera. */
.avisos { padding-top: var(--esp-4); }
.avisos:empty { display: none; }

@media (max-width: 1500px) {
    .contador__rotulo { display: none; }
    .contador { padding-right: 12px; }
}

@media (max-width: 960px) {
    .cabecera__fila {
        grid-template-columns: auto auto;
        grid-template-areas: "marca estado" "menu menu";
        row-gap: 0;
        padding-block: 8px;
    }
    .marca { grid-area: marca; }
    .cabecera__estado { grid-area: estado; }
    .menu {
        grid-area: menu;
        justify-self: stretch;
        overflow-x: auto;
        scrollbar-width: none;
        margin-inline: calc(-1 * clamp(16px, 4vw, 32px));
        padding: 4px clamp(16px, 4vw, 32px) 8px;
        -webkit-mask-image: linear-gradient(90deg, transparent, #000 16px, #000 calc(100% - 24px), transparent);
                mask-image: linear-gradient(90deg, transparent, #000 16px, #000 calc(100% - 24px), transparent);
    }
}
@media (max-width: 560px) {
    .marca { font-size: 1.5rem; }
    .wombat-mini { display: none; }
    .cabecera__estado { gap: 8px; min-width: 0; }
    .menu-entrar { padding: 6px 10px; font-size: .8rem; }
    .contador { padding: 4px 10px 4px 6px; gap: 6px; }
    .contador .cubo { --cubo: 18px; }
    .contador__cifra { font-size: 1.25rem; }
}

/* ------------------------------------------------------------------
   4. Portada
   ------------------------------------------------------------------ */

.portada {
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(900px 480px at 12% 0%, rgba(121, 85, 72, .45), transparent 65%),
        radial-gradient(700px 520px at 92% 100%, rgba(93, 64, 55, .7), transparent 60%),
        var(--wombat);
    color: var(--hueso);
    border-bottom: 1px solid rgba(255, 255, 255, .05);
}
.portada::after {
    /* Horizonte de tierra, apenas. */
    content: '';
    position: absolute; left: 0; right: 0; bottom: 0;
    height: 42%;
    background: linear-gradient(180deg, transparent, rgba(0, 0, 0, .22));
    pointer-events: none;
}

.portada__fila {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(300px, .9fr);
    gap: clamp(32px, 5vw, 72px);
    align-items: center;
    padding-block: clamp(56px, 9vw, 120px);
}

.portada__rotulo {
    color: var(--arcilla);
    margin-bottom: var(--esp-4);
}
.portada__titulo {
    font-size: clamp(3.4rem, 9vw, 7.4rem);
    line-height: .92;
    letter-spacing: .01em;
    color: var(--hueso);
    margin-bottom: .3em;
}
.portada__titulo em { font-style: normal; color: var(--oro); }
.portada__lema {
    font-size: clamp(1.08rem, 1.7vw, 1.28rem);
    color: var(--papel);
    max-width: 50ch;
    line-height: 1.55;
}
.portada__acciones { margin-top: var(--esp-6); }

.portada__visual {
    position: relative;
    display: grid;
    justify-items: center;
    gap: var(--esp-5);
}

/* El montón: cinco cubos de wombat, uno de ellos de oro. */
.monton {
    position: relative;
    width: 240px;
    height: 220px;
    filter: drop-shadow(0 24px 30px rgba(0, 0, 0, .45));
    animation: flotar 7s ease-in-out infinite;
}
.monton .cubo {
    --cubo: 112px;
    position: absolute;
    --c1: #A78B7E; --c2: #7E5A4C; --c3: #5B3E35; --ct: rgba(0,0,0,.25);
}
.monton .cubo:nth-child(1) { left: 64px; top: 48px; }
.monton .cubo:nth-child(2) { left: 17px; top: 74px; }
.monton .cubo:nth-child(3) { left: 111px; top: 74px; }
.monton .cubo:nth-child(4) { left: 64px; top: 100px; }
.monton .cubo:nth-child(5) { left: 64px; top: 54px; --c1: #E3C25A; --c2: #C9A227; --c3: #9A7B1B; }

.comedero {
    width: 100%;
    max-width: 380px;
    background: var(--nata);
    color: var(--wombat);
    border-radius: var(--radio-l);
    padding: var(--esp-5) var(--esp-6) var(--esp-6);
    text-align: center;
    box-shadow: 0 30px 60px -24px rgba(0, 0, 0, .7), 0 0 0 1px rgba(255, 255, 255, .08);
    transform: rotate(-1deg);
    position: relative;
}
.comedero::before {
    /* La chincheta que sujeta la nota. */
    content: '';
    position: absolute; top: -9px; left: 50%;
    width: 18px; height: 18px; margin-left: -9px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, #E3C25A, #9A7B1B);
    box-shadow: 0 3px 6px rgba(0, 0, 0, .4);
}
.comedero .rotulo { color: var(--tinta-2); }
.comedero__cifra {
    font-family: var(--titulo);
    font-size: 4.6rem;
    line-height: 1;
    color: var(--wombat);
    margin: 6px 0 2px;
    font-variant-numeric: tabular-nums;
}
.comedero__cifra span { color: var(--oro-tinta); margin-inline: .08em; }
.comedero__nota { font-size: .82rem; color: var(--tinta-2); margin-top: var(--esp-3); }
.comedero .boton { margin-top: var(--esp-4); background: var(--wombat); color: var(--hueso); }
.comedero .boton:hover { background: var(--fresca); }
.comedero--agotado .comedero__cifra { color: var(--cacao); }

@media (max-width: 900px) {
    .portada__fila { grid-template-columns: minmax(0, 1fr); padding-block: clamp(40px, 8vw, 72px); }
    .portada__visual { justify-items: start; }
    .monton { display: none; }
    .comedero { transform: none; max-width: 100%; }
}

/* Banda oscura a lo ancho, para hambre y montón. */
.banda {
    background: var(--wombat);
    color: var(--hueso);
    border-block: 1px solid rgba(255, 255, 255, .05);
}

/* ------------------------------------------------------------------
   5. Piezas
   ------------------------------------------------------------------ */

.tarjeta {
    background: var(--s-tarjeta);
    border: 1px solid var(--s-linea);
    border-radius: var(--radio-l);
    padding: clamp(20px, 3vw, 28px);
    box-shadow: var(--s-sombra);
    color: var(--s-tinta);
}
.tarjeta > :last-child { margin-bottom: 0; }
.tarjeta--oro   { border-color: color-mix(in srgb, var(--oro) 65%, var(--s-linea)); box-shadow: var(--s-sombra), inset 0 0 0 1px color-mix(in srgb, var(--oro) 25%, transparent); }
.tarjeta--cacao { border-color: color-mix(in srgb, var(--cacao) 65%, var(--s-linea)); }
.tarjeta--centrada { text-align: center; }
.tarjeta--enlace { transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease; }
.tarjeta--enlace:hover { transform: translateY(-2px); box-shadow: var(--s-sombra-alta); border-color: var(--s-linea-fuerte); }

/* Papel: la ficha, la nota, el documento. Siempre claro. */
.tarjeta--papel {
    --s-fondo:        var(--papel-nota);
    --s-tarjeta:      var(--papel-nota);
    --s-tinta:        var(--wombat);
    --s-tinta-2:      var(--tinta-2);
    --s-tinta-3:      #8D6E63;
    --s-linea:        #CDBFB6;
    --s-linea-fuerte: #B9A59C;
    --s-enlace:       var(--fresca);
    --s-acento:       var(--oro-tinta);
    --s-cifra:        var(--wombat);
    --s-hueco:        rgba(62, 39, 35, .07);
    --s-foco:         var(--oro-tinta);
    --boton-fondo:    var(--wombat);
    --boton-tinta:    var(--hueso);
    --boton-hover:    var(--fresca);
    --cubo-trazo-vacio: #A8958B;
    background: var(--papel-nota);
    color: var(--wombat);
    color-scheme: light;
    border-color: #CDBFB6;
    background-image: linear-gradient(180deg, rgba(255, 255, 255, .35), transparent 40%);
}

.boton {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5em;
    font-family: var(--titulo);
    font-size: 1.12rem;
    letter-spacing: .08em;
    line-height: 1;
    padding: 13px 24px 12px;
    border: 1px solid transparent;
    border-radius: var(--radio);
    background: var(--boton-fondo);
    color: var(--boton-tinta);
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    white-space: nowrap;
    transition: background .15s ease, transform .15s ease, box-shadow .15s ease, border-color .15s ease, color .15s ease;
    box-shadow: 0 1px 0 rgba(0, 0, 0, .08);
}
.boton:hover { background: var(--boton-hover); color: var(--boton-tinta); transform: translateY(-1px); box-shadow: 0 6px 16px -8px rgba(0, 0, 0, .5); }
.boton:active { transform: translateY(0); box-shadow: none; }
.boton:disabled, .boton[aria-disabled="true"] {
    background: var(--s-hueco); color: var(--s-tinta-3); border-color: var(--s-linea);
    cursor: not-allowed; transform: none; box-shadow: none;
}

.boton--hueco {
    background: transparent;
    color: var(--s-tinta);
    border-color: var(--s-linea-fuerte);
    box-shadow: none;
}
.boton--hueco:hover { background: var(--s-hueco); color: var(--s-tinta); border-color: var(--s-tinta-3); }
.boton--oro { background: var(--oro); color: var(--wombat); }
.boton--oro:hover { background: #D9B23A; color: var(--wombat); }
.boton--fino  { font-size: .95rem; padding: 9px 16px 8px; letter-spacing: .06em; }
.boton--ancho { display: flex; width: 100%; }
.boton .cubo { --cubo: 1em; }

.aviso {
    display: flex;
    gap: var(--esp-3);
    align-items: flex-start;
    border: 1px solid var(--s-linea);
    border-left: 4px solid var(--oro);
    background: var(--s-tarjeta);
    padding: 12px 16px;
    margin-block: var(--esp-4);
    border-radius: var(--radio);
    box-shadow: var(--s-sombra);
    font-size: .95rem;
    color: var(--s-tinta);
}
.aviso--error { border-left-color: var(--cacao); }
.aviso--ok    { border-left-color: var(--oro); }
.aviso .cubo  { --cubo: 18px; flex: none; margin-top: 2px; }
.aviso p { margin: 0; }

/* Sello: KPI, CACA, VITALICIO, número de expediente. */
.sello {
    display: inline-block;
    font-family: var(--mono);
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .16em;
    text-transform: uppercase;
    padding: 3px 8px 2px;
    border: 1.5px solid currentColor;
    border-radius: 3px;
    color: var(--s-tinta-2);
    line-height: 1.3;
    vertical-align: middle;
}
.sello--kpi  { color: var(--s-acento); }
.sello--caca { color: var(--cacao); }
.sello--oro  { color: var(--wombat); background: var(--oro); border-color: var(--oro); }
.sello--girado { transform: rotate(-3deg); }

.etiquetas { display: flex; flex-wrap: wrap; gap: 8px; margin: var(--esp-4) 0 0; padding: 0; list-style: none; }
.etiqueta {
    display: inline-block;
    font-size: .78rem;
    font-weight: 500;
    letter-spacing: .02em;
    padding: 4px 11px;
    border-radius: 999px;
    background: var(--s-hueco);
    border: 1px solid var(--s-linea);
    color: var(--s-tinta-2);
}

/* Filtros en píldora y pestañas subrayadas. */
.filtros { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: var(--esp-5); }
.filtros__rotulo { font-size: .78rem; color: var(--s-tinta-3); text-transform: uppercase; letter-spacing: .1em; font-weight: 600; margin-right: 4px; }
.filtros__rotulo:not(:first-child) { margin-left: 8px; }
.filtro {
    display: inline-block;
    font-size: .86rem;
    font-weight: 500;
    padding: 6px 14px;
    border-radius: 999px;
    border: 1px solid var(--s-linea-fuerte);
    color: var(--s-tinta);
    text-decoration: none;
    transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.filtro:hover { background: var(--s-hueco); border-color: var(--s-tinta-3); }
.filtro.es-activo { background: var(--wombat); border-color: var(--wombat); color: var(--hueso); }
.oscuro .filtro.es-activo { background: var(--oro); border-color: var(--oro); color: var(--wombat); }

.pestanas {
    display: flex;
    gap: 2px;
    border-bottom: 1px solid var(--s-linea-fuerte);
    margin-top: var(--esp-5);
    overflow-x: auto;
    scrollbar-width: none;
}
.pestanas::-webkit-scrollbar { display: none; }
.pestana {
    font-family: var(--titulo);
    font-size: 1.15rem;
    letter-spacing: .06em;
    padding: 10px 16px 8px;
    color: var(--s-tinta-2);
    text-decoration: none;
    border-bottom: 3px solid transparent;
    margin-bottom: -1px;
    white-space: nowrap;
    transition: color .15s ease, border-color .15s ease;
}
.pestana:hover { color: var(--s-tinta); }
.pestana.es-activo { color: var(--s-tinta); border-bottom-color: var(--oro); }

.paginacion { display: flex; align-items: center; gap: var(--esp-3); margin-top: var(--esp-6); flex-wrap: wrap; }

/* ------------------------------------------------------------------
   6. Cubos: la unidad
   ------------------------------------------------------------------ */

.cubo {
    --cubo: 20px;
    --c1: #A1887F;             /* cara de arriba   */
    --c2: #795548;             /* cara izquierda   */
    --c3: #5D4037;             /* cara derecha     */
    --ct: rgba(62, 39, 35, .35);  /* arista         */
    --cw: .9;
    --cd: 0;
    width: var(--cubo);
    height: var(--cubo);
    flex: none;
    display: inline-block;
    overflow: visible;
}
.cubo--vacio { --c1: transparent; --c2: transparent; --c3: transparent; --ct: var(--cubo-trazo-vacio); --cw: 1.4; --cd: 2.6 2.2; }
.cubo--oro   { --c1: #E3C25A; --c2: #C9A227; --c3: #9A7B1B; --ct: rgba(90, 70, 10, .35); }
.cubo--cacao { --c1: #D4938A; --c2: #BD6E63; --c3: #94544B; --ct: rgba(80, 30, 25, .35); }
.cubo--suave { --c1: #C7B4AB; --c2: #A1887F; --c3: #8D6E63; }

.cubos {
    display: inline-flex;
    gap: calc(var(--cubo, 20px) * .18);
    align-items: center;
    vertical-align: middle;
}
.cubos--s  { --cubo: 14px; }
.cubos--m  { --cubo: 20px; }
.cubos--l  { --cubo: 28px; }
.cubos--xl { --cubo: 40px; }
.cubos .cubo { --cubo: inherit; }

/* Media con decimal: el último cubo, a medias. */
.cubo-parcial {
    position: relative;
    display: inline-block;
    width: var(--cubo, 20px);
    height: var(--cubo, 20px);
    flex: none;
}
.cubo-parcial .cubo { position: absolute; inset: 0; --cubo: 100%; }
.cubo-parcial .cubo:last-child { clip-path: inset(0 calc(100% - var(--parte, 50%)) 0 0); }

/* Valoración: rótulo + cubos + cifra. */
.valoraciones {
    display: grid;
    gap: var(--esp-4);
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
}
.valoracion { display: grid; gap: 6px; align-content: start; }
.valoracion__fila { display: flex; align-items: center; gap: var(--esp-3); flex-wrap: wrap; }
.valoracion__cifra {
    font-family: var(--titulo);
    font-size: 1.7rem;
    line-height: 1;
    color: var(--s-tinta);
    font-variant-numeric: tabular-nums;
}
.valoracion__cifra small { font-family: var(--texto); font-size: .8rem; color: var(--s-tinta-2); letter-spacing: 0; }
.valoracion__nota { font-size: .84rem; color: var(--s-tinta-2); margin: 0; }

/* Discrepancia: casa y manada, cara a cara. */
.discrepancia {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: var(--esp-3);
    font-size: .84rem;
    color: var(--s-tinta-2);
}
.discrepancia__cifra {
    font-family: var(--titulo);
    font-size: 2.2rem;
    line-height: 1;
    color: var(--s-acento);
    padding-inline: var(--esp-3);
}
.discrepancia > span:first-child { text-align: right; }

/* ------------------------------------------------------------------
   7. Depósito (votación 0–5). Cinco es el máximo. No existen seis.
   ------------------------------------------------------------------ */

.deposito { max-width: 620px; min-width: 0; }
.deposito .rotulo { margin-bottom: var(--esp-3); }

.escala {
    border: 0;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: flex-end;
    gap: var(--esp-4);
    flex-wrap: wrap;
}
.escala input[type="radio"] { position: absolute; opacity: 0; width: 0; height: 0; pointer-events: none; }

.escala__cubos {
    display: inline-flex;
    gap: 6px;
    padding: 10px 12px;
    border: 1px solid var(--s-linea);
    border-radius: var(--radio-l);
    background: var(--s-hueco);
}
.escala__cubos label {
    display: grid;
    place-items: center;
    width: 52px; height: 52px;
    border-radius: var(--radio);
    cursor: pointer;
    transition: background .15s ease, transform .15s ease;
}
.escala__cubos label:hover { background: rgba(201, 162, 39, .12); }
.escala__cubos label:active { transform: scale(.94); }
.escala__cubos label .cubo {
    --cubo: 38px;
    --c1: transparent; --c2: transparent; --c3: transparent;
    --ct: var(--cubo-trazo-vacio); --cw: 1.4; --cd: 2.6 2.2;
    transition: transform .15s ease, filter .2s ease;
}
.escala input:focus-visible + label { outline: 2px solid var(--s-foco); outline-offset: 2px; }

/* Llenos hasta el marcado… */
.escala:has(input[value="1"]:checked) .escala__cubos label:nth-of-type(-n+1) .cubo,
.escala:has(input[value="2"]:checked) .escala__cubos label:nth-of-type(-n+2) .cubo,
.escala:has(input[value="3"]:checked) .escala__cubos label:nth-of-type(-n+3) .cubo,
.escala:has(input[value="4"]:checked) .escala__cubos label:nth-of-type(-n+4) .cubo,
.escala:has(input[value="5"]:checked) .escala__cubos label:nth-of-type(-n+5) .cubo {
    --c1: #A1887F; --c2: #795548; --c3: #5D4037; --ct: rgba(62, 39, 35, .35); --cw: .9; --cd: 0;
}
/* …y al pasar el ratón, hasta donde está el ratón. */
.escala__cubos:has(label:hover) label .cubo {
    --c1: transparent; --c2: transparent; --c3: transparent;
    --ct: var(--cubo-trazo-vacio); --cw: 1.4; --cd: 2.6 2.2;
}
.escala__cubos:has(label:nth-of-type(1):hover) label:nth-of-type(-n+1) .cubo,
.escala__cubos:has(label:nth-of-type(2):hover) label:nth-of-type(-n+2) .cubo,
.escala__cubos:has(label:nth-of-type(3):hover) label:nth-of-type(-n+3) .cubo,
.escala__cubos:has(label:nth-of-type(4):hover) label:nth-of-type(-n+4) .cubo,
.escala__cubos:has(label:nth-of-type(5):hover) label:nth-of-type(-n+5) .cubo {
    --c1: #E3C25A; --c2: #C9A227; --c3: #9A7B1B; --ct: rgba(90, 70, 10, .35); --cw: .9; --cd: 0;
    transform: translateY(-2px);
}
.escala:has(input[value="5"]:checked) .escala__cubos label:nth-of-type(5) .cubo { filter: drop-shadow(0 0 6px rgba(201, 162, 39, .45)); }

/* Cero: que si quiere bolsa. Vale lo mismo que cinco. */
.escala__cero {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 10px 12px;
    border: 1px dashed var(--s-linea-fuerte);
    border-radius: var(--radio-l);
    cursor: pointer;
    color: var(--s-tinta-2);
    font-size: .74rem;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    transition: border-color .15s ease, background .15s ease, color .15s ease;
}
.escala__cero .cubo { --cubo: 30px; }
.escala__cero:hover { border-color: var(--cacao); color: var(--cacao); }
.escala:has(input[value="0"]:checked) .escala__cero { border-style: solid; border-color: var(--cacao); color: var(--cacao); background: rgba(189, 110, 99, .08); }
.escala:has(input[value="0"]:checked) .escala__cero .cubo { --ct: var(--cacao); }

/* La lectura: número y nombre de lo que hay marcado. */
.escala__lectura {
    margin: var(--esp-3) 0 0;
    min-height: 1.6em;
    font-size: 1rem;
    color: var(--s-tinta);
}
.escala__lectura span { display: none; }
.escala__lectura b { font-family: var(--titulo); font-size: 1.35rem; letter-spacing: .04em; margin-right: .4em; color: var(--s-acento); font-weight: 400; }

.deposito:has(input[value="0"]:checked) .escala__lectura [data-n="0"],
.deposito:has(input[value="1"]:checked) .escala__lectura [data-n="1"],
.deposito:has(input[value="2"]:checked) .escala__lectura [data-n="2"],
.deposito:has(input[value="3"]:checked) .escala__lectura [data-n="3"],
.deposito:has(input[value="4"]:checked) .escala__lectura [data-n="4"],
.deposito:has(input[value="5"]:checked) .escala__lectura [data-n="5"] { display: inline; }

.deposito:has(.escala__cubos label:hover) .escala__lectura span,
.deposito:has(.escala__cero:hover) .escala__lectura span { display: none; }
.deposito:has(.escala__cero:hover) .escala__lectura [data-n="0"],
.deposito:has(.escala__cubos label:nth-of-type(1):hover) .escala__lectura [data-n="1"],
.deposito:has(.escala__cubos label:nth-of-type(2):hover) .escala__lectura [data-n="2"],
.deposito:has(.escala__cubos label:nth-of-type(3):hover) .escala__lectura [data-n="3"],
.deposito:has(.escala__cubos label:nth-of-type(4):hover) .escala__lectura [data-n="4"],
.deposito:has(.escala__cubos label:nth-of-type(5):hover) .escala__lectura [data-n="5"] { display: inline; }

.deposito__pie {
    display: flex;
    align-items: center;
    gap: var(--esp-4);
    flex-wrap: wrap;
    margin-top: var(--esp-4);
}
.deposito__hecho {
    display: flex;
    align-items: center;
    gap: var(--esp-4);
    padding: var(--esp-4);
    border: 1px solid var(--s-linea);
    border-radius: var(--radio-l);
    background: var(--s-hueco);
}
.deposito__agotado {
    padding: var(--esp-5);
    border: 1px dashed var(--s-linea-fuerte);
    border-radius: var(--radio-l);
    text-align: center;
}
.deposito__agotado strong {
    display: block;
    font-family: var(--titulo);
    font-weight: 400;
    font-size: 1.6rem;
    letter-spacing: .03em;
    line-height: 1.1;
    margin-bottom: var(--esp-4);
}

@media (max-width: 560px) {
    .escala { gap: var(--esp-3); }
    .escala__cubos { gap: 3px; padding: 8px; }
    .escala__cubos label { width: 40px; height: 40px; }
    .escala__cubos label .cubo { --cubo: 30px; }
    .escala__cero { padding: 8px 10px; }
    .escala__cero .cubo { --cubo: 26px; }
}

/* ------------------------------------------------------------------
   8. Expedientes
   ------------------------------------------------------------------ */

/* Tarjeta de expediente en listados. */
.exp {
    display: flex;
    flex-direction: column;
    gap: var(--esp-3);
    padding: clamp(18px, 2.6vw, 24px);
}
.exp__cabecera { display: flex; align-items: center; justify-content: space-between; gap: var(--esp-2); flex-wrap: wrap; }
.exp__codigo { font-family: var(--mono); font-size: .72rem; letter-spacing: .14em; color: var(--s-tinta-3); text-transform: uppercase; }
.exp__sellos { display: flex; gap: 6px; }
.exp__titulo { font-size: 1.65rem; margin: 0; }
.exp__entradilla { color: var(--s-tinta-2); font-size: .94rem; margin: 0; flex: 1 1 auto; text-wrap: pretty; }
.exp__medidas {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 6px var(--esp-3);
    align-items: center;
    padding-top: var(--esp-3);
    border-top: 1px solid var(--s-linea);
    font-size: .8rem;
    color: var(--s-tinta-2);
}
.exp__medidas .cubos { --cubo: 14px; }
.exp__medidas .num { font-weight: 600; color: var(--s-tinta); text-align: right; }
.exp__ambito { font-size: .74rem; letter-spacing: .1em; text-transform: uppercase; color: var(--s-tinta-3); font-weight: 600; }

/* Ficha. */
.expediente__cabecera { max-width: 72ch; }
.expediente__codigo { display: flex; align-items: center; gap: var(--esp-3); flex-wrap: wrap; margin-bottom: var(--esp-4); }
.expediente__entradilla {
    font-size: clamp(1.15rem, 1.8vw, 1.4rem);
    line-height: 1.45;
    color: var(--s-tinta-2);
    max-width: 58ch;
    text-wrap: pretty;
}
.volver { font-size: .88rem; color: var(--s-tinta-2); text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.volver:hover { color: var(--s-tinta); }

/* Los cuatro apartados del Principio del Un Momento. */
.apartados { max-width: 74ch; margin-top: var(--esp-6); }
.apartado {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr);
    gap: var(--esp-5);
    padding-block: var(--esp-6);
    border-top: 1px solid var(--s-linea-fuerte);
}
.apartado:last-child { border-bottom: 1px solid var(--s-linea-fuerte); }
.apartado__numero {
    font-family: var(--titulo);
    font-size: 2.6rem;
    color: var(--s-tinta-3);
    line-height: .9;
    margin: 0;
    position: sticky;
    top: 92px;
}
.apartado__rotulo { margin: 0 0 4px; font-size: 1.6rem; }
.apartado__papel {
    font-size: .72rem;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--s-tinta-3);
    font-weight: 600;
    margin: 0 0 var(--esp-3);
}
.apartado__texto { font-size: 1.05rem; line-height: 1.7; }
.apartado--veredicto { background: var(--s-hueco); margin-inline: calc(-1 * var(--esp-5)); padding-inline: var(--esp-5); border-radius: var(--radio-l); border-top-color: transparent; }
.apartado--veredicto .apartado__numero { color: var(--s-acento); }

@media (max-width: 560px) {
    .apartado { grid-template-columns: 1fr; gap: var(--esp-2); }
    .apartado__numero { position: static; font-size: 2rem; }
    .apartado--veredicto { margin-inline: 0; }
}

/* ------------------------------------------------------------------
   9. Barras
   ------------------------------------------------------------------ */

.hambre { display: grid; gap: var(--esp-3); }
.hambre__cabecera { display: flex; justify-content: space-between; align-items: baseline; gap: var(--esp-3); }
.hambre__pct { font-family: var(--titulo); font-size: 1.9rem; line-height: 1; color: var(--s-cifra); font-variant-numeric: tabular-nums; white-space: nowrap; flex: none; }

.barra {
    position: relative;
    height: 16px;
    background: var(--s-hueco);
    border: 1px solid var(--s-linea-fuerte);
    border-radius: 999px;
    overflow: hidden;
}
.barra__relleno {
    height: 100%;
    background: linear-gradient(90deg, var(--tierra), var(--oro));
    border-radius: inherit;
    transition: width .9s cubic-bezier(.2, .8, .2, 1);
    position: relative;
}
.barra__relleno::after {
    content: '';
    position: absolute; inset: 0;
    background: repeating-linear-gradient(-55deg, transparent 0 8px, rgba(255, 255, 255, .12) 8px 12px);
}
.barra--fina { height: 10px; }

/* Barras horizontales de reparto. */
.reparto {
    display: grid;
    grid-template-columns: 108px minmax(0, 1fr) 72px;
    gap: var(--esp-3);
    align-items: center;
    padding-block: 7px;
}
.reparto + .reparto { border-top: 1px solid var(--s-linea); }
.reparto__clave { font-size: .84rem; color: var(--s-tinta-2); white-space: nowrap; display: flex; align-items: center; gap: 8px; }
.reparto__clave .cubos { --cubo: 11px; }
.reparto__barra { display: block; height: 12px; background: var(--s-hueco); border-radius: 999px; overflow: hidden; }
.reparto__barra > span { display: block; height: 100%; background: linear-gradient(90deg, var(--tierra), var(--oro)); border-radius: inherit; transition: width .9s cubic-bezier(.2, .8, .2, 1); }
.reparto__cifra { text-align: right; font-variant-numeric: tabular-nums; font-size: .9rem; font-weight: 600; }
.reparto__cifra small { font-weight: 400; color: var(--s-tinta-3); }

@media (max-width: 480px) {
    .reparto { grid-template-columns: 84px minmax(0, 1fr) 56px; gap: 8px; }
}

/* ------------------------------------------------------------------
   10. Tablas
   ------------------------------------------------------------------ */

.tabla-envoltura { overflow-x: auto; margin-inline: calc(-1 * var(--esp-2)); padding-inline: var(--esp-2); }

table.tabla { width: 100%; border-collapse: collapse; font-size: .93rem; }
table.tabla th, table.tabla td {
    padding: 12px 12px;
    text-align: left;
    border-bottom: 1px solid var(--s-linea);
    vertical-align: middle;
}
table.tabla th {
    font-family: var(--mono);
    font-size: .68rem;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--s-tinta-3);
    font-weight: 700;
    white-space: nowrap;
    border-bottom-color: var(--s-linea-fuerte);
}
table.tabla tbody tr { transition: background .12s ease; }
table.tabla tbody tr:hover { background: var(--s-hueco); }
table.tabla tbody tr:last-child td { border-bottom: 0; }
table.tabla td.num, table.tabla th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.tabla td .apunte { display: block; margin-top: 2px; }
table.tabla a { text-decoration: none; font-weight: 600; color: var(--s-tinta); }
table.tabla a:hover { color: var(--s-enlace); text-decoration: underline; }

.tabla--ranking td { padding-block: 14px; }
.pos {
    font-family: var(--titulo);
    font-size: 1.7rem;
    line-height: 1;
    color: var(--s-tinta-3);
    width: 2.2em;
}
tr:nth-child(1) .pos { color: var(--s-acento); }
.tabla--ranking .cubos { --cubo: 15px; }
.tabla--ranking .medida { display: flex; align-items: center; gap: 8px; white-space: nowrap; justify-content: flex-end; }
.tabla--ranking .medida b { font-variant-numeric: tabular-nums; min-width: 2.4em; text-align: right; }

/* ------------------------------------------------------------------
   11. Precios
   ------------------------------------------------------------------ */

.precios {
    display: grid;
    gap: var(--esp-4);
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
    align-items: stretch;
}
.precio {
    display: flex;
    flex-direction: column;
    background: var(--s-tarjeta);
    border: 1px solid var(--s-linea);
    border-radius: var(--radio-l);
    padding: var(--esp-5);
    position: relative;
    box-shadow: var(--s-sombra);
    transition: transform .2s ease, box-shadow .2s ease;
}
.precio:hover { transform: translateY(-2px); box-shadow: var(--s-sombra-alta); }
.precio--destacado { border-color: var(--oro); box-shadow: var(--s-sombra), 0 0 0 3px color-mix(in srgb, var(--oro) 22%, transparent); }

.precio__marca {
    position: absolute; top: -12px; left: 18px;
    background: var(--oro); color: var(--wombat);
    font-family: var(--mono); font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
    font-size: .64rem; padding: 4px 10px; border-radius: 3px;
    transform: rotate(-2deg);
    box-shadow: 0 2px 6px rgba(0, 0, 0, .18);
}
.precio__cubo { --cubo: 34px; margin-bottom: var(--esp-3); }
.precio__nombre { font-size: 1.55rem; margin: 0 0 var(--esp-2); }
.precio__cifra  { font-family: var(--titulo); font-size: 2.9rem; color: var(--s-cifra); line-height: 1; letter-spacing: .01em; margin: 0; }
.precio__periodo { color: var(--s-tinta-2); font-size: .84rem; margin: 4px 0 0; }
.precio__resumen { color: var(--s-tinta-2); font-size: .92rem; margin: var(--esp-3) 0; }

.precio__lista { list-style: none; margin: 0 0 var(--esp-4); padding: 0; font-size: .9rem; }
.precio__lista li { padding-left: 24px; position: relative; margin-bottom: 7px; color: var(--s-tinta); }
.precio__lista li::before {
    content: ''; position: absolute; left: 2px; top: .5em;
    width: 9px; height: 9px;
    background: var(--tierra); transform: rotate(45deg); border-radius: 1px;
}

.precio__pie { margin-top: auto; }

/* El nombre del wombat, antes de elegir plan. */
.adopcion__nombre { margin-bottom: var(--esp-6); }
.adopcion__nombre .campo { margin: 0; max-width: 440px; }
.precio__conservacion {
    display: block;
    margin-top: var(--esp-3);
    font-size: .78rem;
    color: var(--s-tinta-2);
    text-align: center;
    line-height: 1.45;
}
.precio__conservacion strong { color: var(--s-acento); }

/* ------------------------------------------------------------------
   12. Fichas y estadísticas
   ------------------------------------------------------------------ */

.ficha__cabecera {
    display: flex; flex-wrap: wrap; gap: var(--esp-5);
    align-items: center;
}
.ficha__numero {
    font-family: var(--mono);
    letter-spacing: .16em;
    color: var(--s-tinta-3);
    font-size: .78rem;
    text-transform: uppercase;
    margin-bottom: var(--esp-2);
}
.ficha__apodo { font-size: 1.1rem; color: var(--s-tinta-2); font-style: italic; }

/* El retrato: no hay foto, hay un cubo con su número. */
.retrato {
    width: 112px; height: 112px;
    display: grid; place-items: center;
    background: var(--s-hueco);
    border: 1px solid var(--s-linea);
    border-radius: 50%;
    position: relative;
    flex: none;
}
.retrato .cubo { --cubo: 60px; }
.retrato--oro .cubo { --c1: #E3C25A; --c2: #C9A227; --c3: #9A7B1B; }

.estadisticas { list-style: none; margin: 0; padding: 0; }
.estadisticas li {
    display: flex; justify-content: space-between; gap: var(--esp-4);
    padding: 11px 0;
    border-bottom: 1px dashed var(--s-linea-fuerte);
    align-items: baseline;
}
.estadisticas li:last-child { border-bottom: 0; }
.estadisticas .clave { color: var(--s-tinta-2); font-size: .9rem; }
.estadisticas .valor { font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.estadisticas--suelta li { align-items: flex-start; }
.estadisticas--suelta .clave { min-width: 170px; }
.estadisticas--suelta .clave strong { color: var(--s-tinta); }
.estadisticas--suelta .valor { text-align: left; font-weight: 400; }

/* ------------------------------------------------------------------
   13. Formularios
   ------------------------------------------------------------------ */

label.campo { display: block; margin-bottom: var(--esp-4); }
label.campo > span { display: block; font-size: .82rem; font-weight: 600; color: var(--s-tinta-2); margin-bottom: 6px; letter-spacing: .01em; }
label.campo small { display: block; font-weight: 400; color: var(--s-tinta-3); margin-top: 2px; }

input[type="text"], input[type="email"], input[type="password"], textarea, select {
    width: 100%;
    font: inherit;
    font-size: .98rem;
    padding: 11px 13px;
    color: var(--s-tinta);
    background: var(--s-tarjeta);
    border: 1.5px solid var(--s-linea-fuerte);
    border-radius: var(--radio);
    transition: border-color .15s ease, box-shadow .15s ease;
}
.oscuro input[type="text"], .oscuro input[type="email"], .oscuro input[type="password"], .oscuro textarea, .oscuro select { background: rgba(0, 0, 0, .25); }
input::placeholder, textarea::placeholder { color: var(--s-tinta-3); opacity: .8; }
input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--s-acento);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--oro) 28%, transparent);
}
textarea { min-height: 96px; resize: vertical; }
select { appearance: none; -webkit-appearance: none; padding-right: 36px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%238D6E63' stroke-width='1.8'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; }

.campo--codigo input { font-family: var(--titulo); font-size: 1.6rem; letter-spacing: .16em; text-align: center; text-transform: uppercase; }

.codigo-regalo {
    font-family: var(--titulo);
    font-size: clamp(1.8rem, 5vw, 2.6rem);
    letter-spacing: .22em;
    color: var(--wombat);
    background: var(--nata);
    border: 2px dashed var(--oro);
    border-radius: var(--radio-l);
    padding: 18px 20px;
    text-align: center;
    word-break: break-all;
    margin-block: var(--esp-5);
    box-shadow: var(--s-sombra);
}

fieldset.opciones { border: 0; padding: 0; margin: 0 0 var(--esp-4); }
fieldset.opciones legend { font-size: .82rem; font-weight: 600; color: var(--s-tinta-2); margin-bottom: 8px; padding: 0; }
.opcion {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 14px;
    border: 1.5px solid var(--s-linea-fuerte);
    border-radius: var(--radio);
    cursor: pointer;
    font-size: .94rem;
    transition: border-color .15s ease, background .15s ease;
}
.opcion:hover { border-color: var(--s-tinta-3); }
.opcion:has(input:checked) { border-color: var(--s-tinta); background: var(--s-hueco); }
.opcion input { accent-color: var(--fresca); margin: 0; }
.opciones__fila { display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 140px), 1fr)); }

/* ------------------------------------------------------------------
   14. Manifiesto
   ------------------------------------------------------------------ */

.manifiesto__apertura { max-width: 60ch; font-size: 1.15rem; line-height: 1.65; }
.manifiesto__grito {
    font-family: var(--titulo);
    font-size: clamp(1.8rem, 4.5vw, 3rem);
    letter-spacing: .04em;
    line-height: 1;
    color: var(--s-acento);
    margin-block: .5em;
}
.manifiesto__capitulo {
    display: grid;
    grid-template-columns: 88px minmax(0, 1fr);
    gap: var(--esp-5);
    padding-block: var(--esp-6);
    border-top: 1px solid var(--s-linea-fuerte);
    max-width: 78ch;
}
.manifiesto__capitulo h2 { font-size: 1.9rem; }
.manifiesto__capitulo p { font-size: 1.05rem; line-height: 1.7; }
.manifiesto__capitulo .manifiesto__grito { font-size: clamp(1.8rem, 4.5vw, 3rem); line-height: 1; }
.manifiesto__capitulo .manifiesto__num,
.manifiesto__num {
    font-family: var(--titulo);
    font-size: 2.8rem;
    color: var(--s-tinta-3);
    line-height: .9;
    margin: 0;
    position: sticky;
    top: 92px;
}
.declaraciones { margin: 0; padding: 0; list-style: none; counter-reset: dec; }
.declaraciones li {
    position: relative;
    padding: 10px 0 10px 40px;
    border-bottom: 1px dashed var(--s-linea-fuerte);
    counter-increment: dec;
}
.declaraciones li:last-child { border-bottom: 0; }
.declaraciones li::before {
    content: counter(dec, upper-roman);
    position: absolute; left: 0; top: 10px;
    font-family: var(--titulo);
    color: var(--s-tinta-3);
    font-size: 1.1rem;
    letter-spacing: .04em;
}

/* La escala oficial, como una regla. */
.regla { list-style: none; margin: var(--esp-5) 0 0; padding: 0; }
.regla li {
    display: grid;
    grid-template-columns: 150px minmax(0, 1fr);
    gap: var(--esp-4);
    padding: 14px 0;
    border-top: 1px solid var(--s-linea-fuerte);
    align-items: start;
}
.regla li:first-child { border-top: 0; }
.regla__cubos { display: grid; gap: 6px; }
.regla__cubos .cubos { --cubo: 15px; }
.regla__n { font-family: var(--titulo); font-size: 1.25rem; letter-spacing: .04em; color: var(--s-tinta); }
.regla p { margin: 0; }
.regla strong { display: block; font-family: var(--titulo); font-weight: 400; font-size: 1.3rem; letter-spacing: .02em; margin-bottom: 2px; }

@media (max-width: 560px) {
    .manifiesto__capitulo { grid-template-columns: 1fr; gap: var(--esp-2); }
    .manifiesto__num { position: static; font-size: 2rem; }
    .regla li { grid-template-columns: 1fr; gap: 6px; }
}

/* ------------------------------------------------------------------
   15. Pie
   ------------------------------------------------------------------ */

.pie {
    margin-top: var(--esp-9);
    padding-block: var(--esp-8) var(--esp-6);
    background: var(--wombat);
    color: var(--papel);
    border-top: 1px solid rgba(255, 255, 255, .05);
    font-size: .9rem;
    position: relative;
    z-index: 1;
}
.pie__rejilla {
    display: grid;
    grid-template-columns: 1.6fr 1fr 1fr 1fr;
    gap: var(--esp-6);
}
.pie__lema {
    font-family: var(--titulo);
    font-size: 1.6rem;
    letter-spacing: .04em;
    line-height: 1.05;
    color: var(--hueso);
    max-width: 18ch;
    margin: var(--esp-4) 0 var(--esp-3);
}
.pie__marca { --cubo: 28px; }
.pie__col h4 { color: var(--arcilla); font-family: var(--mono); font-size: .68rem; letter-spacing: .16em; text-transform: uppercase; margin-bottom: var(--esp-3); }
.pie__col a { display: block; color: var(--papel); text-decoration: none; padding: 4px 0; }
.pie__col a:hover { color: var(--oro); }
.pie__legal { color: var(--arcilla); max-width: 60ch; font-size: .86rem; }
.pie__legal--fino { font-size: .8rem; font-style: italic; }
.pie__firma {
    margin-top: var(--esp-6);
    padding-top: var(--esp-4);
    border-top: 1px solid rgba(161, 136, 127, .2);
    color: var(--tierra);
    font-family: var(--mono);
    letter-spacing: .14em;
    font-size: .7rem;
    text-transform: uppercase;
    display: flex; justify-content: space-between; gap: var(--esp-4); flex-wrap: wrap;
}

@media (max-width: 860px) {
    .pie__rejilla { grid-template-columns: 1fr 1fr; }
    .pie__rejilla > :first-child { grid-column: 1 / -1; }
}
@media (max-width: 480px) {
    .pie__rejilla { grid-template-columns: 1fr; }
}

/* ------------------------------------------------------------------
   16. Easter KK: cubos escondidos.

   Casi invisibles, no invisibles del todo. Tienen que poder encontrarse
   mirando con atención, pasando el ratón o tabulando con el teclado —
   las tres son formas legítimas de hurgar.
   ------------------------------------------------------------------ */

.kk { display: block; margin: 0; line-height: 0; }
.kk__cubo {
    width: 18px; height: 18px;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: help;
    opacity: .28;
    transition: opacity .25s ease, transform .3s cubic-bezier(.2, .8, .2, 1);
}
.kk__cubo .cubo { --cubo: 18px; --c1: #B9A59C; --c2: #A1887F; --c3: #8D6E63; --ct: transparent; }
.kk__cubo:hover, .kk__cubo:focus-visible { opacity: 1; transform: rotate(-10deg) scale(1.35); }
.kk__cubo:focus-visible { outline: 2px solid var(--s-foco); outline-offset: 3px; }

.kk-hallada { --cubo: 16px; vertical-align: -3px; margin-right: 6px; }

/* ------------------------------------------------------------------
   17. Movimiento
   ------------------------------------------------------------------ */

@keyframes flotar {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-7px); }
}
@keyframes caer {
    from { transform: translateY(-14px); opacity: 0; }
    to   { transform: translateY(0); opacity: 1; }
}
@keyframes aparecer {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: none; }
}

.aviso .cubo { animation: caer .5s cubic-bezier(.2, .8, .2, 1) both; }
.entra { animation: aparecer .5s ease both; }
.entra--2 { animation-delay: .08s; }
.entra--3 { animation-delay: .16s; }

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

@media print {
    .cabecera, .pie, .kk, .deposito, .acciones, .saltar { display: none !important; }
    body { background: #fff; color: #000; }
    body::before { display: none; }
    .tarjeta, .precio { box-shadow: none; }
}
