/* styles.css · vlookup-buscarv · 1000HW
 * Cache-bust: ?v=4
 * Vanilla CSS · mobile-first · paleta 1000HW (void/acid/concrete/structure)
 * WCAG 2.1 AA compliant · prefers-reduced-motion respetado
 *
 * Diseño: 4 modos (generador + parser + probador + export) + 5 funciones de búsqueda
 * (BUSCARV / BUSCARH / BUSCARX / INDICE+COINCIDIR / comodines) + bilingüe ES/EN.
 */

/* ============================================================
 * 0. CUSTOM PROPERTIES (design tokens)
 * ============================================================ */
:root {
  /* Paleta canónica 1000HW */
  --void:        #050505;
  --concrete:    #1A1A1E;
  --structure:   #2A2A30;
  --acid:        #CCFF00;
  --acid-dim:    #A8CC00;
  --softgray:    #9CA3AF;
  --text-light:  #E5E7EB;
  --text-mid:    #B5B7C0;
  --text-dim:    #8B8E98; /* V18 P2-WCAG: ratio 6.23:1 sobre #050505, AA PASS (antes #6B6E78 4.01:1) */
  --danger:      #FF6B6B;
  --warn:        #FFB74D;
  --success:     #4ADE80;
  --info:        #60A5FA;

  /* Tipografía */
  --font-display: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono:    'JetBrains Mono', 'SF Mono', Monaco, Consolas, monospace;
  --font-body:    'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  /* Espaciado */
  --space-1:  4px;
  --space-2:  8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;

  /* Otros */
  --radius-sm: 4px;
  --radius:    8px;
  --radius-lg: 14px;
  --shadow-md: 0 6px 22px rgba(0,0,0,0.45);
  --shadow-lg: 0 14px 50px rgba(0,0,0,0.55);

  /* Transiciones */
  --t-fast: 150ms cubic-bezier(.4,0,.2,1);
  --t-mid:  300ms cubic-bezier(.4,0,.2,1);
  --t-slow: 600ms cubic-bezier(.4,0,.2,1);
}

/* ============================================================
 * 1. RESET + BASE
 * ============================================================ */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  font-family: var(--font-body);
  background-color: var(--void);
  color: var(--text-light);
  line-height: 1.55;
  font-size: 16px;
  background-image:
    radial-gradient(circle at 20% 0%, rgba(204, 255, 0, 0.05) 0%, transparent 40%),
    radial-gradient(circle at 100% 100%, rgba(204, 255, 0, 0.03) 0%, transparent 40%);
  min-height: 100vh;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 var(--space-4);
  line-height: 1.2;
}

p { margin: 0 0 var(--space-4); }

a {
  color: var(--acid);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color var(--t-fast);
}
a:hover { color: var(--text-light); }
a:focus-visible {
  outline: 2px solid var(--acid);
  outline-offset: 2px;
  border-radius: 2px;
}

code {
  font-family: var(--font-mono);
  background: rgba(255,255,255,0.04);
  padding: 1px 6px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--acid);
}

pre {
  font-family: var(--font-mono);
  background: var(--void);
  border: 1px solid var(--structure);
  border-radius: var(--radius);
  padding: var(--space-3) var(--space-4);
  color: var(--acid);
  font-size: 14px;
  margin: 0;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
}

input, select, textarea {
  font-family: inherit;
  font-size: 14px;
  background-color: var(--void);
  border: 1px solid var(--structure);
  color: var(--text-light);
  padding: 8px 12px;
  border-radius: var(--radius);
  outline: none;
  transition: all var(--t-fast);
  min-height: 44px;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--acid);
  box-shadow: 0 0 0 2px rgba(204, 255, 0, 0.18);
}

textarea { resize: vertical; min-height: 80px; line-height: 1.5; }

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

/* ============================================================
 * 2. UTILIDADES + ACCESIBILIDAD
 * ============================================================ */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--acid);
  color: var(--void);
  padding: var(--space-3) var(--space-4);
  z-index: 100;
  font-family: var(--font-mono);
  font-size: 13px;
  text-decoration: none;
  font-weight: 700;
}
.skip-link:focus {
  left: var(--space-3);
  top: var(--space-3);
}

::selection { background: var(--acid); color: var(--void); }

/* ============================================================
 * 3. LAYOUT (container)
 * ============================================================ */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 var(--space-4);
}
@media (min-width: 768px) {
  .container { padding: 0 var(--space-5); }
}

/* ============================================================
 * 4. NAV
 * ============================================================ */
.nav {
  border-bottom: 1px solid var(--structure);
  background: rgba(5, 5, 5, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: var(--space-3) var(--space-4);
  position: sticky;
  top: 0;
  z-index: 40;
}
.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}
.nav-back {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--text-dim);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
}
.nav-back:hover { color: var(--acid); }
.nav-brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.04em;
  color: var(--text-light);
}
.nav-brand .brand-acid { color: var(--acid); }

/* ============================================================
 * 5. HERO
 * ============================================================ */
.hero {
  padding: var(--space-7) 0 var(--space-5);
  border-bottom: 1px solid var(--structure);
}
.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}
.tag {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  padding: 4px 10px;
  border: 1px solid var(--structure);
  color: var(--text-mid);
  background: var(--concrete);
  border-radius: var(--radius-sm);
}
.tag-acid {
  border-color: var(--acid);
  color: var(--acid);
  background: rgba(204, 255, 0, 0.08);
}
.tag-priv {
  border-color: var(--success);
  color: var(--success);
  background: rgba(74, 222, 128, 0.08);
}

.hero h1 {
  font-size: clamp(28px, 4vw, 44px);
  margin-bottom: var(--space-4);
}
.hero .accent { color: var(--acid); }
.hero-lede {
  font-size: clamp(16px, 1.5vw, 18px);
  color: var(--text-mid);
  max-width: 70ch;
  margin-bottom: var(--space-5);
}

.hero-disclaimer {
  background: rgba(204, 255, 0, 0.06);
  border-left: 3px solid var(--acid);
  padding: var(--space-4);
  border-radius: var(--radius);
  color: var(--text-light);
  max-width: 75ch;
  margin: 0;
  font-size: 14px;
}
.hero-disclaimer strong { color: var(--acid); }

/* ============================================================
 * 6. TOOL CARD + MODE TABS
 * ============================================================ */
.tool-section {
  padding: var(--space-6) 0;
}
.tool-card {
  background: var(--concrete);
  border: 1px solid var(--structure);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  box-shadow: var(--shadow-md);
}

.mode-tabs {
  display: flex;
  gap: var(--space-2);
  margin-bottom: var(--space-5);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--structure);
  overflow-x: auto;
}
.mode-tab {
  flex: 1 1 auto;
  min-width: 110px;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius);
  background: var(--void);
  border: 1px solid var(--structure);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  white-space: nowrap;
  min-height: 44px;
  transition: all var(--t-fast);
}
.mode-tab:hover { color: var(--text-mid); border-color: var(--text-mid); }
.mode-tab.active {
  border-color: var(--acid);
  color: var(--acid);
  background: rgba(204, 255, 0, 0.06);
}
.mode-tab:focus-visible {
  outline: 2px solid var(--acid);
  outline-offset: 2px;
}
.mode-tab-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--structure);
  color: var(--text-mid);
  font-size: 10px;
  font-weight: 700;
  flex-shrink: 0;
}
.mode-tab.active .mode-tab-num {
  background: var(--acid);
  color: var(--void);
}

.mode-panel {
  display: none;
  animation: fadeIn 250ms ease;
}
.mode-panel.active {
  display: block;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .mode-panel { animation: none; }
}

.panel-title {
  font-size: 22px;
  margin-bottom: var(--space-2);
  color: var(--text-light);
}
.panel-hint {
  color: var(--text-mid);
  font-size: 14px;
  margin-bottom: var(--space-5);
}

/* ============================================================
 * 7. DATA SECTION (CSV / TSV loader)
 * ============================================================ */
.data-section {
  background: var(--void);
  border: 1px solid var(--structure);
  border-radius: var(--radius);
  padding: var(--space-4);
  margin-bottom: var(--space-5);
}

.data-controls {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.dropzone {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  border: 2px dashed var(--structure);
  border-radius: var(--radius);
  padding: var(--space-5);
  background: rgba(255,255,255,0.02);
  color: var(--text-mid);
  cursor: pointer;
  transition: all var(--t-fast);
  min-height: 80px;
  text-align: center;
}
.dropzone:hover,
.dropzone:focus-visible {
  border-color: var(--acid);
  background: rgba(204, 255, 0, 0.04);
  color: var(--text-light);
  outline: none;
}
.dropzone.dragover {
  border-color: var(--acid);
  background: rgba(204, 255, 0, 0.08);
}
.dropzone-icon {
  font-size: 24px;
  flex-shrink: 0;
}
.dropzone-text {
  font-size: 14px;
  line-height: 1.4;
}

.data-row {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.data-label {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-mid);
}
.data-textarea,
.data-select {
  font-family: var(--font-mono);
  font-size: 13px;
}
.example-row {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
}
.example-row select { flex: 1 1 200px; }

.data-meta {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
  margin-left: var(--space-3);
}

/* Preview table */
.preview-wrap {
  margin-top: var(--space-4);
  max-height: 280px;
  overflow: auto;
  border: 1px solid var(--structure);
  border-radius: var(--radius);
  background: var(--void);
}
.preview-empty {
  padding: var(--space-5);
  text-align: center;
  color: var(--text-dim);
  font-size: 13px;
  margin: 0;
}
.preview-table table {
  border-collapse: collapse;
  width: 100%;
  font-size: 12px;
  font-family: var(--font-mono);
}
.preview-table th,
.preview-table td {
  padding: 6px 10px;
  text-align: left;
  border-bottom: 1px solid var(--structure);
  white-space: nowrap;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.preview-table th {
  background: var(--concrete);
  color: var(--acid);
  font-weight: 700;
  position: sticky;
  top: 0;
  z-index: 2;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 10px;
}
.preview-table tr:hover td {
  background: rgba(204, 255, 0, 0.04);
}
.preview-table .match-highlight {
  background: rgba(204, 255, 0, 0.18) !important;
  outline: 2px solid var(--acid);
  outline-offset: -2px;
}
.preview-table .match-row td {
  background: rgba(204, 255, 0, 0.06);
}

/* ============================================================
 * 8. FORM GRID (generator + tester + parser)
 * ============================================================ */
.form-grid {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  margin-bottom: var(--space-5);
}
.form-row {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.form-label {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-mid);
  font-weight: 700;
}
.form-input {
  font-family: var(--font-mono);
  font-size: 14px;
}
.form-hint {
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.4;
}

.parse-textarea {
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.5;
}

.parse-actions,
.export-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}

.checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 13px;
  color: var(--text-mid);
  cursor: pointer;
  min-height: 44px;
  padding: 0 var(--space-2);
}
.checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--acid);
}

/* ============================================================
 * 9. BUTTONS
 * ============================================================ */
.btn {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 10px 18px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--t-fast);
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  line-height: 1;
}
.btn:focus-visible {
  outline: 2px solid var(--acid);
  outline-offset: 2px;
}
.btn-primary {
  background: var(--acid);
  color: var(--void);
  border-color: var(--acid);
}
.btn-primary:hover { background: var(--acid-dim); border-color: var(--acid-dim); }
.btn-secondary {
  background: var(--concrete);
  color: var(--text-light);
  border-color: var(--structure);
}
.btn-secondary:hover {
  border-color: var(--acid);
  color: var(--acid);
}
.btn-ghost {
  background: transparent;
  color: var(--text-dim);
  border-color: var(--structure);
}
.btn-ghost:hover {
  color: var(--text-light);
  border-color: var(--text-mid);
}
.btn-mini {
  font-size: 10px;
  padding: 6px 12px;
  min-height: 32px;
  background: var(--concrete);
  color: var(--text-mid);
  border: 1px solid var(--structure);
  border-radius: var(--radius-sm);
}
.btn-mini:hover {
  color: var(--acid);
  border-color: var(--acid);
}
.btn[disabled],
.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

/* ============================================================
 * 10. OUTPUT BLOCK (formula preview)
 * ============================================================ */
.output-block {
  background: var(--void);
  border: 1px solid var(--structure);
  border-radius: var(--radius);
  padding: var(--space-3);
  margin-top: var(--space-4);
}
.output-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-2);
}
.output-label {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--text-dim);
}
.output-code {
  font-family: var(--font-mono);
  font-size: 16px;
  background: transparent;
  border: none;
  padding: var(--space-2) 0;
  color: var(--acid);
  white-space: pre-wrap;
  word-break: break-all;
  min-height: 40px;
}

/* ============================================================
 * 11. PARSE RESULT + TESTER RESULT + EXPORT RESULT
 * ============================================================ */
.parse-result,
.tester-result,
.export-result {
  background: var(--void);
  border: 1px solid var(--structure);
  border-radius: var(--radius);
  padding: var(--space-4);
  min-height: 100px;
}
.parse-empty,
.tester-empty,
.export-empty {
  text-align: center;
  color: var(--text-dim);
  font-size: 13px;
  margin: 0;
  padding: var(--space-4) 0;
}

.parse-args {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-3);
  margin-top: var(--space-3);
}
@media (min-width: 700px) {
  .parse-args { grid-template-columns: 1fr 1fr; }
}
.parse-arg {
  background: var(--concrete);
  border-left: 3px solid var(--acid);
  padding: var(--space-3);
  border-radius: var(--radius);
}
.parse-arg-name {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--acid);
  margin-bottom: 4px;
  font-weight: 700;
}
.parse-arg-value {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--text-light);
  background: var(--void);
  padding: var(--space-2);
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-2);
  word-break: break-all;
  overflow-wrap: anywhere;
}
.parse-arg-desc {
  font-size: 12px;
  color: var(--text-mid);
  line-height: 1.4;
}
.parse-translated {
  margin-top: var(--space-4);
  padding-top: var(--space-3);
  border-top: 1px solid var(--structure);
}
.parse-translated-label {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--text-dim);
  margin-bottom: var(--space-2);
}

.parse-error,
.tester-error {
  border-left: 3px solid var(--danger);
  background: rgba(255, 107, 107, 0.06);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius);
  color: var(--danger);
  font-size: 14px;
  margin-top: var(--space-3);
}
.parse-error-code,
.tester-error-code {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 16px;
  margin-bottom: var(--space-1);
}
.parse-error-fix,
.tester-error-fix {
  color: var(--text-mid);
  font-size: 13px;
  line-height: 1.5;
}

.tester-result-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: var(--space-3);
  font-family: var(--font-mono);
  font-size: 13px;
}
.tester-result-table th,
.tester-result-table td {
  padding: 8px 12px;
  text-align: left;
  border-bottom: 1px solid var(--structure);
}
.tester-result-table th {
  color: var(--acid);
  font-weight: 700;
  background: var(--concrete);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.tester-result-table tr:hover td {
  background: rgba(204, 255, 0, 0.04);
}
.tester-result-table .matched {
  color: var(--success);
  font-weight: 700;
}
.tester-result-table .not-matched {
  color: var(--danger);
}

.tester-summary {
  display: flex;
  gap: var(--space-4);
  flex-wrap: wrap;
  margin-bottom: var(--space-3);
  font-size: 13px;
  color: var(--text-mid);
}
.tester-summary-item strong {
  color: var(--acid);
  font-family: var(--font-mono);
  font-weight: 700;
  margin-right: 4px;
}

/* ============================================================
 * 12. GLOSARIO DE ERRORES
 * ============================================================ */
.glossary {
  margin-top: var(--space-6);
  background: var(--concrete);
  border: 1px solid var(--structure);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  box-shadow: var(--shadow-md);
}
.section-title {
  font-size: 22px;
  margin-bottom: var(--space-2);
}
.section-hint {
  color: var(--text-mid);
  font-size: 14px;
  margin-bottom: var(--space-4);
}
.glossary-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-3);
}
@media (min-width: 700px) {
  .glossary-grid { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 1000px) {
  .glossary-grid { grid-template-columns: 1fr 1fr 1fr; }
}
.glossary-item {
  background: var(--void);
  border: 1px solid var(--structure);
  border-left: 3px solid var(--danger);
  padding: var(--space-3);
  border-radius: var(--radius);
}
.glossary-code {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--danger);
  font-size: 16px;
  margin-bottom: var(--space-1);
}
.glossary-title {
  font-weight: 700;
  font-size: 14px;
  color: var(--text-light);
  margin-bottom: var(--space-2);
}
.glossary-desc {
  font-size: 12px;
  color: var(--text-mid);
  line-height: 1.5;
  margin-bottom: var(--space-2);
}
.glossary-fix {
  font-size: 12px;
  color: var(--text-light);
  background: var(--concrete);
  padding: var(--space-2);
  border-radius: var(--radius-sm);
  line-height: 1.5;
}
.glossary-fix-label {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--success);
  font-weight: 700;
  display: block;
  margin-bottom: 4px;
}

/* ============================================================
 * 13. ADSENSE SECTION
 * ============================================================ */
.ad-section {
  padding: var(--space-5) 0;
  border-top: 1px solid var(--structure);
  border-bottom: 1px solid var(--structure);
  margin: var(--space-6) 0;
  background: rgba(255, 255, 255, 0.02);
}
.ad-section .container {
  min-height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ============================================================
 * 14. CONTENT SECTIONS (long content)
 * ============================================================ */
.content-section {
  padding: var(--space-6) 0 var(--space-7);
  border-top: 1px solid var(--structure);
}
.content-section h2 {
  font-size: clamp(22px, 3vw, 28px);
  margin-top: var(--space-6);
  margin-bottom: var(--space-4);
  color: var(--text-light);
}
.content-section h2:first-child {
  margin-top: 0;
}
.content-section p,
.content-section li {
  color: var(--text-mid);
  font-size: 15px;
  line-height: 1.7;
}
.content-section strong {
  color: var(--text-light);
}
.content-list {
  margin: 0 0 var(--space-4);
  padding-left: var(--space-5);
}
.content-list li {
  margin-bottom: var(--space-2);
}

.funcs-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
  margin-bottom: var(--space-5);
}
@media (min-width: 700px) {
  .funcs-grid { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 1000px) {
  .funcs-grid { grid-template-columns: 1fr 1fr 1fr; }
}
.func-card {
  background: var(--concrete);
  border: 1px solid var(--structure);
  border-radius: var(--radius);
  padding: var(--space-4);
}
.func-card h3 {
  font-size: 16px;
  margin-bottom: var(--space-2);
  color: var(--acid);
}
.func-card p {
  font-size: 13px;
  color: var(--text-mid);
  margin-bottom: var(--space-3);
}
.func-syntax {
  display: block;
  font-size: 12px;
  padding: var(--space-2);
  background: var(--void);
  border-radius: var(--radius-sm);
  white-space: pre-wrap;
  word-break: break-all;
  overflow-wrap: anywhere;
}

/* ============================================================
 * 15. CALLOUT (limitaciones + warnings)
 * ============================================================ */
.callout {
  border-radius: var(--radius);
  padding: var(--space-4);
  margin: var(--space-5) 0;
}
.callout-warn {
  background: rgba(255, 183, 77, 0.06);
  border-left: 3px solid var(--warn);
}
.callout h3 {
  color: var(--warn);
  margin-bottom: var(--space-3);
  font-size: 18px;
}
.callout ul {
  margin: 0;
  padding-left: var(--space-5);
}
.callout li {
  color: var(--text-mid);
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: var(--space-2);
}
.callout strong {
  color: var(--text-light);
}

/* ============================================================
 * 16. FAQ
 * ============================================================ */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-bottom: var(--space-5);
}
.faq-item {
  background: var(--concrete);
  border: 1px solid var(--structure);
  border-radius: var(--radius);
  padding: var(--space-3) var(--space-4);
}
.faq-item summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--text-light);
  font-size: 15px;
  padding: var(--space-2) 0;
  outline: none;
}
.faq-item summary::-webkit-details-marker { color: var(--acid); }
.faq-item summary::marker { color: var(--acid); }
.faq-item[open] summary {
  margin-bottom: var(--space-2);
  color: var(--acid);
}
.faq-item p {
  margin: 0;
  padding-top: var(--space-2);
  font-size: 14px;
  color: var(--text-mid);
  line-height: 1.6;
}

/* ============================================================
 * 17. FOOTER + DISCLAIMER
 * ============================================================ */
.footer-disclaimer {
  background: rgba(204, 255, 0, 0.06);
  border-left: 3px solid var(--acid);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius);
  font-size: 13px;
  color: var(--text-mid);
  margin-top: var(--space-5);
  margin-bottom: var(--space-4);
}
.site-footer {
  border-top: 1px solid var(--structure);
  padding: var(--space-5) 0;
  background: rgba(0,0,0,0.3);
  text-align: center;
}
.site-footer p {
  margin: 0;
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.7;
}
.site-footer a {
  color: var(--text-mid);
  text-decoration: none;
}
.site-footer a:hover { color: var(--acid); }
.footer-brand {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--text-light);
}
.footer-meta {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  margin-top: var(--space-2) !important;
  text-transform: uppercase;
}

/* ============================================================
 * 18. OFFLINE BANNER
 * ============================================================ */
.offline-banner {
  position: fixed;
  top: 70px;
  left: 50%;
  transform: translateX(-50%) translateY(-200%);
  background: var(--concrete);
  border: 1px solid var(--success);
  border-left: 3px solid var(--success);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius);
  color: var(--text-light);
  font-size: 13px;
  z-index: 50;
  box-shadow: var(--shadow-md);
  max-width: calc(100% - 32px);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  transition: transform var(--t-mid);
}
.offline-banner.visible {
  transform: translateX(-50%) translateY(0);
}
.offline-banner-icon {
  color: var(--success);
  font-size: 16px;
  font-weight: 700;
  flex-shrink: 0;
}
.offline-banner-text {
  flex: 1;
  line-height: 1.4;
}
.offline-banner-close {
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 20px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all var(--t-fast);
}
.offline-banner-close:hover { color: var(--text-light); background: rgba(255,255,255,0.05); }
.offline-banner-close:focus-visible {
  outline: 2px solid var(--acid);
  outline-offset: 2px;
}

/* ============================================================
 * 19. DONATION TOAST
 * ============================================================ */
.donation-toast {
  position: fixed;
  bottom: var(--space-4);
  right: var(--space-4);
  background: var(--concrete);
  border: 1px solid var(--structure);
  border-left: 3px solid var(--acid);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  z-index: 50;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  max-width: 380px;
  transform: translateY(200%);
  opacity: 0;
  transition: transform var(--t-mid), opacity var(--t-mid);
}
.donation-toast.visible {
  transform: translateY(0);
  opacity: 1;
}
.donation-toast-icon {
  color: var(--acid);
  font-size: 24px;
  flex-shrink: 0;
}
.donation-toast-content {
  flex: 1;
  min-width: 0;
}
.donation-toast-title {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  color: var(--text-light);
  margin: 0 0 2px;
}
.donation-toast-subtitle {
  font-size: 12px;
  color: var(--text-mid);
  line-height: 1.4;
  margin: 0;
  max-width: 280px;
}
.donation-toast-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--acid);
  color: var(--void);
  text-decoration: none;
  padding: 8px 16px;
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  min-height: 44px;
  flex-shrink: 0;
  transition: background var(--t-fast);
}
.donation-toast-btn:hover { background: var(--acid-dim); }
.donation-toast-btn:focus-visible {
  outline: 2px solid var(--acid);
  outline-offset: 2px;
}
.donation-toast-close {
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
  transition: all var(--t-fast);
}
.donation-toast-close:hover { color: var(--text-light); background: rgba(255,255,255,0.05); }
.donation-toast-close:focus-visible {
  outline: 2px solid var(--acid);
  outline-offset: 2px;
}

@media (max-width: 480px) {
  .donation-toast {
    bottom: var(--space-3);
    right: var(--space-3);
    left: var(--space-3);
    max-width: none;
  }
  .donation-toast-subtitle { max-width: none; }
  .offline-banner {
    left: var(--space-3);
    right: var(--space-3);
    transform: translateX(0) translateY(-200%);
    max-width: none;
    width: auto;
    padding: var(--space-3) var(--space-4);
    font-size: 12px;
    line-height: 1.3;
  }
  .offline-banner.visible {
    transform: translateX(0) translateY(0);
  }
  .offline-banner-text {
    line-height: 1.3;
  }
}

/* ============================================================
 * 20. A11Y + FOCUS
 * ============================================================ */
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible,
[tabindex]:focus-visible,
details:focus-visible summary {
  outline: 2px solid var(--acid);
  outline-offset: 2px;
}

/* ============================================================
 * 21. PREFERS-REDUCED-MOTION
 * ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .offline-banner,
  .donation-toast {
    transition: none !important;
  }
}

/* ============================================================
 * 22. LANG SWITCH (ES/EN)
 * ============================================================ */
.lang-switch {
  display: inline-flex;
  gap: 2px;
  align-items: center;
  background: var(--concrete);
  border: 1px solid var(--structure);
  border-radius: var(--radius);
  padding: 2px;
}
.lang-btn {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  padding: 4px 10px;
  min-height: 32px;
  min-width: 36px;
  border: none;
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all var(--t-fast);
}
.lang-btn:hover { color: var(--text-light); }
.lang-btn[aria-pressed="true"] {
  background: var(--acid);
  color: var(--void);
}
.lang-btn:focus-visible {
  outline: 2px solid var(--acid);
  outline-offset: 2px;
}

/* ============================================================
 * 23. TOAST MSG (info/success/error durante uso)
 * ============================================================ */
.toast-msg {
  position: fixed;
  top: 70px;
  left: 50%;
  transform: translateX(-50%) translateY(-200%);
  background: var(--concrete);
  border: 1px solid var(--structure);
  border-left: 3px solid var(--info);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius);
  color: var(--text-light);
  font-size: 14px;
  z-index: 60;
  box-shadow: var(--shadow-md);
  max-width: calc(100% - 32px);
  transition: transform var(--t-mid);
}
.toast-msg.visible {
  transform: translateX(-50%) translateY(0);
}
.toast-msg.success { border-left-color: var(--success); }
.toast-msg.error { border-left-color: var(--danger); }
.toast-msg.warn { border-left-color: var(--warn); }

/* ============================================================
 * 24. MOBILE TWEAKS
 * ============================================================ */
@media (max-width: 600px) {
  .mode-tabs {
    flex-direction: column;
    gap: var(--space-1);
  }
  .mode-tab {
    font-size: 10px;
    width: 100%;
  }
  .tool-card {
    padding: var(--space-3);
  }
  .form-grid {
    gap: var(--space-3);
  }
  .parse-actions,
  .export-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .parse-actions .btn,
  .export-actions .btn {
    width: 100%;
  }
  .data-row .btn {
    align-self: flex-start;
  }
  .preview-table th,
  .preview-table td {
    padding: 4px 8px;
    font-size: 11px;
  }
  .funcs-grid,
  .glossary-grid {
    grid-template-columns: 1fr;
  }
}

/* ============================================================
 * 25. PRINT
 * ============================================================ */
@media print {
  body { background: white; color: black; }
  .nav, .hero-disclaimer, .tool-section, .callout, .offline-banner, .donation-toast,
  footer, .ad-section, .preview-wrap { display: none; }
  .content-section { color: black; }
  .content-section h2, .content-section h3, .content-section p, .content-section li { color: black; }
}