/* TooAudience × LevantArte — Design System editorial
   Inter + JetBrains Mono. Desktop-first con refuerzos mobile. */

:root {
  --bg: #ffffff;
  --bg-soft: #fafafa;
  --bg-card: #ffffff;
  --ink: #0a0a0a;
  --ink-2: #2a2a2a;
  --ink-3: #5e5e5e;
  --ink-4: #8e8e8e;
  --line: #e5e5e5;
  --line-2: #f0f0f0;
  --accent: #18181b;
  --accent-soft: #f4f4f5;
  --green: #15803d;
  --amber: #b45309;
  --red: #b91c1c;
  --blue: #1d4ed8;
  --bottom-tab-h: 60px;
  --topnav-h: 53px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--ink); background: var(--bg);
  font-size: 15px; line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
.mono { font-family: 'JetBrains Mono', ui-monospace, monospace; }

/* ─── TOP NAV ─── */
nav.topnav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,0.92);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  max-width: 1320px; margin: 0 auto; padding: 14px 32px;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
}
.nav-brand {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px; color: var(--ink); font-weight: 500;
  display: flex; align-items: center; gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}
.nav-brand .dot { width: 5px; height: 5px; background: var(--ink); border-radius: 50%; }
.nav-links { display: flex; gap: 24px; align-items: center; }
.nav-links a {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px; color: var(--ink-3);
  text-decoration: none; padding: 6px 0;
  transition: color .15s ease; letter-spacing: .02em;
  display: inline-flex; align-items: center; gap: 4px;
}
.nav-links a:hover, .nav-links a.active { color: var(--ink); }
.nav-links a .icon { font-size: 13px; }
.nav-links a .arrow { font-size: 9px; opacity: .6; }
.nav-cta {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  background: var(--ink); color: #fff;
  padding: 8px 14px; border-radius: 6px;
  text-decoration: none;
  transition: opacity .15s ease;
}
.nav-cta:hover { opacity: .85; }
.nav-back-home, .menu-toggle { display: none; }

/* ─── LAYOUT (páginas internas con sidebar) ─── */
.layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  max-width: 1320px;
  margin: 0 auto;
  min-height: calc(100vh - 53px);
}
.sidebar {
  border-right: 1px solid var(--line);
  padding: 32px 24px;
  position: sticky; top: 53px;
  height: calc(100vh - 53px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.sidebar h4 {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; color: var(--ink-3);
  text-transform: uppercase; letter-spacing: .06em;
  margin: 0 0 12px 0; font-weight: 500;
}
.sidebar h4:not(:first-child) { margin-top: 28px; }
.sidebar ul { list-style: none; margin: 0; padding: 0; }
.sidebar li { margin: 0; }
.sidebar a {
  display: block;
  padding: 7px 10px;
  font-size: 13px; color: var(--ink-3);
  text-decoration: none;
  border-radius: 6px;
  transition: background .15s ease, color .15s ease;
  line-height: 1.4;
}
.sidebar a:hover { background: var(--bg-soft); color: var(--ink); }
.sidebar a.current { background: var(--accent); color: #fff; }
.sidebar a .num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; color: var(--ink-4);
  margin-right: 8px; display: inline-block; width: 18px;
}
.sidebar a.current .num { color: rgba(255,255,255,.6); }

/* Drawer-only en desktop: ocultos */
.sidebar-header,
.sidebar-drawer-footer,
.sidebar-close,
.sidebar-search { display: none; }

/* <details> en desktop: siempre abierto, sin chevron, summary se ve como h4 */
.sidebar details {
  display: block;
  margin: 0 0 28px 0;
}
.sidebar details:first-of-type { margin-top: 0; }
.sidebar details > summary {
  list-style: none;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; color: var(--ink-3);
  text-transform: uppercase; letter-spacing: .06em;
  margin: 0 0 12px 0;
  padding: 0;
  font-weight: 500;
  cursor: default;
  display: block;
}
.sidebar details > summary::-webkit-details-marker,
.sidebar details > summary::marker { display: none; content: ''; }
.sidebar details > summary::after { display: none; }
.sidebar details > summary .sec-count {
  font-size: 10px; color: var(--ink-4); margin-left: 6px;
}
.sidebar details > ul {
  display: block !important;  /* forzar abierto en desktop pase lo que pase */
}

.content {
  padding: 56px 64px 96px 64px;
  max-width: none;
  overflow-x: auto;
}
.content-inner { max-width: 820px; }

/* Breadcrumbs */
.breadcrumbs {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; color: var(--ink-3);
  letter-spacing: .04em; text-transform: uppercase;
  margin-bottom: 16px;
}
.breadcrumbs a { color: var(--ink-3); text-decoration: none; }
.breadcrumbs a:hover { color: var(--ink); }
.breadcrumbs .sep { color: var(--ink-4); margin: 0 8px; }

/* ─── TIPOGRAFÍA del contenido ─── */
.content h1, .content h2, .content h3, .content h4, .content h5, .content h6 {
  font-weight: 500; letter-spacing: -0.02em;
  margin: 0; color: var(--ink);
}
.content h1 {
  font-size: 44px; font-weight: 400; line-height: 1.1;
  letter-spacing: -0.03em; margin-bottom: 24px;
}
.content h2 {
  font-size: 28px; font-weight: 500; line-height: 1.2;
  margin: 56px 0 16px 0;
  padding-top: 24px; border-top: 1px solid var(--line);
}
.content h2:first-of-type { padding-top: 0; border-top: none; margin-top: 32px; }
.content h3 {
  font-size: 18px; font-weight: 600; line-height: 1.3;
  margin: 32px 0 12px 0;
}
.content h4 {
  font-size: 14px; font-weight: 600; line-height: 1.4;
  margin: 20px 0 8px 0;
  font-family: 'JetBrains Mono', monospace;
  text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3);
}
.content p { margin: 0 0 16px 0; color: var(--ink-2); }
.content p strong { color: var(--ink); font-weight: 600; }
.content a {
  color: var(--ink); text-decoration: underline;
  text-underline-offset: 3px; text-decoration-thickness: 1px;
}
.content a:hover { text-decoration-thickness: 2px; }
.content blockquote {
  border-left: 2px solid var(--ink); padding: 4px 16px;
  background: var(--bg-soft);
  margin: 24px 0;
  font-size: 14px; color: var(--ink-2);
}
.content blockquote p:last-child { margin-bottom: 0; }
.content blockquote strong { color: var(--ink); }

/* LISTAS */
.content ul, .content ol { margin: 0 0 16px 0; padding-left: 24px; color: var(--ink-2); }
.content li { margin: 6px 0; line-height: 1.6; }
.content li > ul, .content li > ol { margin: 8px 0 0 0; }

/* CHECKBOXES */
.content input[type="checkbox"] {
  appearance: none; -webkit-appearance: none;
  width: 14px; height: 14px;
  border: 1.5px solid var(--ink-4);
  border-radius: 3px;
  vertical-align: middle;
  margin-right: 8px;
  cursor: default;
  position: relative;
  top: -1px;
}
.content input[type="checkbox"]:checked { background: var(--ink); border-color: var(--ink); }
.content input[type="checkbox"]:checked::after {
  content: '✓'; color: #fff;
  font-size: 11px; line-height: 11px;
  position: absolute; top: 0px; left: 2px;
}
.content ul:has(> li > input[type="checkbox"]) { list-style: none; padding-left: 0; }
.content ul li:has(> input[type="checkbox"]) { padding-left: 0; }

/* TABLAS */
.content table {
  width: 100%; border-collapse: collapse;
  margin: 20px 0;
  font-size: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}
.content table th {
  text-align: left; padding: 12px 16px;
  background: var(--bg-soft);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; color: var(--ink-3);
  text-transform: uppercase; letter-spacing: .06em;
  font-weight: 500;
  border-bottom: 1px solid var(--line);
}
.content table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line-2);
  color: var(--ink-2);
  vertical-align: top;
  line-height: 1.5;
}
.content table tr:last-child td { border-bottom: none; }
.content table strong { color: var(--ink); }

/* CODE */
.content code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12.5px;
  background: var(--accent-soft);
  padding: 1px 6px; border-radius: 4px;
  color: var(--ink);
}
.content pre {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px 24px;
  overflow-x: auto;
  margin: 20px 0;
  font-size: 12.5px; line-height: 1.6;
}
.content pre code {
  background: transparent; padding: 0; border: none;
  color: var(--ink-2);
}

/* Missing link */
.content .missing-link {
  color: var(--ink-3);
  text-decoration: line-through dotted var(--ink-4);
  cursor: help;
}

/* HR */
.content hr {
  border: none; border-top: 1px solid var(--line);
  margin: 48px 0;
}

/* FOOTER NAV (prev/next) */
.page-nav {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
  margin-top: 64px; padding-top: 32px;
  border-top: 1px solid var(--line);
}
.page-nav a {
  display: block; padding: 16px 20px;
  border: 1px solid var(--line); border-radius: 12px;
  text-decoration: none;
  transition: border-color .15s ease, background .15s ease;
}
.page-nav a:hover { border-color: var(--ink); background: var(--bg-soft); }
.page-nav .label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; color: var(--ink-3);
  text-transform: uppercase; letter-spacing: .06em;
  margin-bottom: 6px;
}
.page-nav .title { font-size: 14px; font-weight: 500; color: var(--ink); }
.page-nav .next { text-align: right; }

/* ─── HOME — hero + cards grid ─── */
.home-hero {
  padding: 80px 32px 56px 32px;
  border-bottom: 1px solid var(--line);
  max-width: 1320px; margin: 0 auto;
}
.home-hero .eyebrow {
  display: inline-block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px; color: var(--ink-3);
  letter-spacing: .04em; text-transform: uppercase;
  margin-bottom: 16px;
}
.home-hero h1 {
  font-size: 56px; font-weight: 300; line-height: 1.05;
  letter-spacing: -0.04em; margin: 0 0 24px 0; max-width: 900px;
}
.home-hero p.lead {
  font-size: 19px; color: var(--ink-2); line-height: 1.55;
  max-width: 720px; margin: 0;
}
.home-hero .meta {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 32px;
  margin-top: 56px; padding-top: 32px; border-top: 1px solid var(--line);
}
.home-hero .meta-item .meta-label {
  font-family: 'JetBrains Mono', monospace; font-size: 11px;
  color: var(--ink-4); text-transform: uppercase; letter-spacing: .06em;
  margin-bottom: 8px;
}
.home-hero .meta-item .meta-value { font-size: 15px; color: var(--ink); font-weight: 500; }
.home-hero .meta-item .meta-value a { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }

.home-section {
  padding: 64px 32px; border-bottom: 1px solid var(--line);
  max-width: 1320px; margin: 0 auto;
}
.home-section:last-of-type { border-bottom: none; }
.home-section .section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 32px;
}
.home-section h2 {
  font-size: 24px; font-weight: 500; letter-spacing: -0.02em; margin: 0;
}
.home-section .section-meta {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px; color: var(--ink-3);
}

.cards-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px;
}
.card {
  border: 1px solid var(--line); border-radius: 12px;
  background: var(--bg-card);
  padding: 24px;
  text-decoration: none;
  display: block;
  transition: border-color .15s ease, transform .15s ease;
  position: relative;
}
.card:hover {
  border-color: var(--ink);
  transform: translateY(-1px);
}
.card .card-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; color: var(--ink-3);
  letter-spacing: .04em; margin-bottom: 12px;
  display: block;
}
.card .card-title {
  font-size: 16px; font-weight: 500; color: var(--ink);
  margin-bottom: 8px; line-height: 1.3; letter-spacing: -0.01em;
}
.card .card-desc {
  font-size: 13px; color: var(--ink-3); line-height: 1.5;
  margin: 0;
}
.card .card-footer {
  margin-top: 16px; padding-top: 12px;
  border-top: 1px solid var(--line-2);
  display: flex; justify-content: space-between; align-items: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; color: var(--ink-3);
}

/* CTA secundario tipo botón en hero */
.btn-secondary {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: 'Inter', sans-serif;
  font-size: 14px; font-weight: 500; color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line);
  padding: 12px 18px;
  border-radius: 8px;
  text-decoration: none;
  transition: border-color .15s ease, background .15s ease;
  margin-top: 20px;
}
.btn-secondary:hover { border-color: var(--ink); background: var(--bg-soft); }

/* Sub-badge dentro de las cards (HUB) */
.card-drive-badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px; color: var(--ink-3);
  background: var(--accent-soft);
  padding: 4px 8px; border-radius: 5px;
  text-decoration: none;
  margin-top: 12px;
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
.card-drive-badge:hover { background: var(--ink); color: #fff; }

/* ─── Page TOC ─── */
.page-toc {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px 20px;
  margin: 24px 0 32px 0;
  background: var(--bg-soft);
}
.page-toc summary {
  cursor: pointer;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; color: var(--ink-3);
  text-transform: uppercase; letter-spacing: .06em;
  list-style: none;
  display: flex; align-items: center; justify-content: space-between;
  user-select: none;
  padding: 4px 0;
}
.page-toc summary::-webkit-details-marker { display: none; }
.page-toc summary::after { content: 'Mostrar'; font-size: 11px; color: var(--ink-2); }
.page-toc[open] summary::after { content: 'Ocultar'; }
.page-toc-list {
  list-style: none;
  padding: 12px 0 0 0; margin: 12px 0 0 0;
  border-top: 1px solid var(--line);
}
.page-toc-list li { margin: 0; padding: 0; }
.page-toc-list li.toc-h3 { padding-left: 16px; }
.page-toc-list a {
  display: block;
  padding: 6px 8px;
  font-size: 13px; color: var(--ink-2);
  text-decoration: none;
  border-radius: 4px;
  line-height: 1.4;
}
.page-toc-list a:hover { background: var(--bg); color: var(--ink); }
.page-toc-list .toc-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; color: var(--ink-3);
  margin-right: 6px;
}

/* ─── Bottom-tab fixed (mobile only) ─── */
.bottom-tab {
  display: none;
  position: fixed; bottom: 0; left: 0; right: 0;
  height: var(--bottom-tab-h); z-index: 80;
  background: rgba(255,255,255,0.96);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.bottom-tab-inner {
  display: grid; grid-template-columns: repeat(4, 1fr);
  height: 100%;
}
.bottom-tab a {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 3px;
  text-decoration: none;
  font-family: 'Inter', sans-serif;
  font-size: 10px; color: var(--ink-3);
  padding: 6px 4px;
  letter-spacing: .02em;
}
.bottom-tab a .tab-icon { font-size: 18px; line-height: 1; }
.bottom-tab a.active { color: var(--ink); font-weight: 600; }
.bottom-tab a:active { background: var(--bg-soft); }

/* ─── Sticky section indicator (mobile only) ─── */
.sticky-section { display: none; }

/* ─── Back to top floating ─── */
.back-to-top {
  display: none;
  position: fixed; right: 20px; bottom: 20px; z-index: 70;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--ink); color: #fff;
  border: none;
  font-size: 18px; line-height: 1;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,0.18);
  transition: opacity .2s ease, transform .2s ease;
  opacity: 0; transform: translateY(8px);
}
.back-to-top.is-visible { display: block; opacity: 1; transform: translateY(0); }

/* ─── Table card stack (mobile only via JS) ─── */
.content table.is-stacked {
  display: block; border: none; background: transparent;
  margin: 16px 0;
}
.content table.is-stacked thead { display: none; }
.content table.is-stacked tbody { display: block; }
.content table.is-stacked tr {
  display: block;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 12px;
  background: var(--bg-card);
}
.content table.is-stacked td {
  display: block;
  padding: 6px 0;
  border-bottom: 1px solid var(--line-2);
  font-size: 14px;
}
.content table.is-stacked td:last-child { border-bottom: none; padding-bottom: 0; }
.content table.is-stacked td:first-child { padding-top: 0; }
.content table.is-stacked td::before {
  content: attr(data-label);
  display: block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px; color: var(--ink-3);
  text-transform: uppercase; letter-spacing: .05em;
  margin-bottom: 4px;
  font-weight: 500;
}

footer.site-footer {
  padding: 48px 32px; text-align: center;
  color: var(--ink-3);
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px; letter-spacing: .04em;
  border-top: 1px solid var(--line);
  max-width: 1320px; margin: 0 auto;
}
footer.site-footer a { color: var(--ink-2); }

/* ─── Sidebar overlay (oculto en desktop) ─── */
.sidebar-overlay { display: none; }

/* ═══════════════════════════════════════════════
   RESPONSIVE — Tablet
   ═══════════════════════════════════════════════ */
@media (max-width: 1180px) {
  .home-hero { padding: 64px 24px 48px 24px; }
  .home-hero h1 { font-size: 44px; }
  .home-section { padding: 48px 24px; }
  .cards-grid { grid-template-columns: repeat(2, 1fr); }
  .content { padding: 40px 40px 80px; }
}

/* ═══════════════════════════════════════════════
   RESPONSIVE — Mobile (≤768px)
   ═══════════════════════════════════════════════ */
@media (max-width: 768px) {
  body { font-size: 15px; padding-bottom: var(--bottom-tab-h); }

  /* TOPNAV mobile */
  .nav-inner { padding: 10px 14px; gap: 10px; flex-wrap: nowrap; }
  .nav-brand {
    flex: 1; min-width: 0;
    font-size: 11.5px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .nav-brand .dot { flex-shrink: 0; }
  .nav-brand span:last-child {
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .nav-links { display: none; }
  .nav-cta { display: none; }
  .nav-back-home {
    display: flex; align-items: center; gap: 4px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px; color: var(--ink-2);
    text-decoration: none;
    padding: 8px 10px;
    border: 1px solid var(--line); border-radius: 6px;
    flex-shrink: 0; min-height: 36px;
  }
  .nav-back-home:active { background: var(--bg-soft); }
  .menu-toggle {
    display: flex; align-items: center; gap: 6px;
    background: none; border: 1px solid var(--line); border-radius: 6px;
    padding: 8px 10px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px; color: var(--ink);
    cursor: pointer;
    flex-shrink: 0; min-height: 36px;
  }
  .menu-toggle .bars { display: flex; flex-direction: column; gap: 3px; }
  .menu-toggle .bars span { display: block; width: 14px; height: 1.5px; background: var(--ink); }
  .menu-toggle .menu-count { font-size: 10px; color: var(--ink-3); margin-left: 2px; }

  /* DRAWER */
  .layout { grid-template-columns: 1fr; }
  .sidebar {
    display: block;
    position: fixed; top: 0; left: -100%;
    width: 88%; max-width: 340px;
    height: 100vh; z-index: 100;
    background: var(--bg);
    padding: 16px 16px 16px 16px;
    transition: left 280ms cubic-bezier(.25,.46,.45,.94);
    box-shadow: 0 0 0 rgba(0,0,0,0);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    border-right: none;
  }
  .sidebar.is-open { left: 0; box-shadow: 0 0 32px rgba(0,0,0,0.22); }
  .sidebar-overlay {
    display: none;
    position: fixed; inset: 0; z-index: 99;
    background: rgba(0,0,0,0);
    transition: background 280ms cubic-bezier(.25,.46,.45,.94);
  }
  .sidebar-overlay.is-open { display: block; background: rgba(0,0,0,0.45); }
  .sidebar-close {
    display: flex;
    position: absolute; top: 12px; right: 12px;
    background: none; border: none;
    font-size: 28px; line-height: 1;
    color: var(--ink); cursor: pointer;
    padding: 8px 12px;
    width: 44px; height: 44px;
    align-items: center; justify-content: center;
  }

  /* Header sticky del drawer */
  .sidebar-header {
    display: block;
    position: sticky; top: 0; z-index: 2;
    background: var(--bg);
    padding: 0 0 12px 0;
    margin-bottom: 8px;
    border-bottom: 1px solid var(--line);
  }
  .sidebar-header h3 {
    margin: 8px 44px 12px 0;
    font-size: 14px; font-weight: 600;
    letter-spacing: -0.01em;
  }
  .sidebar-search {
    display: block;
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 10px 12px;
    font-family: 'Inter', sans-serif;
    font-size: 14px; color: var(--ink);
    background: var(--bg-soft);
    -webkit-appearance: none; appearance: none;
  }
  .sidebar-search:focus {
    outline: 2px solid var(--ink); outline-offset: -1px; background: var(--bg);
  }

  /* Sidebar items mobile (más grandes) */
  .sidebar a { padding: 12px 12px; font-size: 14px; min-height: 44px; }
  .sidebar a .num { width: 22px; }

  /* En mobile <details> SÍ son colapsables */
  .sidebar details { margin: 0 0 4px 0; }
  .sidebar details > summary {
    cursor: pointer;
    padding: 12px 8px;
    font-size: 11.5px;
    min-height: 44px;
    display: flex; align-items: center; justify-content: space-between;
    border-radius: 6px;
    margin: 0;
  }
  .sidebar details > summary:hover { background: var(--bg-soft); color: var(--ink); }
  .sidebar details > summary::after {
    content: '▸'; color: var(--ink-4);
    transition: transform .2s ease;
    font-size: 9px;
    display: inline-block;
  }
  .sidebar details[open] > summary::after { transform: rotate(90deg); }
  .sidebar details > ul { display: none !important; }
  .sidebar details[open] > ul { display: block !important; }

  /* Footer del drawer con Drive + Hub */
  .sidebar-drawer-footer {
    display: block;
    position: sticky; bottom: -16px;
    background: var(--bg);
    margin: 16px -16px -16px -16px;
    padding: 12px 16px 20px 16px;
    border-top: 1px solid var(--line);
  }
  .sidebar-drawer-footer a {
    display: flex; align-items: center; gap: 8px;
    padding: 12px 14px;
    font-family: 'Inter', sans-serif;
    font-size: 14px; color: var(--ink); font-weight: 500;
    text-decoration: none;
    background: var(--bg-soft);
    border-radius: 8px;
    margin-bottom: 8px;
    min-height: 48px;
  }
  .sidebar-drawer-footer a:active { background: var(--accent-soft); }
  .sidebar-drawer-footer a:last-child { margin-bottom: 0; }
  .sidebar-drawer-footer a .icon { font-size: 16px; }
  .sidebar-drawer-footer a .arrow { margin-left: auto; color: var(--ink-3); }

  /* CONTENT mobile */
  .content { padding: 24px 20px 80px; }
  .content-inner { max-width: 100%; }
  .content h1 { font-size: 30px; line-height: 1.15; margin-bottom: 18px; font-weight: 500; letter-spacing: -0.025em; }
  .content h2 { font-size: 24px; margin: 40px 0 14px 0; padding-top: 24px; font-weight: 600; }
  .content h3 { font-size: 18px; margin: 28px 0 10px 0; }
  .content h4 { font-size: 14px; }
  .content p, .content li { font-size: 16px; line-height: 1.7; letter-spacing: -0.005em; }
  .content blockquote { font-size: 15px; padding: 8px 16px; }
  .content code { font-size: 13.5px; padding: 2px 6px; }
  .content pre { font-size: 13px; padding: 16px 18px; }
  .content hr { margin: 32px 0; }

  .content table {
    display: table; width: 100%;
    overflow: visible; white-space: normal;
    font-size: 13.5px;
  }
  .content table th, .content table td { padding: 10px 12px; word-break: break-word; }

  /* Page TOC */
  .page-toc { padding: 14px 16px; margin: 16px 0 24px 0; }
  .page-toc-list a { padding: 10px 8px; font-size: 14px; min-height: 40px; }

  /* Hero (HUB y cliente HOME) */
  .home-hero { padding: 32px 20px 28px 20px; }
  .home-hero h1 { font-size: 30px; line-height: 1.12; margin-bottom: 14px; }
  .home-hero p.lead { font-size: 15.5px; }
  .home-hero .meta {
    grid-template-columns: 1fr; gap: 14px;
    margin-top: 28px; padding-top: 20px;
  }
  .home-hero .meta-item .meta-value { font-size: 14px; line-height: 1.4; }
  .home-hero .meta-item .meta-label { font-size: 10px; }

  .home-section { padding: 28px 20px; }
  .home-section .section-head {
    flex-direction: column; align-items: flex-start; gap: 6px;
    margin-bottom: 18px;
  }
  .home-section h2 { font-size: 22px; }
  .home-section .section-meta { font-size: 11px; }

  .cards-grid { grid-template-columns: 1fr; gap: 14px; }
  .card { padding: 22px 22px; }
  .card .card-title { font-size: 17px; line-height: 1.3; }
  .card .card-desc { font-size: 14px; line-height: 1.55; }
  .card .card-num { font-size: 11.5px; }

  .page-nav { grid-template-columns: 1fr; gap: 10px; margin-top: 40px; padding-top: 24px; }
  .page-nav .next { text-align: left; }
  .page-nav a { padding: 18px 20px; min-height: 64px; }
  .page-nav .label { font-size: 12px; }
  .page-nav .title { font-size: 15px; }

  .breadcrumbs { font-size: 12px; margin-bottom: 16px; color: var(--ink-2); }

  .bottom-tab { display: block; }
  .sticky-section {
    display: block;
    position: sticky; top: var(--topnav-h); z-index: 40;
    background: var(--bg-soft);
    border-bottom: 1px solid var(--line);
    padding: 8px 16px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px; color: var(--ink-2);
    letter-spacing: .04em;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }

  .back-to-top { right: 16px; bottom: calc(var(--bottom-tab-h) + 16px); }

  footer.site-footer { padding: 28px 20px 16px; font-size: 11.5px; }
}

@media (max-width: 380px) {
  .home-hero { padding: 28px 16px; }
  .home-hero h1 { font-size: 26px; }
  .nav-inner { padding: 8px 12px; gap: 8px; }
  .nav-brand { font-size: 11px; }
  .menu-toggle { padding: 6px 8px; font-size: 10px; }
  .menu-toggle span:not(.bars):not(.menu-count) { display: none; }
  .nav-back-home span:not(.icon) { display: none; }
  .nav-back-home { padding: 6px 10px; }
  .content { padding: 20px 16px 80px; }
  .home-section { padding: 24px 16px; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
