/* ═══════════════════════════════════════════════════════════════
   HTML to Elementor · dirección «Diccionario» (oct 2026)
   Se carga después de styles.css y sobrescribe sus tokens.
   Idea: la tabla de equivalencias del motor se convierte en un
   diccionario HTML → Elementor. La herramienta vive en un campo
   carbón (el editor); el resto es papel y tinta. El coral solo
   marca la acción principal y el punto del logo.
   ═══════════════════════════════════════════════════════════════ */

:root {
    /* Papel y tinta */
    --bg-primary:     #FAFAF8;   /* papel */
    --bg-secondary:   #EFEEEA;   /* papel en sombra: separa secciones por tono */
    --bg-card:        #FFFFFF;
    --text-primary:   #161616;   /* tinta */
    --text-secondary: #46443F;   /* tinta suave, solo para notas */
    --text-muted:     #75726B;
    --border:         #DEDCD6;

    /* Campo del editor */
    --editor:        #1C1C1C;
    --editor-2:      #242424;
    --editor-line:   #383838;
    --editor-text:   #EEEDE9;
    --editor-sub:    #B5B2AB;

    /* Señal: lo que queda nativo */
    --ok:            #2C7D51;

    /* Forma: esquinas cuadradas en todo, sin sombras en reposo */
    --radius:    0px;
    --radius-lg: 0px;
    --shadow:    none;

    --f-sans: "Archivo", "Helvetica Neue", Arial, sans-serif;
    --f-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
}
[data-theme="dark"] {
    --bg-primary:     #181817;
    --bg-secondary:   #111110;
    --bg-card:        #1F1F1E;
    --text-primary:   #EEEDE9;
    --text-secondary: #B5B2AB;
    --text-muted:     #8C8981;
    --border:         #34332F;
    --editor:         #0E0E0E;
    --editor-2:       #161616;
    --editor-line:    #2E2E2E;
    --ok:             #5DBE89;
    --shadow:         none;
}

body { font-family: var(--f-sans); }
code, pre, kbd, textarea { font-family: var(--f-mono); }
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ── Cabecera ─────────────────────────────────────────────────── */
.header { box-shadow: none; }
.logo h1 { font-weight: 800; font-stretch: 112%; letter-spacing: -0.01em; }

/* ── Botones ──────────────────────────────────────────────────── */
.btn-primary { box-shadow: none; }
.btn-primary:hover { box-shadow: none; }
.btn-secondary { border-width: 1px; }
.mode-btn.active { box-shadow: none; }

/* ═══ Campo del editor: titular + herramienta ═══════════════════ */
.main-content:has(> .tool-band) { padding-top: 0; }
.tool-band {
    background: var(--editor);
    color: var(--editor-text);
    padding-block: clamp(2.25rem, 5vw, 4rem) clamp(2rem, 4vw, 3.5rem);
}
.tool-band .hero { text-align: left; margin-bottom: clamp(1.25rem, 3vw, 2rem); }
.tool-band .hero h2 {
    color: #FFFFFF;
    font-size: clamp(2.1rem, 5.4vw, 4.6rem);
    line-height: 0.96;
    font-weight: 800;
    font-stretch: 116%;
    letter-spacing: -0.015em;
    max-width: 17ch;
    text-wrap: balance;
    margin-bottom: 0.9rem;
}
.tool-band .subtitle { color: #D9D6CF; font-size: 1.1rem; max-width: 58ch; line-height: 1.5; }

.tool { border: 1px solid var(--editor-line); background: var(--editor-2); }
.tool-bar {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
    gap: 0.6rem 1rem; padding: 0.6rem 0.75rem 0.6rem 1rem;
    border-bottom: 1px solid var(--editor-line);
}
.tool-title { font-weight: 700; font-size: 0.95rem; color: var(--editor-text); }
.tool-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }

.tool .input-mode-toggle,
.tool .output-mode-toggle { background: transparent; border-color: var(--editor-line); }
.tool .mode-btn { color: var(--editor-sub); }
.tool .mode-btn:hover { color: var(--editor-text); }
.tool .mode-btn.active { background: var(--editor-text); color: var(--editor); }
.tool .btn-secondary { background: transparent; color: var(--editor-text); border: 1px solid var(--editor-line); }
.tool .btn-secondary:hover { background: transparent; border-color: var(--editor-text); }

.tool-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); }
.tool #htmlInput {
    background: var(--editor);
    color: var(--editor-text);
    border: 0;
    border-right: 1px solid var(--editor-line);
    border-radius: 0;
    min-height: 320px;
    padding: 1.1rem 1.25rem;
    font-size: 0.86rem;
    line-height: 1.6;
    caret-color: var(--primary);
    box-shadow: none;
}
.tool #htmlInput::placeholder { color: #8E8B84; }
.tool #htmlInput:focus { outline: 2px solid var(--primary); outline-offset: -2px; box-shadow: none; border-color: var(--editor-line); background: var(--editor); }

.live-tree { padding: 1rem 1.15rem 1.25rem; min-width: 0; max-height: 360px; overflow: auto; }
.live-tree__head {
    display: flex; justify-content: space-between; align-items: baseline; gap: 1rem;
    font-weight: 700; font-size: 0.9rem; color: var(--editor-text); margin-bottom: 0.85rem;
}
.live-tree__tag { font-weight: 500; font-size: 0.82rem; color: var(--editor-sub); }
.live-tree__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.35rem; font-family: var(--f-mono); font-size: 0.82rem; }
.live-tree__list li { display: flex; gap: 0.75rem; padding-left: calc(var(--d, 0) * 1.15rem); white-space: nowrap; min-width: 0; }
.lt-name { color: var(--editor-text); }
.lt-name.is-container { color: var(--primary); }
.lt-name.is-fallback { color: var(--editor-sub); }
.lt-meta { color: var(--editor-sub); overflow: hidden; text-overflow: ellipsis; }
.lt-note { color: var(--editor-sub); white-space: normal !important; font-family: var(--f-sans); font-size: 0.88rem; }

.tool .input-footer { background: transparent; border-top: 1px solid var(--editor-line); border-radius: 0; padding: 0.65rem 0.75rem 0.65rem 1rem; }
.tool .info-bar { color: var(--editor-sub); }
.tool #btnAnalyze {
    background: var(--primary);
    color: #161616;
    font-weight: 800;
    font-stretch: 108%;
    padding: 0.8rem 1.5rem;
}
.tool #btnAnalyze:hover { background: #FF956E; }
.tool #btnAnalyze .btn-spinner { border-color: rgba(22,22,22,.25); border-top-color: #161616; }

/* Pastillas de información sobre el carbón */
.tool .ibar-pill, .tool .ibar-row > * { background: transparent; border-color: var(--editor-line); color: var(--editor-sub); }

@media (max-width: 760px) {
    .tool-grid { grid-template-columns: 1fr; }
    .tool #htmlInput { border-right: 0; border-bottom: 1px solid var(--editor-line); min-height: 0; }
    .live-tree { max-height: 220px; }
}
@media (max-width: 640px) {
    .main-content:has(> .tool-band) { padding-top: 0; }
    .tool-band .hero h2 { font-size: 2.15rem; font-stretch: 104%; line-height: 1; }
    .tool-band .subtitle { font-size: 1rem; }
    .tool-bar { padding: 0.6rem; }
    .tool-actions { width: 100%; }
    .tool-actions .input-mode-toggle { width: 100%; }
    .tool-actions .input-mode-toggle .mode-btn { flex: 1; }
    .tool-actions .btn-small { flex: 1; }
    .tool #htmlInput { height: 160px; }
    .live-tree { max-height: 170px; padding: 0.8rem 0.9rem; }
    .tool .input-footer { flex-wrap: wrap; padding: 0.6rem; }
    .tool .output-mode-toggle { width: 100%; }
    .tool .output-mode-toggle .mode-btn { flex: 1; }
    .tool #btnAnalyze { width: 100%; justify-content: center; }
}

/* Resultados bajo el campo del editor: sin hueco mientras no hay resultados */
.main-content:has(> .tool-band) { padding-bottom: 0; }
.main-content > .tool-band + .container { padding-block: 0; }
.main-content > .tool-band + .container:has(> section:not([style*="display: none"])) { padding-block: 2rem; }
.card { box-shadow: none; }

/* ═══ Diccionario ═══════════════════════════════════════════════ */
.dict { background: var(--bg-primary); padding-block: clamp(4.5rem, 9vw, 8rem); }
.dict .container {
    display: grid;
    grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.6fr);
    gap: clamp(2rem, 5vw, 5.5rem);
    align-items: start;
}
.dict-intro { position: sticky; top: 6.5rem; }
.dict h2, .howto h2 {
    font-size: clamp(2rem, 4.2vw, 3.4rem);
    line-height: 1;
    font-weight: 800;
    font-stretch: 116%;
    letter-spacing: -0.012em;
    color: var(--text-primary);
    text-wrap: balance;
    max-width: 14ch;
    margin-bottom: 1.25rem;
}
.dict-intro p { font-size: 1.05rem; line-height: 1.65; color: var(--text-primary); max-width: 44ch; margin-bottom: 1rem; }
.dict-intro p + p { color: var(--text-secondary); font-size: 0.98rem; }

.dict-list { margin: 0; display: grid; gap: clamp(1.75rem, 3vw, 2.5rem); }
.dict-entry {
    display: grid;
    grid-template-columns: minmax(0, 15rem) minmax(0, 1fr) auto;
    gap: 0.4rem 2rem;
    align-items: baseline;
}
.dict-entry dt { display: flex; flex-wrap: wrap; gap: 0.15rem 0.7rem; }
.dict-entry dt code {
    font-family: var(--f-mono);
    font-weight: 600;
    font-size: clamp(1.1rem, 1.9vw, 1.45rem);
    color: var(--text-primary);
    background: none;
    padding: 0;
    overflow-wrap: anywhere;
}
.dict-entry dd { margin: 0; min-width: 0; }
.dict-widget {
    display: block;
    font-weight: 800;
    font-stretch: 114%;
    font-size: 1.2rem;
    color: var(--ok);
    margin-bottom: 0.2rem;
}
.dict-widget.is-fallback { color: var(--text-secondary); }
.dict-def { display: block; font-size: 1rem; line-height: 1.6; color: var(--text-primary); max-width: 54ch; }
.dict-act { align-self: center; }
.dict-try {
    font: 600 0.88rem var(--f-sans);
    color: var(--text-primary);
    background: transparent;
    border: 1px solid var(--text-primary);
    padding: 0.55rem 1rem;
    min-height: 44px;
    cursor: pointer;
    transition: background-color .15s ease, color .15s ease;
}
.dict-try:hover { background: var(--text-primary); color: var(--bg-primary); }

@media (max-width: 900px) {
    .dict .container { grid-template-columns: 1fr; }
    .dict-intro { position: static; }
}
@media (max-width: 640px) {
    .dict-entry { grid-template-columns: minmax(0, 1fr) auto; }
    .dict-entry dt { grid-column: 1 / -1; }
    .dict-act { align-self: start; }
}

/* ═══ Cómo pegarlo: secuencia real, numerada ════════════════════ */
.howto { background: var(--bg-secondary); padding-block: clamp(4rem, 8vw, 7rem); }
.howto-steps {
    list-style: none; margin: 2.25rem 0 0; padding: 0;
    display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: clamp(1.5rem, 3vw, 2.75rem);
    counter-reset: paso;
}
.howto-steps li { counter-increment: paso; min-width: 0; }
.howto-steps li::before {
    content: counter(paso);
    display: block;
    font-weight: 800;
    font-stretch: 125%;
    font-size: clamp(2.5rem, 5vw, 4rem);
    line-height: 1;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    font-variant-numeric: tabular-nums;
}
.howto-steps h3 { font-size: 1.15rem; font-weight: 800; font-stretch: 108%; margin-bottom: 0.4rem; color: var(--text-primary); }
.howto-steps p { font-size: 1rem; line-height: 1.6; color: var(--text-primary); }
.howto-compat { margin-top: clamp(2.5rem, 5vw, 4rem); font-size: 0.98rem; color: var(--text-secondary); max-width: 70ch; }
.howto-compat a { color: var(--text-primary); }
@media (max-width: 900px) { .howto-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .howto-steps { grid-template-columns: 1fr; } }

/* ═══ Pie: cierre tranquilo, sin rótulos en mayúsculas ══════════ */
.footer--expanded { background: var(--bg-primary); }
.footer-col h4 { text-transform: none; letter-spacing: 0; font-size: 0.95rem; color: var(--text-primary); }
.footer-desc { color: var(--text-secondary); font-size: 0.92rem; }
.footer-col ul a { color: var(--text-primary); }

/* ═══ Precios: dos entradas del diccionario ═════════════════════ */
.plans-band { background: var(--editor); color: var(--editor-text); padding-block: clamp(2.5rem, 6vw, 4.5rem); }
.plans-band h1 {
    color: #FFFFFF; font-weight: 800; font-stretch: 116%;
    font-size: clamp(2.3rem, 6vw, 4.8rem); line-height: 0.96; letter-spacing: -0.015em;
    max-width: 16ch; text-wrap: balance; margin-bottom: 0.9rem;
}
.plans-band p { color: #D9D6CF; font-size: 1.1rem; max-width: 56ch; }
.plans { background: var(--bg-primary); padding-block: clamp(3rem, 7vw, 6rem); }
.plan-list { margin: 0; display: grid; gap: clamp(2.5rem, 5vw, 4rem); }
.plan-entry { display: grid; grid-template-columns: minmax(0, 15rem) minmax(0, 1fr) minmax(0, 17rem); gap: 1rem 2.5rem; align-items: start; }
.plan-entry dt { font-weight: 800; font-stretch: 116%; font-size: clamp(1.8rem, 3.4vw, 2.6rem); line-height: 1; color: var(--text-primary); }
.plan-entry dt .plan-price { display: block; margin-top: 0.6rem; font-size: 0.55em; font-stretch: 100%; font-weight: 700; font-variant-numeric: tabular-nums; }
.plan-entry dt .plan-price small { font-size: 0.6em; font-weight: 500; color: var(--text-secondary); }
.plan-entry dd { margin: 0; min-width: 0; }
.plan-entry ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.45rem; }
.plan-entry li { font-size: 1.02rem; line-height: 1.5; color: var(--text-primary); }
.plan-entry li.is-off { color: var(--text-muted); }
.plan-entry .plan-cta { display: grid; gap: 0.6rem; }
.plan-entry .btn-primary, .plan-entry .btn-secondary { justify-content: center; text-decoration: none; min-height: 48px; }
.plan-entry .btn-primary { background: var(--primary); color: #161616; font-weight: 800; }
.plan-entry .btn-primary:hover { background: #FF956E; }
.plan-entry .btn-secondary { background: transparent; border: 1px solid var(--text-primary); color: var(--text-primary); }
.plan-note { font-size: 0.88rem; color: var(--text-secondary); line-height: 1.5; }
.plan-entry + .plan-entry { padding-top: clamp(2.5rem, 5vw, 4rem); border-top: 1px solid var(--border); }
@media (max-width: 900px) { .plan-entry { grid-template-columns: minmax(0, 1fr); } }

.faq-dict { background: var(--bg-secondary); padding-block: clamp(3.5rem, 7vw, 6rem); }
.faq-dict h2 { font-size: clamp(1.8rem, 3.6vw, 2.8rem); font-weight: 800; font-stretch: 116%; line-height: 1; margin-bottom: 2rem; color: var(--text-primary); }
.faq-dict dl { margin: 0; display: grid; gap: 1.75rem; max-width: 78ch; }
.faq-dict dt { font-weight: 800; font-size: 1.15rem; color: var(--text-primary); margin-bottom: 0.35rem; }
.faq-dict dd { margin: 0; font-size: 1.02rem; line-height: 1.65; color: var(--text-primary); }
.faq-dict a { color: var(--text-primary); }

@media (prefers-reduced-motion: reduce) {
    .dict-try { transition: none; }
}

/* Precios: la frase del Pro */
.plan-entry dt .plan-claim { display: block; margin-top: 0.5rem; font-size: 0.42em; font-stretch: 100%; font-weight: 600; color: var(--text-secondary); line-height: 1.3; }

/* ═══ Páginas de lectura: guía, ejemplos, proyecto, legales ═════ */
.hero-secondary { background: var(--editor); text-align: left; padding-block: clamp(2.5rem, 6vw, 4.5rem); }
.hero-secondary h1 {
    color: #FFFFFF; font-weight: 800; font-stretch: 116%;
    font-size: clamp(2.3rem, 6vw, 4.8rem); line-height: 0.96; letter-spacing: -0.015em;
    max-width: 18ch; text-wrap: balance; margin-bottom: 0.9rem;
}
.hero-secondary .subtitle { color: #D9D6CF; font-size: 1.1rem; max-width: 60ch; }
.about-hero-inner { display: block; }
.about-byline { color: #B5B2AB; }
.about-byline a { color: #FFFFFF; }
.about-byline .tech-badge { background: transparent; color: var(--primary); padding: 0; margin: 0; font-family: 'JetBrains Mono', monospace; }

/* Títulos de sección sin filete: tamaño en lugar de línea */
.docs-section h2, .about-section h2 {
    border-bottom: 0; padding-bottom: 0; font-weight: 800; font-stretch: 116%;
    font-size: clamp(1.5rem, 2.6vw, 2rem); line-height: 1.05;
}
.docs-section p, .about-section p, .legal-section p, .legal-section ul li, .feature-list li, .steps-list li { color: var(--text-primary); }

/* Índice de la guía: lista simple */
.docs-toc { background: transparent; border: 0; padding: 0; }
.toc-title { text-transform: none; letter-spacing: 0; font-size: 0.95rem; color: var(--text-primary); }
.docs-toc a { border-radius: 0; color: var(--text-secondary); }
.docs-toc a:hover, .docs-toc a.toc-active { background: transparent; color: var(--text-primary); font-weight: 700; }
@media (max-width: 900px) { .docs-toc a { border-radius: 0; background: var(--bg-secondary); } }

/* Pasos: número en la misma tinta, sin círculos */
.steps-list--numbered li::before {
    background: transparent; color: var(--text-primary); border-radius: 0;
    font-family: 'JetBrains Mono', monospace; font-size: 0.9rem; min-width: 1.6rem; justify-content: flex-start; height: auto;
}
.steps-list--numbered li { display: block; position: relative; padding-left: 2rem; }
.steps-list--numbered li::before { position: absolute; left: 0; top: 0.1rem; }
.docs-section a:not([class]), .legal-section a:not([class]), .about-section p a:not([class]) { color: var(--text-primary); text-decoration: underline; text-decoration-color: var(--primary); text-underline-offset: 3px; }

/* Avisos: salto de tono, sin borde lateral */
.info-box { border-left: 0; border-radius: 0; background: var(--bg-secondary); color: var(--text-primary); }
.info-box--tip, .info-box--warn { background: var(--bg-secondary); }
.feature-list li::before { color: var(--text-primary); }
.feature-list--warn li::before { color: var(--text-secondary); }
.docs-table code, .docs-section code { border-radius: 0; }
.code-block, .example-code { background: var(--editor); border-radius: 0; }
.code-block code, .example-code code { color: var(--editor-text); font-family: 'JetBrains Mono', monospace; }

/* FAQ de la guía */
.faq-category-title { text-transform: none; letter-spacing: 0; }
.faq-item { border-radius: 0; }
.faq-question:hover, .faq-question[aria-expanded="true"] { background: transparent; color: var(--text-primary); }

/* Ejemplos */
.lib-chip { border-radius: 0; }
.lib-chip:hover { border-color: var(--text-primary); color: var(--text-primary); }
.lib-chip.active { background: var(--text-primary); border-color: var(--text-primary); color: var(--bg-primary); }
.lib-search-input { border-radius: 0; }
.lib-search-input:focus { border-color: var(--text-primary); box-shadow: none; }
.lib-stats-bar { border-top: 0; }
.example-card { border-radius: 0; }
.example-card:hover { box-shadow: none; transform: none; border-color: var(--text-primary); }
.tag { border-radius: 0; background: transparent; padding: 0; color: var(--text-secondary); font-family: 'JetBrains Mono', monospace; font-weight: 400; }
.tag + .tag::before { content: "/ "; color: var(--text-muted); }
.example-tags { gap: 0.4rem; }
.examples-cta { text-align: left; border-radius: 0; background: var(--editor); color: var(--editor-text); padding: clamp(2rem, 5vw, 3.5rem); }
.examples-cta h2 { color: #FFFFFF; font-weight: 800; font-stretch: 116%; font-size: clamp(1.6rem, 3vw, 2.4rem); }
.examples-cta p { color: #D9D6CF; }
.examples-cta .btn-primary { background: var(--primary); color: #161616; font-weight: 800; border-radius: 0; text-decoration: none; }

/* Proyecto */
.about-container { max-width: 1400px; }
.about-container > * { max-width: 820px; }
.about-values { gap: 1.75rem 2.5rem; }
.about-value { padding: 0; background: transparent; border-radius: 0; }
.about-value h3 { font-size: 1.05rem; }
.about-value p { color: var(--text-primary); font-size: 0.95rem; }
.tech-stack { gap: 1.25rem 2rem; }
.tech-item { padding: 0; background: transparent; border: 0; border-radius: 0; }
.tech-item .tech-badge { background: transparent; color: var(--text-primary); padding: 0; border-radius: 0; font-family: 'JetBrains Mono', monospace; font-size: 0.9rem; }
.roadmap-list { gap: 0; }
.roadmap-item { border: 0; border-radius: 0; background: transparent; padding: 0.8rem 0; border-top: 1px solid var(--border); }
.roadmap-item--done, .roadmap-item--planned { background: transparent; }
.roadmap-status { font-family: 'JetBrains Mono', monospace; min-width: 6.5rem; color: var(--text-secondary); }
.roadmap-item--done .roadmap-status { color: var(--ok, #2C7D51); }
.roadmap-item--planned .roadmap-status { color: var(--text-primary); }
.roadmap-item div strong { font-size: 1rem; }
.roadmap-item div span { color: var(--text-secondary); font-size: 0.92rem; }
.about-section--support { border-radius: 0; background: var(--bg-secondary); padding: clamp(1.5rem, 4vw, 2.5rem); }
.support-card { border-radius: 0; border: 0; background: transparent; padding: 0; }
.support-card--primary { background: transparent; text-decoration: none; }
.support-card--primary h3 { color: var(--text-primary); text-decoration: underline; text-decoration-color: var(--primary); text-decoration-thickness: 3px; text-underline-offset: 4px; }
.support-card h3 { font-size: 1.05rem; }
.support-card p { color: var(--text-primary); font-size: 0.92rem; }
.contact-item { border-radius: 0; background: transparent; }
.contact-item:hover { border-color: var(--text-primary); color: var(--text-primary); background: transparent; }
.contact-item svg { color: var(--text-primary); }

/* Legales */
.legal-container { max-width: 1400px; }
.legal-container > * { max-width: 72ch; }
.legal-section h2 { font-weight: 800; font-stretch: 116%; font-size: 1.4rem; }

/* Código en línea sobre papel: el color global (#d4d4d4) es para el editor oscuro */
:where(:not(pre)) > code { color: var(--text-primary); background: var(--bg-secondary); padding: 0.05em 0.35em; }
.examples-cta :where(:not(pre)) > code, .tool-band :where(:not(pre)) > code { color: var(--editor-text); background: transparent; }
.feature-list li { display: block; position: relative; padding-left: 1.4rem; }
.feature-list li::before { position: absolute; left: 0; top: 0; }

/* Versión de Elementor: V4 es Pro */
.pro-chip { font-family: var(--f-mono); font-size: 0.68rem; font-weight: 600; letter-spacing: 0.02em; color: var(--primary); margin-left: 0.25rem; }
.tool .mode-btn.active .pro-chip { color: #C2491E; }
.tool .input-footer { flex-wrap: wrap; }

/* Antes del lanzamiento del Pro */
.pro-prelaunch #formatToggle { display: none; }
