/**
 * @file frontend/public/landing/neuroapi.css
 * @description Estilos visuales del portal público de documentación interactiva y sección NeuroAPI.
 * @module Landing / NeuroAPI
 * @dependencies [frontend/public/landing/styles.css]
 * @lastModified 2026-09-30 - Cobertura responsive completa (1024/880/768/480/360px): rejillas de tarjetas, tabs sticky, tablas de parámetros y bloques de código con scroll horizontal contenido, sin alterar el diseño de escritorio.
 */

/* =========================================================================
   1. LINK EN BARRA DE NAVEGACIÓN Y SECCIÓN EN LANDING
   ========================================================================= */
.nav-api-link {
  color: #2563eb !important;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.nav-api-link::after {
  content: "DOCS";
  font-size: 9px;
  font-family: var(--font-display, "Space Grotesk", sans-serif);
  font-weight: 700;
  background: #dbeafe;
  color: #1d4ed8;
  padding: 1px 6px;
  border-radius: 4px;
  letter-spacing: 0.06em;
}

.neuroapi-section {
  padding: 84px 0;
  background: #fbfbfd;
  border-top: 1px solid var(--line, #E5E5E5);
  position: relative;
}

.neuroapi-box {
  background: #ffffff;
  border: 1px solid var(--line, #E5E5E5);
  border-radius: 16px;
  padding: 56px 44px;
  box-shadow: 0 4px 24px -4px rgba(0, 0, 0, 0.04);
}

.neuroapi-header {
  max-width: 780px;
  margin-bottom: 40px;
}

.neuroapi-cards-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-bottom: 40px;
}

.n-card {
  border: 1px solid var(--line, #E5E5E5);
  border-radius: 12px;
  padding: 32px 28px;
  background: #fafafa;
  position: relative;
  transition: all 0.25s ease;
  display: flex;
  flex-direction: column;
}

.n-card:hover {
  border-color: var(--ink, #111111);
  background: #ffffff;
  box-shadow: 0 12px 32px -6px rgba(0, 0, 0, 0.06);
  transform: translateY(-2px);
}

.n-card-badge {
  display: inline-block;
  font-family: var(--font-display, "Space Grotesk", sans-serif);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: #2563eb;
  background: #eff6ff;
  border: 1px solid #dbeafe;
  padding: 3px 8px;
  border-radius: 4px;
  margin-bottom: 14px;
  align-self: flex-start;
}

.n-card-num {
  font-family: var(--font-display, "Space Grotesk", sans-serif);
  font-size: 2.2rem;
  font-weight: 300;
  color: var(--line-2, #DCDCDC);
  line-height: 1;
  position: absolute;
  top: 28px;
  right: 28px;
}

.n-card h3 {
  font-family: var(--font-display, "Space Grotesk", sans-serif);
  font-size: 1.15rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 10px;
  color: var(--ink, #111111);
}

.n-card p {
  font-size: 13.5px;
  color: var(--ink-2, #4A4A4A);
  line-height: 1.6;
  margin-bottom: 20px;
  flex-grow: 1;
}

.n-card-endpoint {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  padding: 8px 12px;
  border-radius: 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
  color: #1e293b;
}

.n-card-endpoint .method {
  font-weight: 700;
  font-size: 10.5px;
  color: #059669;
  background: #d1fae5;
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 0.04em;
}

.neuroapi-footer-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 32px;
  border-top: 1px solid var(--line, #E5E5E5);
  flex-wrap: wrap;
  gap: 20px;
}

.neuroapi-cta-info {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13.5px;
  color: var(--ink-2, #4A4A4A);
  max-width: 620px;
}

.n-pulse-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: pulse-ring 2s infinite;
  flex-shrink: 0;
}

@keyframes pulse-ring {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.neuroapi-cta-btns {
  display: flex;
  gap: 12px;
}

/* =========================================================================
   2. PORTAL DE DOCUMENTACIÓN PÚBLICA (NEUROAPI.HTML)
   ========================================================================= */
.doc-page {
  padding-top: 68px;
  padding-bottom: 80px;
  background: #ffffff;
}

.doc-page.container {
  max-width: 1260px;
  width: 100%;
}

/* Blindaje anti-desborde horizontal del portal de documentación: los hijos de
   rejilla/flex deben poder encogerse por debajo de su contenido mínimo, y todo
   bloque ancho (tabla de parámetros, snippet de código, terminal) se contiene
   dentro de su tarjeta con scroll propio en lugar de estirar la página. */
.neuroapi-cards-grid > *,
.doc-prompt-info > *,
.doc-apikey-left > *,
.doc-section > *,
.n-card {
  min-width: 0;
}

.doc-section,
.neuroapi-box,
.doc-prompt-card,
.doc-apikey-banner,
.code-box {
  max-width: 100%;
}

.doc-hero {
  padding: 24px 0 16px;
  text-align: left;
}

.doc-hero .eyebrow {
  margin-bottom: 8px;
  font-size: 11px;
}

.doc-hero .hero-title {
  margin-bottom: 12px;
  font-size: clamp(1.8rem, 3.2vw, 2.45rem);
  line-height: 1.08;
  letter-spacing: -0.01em;
}

.doc-hero .hero-text {
  max-width: 780px;
  margin-bottom: 20px;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--ink-2, #4A4A4A);
}

/* Sticky Tabs Navigation Bar */
.api-tabs-nav {
  position: sticky;
  top: 64px;
  z-index: 80;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line, #E5E5E5);
  margin-bottom: 24px;
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 8px 0;
  scrollbar-width: none;
}
.api-tabs-nav::-webkit-scrollbar { display: none; }

/* Anclas reales de cada pestaña del Developer Hub (#cloud, #voice, #otp, #audio, #pricing, #faq).
   Permiten que el enlace sea válido, que la URL pública sea navegable y que el scroll no quede
   tapado por la cabecera fija (64px) más la barra de pestañas (sticky). */
.doc-anchors {
  position: relative;
  height: 0;
}

.doc-anchor {
  display: block;
  position: relative;
  height: 0;
  scroll-margin-top: 132px;
}

.api-tab-btn {
  font-family: var(--font-display, "Space Grotesk", sans-serif);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--ink-2, #4A4A4A);
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  padding: 7px 14px;
  border-radius: 7px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.api-tab-btn:hover {
  color: var(--ink, #111111);
  background: #ffffff;
  border-color: #cbd5e1;
}

.api-tab-btn.active {
  color: #ffffff;
  background: #0f172a;
  border-color: #0f172a;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.15);
}

/* Tab Panes */
.api-tab-pane {
  display: none;
  animation: fadeIn 0.25s ease;
}
.api-tab-pane.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Service Header Block */
.service-header {
  margin-bottom: 20px;
}

.service-icon-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: #eff6ff;
  border: 1px solid #dbeafe;
  color: #2563eb;
  margin-bottom: 10px;
}

.service-title {
  font-family: var(--font-display, "Space Grotesk", sans-serif);
  font-size: clamp(1.35rem, 2.2vw, 1.7rem);
  font-weight: 700;
  letter-spacing: 0.01em;
  color: #0f172a;
  margin-bottom: 6px;
}

.service-desc {
  font-size: 13.5px;
  color: #475569;
  line-height: 1.55;
  max-width: 820px;
}

/* Quick Index Links */
.doc-index-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 28px;
  padding: 12px 16px;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  font-size: 12.5px;
  align-items: center;
}

.doc-index-label {
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.05em;
  margin-right: 4px;
}

.doc-index-link {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  color: #334155;
  padding: 4px 10px;
  border-radius: 6px;
  font-weight: 500;
  transition: all 0.15s ease;
}

.doc-index-link:hover {
  border-color: #3b82f6;
  color: #2563eb;
}

/* AI Assistant Prompt Card (Literal to internal docs page) */
.doc-prompt-card {
  background: linear-gradient(to right, #2563eb, #4f46e5, #7c3aed);
  padding: 1px;
  border-radius: 14px;
  margin-bottom: 24px;
  box-shadow: 0 4px 20px -2px rgba(59, 130, 246, 0.1);
}

.doc-prompt-card-inner {
  background: #ffffff;
  border-radius: 13px;
  padding: 22px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.doc-prompt-info {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  max-width: 720px;
}

.doc-prompt-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: #eef2ff;
  color: #4f46e5;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.doc-prompt-heading {
  font-family: var(--font-display, "Space Grotesk", sans-serif);
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.doc-prompt-badge {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  background: #eef2ff;
  color: #4338ca;
  padding: 2px 7px;
  border-radius: 4px;
  letter-spacing: 0.05em;
}

.doc-prompt-text {
  font-size: 13px;
  color: #64748b;
  line-height: 1.55;
}

.btn-doc-prompt {
  background: #0f172a;
  color: #ffffff;
  border: none;
  padding: 11px 20px;
  border-radius: 8px;
  font-family: var(--font-display, "Space Grotesk", sans-serif);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.btn-doc-prompt:hover {
  background: #1e293b;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.15);
}

/* API Key Quick Access Banner (Literal to internal docs page) */
.doc-apikey-banner {
  background: linear-gradient(to right, #eff6ff, #f5f3ff, #faf5ff);
  border: 1px solid #bfdbfe;
  border-radius: 14px;
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 40px;
}

.doc-apikey-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.doc-apikey-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: #2563eb;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.doc-apikey-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 2px;
}

.doc-apikey-title {
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
}

.doc-apikey-scope {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, monospace;
  font-size: 11px;
  font-weight: 700;
  color: #1d4ed8;
  background: #dbeafe;
  padding: 1px 7px;
  border-radius: 4px;
}

.doc-apikey-desc {
  font-size: 12.5px;
  color: #475569;
}

.btn-apikey-action {
  background: #2563eb;
  color: #ffffff;
  font-family: var(--font-display, "Space Grotesk", sans-serif);
  font-size: 12.5px;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.btn-apikey-action:hover {
  background: #1d4ed8;
  transform: translateY(-1px);
}

/* Documentation Content Sections */
.doc-section {
  margin-bottom: 28px;
  background: #ffffff;
  border: 1px solid var(--line, #E5E5E5);
  border-radius: 12px;
  padding: 22px 24px;
  scroll-margin-top: 110px;
}

.doc-section-title {
  font-family: var(--font-display, "Space Grotesk", sans-serif);
  font-size: 1.15rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.doc-section-desc {
  font-size: 13px;
  color: #475569;
  line-height: 1.55;
  margin-bottom: 16px;
}

/* Endpoint Header Pill */
.endpoint-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  padding: 8px 14px;
  border-radius: 7px;
  margin: 10px 0 16px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, monospace;
  font-size: 12px;
  width: 100%;
  box-sizing: border-box;
}

.method-badge {
  font-weight: 800;
  font-size: 11px;
  letter-spacing: 0.05em;
  padding: 2px 8px;
  border-radius: 4px;
  text-transform: uppercase;
}
.method-post { background: #dcfce7; color: #15803d; }
.method-get { background: #e0f2fe; color: #0369a1; }
.method-put { background: #fef3c7; color: #b45309; }

.endpoint-pill .path {
  font-weight: 600;
  color: #0f172a;
}

/* Code Snippet Box (Styled to #0A0A0A like the internal docs) */
.code-box {
  background: #0A0A0A;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #1f2937;
  margin: 20px 0;
  box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.2);
}

.code-box-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #111111;
  padding: 8px 16px;
  border-bottom: 1px solid #1f2937;
}

.code-lang-tabs {
  display: flex;
  gap: 6px;
}

.lang-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, monospace;
  font-size: 12px;
  font-weight: 500;
  padding: 5px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.lang-btn:hover { color: #ffffff; background: rgba(255, 255, 255, 0.05); }
.lang-btn.active { background: #2563eb; color: #ffffff; font-weight: 600; }

.copy-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #94a3b8;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11.5px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, monospace;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}
.copy-btn:hover { background: rgba(255, 255, 255, 0.12); color: #ffffff; }
.copy-btn.copied { color: #34d399; border-color: #059669; }

.code-content {
  padding: 14px 16px;
  overflow-x: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
  line-height: 1.6;
  color: #e2e8f0;
  margin: 0;
  white-space: pre;
}

/* Parameters Table */
.param-table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0 18px;
  font-size: 12px;
}
.param-table th {
  text-align: left;
  padding: 7px 11px;
  background: #f8fafc;
  border-bottom: 2px solid #e2e8f0;
  font-family: var(--font-display, "Space Grotesk", sans-serif);
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #475569;
}
.param-table td {
  padding: 8px 11px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: top;
  color: #334155;
}
.param-name { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, monospace; font-weight: 600; color: #0f172a; }
.param-req { color: #e11d48; font-size: 10.5px; font-weight: 700; text-transform: uppercase; margin-left: 6px; }
.param-opt { color: #64748b; font-size: 10.5px; text-transform: uppercase; margin-left: 6px; }

/* Note Alert */
.doc-note {
  background: #eff6ff;
  border-left: 4px solid #3b82f6;
  padding: 14px 18px;
  border-radius: 0 8px 8px 0;
  margin: 18px 0;
  font-size: 13.5px;
  color: #1e3a8a;
  line-height: 1.55;
}

/* Floating Toast */
.api-toast {
  position: fixed;
  bottom: 28px;
  right: 28px;
  background: #0f172a;
  color: #f8fafc;
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.25);
  border: 1px solid #334155;
  z-index: 9999;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}
.api-toast.show { transform: translateY(0); opacity: 1; }

/* =========================================================================
   7. RESPONSIVE DESIGN & BARRA DE NAVEGACIÓN
   ========================================================================= */
@media (min-width: 881px) {
  .header-inner { max-width: 1360px !important; width: 100%; margin: 0 auto; padding: 0 24px; }
  .brand { flex-shrink: 0; }
  .nav-links { display: flex; gap: 4px; margin: 0 auto; }
  .nav-links a { padding: 6px 10px !important; font-size: 13px !important; white-space: nowrap; }
  .header-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
  .auth-register { white-space: nowrap; padding: 8px 16px !important; font-size: 12px !important; }
}

/* Tablet horizontal: la sección NeuroAPI de la landing pasa a una columna a
   ancho completo y la barra de pestañas estrena área táctil suficiente. */
@media (max-width: 1024px) {
  .neuroapi-section { padding: 64px 0; }
  .neuroapi-box { padding: 40px 28px; }
  .neuroapi-header { margin-bottom: 32px; }
  .neuroapi-cards-grid { grid-template-columns: 1fr; gap: 16px; margin-bottom: 32px; }
  .n-card { padding: 26px 22px; }
  .neuroapi-footer-cta { padding-top: 26px; gap: 16px; }
  .neuroapi-cta-btns { flex-wrap: wrap; gap: 10px; }
  .api-tab-btn { min-height: 40px; }
}

/* Tablet vertical: cabecera colapsada con el menú `.nav.open`, hero de la
   documentación a una columna y tablas de parámetros con scroll contenido. */
@media (max-width: 880px) {
  .header { z-index: 10000; background: #ffffff; }
  .nav-toggle {
    display: flex !important; z-index: 10001;
    align-items: center; justify-content: center;
    min-width: 44px; min-height: 44px;
  }
  .nav {
    position: fixed; top: 64px; left: 0; right: 0; z-index: 10000;
    transform: none; flex-direction: column; margin-left: 0;
    background: #ffffff; border-bottom: none; padding: 0 24px;
    max-height: 0; opacity: 0; visibility: hidden; overflow: hidden; pointer-events: none;
    transition: max-height 0.32s ease, opacity 0.25s ease, padding 0.32s ease, visibility 0.32s ease;
  }
  .nav.open {
    max-height: calc(100vh - 64px); opacity: 1; visibility: visible;
    overflow-y: auto; pointer-events: auto; background: #ffffff;
    padding: 12px 24px 28px; border-bottom: 1px solid var(--line, #e2e8f0);
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.12);
  }
  .nav-links { display: flex; flex-direction: column; width: 100%; margin: 0; }
  .nav-links a {
    padding: 14px 0 !important; border-bottom: 1px solid #f1f5f9; border-radius: 0;
    font-size: 14px !important; color: #1e293b; display: flex; align-items: center; justify-content: space-between;
    min-height: 44px; /* Área táctil ergonómica */
  }
  .nav-links a:last-child { border-bottom: none; }
  .header-actions {
    display: flex; flex-direction: column; width: 100%; gap: 12px;
    margin-top: 14px; padding-top: 14px; border-top: 1px solid #e2e8f0;
  }
  .header-actions a { width: 100%; text-align: center; justify-content: center; }
  .doc-hero { padding: 20px 0 14px; }
  .doc-hero .hero-title { font-size: clamp(1.6rem, 6vw, 2.4rem); }
  .doc-hero .hero-text { font-size: 13px; }
  .api-tabs-nav {
    top: 64px; padding: 8px 0; margin-bottom: 20px;
    gap: 8px;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
  }
  .api-tab-btn { padding: 9px 15px; font-size: 12px; min-height: 44px; }
  .doc-section { padding: 20px 16px; scroll-margin-top: 124px; }
  /* Tablas y código: scroll horizontal contenido, nunca desborde de página. */
  .param-table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }
  .code-content { -webkit-overflow-scrolling: touch; }
  .copy-btn { min-height: 32px; }
  .lang-btn { min-height: 32px; }
  .doc-note { padding: 12px 14px; font-size: 13px; }
  .endpoint-pill { flex-wrap: wrap; row-gap: 4px; }
  .endpoint-pill .path { overflow-wrap: anywhere; }
  .neuroapi-cards-grid { grid-template-columns: 1fr; }
  .neuroapi-box { padding: 36px 20px; }
  .neuroapi-footer-cta { flex-direction: column; align-items: stretch; }
  .neuroapi-cta-btns { flex-direction: column; }
  .neuroapi-cta-btns .btn { width: 100%; }
  .api-toast { left: 20px; right: 20px; bottom: calc(20px + env(safe-area-inset-bottom)); justify-content: center; }
  .doc-prompt-card-inner, .doc-apikey-banner { flex-direction: column; align-items: stretch; }
  .btn-doc-prompt, .btn-apikey-action { width: 100%; justify-content: center; }
}

/* Móvil grande: tipografía fluida, index de enlaces con área táctil real y
   paddings laterales contenidos en todo el portal de documentación. */
@media (max-width: 768px) {
  .neuroapi-section { padding: 52px 0; }
  .neuroapi-box { padding: 28px 18px; border-radius: 12px; }

  .doc-page { padding-top: 76px; padding-bottom: 96px; }
  .doc-hero { padding: 16px 0 12px; }
  .doc-hero .hero-title { font-size: clamp(1.5rem, 6.4vw, 2rem); }
  .doc-hero .hero-text { font-size: 13px; }

  .service-title { font-size: clamp(1.2rem, 4.6vw, 1.5rem); }
  .doc-section-title { font-size: 1.05rem; }

  .doc-index-bar { padding: 10px 12px; gap: 6px; margin-bottom: 22px; }
  /* Área táctil de 44px en el index de enlaces de la documentación. */
  .doc-index-link { display: inline-flex; align-items: center; min-height: 44px; padding: 6px 12px; }

  .doc-prompt-card-inner { padding: 18px 16px; }
  .doc-apikey-banner { padding: 16px; }
  .doc-section { padding: 18px 14px; }

  .param-table { font-size: 11.5px; }
  .param-table th, .param-table td { padding: 7px 9px; }
  .param-name { overflow-wrap: anywhere; }

  .code-box { border-radius: 10px; margin: 16px 0; }
  .code-box-header { padding: 8px 12px; }
  .code-content { font-size: 11.5px; padding: 12px; }
  .code-lang-tabs { flex-wrap: wrap; }
  .lang-btn { padding: 6px 10px; min-height: 40px; }
  .copy-btn { min-height: 40px; padding: 6px 10px; }

  .api-tab-btn { padding: 9px 13px; font-size: 11.5px; }
  .api-toast { font-size: 12.5px; padding: 11px 16px; }
}

/* Móvil: botones a ancho completo, scroll táctil en tablas y código, y
   botones del portal de documentación con área táctil completa. */
@media (max-width: 480px) {
  .neuroapi-section { padding: 44px 0; }
  .neuroapi-box { padding: 24px 16px; }
  .neuroapi-header { margin-bottom: 24px; }
  .n-card { padding: 22px 18px; }
  .n-card-num { font-size: 1.9rem; top: 20px; right: 20px; }

  .doc-page { padding-top: 72px; padding-bottom: 88px; }
  .doc-hero .hero-title { font-size: clamp(1.35rem, 6.8vw, 1.75rem); }

  .api-tab-btn {
    min-height: 44px; padding: 9px 12px; font-size: 11px;
  }
  .doc-section { padding: 16px 12px; border-radius: 10px; }
  .doc-section-title { font-size: 1rem; }
  .doc-section-desc { font-size: 12.5px; }

  .doc-index-bar { font-size: 12px; }
  .doc-index-link { min-height: 44px; }

  .endpoint-pill { padding: 8px 10px; font-size: 11px; }
  .code-content { font-size: 11px; }
  .param-table { font-size: 11px; }
  .param-table th, .param-table td { padding: 6px 8px; }
  .doc-note { font-size: 12.5px; padding: 12px; border-left-width: 3px; }

  .btn-doc-prompt, .btn-apikey-action { min-height: 44px; width: 100%; justify-content: center; }
  .copy-btn, .lang-btn { min-height: 44px; }
  .api-toast { left: 14px; right: 14px; bottom: calc(14px + env(safe-area-inset-bottom)); }
}

/* Móvil muy pequeño: ajustes finales para que nada desborde ni se corte. */
@media (max-width: 360px) {
  .neuroapi-section { padding: 36px 0; }
  .neuroapi-box { padding: 20px 13px; }
  .n-card { padding: 20px 15px; }
  .n-card-endpoint { font-size: 11px; padding: 7px 10px; }

  .doc-page { padding-top: 68px; }
  .doc-hero .hero-title { font-size: clamp(1.25rem, 7vw, 1.55rem); }

  .api-tab-btn { padding: 8px 10px; font-size: 10.5px; gap: 4px; }
  .doc-section { padding: 14px 11px; }
  .doc-section-title { font-size: 0.95rem; gap: 6px; }

  .code-content { font-size: 10.5px; padding: 10px; }
  .code-box-header { padding: 7px 10px; }
  .param-table { font-size: 10.5px; }
  .param-table th, .param-table td { padding: 5px 7px; }
  .lang-btn { padding: 6px 8px; }
  .copy-btn { padding: 6px 8px; font-size: 11px; }
  .endpoint-pill { font-size: 10.5px; }
  .doc-note { font-size: 12px; }
  .neuroapi-cta-info { font-size: 12.5px; gap: 9px; }
}
