/* ==========================================================================
   Aplicaciones temáticas — Temática 2027: Motor
   Página pública (`.esc-esc__`) y panel (`.esc-apps__`, `.esc-admin__`).
   Todo el movimiento está apagado con prefers-reduced-motion.
   ========================================================================== */

.esc-esc {
    --esc-ink: #17120e;
    --esc-ink-soft: #241a12;
    --esc-line: #efe7dd;
    --esc-orange-glow: rgba(251, 105, 0, .32);
    position: relative;
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 0 48px;
    color: #222;
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

/* Franja de damero en el borde inferior. */
.esc-esc__login-flags,
.esc-admin__hero-flags {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 10px;
    background-image:
        linear-gradient(45deg, rgba(255, 255, 255, .85) 25%, transparent 25%, transparent 75%, rgba(255, 255, 255, .85) 75%),
        linear-gradient(45deg, rgba(255, 255, 255, .85) 25%, transparent 25%, transparent 75%, rgba(255, 255, 255, .85) 75%);
    background-size: 20px 20px;
    background-position: 0 0, 10px 10px;
    opacity: .16;
    animation: escFlags 1.6s linear infinite;
    pointer-events: none;
}

/* ==========================================================================
   Avisos
   ========================================================================== */

.esc-esc__msg {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 18px;
    padding: 14px 18px;
    border-radius: 14px;
    font-size: 14px;
    line-height: 1.5;
    animation: escPop .45s cubic-bezier(.2, .9, .25, 1.2) both;
}

.esc-esc__msg[hidden] {
    display: none;
}

.esc-esc__msg-ico {
    flex: 0 0 auto;
    width: 22px;
    height: 22px;
    font-size: 22px;
}

.esc-esc__msg--ok {
    border: 1px solid rgba(26, 127, 55, .22);
    background: linear-gradient(120deg, #eefaf1, #f7fdf9);
    color: #145c28;
}

.esc-esc__msg--error {
    border: 1px solid rgba(211, 47, 47, .28);
    background: linear-gradient(120deg, #fdeeee, #fff8f8);
    color: #8d1c1c;
}

.esc-esc__msg--cerrada {
    border: 1px solid #f0d9c4;
    background: linear-gradient(120deg, #fff6ed, #fffdfb);
    color: #7a4a15;
}

.esc-esc__msg--cerrada a {
    color: #a33e00;
    font-weight: 800;
}

/* La tarjeta de app cerrada reutiliza .esc-esc__login; solo va sin botón. */
.esc-esc__login.esc-esc__cerrada p {
    margin-bottom: 0;
}

/* ==========================================================================
   Rejilla: taller + monitor
   ========================================================================== */

.esc-esc__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 350px), 1fr));
    gap: 22px;
    align-items: start;
}

.esc-esc__panel {
    --pad: 26px;
    padding: var(--pad);
    border: 1px solid var(--esc-line);
    border-radius: 22px;
    background:
        radial-gradient(120% 90% at 0% 0%, #fff8f1, transparent 46%),
        #fff;
    box-shadow: 0 14px 34px rgba(23, 18, 14, .07);
}

.esc-esc__panel-head {
    display: flex;
    align-items: center;
    gap: 14px;
    padding-bottom: 18px;
    margin-bottom: 20px;
    border-bottom: 1px dashed #ece3d8;
}

.esc-esc__panel-badge {
    padding: 7px 11px;
    border-radius: 10px;
    background: var(--esc-ink);
    color: #ffb37a;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .14em;
    text-transform: uppercase;
    white-space: nowrap;
}

.esc-esc__panel-head h3 {
    margin: 0 0 2px;
    font-size: 19px;
    line-height: 1.15;
    letter-spacing: -.015em;
}

.esc-esc__panel-head p {
    margin: 0;
    color: #6b625a;
    font-size: 12.5px;
}

/* Bloques numerados ---------------------------------------------------- */

.esc-esc__group {
    padding: 16px 0;
    border-bottom: 1px dashed #f1eae1;
    animation: escUp .5s cubic-bezier(.2, .7, .2, 1) both;
    animation-delay: calc(var(--i, 1) * 60ms);
}

.esc-esc__group:last-of-type {
    border-bottom: 0;
}

.esc-esc__group-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.esc-esc__group-num {
    display: inline-grid;
    place-items: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 1px solid #f0d9c4;
    background: #fff6ed;
    color: #c54b00;
    font-size: 10.5px;
    font-weight: 900;
    transition: background-color .2s linear, color .2s linear, transform .2s ease-out;
}

.esc-esc__group:focus-within .esc-esc__group-num {
    background: #fb6900;
    color: #fff;
    transform: scale(1.06);
}

.esc-esc__group-head h4 {
    margin: 0;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: .01em;
    text-transform: none;
}

.esc-esc__field {
    margin-bottom: 4px;
}

.esc-esc__field label,
.esc-esc__label {
    display: block;
    margin-bottom: 7px;
    color: #33291f;
    font-size: 12.5px;
    font-weight: 700;
}

.esc-esc__field input[type="text"] {
    width: 100%;
    padding: 13px 15px;
    border: 1.5px solid #eadfd3;
    border-radius: 12px;
    background: #fffdfb;
    color: var(--esc-ink);
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -.01em;
    transition: border-color .18s linear, box-shadow .18s linear, background-color .18s linear;
}

.esc-esc__field input[type="text"]::placeholder {
    color: #b3a79a;
    font-weight: 500;
}

.esc-esc__field input[type="text"]:focus {
    outline: none;
    border-color: #fb6900;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(251, 105, 0, .14);
}

.esc-esc__hint {
    margin: 7px 0 0;
    color: #7a7168;
    font-size: 11.5px;
    line-height: 1.5;
}

.esc-esc__hint--center {
    text-align: center;
}

.esc-esc__js-warn {
    color: #8d1c1c;
    font-weight: 600;
}

/* Opciones: formas y patrones ------------------------------------------ */

.esc-esc__opts {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.esc-esc__opt {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 12px 8px;
    border: 1.5px solid #ece2d7;
    border-radius: 13px;
    background: #fff;
    color: #4a3f35;
    font-size: 11.5px;
    font-weight: 700;
    line-height: 1.15;
    text-align: center;
    cursor: pointer;
    overflow: hidden;
    transition: transform .16s cubic-bezier(.2, .8, .2, 1.3), border-color .16s linear,
                background-color .16s linear, box-shadow .16s linear;
}

.esc-esc__opt::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, rgba(251, 105, 0, .10), transparent 60%);
    opacity: 0;
    transition: opacity .18s linear;
}

.esc-esc__opt:hover {
    transform: translateY(-2px);
    border-color: #f4c9a2;
    box-shadow: 0 8px 18px rgba(251, 105, 0, .12);
}

.esc-esc__opt:hover::before {
    opacity: 1;
}

.esc-esc__opt input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.esc-esc__opt:has(input:focus-visible) {
    outline: 2px solid #fb6900;
    outline-offset: 2px;
}

.esc-esc__opt:has(input:checked) {
    border-color: #fb6900;
    background: #fff7f0;
    color: #a33e00;
    box-shadow: 0 0 0 1px #fb6900, 0 10px 22px rgba(251, 105, 0, .16);
}

/* Palomita que aparece al elegir. */
.esc-esc__opt::after {
    content: "";
    position: absolute;
    top: 6px;
    right: 6px;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: #fb6900 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center/10px no-repeat;
    transform: scale(0);
    transition: transform .22s cubic-bezier(.2, .9, .3, 1.5);
}

.esc-esc__opt:has(input:checked)::after {
    transform: scale(1);
}

.esc-esc__opt-shape {
    width: 30px;
    height: 36px;
    background: linear-gradient(155deg, #fb6900, #17120e);
    clip-path: polygon(0 0, 100% 0, 100% 62%, 50% 100%, 0 62%);
    transition: transform .25s cubic-bezier(.2, .9, .3, 1.4);
}

.esc-esc__opt:hover .esc-esc__opt-shape,
.esc-esc__opt:has(input:checked) .esc-esc__opt-shape {
    transform: rotate(-6deg) scale(1.08);
}

.esc-esc__opt-shape--redondo {
    clip-path: circle(48% at 50% 50%);
    height: 34px;
}

.esc-esc__opt-shape--rombo {
    clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
}

.esc-esc__opt-shape--hexagono {
    clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
}

.esc-esc__opt-shape--gotico {
    clip-path: polygon(0 0, 100% 0, 100% 68%, 78% 86%, 50% 100%, 22% 86%, 0 68%);
}

.esc-esc__opt-shape--moderno {
    clip-path: polygon(0 0, 78% 0, 100% 18%, 100% 100%, 0 100%);
}

.esc-esc__opt-shape--triangular {
    clip-path: polygon(50% 0, 100% 34%, 50% 100%, 0 34%);
}

.esc-esc__opt-shape--suizo {
    clip-path: polygon(18% 0, 100% 0, 100% 100%, 0 100%, 0 18%);
}

.esc-esc__opt-shape--medieval {
    clip-path: polygon(0 22%, 18% 2%, 82% 2%, 100% 22%, 100% 62%, 50% 100%, 0 62%);
}

.esc-esc__opt-shape--lanceta {
    clip-path: polygon(18% 0, 82% 0, 100% 10%, 100% 60%, 50% 100%, 0 60%, 0 10%);
}

.esc-esc__opt-shape--cuadrado {
    clip-path: inset(4% 4% round 12%);
    height: 34px;
}

.esc-esc__opt-shape--estrella {
    clip-path: polygon(50% 0, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
}

.esc-esc__opt-shape--banda {
    clip-path: polygon(18% 0, 82% 0, 82% 88%, 50% 100%, 18% 88%);
}

.esc-esc__opt-shape--escoces {
    clip-path: polygon(0 0, 100% 0, 100% 72%, 86% 88%, 50% 100%, 14% 88%, 0 72%);
}

.esc-esc__opt-shape--curvo {
    clip-path: polygon(0 24%, 12% 6%, 50% 0, 88% 6%, 100% 24%, 100% 62%, 50% 100%, 0 62%);
}

.esc-esc__opts--formas {
    grid-template-columns: repeat(auto-fill, minmax(82px, 1fr));
}

.esc-esc__field-label {
    display: block;
    margin-bottom: 4px;
    color: #6b625a;
    font-size: 11.5px;
    font-weight: 800;
    letter-spacing: .04em;
}

/* Colores -------------------------------------------------------------- */

.esc-esc__field--colors {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.esc-esc__color {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px 8px 8px;
    border: 1.5px solid #ece2d7;
    border-radius: 12px;
    background: #fff;
    transition: border-color .16s linear, box-shadow .16s linear;
}

.esc-esc__color:hover {
    border-color: #f4c9a2;
}

.esc-esc__color:focus-within {
    border-color: #fb6900;
    box-shadow: 0 0 0 4px rgba(251, 105, 0, .12);
}

.esc-esc__color input[type="color"] {
    width: 40px;
    height: 36px;
    padding: 0;
    border: 0;
    border-radius: 9px;
    background: transparent;
    cursor: pointer;
}

.esc-esc__color input[type="color"]::-webkit-color-swatch {
    border: 0;
    border-radius: 8px;
}

.esc-esc__color input[type="color"]::-moz-color-swatch {
    border: 0;
    border-radius: 8px;
}

.esc-esc__color code {
    color: #6b625a;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.esc-esc__paleta-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 14px;
}

.esc-esc__paleta-head .esc-esc__field-label {
    margin: 0;
}

.esc-esc__paleta {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 10px;
}

.esc-esc__swatch {
    width: 24px;
    height: 24px;
    padding: 0;
    border: 2px solid #fff;
    border-radius: 50%;
    background: var(--sw);
    box-shadow: 0 0 0 1px rgba(23, 18, 14, .16);
    cursor: pointer;
    animation: escPop .4s cubic-bezier(.2, .9, .3, 1.4) both;
    animation-delay: calc(var(--i, 0) * 35ms + 120ms);
    transition: transform .16s cubic-bezier(.2, .9, .3, 1.6), box-shadow .16s linear;
}

.esc-esc__swatch:hover,
.esc-esc__swatch:focus-visible {
    transform: scale(1.22) translateY(-1px);
    box-shadow: 0 0 0 2px rgba(251, 105, 0, .5), 0 6px 12px rgba(23, 18, 14, .18);
    outline: none;
}

/* Foto: zona de arrastre ---------------------------------------------- */

.esc-esc__drop {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 20px 16px;
    border: 2px dashed #e6d9ca;
    border-radius: 16px;
    background:
        repeating-linear-gradient(45deg, #fffdfb 0 10px, #fdf7f0 10px 20px);
    text-align: center;
    cursor: pointer;
    transition: border-color .18s linear, background-color .18s linear, transform .18s ease-out;
}

.esc-esc__drop:hover,
.esc-esc__drop.is-over {
    border-color: #fb6900;
    background: #fff5ec;
    transform: translateY(-1px);
}

.esc-esc__drop.has-file {
    border-style: solid;
    border-color: #cfe8d6;
    background: #f5fbf6;
}

.esc-esc__drop-ico {
    width: 30px;
    height: 30px;
    font-size: 30px;
    color: #c9b8a5;
    transition: transform .25s cubic-bezier(.2, .9, .3, 1.4), color .18s linear;
}

.esc-esc__drop:hover .esc-esc__drop-ico,
.esc-esc__drop.is-over .esc-esc__drop-ico {
    color: #fb6900;
    transform: translateY(-3px) scale(1.06);
}

.esc-esc__drop.has-file .esc-esc__drop-ico {
    color: #1a7f37;
}

.esc-esc__drop-txt {
    color: #6b625a;
    font-size: 12.5px;
}

.esc-esc__drop-txt strong {
    color: #33291f;
}

.esc-esc__foto-name {
    padding: 3px 10px;
    border-radius: 9999px;
    background: #f6efe7;
    color: #6b625a;
    font-size: 11px;
    font-weight: 700;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.esc-esc__drop.has-file .esc-esc__foto-name {
    background: #e6f5ea;
    color: #145c28;
}

.esc-esc__foto-prev {
    display: block;
    width: 100%;
    max-width: 230px;
    height: 120px;
    margin-bottom: 4px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #e6d9ca;
    background: #f6efe7;
}

.esc-esc__foto-prev[hidden] {
    display: none;
}

.esc-esc__foto-prev img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.esc-esc__check {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    margin-top: 12px;
    padding: 11px 13px;
    border: 1px solid #efe4d7;
    border-radius: 12px;
    background: #fffdfb;
    color: #4a4239;
    font-size: 12.5px;
    line-height: 1.45;
    cursor: pointer;
}

.esc-esc__check input {
    flex: none;
    margin: 2px 0 0;
    accent-color: #fb6900;
}

.esc-esc__file {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

.esc-esc__foto {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.esc-esc__link {
    padding: 0;
    border: 0;
    background: none;
    color: #c54b00;
    font-size: 11.5px;
    font-weight: 800;
    text-decoration: underline;
    cursor: pointer;
}

.esc-esc__link[hidden] {
    display: none;
}

/* Acciones ------------------------------------------------------------- */

.esc-esc__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    padding-top: 18px;
}

.esc-esc__btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 13px 22px;
    border: 1.5px solid transparent;
    border-radius: 9999px;
    font-size: 13.5px;
    font-weight: 800;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
    overflow: hidden;
    isolation: isolate;
    transition: transform .16s cubic-bezier(.2, .8, .2, 1.3), background-color .18s linear,
                box-shadow .18s linear, border-color .18s linear, color .18s linear;
}

.esc-esc__btn .dashicons {
    width: 18px;
    height: 18px;
    font-size: 18px;
}

/* Destello que cruza el botón al pasar por encima. */
.esc-esc__btn::after {
    content: "";
    position: absolute;
    top: -60%;
    left: -80%;
    width: 45%;
    height: 220%;
    background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .55), transparent);
    transform: rotate(16deg);
    opacity: 0;
    pointer-events: none;
    z-index: -1;
}

.esc-esc__btn:hover::after {
    opacity: 1;
    animation: escShine .8s ease-out;
}

.esc-esc__btn--primary {
    background: linear-gradient(135deg, #fb6900, #e35700);
    /* «Entrar en mi cuenta» es un enlace: el color de enlace del tema le gana a
       la clase si no se fuerza. El blanco es el mismo de «Reservar mi plaza». */
    color: #fff !important;
    box-shadow: 0 10px 24px rgba(251, 105, 0, .32);
}

.esc-esc__btn--primary:hover {
    color: #fff !important;
    transform: translateY(-2px);
    box-shadow: 0 16px 30px rgba(251, 105, 0, .38);
}

.esc-esc__btn--primary:disabled,
.esc-esc__btn--primary.is-loading {
    opacity: .8;
    cursor: progress;
    transform: none;
}

.esc-esc__btn--primary.is-loading .dashicons {
    animation: escSpin .8s linear infinite;
}

.esc-esc__btn--ghost {
    border-color: #e7ddd2;
    background: #fff;
    color: #33291f;
}

.esc-esc__btn--ghost:hover {
    border-color: #fb6900;
    color: #c54b00;
    transform: translateY(-2px);
}

.esc-esc__btn[hidden] {
    display: none;
}

.esc-esc__dirty {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 9999px;
    background: #fff4e8;
    color: #a33e00;
    font-size: 11px;
    font-weight: 800;
    animation: escPop .3s ease-out both;
}

.esc-esc__dirty::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #fb6900;
    animation: escBreathe 1.6s ease-in-out infinite;
}

.esc-esc__dirty[hidden] {
    display: none;
}

/* ==========================================================================
   Monitor: vista previa
   ========================================================================== */

.esc-esc__preview {
    position: sticky;
    top: 24px;
    padding: 16px;
    border-radius: 22px;
    background:
        radial-gradient(120% 90% at 100% 0%, rgba(251, 105, 0, .22), transparent 55%),
        linear-gradient(160deg, #1d1712, #120e0b);
    box-shadow: 0 20px 44px rgba(23, 18, 14, .26);
    animation: escRise .6s .12s cubic-bezier(.2, .7, .2, 1) both;
}

.esc-esc__hud {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 0 6px 12px;
    color: rgba(255, 255, 255, .52);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .16em;
    text-transform: uppercase;
}

.esc-esc__hud-live {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: #fff;
}

.esc-esc__hud-led {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #ff4d4d;
    box-shadow: 0 0 0 0 rgba(255, 77, 77, .6);
    animation: escLed 2s ease-out infinite;
}

.esc-esc__canvas-wrap {
    position: relative;
    padding: 10px;
    border-radius: 16px;
    background:
        linear-gradient(45deg, #efeae3 25%, transparent 25%) -10px 0/20px 20px,
        linear-gradient(-45deg, #efeae3 25%, transparent 25%) -10px 0/20px 20px,
        linear-gradient(45deg, transparent 75%, #efeae3 75%) -10px 0/20px 20px,
        linear-gradient(-45deg, transparent 75%, #efeae3 75%) -10px 0/20px 20px,
        #fbf8f4;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .06);
    transform: perspective(1000px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
    transition: transform .3s ease-out;
    will-change: transform;
}

#esc-canvas {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 10px;
    filter: drop-shadow(0 8px 18px rgba(23, 18, 14, .18));
}

/* Esquinas tipo visor. */
.esc-esc__corner {
    position: absolute;
    width: 16px;
    height: 16px;
    border: 2px solid #fb6900;
    opacity: .85;
    pointer-events: none;
}

.esc-esc__corner--tl { top: 4px; left: 4px; border-right: 0; border-bottom: 0; border-radius: 4px 0 0 0; }
.esc-esc__corner--tr { top: 4px; right: 4px; border-left: 0; border-bottom: 0; border-radius: 0 4px 0 0; }
.esc-esc__corner--bl { bottom: 4px; left: 4px; border-right: 0; border-top: 0; border-radius: 0 0 0 4px; }
.esc-esc__corner--br { bottom: 4px; right: 4px; border-left: 0; border-top: 0; border-radius: 0 0 4px 0; }

/* Barrido de escáner: una línea fina que recorre el lienzo. */
.esc-esc__scan {
    position: absolute;
    inset: 10px;
    background: none;
    border-bottom: 2px solid rgba(251, 105, 0, .55);
    box-shadow: 0 10px 24px rgba(251, 105, 0, .22);
    border-radius: 10px;
    pointer-events: none;
    opacity: 0;
}

/* El barrido solo aparece al repintar el escudo, no en bucle. */
.esc-esc__canvas-wrap.is-refresh .esc-esc__scan {
    animation: escScan .9s cubic-bezier(.4, 0, .6, 1);
}

.esc-esc__preview-foot {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 14px 6px 2px;
}

.esc-esc__preview-foot .esc-esc__hint {
    margin: 0;
    color: rgba(255, 255, 255, .58);
    text-align: center;
}

.esc-esc__preview-foot .esc-esc__btn--ghost {
    justify-content: center;
    border-color: rgba(255, 255, 255, .22);
    background: rgba(255, 255, 255, .08);
    color: #fff;
}

.esc-esc__preview-foot .esc-esc__btn--ghost:hover {
    border-color: #fb6900;
    background: rgba(251, 105, 0, .18);
    color: #fff;
}

/* ==========================================================================
   Sin sesión
   ========================================================================== */

.esc-esc__login {
    position: relative;
    display: flex;
    align-items: center;
    gap: 22px;
    max-width: 760px;
    padding: 30px 32px 36px;
    border-radius: 22px;
    background:
        radial-gradient(120% 120% at 0% 0%, rgba(251, 105, 0, .10), transparent 55%),
        #fff;
    border: 1px solid var(--esc-line);
    box-shadow: 0 16px 38px rgba(23, 18, 14, .08);
    overflow: hidden;
    animation: escRise .5s cubic-bezier(.2, .7, .2, 1) both;
}

.esc-esc__login-glow {
    position: absolute;
    right: -80px;
    bottom: -100px;
    width: 260px;
    height: 260px;
    border-radius: 50%;
    background: #fb6900;
    filter: blur(80px);
    opacity: .12;
    animation: escBreathe 6s ease-in-out infinite;
    pointer-events: none;
}

.esc-esc__login-ico {
    position: relative;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    width: 64px;
    height: 64px;
    border-radius: 20px;
    background: linear-gradient(150deg, #fff6ed, #ffe6cf);
    color: #c54b00;
    font-size: 30px;
    animation: escFloat 4.5s ease-in-out infinite;
}

.esc-esc__login-ico::before {
    width: 30px;
    height: 30px;
    font-size: 30px;
}

.esc-esc__login-body {
    position: relative;
}

.esc-esc__login-kicker {
    margin: 0 0 4px;
    color: #c54b00;
    font-size: 10.5px;
    font-weight: 900;
    letter-spacing: .16em;
    text-transform: uppercase;
}

.esc-esc__login h3 {
    margin: 0 0 8px;
    font-size: 22px;
    line-height: 1.15;
    letter-spacing: -.02em;
}

.esc-esc__login p {
    margin: 0 0 16px;
    max-width: 52ch;
    color: #6b625a;
    font-size: 13.5px;
    line-height: 1.6;
}

.esc-esc__login .esc-esc__btn {
    margin-top: 2px;
}

/* ==========================================================================
   Panel: menú de aplicaciones
   ========================================================================== */

.esc-apps {
    margin-top: 8px;
}

.esc-apps__head {
    padding: 24px;
    margin-bottom: 24px;
    border-radius: 18px;
    background:
        radial-gradient(120% 140% at 12% 0%, rgba(251, 105, 0, .28), transparent 55%),
        radial-gradient(90% 120% at 100% 100%, rgba(255, 255, 255, .1), transparent 60%),
        linear-gradient(135deg, #17120e 0%, #241a12 55%, #17120e 100%);
    color: #fff;
    overflow: hidden;
}

.esc-apps__kicker {
    margin: 0 0 4px;
    color: #ffb37a;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .14em;
    text-transform: uppercase;
}

.esc-apps__title {
    margin: 0 0 8px;
    font-size: 34px;
    line-height: 1;
    letter-spacing: -.02em;
    color: #fff;
}

.esc-apps__intro {
    margin: 0;
    max-width: 72ch;
    color: rgba(255, 255, 255, .72);
    font-size: 13px;
    line-height: 1.6;
}

.esc-apps__stats {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
}

.esc-apps__stat {
    padding: 6px 12px;
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: 9999px;
    background: rgba(255, 255, 255, .05);
    font-size: 12px;
    color: rgba(255, 255, 255, .74);
}

.esc-apps__stat strong {
    color: #fff;
    font-size: 13px;
}

.esc-apps__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(290px, 100%), 1fr));
    gap: 16px;
}

.esc-apps__card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 24px;
    border: 1px solid #e8e8e8;
    border-radius: 18px;
    background: #fff;
    color: inherit;
    text-decoration: none;
    overflow: hidden;
    isolation: isolate;
    animation: escAppIn .55s cubic-bezier(.2, .7, .2, 1) both;
    animation-delay: calc(var(--app-i, 1) * 70ms);
    transition: transform .2s ease-out, box-shadow .2s ease-out, border-color .2s linear;
}

.esc-apps__card:hover,
.esc-apps__card:focus-visible,
.esc-apps__card:focus-within {
    transform: translateY(-4px);
    border-color: var(--app-color, #fb6900);
    box-shadow: 0 18px 38px rgba(23, 18, 14, .12);
    outline: none;
}

.esc-apps__glow {
    position: absolute;
    inset: auto -40px -60px auto;
    width: 190px;
    height: 190px;
    border-radius: 50%;
    background: var(--app-color, #fb6900);
    filter: blur(46px);
    opacity: .14;
    z-index: -1;
    transition: opacity .25s linear, transform .3s ease-out;
}

.esc-apps__card:hover .esc-apps__glow {
    opacity: .26;
    transform: scale(1.15);
}

.esc-apps__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    border-radius: 14px;
    background: color-mix(in srgb, var(--app-color, #fb6900) 14%, #fff);
    color: var(--app-color, #fb6900);
    font-size: 24px;
    line-height: 1;
    transition: transform .25s cubic-bezier(.2, .8, .2, 1.4);
}

.esc-apps__icon::before {
    font-size: 24px;
    width: 24px;
    height: 24px;
}

.esc-apps__card:hover .esc-apps__icon {
    transform: rotate(-8deg) scale(1.08);
}

.esc-apps__card-kicker {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: #767676;
}

.esc-apps__card-title {
    margin: 0;
    font-size: 22px;
    line-height: 1.1;
}

.esc-apps__card-desc {
    margin: 0;
    font-size: 13px;
    line-height: 1.6;
    color: #555;
}

.esc-apps__card-list {
    margin: 4px 0 0;
    padding: 0;
    list-style: none;
    font-size: 12px;
    line-height: 1.55;
    color: #444;
}

.esc-apps__card-list li {
    position: relative;
    padding-left: 20px;
    margin-bottom: 3px;
}

.esc-apps__card-list li::before {
    content: "";
    position: absolute;
    left: 2px;
    top: 6px;
    width: 8px;
    height: 8px;
    border-radius: 2px;
    background: var(--app-color, #fb6900);
}

.esc-apps__card-foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 12px;
    margin-top: auto;
    padding-top: 12px;
}

.esc-apps__badge {
    padding: 4px 10px;
    border-radius: 9999px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.esc-apps__badge--activa {
    background: #e8f5ec;
    color: #1a7f37;
}

.esc-apps__badge--pronto {
    background: #f0f0f0;
    color: #555;
}

.esc-apps__badges {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.esc-apps__badge--abierta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #e8f5ec;
    color: #145c28;
}

.esc-apps__badge--cerrada {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #fdecec;
    color: #8d1c1c;
}

.esc-apps__dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
}

.esc-apps__badge--cerrada .esc-apps__dot {
    box-shadow: 0 0 0 0 rgba(211, 47, 47, .6);
    animation: escLed 2s ease-out infinite;
}

.esc-apps__go {
    margin-left: auto;
    font-size: 13px;
    font-weight: 800;
    color: var(--app-color, #fb6900);
    text-decoration: none;
    white-space: nowrap;
    transition: transform .2s ease-out;
}

.esc-apps__links {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    margin-left: auto;
}

.esc-apps__links .esc-apps__go {
    margin-left: 0;
}

.esc-apps__go--page {
    color: #555;
    font-size: 12px;
    font-weight: 700;
}

.esc-apps__go--page:hover {
    color: var(--app-color, #fb6900);
}

.esc-apps__go:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
    border-radius: 3px;
}

.esc-apps__card:hover .esc-apps__go {
    transform: translateX(3px);
}

.esc-apps__card--soon {
    border-style: dashed;
    background: #fcfcfc;
    color: #555;
    box-shadow: none;
}

.esc-apps__card::after {
    content: "";
    position: absolute;
    top: -60%;
    left: -70%;
    width: 45%;
    height: 220%;
    background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .65), transparent);
    transform: rotate(14deg);
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s linear;
}

.esc-apps__card:hover::after {
    opacity: 1;
    animation: escShine .85s ease-out;
}

/* ==========================================================================
   Panel: héroe de escuderías
   ========================================================================== */

.esc-admin {
    max-width: 1200px;
}

.esc-admin__hero {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 22px;
    flex-wrap: wrap;
    margin-bottom: 14px;
    padding: 26px 28px 30px;
    border-radius: 18px;
    background:
        radial-gradient(120% 150% at 6% 0%, rgba(251, 105, 0, .30), transparent 55%),
        linear-gradient(135deg, #17120e 0%, #241a12 58%, #17120e 100%);
    color: #fff;
    overflow: hidden;
    isolation: isolate;
    animation: escRise .5s cubic-bezier(.2, .7, .2, 1) both;
}

.esc-admin__hero-grid {
    position: absolute;
    inset: -50%;
    background-image:
        linear-gradient(rgba(255, 255, 255, .05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, .05) 1px, transparent 1px);
    background-size: 40px 40px;
    transform: perspective(600px) rotateX(56deg);
    transform-origin: center 30%;
    animation: escGrid 28s linear infinite;
    pointer-events: none;
    z-index: -1;
}

.esc-admin__hero-glow {
    position: absolute;
    right: -100px;
    top: -120px;
    width: 320px;
    height: 320px;
    border-radius: 50%;
    background: #fb6900;
    filter: blur(90px);
    opacity: .30;
    animation: escBreathe 7s ease-in-out infinite;
    pointer-events: none;
    z-index: -1;
}

.esc-admin__hero-body {
    position: relative;
}

.esc-admin__kicker {
    margin: 0 0 3px;
    color: #ffb37a;
    font-size: 10.5px;
    font-weight: 800;
    letter-spacing: .14em;
    text-transform: uppercase;
}

.esc-admin__hero h1 {
    margin: 0 0 4px;
    color: #fff;
    font-size: 28px;
    line-height: 1;
    letter-spacing: -.02em;
}

.esc-admin__sub {
    margin: 0;
    color: rgba(255, 255, 255, .68);
    font-size: 12.5px;
}

.esc-admin__hero-stats {
    position: relative;
    display: flex;
    gap: 10px;
}

.esc-admin__stat {
    min-width: 84px;
    padding: 10px 14px;
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: 12px;
    background: rgba(255, 255, 255, .06);
    text-align: center;
}

.esc-admin__stat b {
    display: block;
    color: #fff;
    font-size: 22px;
    line-height: 1;
}

.esc-admin__stat span {
    color: rgba(255, 255, 255, .62);
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}

/* Controles de acceso y página ---------------------------------------- */

.esc-admin__control {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 12px;
    margin-bottom: 14px;
}

.esc-admin__control-item {
    padding: 16px 18px;
    border: 1px solid #e8e8e8;
    border-radius: 14px;
    background: #fff;
    animation: escUp .45s .04s cubic-bezier(.2, .7, .2, 1) both;
}

.esc-admin__control-label {
    margin: 0 0 6px;
    color: #767676;
    font-size: 10.5px;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.esc-admin__control-state {
    display: flex;
    align-items: center;
    gap: 7px;
    margin: 0 0 4px;
    font-size: 17px;
    font-weight: 800;
}

.esc-admin__dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #9ca3af;
}

.esc-admin__control-state.is-open {
    color: #145c28;
}

.esc-admin__control-state.is-open .esc-admin__dot {
    background: #1a7f37;
    box-shadow: 0 0 0 3px rgba(26, 127, 55, .16);
}

.esc-admin__control-state.is-closed {
    color: #8d1c1c;
}

.esc-admin__control-state.is-closed .esc-admin__dot {
    background: #d32f2f;
    box-shadow: 0 0 0 3px rgba(211, 47, 47, .16);
    animation: escBreathe 2.2s ease-in-out infinite;
}

.esc-admin__control-state.is-off {
    color: #6b625a;
}

.esc-admin__control-item .esc-admin__mail {
    margin: 0 0 12px;
    font-size: 12px;
    line-height: 1.5;
    color: #6b625a;
}

.esc-admin__control-item form {
    margin: 0;
}

/* ==========================================================================
   Panel: barra, tabla y ajustes
   ========================================================================== */

.esc-admin__bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    margin-bottom: 12px;
    border: 1px solid #e8e8e8;
    border-radius: 14px;
    background: #fff;
    animation: escUp .45s .05s cubic-bezier(.2, .7, .2, 1) both;
}

.esc-admin__bar-info {
    font-size: 13px;
    color: #555;
}

.esc-admin__bar-info strong {
    color: #17120e;
    font-size: 16px;
}

.esc-admin__bar-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.esc-admin__note {
    margin: 0 0 16px;
    font-size: 12px;
    line-height: 1.6;
    color: #555;
}

.esc-admin__thumb {
    display: block;
    width: 56px;
    height: 56px;
    border-radius: 10px;
    background: #f7f7f7;
    border: 1px solid #eee;
    object-fit: contain;
    transition: transform .18s ease-out, box-shadow .18s linear;
}

.esc-admin__table tbody tr {
    animation: escUp .4s cubic-bezier(.2, .7, .2, 1) both;
}

.esc-admin__table tbody tr:nth-child(1) { animation-delay: .04s; }
.esc-admin__table tbody tr:nth-child(2) { animation-delay: .08s; }
.esc-admin__table tbody tr:nth-child(3) { animation-delay: .12s; }
.esc-admin__table tbody tr:nth-child(4) { animation-delay: .16s; }
.esc-admin__table tbody tr:nth-child(5) { animation-delay: .2s; }

.esc-admin__table tbody tr:hover .esc-admin__thumb {
    transform: scale(1.06) rotate(-2deg);
    box-shadow: 0 8px 18px rgba(23, 18, 14, .14);
}

.esc-admin__thumb--vacio {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 16px;
}

.esc-admin__chips {
    display: flex;
    gap: 4px;
    margin-top: 5px;
}

.esc-admin__chip {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    background: var(--c);
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .18);
}

.esc-admin__mail {
    font-size: 11px;
    color: #767676;
    margin-top: 2px;
}

.esc-admin__table td {
    vertical-align: middle;
}

.esc-admin__empty {
    padding: 40px 24px;
    border: 1px dashed #dcdcdc;
    border-radius: 16px;
    background: #fcfcfc;
    text-align: center;
}

.esc-admin__empty .dashicons {
    width: 40px;
    height: 40px;
    font-size: 40px;
    color: #c5c5c5;
}

.esc-admin__empty h2 {
    margin: 8px 0;
    font-size: 18px;
}

.esc-admin__empty p {
    margin: 0 0 6px;
    color: #555;
    font-size: 13px;
}

.esc-admin__ajustes {
    margin-top: 22px;
    padding: 14px 16px;
    border: 1px solid #e8e8e8;
    border-radius: 14px;
    background: #fff;
}

.esc-admin__ajustes summary {
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
}

.esc-admin__ajustes form {
    margin-top: 12px;
}

/* ==========================================================================
   Animaciones
   ========================================================================== */

@keyframes escRise {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes escUp {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes escPop {
    0%   { opacity: 0; transform: scale(.9); }
    100% { opacity: 1; transform: scale(1); }
}

@keyframes escGrid {
    from { background-position: 0 0, 0 0; }
    to   { background-position: 0 46px, 46px 0; }
}

@keyframes escBreathe {
    0%, 100% { opacity: .30; transform: scale(1); }
    50%      { opacity: .46; transform: scale(1.06); }
}

@keyframes escPulse {
    0%   { transform: scale(.7); opacity: .9; }
    100% { transform: scale(1.9); opacity: 0; }
}

@keyframes escFlags {
    from { background-position: 0 0, 10px 10px; }
    to   { background-position: 20px 0, 30px 10px; }
}

@keyframes escShine {
    from { left: -80%; }
    to   { left: 130%; }
}

@keyframes escScan {
    0%   { transform: translateY(-100%); opacity: 0; }
    15%  { opacity: .9; }
    85%  { opacity: .9; }
    100% { transform: translateY(0); opacity: 0; }
}

@keyframes escLed {
    0%   { box-shadow: 0 0 0 0 rgba(255, 77, 77, .55); }
    70%  { box-shadow: 0 0 0 8px rgba(255, 77, 77, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 77, 77, 0); }
}

@keyframes escFloat {
    0%, 100% { transform: translateY(0) rotate(-2deg); }
    50%      { transform: translateY(-6px) rotate(2deg); }
}

@keyframes escSpin {
    to { transform: rotate(360deg); }
}

@keyframes escAppIn {
    from { opacity: 0; transform: translateY(14px) scale(.985); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 900px) {
    .esc-esc__preview {
        position: static;
    }
}

@media (max-width: 640px) {
    .esc-esc__panel {
        --pad: 18px;
        border-radius: 18px;
    }

    .esc-esc__panel-head {
        gap: 10px;
    }

    .esc-esc__panel-head h3 {
        font-size: 17px;
    }

    .esc-esc__opts {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .esc-esc__field--colors {
        grid-template-columns: 1fr;
    }

    .esc-esc__login {
        flex-direction: column;
        align-items: flex-start;
        padding: 24px 20px 30px;
    }

    .esc-esc__actions .esc-esc__btn--primary {
        width: 100%;
        justify-content: center;
    }

    .esc-admin__hero {
        padding: 20px;
    }

    .esc-admin__hero h1 {
        font-size: 24px;
    }
}

/* ==========================================================================
   Movimiento reducido
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
    .esc-admin__hero-grid,
    .esc-admin__hero-glow,
    .esc-admin__hero-flags,
    .esc-esc__login-flags,
    .esc-esc__login-glow,
    .esc-esc__login-ico,
    .esc-esc__scan,
    .esc-esc__hud-led,
    .esc-esc__msg,
    .esc-esc__group,
    .esc-esc__swatch,
    .esc-esc__dirty,
    .esc-esc__preview,
    .esc-esc__login,
    .esc-admin__hero,
    .esc-admin__bar,
    .esc-admin__table tbody tr,
    .esc-apps__card,
    .esc-apps__card::after,
    .esc-apps__icon,
    .esc-apps__glow,
    .esc-apps__go,
    .esc-esc__btn,
    .esc-esc__btn::after,
    .esc-esc__opt,
    .esc-esc__opt::after,
    .esc-esc__opt-shape,
    .esc-esc__drop-ico,
    .esc-esc__thumb {
        animation: none !important;
        transition: none !important;
    }

    .esc-esc__canvas-wrap {
        transform: none !important;
    }

    .esc-esc__opt:hover,
    .esc-esc__btn:hover,
    .esc-apps__card:hover {
        transform: none;
    }
}

/* ==========================================================================
   Ajustes de la foto: zoom, arrastre y aviso
   ========================================================================== */

.esc-esc__ajustes {
    margin-top: 14px;
    padding: 12px 14px 10px;
    border: 1px dashed #e6d6c6;
    border-radius: 13px;
    background: #fffaf5;
    animation: escUp .35s cubic-bezier(.2, .7, .2, 1) both;
}

.esc-esc__rango {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 2px 10px;
}

.esc-esc__rango label {
    grid-column: 1 / -1;
    color: #4a3f35;
    font-size: 11.5px;
    font-weight: 800;
    letter-spacing: .04em;
}

.esc-esc__rango output {
    padding: 3px 8px;
    border-radius: 7px;
    background: #fff0e2;
    color: #a33e00;
    font-size: 11.5px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

#esc-zoom {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 28px;
    margin: 0;
    background: transparent;
    cursor: pointer;
}

#esc-zoom::-webkit-slider-runnable-track {
    height: 6px;
    border-radius: 3px;
    background: linear-gradient(90deg, #fb6900, #ffb27a);
}

#esc-zoom::-moz-range-track {
    height: 6px;
    border-radius: 3px;
    background: linear-gradient(90deg, #fb6900, #ffb27a);
}

#esc-zoom::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 22px;
    height: 22px;
    margin-top: -8px;
    border: 3px solid #fff;
    border-radius: 50%;
    background: #fb6900;
    box-shadow: 0 0 0 1px rgba(23, 18, 14, .18), 0 4px 10px rgba(251, 105, 0, .35);
    transition: transform .16s cubic-bezier(.2, .9, .3, 1.6);
}

#esc-zoom::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border: 3px solid #fff;
    border-radius: 50%;
    background: #fb6900;
    box-shadow: 0 0 0 1px rgba(23, 18, 14, .18), 0 4px 10px rgba(251, 105, 0, .35);
}

#esc-zoom:hover::-webkit-slider-thumb,
#esc-zoom:focus-visible::-webkit-slider-thumb {
    transform: scale(1.18);
}

#esc-zoom:focus-visible {
    outline: 2px solid #fb6900;
    outline-offset: 4px;
    border-radius: 6px;
}

.esc-esc__ajustes .esc-esc__hint {
    margin: 4px 0 6px;
}

/* El lienzo se puede arrastrar para colocar la foto (también con el dedo). */
#esc-canvas {
    touch-action: none;
    cursor: grab;
}

#esc-canvas.is-dragging {
    cursor: grabbing;
}

/* Golpe visual al cambiar forma, textura o colores. */
.esc-esc__canvas-wrap.is-swap #esc-canvas {
    animation: escSwap .4s cubic-bezier(.2, .7, .2, 1);
}

@keyframes escSwap {
    0%   { transform: scale(.972); filter: brightness(1.14) saturate(1.1); }
    60%  { transform: scale(1.008); }
    100% { transform: scale(1); filter: none; }
}

@media (max-width: 560px) {
    .esc-esc__opts--formas {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .esc-esc__paleta-head {
        flex-wrap: wrap;
    }

    .esc-esc__ajustes {
        padding: 12px 12px 10px;
    }

    #esc-zoom {
        height: 38px;
    }

    #esc-zoom::-webkit-slider-thumb {
        width: 26px;
        height: 26px;
        margin-top: -10px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .esc-esc__ajustes,
    .esc-esc__canvas-wrap.is-swap #esc-canvas {
        animation: none !important;
        transition: none !important;
    }
}

/* ------------------------------ Equipos -------------------------------- */
/* Parrilla pública: solo escuderías aprobadas por el equipo. */
.esc-eqs {
    max-width: 1120px;
    margin: 0 auto;
    padding: 8px 0 24px;
    font-family: var(--esc-font, inherit);
}
.esc-eqs__head {
    margin-bottom: 22px;
}
.esc-eqs__kicker {
    margin: 0 0 6px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .8px;
    text-transform: uppercase;
    color: #fb6900;
}
.esc-eqs__title {
    margin: 0 0 8px;
    font-size: clamp(28px, 4vw, 42px);
    font-weight: 900;
    line-height: 1.05;
    color: #1f2328;
}
.esc-eqs__title span { color: #fb6900; }
.esc-eqs__intro {
    margin: 0;
    max-width: 60ch;
    color: #5b6470;
    font-size: 14px;
    line-height: 1.55;
}
.esc-eqs__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 18px;
}
.esc-eqs__card {
    margin: 0;
    padding: 14px;
    border: 1px solid #efe4d7;
    border-radius: 18px;
    background: #fffdfa;
    text-align: center;
}
.esc-eqs__shield {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 1;
    object-fit: contain;
    margin-bottom: 10px;
}
.esc-eqs__name {
    margin: 0;
    font-size: 15px;
    font-weight: 800;
    line-height: 1.3;
    color: #1f2328;
    overflow-wrap: anywhere;
}
.esc-eqs__owner {
    margin: 3px 0 0;
    font-size: 12px;
    color: #6b6f76;
}
.esc-eqs__empty {
    margin: 0;
    padding: 22px;
    border: 1px dashed #e6d9ca;
    border-radius: 16px;
    background: #fffdfb;
    color: #6b625a;
    font-size: 13px;
}
.esc-eqs__pending {
    display: inline-block;
    margin: 8px 0 0;
    padding: 2px 9px;
    border-radius: 999px;
    background: #fdf3e3;
    color: #8a5a12;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .2px;
}
/* La parrilla que acompaña al editor respira respecto a él. */
.esc-esc + .esc-eqs { margin-top: 40px; }

/* ------------------- Página de la app sin cabecera del tema ---------------- */
/* El tema pinta su título de página (un h1 enorme) encima del shortcode: en
   esta página sobra y parecía un banner. La clase la pone esco_esc_body_class(),
   así que solo se oculta cuando la página lleva [esc_escuderias]. */
.esc-esco-escuderias .wp-block-post-title,
.esc-esco-app .wp-block-post-title,
.esc-esco-escuderias .entry-header,
.esc-esco-app .entry-header { display: none; }
/* Solo se oculta el grupo si no lleva dentro la app: en Twenty Twenty-Five el
   título y el contenido comparten grupo, y ocultarlo dejaba la página en
   blanco. */
.esc-esco-escuderias :is(.wp-block-group, .wp-block-cover, .wp-block-column):has(> .wp-block-post-title):not(:has(.esc-esc, .esc-eqs)),
.esc-esco-app :is(.wp-block-group, .wp-block-cover, .wp-block-column):has(> .wp-block-post-title):not(:has(.esc-esc, .esc-eqs)) {
    display: none;
}

/* El tema de bloques limita el contenido a la columna de texto (645 px): el
   editor quedaba en una sola columna con la vista previa debajo. La app usa su
   propio ancho, sin pasarse de 1120 px. */
.esc-esco-app .entry-content > .esc-esc,
.esc-esco-app .entry-content > .esc-eqs {
    width: 100%;
    max-width: min(1120px, 100%);
    margin-left: auto;
    margin-right: auto;
}
/* Las chapas de estado reutilizan la clase del punto de color: sin esto se
   quedaban en 12 px y el texto «Publicado» se salía del cuadro. */
.esc-admin__chip--ok,
.esc-admin__chip--wait {
    display: inline-flex;
    align-items: center;
    width: auto;
    height: auto;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
    line-height: 1.4;
    white-space: nowrap;
    box-shadow: none;
}

.esc-admin__chip--ok { background: #e6f5ea; color: #145c28; }
.esc-admin__chip--wait { background: #fdf3e3; color: #8a5a12; }

/* ==========================================================================
   Móvil: editor de escuderías
   ========================================================================== */

@media (max-width: 700px) {
    /* La cabecera oscura y sus tres cifras: a 320 px la tercera tarjeta se
       salía del héroe. Pasa a rejilla de tres columnas que sí cabe. */
    .esc-admin__hero {
        align-items: stretch;
        gap: 16px;
        padding: 20px 16px 22px;
    }

    .esc-admin__hero-body {
        width: 100%;
    }

    .esc-admin__hero-stats {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 8px;
        width: 100%;
    }

    .esc-admin__stat {
        min-width: 0;
        padding: 10px 6px;
    }

    .esc-admin__stat span {
        font-size: 10px;
        line-height: 1.3;
    }

    .esc-esc {
        padding-bottom: 28px;
    }

    .esc-esc__grid {
        gap: 16px;
    }

    /* La vista previa va primero: se ve el escudo sin bajar todo el formulario. */
    .esc-esc__preview {
        order: -1;
        position: static;
        padding: 12px;
        border-radius: 18px;
    }

    .esc-esc__hud {
        gap: 6px;
        padding: 0 4px 9px;
        font-size: 9px;
        letter-spacing: .11em;
    }

    .esc-esc__hud-meta {
        white-space: nowrap;
    }

    .esc-esc__canvas-wrap {
        padding: 6px;
        border-radius: 12px;
        transform: none;
    }

    #esc-canvas {
        width: min(100%, 52vh);
        margin: 0 auto;
    }

    .esc-esc__preview-foot {
        gap: 8px;
        padding: 10px 0 0;
    }

    .esc-esc__preview-foot .esc-esc__hint {
        font-size: 11px;
        line-height: 1.45;
    }

    .esc-esc__preview-foot .esc-esc__btn--ghost {
        width: 100%;
        min-height: 44px;
        justify-content: center;
        padding: 12px 16px;
    }

    .esc-esc__panel {
        padding: 16px 14px;
        border-radius: 18px;
    }

    .esc-esc__panel-head {
        align-items: flex-start;
    }

    .esc-esc__group {
        padding: 14px 0;
    }

    .esc-esc__opts--formas {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .esc-esc__drop {
        padding: 16px 12px;
    }

    .esc-esc__foto-prev {
        max-width: 100%;
        height: 132px;
    }

    .esc-esc__foto {
        align-items: flex-start;
    }

    .esc-esc__link {
        display: inline-flex;
        align-items: center;
        min-height: 40px;
    }

    .esc-esc__check {
        min-height: 44px;
        padding: 11px 12px;
    }

    .esc-esc__actions {
        gap: 10px;
    }

    .esc-esc__actions .esc-esc__btn--primary {
        min-height: 48px;
    }

    .esc-esc__rango {
        gap: 4px 8px;
    }

    .esc-esc__rango label {
        font-size: 12px;
    }

    #esc-zoom {
        height: 42px;
    }

    .esc-esc__ajustes {
        padding: 12px 12px 10px;
    }

    .esc-esc__ajustes .esc-esc__hint {
        margin-bottom: 2px;
    }
}

/* ---------------------------------------------------------------------------
   Tabla del panel: filtros, selección en lote y ficha grande
   ------------------------------------------------------------------------ */

.esc-admin__tools {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 18px;
    align-items: center;
    justify-content: space-between;
    margin: 0 0 14px;
}

.esc-admin__filters,
.esc-admin__lote {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin: 0;
}

.esc-admin__filters .esc-admin__mail {
    margin: 0;
}

.esc-admin__check {
    width: 34px;
    text-align: center;
}

.esc-admin__check-todos {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
}

.esc-admin__thumb-link {
    display: inline-block;
    border-radius: 10px;
}

.esc-admin__thumb-link:focus-visible {
    outline: 2px solid #fb6900;
    outline-offset: 2px;
}

.esc-ficha {
    width: min(760px, 94vw);
    max-height: 92vh;
    overflow: auto;
    padding: 0;
    border: 0;
    border-radius: 18px;
    background: #fffdfa;
    color: #1f2328;
    box-shadow: 0 30px 80px rgba(23, 18, 14, .35);
}

.esc-ficha::backdrop {
    background: rgba(23, 18, 14, .7);
}

.esc-ficha__body {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 250px;
    gap: 20px;
    padding: 20px;
}

.esc-ficha__img {
    width: 100%;
    height: auto;
    aspect-ratio: 1;
    object-fit: contain;
    border-radius: 14px;
    background: #f7f3ee;
}

.esc-ficha__name {
    margin: 4px 0 8px;
    font-size: 20px;
    font-weight: 900;
    line-height: 1.2;
}

.esc-ficha__meta {
    margin: 0 0 6px;
    font-size: 13px;
    color: #6b6f76;
}

.esc-ficha__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 16px 0 0;
}

.esc-ficha__close {
    position: absolute;
    top: 8px;
    right: 10px;
    z-index: 2;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 50%;
    background: #17120e;
    color: #ffffff;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}

.esc-ficha__close:hover {
    background: #fb6900;
}

@media (max-width: 720px) {
    .esc-ficha__body {
        grid-template-columns: 1fr;
        padding: 16px;
    }

    .esc-ficha__img {
        max-height: 52vh;
    }
}

@media (max-width: 768px) {
    /* Filtros y lote a lo ancho: la barra no cabe en una fila. */
    .esc-admin__tools {
        align-items: stretch;
    }

    .esc-admin__filters,
    .esc-admin__lote {
        width: 100%;
    }

    .esc-admin__filters select,
    .esc-admin__filters input[type="search"] {
        flex: 1 1 140px;
        min-width: 0;
    }

    /* «Aprobar seleccionados» se cortaba dentro del desplegable. */
    .esc-admin__lote select {
        flex: 1 1 100%;
        min-width: 0;
    }

    .esc-admin__check-todos input {
        margin: 0;
    }

    /* La cabecera de la tabla se oculta: la casilla vive en la barra del lote. */
    .esc-admin__table .esc-admin__check {
        width: auto;
    }
}

/* Descarga del escudo propio desde la parrilla pública */
.esc-eqs__download {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 10px 0 0;
    padding: 7px 12px;
    border: 1px solid #efe4d7;
    border-radius: 999px;
    background: #fffdfa;
    color: #1f2328;
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
}

.esc-eqs__download:hover {
    border-color: #fb6900;
    color: #c94f00;
}

.esc-eqs__download .dashicons {
    width: 16px;
    height: 16px;
    font-size: 16px;
}
