/* ---------- Tokens ---------- */
:root {
  --bg: #eaeff1; --sheet: #ffffff; --sheet-2: #f3f6f7;
  --ink: #132026; --ink-2: #44555c; --ink-3: #5a6a71;
  --line: #d6dfe2; --line-2: #b9c6cb;
  --accent: #0b6a6a; --accent-ink: #ffffff; --accent-soft: #d7eeec; --accent-hover: #08585a;
  --tab: #f5cf3f; --tab-ink: #2a2306; --tab-edge: #d9b21f;
  --danger: #b3261e; --danger-soft: #fdecea; --ok: #1d6b3a; --ok-soft: #e1f3e7;
  --shadow: 0 1px 2px rgba(19,32,38,.06), 0 12px 32px -18px rgba(19,32,38,.35);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --display: "Bricolage Grotesque", var(--font);
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1619; --sheet: #162227; --sheet-2: #1c2a30;
    --ink: #e4edf0; --ink-2: #a9bac0; --ink-3: #93a5ac;
    --line: #26363c; --line-2: #36494f;
    --accent: #52c6bd; --accent-ink: #04201e; --accent-soft: #143331; --accent-hover: #74d6ce;
    --tab: #e2bf3a; --tab-ink: #221b02; --tab-edge: #b8981f;
    --danger: #ff8a80; --danger-soft: #3a1c1a; --ok: #7bd59b; --ok-soft: #173525;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 12px 32px -18px rgba(0,0,0,.8);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0e1619; --sheet: #162227; --sheet-2: #1c2a30;
  --ink: #e4edf0; --ink-2: #a9bac0; --ink-3: #93a5ac;
  --line: #26363c; --line-2: #36494f;
  --accent: #52c6bd; --accent-ink: #04201e; --accent-soft: #143331; --accent-hover: #74d6ce;
  --tab: #e2bf3a; --tab-ink: #221b02; --tab-edge: #b8981f;
  --danger: #ff8a80; --danger-soft: #3a1c1a; --ok: #7bd59b; --ok-soft: #173525;
  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: 16px; line-height: 1.55; min-height: 100dvh; display: flex; flex-direction: column; }
h1, h2, h3, p, ol, ul, figure { margin: 0; }
button, input, select, textarea { 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: 650; }
small { font-size: 14px; color: var(--ink-2); }
.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: 1120px; 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: 16px 24px; max-width: 1120px; margin: 0 auto; width: 100%; }
.brand { display: inline-flex; align-items: center; gap: 9px; color: var(--ink); text-decoration: none; font-family: var(--display); font-weight: 700; font-size: 19px; letter-spacing: -.01em; }
.brand svg { color: var(--accent); }
.top__privacy { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--ink-2); }
.lang { display: flex; border: 1px solid var(--line-2); border-radius: 999px; overflow: hidden; }
.lang a { padding: 4px 11px; font-size: 13px; font-weight: 600; text-decoration: none; color: var(--ink-2); }
.lang a[aria-current="page"] { background: var(--ink); color: var(--bg); }
@media (max-width: 640px) { .top__privacy { display: none; } .lang { margin-left: auto; } .top { padding: 14px 16px; } }

/* ---------- Hero ---------- */
.hero { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 48px; align-items: center; padding-top: 28px; padding-bottom: 36px; }
.hero h1 { font-family: var(--display); font-weight: 700; font-size: clamp(32px, 4.6vw, 52px); line-height: 1.04; letter-spacing: -.025em; text-wrap: balance; }
.lede { margin-top: 16px; font-size: 18px; color: var(--ink-2); max-width: 34em; }
.perks { list-style: none; padding: 0; margin-top: 22px; display: flex; flex-wrap: wrap; gap: 8px; }
.perks li { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px 5px 9px; border-radius: 999px; background: var(--sheet); border: 1px solid var(--line); font-size: 14px; font-weight: 550; }
.perks svg { color: var(--accent); flex: none; }

/* Ilustración: tarjeta de contacto ↔ fila de hoja de cálculo */
.duo { position: relative; display: grid; gap: 14px; }
.vcard-ill { background: var(--sheet); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); padding: 18px 20px; display: grid; grid-template-columns: 52px 1fr; gap: 4px 14px; max-width: 360px; transform: rotate(-2deg); }
.vcard-ill__av { grid-row: span 3; width: 52px; height: 52px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-family: var(--display); font-weight: 700; font-size: 20px; }
.vcard-ill__name { font-family: var(--display); font-weight: 700; font-size: 18px; line-height: 1.2; }
.vcard-ill__line { font-size: 14px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.duo__arrows { display: flex; align-items: center; gap: 10px; padding-left: 36px; color: var(--ink-3); font-size: 13px; font-weight: 600; }
.sheet-ill { background: var(--sheet); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); overflow: hidden; font-size: 13px; justify-self: end; width: min(100%, 420px); }
.sheet-ill table { border-collapse: collapse; width: 100%; table-layout: fixed; }
.sheet-ill th, .sheet-ill td { border: 1px solid var(--line); padding: 5px 8px; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sheet-ill th { background: var(--sheet-2); color: var(--ink-2); font-weight: 600; }
.sheet-ill tr:first-child th { border-top: 0; }
.sheet-ill td:first-child, .sheet-ill th:first-child { width: 28px; text-align: center; color: var(--ink-3); background: var(--sheet-2); font-weight: 500; }
.sheet-ill .hl td:not(:first-child) { background: var(--accent-soft); }
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; gap: 28px; padding-top: 12px; }
  .duo { display: none; }
}

/* ---------- Herramienta ---------- */
.tool { position: relative; }
.tabs { display: flex; gap: 6px; padding-left: 18px; position: relative; z-index: 1; }
.tab { border: 1px solid var(--line-2); border-bottom: 0; background: var(--sheet-2); color: var(--ink-2); padding: 11px 20px 10px; border-radius: 12px 12px 0 0; font-weight: 650; font-size: 16px; display: inline-flex; align-items: center; gap: 8px; margin-bottom: -1px; }
.tab:hover { color: var(--ink); }
.tab[aria-selected="true"] { background: var(--tab); color: var(--tab-ink); border-color: var(--tab-edge); }
.tab__fmt { font-family: var(--display); font-weight: 700; letter-spacing: -.01em; }
.tab svg { flex: none; }
.panel { background: var(--sheet); border: 1px solid var(--line-2); border-top: 4px solid var(--tab); border-radius: 16px; box-shadow: var(--shadow); padding: 24px; }
@media (max-width: 640px) {
  .wrap { padding: 0 16px; }
  .tabs { padding-left: 8px; gap: 4px; }
  .tab { padding: 10px 12px 9px; font-size: 15px; }
  .panel { padding: 16px; border-radius: 14px; }
}

.drop { display: grid; justify-items: center; text-align: center; gap: 6px; padding: 34px 20px; border: 2px dashed var(--line-2); border-radius: 12px; background: var(--sheet-2); 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__icon { color: var(--accent); }
.drop__title { font-family: var(--display); font-weight: 700; font-size: 20px; letter-spacing: -.01em; }
.drop__hint { font-size: 14px; color: var(--ink-2); }
.alt { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: center; font-size: 15px; color: var(--ink-2); }
.link { background: none; border: 0; padding: 0; color: var(--accent); text-decoration: underline; text-underline-offset: 2px; font-weight: 600; }
.paste { margin-top: 14px; display: grid; gap: 8px; }
.paste textarea { width: 100%; min-height: 140px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--sheet); padding: 10px 12px; font-family: var(--mono); font-size: 13px; resize: vertical; }
.paste__actions { display: flex; gap: 10px; flex-wrap: wrap; }

.status { margin-top: 12px; font-size: 15px; min-height: 0; }
.status:empty { display: none; }
.status--error { color: var(--danger); background: var(--danger-soft); padding: 10px 14px; border-radius: 10px; }
.status--ok { color: var(--ok); background: var(--ok-soft); padding: 10px 14px; border-radius: 10px; }
.status--busy { color: var(--ink-2); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: 10px; border: 1px solid transparent; padding: 10px 18px; font-weight: 650; font-size: 15px; line-height: 1.2; text-decoration: none; }
.btn--primary { background: var(--accent); color: var(--accent-ink); }
.btn--primary:hover { background: var(--accent-hover); }
.btn--ghost { background: transparent; border-color: var(--line-2); color: var(--ink); }
.btn--ghost:hover { background: var(--sheet-2); }
.btn--sm { padding: 6px 12px; font-size: 14px; }
.btn[disabled] { opacity: .55; cursor: progress; }

/* Resultado y configuración */
.result { display: grid; gap: 18px; }
.result__head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.result__title { font-family: var(--display); font-weight: 700; font-size: 22px; letter-spacing: -.01em; }
.result__meta { font-size: 14px; color: var(--ink-2); }
.result__head .btn--ghost { margin-left: auto; }
.opts { display: flex; flex-wrap: wrap; gap: 14px 22px; align-items: end; padding: 16px; background: var(--sheet-2); border-radius: 12px; border: 1px solid var(--line); }
.field { display: grid; gap: 5px; min-width: 0; }
.field > label, .field__label { font-size: 14px; font-weight: 600; color: var(--ink-2); }
.field select, .field input[type="text"] { border: 1px solid var(--line-2); border-radius: 8px; background: var(--sheet); padding: 8px 10px; min-width: 0; max-width: 100%; }
.field input[type="text"] { width: 110px; }
.field small { font-size: 13px; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 15px; cursor: pointer; }
.check input { width: 17px; height: 17px; accent-color: var(--accent); margin: 0; flex: none; }
.dl-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.dl-row .btn--primary { padding: 12px 22px; font-size: 16px; }

.preview { border: 1px solid var(--line); border-radius: 10px; overflow: auto; max-height: 460px; background: var(--sheet); }
.preview table { border-collapse: separate; border-spacing: 0; font-size: 14px; min-width: 100%; }
.preview th, .preview td { padding: 6px 10px; border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); text-align: left; white-space: nowrap; max-width: 280px; overflow: hidden; text-overflow: ellipsis; vertical-align: top; }
.preview th { position: sticky; top: 0; background: var(--sheet-2); font-weight: 600; color: var(--ink-2); z-index: 1; }
.preview td.num, .preview th.num { color: var(--ink-3); text-align: right; font-variant-numeric: tabular-nums; position: sticky; left: 0; background: var(--sheet-2); }
.preview th.num { z-index: 2; }
.preview__note { font-size: 13px; color: var(--ink-3); }

.mapping { display: grid; gap: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.map-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) minmax(170px, 220px); gap: 12px; align-items: center; padding: 9px 14px; border-bottom: 1px solid var(--line); }
.map-row:last-child { border-bottom: 0; }
.map-row--head { background: var(--sheet-2); font-size: 13px; font-weight: 600; color: var(--ink-2); padding-top: 7px; padding-bottom: 7px; }
.map-row__col { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.map-row__sample { font-size: 14px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.map-row select { width: 100%; border: 1px solid var(--line-2); border-radius: 8px; background: var(--sheet); padding: 7px 8px; }
.map-row.is-ignored .map-row__col, .map-row.is-ignored .map-row__sample { opacity: .55; }
@media (max-width: 640px) {
  .map-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .map-row__sample { grid-column: 1 / -1; grid-row: 2; }
  .map-row--head .map-row__sample { display: none; }
}
.vcf-out { margin: 0; font-family: var(--mono); font-size: 12.5px; line-height: 1.5; background: var(--sheet-2); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; max-height: 260px; overflow: auto; white-space: pre; }
.subhead { font-family: var(--display); font-weight: 700; font-size: 17px; }

/* ---------- Contenido ---------- */
.content { padding-top: 64px; padding-bottom: 24px; display: grid; gap: 52px; }
.content section { max-width: 760px; }
.content h2 { font-family: var(--display); font-weight: 700; font-size: clamp(24px, 3vw, 30px); letter-spacing: -.02em; line-height: 1.15; margin-bottom: 14px; }
.content h3 { font-size: 17px; font-weight: 650; margin: 18px 0 6px; }
.content p + p { margin-top: 10px; }
.content p, .content li { color: var(--ink-2); }
.content ol, .content ul { padding-left: 22px; display: grid; gap: 6px; }
.content strong { color: var(--ink); }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; max-width: none !important; }
.split > div { background: var(--sheet); border: 1px solid var(--line); border-radius: 14px; padding: 20px 22px; }
.split h2 { font-size: 22px; }
@media (max-width: 760px) { .split { grid-template-columns: 1fr; } }
.faq details { border-bottom: 1px solid var(--line-2); padding: 14px 0; }
.faq summary { font-weight: 650; cursor: pointer; list-style: none; display: flex; justify-content: space-between; gap: 16px; color: var(--ink); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-family: var(--display); font-size: 22px; line-height: 1; color: var(--accent); }
.faq details[open] summary::after { content: "–"; }
.faq details p { margin-top: 8px; }

/* ---------- Pie ---------- */
.foot { margin-top: 48px; border-top: 1px solid var(--line-2); padding: 28px 0 36px; font-size: 14px; color: var(--ink-2); }
.foot__grid { display: flex; flex-wrap: wrap; gap: 12px 28px; justify-content: space-between; }
.foot ul { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 18px; }
.foot__title { font-weight: 650; color: var(--ink); margin-bottom: 6px; }
.muted { color: var(--ink-3); font-weight: 400; }
