/*
 * Sección pública «Herramientas» de Felicita. Paleta = tailwind.config.js de la app
 * (brand / sidebar / surface / line / content). Si cambias la paleta allá, cámbiala aquí.
 * Las páginas se generan con frontend/scripts/generar-herramientas.mjs: no editar los .html a mano.
 */
:root {
  --brand-50: #EFF6FF; --brand-100: #DBEAFE; --brand-200: #BFDBFE; --brand-300: #93C5FD;
  --brand-500: #3B82F6; --brand-600: #2563EB; --brand-700: #1D4ED8; --brand-800: #1E40AF; --brand-900: #1E3A8A;
  --sidebar: #0F172A; --sidebar-hover: #1E293B; --sidebar-border: #1E293B; --sidebar-text: #CBD5E1; --sidebar-muted: #64748B;
  --surface: #FFFFFF; --surface-muted: #F8FAFC; --surface-subtle: #F1F5F9;
  --line: #E2E8F0; --line-strong: #CBD5E1;
  --content: #334155; --content-muted: #64748B; --content-strong: #0F172A;
  --success-50: #ECFDF5; --success-200: #A7F3D0; --success-600: #059669; --success-800: #065F46;
  --warning-50: #FFFBEB; --warning-200: #FDE68A; --warning-800: #92400E;
  --danger-50: #FEF2F2; --danger-200: #FECACA; --danger-700: #B91C1C;
  --f-heading: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --f-body: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --top-h: 64px;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }
body { margin: 0; font-family: var(--f-body); color: var(--content); background: var(--surface-muted); line-height: 1.65; -webkit-font-smoothing: antialiased; }
a { color: var(--brand-800); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--brand-600); outline-offset: 2px; border-radius: 6px; }
h1, h2, h3 { font-family: var(--f-heading); color: var(--content-strong); line-height: 1.2; margin: 0; }
.hf-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hf-skip { position: absolute; left: -999px; top: 8px; background: var(--brand-900); color: #fff; padding: 8px 14px; border-radius: 8px; z-index: 100; }
.hf-skip:focus { left: 8px; }

/* ── Botones y barra del menú lateral ──────────────────────────
 * La cabecera, el pie y el botón de WhatsApp son los comunes del sitio (public/sitio/sitio.css). */
.hf-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; background: var(--brand-700); color: #fff; font-weight: 600; font-size: 14px; padding: 9px 16px; border-radius: 10px; border: 0; cursor: pointer; font-family: inherit; transition: background .15s; }
.hf-btn:hover { background: var(--brand-800); text-decoration: none; color: #fff; }
.hf-btn-ghost { background: transparent; color: var(--brand-800); border: 1px solid var(--line-strong); }
.hf-btn-ghost:hover { background: var(--brand-50); color: var(--brand-900); }
.hf-btn-lg { padding: 13px 22px; font-size: 15px; border-radius: 12px; }
.hf-subbar { display: none; background: var(--surface); border-bottom: 1px solid var(--line); padding: 8px 14px; }
.hf-menu-toggle { display: inline-flex; align-items: center; gap: 8px; background: var(--sidebar); color: #fff; border: 0; border-radius: 10px; padding: 8px 12px; font: 600 14px var(--f-body); cursor: pointer; }

/* ── Estructura de 3 columnas ───────────────────────────────── */
.hf-shell { max-width: 1480px; margin: 0 auto; display: grid; grid-template-columns: 252px minmax(0, 1fr) 320px; align-items: start; min-height: calc(100vh - var(--top-h)); }
.hf-menu { position: sticky; top: var(--top-h); height: calc(100vh - var(--top-h)); overflow-y: auto; background: var(--sidebar); color: var(--sidebar-text); padding: 18px 12px 20px; display: flex; flex-direction: column; gap: 4px; }
.hf-menu-title { font: 700 11px var(--f-heading); letter-spacing: .08em; text-transform: uppercase; color: var(--sidebar-muted); padding: 14px 12px 6px; }
.hf-menu-title:first-child { padding-top: 2px; }
.hf-item { display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 10px; font-size: 14px; font-weight: 500; color: var(--sidebar-text); transition: background .15s, color .15s; }
.hf-item svg { flex: none; width: 18px; height: 18px; }
.hf-item:hover { background: var(--sidebar-hover); color: #fff; text-decoration: none; }
.hf-item[aria-current="page"] { background: var(--brand-800); color: #fff; }
.hf-item.hf-pronto { color: var(--sidebar-muted); cursor: default; }
.hf-item.hf-pronto:hover { background: transparent; color: var(--sidebar-muted); }
.hf-badge { margin-left: auto; font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 999px; background: var(--sidebar-hover); color: var(--sidebar-text); }
.hf-menu-foot { margin-top: auto; padding: 14px 10px 0; border-top: 1px solid var(--sidebar-border); font-size: 12px; color: var(--sidebar-muted); }
.hf-menu-foot a { color: #fff; font-weight: 600; }

.hf-main { padding: 34px 32px 70px; min-width: 0; transition: opacity .15s; }
.hf-main.hf-cargando { opacity: .45; pointer-events: none; }
.hf-wrap { max-width: 760px; margin: 0 auto; }
.hf-crumbs { font-size: 13px; color: var(--content-muted); margin-bottom: 14px; }
.hf-crumbs a { color: var(--content-muted); }
.hf-kicker { display: inline-flex; align-items: center; gap: 6px; font: 700 12px var(--f-heading); letter-spacing: .06em; text-transform: uppercase; color: var(--brand-700); background: var(--brand-50); border: 1px solid var(--brand-100); padding: 4px 10px; border-radius: 999px; }
.hf-h1 { font-size: clamp(26px, 3.4vw, 38px); letter-spacing: -.02em; font-weight: 800; margin: 14px 0 12px; }
.hf-lead { font-size: 17px; color: var(--content); margin: 0 0 24px; }
.hf-h2 { font-size: 22px; font-weight: 800; margin: 44px 0 12px; letter-spacing: -.01em; }
.hf-h3 { font-size: 17px; font-weight: 700; margin: 22px 0 6px; }
.hf-main p { margin: 0 0 14px; }
.hf-main ul, .hf-main ol { padding-left: 22px; margin: 0 0 14px; }
.hf-main li { margin: 5px 0; }

/* ── Tarjetas, formularios, resultados ─────────────────────── */
.hf-card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 22px; box-shadow: 0 1px 2px rgba(15,23,42,.04); }
.hf-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 18px; }
.hf-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.hf-field.hf-full { grid-column: 1 / -1; }
.hf-label { font-size: 13px; font-weight: 600; color: var(--content-strong); }
.hf-hint { font-size: 12px; color: var(--content-muted); }
.hf-input { width: 100%; font: 500 15px var(--f-body); color: var(--content-strong); background: var(--surface); border: 1px solid var(--line-strong); border-radius: 10px; padding: 10px 12px; min-height: 44px; }
.hf-input:focus { outline: 2px solid var(--brand-600); outline-offset: 0; border-color: var(--brand-600); }
.hf-check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--content-strong); cursor: pointer; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-muted); }
.hf-check input { margin-top: 3px; width: 17px; height: 17px; accent-color: var(--brand-800); }
.hf-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.hf-error { grid-column: 1 / -1; background: var(--danger-50); border: 1px solid var(--danger-200); color: var(--danger-700); border-radius: 10px; padding: 10px 14px; font-size: 14px; }

.hf-result { margin-top: 18px; border-radius: 16px; overflow: hidden; border: 1px solid var(--brand-200); background: var(--surface); }
.hf-result[hidden] { display: none; }
.hf-result-head { background: linear-gradient(135deg, var(--brand-700), var(--brand-900)); color: #fff; padding: 20px 22px; }
.hf-result-head small { display: block; font-size: 13px; opacity: .85; margin-bottom: 4px; }
.hf-result-total { font: 800 clamp(30px, 5vw, 40px) var(--f-heading); letter-spacing: -.02em; }
.hf-result-body { padding: 6px 22px 18px; }
.hf-rows { width: 100%; border-collapse: collapse; font-size: 14px; }
.hf-rows th { text-align: left; font-weight: 500; color: var(--content-muted); padding: 10px 0; border-bottom: 1px solid var(--line); }
.hf-rows td { text-align: right; font-weight: 600; color: var(--content-strong); padding: 10px 0 10px 12px; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.hf-rows tr:last-child th, .hf-rows tr:last-child td { border-bottom: 0; }
.hf-rows .hf-sum th, .hf-rows .hf-sum td { color: var(--success-800); font-weight: 700; }
.hf-formula { margin-top: 12px; background: var(--surface-muted); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; font: 500 13px/1.6 var(--f-body); color: var(--content); }
.hf-note { background: var(--warning-50); border: 1px solid var(--warning-200); color: var(--warning-800); border-radius: 12px; padding: 12px 16px; font-size: 13px; margin: 16px 0 0; }
.hf-note-info { background: var(--brand-50); border-color: var(--brand-100); color: var(--brand-900); }
.hf-cta-box { margin-top: 18px; display: flex; flex-wrap: wrap; gap: 14px 20px; align-items: center; justify-content: space-between; background: var(--brand-50); border: 1px solid var(--brand-100); border-radius: 14px; padding: 16px 18px; }
.hf-cta-box p { margin: 0; font-size: 14px; color: var(--brand-900); max-width: 430px; }

.hf-faq details { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; margin: 8px 0; padding: 0 16px; }
.hf-faq summary { cursor: pointer; font: 700 15px var(--f-heading); color: var(--content-strong); padding: 14px 0; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.hf-faq summary::-webkit-details-marker { display: none; }
.hf-faq summary::after { content: '+'; color: var(--brand-700); font-size: 20px; line-height: 1; }
.hf-faq details[open] summary::after { content: '–'; }
.hf-faq details p { padding-bottom: 6px; }

.hf-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; margin: 20px 0 8px; }
.hf-tile { display: flex; flex-direction: column; gap: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 18px; color: var(--content); transition: border-color .15s, box-shadow .15s, transform .15s; }
.hf-tile:hover { border-color: var(--brand-500); box-shadow: 0 10px 24px -14px rgba(30,64,175,.45); text-decoration: none; transform: translateY(-2px); }
.hf-tile-ico { width: 40px; height: 40px; border-radius: 11px; background: var(--brand-50); color: var(--brand-800); display: grid; place-items: center; margin-bottom: 4px; }
.hf-tile-ico svg { width: 21px; height: 21px; }
.hf-tile strong { font: 700 16px var(--f-heading); color: var(--content-strong); }
.hf-tile span { font-size: 13.5px; color: var(--content-muted); }
.hf-tile.hf-tile-off { opacity: .6; pointer-events: none; }
.hf-tile .hf-badge { align-self: flex-start; margin: 0; background: var(--surface-subtle); color: var(--content-muted); }

/* ── Columna de anuncios (propios de Felicita) ─────────────── */
.hf-ads { position: sticky; top: var(--top-h); padding: 34px 20px 30px 4px; display: flex; flex-direction: column; gap: 16px; }
.hf-ad { position: relative; display: flex; flex-direction: column; justify-content: space-between; gap: 14px; min-height: 250px; border-radius: 16px; padding: 22px 20px 20px; color: #fff; background: linear-gradient(150deg, var(--brand-600), var(--brand-900)); box-shadow: 0 12px 28px -16px rgba(30,58,138,.7); }
.hf-ad:hover { text-decoration: none; }
.hf-ad-dark { background: linear-gradient(150deg, var(--sidebar-hover), var(--sidebar)); }
.hf-ad-soft { background: var(--surface); color: var(--content); border: 1px solid var(--line); box-shadow: none; min-height: 0; }
.hf-ad-tag { font: 700 10px var(--f-heading); letter-spacing: .08em; text-transform: uppercase; opacity: .75; }
.hf-ad h3 { color: inherit; font-size: 19px; font-weight: 800; letter-spacing: -.01em; margin: 6px 0 8px; }
.hf-ad p { margin: 0; font-size: 13.5px; line-height: 1.55; opacity: .92; }
.hf-ad ul { list-style: none; padding: 0; margin: 12px 0 0; font-size: 13px; }
.hf-ad li { padding-left: 20px; position: relative; margin: 5px 0; }
.hf-ad li::before { content: '✓'; position: absolute; left: 0; font-weight: 800; }
.hf-ad .hf-btn { background: #fff; color: var(--brand-900); }
.hf-ad .hf-btn:hover { background: var(--brand-50); color: var(--brand-900); }
.hf-ad-soft .hf-btn { background: var(--brand-700); color: #fff; }
.hf-ad-soft .hf-btn:hover { background: var(--brand-800); color: #fff; }
.hf-ad-soft h3 { color: var(--content-strong); }

/* ── SEO: fecha, índice, tablas ───────────────────────────── */
.hf-updated { font-size: 13px; color: var(--content-muted); margin: -12px 0 22px; }
.hf-h2 { scroll-margin-top: calc(var(--top-h) + 16px); }
.hf-toc { margin: 26px 0 0; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px 18px; font-size: 14px; }
.hf-toc b { display: block; font: 700 13px var(--f-heading); letter-spacing: .04em; text-transform: uppercase; color: var(--content-muted); margin-bottom: 6px; }
.hf-toc ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 2px 18px; }
.hf-toc li { margin: 0; }
.hf-toc a { display: block; padding: 5px 0; }
.hf-table-title { font: 700 14px var(--f-heading); color: var(--content-strong); margin: 18px 0 8px; }
.hf-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hf-table-wrap { overflow-x: auto; margin: 0 0 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.hf-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.hf-table th, .hf-table td { padding: 10px 14px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.hf-table thead th { background: var(--surface-subtle); color: var(--content-muted); font: 600 12.5px var(--f-body); }
.hf-table tbody th { text-align: left; font-weight: 700; color: var(--content-strong); }
.hf-table th:first-child, .hf-table td:first-child { text-align: left; }
.hf-table tbody tr:last-child th, .hf-table tbody tr:last-child td { border-bottom: 0; }
.hf-table-ajusta th, .hf-table-ajusta td { white-space: normal; }
@media (max-width: 880px) { .hf-table-ajusta th, .hf-table-ajusta td { padding: 9px 10px; font-size: 13px; } }
.hf-table-wrap:focus-visible { outline: 2px solid var(--brand-500); outline-offset: 2px; }

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 1240px) {
  .hf-shell { grid-template-columns: 236px minmax(0, 1fr); }
  .hf-ads { position: static; grid-column: 2; padding: 0 32px 40px; flex-direction: row; flex-wrap: wrap; }
  .hf-ads .hf-ad { flex: 1 1 280px; max-width: 760px; }
}
@media (max-width: 880px) {
  .hf-subbar { display: block; position: sticky; top: var(--top-h); z-index: 30; }
  .hf-shell { grid-template-columns: minmax(0, 1fr); }
  .hf-menu { display: none; position: fixed; inset: calc(var(--top-h) + 53px) 0 0 0; height: auto; z-index: 35; padding: 14px 14px 30px; }
  .hf-menu.hf-abierto { display: flex; }
  .hf-main { padding: 22px 16px 40px; }
  .hf-ads { grid-column: 1; padding: 0 16px 36px; }
  .hf-form { grid-template-columns: minmax(0, 1fr); }
  .hf-result-body, .hf-result-head, .hf-card { padding-left: 16px; padding-right: 16px; }
}
@media print {
  .hf-subbar, .hf-menu, .hf-ads, .hf-cta-box, .hf-actions { display: none !important; }
  .hf-shell { display: block; }
  body { background: #fff; }
}
