/* ============================================================
   XandA · Header component
   Todo scopeado bajo .xa-header: los tokens viven aquí adentro
   y NO chocan con las variables :root de cada herramienta.
============================================================ */
.xa-header{
  /* tokens locales del header */
  --bg:#0E0C1C; --bg2:#131024; --panel:#181430; --panel2:#1E1940; --panel3:#241E4A;
  --line:#282250; --line2:#342C66;
  --ink:#F1EFFC; --sub:#A6A1C9; --mut:#6F6A96;
  --acc:#8B7CF7; --acc2:#6C5CE7; --deep:#5646C8; --lav:#E9E6FC;
  --grad:linear-gradient(135deg,#8B7CF7 0%,#6C5CE7 55%,#5646C8 100%);
  --f-head:'Space Grotesk',sans-serif;
  --f-body:'Inter',sans-serif;
  --f-mono:'JetBrains Mono',monospace;
  font-family:var(--f-body);
  color:var(--ink);
}

/* reset mínimo local */
.xa-header, .xa-header *{box-sizing:border-box}
.xa-header a{color:inherit;text-decoration:none}
.xa-header svg{display:block}
.xa-header button{font-family:var(--f-body);cursor:pointer}

/* ---------- accesibilidad ---------- */
.xa-header .skip{position:fixed;top:-60px;left:20px;z-index:4000;background:var(--acc2);color:#fff;padding:10px 18px;border-radius:10px;font-weight:600;transition:.3s}
.xa-header .skip:focus{top:14px}

/* ---------- barra de anuncio ---------- */
.xa-header .announ{position:relative;z-index:1100;background:linear-gradient(90deg,rgba(108,92,231,.25),rgba(139,124,247,.12),rgba(108,92,231,.25));border-bottom:1px solid var(--line);font-size:13px;text-align:center;padding:9px 44px;color:var(--lav)}
.xa-header .announ b{color:#fff}
.xa-header .announ a{color:var(--acc);font-weight:600;border-bottom:1px dashed var(--acc)}
.xa-header .announ-x{position:absolute;right:14px;top:50%;transform:translateY(-50%);background:none;border:0;color:var(--mut);cursor:pointer;font-size:16px;padding:4px 8px;border-radius:8px}
.xa-header .announ-x:hover{color:#fff;background:var(--panel3)}

/* ---------- nav ---------- */
.xa-header nav{position:fixed;top:0;left:0;right:0;z-index:1000;transition:.35s;border-bottom:1px solid transparent}
.xa-header nav.scrolled{background:rgba(14,12,28,.8);backdrop-filter:blur(16px);border-bottom-color:var(--line)}
.xa-header .nav-inner{max-width:1280px;margin:0 auto;padding:0 28px;height:72px;display:flex;align-items:center;gap:30px}
.xa-header .brand{display:flex;align-items:center;gap:11px;font-family:var(--f-head);font-weight:700;font-size:23px;letter-spacing:-.02em;color:var(--ink)}
.xa-header .brand svg{width:33px;height:33px}
.xa-header .nav-links{display:flex;align-items:center;gap:28px;margin-left:auto}
.xa-header .nav-links a{display:flex;align-items:center;gap:8px;font-weight:600;font-size:15px;color:var(--sub);transition:.25s}
.xa-header .nav-links a:hover{color:#fff}
.xa-header .nav-links .btn-lib{background:var(--grad);color:#fff;font-size:13.5px;font-weight:700;letter-spacing:.05em;text-transform:uppercase;padding:10px 22px;border-radius:999px;box-shadow:0 10px 24px -10px rgba(108,92,231,.7)}
.xa-header .nav-links .btn-lib:hover{transform:translateY(-2px)}
.xa-header .cmdk-btn{display:flex;align-items:center;gap:10px;background:var(--panel);border:1px solid var(--line);color:var(--mut);border-radius:11px;padding:8px 12px;font-size:13.5px;cursor:pointer;transition:.25s}
.xa-header .cmdk-btn:hover{border-color:var(--acc);color:var(--sub)}
.xa-header .cmdk-btn kbd{margin-left:4px}
.xa-header .icon{width:1.2em;height:1.2em;stroke:currentColor;fill:none;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;flex:none}
.xa-header kbd{font-family:var(--f-mono);font-size:11px;background:var(--panel3);border:1px solid var(--line2);border-bottom-width:2px;border-radius:6px;padding:2px 7px;color:var(--sub)}
.xa-header .burger{display:none;flex-direction:column;gap:5px;background:none;border:0;cursor:pointer;padding:8px;margin-left:auto}
.xa-header .burger span{width:24px;height:2.5px;border-radius:2px;background:var(--ink);transition:.3s}
.xa-header .mobile-menu{display:none}

/* ---------- responsive ---------- */
@media(max-width:860px){
  .xa-header .nav-links{display:none}
  .xa-header .burger{display:flex}
  .xa-header .mobile-menu{display:block;position:fixed;top:0;left:0;right:0;padding:86px 28px 26px;background:var(--bg2);border-bottom:1px solid var(--line);transform:translateY(-105%);transition:.4s;z-index:990}
  .xa-header .mobile-menu.open{transform:none}
  .xa-header .mobile-menu a{display:flex;align-items:center;gap:12px;padding:14px 4px;font-weight:600;border-bottom:1px solid var(--line);color:var(--sub)}
  .xa-header .mobile-menu .btn-lib{margin-top:18px;justify-content:center;width:100%}
}

/* =========================
TOKENS  →  tema oscuro de la propuesta
========================= */

:root {
    --ink-950: #F1EFFC;
    --ink-700: #A6A1C9;
    --ink-500: #6F6A96;
    --indigo-600: #6C5CE7;
    --indigo-700: #5646C8;
    --violet-500: #8B7CF7;
    --blue-400: #A99DFF;
    --lav: #E9E6FC;
    --lav-50: #0E0C1C;
    --lav-100: #181430;
    --lav-150: #1E1940;
    --lav-200: #282250;
    --white: #181430;
    --good-600: #3ECF8E;
    --good-100: rgba(62, 207, 142, 0.12);
    --amber-500: #F5A524;
    --amber-100: rgba(245, 165, 36, 0.12);
    --red-500: #EF4444;
    --red-100: rgba(239, 68, 68, 0.12);
    --grad: linear-gradient(135deg, #8B7CF7 0%, #6C5CE7 55%, #5646C8 100%);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.55);
    --radius-lg: 22px;
    --radius-md: 14px;
    --radius-sm: 9px;
}

* {
    margin: 0%;
    padding: 0%;
}

img {
    user-select: none;
    -webkit-user-select: none;
    -webkit-user-drag: none;
    user-drag: none;
    pointer-events: none;
}

html {
    scroll-behavior: smooth;
    color-scheme: dark;
}

body {
    margin: 0;
    background:
        radial-gradient(1100px 480px at 12% -10%, rgba(108, 92, 231, 0.20) 0%, transparent 60%),
        radial-gradient(900px 420px at 100% 8%, rgba(139, 124, 247, 0.10) 0%, transparent 55%),
        var(--lav-50);
    color: var(--ink-950);
    font-family: 'Inter', system-ui, sans-serif;
    -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
.display {
    font-family: 'Space Grotesk', sans-serif;
    letter-spacing: -0.02em;
}

.mono {
    font-family: 'IBM Plex Mono', monospace;
    letter-spacing: -0.01em;
}

.wrap {
    max-width: 1160px;
    margin: 0 auto;
    padding: 64px 28px 120px;
}

::selection {
    background: var(--violet-500);
    color: #fff;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    font-family: inherit;
    cursor: pointer;
}

/* ---------- focus ---------- */
:focus-visible {
    outline: 2.5px solid var(--violet-500);
    outline-offset: 3px;
    border-radius: 8px;
}

/* ---------- intro ---------- */
.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--lav);
    background: rgba(139, 124, 247, 0.08);
    border: 1px solid var(--lav-200);
    padding: clamp(10px, 1.5vw, 15px) clamp(15px, 2vw, 20px);
    border-radius: clamp(15px, 2vw, 20px);
    text-transform: uppercase;
    letter-spacing: .08em;
}

.eyebrow .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--violet-500);
    box-shadow: 0 0 0 3px rgba(139, 124, 247, 0.25);
}

.intro {
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-width: 760px;
    margin-top: 22px;
}

.intro h1 {
    font-size: clamp(34px, 5vw, 52px);
    line-height: 1.04;
    margin: 0;
    font-weight: 700;
    color: var(--ink-950);
}

.intro h1 em {
    font-style: normal;
    background: var(--grad);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.intro p {
    font-size: 17px;
    line-height: 1.65;
    color: var(--ink-700);
    margin: 0;
    max-width: 600px;
}

.chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    margin-top: 6px;
}

.fmt-chip {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 12.5px;
    font-weight: 600;
    padding: 7px 13px;
    border-radius: 99px;
    background: var(--lav-100);
    border: 1px solid var(--lav-200);
    color: var(--ink-700);
    box-shadow: var(--shadow-sm);
}

/* ---------- dropzone ---------- */
.dropzone-section {
    margin-top: 44px;
}

.dropzone {
    position: relative;
    border-radius: 26px;
    padding: 52px 36px;
    background: linear-gradient(180deg, var(--lav-100) 0%, var(--lav-50) 100%);
    border: 2px dashed var(--lav-200);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 16px;
    transition: border-color .22s ease, background .22s ease, transform .22s ease;
    overflow: hidden;
}

.dropzone.drag {
    border-color: var(--violet-500);
    background: linear-gradient(180deg, rgba(139, 124, 247, 0.10) 0%, var(--lav-100) 100%);
    transform: scale(1.005);
}

.dropzone::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: .9;
    background:
        radial-gradient(420px 200px at 15% 0%, rgba(139, 124, 247, 0.14), transparent 60%),
        radial-gradient(420px 220px at 100% 100%, rgba(108, 92, 231, 0.12), transparent 60%);
}

/* signature: shuffling format chips */
.shifter {
    position: relative;
    width: 150px;
    height: 96px;
    margin-bottom: 4px;
}

.shifter .sq {
    position: absolute;
    width: 64px;
    height: 64px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 700;
    font-size: 12px;
    color: #fff;
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.45);
    animation: shift 6.4s cubic-bezier(.65, 0, .35, 1) infinite;
}

.shifter .sq.png {
    background: linear-gradient(140deg, var(--indigo-700), var(--indigo-600));
    animation-delay: 0s;
}

.shifter .sq.jpg {
    background: linear-gradient(140deg, var(--indigo-600), var(--violet-500));
    animation-delay: -1.6s;
}

.shifter .sq.webp {
    background: linear-gradient(140deg, var(--violet-500), var(--blue-400));
    animation-delay: -3.2s;
}

.shifter .sq.avif {
    background: linear-gradient(140deg, var(--blue-400), #BDB4FF);
    animation-delay: -4.8s;
}

@keyframes shift {
    0% {
        top: 16px;
        left: 43px;
        transform: rotate(-6deg) scale(1);
        z-index: 4;
    }

    25% {
        top: 0px;
        left: 0px;
        transform: rotate(-4deg) scale(.86);
        z-index: 3;
    }

    50% {
        top: 22px;
        left: 0px;
        transform: rotate(3deg) scale(.78);
        z-index: 2;
    }

    75% {
        top: 32px;
        left: 43px;
        transform: rotate(6deg) scale(.72);
        z-index: 1;
    }

    100% {
        top: 16px;
        left: 43px;
        transform: rotate(-6deg) scale(1);
        z-index: 4;
    }
}

@media (prefers-reduced-motion: reduce) {
    .shifter .sq {
        animation: none;
    }

    .shifter .sq.png {
        top: 16px;
        left: 43px;
        transform: rotate(-6deg);
        z-index: 4;
    }

    .shifter .sq.jpg {
        top: 0;
        left: 0;
        transform: rotate(-4deg) scale(.86);
        z-index: 3;
    }

    .shifter .sq.webp {
        top: 22px;
        left: 0;
        transform: rotate(3deg) scale(.78);
        z-index: 2;
    }

    .shifter .sq.avif {
        top: 32px;
        left: 43px;
        transform: rotate(6deg) scale(.72);
        z-index: 1;
    }
}

.dropzone h2 {
    font-size: 22px;
    margin: 0;
    color: var(--ink-950);
}

.dropzone p.hint {
    margin: 0;
    color: var(--ink-500);
    font-size: 14.5px;
}

.browse-btn {
    margin-top: 6px;
    background: var(--grad);
    color: #fff;
    border: none;
    padding: 13px 26px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 15px;
    box-shadow: 0 10px 24px rgba(108, 92, 231, 0.45);
    transition: transform .15s ease, box-shadow .15s ease;
}

.browse-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 30px rgba(139, 124, 247, 0.5);
}

.browse-btn:active {
    transform: translateY(0);
}

input[type=file] {
    display: none;
}

.dz-formats {
    font-size: 12.5px;
    color: var(--ink-500);
    margin-top: 2px;
}

.dz-formats b {
    color: var(--ink-700);
}

/* ---------- toolbar ---------- */
.toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    margin-top: 34px;
}

.toolbar h3 {
    margin: 0;
    font-size: 18px;
}

.toolbar .count {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 12.5px;
    color: var(--violet-500);
    background: var(--lav-100);
    border: 1px solid var(--lav-200);
    padding: 4px 10px;
    border-radius: 99px;
    margin-left: 8px;
}

.toolbar-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 10px 17px;
    border-radius: 11px;
    font-weight: 600;
    font-size: 14px;
    border: 1px solid transparent;
    transition: all .15s ease;
}

.btn-primary {
    background: var(--grad);
    color: #fff;
    box-shadow: 0 8px 18px rgba(108, 92, 231, 0.4);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 22px rgba(139, 124, 247, 0.45);
}

.btn-ghost {
    background: var(--lav-100);
    color: var(--ink-700);
    border-color: var(--lav-200);
}

.btn-ghost:hover {
    border-color: var(--violet-500);
    color: var(--lav);
}

.btn-danger-ghost {
    background: var(--lav-100);
    color: #F87171;
    border-color: rgba(239, 68, 68, 0.35);
}

.btn-danger-ghost:hover {
    background: var(--red-100);
}

.btn[disabled] {
    opacity: .45;
    pointer-events: none;
}

/* global controls */
.global-controls {
    display: flex;
    gap: 22px;
    flex-wrap: wrap;
    align-items: flex-end;
    background: var(--white);
    border: 1px solid var(--lav-200);
    border-radius: 16px;
    padding: 18px 20px;
    margin-top: 16px;
    box-shadow: var(--shadow-sm);
}

.field {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 170px;
}

.field label {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--ink-700);
    display: flex;
    justify-content: space-between;
}

.field label .val {
    font-family: 'IBM Plex Mono', monospace;
    color: var(--violet-500);
}

.seg {
    display: flex;
    background: var(--lav-150);
    border: 1px solid var(--lav-200);
    border-radius: 10px;
    padding: 3px;
    gap: 2px;
}

.seg button {
    flex: 1;
    border: none;
    background: transparent;
    padding: 8px 10px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--ink-700);
    transition: all .15s ease;
}

.seg button.active {
    background: var(--grad);
    color: #fff;
    box-shadow: 0 4px 12px rgba(108, 92, 231, 0.4);
}

input[type=range] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 99px;
    background: var(--lav-200);
    outline: none;
}

input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--violet-500);
    border: 3px solid var(--lav-50);
    box-shadow: 0 2px 8px rgba(139, 124, 247, 0.5);
    cursor: pointer;
}

input[type=range]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--violet-500);
    border: 3px solid var(--lav-50);
    box-shadow: 0 2px 8px rgba(139, 124, 247, 0.5);
    cursor: pointer;
}

/* ---------- file list ---------- */
.file-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 20px;
}

.file-card {
    background: var(--white);
    border: 1px solid var(--lav-200);
    border-radius: 18px;
    padding: 18px;
    display: grid;
    grid-template-columns: 76px 1fr auto;
    gap: 18px;
    align-items: center;
    box-shadow: var(--shadow-sm);
    transition: box-shadow .2s ease, transform .2s ease, opacity .2s ease;
    animation: cardIn .35s ease both;
}

@keyframes cardIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

.file-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--line-hover, #342C66);
}

.file-card.selected {
    border-color: var(--violet-500);
    box-shadow: 0 0 0 3px rgba(139, 124, 247, 0.18);
}

.thumb {
    width: 76px;
    height: 76px;
    border-radius: 13px;
    object-fit: cover;
    background: var(--lav-150);
    border: 1px solid var(--lav-200);
    cursor: pointer;
}

.file-meta {
    min-width: 0;
}

.file-name {
    font-weight: 600;
    font-size: 14.5px;
    color: var(--ink-950);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.file-sub {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
    flex-wrap: wrap;
}

.badge {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: .03em;
}

.badge-in {
    background: var(--lav-150);
    color: var(--violet-500);
    border: 1px solid var(--lav-200);
}

.arrow {
    color: var(--ink-500);
    font-size: 12px;
}

.size-text {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 12px;
    color: var(--ink-500);
}

.size-text .save {
    color: var(--good-600);
    font-weight: 600;
}

.size-text .grow {
    color: var(--amber-500);
    font-weight: 600;
}

.row-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 2px;
}

.target-select {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--ink-950);
    background: var(--lav-150);
    border: 1px solid var(--lav-200);
    border-radius: 8px;
    padding: 7px 10px;
}

.status-pill {
    font-size: 11.5px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 99px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.status-pending {
    background: var(--lav-150);
    color: var(--ink-700);
}

.status-done {
    background: var(--good-100);
    color: var(--good-600);
}

.status-error {
    background: var(--red-100);
    color: #F87171;
}

.status-working {
    background: var(--amber-100);
    color: #FBBF24;
}

.file-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: flex-end;
}

.icon-btn {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    border: 1px solid var(--lav-200);
    background: var(--lav-100);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ink-500);
    transition: all .15s ease;
}

.icon-btn:hover {
    border-color: var(--violet-500);
    color: var(--lav);
}

.row-btns {
    display: flex;
    gap: 8px;
}

.btn-sm {
    padding: 8px 13px;
    font-size: 13px;
    border-radius: 9px;
}

/* progress bar inline */
.progress {
    height: 4px;
    width: 100%;
    background: var(--lav-150);
    border-radius: 99px;
    overflow: hidden;
    margin-top: 8px;
}

.progress i {
    display: block;
    height: 100%;
    background: var(--grad);
    width: 0%;
    transition: width .25s ease;
}

/* ---------- empty state ---------- */
.empty-state {
    display: none;
    text-align: center;
    padding: 30px 10px;
    color: var(--ink-500);
    font-size: 14px;
}

/* ---------- stats strip ---------- */
.stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin-top: 38px;
}

.stat-card {
    background: var(--white);
    border: 1px solid var(--lav-200);
    border-radius: 16px;
    padding: 20px 22px;
    box-shadow: var(--shadow-sm);
}

.stat-card .n {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 28px;
    font-weight: 700;
    color: var(--ink-950);
}

.stat-card .l {
    font-size: 12.5px;
    color: var(--ink-500);
    margin-top: 4px;
    font-weight: 500;
}

.stat-card.accent {
    background: var(--grad);
    border-color: transparent;
    box-shadow: 0 14px 34px -12px rgba(108, 92, 231, 0.55);
}

.stat-card.accent .n,
.stat-card.accent .l {
    color: #fff;
}

.stat-card.accent .l {
    opacity: .85;
}

/* ---------- compare ---------- */
.compare-section {
    margin-top: 64px;
}

.section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.section-head h2 {
    font-size: 24px;
    margin: 0;
}

.section-head p {
    margin: 4px 0 0;
    color: var(--ink-500);
    font-size: 14px;
}

.compare-box {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    background: var(--lav-100);
    border: 1px solid var(--lav-200);
    box-shadow: var(--shadow-md);
    aspect-ratio: 16/9;
}

.compare-box .layer {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: var(--lav-50);
    user-select: none;
    pointer-events: none;
}

.compare-box .after-wrap {
    position: absolute;
    inset: 0;
    overflow: hidden;
    width: 50%;
}

.compare-box .after-wrap img {
    position: absolute;
    inset: 0;
    width: var(--cbw, 100%);
    height: 100%;
    object-fit: contain;
    background: var(--lav-50);
    max-width: none;
}

.compare-tag {
    position: absolute;
    top: 14px;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11.5px;
    font-weight: 600;
    background: rgba(14, 12, 28, 0.78);
    border: 1px solid rgba(139, 124, 247, 0.35);
    color: var(--lav);
    padding: 5px 10px;
    border-radius: 99px;
    backdrop-filter: blur(4px);
}

.compare-tag.left {
    left: 14px;
}

.compare-tag.right {
    right: 14px;
}

.compare-handle {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 0;
    transform: translateX(-50%);
    cursor: ew-resize;
    display: flex;
    align-items: center;
    justify-content: center;
}

.compare-handle::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--violet-500);
    box-shadow: 0 0 12px rgba(139, 124, 247, 0.7);
}

.compare-handle .grip {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--grad);
    box-shadow: 0 8px 20px rgba(108, 92, 231, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 14px;
    z-index: 2;
}

.compare-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--ink-500);
    font-size: 14px;
    text-align: center;
    padding: 20px;
}

/* ---------- format guide ---------- */
.guide-section {
    margin-top: 70px;
}

.guide-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
}

.guide-card {
    background: var(--white);
    border: 1px solid var(--lav-200);
    border-radius: 16px;
    padding: 20px;
    box-shadow: var(--shadow-sm);
    transition: transform .2s ease, box-shadow .2s ease;
}

.guide-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.guide-card .tag {
    display: inline-flex;
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 700;
    font-size: 12.5px;
    color: #fff;
    padding: 5px 10px;
    border-radius: 7px;
    margin-bottom: 12px;
}

.guide-card p {
    font-size: 13.5px;
    color: var(--ink-700);
    line-height: 1.55;
    margin: 0;
}

.guide-card .best {
    margin-top: 10px;
    font-size: 12px;
    color: var(--ink-500);
}

.guide-card .best b {
    color: var(--violet-500);
}

/* ---------- toast ---------- */
.toast-wrap {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 999;
}

.toast {
    background: var(--lav-150);
    border: 1px solid #342C66;
    color: var(--ink-950);
    padding: 13px 18px;
    border-radius: 12px;
    font-size: 13.5px;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 10px;
    animation: toastIn .25s ease both;
    max-width: 320px;
}

.toast.good {
    background: linear-gradient(120deg, #166534, #16A34A);
    border-color: transparent;
    color: #fff;
}

.toast.bad {
    background: linear-gradient(120deg, #7F1D1D, #DC2626);
    border-color: transparent;
    color: #fff;
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

/* ---------- reveal ---------- */
.reveal {
    opacity: 0;
    transform: translateY(14px);
    transition: opacity .6s ease, transform .6s ease;
}

.reveal.in {
    opacity: 1;
    transform: none;
}

/* =========================
   RESPONSIVE (TOOL PAGE)
========================= */

@media (max-width:860px) {
    .file-card {
        grid-template-columns: 56px 1fr;
        grid-template-rows: auto auto;
    }

    .file-actions {
        grid-column: 1/-1;
        flex-direction: row;
        justify-content: flex-end;
    }

    .thumb {
        width: 56px;
        height: 56px;
    }

    .stats {
        grid-template-columns: 1fr;
    }

    .guide-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width:520px) {
    .wrap {
        padding: 40px 16px 90px;
    }

    .guide-grid {
        grid-template-columns: 1fr;
    }

    .global-controls {
        flex-direction: column;
        align-items: stretch;
    }
}

/* BARRA DE SCROLL */
::-webkit-scrollbar {
    width: 10px;
}

/* FONDO */
::-webkit-scrollbar-track {
    background: #131024;
}

/* BARRA */
::-webkit-scrollbar-thumb {
    background: linear-gradient(#8B7CF7, #5646C8);
    border-radius: 10px;
}

/* HOVER */
::-webkit-scrollbar-thumb:hover {
    background: #A99DFF;
}