/* =========================================================
   Guía de Facturación · por CoreWorks — capa editorial sobre "El Libro Verde"
   Componentes de guía/artículo: TOC, prosa, definiciones, glosario,
   citas a fuente oficial (SAT/CFF/RMF), disclaimer, tabla de libro mayor,
   chips de clave SAT, sello fiscal y CTA de embudo (timbre → lucas.mx).
   ========================================================= */

/* ---- Ajustes de conversión y accesibilidad (capa overlay, gana por orden de carga) ---- */
:root {
  /* Contraste AA: el gris-tinta tenue sobre papel fallaba (~4.0:1). Lo oscurecemos. */
  --ink-faint: #566459;
}

/* CTA de embudo: acción + reaseguro apilados en la 2.ª columna del timbre */
.guia-cta__act { display: flex; flex-direction: column; gap: 10px; align-items: center; justify-content: center; }
.guia-cta__meta { font-family: var(--font-mono); font-size: 11px; font-weight: 600; letter-spacing: .04em; color: var(--ink-soft); text-align: center; max-width: 24ch; line-height: 1.4; }
@media (max-width: 720px) { .guia-cta__act { align-items: stretch; } .guia-cta__act .btn { width: 100%; justify-content: center; } }

/* Menú "Herramientas": apertura por click (accesible/táctil), además del hover */
.navtools.is-open > .navtools__menu { display: block; }
.navtools.is-open .navtools__btn svg { transform: rotate(180deg); }
/* En móvil el nav prioriza Herramientas + Prueba Lucas; las guías se descubren por el footer.
   Especificidad 0,2,0 para ganarle a la base .navtools{display:inline-flex}. */
@media (max-width: 560px) { .nav__actions .navtools--guias { display: none; } }
/* Que el nav (logo + Herramientas + Prueba Lucas) quepa en pantallas angostas sin recortarse */
@media (max-width: 430px) {
  .nav .nav__inner { padding-left: 12px; padding-right: 12px; }
  .nav .nav__actions { gap: 7px; }
  .nav .nav__actions .btn { padding: 8px 10px; font-size: 11.5px; }
  .nav .nav__actions .navtools__btn { gap: 4px; }
  .nav .nav__actions .navtools__btn svg { width: 10px; height: 10px; margin-left: -1px; }
  .nav .guia-logo b { font-size: 14.5px; }
  .nav .guia-logo span { font-size: 8px; letter-spacing: .08em; }
}

/* CTA pegajoso (móvil): la etiqueta usa el eslogan de Lucas, legible (no mayúsculas mono) */
.stickycta__alt { font-family: var(--font-body); font-size: 13px; font-weight: 600; letter-spacing: .005em; text-transform: none; color: var(--ink); flex: 0 1 auto; min-width: 0; }

/* ---- Diagnóstico "¿Qué necesitas para facturar?" (wizard) ---- */
.wiz__head { display: flex; align-items: center; gap: 14px; margin-bottom: 24px; }
.wiz__count { flex: none; min-width: 84px; font-family: var(--font-mono); font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-faint); }
.wiz__bar { flex: 1; height: 6px; background: var(--paper-soft); border: 1px solid var(--rule); border-radius: var(--r-pill); overflow: hidden; }
.wiz__fill { display: block; height: 100%; background: var(--teal-deep); border-radius: var(--r-pill); transition: width .32s ease; }
.wiz__step { display: none; }
.wiz__step.is-active { display: block; }
.wiz__q { font-family: var(--font-display); font-weight: 650; font-size: clamp(20px, 2.6vw, 27px); letter-spacing: -.014em; line-height: 1.16; color: var(--ink); margin: 0; outline: none; }
.wiz__opts { display: grid; gap: 11px; margin-top: 22px; }
.wiz__opt { display: block; cursor: pointer; }
.wiz__opt input { position: absolute; opacity: 0; width: 0; height: 0; }
.wiz__opt-in { display: block; padding: 15px 18px; background: var(--paper); border: 2px solid var(--rule); border-radius: var(--r-md); transition: border-color .16s, background .16s, box-shadow .16s; }
.wiz__opt:hover .wiz__opt-in { border-color: color-mix(in oklab, var(--teal) 42%, var(--rule)); }
.wiz__opt input:checked + .wiz__opt-in { border-color: var(--teal-deep); background: color-mix(in oklab, var(--teal) 7%, white); box-shadow: 0 0 0 3px color-mix(in oklab, var(--teal) 14%, transparent); }
.wiz__opt input:focus-visible + .wiz__opt-in { outline: 2px solid var(--teal-deep); outline-offset: 2px; }
.wiz__opt-in b { display: block; font-family: var(--font-display); font-weight: 650; font-size: 16.5px; color: var(--ink); }
.wiz__opt-in small { display: block; font-size: 13.5px; line-height: 1.5; color: var(--ink-soft); margin-top: 3px; }
.wiz__nav { display: flex; align-items: center; gap: 10px; margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--rule); }
.wiz__navspacer { flex: 1; }
.wiz__nav .btn[disabled] { opacity: .42; pointer-events: none; }
.wiz__rhead { font-family: var(--font-display); font-weight: 650; font-size: clamp(22px, 2.9vw, 29px); letter-spacing: -.016em; line-height: 1.12; color: var(--ink); }
.wiz__profile { font-size: 15.5px; line-height: 1.6; color: var(--ink-soft); margin-top: 10px; }
.wiz__profile b { color: var(--ink); font-weight: 600; }
.wiz__sub { font-family: var(--font-mono); font-size: 11px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-faint); margin-top: 28px; padding-bottom: 6px; border-bottom: 2px solid var(--teal-deep); }
.wiz__result .tool__reco { margin-top: 16px; }
.wiz__cta { margin-top: 22px; display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.wiz__cta .guia-cta__meta { text-align: left; }
@media (max-width: 520px) { .wiz__cta { align-items: stretch; } .wiz__cta .btn { width: 100%; justify-content: center; } .wiz__cta .guia-cta__meta { text-align: center; } }

/* ---- Rail derecho de spokes (desktop): tarjeta Lucas fija + guías populares ---- */
.guia-layout { display: grid; grid-template-columns: minmax(0,1fr) 284px; gap: clamp(30px,4vw,58px); align-items: start; max-width: 1080px; margin-inline: auto; }
.grail { position: sticky; top: 88px; display: flex; flex-direction: column; gap: 18px; }
.grail__card { border: 2px solid var(--teal-deep); border-radius: var(--r-lg); background: var(--card); padding: 22px; box-shadow: var(--sh-sm); }
.grail__k { font-family: var(--font-mono); font-size: 10.5px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--teal-deep); }
.grail__d { font-size: 13.5px; line-height: 1.55; color: var(--ink-soft); margin: 10px 0 15px; }
.grail__d strong { color: var(--ink); }
.grail__card .btn { width: 100%; justify-content: center; }
.grail__meta { display: block; text-align: center; margin-top: 9px; font-family: var(--font-mono); font-size: 10.5px; font-weight: 600; letter-spacing: .06em; color: var(--ink-soft); }
.grail__nav { border: 1px solid var(--rule); border-radius: var(--r-md); background: var(--paper-soft); padding: 16px 18px; }
.grail__nav .grail__k { color: var(--ink-faint); margin-bottom: 8px; }
.grail__nav a { display: block; padding: 7px 0; font-size: 13.5px; color: var(--ink-soft); text-decoration: none; border-bottom: 1px solid var(--rule-soft); transition: color .16s; }
.grail__nav a:last-child { border-bottom: none; }
.grail__nav a:hover { color: var(--teal-deep); }
@media (max-width: 980px) {
  .guia-layout { display: block; max-width: 730px; }
  .grail { display: none; }
}

/* ---- Skip link (accesibilidad) ---- */
.skip { position: absolute; left: -9999px; top: 0; z-index: 100; background: var(--ink); color: var(--paper); padding: 11px 18px; font-family: var(--font-body); font-size: 14px; font-weight: 600; border-radius: 0 0 var(--r-sm) 0; }
.skip:focus { left: 0; }

/* ---- Botón flotante de WhatsApp ---- */
.wa-float { position: fixed; right: 20px; bottom: 24px; z-index: 60; width: 54px; height: 54px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: #25D366; box-shadow: 0 10px 26px -8px rgba(18,40,30,.5); transition: transform .18s; }
.wa-float:hover { transform: scale(1.06); }
.wa-float svg { width: 30px; height: 30px; fill: #fff; }
.wa-float__lbl { position: absolute; }
@media (max-width: 980px) { .wa-float { right: 16px; bottom: 82px; width: 50px; height: 50px; } .wa-float svg { width: 27px; height: 27px; } }

/* ---- Franja de confianza (prueba social de bajo riesgo) ---- */
.trust { display: flex; flex-wrap: wrap; gap: 12px 26px; align-items: center; justify-content: center; padding: 16px 20px; margin: 24px 0; border: 1px dashed var(--rule); border-radius: var(--r-md); background: var(--paper-soft); }
.trust__item { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-mono); font-size: 11.5px; letter-spacing: .03em; color: var(--ink-soft); }
.trust__item svg { width: 16px; height: 16px; stroke: var(--teal-deep); fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.trust__item b { color: var(--ink); font-weight: 600; }

/* ---- Objetivos táctiles: cifras/claves copiables cómodas en móvil ---- */
@media (max-width: 640px) { .iva__v { min-height: 38px; display: inline-flex; align-items: center; } }

/* ---- Boletín / captura de lead (SendGrid) ---- */
.leadband { border-top: 1px solid var(--rule); background: var(--paper-soft); }
.leadband__inner { display: grid; grid-template-columns: 1fr minmax(280px, 400px); gap: clamp(24px, 4vw, 56px); align-items: center; padding: clamp(34px, 5vw, 56px) 0; }
.leadband__k { font-family: var(--font-mono); font-size: 11px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--teal-deep); }
.leadband__t { font-family: var(--font-display); font-weight: 650; font-size: clamp(21px, 2.7vw, 29px); letter-spacing: -.015em; color: var(--ink); margin-top: 8px; line-height: 1.14; }
.leadband__d { font-size: 15px; line-height: 1.6; color: var(--ink-soft); margin-top: 10px; max-width: 46ch; }
.leadform { display: grid; gap: 10px; }
.leadform__row { display: flex; gap: 10px; }
.leadform__in { flex: 1; min-width: 0; font-family: var(--font-body); font-size: 16px; color: var(--ink); background: var(--paper); border: 2px solid var(--rule); border-radius: var(--r-md); padding: 13px 16px; -webkit-appearance: none; }
.leadform__in:focus { outline: none; border-color: var(--teal-deep); }
.leadform__hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.leadform__msg { font-family: var(--font-mono); font-size: 12px; color: var(--ink-soft); min-height: 1em; margin: 2px 0 0; }
.leadform__msg.is-ok { color: var(--teal-deep); }
.leadform__fine { font-size: 11.5px; line-height: 1.5; color: var(--ink-faint); margin: 0; }
.leadform__fine a { color: var(--teal-deep); text-decoration: underline; text-underline-offset: 2px; }
@media (max-width: 760px) { .leadband__inner { grid-template-columns: 1fr; } }
@media (max-width: 420px) { .leadform__row { flex-direction: column; } .leadform__row .btn { width: 100%; justify-content: center; } }

/* ---- Wordmark ---- */
.guia-logo { display: inline-flex; align-items: baseline; gap: 9px; line-height: 1; }
.guia-logo b { font-family: var(--font-display); font-weight: 650; font-size: 18px; letter-spacing: -.01em; color: var(--ink); }
.guia-logo span { font-family: var(--font-mono); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-faint); }
@media (max-width: 640px) { .guia-logo span { display: none; } .guia-logo b { font-size: 16.5px; } }

/* ---- Nav compacto en móvil ---- */
@media (max-width: 560px) {
  .nav__actions .btn--ghost { display: none; } /* el logo ya lleva al home */
  .nav__actions .btn--grad.btn--sm { padding: 8px 12px; font-size: 12.5px; white-space: nowrap; }
}

/* ---- Hero: meta / badges ---- */
.gmeta { display: flex; flex-wrap: wrap; gap: 10px 20px; margin-top: 24px; }
.gmeta__item { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-mono); font-size: 12px; color: var(--ink-soft); }
.gmeta__item svg { width: 15px; height: 15px; stroke: var(--teal-deep); fill: none; stroke-width: 1.8; flex: none; }

/* ---- Sello fiscal (marca de goma) ---- */
.sello {
  display: inline-block; font-family: var(--font-mono); font-size: 10.5px; font-weight: 600;
  letter-spacing: .18em; text-transform: uppercase; color: var(--teal-deep);
  border: 2px solid currentColor; border-radius: 5px; padding: 7px 12px;
  transform: rotate(-2.5deg); opacity: .88;
  box-shadow: inset 0 0 0 1.5px var(--paper), inset 0 0 0 2.5px currentColor;
  background: color-mix(in oklab, var(--teal) 5%, transparent);
}
.sello--rojo { color: var(--alert); background: color-mix(in oklab, var(--alert) 5%, transparent); }

/* ---- Layout: TOC + artículo ---- */
.guia-grid { display: grid; grid-template-columns: 228px 1fr; gap: clamp(28px, 5vw, 64px); align-items: start; }
.toc { position: sticky; top: 92px; }
.toc__label { font-family: var(--font-mono); font-size: 11px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-faint); margin-bottom: 14px; }
.toc__list { list-style: none; padding: 0; margin: 0; display: grid; gap: 1px; border-left: 2px solid var(--rule); }
.toc__list a { display: block; padding: 8px 0 8px 16px; margin-left: -2px; border-left: 2px solid transparent; font-size: 14px; color: var(--ink-soft); text-decoration: none; transition: color .2s, border-color .2s; }
.toc__list a:hover { color: var(--ink); }
.toc__list a.is-active { color: var(--teal-deep); border-left-color: var(--teal); font-weight: 500; }
@media (max-width: 920px) {
  .guia-grid { grid-template-columns: 1fr; }
  .toc { position: static; margin-bottom: 26px; }
  .toc__list { display: flex; flex-wrap: wrap; gap: 8px; border-left: none; }
  .toc__list a { padding: 7px 13px; margin: 0; border-left: none; background: var(--paper-soft); border: 1px solid var(--rule); border-radius: var(--r-pill); }
  .toc__list a.is-active { border-color: var(--teal); }
}

/* ---- Artículo / prosa ---- */
.article { max-width: 730px; }
.asec { scroll-margin-top: 90px; }
.asec + .asec { border-top: 1px solid var(--rule); margin-top: clamp(36px, 5vw, 60px); padding-top: clamp(36px, 5vw, 60px); }
.asec__n { font-family: var(--font-mono); font-size: 12px; font-weight: 600; letter-spacing: .1em; color: var(--teal-deep); }
.article h2 { font-family: var(--font-display); font-weight: 650; font-size: clamp(25px, 3vw, 33px); letter-spacing: -.014em; color: var(--ink); line-height: 1.12; margin-top: 8px; }
.article h3 { font-family: var(--font-display); font-weight: 650; font-size: 19px; letter-spacing: -.008em; color: var(--ink); margin-top: 28px; }
.article p { font-size: 16.5px; line-height: 1.72; color: var(--ink-soft); margin-top: 14px; }
.article p strong { color: var(--ink); font-weight: 600; }
.article .lead-p { font-size: 18px; color: var(--ink); }
.article ul.bullets { margin-top: 16px; padding: 0; list-style: none; display: grid; gap: 11px; }
.article ul.bullets li { position: relative; padding-left: 27px; font-size: 16px; line-height: 1.6; color: var(--ink-soft); }
.article ul.bullets li::before { content: ""; position: absolute; left: 4px; top: 9px; width: 7px; height: 7px; border-radius: 2px; background: var(--teal); }
.article ul.bullets li strong { color: var(--ink); }
.inlink { color: var(--teal-deep); text-decoration: underline; text-underline-offset: 2px; }

/* ---- Pasos numerados (cómo facturar) ---- */
.pasos { counter-reset: paso; margin-top: 22px; display: grid; gap: 14px; padding: 0; list-style: none; }
.pasos li { counter-increment: paso; position: relative; padding: 16px 18px 16px 62px; background: var(--card); border: 1px solid var(--rule); border-radius: var(--r-md); box-shadow: var(--sh-sm); }
.pasos li::before {
  content: counter(paso, decimal-leading-zero); position: absolute; left: 16px; top: 16px;
  font-family: var(--font-mono); font-size: 15px; font-weight: 600; color: var(--teal-deep);
  border-bottom: 2px solid var(--teal); padding-bottom: 2px;
}
.pasos li b, .pasos li strong { color: var(--ink); }
.pasos li p { margin-top: 6px; font-size: 15px; line-height: 1.6; color: var(--ink-soft); }
.paso__t { font-family: var(--font-display); font-weight: 650; font-size: 17px; color: var(--ink); }

/* ---- Tabla de libro mayor (claves y catálogos) ---- */
.tbl-scroll { overflow-x: auto; margin-top: 20px; border: 1px solid var(--rule); border-radius: var(--r-md); background: var(--card); box-shadow: var(--sh-sm); }
.ledger { width: 100%; border-collapse: collapse; font-size: 14.5px; min-width: 480px; }
.ledger th { font-family: var(--font-mono); font-size: 11px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; text-align: left; color: var(--ink-faint); padding: 12px 16px; border-bottom: 2px solid var(--teal-deep); background: var(--paper-soft); }
.ledger td { padding: 12px 16px; border-bottom: 1px solid var(--rule-soft); color: var(--ink-soft); line-height: 1.5; vertical-align: top; }
.ledger tr:last-child td { border-bottom: none; }
.ledger td strong { color: var(--ink); }

/* ---- Chip de clave SAT ---- */
.clave {
  display: inline-block; font-family: var(--font-mono); font-size: 12.5px; font-weight: 600;
  color: var(--teal-deep); background: color-mix(in oklab, var(--teal) 10%, white);
  border: 1px solid color-mix(in oklab, var(--teal) 30%, var(--rule));
  border-radius: 4px; padding: 2px 8px; white-space: nowrap;
}
.clave--rojo { color: var(--alert); background: color-mix(in oklab, var(--alert) 8%, white); border-color: color-mix(in oklab, var(--alert) 26%, var(--rule)); }

/* ---- Tarjeta de definición ---- */
.def { background: var(--card); border: 1px solid var(--rule); border-left: 3px solid var(--teal); border-radius: 0 var(--r-md) var(--r-md) 0; padding: 16px 18px; margin-top: 16px; box-shadow: var(--sh-sm); }
.def__t { font-family: var(--font-display); font-weight: 650; font-size: 16px; color: var(--ink); }
.def__d { font-size: 15px; line-height: 1.6; color: var(--ink-soft); margin-top: 6px; }
.def__src { display: inline-block; font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .02em; color: var(--ink-faint); margin-top: 9px; }

/* ---- Glosario (grid de definiciones) ---- */
.glos { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin-top: 20px; }
@media (max-width: 600px) { .glos { grid-template-columns: 1fr; } }
.glos .def { margin-top: 0; }

/* ---- Callout / nota ---- */
.callout { display: flex; gap: 12px; background: color-mix(in oklab, var(--teal) 7%, white); border: 1px solid color-mix(in oklab, var(--teal) 24%, var(--rule)); border-radius: var(--r-md); padding: 14px 16px; margin-top: 20px; }
.callout svg { width: 20px; height: 20px; stroke: var(--teal-deep); fill: none; stroke-width: 1.8; flex: none; margin-top: 1px; }
.callout p { margin: 0; font-size: 14.5px; line-height: 1.58; color: var(--ink-soft); }
.callout b { color: var(--ink); }
/* variante de plazo/multa: tinta de sello rojo */
.callout--plazo { background: color-mix(in oklab, var(--alert) 6%, white); border-color: color-mix(in oklab, var(--alert) 22%, var(--rule)); }
.callout--plazo svg { stroke: var(--alert); }

/* ---- Disclaimer ---- */
.disclaimer { display: flex; gap: 12px; background: var(--paper-soft); border: 1px solid var(--rule); border-radius: var(--r-md); padding: 14px 16px; }
.disclaimer svg { width: 20px; height: 20px; stroke: #b07717; fill: none; stroke-width: 1.8; flex: none; margin-top: 1px; }
.disclaimer p { margin: 0; font-size: 13.5px; line-height: 1.58; color: var(--ink-soft); }
.disclaimer b { color: var(--ink); }

/* ---- Fuentes oficiales ---- */
.sources { display: grid; gap: 9px; margin-top: 16px; }
.sources a { display: flex; gap: 9px; align-items: center; font-size: 14px; color: var(--teal-deep); text-decoration: none; }
.sources a:hover { text-decoration: underline; text-underline-offset: 2px; }
.sources a svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.7; flex: none; }

/* ---- CTA de embudo a Lucas: el timbre ---- */
.guia-cta {
  position: relative; background: var(--card); border: 2px solid var(--teal-deep); border-radius: var(--r-lg);
  padding: clamp(26px, 4vw, 42px); box-shadow: var(--sh-sm);
  outline: 2px dashed color-mix(in oklab, var(--teal-deep) 45%, transparent); outline-offset: 7px;
  display: grid; grid-template-columns: 1fr auto; gap: clamp(20px, 3vw, 40px); align-items: center;
  margin-block: 14px;
}
.guia-cta::before {
  content: "TIMBRADO POR LUCAS"; position: absolute; top: -13px; right: 22px;
  font-family: var(--font-mono); font-size: 9.5px; font-weight: 600; letter-spacing: .2em;
  color: var(--teal-deep); background: var(--card); border: 1.5px solid var(--teal-deep);
  border-radius: 4px; padding: 4px 9px; transform: rotate(1.6deg);
}
.guia-cta__t { font-family: var(--font-display); font-weight: 650; font-size: clamp(21px, 2.4vw, 27px); letter-spacing: -.012em; color: var(--ink); line-height: 1.14; }
.guia-cta__d { font-size: 15px; line-height: 1.62; color: var(--ink-soft); margin-top: 9px; max-width: 50ch; }
.guia-cta__d strong { color: var(--ink); }
@media (max-width: 720px) { .guia-cta { grid-template-columns: 1fr; } }

/* ---- Preguntas frecuentes (acordeón accesible) ---- */
.faqlist { margin-top: 22px; border-top: 1px solid var(--rule); }
.faq-item { border-bottom: 1px solid var(--rule); }
.faq-item > summary { cursor: pointer; list-style: none; display: flex; gap: 16px; align-items: flex-start; justify-content: space-between; padding: 18px 2px; font-family: var(--font-display); font-weight: 650; font-size: 18px; line-height: 1.3; color: var(--ink); transition: color .18s; }
.faq-item > summary::-webkit-details-marker { display: none; }
.faq-item > summary::after { content: "+"; font-family: var(--font-mono); font-size: 22px; line-height: 1; color: var(--teal-deep); flex: none; }
.faq-item[open] > summary::after { content: "\2013"; }
.faq-item > summary:hover { color: var(--teal-deep); }
.faq-a { padding: 0 2px 20px; }
.faq-a p { margin-top: 0; font-size: 15.5px; line-height: 1.68; color: var(--ink-soft); }
.faq-a p + p { margin-top: 10px; }
.faq-a a { color: var(--teal-deep); text-decoration: underline; text-underline-offset: 2px; }
.faq-a strong { color: var(--ink); font-weight: 600; }

/* ---- Footer extra ---- */
.gfoot-note { font-size: 13px; line-height: 1.6; color: var(--ink-faint); max-width: 60ch; }

/* =========================================================
   Home: tarjetas de herramientas + índice de guías
   ========================================================= */
.htools { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin-top: 24px; }
@media (max-width: 620px) { .htools { grid-template-columns: 1fr; } }
.htool { display: flex; flex-direction: column; gap: 11px; padding: 22px 20px; background: var(--card); border: 1px solid var(--rule); border-radius: var(--r-lg); box-shadow: var(--sh-sm); text-decoration: none; transition: transform .16s, box-shadow .16s, border-color .16s; }
.htool:hover { transform: translateY(-3px); box-shadow: var(--sh-md); border-color: color-mix(in oklab, var(--teal) 42%, var(--rule)); }
.htool__ic { width: 44px; height: 44px; display: grid; place-items: center; border-radius: var(--r-md); background: color-mix(in oklab, var(--teal) 12%, white); color: var(--teal-deep); }
.htool__ic svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.9; }
.htool__t { font-family: var(--font-display); font-weight: 650; font-size: 18px; line-height: 1.12; color: var(--ink); }
.htool__d { font-size: 14px; line-height: 1.55; color: var(--ink-soft); }
.htool__go { margin-top: auto; padding-top: 4px; font-family: var(--font-mono); font-size: 12px; font-weight: 600; letter-spacing: .04em; color: var(--teal-deep); }

.hindex { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 20px; }
@media (max-width: 620px) { .hindex { grid-template-columns: 1fr; } }
.hindex a { padding: 13px 16px; background: var(--paper-soft); border: 1px solid var(--rule); border-radius: var(--r-md); text-decoration: none; transition: background .16s, border-color .16s; }
.hindex a:hover { background: var(--card); border-color: color-mix(in oklab, var(--teal) 32%, var(--rule)); }
.hindex b { display: block; font-family: var(--font-display); font-weight: 650; font-size: 15.5px; color: var(--ink); }
.hindex span { display: block; font-size: 12.5px; color: var(--ink-faint); margin-top: 2px; }

/* =========================================================
   Calculadora de IVA
   ========================================================= */
.iva__controls { display: flex; flex-wrap: wrap; gap: 22px 32px; }
.iva__glabel { display: block; font-family: var(--font-mono); font-size: 11px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-faint); margin-bottom: 9px; }
.iva__seg { display: inline-flex; gap: 4px; padding: 4px; background: var(--paper-soft); border: 1px solid var(--rule); border-radius: var(--r-pill); }
.iva__seg button { font-family: var(--font-mono); font-size: 13px; font-weight: 600; letter-spacing: .01em; color: var(--ink-soft); padding: 8px 15px; border-radius: var(--r-pill); transition: color .16s, background .16s; }
.iva__seg button:hover { color: var(--ink); }
.iva__seg button.is-active { background: var(--teal-deep); color: #fff; }

.iva__amountwrap { position: relative; margin-top: 20px; }
.iva__amountwrap .cur { position: absolute; left: 18px; top: 50%; transform: translateY(-50%); font-family: var(--font-mono); font-size: 20px; color: var(--ink-faint); pointer-events: none; }
.iva__amount { width: 100%; font-family: var(--font-body); font-size: 22px; font-weight: 500; color: var(--ink); background: var(--paper); border: 2px solid var(--rule); border-radius: var(--r-md); padding: 15px 18px 15px 42px; -webkit-appearance: none; }
.iva__amount:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 4px color-mix(in oklab, var(--teal) 16%, transparent); }

.iva__out { margin-top: 22px; border: 1px solid var(--rule); border-radius: var(--r-md); background: var(--card); overflow: hidden; box-shadow: var(--sh-sm); }
.iva__row { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 15px 20px; border-bottom: 1px solid var(--rule-soft); }
.iva__row:last-child { border-bottom: none; }
.iva__row--total { background: color-mix(in oklab, var(--teal) 8%, var(--card)); border-top: 2px solid var(--teal-deep); }
.iva__k { font-size: 15px; color: var(--ink-soft); }
.iva__row--total .iva__k { font-family: var(--font-display); font-weight: 650; font-size: 18px; color: var(--ink); }
.iva__v { font-family: var(--font-mono); font-size: 16px; font-weight: 500; color: var(--ink); cursor: pointer; border-radius: 4px; padding: 2px 6px; transition: background .16s, color .16s; white-space: nowrap; }
.iva__v:hover { background: color-mix(in oklab, var(--teal) 12%, white); }
.iva__v.is-copied { background: var(--teal); color: #fff; }
.iva__row--total .iva__v { font-size: 21px; font-weight: 600; color: var(--teal-deep); }
.iva__hint { margin-top: 12px; font-family: var(--font-mono); font-size: 11.5px; color: var(--ink-faint); text-align: center; }

/* =========================================================
   Nav: menú de Herramientas (desplegable, CSS puro)
   ========================================================= */
.navtools { position: relative; display: inline-flex; }
.navtools__btn { display: inline-flex; align-items: center; gap: 6px; }
.navtools__btn svg { width: 12px; height: 12px; stroke: currentColor; fill: none; stroke-width: 2.6; transition: transform .2s; }
.navtools__menu {
  position: absolute; right: 0; top: calc(100% + 9px); min-width: 268px; max-width: 84vw;
  background: var(--card); border: 1px solid var(--rule); border-radius: var(--r-md);
  box-shadow: var(--sh-lg); padding: 6px; display: none; z-index: 70;
}
.navtools__menu::before { content: ""; position: absolute; left: 0; right: 0; top: -9px; height: 9px; }
.navtools:hover .navtools__menu,
.navtools:focus-within .navtools__menu { display: block; }
.navtools:hover .navtools__btn svg,
.navtools:focus-within .navtools__btn svg { transform: rotate(180deg); }
.navtools__menu a { display: block; padding: 9px 12px; border-radius: var(--r-sm); text-decoration: none; }
.navtools__menu a:hover { background: var(--paper-soft); }
.navtools__menu b { display: block; font-family: var(--font-body); font-size: 14px; font-weight: 600; color: var(--ink); }
.navtools__menu small { display: block; font-family: var(--font-mono); font-size: 11px; color: var(--ink-faint); margin-top: 2px; }
/* móvil: mantener el botón de menú aunque los ghost se oculten */
@media (max-width: 560px) {
  .nav__actions .navtools__btn { display: inline-flex; padding: 8px 12px; font-size: 12.5px; }
  .navtools__menu { min-width: 236px; }
}

/* ---- Firma de autor (E-E-A-T) ---- */
.byline { margin-top: 16px; font-family: var(--font-mono); font-size: 12.5px; letter-spacing: .01em; color: var(--ink-faint); }
.byline a { color: var(--teal-deep); text-decoration: underline; text-underline-offset: 2px; }
.byline strong { font-family: var(--font-body); font-weight: 600; color: var(--ink-soft); }
.authorcard { display: flex; gap: 16px; align-items: flex-start; background: var(--card); border: 1px solid var(--rule); border-left: 3px solid var(--teal); border-radius: 0 var(--r-md) var(--r-md) 0; padding: 18px 20px; margin-top: 16px; box-shadow: var(--sh-sm); }
.authorcard__mono { flex: none; width: 46px; height: 46px; display: grid; place-items: center; border-radius: 50%; background: var(--teal-deep); color: #fff; font-family: var(--font-display); font-weight: 650; font-size: 19px; }
.authorcard__b p { margin: 0; }
.authorcard__b p + p { margin-top: 8px; }

/* =========================================================
   Herramienta: Buscador de claves SAT
   ========================================================= */
.tool {
  background: var(--card); border: 1px solid var(--rule); border-radius: var(--r-lg);
  box-shadow: var(--sh-md); padding: clamp(16px, 2.5vw, 26px); overflow: hidden;
}
.tool__tabs { display: inline-flex; gap: 4px; padding: 4px; background: var(--paper-soft); border: 1px solid var(--rule); border-radius: var(--r-pill); }
.tool__tab {
  font-family: var(--font-mono); font-size: 12.5px; font-weight: 600; letter-spacing: .02em;
  color: var(--ink-soft); padding: 8px 16px; border-radius: var(--r-pill); transition: color .18s, background .18s;
}
.tool__tab:hover { color: var(--ink); }
.tool__tab.is-active { background: var(--teal-deep); color: #fff; }

.tool__searchwrap { position: relative; margin-top: 16px; }
.tool__searchwrap svg { position: absolute; left: 18px; top: 50%; transform: translateY(-50%); width: 21px; height: 21px; stroke: var(--teal-deep); fill: none; stroke-width: 2; pointer-events: none; }
.tool__input {
  width: 100%; font-family: var(--font-body); font-size: 17px; color: var(--ink);
  background: var(--paper); border: 2px solid var(--rule); border-radius: var(--r-md);
  padding: 16px 18px 16px 50px; transition: border-color .18s, box-shadow .18s; -webkit-appearance: none;
}
.tool__input::placeholder { color: var(--ink-faint); }
.tool__input:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 4px color-mix(in oklab, var(--teal) 16%, transparent); }
.tool__input::-webkit-search-cancel-button { -webkit-appearance: none; }

.tool__hintrow { margin-top: 14px; font-family: var(--font-mono); font-size: 12px; color: var(--ink-faint); display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.tool__hint {
  font-family: var(--font-body); font-size: 13px; color: var(--teal-deep);
  background: color-mix(in oklab, var(--teal) 8%, white); border: 1px solid color-mix(in oklab, var(--teal) 26%, var(--rule));
  border-radius: var(--r-pill); padding: 5px 12px; transition: background .16s, border-color .16s;
}
.tool__hint:hover { background: color-mix(in oklab, var(--teal) 16%, white); border-color: var(--teal); }

.tool__status { margin-top: 16px; font-family: var(--font-mono); font-size: 12px; color: var(--ink-faint); letter-spacing: .01em; }

.tool__results { margin-top: 6px; display: grid; gap: 0; max-height: 520px; overflow-y: auto; }
.tool__results:not(:empty) { margin-top: 14px; border: 1px solid var(--rule); border-radius: var(--r-md); background: var(--paper); }
.hit { display: flex; gap: 14px; align-items: flex-start; padding: 13px 16px; border-bottom: 1px solid var(--rule-soft); }
.hit:last-child { border-bottom: none; }
.hit__c { flex: none; cursor: pointer; margin-top: 1px; min-width: 78px; text-align: center; transition: background .16s, color .16s, border-color .16s; }
.hit__c:hover { background: var(--teal-deep); color: #fff; border-color: var(--teal-deep); }
.hit__c.is-copied { background: var(--teal); color: #fff; border-color: var(--teal); min-width: 92px; }
.hit__body { min-width: 0; }
.hit__d { font-size: 15.5px; line-height: 1.4; color: var(--ink); font-weight: 500; }
.hit__s { font-family: var(--font-mono); font-size: 11.5px; line-height: 1.45; color: var(--ink-faint); margin-top: 4px; }
.tool__empty, .tool__more { padding: 22px 18px; font-size: 14.5px; color: var(--ink-soft); text-align: center; }
.tool__more { font-family: var(--font-mono); font-size: 12px; color: var(--ink-faint); border-top: 1px solid var(--rule-soft); }
.tool__approx { padding: 11px 16px; font-size: 13px; line-height: 1.5; color: var(--ink-soft); background: color-mix(in oklab, var(--teal) 7%, var(--paper-soft)); border-bottom: 1px solid var(--rule-soft); }

/* ---- Selector de uso por régimen ---- */
.tool__label { display: block; font-family: var(--font-mono); font-size: 11.5px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-faint); margin-bottom: 10px; }
.tool__selectwrap { position: relative; }
.tool__selectwrap::after { content: ""; position: absolute; right: 20px; top: 50%; width: 10px; height: 10px; border-right: 2px solid var(--teal-deep); border-bottom: 2px solid var(--teal-deep); transform: translateY(-70%) rotate(45deg); pointer-events: none; }
.tool__select {
  width: 100%; font-family: var(--font-body); font-size: 16.5px; color: var(--ink);
  background: var(--paper); border: 2px solid var(--rule); border-radius: var(--r-md);
  padding: 15px 44px 15px 18px; cursor: pointer; -webkit-appearance: none; appearance: none;
  transition: border-color .18s, box-shadow .18s;
}
.tool__select:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 4px color-mix(in oklab, var(--teal) 16%, transparent); }
.tool__select optgroup { font-family: var(--font-body); font-weight: 700; color: var(--ink); }
.tool__select option { font-weight: 400; color: var(--ink); }

.tool__reco { display: flex; gap: 12px; align-items: flex-start; background: color-mix(in oklab, var(--teal) 9%, white); border: 1px solid color-mix(in oklab, var(--teal) 28%, var(--rule)); border-radius: var(--r-md); padding: 14px 16px; margin-top: 18px; }
.tool__reco svg { width: 20px; height: 20px; stroke: var(--teal-deep); fill: none; stroke-width: 1.8; flex: none; margin-top: 1px; }
.tool__reco p { margin: 0; font-size: 14.5px; line-height: 1.55; color: var(--ink-soft); }
.tool__reco b { color: var(--ink); }
.tool__reco .clave { margin-right: 2px; }

/* ---- Semáforo de plazos ---- */
.sem__panel { display: none; }
.sem__panel.is-active { display: block; }
.sem__field { margin-top: 18px; }
.sem__date {
  width: 100%; max-width: 340px; font-family: var(--font-body); font-size: 16.5px; color: var(--ink);
  background: var(--paper); border: 2px solid var(--rule); border-radius: var(--r-md); padding: 14px 16px; cursor: pointer;
}
.sem__date:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 4px color-mix(in oklab, var(--teal) 16%, transparent); }
.sem__personas { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.sem__persona input { position: absolute; opacity: 0; width: 0; height: 0; }
.sem__persona span { display: inline-block; padding: 9px 16px; border: 1px solid var(--rule); border-radius: var(--r-pill); background: var(--paper-soft); font-size: 14px; cursor: pointer; transition: background .16s, color .16s, border-color .16s; }
.sem__persona input:checked + span { background: var(--teal-deep); color: #fff; border-color: var(--teal-deep); }
.sem__persona input:focus-visible + span { outline: 2px solid var(--teal-deep); outline-offset: 2px; }

.sem__result { margin-top: 22px; }
.sem__card { display: flex; gap: 18px; align-items: flex-start; border: 1px solid var(--rule); border-left-width: 5px; border-radius: var(--r-md); padding: 18px 20px; box-shadow: var(--sh-sm); }
.sem__card--verde { border-left-color: var(--teal); background: color-mix(in oklab, var(--teal) 6%, white); }
.sem__card--ambar { border-left-color: #b07717; background: color-mix(in oklab, #b07717 8%, white); }
.sem__card--rojo { border-left-color: var(--alert); background: color-mix(in oklab, var(--alert) 6%, white); }
.sem__light { display: flex; flex-direction: column; gap: 8px; flex: none; padding: 2px 4px; background: #17211a; border-radius: var(--r-pill); }
.sem__dot { width: 15px; height: 15px; border-radius: 50%; background: #55605a; margin: 3px; }
.sem__dot--rojo.on { background: var(--alert); box-shadow: 0 0 9px 1px var(--alert); }
.sem__dot--ambar.on { background: #e2a12a; box-shadow: 0 0 9px 1px #e2a12a; }
.sem__dot--verde.on { background: var(--teal-bright); box-shadow: 0 0 9px 1px var(--teal-bright); }
.sem__body { min-width: 0; }
.sem__status { font-family: var(--font-display); font-weight: 650; font-size: clamp(19px, 2.4vw, 24px); line-height: 1.14; color: var(--ink); }
.sem__deadline { font-family: var(--font-mono); font-size: 12.5px; letter-spacing: .01em; color: var(--ink-soft); margin-top: 7px; }
.sem__note { font-size: 14.5px; line-height: 1.55; color: var(--ink-soft); margin-top: 11px; }
.sem__note b { color: var(--ink); }
.sem__prompt { padding: 26px 18px; text-align: center; color: var(--ink-faint); font-family: var(--font-mono); font-size: 13px; border: 1px dashed var(--rule); border-radius: var(--r-md); }

.tool__group { margin-top: 22px; }
.tool__group:first-child { margin-top: 20px; }
.tool__grouphead { display: flex; align-items: baseline; gap: 10px; padding-bottom: 8px; border-bottom: 2px solid var(--teal-deep); margin-bottom: 2px; }
.tool__grouphead h3 { font-family: var(--font-display); font-weight: 650; font-size: 17px; color: var(--ink); margin: 0; }
.tool__grouphead span { font-family: var(--font-mono); font-size: 11px; color: var(--ink-faint); }
.tool__grouplist { border: 1px solid var(--rule); border-top: none; border-radius: 0 0 var(--r-md) var(--r-md); background: var(--paper); }
.tool__prompt { padding: 30px 18px; text-align: center; color: var(--ink-faint); font-family: var(--font-mono); font-size: 13px; }
@media (max-width: 520px) {
  .hit { flex-direction: column; gap: 7px; }
  .hit__c { min-width: 0; align-self: flex-start; }
}
