:root{
    /* Light, serious palette */
    --bg: #f7f8fb;
    --bg2:#ffffff;
    --ink:#0f172a;          /* slate-900 */
    --muted:#475569;        /* slate-600 */
    --faint:#64748b;        /* slate-500 */
  
    --panel: rgba(255,255,255,.78);
    --panel2: rgba(255,255,255,.92);
    --border: rgba(15,23,42,.10);
    --border2: rgba(15,23,42,.16);
  
    /* restrained “AI” accents */
    --accent:#4f46e5;       /* indigo */
    --accent2:#0891b2;      /* cyan */
    --shadow: 0 18px 60px rgba(2,6,23,.10);
    --shadow2: 0 10px 30px rgba(2,6,23,.08);
  
    --r14:14px;
    --r18:18px;
    --r24:24px;
  
  --max: 1120px;
  --ease:cubic-bezier(.2,.8,.2,1);

  --topnav-bg: rgba(255,255,255,.70);

  /* Article nav horizontal scroll (light) */
  --article-nav-scroll-track: rgba(0,0,0,.04);
  --article-nav-scroll-thumb: var(--border);
  --article-nav-scroll-height: 8px;
  }

  /* ========== Dark theme (institutional) ========== */
  html.theme-dark {
    --cc-dark-bg: #0f172a;
    --cc-dark-surface: #111827;
    --cc-dark-card: rgba(30,41,59,0.65);
    --cc-dark-border: rgba(148,163,184,0.18);
    --cc-dark-text-primary: #e5e7eb;
    --cc-dark-text-secondary: #94a3b8;
    --cc-dark-accent: #c7d2fe;
    --cc-dark-ink-line: rgba(148,163,184,0.35);

    --bg: var(--cc-dark-bg);
    --bg2: #0c1222;
    --ink: var(--cc-dark-text-primary);
    --muted: var(--cc-dark-text-secondary);
    --cc-dark-text-elevated: #b8c5d6;
    --faint: #94a3b8;
    --panel: var(--cc-dark-card);
    --panel2: var(--cc-dark-surface);
    --border: var(--cc-dark-border);
    --border2: rgba(148,163,184,0.25);
    --accent: var(--cc-dark-accent);
    --accent2: #a5b4fc;
    --shadow: 0 18px 60px rgba(0,0,0,.28);
    --shadow2: 0 10px 30px rgba(0,0,0,.2);
    --topnav-bg: rgba(17,24,39,.75);
    --article-nav-scroll-track: rgba(148,163,184,.08);
    --article-nav-scroll-thumb: var(--cc-dark-border);
  }

  html.theme-dark .bg {
    background:
      linear-gradient(transparent 0, transparent 28px, rgba(148,163,184,0.06) 28px, rgba(148,163,184,0.06) 29px),
      linear-gradient(90deg, transparent 0, transparent 28px, rgba(148,163,184,0.05) 28px, rgba(148,163,184,0.05) 29px);
    background-size: 29px 29px, 29px 29px;
    opacity: .85;
  }

  html.theme-dark .topnav { border-color: var(--cc-dark-ink-line); }
  html.theme-dark .drawer { background: rgba(0,0,0,.4); }

  html.theme-dark .navlink--pill {
    border-color: rgba(199,210,254,.35);
    background: rgba(199,210,254,.12);
    color: var(--cc-dark-text-primary);
  }
  html.theme-dark .navlink--pill:hover { background: rgba(199,210,254,.2); }
  html.theme-dark .drawerCta {
    border-color: rgba(199,210,254,.4) !important;
    background: rgba(199,210,254,.14) !important;
    color: var(--cc-dark-text-primary) !important;
  }
  html.theme-dark .tileEmphasis {
    border-color: rgba(199,210,254,.3);
    background: rgba(199,210,254,.1);
  }
  html.theme-dark .tagSm,
  html.theme-dark .tag,
  html.theme-dark .pill,
  html.theme-dark .chip {
    color: var(--cc-dark-text-secondary);
    border-color: var(--cc-dark-border);
  }
  html.theme-dark .card .list,
  html.theme-dark .card .list li,
  html.theme-dark .tile p,
  html.theme-dark .cardMeta,
  html.theme-dark .article p,
  html.theme-dark .articleMeta {
    color: var(--cc-dark-text-elevated);
  }
  html.theme-dark .card,
  html.theme-dark .tile,
  html.theme-dark .article,
  html.theme-dark .fade-card {
    color: var(--cc-dark-text-elevated);
  }
  html.theme-dark .cardTitle,
  html.theme-dark .tile h3,
  html.theme-dark .articleTitle {
    color: var(--cc-dark-text-primary);
  }
  html.theme-dark .card p,
  html.theme-dark .tile p,
  html.theme-dark .article p,
  html.theme-dark .card li,
  html.theme-dark .tile li,
  html.theme-dark .tile ul li {
    color: var(--cc-dark-text-elevated);
  }
  html.theme-dark .card p strong,
  html.theme-dark .tile p strong,
  html.theme-dark .article p strong,
  html.theme-dark .card li strong,
  html.theme-dark .tile li strong {
    color: var(--cc-dark-text-primary);
  }
  html.theme-dark .muted,
  html.theme-dark .sectionHead .muted,
  html.theme-dark .eyebrow,
  html.theme-dark .lead {
    color: var(--cc-dark-text-elevated);
  }
  html.theme-dark .lead strong {
    color: var(--cc-dark-text-primary);
  }

  /* Tablas en dark: fondo oscuro y texto con contraste */
  html.theme-dark .card table,
  html.theme-dark .fade-card table,
  html.theme-dark .article-card table,
  html.theme-dark .card-table,
  html.theme-dark .table {
    background: var(--cc-dark-surface);
    border-color: var(--cc-dark-border);
    color: var(--cc-dark-text-secondary);
  }
  html.theme-dark .card table th,
  html.theme-dark .fade-card table th,
  html.theme-dark .article-card table th,
  html.theme-dark .card-table th,
  html.theme-dark .table th {
    background: rgba(79,70,229,.2);
    color: var(--cc-dark-text-primary);
    border-bottom-color: var(--cc-dark-border);
  }
  html.theme-dark .card table td,
  html.theme-dark .fade-card table td,
  html.theme-dark .article-card table td,
  html.theme-dark .card-table td,
  html.theme-dark .table td {
    color: var(--cc-dark-text-secondary);
    border-bottom-color: var(--cc-dark-border);
  }
  html.theme-dark .card table tbody tr:hover,
  html.theme-dark .fade-card table tbody tr:hover,
  html.theme-dark .article-card table tbody tr:hover,
  html.theme-dark .card-table tbody tr:hover,
  html.theme-dark .table tbody tr:hover {
    background: rgba(79,70,229,.1);
  }

  /* Fade-card en dark: quitar fondo blanco/plateado */
  html.theme-dark .fade-card::before {
    background: radial-gradient(140% 120% at 50% 50%,
      var(--cc-dark-card) 0%,
      rgba(30,41,59,0.75) 45%,
      rgba(30,41,59,0.4) 72%,
      transparent 100%
    );
  }
  html.theme-dark .fade-card::after {
    background: radial-gradient(140% 120% at 50% 50%,
      rgba(148,163,184,0.12) 0%,
      rgba(148,163,184,0.06) 55%,
      rgba(148,163,184,0.02) 75%,
      transparent 100%
    );
  }

  /* Article-card en dark (anula estilos inline en artículos) */
  html.theme-dark .article-card {
    background: var(--cc-dark-card) !important;
    border-color: var(--cc-dark-border) !important;
    box-shadow: 0 1px 2px rgba(0,0,0,.2) !important;
    color: var(--cc-dark-text-elevated);
  }
  html.theme-dark .article-card h2,
  html.theme-dark .article-card h3,
  html.theme-dark .article-card h4 {
    color: var(--cc-dark-text-primary);
  }
  html.theme-dark .article-card p,
  html.theme-dark .article-card li {
    color: var(--cc-dark-text-elevated);
  }
  html.theme-dark .article-section h2 { color: var(--cc-dark-text-primary); }
  html.theme-dark .article-nav-inner {
    background: var(--cc-dark-card);
    border-color: var(--cc-dark-border);
  }
  html.theme-dark .article-nav-inner a { color: var(--cc-dark-text-secondary); }
  html.theme-dark .article-nav-inner a:hover { background: var(--cc-dark-surface); }
  html.theme-dark .article-nav-inner a.active { background: rgba(79,70,229,.25); color: var(--cc-dark-accent); }
  html.theme-dark .article-hero .mermaid {
    background: rgba(30,41,59,0.8);
    border-color: var(--cc-dark-border);
  }
  html.theme-dark .article-rating-summary,
  html.theme-dark .article-user-feedback-desc { color: var(--cc-dark-text-secondary); }
  html.theme-dark .article-feedback-submit {
    background: var(--cc-dark-card) !important;
    border-color: var(--cc-dark-border);
    color: var(--cc-dark-text-primary);
  }
  html.theme-dark .article-feedback-submit:hover { border-color: var(--cc-dark-accent); }
  html.theme-dark .article-quiz-slide .quiz-option label,
  html.theme-dark .article-quiz-slide .article-card.q > div label[for^="q"] {
    background: var(--cc-dark-card);
    border-color: var(--cc-dark-border);
    color: var(--cc-dark-text-elevated);
  }
  html.theme-dark .article-quiz-slide .quiz-option input:checked + label,
  html.theme-dark .article-quiz-slide .article-card.q > div input:checked + label {
    background: rgba(79,70,229,.25);
    color: var(--cc-dark-text-primary);
  }
  html.theme-dark .quizBtns button {
    background: var(--cc-dark-card);
    border-color: var(--cc-dark-border);
    color: var(--cc-dark-text-elevated);
  }
  html.theme-dark .ailab-carouselNav { background: var(--cc-dark-card); border-top-color: var(--cc-dark-border); }
  html.theme-dark .ailab-carouselBtn { background: var(--cc-dark-surface); border-color: var(--cc-dark-border); color: var(--cc-dark-accent); }

  /* Cards y contenedores dentro de artículos: sin fondo plateado */
  html.theme-dark .card {
    background: var(--cc-dark-card) !important;
    border-color: var(--cc-dark-border);
    color: var(--cc-dark-text-elevated);
  }
  html.theme-dark .card .list,
  html.theme-dark .card .list li { color: var(--cc-dark-text-elevated); }
  html.theme-dark .tile {
    background: var(--cc-dark-card) !important;
    border-color: var(--cc-dark-border);
    color: var(--cc-dark-text-elevated);
  }
  html.theme-dark .acc,
  html.theme-dark .accPanel {
    background: var(--cc-dark-card) !important;
    border-color: var(--cc-dark-border);
    color: var(--cc-dark-text-elevated);
  }
  html.theme-dark .article {
    background: var(--cc-dark-card) !important;
    border-color: var(--cc-dark-border);
    color: var(--cc-dark-text-elevated);
  }
  html.theme-dark .tagSm {
    background: var(--cc-dark-surface) !important;
    border-color: var(--cc-dark-border);
    color: var(--cc-dark-text-secondary);
  }
  /* Callouts y mini (usados en artículos) */
  html.theme-dark .callout {
    background: var(--cc-dark-card) !important;
    border-color: var(--cc-dark-border);
    color: var(--cc-dark-text-elevated);
  }
  html.theme-dark .callout strong { color: var(--cc-dark-text-primary); }
  html.theme-dark .callout .mini { color: var(--cc-dark-text-secondary); }
  html.theme-dark .drawerPanel { background: var(--cc-dark-card) !important; border-color: var(--cc-dark-border); }
  html.theme-dark .drawerClose,
  html.theme-dark .drawerLinks a { background: var(--cc-dark-surface) !important; border-color: var(--cc-dark-border); color: var(--cc-dark-text-primary); }
  html.theme-dark .burger { background: var(--cc-dark-card) !important; border-color: var(--cc-dark-border); }
  html.theme-dark .burger span { background: var(--cc-dark-text-secondary); }
  html.theme-dark .article-fab { background: var(--cc-dark-card); border-color: var(--cc-dark-border); }
  html.theme-dark .article-fab:hover,
  html.theme-dark .article-fab.is-open { background: var(--cc-dark-surface); border-color: var(--cc-dark-accent); }
  html.theme-dark .article-fab-icon span { background: var(--cc-dark-text-primary); }
  html.theme-dark .article-fab-panel { background: var(--cc-dark-card); border-color: var(--cc-dark-border); }
  html.theme-dark .article-fab-panel .article-fab-panel-close { background: var(--cc-dark-surface); border-color: var(--cc-dark-border); color: var(--cc-dark-text-primary); }
  html.theme-dark .article-fab-panel .article-fab-panel-links a { background: var(--cc-dark-surface); border-color: var(--cc-dark-border); color: var(--cc-dark-text-primary); }
  html.theme-dark .article-fab-panel .article-fab-panel-links a:hover { background: rgba(79,70,229,.2); border-color: var(--cc-dark-accent); }

  *{ box-sizing:border-box; }
  html{ scroll-behavior:smooth; }
  body{
    margin:0;
    font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
    color: var(--ink);
    background: linear-gradient(180deg, var(--bg), var(--bg2));
    line-height:1.65;
  }
  
  /* subtle grid + glow */
  .bg{
    position:fixed;
    inset:0;
    pointer-events:none;
    background:
      radial-gradient(900px 700px at 15% 0%, rgba(79,70,229,.10), transparent 55%),
      radial-gradient(800px 600px at 85% 10%, rgba(8,145,178,.08), transparent 55%),
      linear-gradient(transparent 0, transparent 28px, rgba(15,23,42,.035) 28px, rgba(15,23,42,.035) 29px),
      linear-gradient(90deg, transparent 0, transparent 28px, rgba(15,23,42,.028) 28px, rgba(15,23,42,.028) 29px);
    background-size: auto, auto, 29px 29px, 29px 29px;
    opacity:.9;
  }
  
  a{ color:inherit; text-decoration:none; }
  .link{
    color: color-mix(in srgb, var(--accent) 88%, var(--ink));
    border-bottom: 1px solid rgba(79,70,229,.25);
  }
  .link:hover{ border-bottom-color: rgba(8,145,178,.45); }
  
  .shell{
    max-width: var(--max);
    margin: 0 auto;
    padding: 18px 16px 70px;
  }
  @media (min-width: 900px){
    .shell{ padding: 22px 20px 90px; }
  }
  
  /* top nav */
  .topnav{
    position: sticky;
    top: 12px;
    z-index: 50;
  
    /* ✅ ahora calza con el ancho del contenido */
    max-width: var(--max);
    margin: 12px auto 0;
  
    /* ✅ alinea el padding con el shell (16px en X) */
    padding: 10px 16px;
  
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--topnav-bg);
    backdrop-filter: blur(12px);
    box-shadow: var(--shadow2);
  
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
  }
  .card, .tile, .article, .heroRight{
    position: relative;
    overflow: hidden; /* necesario para que el overlay se recorte */
  }
  
  /* capa suave de “neblina” en bordes */
  .fog-edges::before{
    content:"";
    position:absolute;
    inset:-1px;
    border-radius: inherit;
    pointer-events:none;
  
    background:
      radial-gradient(60% 18px at 50% 0%, rgba(79,70,229,.12), transparent 60%),
      radial-gradient(60% 18px at 50% 100%, rgba(8,145,178,.10), transparent 60%),
      radial-gradient(18px 60% at 0% 50%, rgba(15,23,42,.05), transparent 65%),
      radial-gradient(18px 60% at 100% 50%, rgba(15,23,42,.05), transparent 65%);
  
    opacity:.9;
  }
  
  /* versión más sutil */
  .fog-edges.soft::before{
    opacity:.55;
  }
  
  /* mejora: hover premium (opcional) */
  .fog-edges:hover::before{
    opacity:.75;
  }  

  .brand{
    display:flex;
    align-items:center;
    gap:10px;
    min-width:0;
    font-family: "IBM Plex Sans", ui-sans-serif, system-ui, sans-serif;
    color: var(--ink);
  }
  .brandMark{
    font-family: "IBM Plex Sans", ui-sans-serif, system-ui, sans-serif;
    font-weight: 600;
    letter-spacing: -0.03em;
    font-size: 1.25rem;
    line-height: 1;
  }
  .brandText{ display:flex; flex-direction:column; min-width:0; }
  .brandName{
    font-family: "IBM Plex Sans", ui-sans-serif, system-ui, sans-serif;
    font-size: 12px;
    letter-spacing: .08em;
    text-transform: uppercase;
    font-weight: 500;
    white-space:nowrap;
  }
  .brandSub{
    font-family: "IBM Plex Sans", ui-sans-serif, system-ui, sans-serif;
    font-size: 11px;
    color: var(--muted);
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
    letter-spacing: 0.04em;
  }

  .theme-toggle{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    width:36px;
    height:36px;
    padding:0;
    border:none;
    border-radius:999px;
    background:transparent;
    color: var(--muted);
    font-size:1.1rem;
    cursor:pointer;
    transition: color .16s var(--ease);
  }
  .theme-toggle:hover{ color: var(--ink); }
  html.theme-dark .theme-toggle{ color: var(--cc-dark-text-secondary); }
  html.theme-dark .theme-toggle:hover{ color: var(--cc-dark-text-primary); }

  .navlinks{
    display:flex;
    align-items:center;
    gap:14px;
  }
  .navlink{
    font-size: 12px;
    color: var(--muted);
    padding: 6px 6px;
    position:relative;
  }
  .navlink:hover{ color: var(--ink); }
  .navlink::after{
    content:"";
    position:absolute;
    left:6px; right:6px; bottom:2px;
    height:2px;
    border-radius:999px;
    background: linear-gradient(90deg, var(--accent), var(--accent2));
    opacity:0;
    transform: translateY(2px);
    transition: all .18s var(--ease);
  }
  .navlink:hover::after{ opacity:.9; transform: translateY(0); }
  
  .navlink--pill{
    border:1px solid rgba(79,70,229,.22);
    background: linear-gradient(135deg, rgba(79,70,229,.12), rgba(8,145,178,.08));
    padding:7px 12px;
    border-radius:999px;
    color: var(--ink);
  }
  .navlink--pill::after{ display:none; }
  
  .burger{
    display:none;
    width:42px;height:36px;
    border-radius:999px;
    border:1px solid var(--border);
    background: rgba(255,255,255,.75);
    cursor:pointer;
  }
  .burger span{
    display:block;
    width:18px;height:2px;
    background: rgba(15,23,42,.70);
    margin:4px auto;
    border-radius:999px;
  }
  
  @media (max-width: 900px){
    .navlinks{ display:none; }
    .burger{ display:block; }
    .brandSub{ display:none; }
  }
  
  /* drawer */
  .drawer{
    position:fixed;
    inset:0;
    z-index:60;
    background: rgba(2,6,23,.24);
    opacity:0;
    pointer-events:none;
    transition: opacity .18s var(--ease);
  }
  .drawer.is-open{ opacity:1; pointer-events:auto; }
  .drawerPanel{
    position:absolute;
    right:12px; top:12px;
    width:min(92vw, 380px);
    border-radius: 18px;
    border:1px solid var(--border);
    background: rgba(255,255,255,.92);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow);
    padding:14px;
  }
  .drawerTop{ display:flex; justify-content:space-between; align-items:center; }
  .drawerTitle{ font-weight: 900; letter-spacing:-.01em; }
  .drawerClose{
    border:1px solid var(--border);
    background: rgba(255,255,255,.85);
    color: var(--ink);
    border-radius: 12px;
    padding: 8px 10px;
    cursor:pointer;
  }
  .drawerLinks{ display:grid; gap:8px; margin-top:12px; }
  .drawerLinks a{
    padding:10px 12px;
    border-radius: 12px;
    border:1px solid var(--border);
    background: rgba(255,255,255,.88);
    color: var(--ink);
  }
  .drawerCta{
    border-color: rgba(79,70,229,.28) !important;
    background: linear-gradient(135deg, rgba(79,70,229,.14), rgba(8,145,178,.08)) !important;
  }
  .drawerFoot{ margin-top:12px; }

  /* Article floating nav (FAB) */
  .article-fab {
    position: fixed;
    bottom: 1.25rem;
    right: 1.25rem;
    z-index: 65;
    width: 52px;
    height: 52px;
    min-width: 44px;
    min-height: 44px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--panel);
    box-shadow: var(--shadow2);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .2s, border-color .2s, transform .2s, box-shadow .2s;
  }
  .article-fab:hover {
    background: var(--panel2);
    border-color: var(--border2);
    box-shadow: var(--shadow);
    transform: scale(1.05);
  }
  .article-fab.is-open {
    background: var(--panel2);
    border-color: var(--accent);
  }
  .article-fab-icon {
    display: flex;
    flex-direction: column;
    gap: 5px;
    align-items: center;
  }
  .article-fab-icon span {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--ink);
    border-radius: 1px;
  }
  .article-fab-panel {
    position: fixed;
    bottom: 4.5rem;
    right: 1.25rem;
    z-index: 64;
    width: min(92vw, 380px);
    max-height: 70vh;
    overflow-y: auto;
    border-radius: 18px;
    border: 1px solid var(--border);
    background: var(--panel);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow);
    padding: 14px;
    opacity: 0;
    pointer-events: none;
    transition: opacity .18s var(--ease);
  }
  .article-fab-panel.is-open {
    opacity: 1;
    pointer-events: auto;
  }
  .article-fab-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
  }
  .article-fab-panel .article-fab-panel-title {
    font-weight: 900;
    letter-spacing: -.01em;
    margin: 0;
  }
  .article-fab-panel .article-fab-panel-close {
    border: 1px solid var(--border);
    background: var(--panel2);
    color: var(--ink);
    border-radius: 12px;
    padding: 8px 10px;
    cursor: pointer;
  }
  .article-fab-panel-section {
    margin-top: 12px;
  }
  .article-fab-panel-section:first-of-type { margin-top: 0; }
  .article-fab-panel-section .article-fab-panel-title {
    font-size: 0.85rem;
    margin-bottom: 8px;
    color: var(--muted);
  }
  .article-fab-panel .article-fab-panel-links {
    display: grid;
    gap: 6px;
  }
  .article-fab-panel .article-fab-panel-links a {
    padding: 8px 12px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--panel2);
    color: var(--ink);
    text-decoration: none;
    font-size: 0.9rem;
    transition: background .2s, border-color .2s;
  }
  .article-fab-panel .article-fab-panel-links a:hover {
    background: rgba(79,70,229,.08);
    border-color: var(--accent);
  }
  .article-fab-panel-articles .article-nav-group {
    margin-top: 14px;
  }
  .article-fab-panel-articles .article-nav-group:first-child {
    margin-top: 0;
  }
  .article-nav-group-title {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--muted);
    margin-bottom: 6px;
  }
  .article-fab-panel-articles .article-fab-panel-links {
    display: grid;
    gap: 6px;
  }
  .drawerLinks .article-nav-group {
    margin-top: 12px;
  }
  .drawerLinks .article-nav-group:first-child {
    margin-top: 0;
  }
  .drawerLinks .article-nav-group-title {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--muted);
    margin-bottom: 6px;
  }
  .drawerLinks .article-fab-panel-links {
    display: grid;
    gap: 6px;
    margin-bottom: 4px;
  }
  
  /* progress bar */
  .progress{
    position:fixed;
    left:0; right:0;
    top:0;
    height:3px;
    z-index:70;
    background: transparent;
  }
  .progressBar{
    height:100%;
    width:0%;
    background: linear-gradient(90deg, var(--accent), var(--accent2));
  }
  
  /* hero */
  .hero{
    margin-top: 18px;
    display:grid;
    grid-template-columns: 1.15fr .85fr;
    gap: 14px;
    align-items: stretch;
  }
  @media (max-width: 980px){
    .hero{ grid-template-columns:1fr; }
  }
  
  .heroLeft{
    border-radius: var(--r24);
    border:1px solid var(--border);
    background: rgba(255,255,255,.78);
    box-shadow: var(--shadow2);
    padding: 18px;
  }
  .heroRight{
    border-radius: var(--r24);
    border:1px solid var(--border);
    background: rgba(255,255,255,.78);
    box-shadow: var(--shadow2);
    padding: 16px;
    overflow:hidden;
  }
  
  .chips{ display:flex; flex-wrap:wrap; gap:8px; }
  .chip{
    display:inline-flex;
    gap:8px;
    align-items:center;
    padding: 7px 10px;
    border-radius: 999px;
    border:1px solid var(--border);
    background: rgba(255,255,255,.90);
    color: var(--muted);
    font-size: 12px;
  }
  .dot{
    width:9px;height:9px;border-radius:50%;
    background: rgba(79,70,229,.70);
    box-shadow: 0 0 0 6px rgba(79,70,229,.10);
  }
  .dot2{
    background: rgba(8,145,178,.65);
    box-shadow: 0 0 0 6px rgba(8,145,178,.10);
  }
  
  .h1{
    margin: 14px 0 10px;
    font-size: clamp(34px, 4.2vw, 48px);
    line-height: 1.05;
    letter-spacing: -0.03em;
  }
  .lead{ margin:0 0 10px; color: rgba(15,23,42,.72); max-width: 85ch; }
  
  .tags{ display:flex; flex-wrap:wrap; gap:8px; margin-top: 10px; }
  .tag{
    padding: 6px 10px;
    border-radius: 999px;
    border:1px solid var(--border);
    background: rgba(255,255,255,.92);
    color: var(--muted);
    font-size: 12px;
  }
  
  .heroCtas{ display:flex; flex-wrap:wrap; gap:10px; margin-top: 14px; }
  .btn{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    padding: 10px 14px;
    border-radius: 999px;
    border:1px solid var(--border);
    font-weight: 800;
    font-size: 13px;
    cursor:pointer;
    transition: transform .16s var(--ease), box-shadow .16s var(--ease), border-color .16s var(--ease);
  }
  .btn:hover{
    transform: translateY(-1px);
    box-shadow: var(--shadow2);
    border-color: rgba(15,23,42,.18);
  }
  .btnPrimary{
    border-color: rgba(79,70,229,.26);
    background: linear-gradient(135deg, rgba(79,70,229,.16), rgba(8,145,178,.10));
  }
  .btnGhost{
    background: rgba(255,255,255,.90);
  }
  
  /* right panel */
  .panelTop{ display:flex; justify-content:space-between; align-items:baseline; gap:12px; }
  .panelTitle{ font-weight: 950; letter-spacing:-.02em; }
  .panelMeta{ color: var(--muted); font-size: 12px; }
  
  .panelViz{
    margin-top: 12px;
    height: 260px;
    border-radius: 18px;
    border:1px solid var(--border);
    background:
      radial-gradient(circle at 20% 15%, rgba(79,70,229,.10), transparent 45%),
      radial-gradient(circle at 80% 20%, rgba(8,145,178,.08), transparent 50%),
      linear-gradient(180deg, rgba(255,255,255,.96), rgba(255,255,255,.86));
    position:relative;
    overflow:hidden;
  }
  .node{
    position:absolute;
    padding: 8px 10px;
    border-radius: 999px;
    border:1px solid rgba(15,23,42,.14);
    background: rgba(255,255,255,.92);
    color: rgba(15,23,42,.78);
    font-size: 12px;
    box-shadow: 0 12px 24px rgba(2,6,23,.08);
  }
  .n1{ left:16px; top:18px; }
  .n2{ left:120px; top:80px; }
  .n3{ left:260px; top:34px; }
  .n4{ left:260px; top:140px; }
  .n5{ left:110px; top:190px; }
  .n6{ left:18px; top:150px; }
  
  .line{
    position:absolute;
    height:2px;
    background: linear-gradient(90deg, rgba(79,70,229,.0), rgba(79,70,229,.45), rgba(8,145,178,.45), rgba(8,145,178,.0));
    opacity:.65;
    transform-origin:left center;
    animation: drift 6s var(--ease) infinite;
  }
  .l1{ left:44px; top:40px; width:150px; transform: rotate(22deg); }
  .l2{ left:150px; top:112px; width:170px; transform: rotate(-10deg); animation-delay: .3s; }
  .l3{ left:70px; top:184px; width:220px; transform: rotate(-2deg); animation-delay: .6s; }
  .l4{ left:52px; top:160px; width:190px; transform: rotate(-26deg); animation-delay: .9s; }
  @keyframes drift{
    0%{ opacity:.35; transform: translateX(0) scaleX(1) rotate(var(--r,0deg)); }
    50%{ opacity:.8; transform: translateX(10px) scaleX(1.02) rotate(var(--r,0deg)); }
    100%{ opacity:.35; transform: translateX(0) scaleX(1) rotate(var(--r,0deg)); }
  }
  .panelFoot{ display:flex; flex-wrap:wrap; gap:8px; margin-top: 12px; }
  .pill{
    padding: 6px 10px;
    border-radius: 999px;
    border:1px solid var(--border);
    background: rgba(255,255,255,.92);
    color: var(--muted);
    font-size: 12px;
  }
  
  /* sections */
  .section{ margin-top: 22px; padding-top: 6px; }
  .sectionHead{
    display:flex;
    align-items:flex-end;
    justify-content:space-between;
    gap:14px;
    margin: 10px 0 12px;
  }
  @media (max-width: 900px){
    .sectionHead{ flex-direction:column; align-items:flex-start; }
  }
  .eyebrow{
    font-size: 12px;
    letter-spacing:.16em;
    text-transform:uppercase;
    color: var(--muted);
  }
  .h2{
    margin: 6px 0 0;
    font-size: 22px;
    letter-spacing: -0.01em;
  }
  .muted{ color: rgba(15,23,42,.55); font-size: 13px; }
  
  /* cards + grids */
  .grid2{
    display:grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }
  .grid3{
    display:grid;
    grid-template-columns: repeat(3, minmax(0,1fr));
    gap: 12px;
  }
  @media (max-width: 980px){
    .grid2, .grid3{ grid-template-columns: 1fr; }
  }
  
  .card{
    border-radius: var(--r18);
    border:1px solid var(--border);
    background: rgba(255,255,255,.78);
    box-shadow: var(--shadow2);
    padding: 14px;
  }
  .cardTitle{ font-weight: 950; letter-spacing:-.01em; }
  .cardMeta{ color: rgba(15,23,42,.55); font-size: 12px; margin-top:2px; }
  
  .list{ margin: 10px 0 0; padding-left: 18px; color: rgba(15,23,42,.72); }
  .list li{ margin: 7px 0; }

  .callout {
    padding: 14px;
    border-radius: var(--r14);
    border: 1px solid var(--border);
    background: var(--panel2, rgba(255,255,255,.92));
    margin: 14px 0;
  }
  .callout strong { color: var(--ink); }
  .callout .mini { margin-top: 8px; font-size: 13px; color: var(--muted); }

  .tile{
    border-radius: var(--r18);
    border:1px solid var(--border);
    background: rgba(255,255,255,.78);
    box-shadow: var(--shadow2);
    padding: 14px;
  }
  .tile h3{ margin:0 0 8px; letter-spacing:-.01em; }
  .tile p{ margin: 8px 0 0; color: rgba(15,23,42,.72); }
  .tileTags{ display:flex; flex-wrap:wrap; gap:8px; }
  
  .tileEmphasis{
    border-color: rgba(79,70,229,.18);
    background: linear-gradient(135deg, rgba(79,70,229,.10), rgba(8,145,178,.06));
  }
  .tileActions{ display:flex; flex-wrap:wrap; gap:12px; margin-top: 10px; }
  
  /* small tags used in article cards */
  .tagSm{
    padding: 5px 9px;
    border-radius: 999px;
    border:1px solid var(--border);
    background: rgba(255,255,255,.92);
    color: var(--muted);
    font-size: 12px;
  }
  
  /* accordion */
  .accordion{ display:grid; gap:10px; }
  .acc{
    width:100%;
    text-align:left;
    border-radius: 16px;
    border:1px solid var(--border);
    background: rgba(255,255,255,.78);
    padding: 12px 12px;
    display:flex;
    align-items:center;
    gap:10px;
    cursor:pointer;
    box-shadow: var(--shadow2);
  }
  .accTitle{ font-weight: 950; }
  .accMeta{ color: var(--muted); font-size: 12px; }
  .accIcon{ margin-left:auto; color: var(--muted); transition: transform .18s var(--ease); }
  .acc[aria-expanded="true"] .accIcon{ transform: rotate(180deg); }
  
  .accPanel{
    display:none;
    border-radius: 16px;
    border:1px solid var(--border);
    background: rgba(255,255,255,.78);
    box-shadow: var(--shadow2);
    padding: 12px 14px;
  }
  .accPanel.is-open{ display:block; }
  
  /* articles */
  .groups{ display:grid; gap: 14px; margin-top: 12px; }
  .groupTitle{
    font-weight: 950;
    letter-spacing:-.01em;
    margin: 2px 0 10px;
  }
  .articleGrid{
    display:grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }
  @media (max-width: 980px){
    .articleGrid{ grid-template-columns: 1fr; }
  }
  .article{
    display:block;
    border-radius: var(--r18);
    border:1px solid var(--border);
    background: rgba(255,255,255,.92);
    box-shadow: var(--shadow2);
    padding: 14px;
    transition: transform .16s var(--ease), border-color .16s var(--ease), box-shadow .16s var(--ease);
  }
  .article:hover{
    transform: translateY(-2px);
    border-color: rgba(8,145,178,.22);
    box-shadow: var(--shadow);
  }
  .articleTitle{ font-weight: 950; letter-spacing:-.01em; }
  .articleMeta{ color: rgba(15,23,42,.55); font-size: 12px; margin-top:2px; }
  .article p{ color: rgba(15,23,42,.72); margin: 10px 0 0; }
  .chipsRow{ display:flex; flex-wrap:wrap; gap:8px; margin-top: 10px; }
  
  .actions{ display:flex; flex-wrap:wrap; gap:10px; margin-top: 12px; }
  
  .footer{
    margin-top: 28px;
    padding: 14px 2px 4px;
    display:flex;
    justify-content:space-between;
    gap:12px;
    flex-wrap:wrap;
    color: var(--muted);
    font-size: 12px;
    border-top: 1px solid rgba(15,23,42,.10);
  }
  
  /* Accessibility: reduce motion */
  @media (prefers-reduced-motion: reduce){
    html{ scroll-behavior:auto; }
    .line{ animation:none; }
    .btn:hover, .article:hover{ transform:none; }
  }
  /* =========================================
   PATCH: Header aligned + Cards + Fog edges
   (Pegar al FINAL de master_v2.css)
========================================= */

/* Header aligned with same inset as .shell */
.topnav{
    width: calc(100% - 32px);
    max-width: var(--max);
    margin: 12px auto 0;
    padding: 10px 16px;
  }
  @media (min-width: 900px){
    .topnav{
      width: calc(100% - 40px);
      padding: 10px 20px;
    }
  }
  
  /* Core card styles (so you see cards) */
  .heroLeft, .heroRight, .card, .tile, .article, .acc, .accPanel{
    border-radius: var(--r18);
    border: 1px solid var(--border);
    background: rgba(255,255,255,.78);
    box-shadow: var(--shadow2);
  }
  
  /* ensure hero uses bigger radius */
  .heroLeft, .heroRight{ border-radius: var(--r24); }
  
  .card, .tile, .article, .accPanel{ padding: 14px; }
  .heroLeft{ padding: 18px; }
  .heroRight{ padding: 16px; }
  
  /* Fog edges (Option B) */
  .card, .tile, .article, .heroRight{
    position: relative;
    overflow: hidden;
  }
  .fog-edges{ position: relative; overflow: hidden; }
  .fog-edges::before{
    content:"";
    position:absolute;
    inset:-1px;
    border-radius: inherit;
    pointer-events:none;
    background:
      radial-gradient(60% 18px at 50% 0%, rgba(79,70,229,.12), transparent 60%),
      radial-gradient(60% 18px at 50% 100%, rgba(8,145,178,.10), transparent 60%),
      radial-gradient(18px 60% at 0% 50%, rgba(15,23,42,.05), transparent 65%),
      radial-gradient(18px 60% at 100% 50%, rgba(15,23,42,.05), transparent 65%);
    opacity:.55;
    z-index:0;
  }
  .fog-edges:hover::before{ opacity:.75; }
  .fog-edges > *{ position: relative; z-index:1; }
 

.fade-card{
    position: relative;
    overflow: hidden;
    border: none !important;                 /* clave: no borde sólido */
    background: transparent !important;      /* fondo lo pintamos en ::before */
  }
  
  /* Fondo del card: blanco en el centro, transparente en bordes */
  .fade-card::before{
    content:"";
    position:absolute;
    inset:0;
    border-radius: inherit;
    pointer-events:none;
    z-index:0;
  
    /* Centro más opaco, bordes se van a transparente */
    background:
      radial-gradient(140% 120% at 50% 50%,
        rgba(255,255,255,.85) 0%,
        rgba(255,255,255,.75) 45%,
        rgba(255,255,255,.25) 72%,
        rgba(255,255,255,0) 100%
      );
  
    /* “desvanecido” más natural */
    filter: blur(0.2px);
  }
  
  /* “Borde” difuminado: se pinta como sombra interna que se desvanece */
  .fade-card::after{
    content:"";
    position:absolute;
    inset:0;
    border-radius: inherit;
    pointer-events:none;
    z-index:0;
  
    /* Simula borde que desaparece hacia afuera */
    background:
      radial-gradient(140% 120% at 50% 50%,
        rgba(15,23,42,.12) 0%,
        rgba(15,23,42,.08) 55%,
        rgba(15,23,42,.03) 75%,
        rgba(15,23,42,0) 100%
      );
  
    /* El truco: lo hacemos “borde” con máscara */
    -webkit-mask:
      linear-gradient(#000, #000) content-box,
      linear-gradient(#000, #000);
    mask:
      linear-gradient(#000, #000) content-box,
      linear-gradient(#000, #000);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
  
    padding: 1px; /* grosor del borde */
  }
  
  /* Mantén contenido arriba */
  .fade-card > *{
    position: relative;
    z-index: 1;
  }

  /* Article hero + PDF button (article page / preview) */
  .article-hero-cta { margin-top: 1.25rem; }
  .article-hero .btn-hero {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,.95);
    color: var(--ink, #0f172a);
    border: 1px solid rgba(255,255,255,.9);
    font-weight: 700;
    padding: 10px 18px;
    border-radius: 999px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: transform .16s var(--ease), box-shadow .16s var(--ease);
  }
  .article-hero .btn-hero:hover {
    background: #fff;
    box-shadow: 0 4px 14px rgba(0,0,0,.12);
    transform: translateY(-1px);
  }

  /* Article page: hero, nav, cards, carousel, quiz slide, rating, feedback, image zoom */
  .article-hero { background: linear-gradient(135deg, #4f46e5 0%, #0ea5e9 100%); border-radius: var(--r18, 18px); padding: 2rem; color: #fff; margin-bottom: 2rem; }
  .article-hero .hero-kicker { font-size: 0.875rem; opacity: .9; margin-bottom: 0.5rem; }
  .article-hero .hero-chips { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0.5rem 0; }
  .article-hero .hero-chip { background: rgba(255,255,255,.2); border: 1px solid rgba(255,255,255,.5); border-radius: 999px; padding: 0.25rem 0.75rem; font-size: 0.8rem; }
  .article-hero .hero-pills { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.75rem; }
  .article-hero .hero-pill { background: rgba(255,255,255,.2); border: 1px solid rgba(255,255,255,.5); border-radius: 999px; padding: 0.35rem 0.75rem; font-size: 0.85rem; }
  .article-hero h1 { margin: 0 0 0.5rem; color: #fff; }
  .article-hero .desc { opacity: .95; max-width: 72ch; }
  .article-hero .mermaid { background: rgba(255,255,255,.95); border-radius: var(--r14); padding: 1rem; margin-top: 1rem; max-height: 280px; overflow: auto; border: 1px solid rgba(0,0,0,.08); }
  .article-nav-inner { position: sticky; top: 0.5rem; z-index: 5; background: var(--panel, #fff); border: 1px solid var(--border, #e5e7eb); border-radius: var(--r14, 14px); padding: 0.75rem 1rem; margin-bottom: 1rem; }
  .article-nav-inner ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: nowrap; gap: 0.5rem; overflow-x: auto; scroll-behavior: smooth; -webkit-overflow-scrolling: touch; scrollbar-width: thin; scrollbar-color: var(--article-nav-scroll-thumb) var(--article-nav-scroll-track); }
  .article-nav-inner ul::-webkit-scrollbar { height: var(--article-nav-scroll-height, 8px); }
  .article-nav-inner ul::-webkit-scrollbar-track { background: var(--article-nav-scroll-track); border-radius: 4px; }
  .article-nav-inner ul::-webkit-scrollbar-thumb { background: var(--article-nav-scroll-thumb); border-radius: 4px; }
  .article-nav-inner li { flex: 0 0 auto; }
  .article-nav-inner a { font-size: 0.9rem; color: var(--ink, #1f2937); text-decoration: none; padding: 0.35rem 0.6rem; border-radius: 6px; white-space: nowrap; display: block; }
  .article-nav-inner a:hover { background: var(--panel2, #f9fafb); }
  .article-nav-inner a.active { font-weight: 600; background: rgba(79,70,229,.1); color: var(--accent, #4f46e5); }
  .article-prev-next { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; padding: 0.75rem 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
  .article-prev-next a { font-size: 0.95rem; font-weight: 600; color: var(--accent); text-decoration: none; padding: 0.5rem 0.75rem; border-radius: 8px; border: 1px solid var(--border); background: var(--panel2); transition: background .2s, border-color .2s, transform .16s ease; }
  .article-prev-next a:hover { background: rgba(79,70,229,.08); border-color: var(--accent); transform: translateY(-1px); }
  .article-prev-next a[hidden] { display: none; }
  .article-prev-next .article-prev-next-prev { margin-right: auto; }
  .article-prev-next .article-prev-next-next { margin-left: auto; }
  .article-section { margin-bottom: 2rem; }
  .article-section h2 { margin: 0 0 1rem; font-size: 1.25rem; }
  .article-card { background: rgba(255,255,255,.7); border: 1px solid rgba(0,0,0,.06); border-radius: var(--r14); padding: 1.25rem; margin-bottom: 1rem; box-shadow: 0 1px 2px rgba(0,0,0,.04); }
  .article-quiz { margin-top: 2rem; }
  .article-quiz h2 { margin-bottom: 1rem; }
  .article-quiz .q { margin-bottom: 1.25rem; }
  .article-quiz .q label { display: block; margin-bottom: 0.5rem; font-weight: 600; }
  .article-refs, .article-feedback { margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid var(--border); }
  .article-refs ul, .article-feedback .content { margin: 0.5rem 0 0; }
  .article-rating-wrap { margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid var(--border); }
  .article-rating-stars { display: flex; gap: 0.25rem; margin: 0.5rem 0; }
  .article-star { background: none; border: none; font-size: 1.5rem; cursor: pointer; color: var(--border, #ccc); padding: 0; }
  .article-star:hover { color: #f59e0b; }
  .article-star.active { color: #f59e0b; }
  .article-rating-summary { margin: 0.25rem 0 0; font-size: 0.9rem; color: var(--muted, #666); }
  .article-user-feedback { margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid var(--border); }
  .article-user-feedback-desc { margin: 0.25rem 0 0.75rem; font-size: 0.9rem; color: var(--muted, #666); }
  .article-feedback-form label { display: block; margin-top: 0.5rem; font-weight: 600; font-size: 0.9rem; }
  .article-feedback-form textarea, .article-feedback-form input[type="email"] { width: 100%; max-width: 480px; padding: 0.5rem; border: 1px solid var(--border); border-radius: 8px; margin-bottom: 0.5rem; }
  .article-feedback-submit { margin-top: 0.75rem; display: inline-flex; align-items: center; justify-content: center; padding: 0.6rem 1.25rem; border-radius: 999px; border: 1px solid var(--border); background: rgba(255,255,255,.92); font-weight: 600; font-size: 0.9rem; cursor: pointer; transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease; color: var(--ink); }
  .article-feedback-submit:hover { transform: translateY(-1px); box-shadow: var(--shadow2); border-color: rgba(15,23,42,.18); }
  .article-feedback-submit:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }
  .article-feedback-result { margin-top: 0.75rem; font-size: 0.9rem; }
  .ailab-carouselWrap { margin: 2rem 0; border-radius: var(--r18); overflow: hidden; background: var(--panel); border: 1px solid var(--border); box-shadow: var(--shadow2); }
  .ailab-carousel { width: 100%; overflow: hidden; }
  .ailab-carouselTrack { display: flex; transition: transform 0.4s ease-out; }
  .ailab-carouselSlide { flex: 0 0 100%; width: 100%; min-width: 0; }
  .ailab-carouselInner { display: grid; grid-template-columns: 1fr; gap: 1.5rem; padding: 1.5rem; align-items: center; max-height: 70vh; overflow-y: auto; }
  @media (min-width: 720px) { .ailab-carouselInner { grid-template-columns: 1fr; gap: 2rem; padding: 2rem 2.5rem; } }
  .ailab-carouselCopy { min-width: 0; }
  .ailab-carouselBadge { font-size: 0.7rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--accent); margin-bottom: 0.5rem; }
  .ailab-carouselTitle { font-size: 1.2rem; font-weight: 700; color: var(--ink); margin: 0 0 0.5rem; line-height: 1.3; }
  /* Evitar triplicar título: ocultar el primer h2 dentro de la card que repite el título de la sección */
  .ailab-carouselCopy .article-card > h2:first-child,
  .ailab-carouselCopy .article-card > * > h2:first-child { display: none; }
  .ailab-carouselNav { display: flex; align-items: center; justify-content: center; gap: 0.75rem; padding: 1rem 1.5rem; background: rgba(255,255,255,.6); border-top: 1px solid var(--border); }
  .ailab-carouselBtn { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--border2); background: #fff; color: var(--accent); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; font-size: 1.25rem; transition: background .2s, border-color .2s, transform .2s; }
  .ailab-carouselBtn:hover { background: rgba(79,70,229,.08); border-color: var(--accent); transform: scale(1.05); }
  .ailab-carouselDots { display: flex; align-items: center; gap: 8px; }
  .ailab-carouselDot { width: 10px; height: 10px; border-radius: 50%; border: none; background: rgba(79,70,229,.25); cursor: pointer; transition: background .2s, transform .2s; }
  .ailab-carouselDot:hover, .ailab-carouselDot.active { background: var(--accent); transform: scale(1.2); }
  .article-quiz-slide { max-height: 60vh; overflow-y: auto; padding-right: 0.25rem; }
  .article-quiz-slide .article-card { margin-bottom: 1rem; }
  .article-quiz-slide .article-card.q label.article-quiz-q-label { display: block; margin-bottom: 0.5rem; font-weight: 600; }
  .article-quiz-slide .quiz-option { margin-bottom: 0.5rem; }
  .article-quiz-slide .article-card.q > div:has(input[type="radio"]) { margin-bottom: 0.5rem; }
  .article-quiz-slide .quiz-option input[type="radio"],
  .article-quiz-slide .article-card.q > div input[type="radio"] { position: absolute; opacity: 0; pointer-events: none; }
  .article-quiz-slide .quiz-option label,
  .article-quiz-slide .article-card.q > div label[for^="q"] { display: block; padding: 0.6rem 1rem; border-radius: 999px; border: 1px solid var(--border); background: rgba(255,255,255,.92); font-weight: 500; cursor: pointer; transition: border-color .2s, background .2s, box-shadow .2s; }
  .article-quiz-slide .quiz-option label:hover,
  .article-quiz-slide .article-card.q > div label[for^="q"]:hover { border-color: rgba(15,23,42,.18); box-shadow: var(--shadow2); }
  .article-quiz-slide .quiz-option input:checked + label,
  .article-quiz-slide .article-card.q > div input:checked + label { border-color: var(--accent); background: rgba(79,70,229,.08); color: var(--ink); }
  .quiz-feedback { margin-top: 0.75rem; padding: 0.5rem 0; font-size: 0.9rem; }
  .quiz-feedback.correct { color: #15803d; font-weight: 600; }
  .quiz-feedback.incorrect { color: #b91c1c; font-weight: 600; }
  .quizQ { margin-bottom: 1.25rem; }
  .quizQ p { margin: 0 0 0.5rem; font-weight: 600; color: var(--ink); }
  .quizBtns { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.5rem; }
  .quizBtns button { display: inline-flex; align-items: center; justify-content: center; padding: 0.6rem 1rem; border-radius: 999px; border: 1px solid var(--border); background: rgba(255,255,255,.92); font-weight: 500; font-size: 0.9rem; cursor: pointer; transition: transform .16s var(--ease), box-shadow .16s var(--ease), border-color .16s; color: rgba(15,23,42,.85); }
  .quizBtns button:hover { border-color: rgba(15,23,42,.18); box-shadow: var(--shadow2); transform: translateY(-1px); }
  .quizBtns button.correct { border-color: #15803d; background: rgba(21,128,61,.1); color: #15803d; }
  .quizBtns button.incorrect { border-color: #b91c1c; background: rgba(185,28,28,.08); color: #b91c1c; }
  .article-card--image { overflow: hidden; }
  .article-card--image .article-card-img { display: block; max-width: 100%; max-height: 280px; width: auto; height: auto; object-fit: contain; cursor: pointer; }
  .article-card img { display: block; max-width: 100%; max-height: 280px; width: auto; height: auto; object-fit: contain; cursor: pointer; }
  .article-hero img { max-height: 320px; width: auto; max-width: 100%; object-fit: contain; cursor: pointer; border-radius: var(--r14); margin-top: 1rem; }
  .article-image-zoom-overlay { position: fixed; inset: 0; z-index: 100; background: rgba(0,0,0,.85); display: flex; align-items: center; justify-content: center; padding: 2rem; cursor: pointer; }
  .article-image-zoom-overlay img { max-width: 90vw; max-height: 90vh; width: auto; height: auto; object-fit: contain; pointer-events: none; }

  /* Tables inside cards and article content */
  .card table,
  .fade-card table,
  .article-card table,
  .card-table,
  .table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    margin: 1rem 0;
    border-radius: var(--r14);
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--panel2, rgba(255,255,255,.92));
  }
  .card table th,
  .card table td,
  .fade-card table th,
  .fade-card table td,
  .article-card table th,
  .article-card table td,
  .card-table th,
  .card-table td,
  .table th,
  .table td {
    padding: 0.6rem 0.85rem;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: top;
  }
  .card table th,
  .fade-card table th,
  .article-card table th,
  .card-table th,
  .table th {
    background: rgba(79,70,229,.08);
    color: rgba(15,23,42,.80);
    font-weight: 600;
  }
  .card table tr:last-child td,
  .fade-card table tr:last-child td,
  .article-card table tr:last-child td,
  .card-table tr:last-child td,
  .table tr:last-child td {
    border-bottom: none;
  }
  .card table tbody tr:hover,
  .fade-card table tbody tr:hover,
  .article-card table tbody tr:hover,
  .card-table tbody tr:hover,
  .table tbody tr:hover {
    background: rgba(79,70,229,.04);
  }
  .article-card .card-table-wrap,
  .card .card-table-wrap,
  .fade-card .card-table-wrap,
  .card-table-wrap {
    overflow-x: auto;
    margin: 1rem 0;
    -webkit-overflow-scrolling: touch;
  }

  /* ===== Card typography refinement (CC editorial hierarchy) ===== */
  .card,
  .tile,
  .article {
    color: rgba(15,23,42,.72);
  }
  .cardTitle,
  .tile h3,
  .articleTitle {
    color: var(--ink);
  }
  .card p,
  .tile p,
  .article p,
  .card li,
  .tile li {
    color: rgba(15,23,42,.72);
  }
  .lead strong {
    color: rgba(15,23,42,.85);
    font-weight: 600;
  }
  .card p strong,
  .tile p strong,
  .article p strong,
  .card li strong,
  .tile li strong {
    color: rgba(15,23,42,.85);
    font-weight: 600;
    text-decoration: underline;
    text-decoration-color: rgba(15,23,42,.15);
    text-underline-offset: 3px;
  }
  .cardMeta,
  .articleMeta {
    color: rgba(15,23,42,.55);
  }
  .tile .tileTags,
  .tagSm {
    color: rgba(15,23,42,.55);
  }
  .card table,
  .fade-card table,
  .article-card table,
  .table {
    color: rgba(15,23,42,.72);
  }
  .card table th,
  .fade-card table th,
  .article-card table th,
  .table th {
    color: rgba(15,23,42,.80);
    font-weight: 600;
  }
  .card table td,
  .fade-card table td,
  .article-card table td,
  .table td {
    color: rgba(15,23,42,.68);
  }

  /* Dark: tablas y article-card con contraste (anula refinement en dark) */
  html.theme-dark .card table,
  html.theme-dark .fade-card table,
  html.theme-dark .article-card table,
  html.theme-dark .card-table,
  html.theme-dark .table {
    background: var(--cc-dark-surface);
    border-color: var(--cc-dark-border);
    color: var(--cc-dark-text-secondary);
  }
  html.theme-dark .card table th,
  html.theme-dark .fade-card table th,
  html.theme-dark .article-card table th,
  html.theme-dark .card-table th,
  html.theme-dark .table th {
    background: rgba(79,70,229,.2);
    color: var(--cc-dark-text-primary);
    border-bottom-color: var(--cc-dark-border);
  }
  html.theme-dark .card table td,
  html.theme-dark .fade-card table td,
  html.theme-dark .article-card table td,
  html.theme-dark .card-table td,
  html.theme-dark .table td {
    color: var(--cc-dark-text-secondary);
    border-bottom-color: var(--cc-dark-border);
  }
  html.theme-dark .card table tbody tr:hover,
  html.theme-dark .fade-card table tbody tr:hover,
  html.theme-dark .article-card table tbody tr:hover,
  html.theme-dark .card-table tbody tr:hover,
  html.theme-dark .table tbody tr:hover {
    background: rgba(79,70,229,.1);
  }
  html.theme-dark .article-card {
    background: var(--cc-dark-card) !important;
    border-color: var(--cc-dark-border) !important;
    box-shadow: 0 1px 2px rgba(0,0,0,.2) !important;
    color: var(--cc-dark-text-elevated);
  }
  html.theme-dark .article-card h2,
  html.theme-dark .article-card h3,
  html.theme-dark .article-card h4 { color: var(--cc-dark-text-primary); }
  html.theme-dark .article-card p,
  html.theme-dark .article-card li { color: var(--cc-dark-text-elevated); }
  html.theme-dark .article-section h2 { color: var(--cc-dark-text-primary); }
  html.theme-dark .article-nav-inner { background: var(--cc-dark-card); border-color: var(--cc-dark-border); }
  html.theme-dark .article-nav-inner a { color: var(--cc-dark-text-secondary); }
  html.theme-dark .article-nav-inner a:hover { background: var(--cc-dark-surface); }
  html.theme-dark .article-nav-inner a.active { background: rgba(79,70,229,.25); color: var(--cc-dark-accent); }
  html.theme-dark .article-prev-next { border-color: var(--cc-dark-border); }
  html.theme-dark .article-prev-next a { background: var(--cc-dark-surface); border-color: var(--cc-dark-border); color: var(--cc-dark-accent); }
  html.theme-dark .article-prev-next a:hover { background: rgba(79,70,229,.2); border-color: var(--cc-dark-accent); }
  html.theme-dark .article-hero .mermaid { background: rgba(30,41,59,0.8); border-color: var(--cc-dark-border); }
  html.theme-dark .article-rating-summary,
  html.theme-dark .article-user-feedback-desc { color: var(--cc-dark-text-secondary); }
  html.theme-dark .article-feedback-submit { background: var(--cc-dark-card) !important; border-color: var(--cc-dark-border); color: var(--cc-dark-text-primary); }
  html.theme-dark .article-feedback-submit:hover { border-color: var(--cc-dark-accent); }
  html.theme-dark .article-quiz-slide .quiz-option label,
  html.theme-dark .article-quiz-slide .article-card.q > div label[for^="q"] {
    background: var(--cc-dark-card); border-color: var(--cc-dark-border); color: var(--cc-dark-text-elevated);
  }
  html.theme-dark .article-quiz-slide .quiz-option input:checked + label,
  html.theme-dark .article-quiz-slide .article-card.q > div input:checked + label {
    background: rgba(79,70,229,.25); color: var(--cc-dark-text-primary);
  }
  html.theme-dark .quizBtns button { background: var(--cc-dark-card); border-color: var(--cc-dark-border); color: var(--cc-dark-text-elevated); }
  html.theme-dark .ailab-carouselNav { background: var(--cc-dark-card); border-top-color: var(--cc-dark-border); }
  html.theme-dark .ailab-carouselBtn { background: var(--cc-dark-surface); border-color: var(--cc-dark-border); color: var(--cc-dark-accent); }