/* ============================================================
   Centro de Ayuda Sushell · Diseño 2026
   Paleta del diseño oficial:
   - Acento:      #5A52FF  (hover #463FEB)
   - Claro:  bg #F4F4F2 · card #FFFFFF · borde #E4E4E0
   - Oscuro: bg #121212 · card #1E1E1E · borde #2E2E2E
   Tipos: Inter (sans) · JetBrains Mono (mono)
   ============================================================ */

:root {
  --accent: #5a52ff;
  --accent-hover: #463feb;
  --accent-soft: rgba(90, 82, 255, 0.1);
  --accent-soft-2: rgba(90, 82, 255, 0.2);
  --accent-ring: rgba(90, 82, 255, 0.45);

  /* Paleta del blog de Sushell (nueva identidad) */
  --bg: #f4f4f2;         /* fondo */
  --card: #ffffff;
  --border: #dcdcd8;     /* líneas (ln del blog) */
  --border-2: #d0d0ca;

  --ink: #121212;        /* texto principal (tx) */
  --ink-2: #3d3d3b;      /* texto de párrafos (tx2) */
  --muted: #6e6e6b;      /* texto secundario (gr) */
  --faint: #8a8a8a;
  --link: #5a52ff;       /* enlaces del blog */
  --chip: #eaeae6;       /* píldoras (pill) */
  --logo-slot: #dcdcd8;  /* fichas grises del logo del producto */
  --chip-h: #e0e0db;
  --code: #121212;       /* bloques de código */
  --hdr: rgba(244, 244, 242, 0.86); /* encabezado translúcido */

  --header-h: 57px;
  --panel-w: clamp(340px, 25vw, 380px);       /* ancho del chat lateral (como el Assistant de Recurrente) */
  --panel-total: calc(var(--panel-w) + 20px); /* desplazamiento del sitio (20 px de aire) */
  --panel-bg: #ffffff;   /* fondo del panel de chat (claro) */
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.1);
  --shadow-lg: 0 20px 50px rgba(15, 23, 42, 0.16);

  --radius: 10px;
  --radius-lg: 16px;
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'Cascadia Mono', monospace;
}

/* ── Oscuro (por defecto, elegido a mano como el blog) ─────── */
.dark {
  --bg: #121212;
  --card: #1e1e1e;
  --border: #2a2a2a;
  --border-2: #3a3a3a;

  --ink: #f4f4f2;
  --ink-2: #d6d6d3;
  --muted: #8a8a8a;
  --faint: #6e6e6b;
  --link: #a9a4ff;      /* acento de enlace en oscuro (blog) */
  --chip: #1c1c1c;
  --chip-h: #262626;
  --logo-slot: #454545;  /* fichas grises del logo (oscuro) */
  --panel-bg: #0c0c0c;   /* fondo del panel de chat (oscuro, más profundo que el sitio) */
  --code: #0c0c0c;
  --hdr: rgba(18, 18, 18, 0.86);

  --accent-soft: rgba(90, 82, 255, 0.16);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.5);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.65);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; overflow-x: clip; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  font-family: var(--font-sans);
  font-feature-settings: "cv11", "ss01";
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
  transition: background-color 0.2s ease, color 0.2s ease;
}

main { flex: 1; width: 100%; }

img, svg { max-width: 100%; display: block; }
a { color: var(--link); text-decoration: none; }
a:hover { color: var(--accent-hover); }

h1, h2, h3, h4 {
  font-family: var(--font-sans);
  color: var(--ink);
  margin: 0 0 0.6em;
  line-height: 1.2;
  letter-spacing: -0.03em;
  font-weight: 700;
  text-wrap: balance;
}

p { margin: 0 0 1em; color: var(--ink-2); }

::selection { background: #5a52ff; color: #fff; }
:focus-visible { outline: 2px solid var(--link); outline-offset: 3px; }

/* Scrollbar fino (como el diseño) */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(148, 163, 184, 0.3); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(148, 163, 184, 0.5); }

.container {
  width: 100%;
  max-width: 1280px;
  margin-inline: auto;
  padding-inline: 1.25rem;
}
@media (min-width: 640px)  { .container { padding-inline: 1.5rem; } }
@media (min-width: 1024px) { .container { padding-inline: 2rem; } }

.mono { font-family: var(--font-mono); }
.text-accent { color: var(--accent); }

/* ══ Botones ════════════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.55rem 1rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 0.9rem;
  line-height: 1.3;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}
.btn:hover { text-decoration: none; }

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 6px 18px rgba(90, 82, 255, 0.25);
}
.btn-primary:hover { background: var(--accent-hover); color: #fff; transform: translateY(-1px); }

.btn-outline {
  background: var(--card);
  border-color: var(--border);
  color: var(--ink-2);
}
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }

.btn-white {
  background: #fff;
  color: var(--accent);
  font-weight: 700;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}
.btn-white:hover { background: #eef0ff; color: var(--accent-hover); transform: translateY(-1px); }

/* ══ Header ═════════════════════════════════════════════════ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  width: 100%;
  border-bottom: 1px solid var(--border);
  background: var(--hdr);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

/* Cabecera de una fila: [categorías · logo centrado · acciones] */
.header-inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.75rem;
  padding-top: 11px;
  padding-bottom: 11px;
}
.pills { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.header-cats { grid-column: 1; justify-self: start; }
.brand { grid-column: 2; justify-self: center; }
.header-inner .nav-controls { grid-column: 3; justify-self: end; }

/* Marca: icono del blog + wordmark que se borra con el scroll */
.brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--ink);
  flex-shrink: 0;
}
.brand:hover { color: var(--ink); text-decoration: none; }

.brand-logo { width: 28px; height: 28px; flex: none; }

.wordmark {
  display: inline-flex;
  align-items: center;
  font-size: 18px;
  font-weight: 650;
  letter-spacing: -0.02em;
  line-height: 1;
  white-space: pre;
}
/* Guion bajo en color de acento mientras el texto se borra (monograma S_) */
.wm-us {
  color: var(--accent);
  opacity: 0;
  transition: opacity 0.12s ease;
}
.wm-us.visible { opacity: 1; }
/* Cursor de acento que parpadea mientras se borran las letras */
.wm-caret {
  display: inline-block;
  width: 2px;
  height: 1.05em;
  margin-left: 1px;
  background: var(--accent);
  border-radius: 1px;
  opacity: 0;
}
.wm-caret.on { opacity: 1; animation: caret 1s steps(1) infinite; }
@keyframes caret { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .wm-caret.on { animation: none; opacity: 0; }
  html, body { transition: none; }
}

/* Búsqueda */
.search-box {
  position: relative;
  flex: 1;
  max-width: 430px;
  margin-inline: 1rem;
}

.search-icon {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--faint);
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: 0.55rem 4.4rem 0.55rem 2.5rem;
  font-family: var(--font-sans);
  font-size: 0.875rem;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.search-input::placeholder { color: var(--faint); }
.search-input:focus { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }

.search-kbd {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--faint);
  border: 1px solid var(--border-2);
  border-radius: 4px;
  padding: 0.1rem 0.4rem;
  pointer-events: none;
  white-space: nowrap;
}

/* Desplegable de resultados */
.search-pop {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  padding: 0.35rem;
  display: none;
  max-height: 380px;
  overflow-y: auto;
  z-index: 60;
}
.search-pop.open { display: block; }

.search-hit {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  padding: 0.5rem 0.65rem;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: 0.85rem;
}
.search-hit:hover { background: var(--accent-soft); color: var(--ink); }

.hit-kind {
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 0.12rem 0.4rem;
  border-radius: 5px;
  background: var(--accent-soft);
  color: var(--accent);
  text-transform: uppercase;
}
.hit-title { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hit-cat { flex-shrink: 0; font-size: 0.7rem; color: var(--faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 34%; }

.search-empty {
  padding: 0.7rem 0.8rem;
  font-size: 0.8rem;
  color: var(--muted);
}
.search-empty strong { color: var(--accent); }

/* Controles derecha */
.nav-controls { display: flex; align-items: center; gap: 0.5rem; flex-shrink: 0; }

/* Píldoras del blog */
.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 34px;
  padding: 0 15px;
  border-radius: 999px;
  background: var(--chip);
  border: 1px solid var(--border);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 550;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.pill:hover { background: var(--chip-h); text-decoration: none; color: var(--ink); }

/* Botón Ask AI (píldora de acento con estrella) */
.btn-ai {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  height: 34px;
  padding: 0 15px;
  border-radius: 999px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
  font-family: var(--font-sans);
  font-weight: 550;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}
.btn-ai:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; }
.btn-ai:active { transform: scale(0.97); }
.btn-ai .spark { color: #ffd84d; }

.theme-toggle {
  width: 34px;
  height: 34px;
  padding: 0;
  justify-content: center;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--chip);
  border: 1px solid var(--border);
  color: var(--muted);
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.theme-toggle:hover { color: var(--link); border-color: var(--accent-soft-2); }
.theme-toggle .icon-sun { display: none; }
.dark .theme-toggle .icon-moon { display: none; }
.dark .theme-toggle .icon-sun { display: block; color: #fbbf24; }

@media (max-width: 800px) {
  .header-cats { display: none; }
}
@media (max-width: 900px) {
  .search-box { display: none; }
}
@media (max-width: 560px) {
  .btn-ai { padding: 0 11px; }
  .btn-ai span, .pill-cta { display: none; }
}

/* ══ Hero ═══════════════════════════════════════════════════ */
.hero {
  text-align: center;
  padding: 2.5rem 1.25rem;
  margin-bottom: 2.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(180deg, var(--accent-soft), transparent 70%),
    var(--card);
  transition: border-color 0.2s ease;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid var(--accent-soft-2);
  border-radius: 999px;
  padding: 0.3rem 0.85rem;
  margin-bottom: 1.1rem;
}
.hero-badge .s { font-weight: 700; }

.hero h1 {
  font-size: clamp(1.8rem, 4.5vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 0.8rem;
}
.hero h1 .s-mono {
  font-family: var(--font-mono);
  color: var(--accent);
  letter-spacing: -0.08em;
}

.hero-lead {
  color: var(--muted);
  max-width: 640px;
  margin: 0 auto 1.9rem;
  font-size: 0.95rem;
}

/* Búsqueda grande del hero */
.hero-search { position: relative; max-width: 620px; margin: 0 auto; }
.hero-search .search-icon { left: 1.05rem; width: 20px; height: 20px; }
.hero-search .search-input {
  padding: 0.95rem 6.6rem 0.95rem 3.1rem;
  font-size: 1rem;
  border-radius: 12px;
  border-color: var(--border);
  box-shadow: var(--shadow-md);
}
.hero-search .search-input:focus { box-shadow: 0 0 0 2px var(--accent-ring), var(--shadow-md); }
.hero-search .btn-hero {
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  padding: 0.55rem 1rem;
  border-radius: 8px;
}

/* ══ Secciones ══════════════════════════════════════════════ */
.section { margin-bottom: 3rem; }

.sec-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.4rem;
}
.sec-head h2 { margin: 0; font-size: 1.25rem; font-weight: 700; }
.sec-sub {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--faint);
  margin-top: 0.15rem;
}
.sec-action {
  border: none;
  background: none;
  color: var(--accent);
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0;
}
.sec-action:hover { text-decoration: underline; }

/* ══ Módulos 2x2 de producto ═══════════════════════════════ */
.mod-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}
@media (min-width: 640px)  { .mod-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .mod-grid { grid-template-columns: repeat(4, 1fr); } }

.mod-card {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 1.15rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--ink);
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}
.mod-card:hover {
  border-color: var(--accent-soft-2);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.mod-card.is-active {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 0 0 1px var(--accent), var(--shadow-md);
}

.mod-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.8rem;
}
.mod-ico {
  padding: 0.5rem;
  border-radius: 8px;
  background: var(--chip);
  display: inline-flex;
  transition: transform 0.2s ease;
}
.mod-card:hover .mod-ico { transform: scale(1.06); }
.mod-ico svg { width: 30px; height: 30px; }

.mod-badge {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 500;
  color: var(--ink-2);
  background: var(--chip);
  border-radius: 6px;
  padding: 0.18rem 0.45rem;
  white-space: nowrap;
}

.mod-card h3 {
  margin: 0 0 0.3rem;
  font-size: 1.08rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: color 0.15s ease;
}
.mod-card:hover h3 { color: var(--accent); }
.mod-card h3 .arr {
  font-size: 0.8rem;
  opacity: 0;
  transform: translateX(-6px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  color: var(--accent);
}
.mod-card:hover h3 .arr { opacity: 1; transform: translateX(0); }

.mod-desc {
  font-size: 0.78rem;
  color: var(--muted);
  margin: 0 0 1rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.mod-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border);
  padding-top: 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--muted);
}
.mod-foot .state { color: var(--accent); font-weight: 700; }
.mod-card.is-active .mod-foot { border-top-color: var(--accent-soft-2); }

/* Fila de chips (servicios del ecosistema) */
.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}
.chip-row-label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--faint);
  display: block;      /* etiqueta en línea propia: las filas de chips quedan alineadas */
  width: 100%;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.32rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--ink-2);
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}
.chip svg { color: var(--faint); transition: color 0.15s ease; flex: none; }
.chip svg { width: 15px; height: 15px; } /* iconos uniformes en todas las píldoras */
.chip:hover { border-color: var(--accent-soft-2); color: var(--accent); background: var(--accent-soft); text-decoration: none; }
.chip:hover svg { color: var(--accent); }
.chip.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.chip.active svg { color: #fff; }

/* ══ Tarjetas de artículo / guía ════════════════════════════ */
.doc-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}
@media (min-width: 768px) { .doc-grid { grid-template-columns: repeat(2, 1fr); } }

.article-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 1.4rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--ink);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.article-card:hover {
  border-color: var(--accent-soft-2);
  box-shadow: var(--shadow-md);
  text-decoration: none;
  color: var(--ink);
}

.ac-top { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; margin-bottom: 0.8rem; }

.tag-prod {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 8px;
  padding: 0.3rem 0.6rem;
}
.tag-prod svg { width: 13px; height: 13px; }

.cat-chip { font-size: 0.72rem; font-weight: 500; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.article-card h3 {
  margin: 0 0 0.5rem;
  font-size: 0.98rem;
  font-weight: 700;
  transition: color 0.15s ease;
}
.article-card:hover h3 { color: var(--accent); }

.ac-desc {
  font-size: 0.78rem;
  color: var(--muted);
  margin: 0 0 1rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ac-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border);
  padding-top: 0.75rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--accent);
}
.ac-foot .chev { transition: transform 0.2s ease; display: inline-flex; }
.article-card:hover .ac-foot .chev { transform: translateX(3px); }

/* Icono mini rejilla 2x2 dentro de etiquetas de producto */
.tag-prod .mod-mini svg { width: 14px; height: 14px; }

/* ══ Lista de guías (estilo docs Linear/Vercel) ═════════════ */
.doc-panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.2rem 1.1rem;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.doc-row {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 0.8rem 0.5rem;
  border-bottom: 1px solid var(--border);
  color: var(--ink);
  transition: background-color 0.15s ease, color 0.15s ease;
}
.doc-row:last-of-type { border-bottom: none; }
.doc-row:hover {
  background: var(--accent-soft);
  color: var(--accent);
  text-decoration: none;
}

.dr-cat {
  width: 150px;
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dr-title {
  flex: 1;
  font-weight: 500;
  font-size: 0.9rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dr-arrow {
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  color: var(--accent);
  display: inline-flex;
  flex-shrink: 0;
}
.doc-row:hover .dr-arrow { opacity: 1; transform: translateX(0); }

.doc-panel-foot {
  display: flex;
  justify-content: center;
  padding: 0.7rem 0.5rem 0.6rem;
  border-top: 1px solid var(--border);
}

@media (max-width: 640px) {
  .dr-cat { display: none; }
  .dr-title { white-space: normal; }
}

/* ══ Banner IA discreto (borde de acento, sin degradado) ════ */
.ai-banner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 1.1rem;
  padding: 1.6rem;
  border-radius: var(--radius-lg);
  background: var(--card);
  border: 1px solid var(--accent-soft-2);
  box-shadow: var(--shadow-sm);
  text-align: center;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}
@media (min-width: 640px) {
  .ai-banner { flex-direction: row; padding: 1.75rem 2rem; text-align: left; }
}
.ai-banner .ai-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 999px;
  padding: 0.18rem 0.7rem;
  margin-bottom: 0.6rem;
}
.ai-banner h3 { color: var(--ink); font-size: 1.15rem; margin: 0 0 0.35rem; }
.ai-banner p { color: var(--muted); font-size: 0.85rem; margin: 0; max-width: 620px; }
.ai-banner .btn { white-space: nowrap; }

/* ══ Cabecera de página (FAQ / Guías / artículo) ═══════════ */
.page-head {
  padding: 2.2rem 0 1.6rem;
  max-width: 780px;
  margin-inline: auto;
  text-align: center;
}
.page-head h1 { font-size: clamp(1.6rem, 4vw, 2.4rem); font-weight: 800; letter-spacing: -0.03em; }
.page-head p { color: var(--muted); margin: 0; font-size: 0.92rem; }

.crumbs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.45rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--muted);
  margin-bottom: 1.4rem;
}
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--accent); }
.crumbs .sep { opacity: 0.55; }
.crumbs .here { color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 46ch; }

/* ══ Página de artículo ═════════════════════════════════════ */
.article-wrap { max-width: 880px; margin-inline: auto; padding-bottom: 3.5rem; }

.art-head {
  padding: 1.75rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 1.75rem;
}
@media (min-width: 640px) { .art-head { padding: 2.25rem; } }

.art-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 0.6rem; margin-bottom: 1rem; }

.art-head h1 {
  font-size: clamp(1.5rem, 3.5vw, 2.2rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 0.9rem;
}

.art-summary {
  border-left: 2px solid var(--accent);
  padding: 0.15rem 0 0.15rem 1rem;
  color: var(--ink-2);
  font-size: 0.92rem;
  margin: 0;
}

.art-body {
  padding: 1.75rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 1.75rem;
}
@media (min-width: 640px) { .art-body { padding: 2.25rem; } }

/* Prosa (contenido markdown, tipografía del blog) */
.prose p { font-size: 18px; line-height: 1.65; color: var(--ink-2); margin: 0 0 24px; }
.prose p.lead { font-size: 21px; line-height: 1.5; color: var(--ink); }
.prose strong { color: var(--ink); font-weight: 600; }
.prose a { color: var(--link); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.prose a:hover { text-decoration-thickness: 2px; }
.prose h1 { font-size: 30px; }
.prose h2 {
  font-size: 25px;
  letter-spacing: -0.02em;
  font-weight: 650;
  line-height: 1.25;
  margin: 48px 0 14px;
  color: var(--ink);
  scroll-margin-top: 80px;
  border: none;
  padding: 0;
}
.prose h3 {
  font-size: 20px;
  letter-spacing: -0.02em;
  font-weight: 650;
  line-height: 1.3;
  margin: 36px 0 12px;
  color: var(--ink);
  scroll-margin-top: 80px;
}
.prose ul, .prose ol { margin: 0 0 24px 22px; color: var(--ink-2); }
.prose li { font-size: 18px; line-height: 1.65; color: var(--ink-2); margin: 6px 0; }
.prose li::marker { color: var(--muted); }
.prose blockquote {
  margin: 0 0 24px;
  padding: 0 0 0 16px;
  border-left: 2px solid var(--link);
  color: var(--ink-2);
  background: none;
  border-radius: 0;
}
.prose blockquote p { font-size: 20px; line-height: 1.55; color: var(--ink); margin-bottom: 8px; }
.prose hr { border: 0; border-top: 1px solid var(--border); margin: 36px 0; }
.prose pre {
  background: var(--code);
  color: #f4f4f2;
  padding: 16px 18px;
  border-radius: 8px;
  overflow: auto;
  font-size: 14px;
  line-height: 1.6;
  margin: 0 0 24px;
  border: 1px solid var(--border);
}
.prose pre code { background: none; padding: 0; color: #f4f4f2; font-size: inherit; font-weight: inherit; }
.prose code { font-family: var(--font-mono); font-size: 0.9em; }
.prose p code, .prose li code, .prose td code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  font-weight: 500;
  background: color-mix(in srgb, var(--link) 12%, transparent);
  color: var(--ink);
  padding: 0.1em 0.35em;
  border-radius: 4px;
}
.prose table { width: 100%; border-collapse: collapse; font-size: 16px; margin: 8px 0 28px; }
.prose th {
  text-align: left;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  padding: 0 12px 10px 0;
  border-bottom: 1px solid var(--ink);
  background: none;
}
.prose td { padding: 12px 12px 12px 0; border-bottom: 1px solid var(--border); color: var(--ink-2); border-left: none; border-right: none; }
.table-wrap { overflow-x: auto; margin: 8px 0 28px; }
.table-wrap table { margin: 0; }

@media (max-width: 760px) {
  .prose p, .prose li { font-size: 17px; line-height: 1.6; }
  .prose h2 { font-size: 21px; margin-top: 36px; }
  .prose h3 { font-size: 18px; }
}

/* ── Cabecera de artículo estilo blog ─────────────────────── */
.article-wrap.blog { max-width: 780px; }
.col { max-width: 660px; margin: 0 auto; }
.kicker { font-size: 13px; font-weight: 600; color: var(--muted); text-align: center; }
.kicker a { color: var(--link); }
.post-title {
  font-size: clamp(29px, 5vw, 48px);
  line-height: 1.08;
  letter-spacing: -0.03em;
  font-weight: 700;
  text-align: center;
  max-width: 720px;
  margin: 16px auto 0;
  text-wrap: balance;
}
.meta {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 22px;
  font-size: 14px;
  color: var(--muted);
  font-weight: 500;
}
.meta span + span::before { content: "·"; margin-right: 10px; }
.meta .au { color: var(--ink); font-weight: 550; }

/* Portada tipográfica opcional (como el blog) */
.page-hero { margin: 44px 0 56px; }
.page-hero figcaption { font-size: 13px; color: var(--muted); margin-top: 12px; }
.art.dark {
  background: #121212;
  border: 1px solid #2a2a2a;
  color: #fff;
  aspect-ratio: 16/9;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 40px;
  border-radius: 6px;
  overflow: hidden;
}
.dark .art.dark { background: #181818; }
.art.dark .t {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  font-size: 12px;
  letter-spacing: 0.14em;
  color: #8a8a8a;
  font-weight: 600;
  line-height: 1.5;
  text-align: right;
  text-transform: uppercase;
}
.art.dark .t .lg {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #fff;
  font-size: 19px;
  letter-spacing: -0.02em;
  text-transform: none;
  font-weight: 650;
}
.art.dark .art-logo { width: 30px; height: 30px; }
.art.dark .big {
  font-size: clamp(36px, 6.5vw, 72px);
  font-weight: 750;
  letter-spacing: -0.045em;
  line-height: 0.95;
  text-wrap: balance;
  overflow-wrap: break-word;
}
.art.dark .big em { font-style: normal; color: var(--accent); }
.art.dark .s {
  color: #d6d6d3;
  font-size: 16px;
  margin-top: 14px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

@media (max-width: 760px) {
  .page-hero { margin: 32px -8px 44px; }
  .art.dark { padding: 22px; aspect-ratio: 4/3; }
  .art.dark .t { font-size: 10px; }
  .art.dark .t .lg { font-size: 15px; }
  .art.dark .art-logo { width: 22px; height: 22px; }
  .art.dark .big { font-size: 44px; }
  .art.dark .s { font-size: 13px; }
}

/* Bloque final de artículo (como .foot-note del blog) */
.foot-note {
  margin-top: 48px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  font-size: 14px;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  align-items: center;
}
.foot-note .sh { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; }

/* Barra de feedback */
.feedback-bar {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 1.4rem;
  background: var(--chip);
  border: 1px solid var(--border);
  border-radius: 12px;
}
@media (min-width: 640px) { .feedback-bar { flex-direction: row; } }
.feedback-bar p { margin: 0; font-size: 0.88rem; font-weight: 500; color: var(--ink); }

.fb-btns { display: flex; align-items: center; gap: 0.6rem; }
.fb-btn {
  padding: 0.35rem 0.8rem;
  font-size: 0.78rem;
  border-radius: 8px;
  border: 1px solid var(--border-2);
  background: var(--card);
  color: var(--ink-2);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.fb-btn:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.fb-btn.sent { border-color: #10b981; color: #10b981; background: rgba(16, 185, 129, 0.1); }

.fb-thanks { color: #10b981; font-size: 0.78rem; font-weight: 600; margin-top: 0.6rem; }

.ask-link {
  border: none;
  background: none;
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  white-space: nowrap;
}
.ask-link:hover { text-decoration: underline; }

/* Guías relacionadas */
.related { margin-top: 2.25rem; }
.related h2 { font-size: 1.05rem; margin-bottom: 1rem; }

/* ══ Grupos (FAQ / índice de guías) ═════════════════════════ */
.group {
  margin-bottom: 2.25rem;
  scroll-margin-top: 84px;
}
.group[hidden] { display: none; }
.group-head {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-bottom: 1rem;
}
.group-head .mod-ico { padding: 0.4rem; background: var(--accent-soft); }
.group-head .mod-ico svg { width: 20px; height: 20px; color: var(--accent); }
.group-head h2 { margin: 0; font-size: 1.05rem; }
.group-count {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--faint);
  background: var(--chip);
  border-radius: 6px;
  padding: 0.15rem 0.45rem;
}

/* ══ FAQ (acordeón) ═════════════════════════════════════════ */
.faq-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  margin-bottom: 2.25rem;
}

.faq-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 0.65rem;
  transition: border-color 0.15s ease;
}
.faq-item summary {
  list-style: none;
  cursor: pointer;
  padding: 0.9rem 1.15rem;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  transition: color 0.15s ease;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: '+';
  font-family: var(--font-mono);
  color: var(--accent);
  font-size: 1.05rem;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}
.faq-item[open] { border-color: var(--accent-soft-2); }
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item summary:hover { color: var(--accent); }

.faq-answer { padding: 0 1.15rem 1.05rem; font-size: 0.86rem; color: var(--muted); }
.faq-answer p { color: var(--muted); margin-bottom: 0.4rem; }
.faq-answer a { font-weight: 600; }

/* ══ Footer (estilo blog: oscuro siempre) ═══════════════════ */
.site-footer {
  margin-top: 80px;
  background: var(--bg);
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 14px;
  transition: background-color 0.2s ease;
}
.dark .site-footer { background: #0c0c0c; border-top-color: #2a2a2a; }
.footer-inner {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 22px 0;
}

.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-size: 17px;
  font-weight: 650;
  letter-spacing: -0.02em;
}
.footer-brand:hover { color: var(--ink); text-decoration: none; }
.footer-logo { width: 24px; height: 24px; }
.footer-by { font-size: 13px; font-weight: 400; color: var(--muted); }

/* ══ Widget de chat: barra lateral tipo Assistant ════════
   Columna a altura completa, del lado derecho, sobre la punta
   del encabezado; el sitio entero se desplaza a la izquierda. */
.ask-panel {
  position: fixed;
  top: 0;
  bottom: 0;
  height: 100dvh; /* respaldo: garantiza que el chat llegue al borde inferior */
  right: 0;
  z-index: 45;
  width: var(--panel-w);
  max-width: 100vw;
  display: flex;
  flex-direction: column;
  background: var(--panel-bg);
  border: none;
  border-left: 1px solid var(--border);
  border-radius: 0;
  box-shadow: -24px 0 60px rgba(0, 0, 0, 0.25);
  overflow: hidden;
  transform: translateX(100%);
  visibility: hidden;
  transition: transform 0.28s ease, visibility 0.28s ease;
}
body.ask-abierto .ask-panel {
  transform: none;
  visibility: visible;
}

/* Empuje: TODO el sitio (encabezado incluido) se corre a la izquierda
   para dejarle la entrada al chat; el chat no tapa nada del sitio y
   queda un margen de aire de 20 px entre el contenido y el chat. */
body.ask-abierto {
  margin-right: var(--panel-total);
}
body {
  transition: background-color 0.2s ease, color 0.2s ease, margin-right 0.28s ease;
}

@media (max-width: 640px) {
  body.ask-abierto { margin-right: 0; }
  .ask-panel {
    top: 0;
    width: 100vw;
    z-index: 60;
    border-left: none;
    box-shadow: none;
  }
  .ask-panel .ask-msgs { padding: 1.25rem 1rem; }
}

.ask-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.8rem 0.9rem;
  border-bottom: 1px solid var(--border);
  background: var(--panel-bg);
}
.ask-head-title {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 13.5px;
  font-weight: 650;
  letter-spacing: -0.01em;
  color: var(--ink);
  white-space: nowrap;
}
.ask-head-title .spark { color: var(--accent); }

.ask-head-btns { display: flex; gap: 0.35rem; }
.icon-btn {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease;
}
.icon-btn:hover { color: var(--ink); background: var(--chip); }

/* Mensajes: estilo Assistant — texto plano para el bot, burbuja acento para el usuario */
.ask-msgs {
  flex: 1;
  overflow-y: auto;
  padding: 1.1rem 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  background: var(--panel-bg);
}

.msg { display: flex; max-width: 100%; }
.msg.user { justify-content: flex-end; }

.msg .bubble.user {
  padding: 0.6rem 0.85rem;
  border-radius: 12px;
  background: var(--accent);
  color: #fff;
  border-bottom-right-radius: 4px;
  font-size: 13.5px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
  max-width: 88%;
}

.msg.bot { display: block; }
.msg.bot .prose-sm {
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--ink-2);
  overflow-wrap: break-word;
}
.msg.bot .prose-sm p { margin: 0 0 0.6em; }
.msg.bot .prose-sm p:last-child { margin-bottom: 0; }
.msg.bot .prose-sm a { color: var(--accent); font-weight: 500; }
.msg.bot .prose-sm code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 0.08rem 0.3rem;
  border-radius: 4px;
}
.msg.bot .prose-sm pre {
  background: var(--code);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.7rem;
  overflow-x: auto;
  font-size: 0.76rem;
  margin: 0.5em 0;
}
.msg.bot .prose-sm pre code { background: none; color: #f4f4f2; padding: 0; font-size: inherit; }
.msg.bot .prose-sm ul, .msg.bot .prose-sm ol { margin: 0.4em 0; padding-left: 1.2rem; }

/* Indicador "escribiendo": línea pequeña, sin tarjeta */
.msg.bot .pulse {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--muted);
  animation: askPulse 1.4s ease-in-out infinite;
}
@keyframes askPulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }

/* Entrada tipo Assistant: caja redondeada con pie y botón cuadrado */
.ask-input-area {
  padding: 0.8rem 0.9rem 0.9rem;
  background: var(--panel-bg);
}
.ask-box {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card);
  padding: 0.5rem 0.55rem 0.45rem;
  transition: border-color 0.15s ease;
}
.ask-box:focus-within { border-color: var(--accent); }
.ask-input {
  width: 100%;
  min-width: 0;
  padding: 0.3rem 0.4rem;
  font-family: var(--font-sans);
  font-size: 13.5px;
  color: var(--ink);
  background: transparent;
  border: none;
  outline: none;
}
.ask-input::placeholder { color: var(--faint); }
.ask-box-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.ask-box-ico { color: var(--faint); flex: none; }

.btn-send {
  width: 32px;
  height: 30px;
  display: grid;
  place-items: center;
  padding: 0;
  border: none;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  transition: background-color 0.15s ease, opacity 0.15s ease;
}
.btn-send:hover { background: var(--accent-hover); }
.btn-send:disabled { opacity: 0.55; cursor: not-allowed; }

/* ══ Carga de guías (sitio estático) ════════════════════════ */
.doc-cargando {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--muted);
  padding: 2rem 0;
  text-align: center;
}
