/* ---------- Tokens ---------- */
:root {
  --bg: #fafaf7; --sheet: #ffffff; --sheet-2: #f4f5f1;
  --ink: #17191c; --ink-2: #565b63; --ink-3: #6b7078;
  --line: #e3e4e0; --line-2: #cdd0ca;
  --accent: #1f7a4d; --accent-ink: #ffffff; --accent-soft: #e4f2ea; --accent-hover: #186540;
  --add: #1f7a4d; --add-bg: #dcf1e4; --add-row: #effaf3;
  --del: #b3261e; --del-bg: #fbe1df; --del-row: #fdf2f1;
  --mod: #8a5a00; --mod-bg: #fdefc2; --mod-row: #fffaea;
  --danger: #b3261e; --danger-soft: #fdecea; --warn-soft: #fff5d6;
  --shadow: 0 1px 2px rgba(23,25,28,.05), 0 6px 20px -12px rgba(23,25,28,.22);
  --radius: 12px; --radius-sm: 8px;
  --font: "Instrument Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111312; --sheet: #191c1a; --sheet-2: #202421;
    --ink: #ebeeea; --ink-2: #a5aca6; --ink-3: #8c938d;
    --line: #2a2f2b; --line-2: #3a403b;
    --accent: #5cc98e; --accent-ink: #062414; --accent-soft: #17301f; --accent-hover: #7bd6a4;
    --add: #6fd39b; --add-bg: #173a26; --add-row: #13241a;
    --del: #ff8a80; --del-bg: #4a1f1c; --del-row: #2a1816;
    --mod: #f3c55a; --mod-bg: #4a3a10; --mod-row: #272110;
    --danger: #ff8a80; --danger-soft: #3a1c1a; --warn-soft: #33290f;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px -12px rgba(0,0,0,.7);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #111312; --sheet: #191c1a; --sheet-2: #202421;
  --ink: #ebeeea; --ink-2: #a5aca6; --ink-3: #8c938d;
  --line: #2a2f2b; --line-2: #3a403b;
  --accent: #5cc98e; --accent-ink: #062414; --accent-soft: #17301f; --accent-hover: #7bd6a4;
  --add: #6fd39b; --add-bg: #173a26; --add-row: #13241a;
  --del: #ff8a80; --del-bg: #4a1f1c; --del-row: #2a1816;
  --mod: #f3c55a; --mod-bg: #4a3a10; --mod-row: #272110;
  --danger: #ff8a80; --danger-soft: #3a1c1a; --warn-soft: #33290f;
  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 15px; line-height: 1.55; min-height: 100dvh; display: flex; flex-direction: column; }
h1, h2, h3, p, ol, ul { margin: 0; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent); text-underline-offset: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
[hidden] { display: none !important; }
b, strong { font-weight: 600; }
small { font-size: 13px; color: var(--ink-2); }
.muted { color: var(--ink-3); font-weight: 400; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 24px; }
main { flex: 1; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }

/* ---------- Cabecera ---------- */
.top { display: flex; align-items: center; gap: 16px; padding: 0 24px; height: 54px; border-bottom: 1px solid var(--line); background: var(--bg); }
.brand { display: inline-flex; align-items: center; gap: 9px; color: var(--ink); text-decoration: none; font-weight: 600; font-size: 16px; letter-spacing: -.01em; white-space: nowrap; }
.brand svg { color: var(--accent); }
.top__privacy { margin-left: auto; display: inline-flex; align-items: center; gap: 7px; color: var(--ink-2); font-size: 13px; }
.top__privacy svg { color: var(--accent); flex: none; }

.lang { display: inline-flex; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: 999px; background: var(--sheet); }
.lang a { padding: 3px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); text-decoration: none; letter-spacing: .02em; }
.lang a:hover { color: var(--ink); }
.lang a[aria-current="page"] { background: var(--accent); color: var(--accent-ink); }

/* ---------- Hero ---------- */
.hero { padding-top: 40px; padding-bottom: 24px; }
.hero h1 { font-size: clamp(26px, 4vw, 36px); line-height: 1.15; letter-spacing: -.02em; font-weight: 600; max-width: 22ch; }
.lede { margin-top: 10px; color: var(--ink-2); font-size: 16.5px; max-width: 62ch; }
.perks { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 0; padding: 0; list-style: none; }
.perks li { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px 6px 9px; border-radius: 999px; background: var(--accent-soft); color: var(--ink); font-size: 13.5px; font-weight: 500; }
.perks svg { color: var(--accent); flex: none; }

/* ---------- Archivos ---------- */
.files { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.file { min-width: 0; }
.drop { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 196px; padding: 28px 20px; border: 1.5px dashed var(--line-2); border-radius: var(--radius); background: var(--sheet); text-align: center; cursor: pointer; transition: border-color .15s, background .15s; }
.drop:hover, .drop.is-over { border-color: var(--accent); background: var(--accent-soft); }
.drop:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.drop__tag, .file__tag { font-size: 12px; font-weight: 600; letter-spacing: .02em; color: var(--ink-2); text-transform: uppercase; }
.drop__icon { color: var(--accent); margin: 6px 0 2px; }
.drop__title { font-weight: 600; font-size: 16px; }
.drop__hint { font-size: 13px; color: var(--ink-2); }
.file__info { border: 1px solid var(--line); border-radius: var(--radius); background: var(--sheet); padding: 16px; display: grid; gap: 12px; min-height: 196px; align-content: start; box-shadow: var(--shadow); }
.file__head { display: flex; align-items: center; gap: 12px; min-width: 0; }
.file__icon { color: var(--accent); flex: none; }
.file__meta { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.file__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file__status { font-size: 13.5px; color: var(--ink-2); min-height: 22px; margin-top: 8px; }
.file__status.is-error, .error { color: var(--danger); }
.sample { margin-top: 12px; font-size: 14px; color: var(--ink-2); }
.link { border: 0; background: none; padding: 0; color: var(--accent); text-decoration: underline; text-underline-offset: 2px; font-weight: 500; }

/* ---------- Campos ---------- */
.field { display: grid; gap: 5px; min-width: 0; }
.field > label { font-weight: 500; font-size: 14px; }
.field--inline { grid-template-columns: auto 120px; align-items: center; column-gap: 12px; }
.field--inline small { grid-column: 1 / -1; }
select, input[type="number"], input[type="search"] { width: 100%; height: 40px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: var(--sheet); }
select { appearance: none; padding-right: 34px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23808080' stroke-width='2.6' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; text-overflow: ellipsis; }
select:focus, input:focus { border-color: var(--accent); }
.check { display: flex; align-items: flex-start; gap: 9px; font-size: 14px; cursor: pointer; line-height: 1.4; }
.check input { width: 17px; height: 17px; margin: 1px 0 0; accent-color: var(--accent); flex: none; }
.check--compact { align-items: center; white-space: nowrap; }
.check--compact input { margin: 0; }

/* ---------- Botones ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 40px; padding: 0 16px; border-radius: var(--radius-sm); border: 1px solid var(--line-2); background: var(--sheet); font-weight: 500; font-size: 14.5px; white-space: nowrap; transition: background .15s, border-color .15s; }
.btn:hover { border-color: var(--ink-3); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn--primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn--primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn--ghost { border-color: transparent; background: transparent; color: var(--accent); }
.btn--ghost:hover { background: var(--accent-soft); border-color: transparent; }
.btn--sm { height: 32px; padding: 0 10px; font-size: 13.5px; }
.btn--lg { height: 46px; padding: 0 26px; font-size: 16px; }

/* ---------- Configuración ---------- */
.setup { margin-top: 20px; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--sheet); display: grid; gap: 16px; }
.setup__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.opts summary { cursor: pointer; font-weight: 500; font-size: 14px; color: var(--ink-2); width: fit-content; }
.opts__body { display: grid; gap: 10px; padding-top: 12px; }
.setup__actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.setup__status { font-size: 14px; color: var(--ink-2); display: inline-flex; align-items: center; gap: 8px; }
.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line-2); border-top-color: var(--accent); animation: spin .8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Resultados ---------- */
.results { margin-top: 28px; }
.notice { padding: 12px 14px; border-radius: var(--radius-sm); background: var(--warn-soft); font-size: 14px; margin-bottom: 14px; }
.stats { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.stat { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--sheet); text-align: left; min-width: 0; position: relative; }
.stat::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: var(--dot, var(--ink-3)); }
.stat__n { font-size: 24px; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1.2; }
.stat__l { font-size: 13px; color: var(--ink-2); }
.stat:hover { border-color: var(--line-2); }
.stat.is-active { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.stat--added { --dot: var(--add); } .stat--removed { --dot: var(--del); } .stat--modified { --dot: var(--mod); } .stat--changes { --dot: var(--accent); } .stat--same { --dot: var(--line-2); } .stat--all { --dot: var(--ink-3); }
.cols-note { margin-top: 10px; font-size: 14px; color: var(--ink-2); }
.toolbar { display: flex; align-items: center; gap: 12px 16px; flex-wrap: wrap; margin-top: 18px; }
.search { position: relative; flex: 1 1 220px; max-width: 340px; }
.search svg { position: absolute; left: 11px; top: 12px; color: var(--ink-3); pointer-events: none; }
.search input { padding-left: 34px; }
.toolbar__dl { display: flex; gap: 8px; margin-left: auto; flex-wrap: wrap; }
.dl-status { font-size: 13.5px; color: var(--ink-2); min-height: 20px; margin-top: 8px; }

.table-wrap { margin-top: 6px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--sheet); overflow: auto; max-height: 70vh; }
.diff { border-collapse: separate; border-spacing: 0; font-size: 13.5px; font-variant-numeric: tabular-nums; min-width: 100%; }
.diff th, .diff td { padding: 7px 12px; border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); text-align: left; vertical-align: top; white-space: nowrap; max-width: 320px; overflow: hidden; text-overflow: ellipsis; }
.diff th { position: sticky; top: 0; background: var(--sheet-2); font-weight: 600; z-index: 2; font-size: 13px; }
.diff th.is-changed { box-shadow: inset 0 -3px 0 var(--mod); }
.diff th.is-only { color: var(--ink-3); font-style: italic; }
.diff td.c-status, .diff th.c-status { position: sticky; left: 0; z-index: 1; background: inherit; }
.diff th.c-status { z-index: 3; background: var(--sheet-2); }
.diff td.c-row { color: var(--ink-3); font-size: 12.5px; }
.diff tbody tr { background: var(--sheet); }
.diff tr.r-added { background: var(--add-row); }
.diff tr.r-removed { background: var(--del-row); }
.diff tr.r-removed td:not(.c-status):not(.c-row) { color: var(--ink-2); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--del) 60%, transparent); }
.diff td.is-mod { background: var(--mod-bg); }
.diff td.is-mod del { color: var(--ink-2); text-decoration-color: var(--del); margin-right: 6px; }
.diff td.is-mod ins { text-decoration: none; font-weight: 600; }
.diff td.is-empty { color: var(--ink-3); }
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; }
.badge::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--dot); }
.b-added { color: var(--add); --dot: var(--add); }
.b-removed { color: var(--del); --dot: var(--del); }
.b-modified { color: var(--mod); --dot: var(--mod); }
.b-same { color: var(--ink-3); --dot: var(--line-2); }
.diff .empty-row td { text-align: center; color: var(--ink-2); padding: 32px 12px; white-space: normal; }
.more { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 2px; font-size: 13.5px; color: var(--ink-2); }

/* ---------- Contenido ---------- */
.content { padding-top: 56px; padding-bottom: 56px; display: grid; gap: 18px; }
.content h2 { font-size: 21px; letter-spacing: -.01em; font-weight: 600; margin-top: 18px; }
.content p, .content li { color: var(--ink-2); max-width: 70ch; }
.content p + p { margin-top: 10px; }
.content__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
.content__grid h2 { margin: 0 0 12px; }
.steps { padding-left: 20px; display: grid; gap: 8px; }
.steps b { color: var(--ink); }
.faq { display: grid; border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); padding: 14px 0; }
.faq summary { cursor: pointer; font-weight: 500; }
.faq details p { margin-top: 8px; }
.limits { padding-left: 20px; display: grid; gap: 6px; }
.limits b { color: var(--ink); }
.uses { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.uses li { padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--sheet); display: grid; gap: 4px; max-width: none; }
.uses b { color: var(--ink); font-size: 15px; }
.uses span { font-size: 14px; }
code { font-family: var(--mono); font-size: 13px; padding: 1px 5px; border-radius: 4px; background: var(--sheet-2); color: var(--ink); overflow-wrap: anywhere; }

.foot { border-top: 1px solid var(--line); padding: 22px 0; font-size: 14px; color: var(--ink-2); }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .content__grid { grid-template-columns: 1fr; gap: 8px; }
}
@media (max-width: 640px) {
  .wrap { padding: 0 16px; }
  .top { padding: 0 16px; }
  .top__privacy span { display: none; }
  .top { gap: 10px; }
  .perks li { font-size: 13px; padding: 5px 10px 5px 8px; }
  .hero { padding-top: 26px; }
  .files { grid-template-columns: 1fr; gap: 12px; }
  .drop, .file__info { min-height: 0; }
  .drop { padding: 22px 16px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .toolbar__dl { margin-left: 0; width: 100%; }
  .toolbar__dl .btn--primary { flex: 1 1 100%; }
  .toolbar__dl .btn:not(.btn--primary) { flex: 1; }
  .search { max-width: none; }
  .field--inline { grid-template-columns: 1fr; }
  .table-wrap { max-height: 65vh; }
  .diff th, .diff td { max-width: 200px; padding: 6px 10px; }
}
