/* ==========================================================
   aDigital · Herramientas gratuitas
   Para ajustar la marca, cambia solo las variables de :root.
   ========================================================== */
:root {
  --ad-bg: #000000;          /* fondo principal (theme-color del sitio) */
  --ad-bg-2: #0b0b0c;        /* fondo de secciones alternas */
  --ad-surface: #121214;     /* tarjetas y paneles */
  --ad-surface-2: #1a1a1d;   /* inputs y elementos dentro de tarjetas */
  --ad-line: #26262b;        /* bordes */
  --ad-line-2: #34343a;
  --ad-text: #f5f5f4;        /* texto principal */
  --ad-muted: #a1a1a8;       /* texto secundario */
  --ad-faint: #6e6e76;
  --ad-accent: #ff5a1f;      /* COLOR DE ACENTO DE MARCA — cámbialo aquí */
  --ad-accent-ink: #ffffff;  /* texto sobre el acento */
  --ad-accent-soft: color-mix(in srgb, var(--ad-accent) 14%, transparent);
  --ad-good: #3ddc84;
  --ad-bad: #ff5d5d;
  --ad-warn: #ffc24b;
  --ad-wa: #25d366;

  --ad-font: "Plus Jakarta Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --ad-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --ad-radius: 18px;
  --ad-radius-sm: 12px;
  --ad-max: 1180px;
  --ad-gutter: clamp(16px, 4vw, 32px);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; animation: none !important; } }
body {
  margin: 0; background: var(--ad-bg); color: var(--ad-text);
  font-family: var(--ad-font); font-size: 16px; line-height: 1.6;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
img, svg, canvas { max-width: 100%; display: block; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--ad-accent); outline-offset: 2px; border-radius: 6px; }
.ad-skip { position: absolute; left: -9999px; top: 8px; background: var(--ad-accent); color: var(--ad-accent-ink); padding: 8px 14px; border-radius: 8px; z-index: 100; }
.ad-skip:focus { left: 8px; }
.ad-wrap { max-width: var(--ad-max); margin: 0 auto; padding: 0 var(--ad-gutter); }
.ad-visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Header ---------- */
.ad-topbar { background: var(--ad-accent); color: var(--ad-accent-ink); text-align: center; font-size: 14px; font-weight: 600; padding: 8px 16px; }
.ad-topbar a { text-decoration: none; }
.ad-topbar a:hover { text-decoration: underline; }
.ad-header { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--ad-bg) 86%, transparent); backdrop-filter: saturate(140%) blur(12px); -webkit-backdrop-filter: saturate(140%) blur(12px); border-bottom: 1px solid var(--ad-line); }
.ad-header .ad-wrap { display: flex; align-items: center; gap: 24px; height: 68px; }
.ad-logo { display: inline-flex; align-items: center; text-decoration: none; font-weight: 800; font-size: 24px; letter-spacing: -0.04em; line-height: 1; }
.ad-logo img { height: 30px; width: auto; }
.ad-logo .ad-logo-a { color: var(--ad-accent); }
.ad-nav { display: flex; gap: 4px; margin-left: auto; }
.ad-nav a { text-decoration: none; color: var(--ad-muted); font-size: 15px; font-weight: 500; padding: 8px 12px; border-radius: 999px; }
.ad-nav a:hover, .ad-nav a[aria-current="page"] { color: var(--ad-text); background: var(--ad-surface); }
.ad-header .ad-btn { flex: none; }
.ad-menu-btn { display: none; margin-left: auto; background: var(--ad-surface); border: 1px solid var(--ad-line); border-radius: 10px; width: 44px; height: 44px; cursor: pointer; align-items: center; justify-content: center; }
@media (max-width: 900px) {
  .ad-nav { display: none; position: absolute; top: 68px; left: 0; right: 0; flex-direction: column; background: var(--ad-bg); border-bottom: 1px solid var(--ad-line); padding: 12px var(--ad-gutter) 20px; }
  .ad-nav.is-open { display: flex; }
  .ad-nav a { padding: 12px; font-size: 17px; }
  .ad-menu-btn { display: inline-flex; }
  .ad-header .ad-btn-head { display: none; }
}

/* ---------- Botones ---------- */
.ad-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 20px; border-radius: 999px; border: 1px solid transparent; font-weight: 700; font-size: 15px; text-decoration: none; cursor: pointer; transition: transform .15s ease, background .15s ease, border-color .15s ease; white-space: nowrap; }
.ad-btn:active { transform: scale(.98); }
.ad-btn svg { width: 18px; height: 18px; flex: none; }
.ad-btn-accent { background: var(--ad-accent); color: var(--ad-accent-ink); }
.ad-btn-accent:hover { background: color-mix(in srgb, var(--ad-accent) 88%, white); }
.ad-btn-light { background: var(--ad-text); color: var(--ad-bg); }
.ad-btn-light:hover { background: #fff; }
.ad-btn-ghost { background: transparent; border-color: var(--ad-line-2); color: var(--ad-text); }
.ad-btn-ghost:hover { border-color: var(--ad-text); }
.ad-btn-wa { background: var(--ad-wa); color: #04210f; }
.ad-btn-sm { min-height: 36px; padding: 6px 14px; font-size: 14px; }
.ad-btn[disabled] { opacity: .5; cursor: not-allowed; }

/* ---------- Breadcrumb / Hero de herramienta ---------- */
.ad-crumbs { font-size: 14px; color: var(--ad-faint); padding-top: 28px; }
.ad-crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; }
.ad-crumbs li + li::before { content: "/"; margin-right: 6px; color: var(--ad-line-2); }
.ad-crumbs a { color: var(--ad-muted); text-decoration: none; }
.ad-crumbs a:hover { color: var(--ad-text); }
.ad-tool-hero { padding: 20px 0 32px; }
.ad-eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ad-accent); margin-bottom: 14px; }
.ad-eyebrow::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--ad-accent); }
.ad-tool-hero h1 { font-size: clamp(32px, 5vw, 52px); line-height: 1.05; letter-spacing: -0.035em; margin: 0 0 16px; font-weight: 800; max-width: 22ch; text-wrap: balance; }
.ad-lead { font-size: clamp(17px, 2vw, 19px); color: var(--ad-muted); max-width: 62ch; margin: 0; text-wrap: pretty; }

/* ---------- Layout de herramienta ---------- */
.ad-tool { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start; padding-bottom: 56px; }
.ad-tool.is-wide { grid-template-columns: minmax(0, 1fr); }
.ad-tool.is-wide-left { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); }
@media (max-width: 860px) { .ad-tool, .ad-tool.is-wide-left { grid-template-columns: minmax(0, 1fr); } }
.ad-panel { background: var(--ad-surface); border: 1px solid var(--ad-line); border-radius: var(--ad-radius); padding: clamp(18px, 3vw, 28px); min-width: 0; }
.ad-panel h2 { font-size: 18px; margin: 0 0 18px; letter-spacing: -0.01em; }
.ad-panel h3 { font-size: 15px; margin: 22px 0 12px; color: var(--ad-muted); font-weight: 600; }
.ad-results { position: sticky; top: 88px; }
@media (max-width: 860px) { .ad-results { position: static; } }
.ad-panel-accent { border-color: color-mix(in srgb, var(--ad-accent) 45%, var(--ad-line)); background: linear-gradient(180deg, color-mix(in srgb, var(--ad-accent) 9%, var(--ad-surface)), var(--ad-surface) 55%); }

/* ---------- Formularios ---------- */
.ad-fields { display: grid; gap: 16px; }
.ad-fields-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 520px) { .ad-fields-2 { grid-template-columns: 1fr; } }
.ad-field { display: grid; gap: 6px; min-width: 0; }
.ad-field > label, .ad-label { font-size: 14px; font-weight: 600; color: var(--ad-text); }
.ad-hint { font-size: 13px; color: var(--ad-faint); line-height: 1.45; }
.ad-input, .ad-select, .ad-textarea {
  width: 100%; min-height: 48px; background: var(--ad-surface-2); border: 1px solid var(--ad-line-2); border-radius: var(--ad-radius-sm);
  padding: 10px 14px; font-size: 16px; outline: none; transition: border-color .15s ease, box-shadow .15s ease;
}
.ad-textarea { min-height: 120px; resize: vertical; line-height: 1.5; }
.ad-input:focus, .ad-select:focus, .ad-textarea:focus { border-color: var(--ad-accent); box-shadow: 0 0 0 3px var(--ad-accent-soft); }
.ad-input:user-invalid { border-color: var(--ad-bad); }
.ad-select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%23a1a1a8' stroke-width='2'%3E%3Cpath d='M1 1l5 5 5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 38px; }
.ad-select option { background: var(--ad-surface-2); }
.ad-affix { display: flex; align-items: stretch; background: var(--ad-surface-2); border: 1px solid var(--ad-line-2); border-radius: var(--ad-radius-sm); transition: border-color .15s ease, box-shadow .15s ease; }
.ad-affix:focus-within { border-color: var(--ad-accent); box-shadow: 0 0 0 3px var(--ad-accent-soft); }
.ad-affix .ad-input { border: 0; box-shadow: none; background: transparent; min-width: 0; }
.ad-affix > span { display: flex; align-items: center; padding: 0 0 0 14px; color: var(--ad-faint); font-weight: 600; font-size: 15px; }
.ad-affix > span:last-child:not(:first-child) { padding: 0 14px 0 0; }
input[type="number"] { -moz-appearance: textfield; }
input[type="number"]::-webkit-inner-spin-button, input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
input[type="color"] { width: 56px; height: 48px; padding: 4px; border-radius: var(--ad-radius-sm); border: 1px solid var(--ad-line-2); background: var(--ad-surface-2); cursor: pointer; }
input[type="range"] { width: 100%; accent-color: var(--ad-accent); }
input[type="checkbox"], input[type="radio"] { accent-color: var(--ad-accent); width: 18px; height: 18px; }
.ad-check { display: flex; align-items: flex-start; gap: 10px; font-size: 15px; cursor: pointer; }
.ad-check input { margin-top: 3px; flex: none; }

/* Control segmentado: <div class="ad-seg" role="radiogroup"><label><input type="radio" name="x" value="a" checked><span>A</span></label>…</div> */
.ad-seg { display: flex; flex-wrap: wrap; gap: 4px; background: var(--ad-surface-2); border: 1px solid var(--ad-line-2); border-radius: var(--ad-radius-sm); padding: 4px; }
.ad-seg label { flex: 1 1 auto; position: relative; }
.ad-seg input { position: absolute; opacity: 0; inset: 0; cursor: pointer; margin: 0; width: 100%; height: 100%; }
.ad-seg span { display: block; text-align: center; padding: 9px 12px; border-radius: 9px; font-size: 14px; font-weight: 600; color: var(--ad-muted); white-space: nowrap; }
.ad-seg input:checked + span { background: var(--ad-text); color: var(--ad-bg); }
.ad-seg input:focus-visible + span { outline: 2px solid var(--ad-accent); outline-offset: 1px; }

/* ---------- Resultados ---------- */
.ad-kicker { font-size: 13px; font-weight: 600; color: var(--ad-muted); text-transform: uppercase; letter-spacing: .06em; margin: 0 0 6px; }
.ad-big { font-size: clamp(36px, 6vw, 54px); font-weight: 800; letter-spacing: -0.04em; line-height: 1.05; margin: 0 0 6px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.ad-big.is-good { color: var(--ad-good); }
.ad-big.is-bad { color: var(--ad-bad); }
.ad-sub { color: var(--ad-muted); font-size: 15px; margin: 0; }
.ad-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin-top: 20px; }
.ad-stat { background: var(--ad-surface-2); border: 1px solid var(--ad-line); border-radius: var(--ad-radius-sm); padding: 14px; min-width: 0; }
.ad-stat dt, .ad-stat .ad-stat-label { font-size: 13px; color: var(--ad-muted); margin: 0 0 4px; }
.ad-stat dd, .ad-stat .ad-stat-value { margin: 0; font-size: 20px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.ad-rows { margin: 20px 0 0; padding: 0; list-style: none; border-top: 1px solid var(--ad-line); }
.ad-rows li { display: flex; justify-content: space-between; gap: 16px; padding: 11px 0; border-bottom: 1px solid var(--ad-line); font-size: 15px; }
.ad-rows li span:first-child { color: var(--ad-muted); }
.ad-rows li span:last-child { font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }
.ad-rows li.is-total { border-bottom: 0; padding-top: 14px; }
.ad-rows li.is-total span { color: var(--ad-text); font-weight: 800; font-size: 17px; }
.ad-neg { color: var(--ad-bad); }
.ad-pos { color: var(--ad-good); }
.ad-badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 13px; font-weight: 700; background: var(--ad-surface-2); border: 1px solid var(--ad-line-2); }
.ad-badge.is-good { color: var(--ad-good); border-color: color-mix(in srgb, var(--ad-good) 40%, transparent); background: color-mix(in srgb, var(--ad-good) 10%, transparent); }
.ad-badge.is-bad { color: var(--ad-bad); border-color: color-mix(in srgb, var(--ad-bad) 40%, transparent); background: color-mix(in srgb, var(--ad-bad) 10%, transparent); }
.ad-badge.is-warn { color: var(--ad-warn); border-color: color-mix(in srgb, var(--ad-warn) 40%, transparent); background: color-mix(in srgb, var(--ad-warn) 10%, transparent); }
.ad-bar { height: 10px; border-radius: 999px; background: var(--ad-surface-2); overflow: hidden; display: flex; }
.ad-bar > i { display: block; height: 100%; background: var(--ad-accent); }
.ad-note { margin-top: 18px; padding: 14px 16px; border-radius: var(--ad-radius-sm); background: var(--ad-surface-2); border: 1px solid var(--ad-line); font-size: 14px; color: var(--ad-muted); line-height: 1.5; }
.ad-note strong { color: var(--ad-text); }
.ad-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }

/* Tablas */
.ad-table-wrap { overflow-x: auto; margin-top: 16px; border: 1px solid var(--ad-line); border-radius: var(--ad-radius-sm); }
.ad-table { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.ad-table th, .ad-table td { padding: 11px 14px; text-align: right; border-bottom: 1px solid var(--ad-line); white-space: nowrap; }
.ad-table th:first-child, .ad-table td:first-child { text-align: left; }
.ad-table thead th { background: var(--ad-surface-2); color: var(--ad-muted); font-weight: 600; font-size: 13px; }
.ad-table tbody tr:last-child td { border-bottom: 0; }
.ad-table tr.is-best td { background: color-mix(in srgb, var(--ad-good) 8%, transparent); }

/* Código */
.ad-code { position: relative; background: #0a0a0b; border: 1px solid var(--ad-line); border-radius: var(--ad-radius-sm); padding: 16px 18px; font-family: var(--ad-mono); font-size: 14px; overflow-x: auto; line-height: 1.6; margin: 14px 0; white-space: pre; }
.ad-code-copy { position: absolute; top: 8px; right: 8px; }
code { font-family: var(--ad-mono); font-size: .92em; background: var(--ad-surface-2); border: 1px solid var(--ad-line); padding: 1px 6px; border-radius: 6px; }
.ad-code code { background: none; border: 0; padding: 0; }

/* ---------- Contenido editorial ---------- */
.ad-section { padding: 64px 0; border-top: 1px solid var(--ad-line); }
.ad-section.is-alt { background: var(--ad-bg-2); }
.ad-prose { max-width: 760px; }
.ad-prose h2 { font-size: clamp(26px, 3.4vw, 34px); letter-spacing: -0.03em; line-height: 1.15; margin: 0 0 18px; text-wrap: balance; }
.ad-prose h3 { font-size: 20px; letter-spacing: -0.01em; margin: 32px 0 10px; }
.ad-prose p, .ad-prose li { color: #d4d4d8; }
.ad-prose ul, .ad-prose ol { padding-left: 22px; }
.ad-prose li { margin: 6px 0; }
.ad-prose a { color: var(--ad-accent); }
.ad-formula { font-family: var(--ad-mono); background: var(--ad-surface); border: 1px solid var(--ad-line); border-left: 3px solid var(--ad-accent); padding: 14px 18px; border-radius: 10px; overflow-x: auto; color: var(--ad-text); }
.ad-faq { display: grid; gap: 10px; margin-top: 8px; }
.ad-faq details { background: var(--ad-surface); border: 1px solid var(--ad-line); border-radius: var(--ad-radius-sm); padding: 0 18px; }
.ad-faq summary { cursor: pointer; list-style: none; padding: 16px 28px 16px 0; font-weight: 700; position: relative; }
.ad-faq summary::-webkit-details-marker { display: none; }
.ad-faq summary::after { content: "+"; position: absolute; right: 0; top: 13px; font-size: 22px; color: var(--ad-accent); font-weight: 400; }
.ad-faq details[open] summary::after { content: "−"; }
.ad-faq details > div { padding: 0 0 18px; color: #d4d4d8; }
.ad-faq details > div p { margin: 0 0 10px; }

/* ---------- Tarjetas de herramientas (landing y relacionadas) ---------- */
.ad-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.ad-card { position: relative; display: flex; flex-direction: column; gap: 12px; background: var(--ad-surface); border: 1px solid var(--ad-line); border-radius: var(--ad-radius); padding: 22px; text-decoration: none; transition: border-color .2s ease, transform .2s ease, background .2s ease; min-height: 220px; }
.ad-card:hover { border-color: var(--ad-line-2); background: #151517; transform: translateY(-2px); }
.ad-card:hover .ad-card-go { color: var(--ad-accent); }
.ad-card:hover .ad-card-go svg { transform: translate(2px, -2px); }
.ad-card-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ad-ico { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--ad-accent-soft); color: var(--ad-accent); flex: none; }
.ad-ico svg { width: 22px; height: 22px; }
.ad-tag { font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--ad-muted); border: 1px solid var(--ad-line-2); padding: 4px 10px; border-radius: 999px; }
.ad-card h3 { font-size: 18px; line-height: 1.25; margin: 4px 0 0; letter-spacing: -0.015em; }
.ad-card p { margin: 0; color: var(--ad-muted); font-size: 15px; line-height: 1.5; flex: 1; }
.ad-card-go { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: 14px; color: var(--ad-text); transition: color .2s ease; }
.ad-card-go svg { width: 16px; height: 16px; transition: transform .2s ease; }

.ad-grid-4 { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.ad-related .ad-cat-head { flex-wrap: wrap; }
.ad-related-more { margin: 22px 0 0; color: var(--ad-faint); font-size: 15px; }
.ad-related-more a { color: var(--ad-muted); }
.ad-related-more a:hover { color: var(--ad-text); }
a.ad-eyebrow { text-decoration: none; }
a.ad-eyebrow:hover { text-decoration: underline; text-underline-offset: 4px; }
.ad-prose p a[href^="/herramientas/"], .ad-prose li a[href^="/herramientas/"] { text-decoration-thickness: 1px; text-underline-offset: 3px; }

/* ---------- Navegación de herramientas ---------- */
.ad-logo-sub { margin-left: 10px; padding-left: 10px; border-left: 1px solid var(--ad-line-2); font-size: 15px; font-weight: 600; letter-spacing: 0; color: var(--ad-muted); }
.ad-nav a[aria-current="true"] { color: var(--ad-text); background: var(--ad-surface); }
.ad-picker-open kbd { font-family: var(--ad-mono); font-size: 12px; border: 1px solid var(--ad-line-2); border-radius: 6px; padding: 0 6px; color: var(--ad-faint); }
.ad-header .ad-picker-open.ad-btn { margin-left: 8px; }
@media (max-width: 1080px) { .ad-nav { display: none !important; } .ad-header .ad-picker-open.ad-btn { margin-left: auto; } }
@media (max-width: 560px) { .ad-header .ad-picker-open.ad-btn { display: none; } .ad-menu-btn { display: inline-flex; margin-left: auto; } .ad-logo-sub { font-size: 14px; } }
@media (min-width: 561px) { .ad-menu-btn { display: none !important; } }

/* Selector de herramientas (dialog) */
.ad-picker { width: min(920px, calc(100vw - 24px)); max-height: min(86vh, 860px); padding: 0; border: 1px solid var(--ad-line-2); border-radius: 22px; background: var(--ad-bg-2); color: var(--ad-text); box-shadow: 0 30px 80px rgba(0,0,0,.6); overflow: hidden; }
.ad-picker[open] { display: flex; flex-direction: column; animation: ad-pick-in .28s cubic-bezier(.2,.9,.3,1); }
.ad-picker::backdrop { background: rgba(0,0,0,.6); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
@keyframes ad-pick-in { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }
.ad-picker-head { display: flex; gap: 10px; align-items: center; padding: 16px; border-bottom: 1px solid var(--ad-line); }
.ad-picker-search { flex: 1; max-width: none; }
.ad-picker-body { overflow-y: auto; padding: 8px 16px 16px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 24px; overscroll-behavior: contain; }
@media (max-width: 720px) { .ad-picker-body { grid-template-columns: minmax(0, 1fr); } }
.ad-picker-group h3 { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ad-accent); margin: 16px 0 6px; }
.ad-picker-group h3 small { color: var(--ad-faint); margin-left: 4px; }
.ad-picker-group ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.ad-picker-group a { display: flex; gap: 12px; align-items: center; padding: 8px; border-radius: 12px; text-decoration: none; }
.ad-picker-group a:hover, .ad-picker-group a:focus-visible { background: var(--ad-surface); }
.ad-picker-group a[aria-current="page"] { background: var(--ad-accent-soft); }
.ad-picker-group .ad-ico { width: 36px; height: 36px; border-radius: 10px; }
.ad-picker-group .ad-ico svg { width: 18px; height: 18px; }
.ad-picker-group b { display: block; font-size: 15px; font-weight: 600; line-height: 1.3; }
.ad-picker-group a small { display: block; font-size: 13px; color: var(--ad-faint); line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.ad-picker-empty { grid-column: 1 / -1; text-align: center; color: var(--ad-muted); padding: 32px 0; }
.ad-picker-foot { border-top: 1px solid var(--ad-line); padding: 12px 16px; font-size: 14px; }
.ad-picker-foot a { color: var(--ad-muted); text-decoration: none; }
.ad-picker-foot a:hover { color: var(--ad-text); }
body:has(.ad-picker[open]) { overflow: hidden; }

/* Anterior / siguiente y chips de la categoría */
.ad-pager { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 40px; }
.ad-pager a { display: flex; flex-direction: column; gap: 4px; padding: 16px 18px; border: 1px solid var(--ad-line); border-radius: var(--ad-radius-sm); background: var(--ad-surface); text-decoration: none; transition: border-color .2s ease; }
.ad-pager a:hover { border-color: var(--ad-accent); }
.ad-pager small { color: var(--ad-faint); font-size: 13px; }
.ad-pager b { font-size: 16px; line-height: 1.3; }
.ad-pager-next { text-align: right; }
@media (max-width: 560px) { .ad-pager { grid-template-columns: 1fr; } .ad-pager-next { text-align: left; } }
.ad-chips-h { font-size: 15px; color: var(--ad-muted); margin: 32px 0 12px; font-weight: 600; }
.ad-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.ad-chip { display: inline-flex; align-items: center; min-height: 36px; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--ad-line-2); font-size: 14px; color: var(--ad-muted); text-decoration: none; }
a.ad-chip:hover { color: var(--ad-text); border-color: var(--ad-text); }
.ad-chip[aria-current="page"] { background: var(--ad-text); color: var(--ad-bg); border-color: var(--ad-text); font-weight: 600; }

/* ---------- CTA ---------- */
.ad-cta { padding: 72px 0; }
.ad-cta-box { position: relative; overflow: hidden; border-radius: 28px; padding: clamp(28px, 6vw, 64px); background: var(--ad-accent); color: var(--ad-accent-ink); display: grid; grid-template-columns: 1.4fr auto; gap: 28px; align-items: center; }
.ad-cta-box h2 { font-size: clamp(28px, 4vw, 44px); line-height: 1.05; letter-spacing: -0.035em; margin: 0 0 12px; text-wrap: balance; }
.ad-cta-box p { margin: 0; font-size: 17px; opacity: .92; max-width: 52ch; }
.ad-cta-box .ad-btn { background: #000; color: #fff; min-height: 54px; padding: 14px 26px; font-size: 16px; }
.ad-cta-box .ad-btn:hover { background: #1a1a1a; }
@media (max-width: 760px) { .ad-cta-box { grid-template-columns: 1fr; } }

/* ---------- Footer ---------- */
.ad-footer { border-top: 1px solid var(--ad-line); padding: 48px 0 32px; color: var(--ad-muted); font-size: 15px; }
.ad-footer-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 32px; margin-bottom: 36px; }
.ad-footer-top p { margin: 0; max-width: 56ch; }
.ad-footer-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 32px; }
.ad-footer h4 a { color: var(--ad-text); }
.ad-footer li { font-size: 14px; line-height: 1.4; }
@media (max-width: 960px) { .ad-footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .ad-footer-grid { grid-template-columns: 1fr; } }
.ad-footer h4 { color: var(--ad-text); font-size: 15px; margin: 0 0 12px; }
.ad-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.ad-footer a { text-decoration: none; color: var(--ad-muted); }
.ad-footer a:hover { color: var(--ad-text); }
.ad-footer-bottom { margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--ad-line); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; font-size: 14px; color: var(--ad-faint); }

/* WhatsApp flotante */
.ad-wa-float { position: fixed; right: 18px; bottom: 18px; z-index: 60; width: 56px; height: 56px; border-radius: 50%; background: var(--ad-wa); color: #fff; display: grid; place-items: center; box-shadow: 0 10px 30px rgba(0,0,0,.45); transition: transform .2s ease; }
.ad-wa-float:hover { transform: scale(1.06); }
.ad-wa-float svg { width: 28px; height: 28px; }

/* Botón flotante "¿Ya tienes página web?" */
.ad-float { font: inherit; cursor: pointer; text-align: left; position: fixed; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 60; display: inline-flex; align-items: center; gap: 10px; padding: 8px 18px 8px 8px; border-radius: 999px; background: color-mix(in srgb, #111113 82%, transparent); backdrop-filter: blur(16px) saturate(160%); -webkit-backdrop-filter: blur(16px) saturate(160%); border: 1px solid rgba(255,255,255,.12); color: var(--ad-text); text-decoration: none; box-shadow: 0 12px 32px rgba(0,0,0,.5); transition: transform .25s cubic-bezier(.2,.9,.3,1.2), border-color .2s ease; animation: ad-float-in .5s cubic-bezier(.2,.9,.3,1) .6s both; }
.ad-float:hover { border-color: var(--ad-accent); transform: translateY(-2px); }
.ad-float:active { transform: scale(.97); transition-duration: .1s; }
.ad-float-ico { width: 40px; height: 40px; border-radius: 50%; background: var(--ad-accent); color: var(--ad-accent-ink); display: grid; place-items: center; flex: none; }
.ad-float-ico svg { width: 20px; height: 20px; transition: transform .2s ease; }
.ad-float:hover .ad-float-ico svg { transform: rotate(-12deg); }
.ad-float-txt { display: flex; flex-direction: column; line-height: 1.2; }
.ad-float-txt b { font-size: 15px; font-weight: 700; letter-spacing: -0.01em; }
.ad-float-txt small { font-size: 13px; color: var(--ad-muted); font-weight: 600; }
.ad-float-txt small .ad-logo-a { color: var(--ad-accent); font-weight: 800; }
@keyframes ad-float-in { from { opacity: 0; transform: translateY(16px) scale(.96); } to { opacity: 1; transform: none; } }
@media (max-width: 420px) { .ad-float { right: 12px; left: 12px; justify-content: center; } }
@media (prefers-reduced-transparency: reduce) { .ad-float { background: #111113; backdrop-filter: none; -webkit-backdrop-filter: none; } }
@media print { .ad-float { display: none !important; } }
body { padding-bottom: 72px; }

/* Toast */
.ad-toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); background: var(--ad-text); color: var(--ad-bg); padding: 10px 18px; border-radius: 999px; font-weight: 700; font-size: 14px; opacity: 0; pointer-events: none; transition: opacity .2s ease, transform .2s ease; z-index: 90; }
.ad-toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Landing ---------- */
.ad-hero { position: relative; padding: clamp(56px, 9vw, 112px) 0 clamp(40px, 6vw, 72px); overflow: hidden; }
.ad-hero::before { content: ""; position: absolute; inset: -40% -10% auto auto; width: 720px; height: 720px; background: radial-gradient(circle, color-mix(in srgb, var(--ad-accent) 30%, transparent), transparent 62%); pointer-events: none; }
.ad-hero .ad-wrap { position: relative; }
.ad-hero h1 { font-size: clamp(40px, 7.4vw, 88px); line-height: .98; letter-spacing: -0.05em; font-weight: 800; margin: 0 0 22px; max-width: 14ch; text-wrap: balance; }
.ad-hero h1 em { font-style: normal; color: var(--ad-accent); }
.ad-hero .ad-lead { font-size: clamp(18px, 2.2vw, 21px); }
.ad-hero-meta { display: flex; flex-wrap: wrap; gap: 10px 22px; margin-top: 28px; color: var(--ad-muted); font-size: 15px; }
.ad-hero-meta span { display: inline-flex; align-items: center; gap: 8px; }
.ad-hero-meta b { color: var(--ad-text); }
.ad-featured { display: grid; grid-template-columns: 1.3fr 1fr; gap: 0; border: 1px solid var(--ad-line); border-radius: 24px; overflow: hidden; background: var(--ad-surface); text-decoration: none; transition: border-color .2s ease; }
.ad-featured:hover { border-color: var(--ad-accent); }
.ad-featured-body { padding: clamp(24px, 4vw, 44px); display: flex; flex-direction: column; gap: 14px; }
.ad-featured-body h2 { font-size: clamp(24px, 3.2vw, 34px); line-height: 1.1; letter-spacing: -0.03em; margin: 0; }
.ad-featured-body p { margin: 0; color: var(--ad-muted); font-size: 17px; }
.ad-featured-art { background: var(--ad-accent); color: var(--ad-accent-ink); display: grid; place-items: center; padding: 32px; min-height: 220px; }
.ad-featured-art .ad-mini { background: rgba(0,0,0,.82); color: #fff; border-radius: 18px; padding: 22px; width: min(320px, 100%); font-variant-numeric: tabular-nums; box-shadow: 0 20px 40px rgba(0,0,0,.25); }
.ad-mini-row { display: flex; justify-content: space-between; font-size: 14px; color: #bdbdc4; padding: 6px 0; border-bottom: 1px solid rgba(255,255,255,.08); }
.ad-mini-row b { color: #fff; }
.ad-mini-total { display: flex; justify-content: space-between; align-items: baseline; padding-top: 12px; }
.ad-mini-total b { font-size: 26px; letter-spacing: -0.03em; }
@media (max-width: 760px) { .ad-featured { grid-template-columns: 1fr; } }

.ad-toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin: 0 0 24px; }
.ad-filters { display: flex; flex-wrap: wrap; gap: 8px; }
.ad-filter { border: 1px solid var(--ad-line-2); background: transparent; color: var(--ad-muted); border-radius: 999px; padding: 9px 16px; font-size: 14px; font-weight: 600; cursor: pointer; min-height: 40px; display: inline-flex; align-items: center; gap: 8px; }
.ad-filter:hover { color: var(--ad-text); border-color: var(--ad-text); }
.ad-filter[aria-pressed="true"] { background: var(--ad-text); color: var(--ad-bg); border-color: var(--ad-text); }
.ad-filter small { font-size: 12px; opacity: .7; font-weight: 700; }
.ad-search { position: relative; flex: 1 1 260px; max-width: 360px; }
.ad-search svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--ad-faint); pointer-events: none; }
.ad-search .ad-input { padding-left: 42px; border-radius: 999px; min-height: 44px; }
.ad-hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.ad-hero-actions .ad-btn { min-height: 50px; padding: 12px 22px; font-size: 16px; }
.ad-btn-accent kbd { border-color: rgba(255,255,255,.45); color: inherit; opacity: .85; }
.ad-catnav { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 32px; }
@media (max-width: 960px) { .ad-catnav { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 480px) { .ad-catnav { grid-template-columns: minmax(0, 1fr); } }
.ad-catcard { display: flex; gap: 12px; align-items: flex-start; padding: 16px; border-radius: var(--ad-radius-sm); border: 1px solid var(--ad-line); background: color-mix(in srgb, var(--ad-surface) 85%, transparent); text-decoration: none; transition: border-color .2s ease, transform .2s ease; min-width: 0; }
.ad-catcard:hover { border-color: var(--ad-accent); transform: translateY(-2px); }
.ad-catcard .ad-ico { width: 40px; height: 40px; }
.ad-catcard b { display: block; font-size: 16px; }
.ad-catcard small { display: block; font-size: 13px; color: var(--ad-muted); line-height: 1.4; margin-top: 2px; }
.ad-toolbar-sticky { position: sticky; top: 68px; z-index: 20; padding: 12px 0; margin-top: -12px; background: color-mix(in srgb, var(--ad-bg) 90%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
@media (max-width: 760px) { .ad-toolbar-sticky { position: static; background: none; backdrop-filter: none; } }
.ad-cat-head[id], [data-group] { scroll-margin-top: 150px; }
#todas { scroll-margin-top: 60px; }
.ad-empty { text-align: center; color: var(--ad-muted); padding: 48px 16px; border: 1px dashed var(--ad-line-2); border-radius: var(--ad-radius); }
.ad-cat-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 40px 0 16px; }
.ad-cat-head h2 { font-size: 22px; margin: 0; letter-spacing: -0.02em; }
.ad-cat-head span { color: var(--ad-faint); font-size: 14px; }
.ad-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; counter-reset: s; }
@media (max-width: 760px) { .ad-steps { grid-template-columns: 1fr; } }
.ad-step { background: var(--ad-surface); border: 1px solid var(--ad-line); border-radius: var(--ad-radius); padding: 24px; }
.ad-step::before { counter-increment: s; content: "0" counter(s); display: block; font-weight: 800; color: var(--ad-accent); font-size: 14px; letter-spacing: .08em; margin-bottom: 10px; }
.ad-step h3 { margin: 0 0 8px; font-size: 18px; }
.ad-step p { margin: 0; color: var(--ad-muted); font-size: 15px; }

/* Respuesta rápida (bloque pensado para fragmentos destacados y respuestas de IA) */
.ad-answer { background: var(--ad-surface); border: 1px solid var(--ad-line); border-left: 3px solid var(--ad-accent); border-radius: var(--ad-radius-sm); padding: 20px 22px; margin: 0 0 40px; }
.ad-answer-k { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ad-accent); margin: 0 0 6px; }
.ad-prose .ad-answer h2 { font-size: clamp(20px, 2.4vw, 24px); margin: 0 0 10px; }
.ad-prose .ad-answer h2 + p { margin: 0; color: var(--ad-text); font-size: 17px; }
.ad-prose .ad-answer .ad-sources a { color: var(--ad-muted); }
.ad-prose .ad-next { margin: -24px 0 40px; font-size: 15px; color: var(--ad-muted); }
.ad-updated { margin: 16px 0 0; font-size: 14px; color: var(--ad-faint); }
.ad-updated a { color: var(--ad-muted); }

/* Utilidades */
[hidden] { display: none !important; }
pre.ad-code { padding-right: 96px; }
.ad-mt-0 { margin-top: 0 !important; }
.ad-mt { margin-top: 18px; }
.ad-hide { display: none !important; }
.ad-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.ad-muted { color: var(--ad-muted); }
.ad-center { text-align: center; }
.ad-divider { height: 1px; background: var(--ad-line); margin: 20px 0; border: 0; }

@media print {
  .ad-topbar, .ad-header, .ad-footer, .ad-cta, .ad-wa-float, .ad-related, .ad-actions, .ad-crumbs { display: none !important; }
  body { background: #fff; color: #000; }
  .ad-panel { border-color: #ccc; background: #fff; }
}
