/* Análisis Blu-ray — hoja única generada por scripts/build-css.py. No editar a mano. */

/* ==========================================================================
   Tokens — Análisis Blu-ray theme
   Fuentes autoalojadas, subset latino y font-display: swap.
   ========================================================================== */

@layer reset, base, layout, components, utilities, print;

:root {
  color-scheme: light;

  /* Tipografía. Las variables --gh-font-* permiten que los ajustes de
     tipografía de Ghost sustituyan las familias por defecto. */
  --gh-font-heading: "Fraunces", "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
  --gh-font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: var(--gh-font-heading, "Fraunces", Georgia, serif);
  --font-body: var(--gh-font-body, "Inter", system-ui, sans-serif);
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-md: 1.0625rem;
  --text-lg: 1.25rem;
  --text-xl: clamp(1.35rem, 1.15rem + 0.8vw, 1.75rem);
  --text-2xl: clamp(1.65rem, 1.3rem + 1.4vw, 2.35rem);
  --text-3xl: clamp(2rem, 1.45rem + 2.4vw, 3.25rem);
  --text-4xl: clamp(2.3rem, 1.5rem + 2.8vw, 3.75rem);

  --leading-tight: 1.08;
  --leading-snug: 1.25;
  --leading-normal: 1.6;
  --leading-relaxed: 1.72;

  --weight-regular: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
  --weight-bold: 700;

  /* Paleta clara: papel, tinta y un único acento cálido */
  --paper: #f7f5f0;
  --paper-raised: #fffdf8;
  --paper-sunken: #efece3;
  --paper-deep: #e6e1d5;
  --ink: #141414;
  --ink-soft: #3a3733;
  --muted: #5b5750;
  --muted-strong: #46423c;
  --rule: #d9d3c7;
  --rule-strong: #b9b1a2;
  --accent: #a33a0c;
  --accent-strong: #7f2c08;
  --accent-soft: #f4e3d8;
  --accent-contrast: #ffffff;
  --ok: #1d6b3a;
  --ok-soft: #e3f1e8;
  --warn: #8a5a00;
  --warn-soft: #f8edd7;
  --danger: #a21c1c;
  --danger-soft: #f8e3e3;
  --focus: #0b5fff;
  --shadow-color: 20 20 20;

  /* Espaciado */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-7: 2rem;
  --space-8: 2.5rem;
  --space-9: 3rem;
  --space-10: 4rem;
  --space-11: 5rem;
  --space-12: 7rem;

  /* Bordes y sombras */
  --radius-xs: 2px;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 14px;
  --radius-pill: 999px;
  --border: 1px solid var(--rule);
  --border-strong: 1px solid var(--rule-strong);
  --shadow-sm: 0 1px 2px rgb(var(--shadow-color) / 0.06),
    0 1px 1px rgb(var(--shadow-color) / 0.04);
  --shadow-md: 0 8px 24px -12px rgb(var(--shadow-color) / 0.28),
    0 2px 6px rgb(var(--shadow-color) / 0.06);
  --shadow-lg: 0 24px 60px -24px rgb(var(--shadow-color) / 0.4),
    0 6px 16px -8px rgb(var(--shadow-color) / 0.12);

  /* Medidas */
  --container: 78rem;
  --container-narrow: 46rem;
  --measure: 68ch;
  --header-height: 4.25rem;
  --sidebar-width: 20rem;

  /* Movimiento */
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --duration-fast: 120ms;
  --duration: 220ms;

  /* Capas */
  --z-header: 50;
  --z-overlay: 80;
  --z-dialog: 100;
  --z-toast: 120;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;

    --paper: #14130f;
    --paper-raised: #1e1c18;
    --paper-sunken: #1a1915;
    --paper-deep: #26231e;
    --ink: #f2eee6;
    --ink-soft: #d8d2c7;
    --muted: #b9b2a6;
    --muted-strong: #cdc6ba;
    --rule: #38342d;
    --rule-strong: #514b41;
    --accent: #f2a173;
    --accent-strong: #ffc09a;
    --accent-soft: #33231a;
    --accent-contrast: #14130f;
    --ok: #8fd3a8;
    --ok-soft: #16261c;
    --warn: #ffd166;
    --warn-soft: #2b2413;
    --danger: #ff8d8d;
    --danger-soft: #2e1919;
    --focus: #9ec1ff;
    --shadow-color: 0 0 0;
  }
}

html[data-theme="dark"] {
  color-scheme: dark;

  --paper: #14130f;
  --paper-raised: #1e1c18;
  --paper-sunken: #1a1915;
  --paper-deep: #26231e;
  --ink: #f2eee6;
  --ink-soft: #d8d2c7;
  --muted: #b9b2a6;
  --muted-strong: #cdc6ba;
  --rule: #38342d;
  --rule-strong: #514b41;
  --accent: #f2a173;
  --accent-strong: #ffc09a;
  --accent-soft: #33231a;
  --accent-contrast: #14130f;
  --ok: #8fd3a8;
  --ok-soft: #16261c;
  --warn: #ffd166;
  --warn-soft: #2b2413;
  --danger: #ff8d8d;
  --danger-soft: #2e1919;
  --focus: #9ec1ff;
  --shadow-color: 0 0 0;
}

/* El color de marca configurado en Ghost puede afinar el acento. */
html[data-brand-accent] {
  --accent: var(--brand-accent);
  --accent-strong: color-mix(in srgb, var(--brand-accent) 78%, black);
}

html[data-theme="dark"][data-brand-accent] {
  --accent: color-mix(in srgb, var(--brand-accent) 45%, white);
  --accent-strong: color-mix(in srgb, var(--brand-accent) 30%, white);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"])[data-brand-accent] {
    --accent: color-mix(in srgb, var(--brand-accent) 45%, white);
    --accent-strong: color-mix(in srgb, var(--brand-accent) 30%, white);
  }
}

@layer reset, base;

@layer reset {
  *,
  *::before,
  *::after {
    box-sizing: border-box;
  }

  html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
  }

  body,
  h1,
  h2,
  h3,
  h4,
  h5,
  h6,
  p,
  figure,
  blockquote,
  dl,
  dd,
  ol,
  ul,
  fieldset,
  legend {
    margin: 0;
  }

  ol[role="list"],
  ul[role="list"] {
    list-style: none;
    padding: 0;
  }

  img,
  picture,
  video,
  canvas,
  svg {
    display: block;
    max-width: 100%;
  }

  input,
  button,
  textarea,
  select {
    font: inherit;
    color: inherit;
  }

  button {
    background: none;
    border: 0;
    cursor: pointer;
  }

  a {
    color: inherit;
    text-decoration-thickness: 0.08em;
    text-underline-offset: 0.18em;
  }

  [hidden] {
    display: none !important;
  }
}

@layer base {
  html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-height) + var(--space-4));
  }

  @media (prefers-reduced-motion: reduce) {
    html {
      scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
      animation-duration: 0.01ms !important;
      animation-iteration-count: 1 !important;
      transition-duration: 0.01ms !important;
      scroll-behavior: auto !important;
    }
  }

  body {
    min-height: 100vh;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: var(--text-md);
    font-weight: var(--weight-regular);
    line-height: var(--leading-normal);
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    overflow-wrap: break-word;
  }

  body.has-menu-open,
  body.has-dialog-open {
    overflow: hidden;
  }

  ::selection {
    background: var(--accent);
    color: var(--accent-contrast);
  }

  :focus-visible {
    outline: 3px solid var(--focus);
    outline-offset: 3px;
    border-radius: var(--radius-xs);
  }

  h1,
  h2,
  h3,
  h4,
  h5,
  h6 {
    color: var(--ink);
    font-family: var(--font-display);
    font-weight: var(--weight-semibold);
    letter-spacing: -0.015em;
    line-height: var(--leading-snug);
    text-wrap: balance;
  }

  h1 {
    font-size: var(--text-3xl);
    line-height: var(--leading-tight);
  }

  h2 {
    font-size: var(--text-2xl);
  }

  h3 {
    font-size: var(--text-xl);
  }

  h4 {
    font-size: var(--text-lg);
  }

  p,
  li {
    text-wrap: pretty;
  }

  a:hover {
    color: var(--accent);
  }

  strong,
  b {
    font-weight: var(--weight-semibold);
  }

  small {
    font-size: var(--text-sm);
  }

  code,
  kbd,
  samp,
  pre {
    font-family: var(--font-mono);
    font-size: 0.9em;
  }

  :not(pre) > code {
    padding: 0.12em 0.35em;
    border: 1px solid var(--rule);
    border-radius: var(--radius-xs);
    background: var(--paper-sunken);
    color: var(--ink-soft);
    overflow-wrap: anywhere;
  }

  pre {
    max-width: 100%;
    padding: var(--space-4);
    border: 1px solid var(--rule);
    border-radius: var(--radius-md);
    background: var(--paper-sunken);
    overflow-x: auto;
    line-height: 1.5;
  }

  hr {
    height: 1px;
    margin: var(--space-7) 0;
    border: 0;
    background: var(--rule);
  }

  table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--text-sm);
  }

  th,
  td {
    padding: var(--space-3) var(--space-3);
    border-bottom: 1px solid var(--rule);
    text-align: left;
    vertical-align: top;
  }

  th {
    color: var(--ink);
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    font-weight: var(--weight-semibold);
    letter-spacing: 0.02em;
    text-transform: uppercase;
  }

  tbody tr:last-child td {
    border-bottom: 0;
  }

  blockquote {
    margin: var(--space-6) 0;
    padding: var(--space-4) var(--space-5);
    border-left: 3px solid var(--accent);
    background: var(--paper-sunken);
    color: var(--ink-soft);
    font-size: var(--text-base);
  }

  blockquote > :last-child {
    margin-bottom: 0;
  }

  .screen-reader-text {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  .skip-link {
    position: fixed;
    top: 0.5rem;
    left: 0.5rem;
    z-index: calc(var(--z-toast) + 1);
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-sm);
    background: var(--ink);
    color: var(--paper);
    transform: translateY(-200%);
    transition: transform var(--duration-fast) var(--ease);
  }

  .skip-link:focus {
    transform: translateY(0);
    color: var(--paper);
  }
}

@layer layout {
  .container {
    width: min(100% - 2rem, var(--container));
    margin-inline: auto;
  }

  .container--narrow {
    width: min(100% - 2rem, var(--container-narrow));
    margin-inline: auto;
  }

  .site {
    display: flex;
    min-height: 100vh;
    flex-direction: column;
  }

  .site-main {
    flex: 1 0 auto;
  }

  .section {
    padding-block: var(--space-10);
  }

  .section--tight {
    padding-block: var(--space-8);
  }

  .section--rule {
    border-top: var(--border);
  }

  .section-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: var(--space-5);
    margin-bottom: var(--space-6);
  }

  .section-head__text {
    max-width: 42rem;
  }

  .section-kicker {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin-bottom: var(--space-2);
    color: var(--accent);
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    font-weight: var(--weight-semibold);
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }

  .section-title {
    font-size: var(--text-2xl);
  }

  .section-deck {
    margin-top: var(--space-2);
    color: var(--muted);
    font-size: var(--text-base);
  }

  .section-link {
    flex: none;
    color: var(--accent);
    font-size: var(--text-sm);
    font-weight: var(--weight-semibold);
    text-decoration: none;
  }

  .section-link:hover {
    color: var(--accent-strong);
    text-decoration: underline;
  }

  .grid {
    display: grid;
    gap: var(--space-5);
  }

  .grid--2 {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr));
  }

  .grid--3 {
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr));
  }

  .grid--4 {
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr));
  }

  /* Cabecera ------------------------------------------------------------- */
  .site-header {
    position: sticky;
    top: 0;
    z-index: var(--z-header);
    border-bottom: var(--border);
    background: color-mix(in srgb, var(--paper) 92%, transparent);
    backdrop-filter: blur(12px);
  }

  @supports not (backdrop-filter: blur(1px)) {
    .site-header {
      background: var(--paper);
    }
  }

  .header-inner {
    display: flex;
    min-height: var(--header-height);
    align-items: center;
    gap: var(--space-5);
  }

  .brand {
    display: inline-flex;
    align-items: center;
    gap: var(--space-3);
    color: var(--ink);
    text-decoration: none;
  }

  .brand:hover {
    color: var(--ink);
  }

  .brand-mark {
    display: grid;
    width: 2.15rem;
    height: 2.15rem;
    place-items: center;
    border: 1px solid var(--ink);
    border-radius: var(--radius-sm);
    background: var(--ink);
    color: var(--paper);
    font-family: var(--font-mono);
    font-size: 0.68rem;
    font-weight: var(--weight-bold);
    letter-spacing: 0.04em;
    line-height: 1;
  }

  .brand-text {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
  }

  .brand-title {
    font-family: var(--font-display);
    font-size: 1.05rem;
    font-weight: var(--weight-semibold);
    letter-spacing: -0.02em;
    line-height: 1.1;
  }

  .brand-tagline {
    color: var(--muted);
    font-family: var(--font-mono);
    font-size: 0.62rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }

  .site-nav {
    margin-inline-start: auto;
  }

  .site-nav-list {
    display: flex;
    align-items: center;
    gap: var(--space-1);
    padding: 0;
    margin: 0;
    list-style: none;
  }

  .site-nav-link {
    display: inline-flex;
    align-items: center;
    min-height: 2.5rem;
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-sm);
    color: var(--ink-soft);
    font-size: var(--text-sm);
    font-weight: var(--weight-medium);
    text-decoration: none;
  }

  .site-nav-link:hover {
    background: var(--paper-sunken);
    color: var(--ink);
  }

  .site-nav-link[aria-current="page"],
  .site-nav-link.is-active {
    background: var(--accent-soft);
    color: var(--accent-strong);
  }

  .header-actions {
    display: flex;
    align-items: center;
    gap: var(--space-1);
  }

  .header-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    min-width: 2.5rem;
    min-height: 2.5rem;
    padding: var(--space-2);
    border-radius: var(--radius-sm);
    color: var(--ink-soft);
    font-size: var(--text-sm);
    font-weight: var(--weight-medium);
    text-decoration: none;
  }

  .header-action:hover {
    background: var(--paper-sunken);
    color: var(--ink);
  }

  .header-action svg {
    width: 1.15rem;
    height: 1.15rem;
  }

  .header-action__label {
    display: none;
  }

  .menu-toggle {
    display: none;
  }

  .nav-backdrop {
    display: none;
  }

  @media (max-width: 58rem) {
    .site-nav {
      position: fixed;
      inset: var(--header-height) 0 auto 0;
      z-index: var(--z-overlay);
      display: none;
      max-height: calc(100dvh - var(--header-height));
      padding: var(--space-4) var(--space-4) var(--space-8);
      border-bottom: var(--border);
      background: var(--paper);
      overflow-y: auto;
      box-shadow: var(--shadow-lg);
    }

    .site-nav[data-open="true"] {
      display: block;
    }

    .site-nav-list {
      flex-direction: column;
      align-items: stretch;
      gap: var(--space-1);
    }

    .site-nav-link {
      min-height: 3rem;
      padding-inline: var(--space-4);
      border-bottom: 1px solid var(--rule);
      border-radius: 0;
      font-size: var(--text-lg);
    }

    .menu-toggle {
      display: inline-flex;
    }

    .nav-backdrop {
      position: fixed;
      inset: var(--header-height) 0 0 0;
      z-index: calc(var(--z-overlay) - 1);
      display: none;
      background: rgb(0 0 0 / 0.42);
    }

    .nav-backdrop[data-open="true"] {
      display: block;
    }

    .header-action__label {
      display: none;
    }
  }

  @media (min-width: 58.0625rem) {
    .header-action__label {
      display: inline;
    }
  }

  /* Pie ------------------------------------------------------------------ */
  .site-footer {
    margin-top: var(--space-10);
    border-top: var(--border);
    background: var(--paper-sunken);
  }

  .footer-main {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) repeat(4, minmax(0, 1fr));
    gap: var(--space-6);
    padding-block: var(--space-9);
  }

  .footer-brand {
    max-width: 26rem;
  }

  .footer-brand .brand {
    margin-bottom: var(--space-4);
  }

  .footer-description {
    color: var(--muted);
    font-size: var(--text-sm);
  }

  .footer-column-title {
    margin-bottom: var(--space-3);
    color: var(--ink);
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    font-weight: var(--weight-semibold);
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }

  .footer-links {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    padding: 0;
    margin: 0;
    list-style: none;
  }

  .footer-links a {
    color: var(--muted);
    font-size: var(--text-sm);
    text-decoration: none;
  }

  .footer-links a:hover {
    color: var(--accent);
    text-decoration: underline;
  }

  .footer-rss {
    display: inline-flex;
    align-items: center;
    gap: 0.35em;
  }

  .footer-rss svg {
    width: 0.9em;
    height: 0.9em;
  }

  .footer-legal {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: var(--space-3);
    padding-block: var(--space-5);
    border-top: var(--border);
    color: var(--muted);
    font-size: var(--text-xs);
  }

  .footer-legal a {
    color: var(--muted);
  }

  @media (max-width: 54rem) {
    .footer-main {
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .footer-brand {
      grid-column: 1 / -1;
    }
  }

  @media (max-width: 32rem) {
    .footer-main {
      grid-template-columns: 1fr;
    }

    .brand-tagline {
      display: none;
    }

    .header-inner {
      gap: var(--space-2);
    }

    .brand {
      min-width: 0;
    }

    .brand-title {
      font-size: 0.98rem;
      white-space: nowrap;
    }

    .brand-mark {
      width: 1.9rem;
      height: 1.9rem;
    }

    .header-actions {
      gap: 0;
    }

    .header-action {
      min-width: 2.25rem;
      min-height: 2.25rem;
      padding: 0.35rem;
    }

    .breadcrumbs__item:last-child {
      min-width: 0;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
  }

  /* Página genérica ------------------------------------------------------ */
  .page-header {
    padding-block: var(--space-9) var(--space-7);
    border-bottom: var(--border);
  }

  .page-header__inner {
    max-width: var(--container-narrow);
  }

  .page-title {
    margin-top: var(--space-3);
    font-size: var(--text-3xl);
  }

  .page-deck {
    margin-top: var(--space-4);
    color: var(--muted);
    font-size: var(--text-lg);
  }

  .page-content {
    padding-block: var(--space-8);
  }

  /* Estructura del análisis --------------------------------------------- */
  .post-shell {
    padding-bottom: var(--space-9);
  }

  .post-hero {
    position: relative;
    padding-block: var(--space-8) var(--space-7);
    border-bottom: var(--border);
  }

  .post-hero__grid {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(0, 0.65fr);
    gap: var(--space-8);
    align-items: start;
  }

  .post-hero__main {
    min-width: 0;
  }

  .post-hero__media {
    min-width: 0;
  }

  .post-hero__media:empty {
    display: none;
  }

  .post-hero__figure {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    border: var(--border);
    border-radius: var(--radius-md);
    background: var(--paper-deep);
    box-shadow: var(--shadow-md);
  }

  .post-hero__figure img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .post-hero__figure--poster {
    aspect-ratio: 2 / 3;
  }

  .post-hero__figure--wide {
    aspect-ratio: 16 / 9;
  }

  .post-hero__figure figcaption {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    padding: var(--space-5) var(--space-3) var(--space-2);
    background: linear-gradient(transparent, rgb(0 0 0 / 0.68));
    color: #fff;
    font-size: 0.68rem;
    line-height: 1.4;
  }

  .post-body-wrap {
    padding-top: var(--space-8);
  }

  .post-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) var(--sidebar-width);
    gap: var(--space-8);
    align-items: start;
  }

  .post-main {
    min-width: 0;
  }

  .post-sidebar {
    position: sticky;
    top: calc(var(--header-height) + var(--space-5));
    display: flex;
    max-height: calc(100dvh - var(--header-height) - var(--space-6));
    flex-direction: column;
    gap: var(--space-4);
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
  }

  .post-sidebar:empty {
    display: none;
  }

  .post-sidebar__label {
    color: var(--muted);
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }

  @media (max-width: 64rem) {
    .post-hero__grid {
      grid-template-columns: minmax(0, 1fr) minmax(12rem, 0.45fr);
      gap: var(--space-6);
    }

    .post-layout {
      grid-template-columns: 1fr;
    }

    .post-sidebar {
      position: static;
      max-height: none;
      overflow: visible;
    }
  }

  @media (max-width: 42rem) {
    .post-hero__grid {
      grid-template-columns: 1fr;
    }

    .post-hero__media {
      order: -1;
      max-width: 20rem;
      height: 11.25rem;
      margin-inline: auto;
    }

    .post-hero__figure,
    .post-hero__figure--wide {
      height: 100%;
      aspect-ratio: auto;
    }

    .post-hero__figure--wide {
      aspect-ratio: 16 / 9;
    }
  }

  /* Hub ------------------------------------------------------------------ */
  .hub-page {
    padding-bottom: var(--space-9);
  }

  .hub-header {
    padding-block: var(--space-8) var(--space-7);
    border-bottom: var(--border);
    background:
      radial-gradient(circle at 85% 0%, var(--accent-soft), transparent 42%),
      var(--paper);
  }

  .hub-header__inner {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(0, 0.85fr);
    gap: var(--space-8);
    align-items: end;
  }

  .hub-title {
    margin-top: var(--space-2);
    font-size: var(--text-3xl);
  }

  .hub-deck {
    max-width: 44rem;
    margin-top: var(--space-4);
    color: var(--muted);
    font-size: var(--text-lg);
  }

  .hub-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--space-3);
    padding: 0;
    margin: 0;
    list-style: none;
  }

  .hub-stat {
    padding: var(--space-3) var(--space-4);
    border: var(--border);
    border-radius: var(--radius-md);
    background: var(--paper-raised);
  }

  .hub-stat__value {
    display: block;
    color: var(--ink);
    font-family: var(--font-mono);
    font-size: var(--text-xl);
    font-weight: var(--weight-semibold);
    line-height: 1.15;
  }

  .hub-stat__label {
    display: block;
    margin-top: var(--space-1);
    color: var(--muted);
    font-size: var(--text-xs);
    letter-spacing: 0.02em;
    text-transform: uppercase;
  }

  .hub-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    padding-block: var(--space-5);
    border-bottom: var(--border);
  }

  .hub-count {
    color: var(--muted);
    font-size: var(--text-sm);
  }

  .hub-count strong {
    color: var(--ink);
  }

  .hub-results {
    padding-top: var(--space-6);
  }

  @media (max-width: 52rem) {
    .hub-header__inner {
      grid-template-columns: 1fr;
      gap: var(--space-5);
    }

    .hub-stats {
      grid-template-columns: repeat(3, minmax(0, 1fr));
    }
  }

  @media (max-width: 34rem) {
    .hub-stats {
      grid-template-columns: 1fr;
    }

    .hub-stat {
      display: flex;
      align-items: baseline;
      justify-content: space-between;
      gap: var(--space-3);
    }

    .hub-stat__label {
      margin-top: 0;
    }
  }

  /* Búsqueda y diálogos ------------------------------------------------ */
  .theme-dialog {
    width: min(100% - 2rem, 34rem);
    max-height: min(80dvh, 40rem);
    padding: 0;
    border: var(--border);
    border-radius: var(--radius-lg);
    background: var(--paper-raised);
    color: var(--ink);
    box-shadow: var(--shadow-lg);
  }

  .theme-dialog::backdrop {
    background: rgb(0 0 0 / 0.55);
    backdrop-filter: blur(2px);
  }

  .theme-dialog__inner {
    padding: var(--space-5);
  }

  .theme-dialog__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    margin-bottom: var(--space-4);
  }

  .theme-dialog__title {
    font-size: var(--text-xl);
  }
}

@layer components {
  /* Botones -------------------------------------------------------------- */
  .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    min-height: 2.75rem;
    padding: var(--space-2) var(--space-5);
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    background: var(--paper-sunken);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: var(--text-sm);
    font-weight: var(--weight-semibold);
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    transition: background var(--duration-fast) var(--ease),
      color var(--duration-fast) var(--ease),
      border-color var(--duration-fast) var(--ease);
  }

  .btn:hover {
    background: var(--paper-deep);
    color: var(--ink);
  }

  .btn svg {
    width: 1.1em;
    height: 1.1em;
    flex: none;
  }

  .btn--primary {
    border-color: var(--accent);
    background: var(--accent);
    color: var(--accent-contrast);
  }

  .btn--primary:hover {
    border-color: var(--accent-strong);
    background: var(--accent-strong);
    color: var(--accent-contrast);
  }

  .btn--ghost {
    border-color: var(--rule-strong);
    background: transparent;
  }

  .btn--ghost:hover {
    border-color: var(--ink);
    background: var(--paper-raised);
  }

  .btn--small {
    min-height: 2.25rem;
    padding: var(--space-1) var(--space-3);
    font-size: var(--text-xs);
  }

  .btn--block {
    width: 100%;
  }

  .brand-logo {
    width: 2.15rem;
    height: 2.15rem;
    border-radius: var(--radius-sm);
    object-fit: contain;
  }

  .theme-toggle__sun,
  .theme-toggle__moon {
    display: inline-flex;
  }

  .theme-toggle__moon {
    display: none;
  }

  html[data-theme="dark"] .theme-toggle__sun {
    display: none;
  }

  html[data-theme="dark"] .theme-toggle__moon {
    display: inline-flex;
  }

  @media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .theme-toggle__sun {
      display: none;
    }

    :root:not([data-theme="light"]) .theme-toggle__moon {
      display: inline-flex;
    }
  }

  /* Etiquetas y badges --------------------------------------------------- */
  .badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3em;
    padding: 0.22em 0.55em;
    border: 1px solid var(--rule-strong);
    border-radius: var(--radius-pill);
    background: var(--paper-raised);
    color: var(--ink-soft);
    font-family: var(--font-mono);
    font-size: 0.68rem;
    font-weight: var(--weight-medium);
    letter-spacing: 0.02em;
    line-height: 1.4;
    text-decoration: none;
    white-space: nowrap;
  }

  .badge--format {
    border-color: color-mix(in srgb, var(--accent) 45%, var(--rule));
    background: var(--accent-soft);
    color: var(--accent-strong);
  }

  .badge--audio {
    border-color: color-mix(in srgb, var(--ok) 35%, var(--rule));
    background: var(--ok-soft);
    color: var(--ok);
  }

  .badge--castilian {
    border-color: color-mix(in srgb, var(--warn) 35%, var(--rule));
    background: var(--warn-soft);
    color: var(--warn);
  }

  .badge--muted {
    border-color: var(--rule);
    background: var(--paper-sunken);
    color: var(--muted);
  }

  .badge--accent {
    border-color: var(--accent);
    background: var(--accent);
    color: var(--accent-contrast);
  }

  .tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    padding: 0;
    margin: 0;
    list-style: none;
  }

  /* Tarjetas ------------------------------------------------------------- */
  .post-card {
    position: relative;
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: var(--space-3);
    padding: var(--space-4);
    border: var(--border);
    border-radius: var(--radius-md);
    background: var(--paper-raised);
    transition: border-color var(--duration-fast) var(--ease),
      box-shadow var(--duration-fast) var(--ease),
      transform var(--duration-fast) var(--ease);
  }

  .post-card:hover {
    border-color: var(--rule-strong);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
  }

  .post-card__media {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    margin: calc(var(--space-4) * -1) calc(var(--space-4) * -1) 0;
    border-bottom: var(--border);
    background: var(--paper-deep);
  }

  .post-card__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--duration) var(--ease);
  }

  .post-card:hover .post-card__media img {
    transform: scale(1.025);
  }

  .post-card__media--poster {
    aspect-ratio: 2 / 3;
  }

  .post-card__placeholder {
    display: grid;
    width: 100%;
    height: 100%;
    place-items: center;
    background:
      repeating-linear-gradient(
        135deg,
        transparent 0 10px,
        color-mix(in srgb, var(--ink) 4%, transparent) 10px 11px
      ),
      var(--paper-deep);
    color: var(--muted);
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }

  .post-card__body {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: var(--space-2);
  }

  .post-card__kicker {
    color: var(--accent);
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    font-weight: var(--weight-semibold);
    letter-spacing: 0.06em;
    text-transform: uppercase;
  }

  .post-card__title {
    font-family: var(--font-display);
    font-size: var(--text-lg);
    font-weight: var(--weight-semibold);
    line-height: var(--leading-snug);
    text-wrap: balance;
  }

  .post-card__title a {
    color: var(--ink);
    text-decoration: none;
  }

  .post-card__title a:hover {
    color: var(--accent);
    text-decoration: underline;
  }

  .post-card__excerpt {
    display: -webkit-box;
    overflow: hidden;
    color: var(--muted);
    font-size: var(--text-sm);
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
  }

  .post-card__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    padding-top: var(--space-2);
    margin-top: auto;
    border-top: 1px solid var(--rule);
    color: var(--muted);
    font-size: var(--text-xs);
  }

  .post-card__score {
    display: inline-flex;
    align-items: baseline;
    gap: 0.15em;
    color: var(--ink);
    font-family: var(--font-mono);
    font-weight: var(--weight-semibold);
  }

  .post-card__score small {
    color: var(--muted);
    font-size: 0.68rem;
    font-weight: var(--weight-regular);
  }

  .post-card__tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-1);
  }

  .post-card__tags > li:nth-child(n + 4) {
    display: none;
  }

  .post-card__date {
    white-space: nowrap;
  }

  /* Home: hero ----------------------------------------------------------- */
  .home-hero {
    position: relative;
    padding-block: var(--space-10) var(--space-9);
    border-bottom: var(--border);
    background:
      radial-gradient(circle at 8% 10%, var(--accent-soft), transparent 38%),
      var(--paper);
  }

  .home-hero__grid {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
    gap: var(--space-9);
    align-items: center;
  }

  .home-hero__content {
    min-width: 0;
  }

  .home-hero__kicker {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    margin-bottom: var(--space-4);
    color: var(--accent);
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    font-weight: var(--weight-semibold);
    letter-spacing: 0.1em;
    text-transform: uppercase;
  }

  .home-hero__kicker::before {
    width: 1.75rem;
    height: 1px;
    background: currentColor;
    content: "";
  }

  .home-hero__title {
    max-width: 22ch;
    font-size: var(--text-4xl);
    line-height: var(--leading-tight);
  }

  .home-hero__title a {
    color: var(--ink);
    text-decoration: none;
  }

  .home-hero__title a:hover {
    color: var(--accent);
  }

  .home-hero__deck {
    max-width: 46ch;
    margin-top: var(--space-5);
    color: var(--muted);
    font-size: var(--text-lg);
  }

  .home-hero__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-3);
    margin-top: var(--space-5);
  }

  .home-hero__tags {
    margin-top: var(--space-4);
  }

  .home-hero__media {
    position: relative;
    min-width: 0;
  }

  .home-hero__figure {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    border: var(--border);
    border-radius: var(--radius-md);
    background: var(--paper-deep);
    box-shadow: var(--shadow-lg);
  }

  .home-hero__figure img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .home-hero__score {
    position: absolute;
    bottom: calc(var(--space-4) * -1);
    left: var(--space-4);
    display: flex;
    align-items: baseline;
    gap: 0.15em;
    padding: var(--space-3) var(--space-4);
    border: 1px solid var(--rule-strong);
    border-radius: var(--radius-md);
    background: var(--paper-raised);
    box-shadow: var(--shadow-md);
    font-family: var(--font-mono);
  }

  .home-hero__score strong {
    font-size: 1.6rem;
    line-height: 1;
  }

  .home-hero__score span {
    color: var(--muted);
    font-size: var(--text-xs);
  }

  @media (max-width: 60rem) {
    .home-hero__grid {
      grid-template-columns: minmax(0, 1fr) minmax(13rem, 0.55fr);
      gap: var(--space-6);
    }
  }

  @media (max-width: 42rem) {
    .home-hero {
      padding-block: var(--space-7) var(--space-8);
    }

    .home-hero__grid {
      grid-template-columns: 1fr;
    }

    .home-hero__media {
      order: -1;
      max-width: 15rem;
    }

    .home-hero__score {
      right: var(--space-2);
      bottom: calc(var(--space-3) * -1);
    }
  }

  /* Home: explorar / metodología --------------------------------------- */
  .explore-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr));
    gap: var(--space-3);
    padding: 0;
    margin: 0;
    list-style: none;
  }

  .explore-card {
    display: flex;
    min-height: 7rem;
    flex-direction: column;
    justify-content: space-between;
    gap: var(--space-3);
    padding: var(--space-4);
    border: var(--border);
    border-radius: var(--radius-md);
    background: var(--paper-raised);
    text-decoration: none;
  }

  .explore-card:hover {
    border-color: var(--accent);
    background: var(--accent-soft);
  }

  .explore-card__title {
    color: var(--ink);
    font-family: var(--font-display);
    font-size: var(--text-lg);
    font-weight: var(--weight-semibold);
  }

  .explore-card__meta {
    color: var(--muted);
    font-family: var(--font-mono);
    font-size: var(--text-xs);
  }

  .method-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--space-5);
    padding: 0;
    margin: 0;
    list-style: none;
  }

  .method-step {
    padding-top: var(--space-4);
    border-top: 2px solid var(--ink);
  }

  .method-step__num {
    color: var(--accent);
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    font-weight: var(--weight-semibold);
    letter-spacing: 0.08em;
  }

  .method-step__title {
    margin-top: var(--space-2);
    font-size: var(--text-lg);
  }

  .method-step__text {
    margin-top: var(--space-2);
    color: var(--muted);
    font-size: var(--text-sm);
  }

  @media (max-width: 48rem) {
    .method-grid {
      grid-template-columns: 1fr;
    }
  }

  /* Newsletter ---------------------------------------------------------- */
  .newsletter {
    padding: var(--space-7);
    border: 1px solid var(--rule-strong);
    border-radius: var(--radius-lg);
    background:
      radial-gradient(circle at 92% 0%, var(--accent-soft), transparent 45%),
      var(--paper-raised);
  }

  .newsletter__grid {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(0, 0.9fr);
    gap: var(--space-6);
    align-items: center;
  }

  .newsletter__kicker {
    color: var(--accent);
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    font-weight: var(--weight-semibold);
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }

  .newsletter__title {
    margin-top: var(--space-2);
    font-size: var(--text-2xl);
  }

  .newsletter__text {
    margin-top: var(--space-2);
    color: var(--muted);
    font-size: var(--text-sm);
  }

  .newsletter__form {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
  }

  .newsletter__row {
    display: flex;
    gap: var(--space-2);
  }

  .newsletter__input {
    min-width: 0;
    flex: 1;
    min-height: 2.75rem;
    padding: var(--space-2) var(--space-4);
    border: 1px solid var(--rule-strong);
    border-radius: var(--radius-sm);
    background: var(--paper);
    color: var(--ink);
    font-size: var(--text-sm);
  }

  .newsletter__input::placeholder {
    color: var(--muted);
  }

  .newsletter__input:focus-visible {
    border-color: var(--focus);
  }

  .newsletter__note {
    color: var(--muted);
    font-size: var(--text-xs);
  }

  .newsletter__note a {
    color: var(--muted);
  }

  .newsletter__message {
    display: none;
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-sm);
    font-size: var(--text-sm);
  }

  .newsletter__form[data-members-form] .newsletter__message--success,
  .newsletter__form[data-members-form] .newsletter__message--error {
    display: none;
  }

  .newsletter__form[data-members-form="subscribed"] .newsletter__message--success,
  .newsletter__form[data-members-form="error"] .newsletter__message--error {
    display: block;
  }

  .newsletter__form[data-members-form="loading"] .btn {
    opacity: 0.7;
    pointer-events: none;
  }

  .newsletter__status {
    min-height: 1.25rem;
    color: var(--muted);
    font-size: var(--text-xs);
  }

  .newsletter__message--success {
    background: var(--ok-soft);
    color: var(--ok);
  }

  .newsletter__message--error {
    background: var(--danger-soft);
    color: var(--danger);
  }

  @media (max-width: 52rem) {
    .newsletter__grid {
      grid-template-columns: 1fr;
    }
  }

  @media (max-width: 30rem) {
    .newsletter {
      padding: var(--space-5);
    }

    .newsletter__row {
      flex-direction: column;
    }
  }

  /* Paginación ---------------------------------------------------------- */
  .pagination {
    display: flex;
    justify-content: center;
    padding-top: var(--space-7);
    margin-top: var(--space-7);
    border-top: var(--border);
  }

  .pagination__list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: var(--space-1);
    padding: 0;
    margin: 0;
    list-style: none;
  }

  .pagination__link {
    display: inline-flex;
    min-width: 2.5rem;
    min-height: 2.5rem;
    align-items: center;
    justify-content: center;
    padding: var(--space-1) var(--space-3);
    border: 1px solid var(--rule);
    border-radius: var(--radius-sm);
    color: var(--ink-soft);
    font-family: var(--font-mono);
    font-size: var(--text-sm);
    text-decoration: none;
  }

  .pagination__link:hover {
    border-color: var(--rule-strong);
    background: var(--paper-sunken);
    color: var(--ink);
  }

  .pagination__item--current .pagination__link,
  .pagination__link[aria-current="page"] {
    border-color: var(--accent);
    background: var(--accent);
    color: var(--accent-contrast);
  }

  .page-number {
    padding-inline: var(--space-3);
    color: var(--muted);
    font-family: var(--font-mono);
    font-size: var(--text-sm);
    white-space: nowrap;
  }

  /* Migas de pan -------------------------------------------------------- */
  .breadcrumbs {
    margin-bottom: var(--space-4);
  }

  .breadcrumbs__list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2);
    padding: 0;
    margin: 0;
    list-style: none;
    color: var(--muted);
    font-size: var(--text-xs);
  }

  .breadcrumbs__item {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
  }

  .breadcrumbs__item + .breadcrumbs__item::before {
    color: var(--rule-strong);
    content: "›";
  }

  .breadcrumbs a {
    color: var(--muted);
    text-decoration: none;
  }

  .breadcrumbs a:hover {
    color: var(--accent);
    text-decoration: underline;
  }

  .breadcrumbs [aria-current="page"] {
    color: var(--ink-soft);
    font-weight: var(--weight-medium);
  }

  /* Meta de artículo ---------------------------------------------------- */
  .post-kicker {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    color: var(--accent);
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    font-weight: var(--weight-semibold);
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }

  .post-title {
    max-width: 24ch;
    margin-top: var(--space-3);
    font-size: var(--text-3xl);
  }

  .post-deck {
    max-width: 58ch;
    margin-top: var(--space-4);
    color: var(--muted);
    font-size: var(--text-lg);
    line-height: var(--leading-relaxed);
  }

  .post-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-3);
    margin-top: var(--space-5);
    color: var(--muted);
    font-size: var(--text-sm);
  }

  .post-meta__avatar {
    width: 1.9rem;
    height: 1.9rem;
    border: 1px solid var(--rule-strong);
    border-radius: 50%;
    object-fit: cover;
  }

  .post-meta__author {
    color: var(--ink-soft);
    font-weight: var(--weight-medium);
    text-decoration: none;
  }

  .post-meta__sep {
    color: var(--rule-strong);
  }

  .post-tags {
    margin-top: var(--space-4);
  }

  /* Acciones de artículo ------------------------------------------------ */
  .post-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin-top: var(--space-5);
  }

  .post-actions .btn {
    min-height: 2.25rem;
    padding-inline: var(--space-3);
    font-size: var(--text-xs);
  }

  .affiliate-note {
    margin-top: var(--space-5);
    padding: var(--space-3) var(--space-4);
    border-left: 3px solid var(--rule-strong);
    background: var(--paper-sunken);
    color: var(--muted);
    font-size: var(--text-xs);
  }

  .affiliate-note a {
    color: var(--muted);
  }

  /* Caja de compra ------------------------------------------------------- */
  .buy-box {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: var(--space-4) var(--space-5);
    align-items: center;
    padding: var(--space-5);
    margin-top: var(--space-6);
    border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--rule));
    border-left: 4px solid var(--accent);
    border-radius: var(--radius-lg);
    background: linear-gradient(
      135deg,
      color-mix(in srgb, var(--accent-soft) 55%, var(--paper-raised)),
      var(--paper-raised) 70%
    );
    box-shadow: var(--shadow-sm);
    scroll-margin-top: calc(var(--header-height) + var(--space-5));
  }

  .buy-box__copy {
    display: grid;
    gap: var(--space-1);
    min-width: 0;
  }

  .buy-box__kicker {
    color: var(--accent-strong);
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    font-weight: var(--weight-semibold);
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }

  .buy-box__title {
    margin: 0;
    font-family: var(--font-display);
    font-size: var(--text-xl);
    line-height: var(--leading-snug);
    text-wrap: balance;
  }

  .buy-box__meta {
    margin: 0;
    color: var(--muted);
    font-size: var(--text-sm);
    line-height: 1.5;
  }

  .buy-box__actions {
    display: flex;
    min-width: 12rem;
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-2);
  }

  .buy-box__button {
    white-space: nowrap;
  }

  .buy-box__affiliate-link {
    color: var(--muted);
    font-size: var(--text-xs);
    text-align: center;
    text-decoration: underline;
    text-underline-offset: 0.15em;
  }

  .buy-box__affiliate-link:hover {
    color: var(--ink);
  }

  @media (max-width: 42rem) {
    .buy-box {
      grid-template-columns: 1fr;
      padding: var(--space-4);
    }

    .buy-box__button {
      width: 100%;
    }
  }

  /* Estado vacío -------------------------------------------------------- */
  .empty-state {
    padding: var(--space-9) var(--space-6);
    border: 1px dashed var(--rule-strong);
    border-radius: var(--radius-lg);
    background: var(--paper-raised);
    text-align: center;
  }

  .empty-state__icon {
    display: inline-grid;
    width: 3rem;
    height: 3rem;
    margin-bottom: var(--space-4);
    place-items: center;
    border: 1px solid var(--rule);
    border-radius: 50%;
    color: var(--accent);
  }

  .empty-state__title {
    font-size: var(--text-xl);
  }

  .empty-state__text {
    max-width: 38rem;
    margin: var(--space-3) auto 0;
    color: var(--muted);
    font-size: var(--text-sm);
  }

  .empty-state__actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--space-2);
    margin-top: var(--space-5);
  }

  /* Aviso / callout ------------------------------------------------------ */
  .callout {
    padding: var(--space-4) var(--space-5);
    border: 1px solid var(--rule);
    border-left: 4px solid var(--accent);
    border-radius: var(--radius-sm);
    background: var(--paper-raised);
    color: var(--ink-soft);
    font-size: var(--text-sm);
  }

  .callout strong {
    color: var(--ink);
  }
}

@layer components {
  /* Contenido del artículo ------------------------------------------------- */
  .gh-content {
    max-width: var(--measure);
    font-size: var(--text-md);
    line-height: var(--leading-relaxed);
  }

  .gh-content > * + * {
    margin-top: 1.15em;
  }

  .gh-content h2 {
    margin-top: 2.1em;
    padding-top: 0.2em;
    font-size: var(--text-2xl);
  }

  .gh-content h3 {
    margin-top: 1.8em;
    font-size: var(--text-xl);
  }

  .gh-content h4 {
    margin-top: 1.6em;
    font-size: var(--text-lg);
  }

  .gh-content p,
  .gh-content ul,
  .gh-content ol,
  .gh-content blockquote,
  .gh-content table,
  .gh-content figure,
  .gh-content pre {
    margin-block: 0;
  }

  .gh-content ul,
  .gh-content ol {
    padding-left: 1.35em;
  }

  .gh-content li + li {
    margin-top: 0.35em;
  }

  .gh-content a:not(.btn):not(.badge) {
    color: var(--accent);
    text-decoration: underline;
    text-decoration-color: color-mix(in srgb, var(--accent) 40%, transparent);
  }

  .gh-content a:not(.btn):not(.badge):hover {
    color: var(--accent-strong);
    text-decoration-color: currentColor;
  }

  .gh-content .btn,
  .gh-content .badge {
    text-decoration: none;
  }

  .gh-content img {
    width: auto;
    max-width: 100%;
    height: auto;
    margin-inline: auto;
    border: var(--border);
    border-radius: var(--radius-sm);
  }

  .gh-content figure {
    margin-block: 1.6em;
  }

  .gh-content figure img {
    margin-inline: auto;
  }

  .gh-content figcaption,
  .gh-content .kg-image-caption {
    margin-top: var(--space-2);
    color: var(--muted);
    font-size: var(--text-sm);
    line-height: 1.5;
    text-align: center;
  }

  .gh-content .table-scroll {
    max-width: 100%;
    margin-block: 1.6em;
    overflow-x: auto;
    border: 1px solid var(--rule);
    border-radius: var(--radius-sm);
    background: var(--paper-raised);
    -webkit-overflow-scrolling: touch;
  }

  .gh-content .table-scroll:focus-visible {
    outline: 3px solid var(--focus);
    outline-offset: 3px;
  }

  .gh-content table {
    display: table;
    width: 100%;
    border: 0;
    background: transparent;
    overflow: visible;
  }

  .gh-content thead {
    background: var(--paper-sunken);
  }

  .gh-content .table-scroll + * {
    margin-top: 1.15em;
  }

  .gh-content tbody tr:nth-child(even) {
    background: color-mix(in srgb, var(--paper-sunken) 55%, transparent);
  }

  .gh-content td,
  .gh-content th {
    min-width: 7rem;
  }

  .gh-content .kg-card {
    margin-block: 1.6em;
  }

  .gh-content .kg-width-wide {
    width: min(100vw - 2rem, 72rem);
    max-width: none;
    margin-left: 50%;
    transform: translateX(-50%);
  }

  .gh-content .kg-width-full {
    width: 100vw;
    max-width: none;
    margin-left: 50%;
    transform: translateX(-50%);
  }

  .gh-content .kg-image-card img {
    border: 0;
  }

  .gh-content .kg-gallery-container {
    max-width: 100%;
  }

  .gh-content .kg-gallery-image img {
    border-radius: var(--radius-xs);
  }

  .gh-content .kg-embed-card iframe {
    max-width: 100%;
    border-radius: var(--radius-sm);
  }

  .gh-content .kg-bookmark-card {
    border: var(--border);
    border-radius: var(--radius-sm);
    background: var(--paper-raised);
  }

  .gh-content .kg-bookmark-container {
    display: flex;
    gap: var(--space-4);
    padding: var(--space-4);
    color: var(--ink);
    text-decoration: none;
  }

  .gh-content .kg-bookmark-content {
    flex: 1;
    min-width: 0;
  }

  .gh-content .kg-bookmark-title {
    font-weight: var(--weight-semibold);
  }

  .gh-content .kg-bookmark-description {
    margin-top: var(--space-1);
    color: var(--muted);
    font-size: var(--text-sm);
  }

  .gh-content .kg-bookmark-thumbnail {
    flex: none;
    width: 7rem;
  }

  .gh-content .kg-bookmark-thumbnail img {
    width: 100%;
    height: 100%;
    border: 0;
    border-radius: var(--radius-xs);
    object-fit: cover;
  }

  .gh-content .kg-callout-card {
    padding: var(--space-4) var(--space-5);
    border: 1px solid var(--rule);
    border-left: 4px solid var(--accent);
    border-radius: var(--radius-sm);
    background: var(--paper-raised);
  }

  .gh-content .kg-callout-card + .kg-callout-card {
    margin-top: -0.6em;
  }

  .gh-content .kg-callout-emoji {
    margin-right: var(--space-2);
  }

  .gh-content .kg-toggle-card {
    border: var(--border);
    border-radius: var(--radius-sm);
    background: var(--paper-raised);
  }

  .gh-content .kg-toggle-heading {
    padding: var(--space-3) var(--space-4);
  }

  .gh-content .kg-toggle-content {
    padding: 0 var(--space-4) var(--space-4);
  }

  .gh-content .kg-file-card {
    border: var(--border);
    border-radius: var(--radius-sm);
    background: var(--paper-raised);
  }

  .gh-content .kg-file-card-container {
    padding: var(--space-4);
  }

  /* Bloques generados por el agente (fase 0) ------------------------------ */
  .fb-ficha,
  .fb-nota,
  .fb-veredicto,
  .fb-toc,
  .fb-galeria,
  .fb-relacionados {
    --fb-paper: var(--paper-raised);
    --fb-ink: var(--ink);
    --fb-muted: var(--muted);
    --fb-rule: var(--rule);
    --fb-accent: var(--accent);
    box-sizing: border-box;
    font-family: var(--font-body);
    line-height: var(--leading-normal);
  }

  .fb-ficha *,
  .fb-nota *,
  .fb-veredicto *,
  .fb-toc *,
  .fb-galeria *,
  .fb-relacionados * {
    box-sizing: border-box;
  }

  .fb-ficha {
    padding: var(--space-5);
    border: 1px solid var(--rule);
    border-radius: var(--radius-md);
    background: var(--paper-raised);
    color: var(--ink);
    font-size: var(--text-sm);
  }

  .fb-ficha > .fb-breadcrumb {
    display: none;
  }

  .fb-ficha-titulo,
  .fb-veredicto-titulo,
  .fb-galeria-titulo {
    margin-top: 0;
    color: var(--ink);
    font-family: var(--font-display);
    font-size: var(--text-lg);
    font-weight: var(--weight-semibold);
    letter-spacing: -0.01em;
  }

  .fb-ficha-titulo {
    margin-bottom: var(--space-3);
  }

  .fb-ficha-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2);
    padding-bottom: var(--space-3);
    margin-bottom: var(--space-3);
    border-bottom: 1px solid var(--rule);
  }

  .fb-copiar-ficha {
    display: inline-flex;
    min-height: 2.15rem;
    align-items: center;
    padding: var(--space-1) var(--space-3);
    border: 1px solid var(--rule-strong);
    border-radius: var(--radius-sm);
    background: var(--paper-sunken);
    color: var(--ink-soft);
    font-family: var(--font-body);
    font-size: var(--text-xs);
    font-weight: var(--weight-semibold);
  }

  .fb-copiar-ficha:hover {
    border-color: var(--accent);
    background: var(--accent-soft);
    color: var(--accent-strong);
  }

  .fb-copiar-ficha.fb-copiado {
    border-color: var(--ok);
    background: var(--ok-soft);
    color: var(--ok);
  }

  .fb-ficha-metodo,
  .fb-evidencia-metodo,
  .fb-veredicto-enlaces a,
  .fb-relacionados a,
  .fb-ficha a {
    color: var(--accent);
  }

  .fb-ficha-grupo {
    padding-top: var(--space-3);
    margin-top: var(--space-3);
    border-top: 1px solid var(--rule);
  }

  .fb-ficha-grupo:first-of-type {
    padding-top: 0;
    margin-top: 0;
    border-top: 0;
  }

  .fb-ficha-grupo-titulo {
    margin: var(--space-1) 0 var(--space-2);
    color: var(--ink);
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: var(--weight-semibold);
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }

  .fb-ficha-lista {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
    margin: var(--space-2) 0 0;
  }

  .fb-kv {
    display: grid;
    grid-template-columns: minmax(6rem, 0.42fr) minmax(0, 1fr);
    gap: var(--space-2);
    padding: 0.32rem 0;
    border-bottom: 1px solid color-mix(in srgb, var(--rule) 55%, transparent);
  }

  .fb-kv:last-child {
    border-bottom: 0;
  }

  .fb-kv dt {
    color: var(--muted);
    font-size: 0.76rem;
    line-height: 1.45;
  }

  .fb-kv dd {
    margin: 0;
    color: var(--ink);
    font-family: var(--font-mono);
    font-size: 0.76rem;
    line-height: 1.5;
    overflow-wrap: anywhere;
  }

  .fb-ficha-grupo[data-grupo="compra"] {
    padding: var(--space-3);
    margin-top: var(--space-4);
    border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--rule));
    border-radius: var(--radius-sm);
    background: var(--accent-soft);
  }

  .fb-ficha-grupo[data-grupo="compra"] .fb-ficha-grupo-titulo {
    color: var(--accent-strong);
  }

  .fb-ficha-grupo[data-grupo="compra"] .fb-kv dd {
    color: var(--ink);
  }

  .fb-ficha--sidebar {
    max-height: none;
  }

  .fb-ficha--sidebar .fb-ficha-titulo {
    font-size: var(--text-base);
  }

  .fb-ficha--sidebar .fb-kv {
    grid-template-columns: 1fr;
    gap: 0.1rem;
  }

  .fb-ficha--sidebar .fb-kv dt {
    font-size: 0.68rem;
  }

  .fb-ficha--sidebar .fb-kv dd {
    font-size: 0.72rem;
  }

  /* Ficha colapsable en móvil (mejora progresiva) */
  .fb-ficha details.fb-ficha-grupo {
    padding-top: var(--space-2);
    margin-top: var(--space-2);
  }

  .fb-ficha details.fb-ficha-grupo > summary {
    display: flex;
    cursor: pointer;
    list-style: none;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-2);
    padding: var(--space-2) 0;
    color: var(--ink);
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: var(--weight-semibold);
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }

  .fb-ficha details.fb-ficha-grupo > summary::-webkit-details-marker {
    display: none;
  }

  .fb-ficha details.fb-ficha-grupo > summary::after {
    width: 0.5rem;
    height: 0.5rem;
    border-right: 2px solid var(--muted);
    border-bottom: 2px solid var(--muted);
    content: "";
    transform: rotate(45deg);
    transition: transform var(--duration-fast) var(--ease);
  }

  .fb-ficha details.fb-ficha-grupo[open] > summary::after {
    transform: rotate(-135deg);
  }

  .fb-ficha details.fb-ficha-grupo > summary h3 {
    margin: 0;
    font: inherit;
    letter-spacing: inherit;
    text-transform: inherit;
  }

  .fb-ficha details.fb-ficha-grupo > summary .fb-evidencia,
  .fb-ficha details.fb-ficha-grupo > summary .fb-evidencia-metodo,
  .fb-ficha details.fb-ficha-grupo > summary .fb-evidencia-nota {
    display: none;
  }

  .fb-ficha details.fb-ficha-grupo .fb-ficha-lista {
    padding-bottom: var(--space-2);
  }

  /* Evidencia ------------------------------------------------------------- */
  .fb-evidencia {
    display: inline-flex;
    align-items: center;
    gap: 0.3em;
    padding: 0.18em 0.5em;
    border: 1px solid var(--rule-strong);
    border-radius: var(--radius-pill);
    background: var(--paper);
    color: var(--muted-strong);
    font-family: var(--font-mono);
    font-size: 0.62rem;
    font-weight: var(--weight-medium);
    letter-spacing: 0.02em;
    line-height: 1.5;
    text-transform: uppercase;
    vertical-align: 0.08em;
  }

  /* Los sellos "Medido" se repiten demasiado y no aportan lectura:
     se ocultan, junto con su enlace de metodología local. */
  .fb-evidencia--medido,
  .fb-evidencia--medido + .fb-evidencia-metodo {
    display: none;
  }

  .fb-evidencia--inspeccionado {
    border-color: color-mix(in srgb, var(--focus) 30%, var(--rule));
    background: color-mix(in srgb, var(--focus) 10%, var(--paper));
    color: color-mix(in srgb, var(--focus) 80%, var(--ink));
  }

  .fb-evidencia--estimado {
    border-color: color-mix(in srgb, var(--warn) 40%, var(--rule));
    background: var(--warn-soft);
    color: var(--warn);
  }

  .fb-evidencia--fuente-externa {
    border-color: var(--rule-strong);
    background: var(--paper-sunken);
    color: var(--muted-strong);
  }

  .fb-evidencia-nota {
    color: var(--muted);
    font-size: 0.68rem;
    line-height: 1.4;
  }

  /* Nota ------------------------------------------------------------------ */
  .fb-nota {
    padding: var(--space-5);
    border: 1px solid var(--rule-strong);
    border-radius: var(--radius-md);
    background:
      linear-gradient(135deg, var(--paper-raised), var(--paper-sunken));
    color: var(--ink);
  }

  .fb-nota-global {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.3rem 0.5rem;
    padding-bottom: var(--space-4);
    border-bottom: 1px solid var(--rule);
  }

  .fb-nota-kicker {
    width: 100%;
    color: var(--muted);
    font-family: var(--font-mono);
    font-size: 0.65rem;
    font-weight: var(--weight-semibold);
    letter-spacing: 0.1em;
    text-transform: uppercase;
  }

  .fb-nota-num {
    color: var(--ink);
    font-family: var(--font-mono);
    font-size: 2.9rem;
    font-weight: var(--weight-semibold);
    letter-spacing: -0.04em;
    line-height: 1;
  }

  .fb-nota-de-5 {
    color: var(--muted);
    font-family: var(--font-mono);
    font-size: var(--text-sm);
  }

  .fb-nota-etiqueta {
    padding: 0.15em 0.55em;
    border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--rule));
    border-radius: var(--radius-pill);
    background: var(--accent-soft);
    color: var(--accent-strong);
    font-size: 0.7rem;
    font-weight: var(--weight-semibold);
  }

  .fb-nota-barras {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    padding-block: var(--space-4);
  }

  .fb-barra {
    display: grid;
    grid-template-columns: 4.4rem minmax(0, 1fr) auto;
    gap: var(--space-2);
    align-items: center;
  }

  .fb-barra-label {
    color: var(--ink-soft);
    font-size: 0.72rem;
    font-weight: var(--weight-medium);
  }

  .fb-barra-track {
    display: block;
    height: 0.42rem;
    overflow: hidden;
    border-radius: var(--radius-pill);
    background: var(--paper-deep);
  }

  .fb-barra-fill {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--accent);
  }

  .fb-barra-valor {
    color: var(--ink);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: var(--weight-semibold);
    white-space: nowrap;
  }

  .fb-barra-peso {
    color: var(--muted);
    font-size: 0.62rem;
    font-weight: var(--weight-regular);
  }

  .fb-barra .fb-evidencia {
    grid-column: 2 / -1;
    grid-row: 2;
    justify-self: start;
  }

  .fb-barra .fb-evidencia-metodo {
    display: none;
  }

  .fb-nota-corpus {
    padding-top: var(--space-3);
    border-top: 1px solid var(--rule);
    color: var(--muted);
    font-size: 0.74rem;
  }

  .fb-nota > .fb-evidencia {
    margin-top: var(--space-3);
  }

  /* En la cabecera del análisis, la nota se compacta */
  .post-hero__aside .fb-nota {
    margin-top: var(--space-4);
    padding: var(--space-4);
  }

  .post-hero__aside .fb-nota-num {
    font-size: 2.3rem;
  }

  .post-hero__aside .fb-nota-barras {
    gap: var(--space-1);
    padding-block: var(--space-3);
  }

  /* Veredicto ------------------------------------------------------------- */
  .fb-veredicto {
    padding: var(--space-6);
    border: 1px solid var(--rule-strong);
    border-left: 5px solid var(--accent);
    border-radius: var(--radius-md);
    background: var(--paper-raised);
    color: var(--ink);
  }

  .fb-veredicto-titulo {
    margin-bottom: var(--space-3);
  }

  .fb-veredicto-resumen {
    color: var(--ink-soft);
    font-size: var(--text-base);
    line-height: var(--leading-relaxed);
  }

  .fb-veredicto-pros,
  .fb-veredicto-contras {
    margin-top: var(--space-4);
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-sm);
  }

  .fb-veredicto-pros {
    border: 1px solid color-mix(in srgb, var(--ok) 30%, var(--rule));
    background: var(--ok-soft);
  }

  .fb-veredicto-contras {
    border: 1px solid color-mix(in srgb, var(--danger) 30%, var(--rule));
    background: var(--danger-soft);
  }

  .fb-veredicto-pros h3,
  .fb-veredicto-contras h3,
  .fb-veredicto-para h3 {
    margin: 0 0 var(--space-2);
    font-family: var(--font-mono);
    font-size: 0.68rem;
    font-weight: var(--weight-semibold);
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }

  .fb-veredicto-pros h3 {
    color: var(--ok);
  }

  .fb-veredicto-contras h3 {
    color: var(--danger);
  }

  .fb-veredicto ul {
    padding-left: 1.1em;
    margin: 0;
  }

  .fb-veredicto li {
    color: var(--ink-soft);
    font-size: var(--text-sm);
  }

  .fb-veredicto li + li {
    margin-top: var(--space-1);
  }

  .fb-veredicto-para {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-3);
    margin-top: var(--space-4);
  }

  .fb-para-si,
  .fb-para-no {
    padding: var(--space-3);
    border: 1px solid var(--rule);
    border-radius: var(--radius-sm);
    background: var(--paper);
  }

  .fb-para-si h3 {
    color: var(--ok);
  }

  .fb-para-no h3 {
    color: var(--danger);
  }

  .fb-veredicto-alternativa {
    padding-top: var(--space-3);
    margin-top: var(--space-4);
    border-top: 1px solid var(--rule);
    color: var(--ink-soft);
    font-size: var(--text-sm);
  }

  .fb-veredicto .fb-evidencia {
    margin-top: var(--space-3);
  }

  .fb-veredicto-enlaces {
    margin-top: var(--space-3);
    color: var(--muted);
    font-size: var(--text-xs);
  }

  /* Índice ---------------------------------------------------------------- */
  .post-main > .fb-toc {
    margin-bottom: var(--space-6);
  }

  .fb-toc {
    padding: var(--space-4) var(--space-5);
    border: 1px solid var(--rule);
    border-radius: var(--radius-md);
    background: var(--paper-raised);
    color: var(--ink);
  }

  .fb-toc-details > summary {
    display: flex;
    min-height: 2rem;
    align-items: center;
    cursor: pointer;
    list-style: none;
    color: var(--ink);
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: var(--weight-semibold);
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }

  .fb-toc-details > summary::-webkit-details-marker {
    display: none;
  }

  .fb-toc-details > summary::after {
    float: right;
    content: "＋";
    color: var(--muted);
  }

  .fb-toc-details[open] > summary::after {
    content: "－";
  }

  .fb-toc-list {
    padding: 0;
    margin: var(--space-3) 0 0;
    list-style: none;
    counter-reset: toc;
  }

  .fb-toc-list li {
    counter-increment: toc;
    margin: 0;
  }

  .fb-toc-list a {
    display: flex;
    gap: var(--space-2);
    padding: var(--space-1) 0;
    color: var(--ink-soft);
    font-size: var(--text-sm);
    text-decoration: none;
  }

  .fb-toc-list a::before {
    flex: none;
    width: 1.5rem;
    color: var(--muted);
    content: counter(toc, decimal-leading-zero);
    font-family: var(--font-mono);
    font-size: 0.68rem;
  }

  .fb-toc-list li.fb-toc-l3 {
    padding-left: 1rem;
  }

  .fb-toc-list li.fb-toc-l3 a {
    font-size: var(--text-xs);
  }

  .fb-toc-list a:hover,
  .fb-toc-list a.fb-toc-active {
    color: var(--accent);
    text-decoration: underline;
  }

  /* Galería y visor ------------------------------------------------------- */
  .fb-galeria {
    padding-top: var(--space-5);
    border-top: 1px solid var(--rule);
  }

  .fb-galeria-titulo {
    margin-bottom: var(--space-3);
  }

  .fb-galeria-rejilla {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-3);
  }

  .fb-galeria-item {
    min-width: 0;
    margin: 0;
  }

  .fb-galeria-mini {
    display: block;
    overflow: hidden;
    border: 1px solid var(--rule);
    border-radius: var(--radius-sm);
    background: var(--paper-deep);
  }

  .fb-galeria-mini:hover {
    border-color: var(--accent);
  }

  .fb-galeria-mini img {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    transition: transform var(--duration) var(--ease);
  }

  .fb-galeria-mini:hover img {
    transform: scale(1.02);
  }

  .fb-galeria-item figcaption {
    margin-top: var(--space-1);
    color: var(--muted);
    font-size: 0.7rem;
    line-height: 1.45;
  }

  .fb-galeria-ts {
    display: block;
    color: var(--ink-soft);
    font-family: var(--font-mono);
    font-size: 0.66rem;
  }

  .fb-galeria-nota {
    display: none;
  }

  @media (min-width: 48rem) {
    .fb-galeria-rejilla {
      grid-template-columns: repeat(3, minmax(0, 1fr));
    }
  }

  @media (min-width: 68rem) {
    .fb-galeria-rejilla {
      grid-template-columns: repeat(4, minmax(0, 1fr));
    }
  }

  .fb-visor {
    position: fixed;
    inset: 0;
    z-index: var(--z-dialog);
    display: grid;
    place-items: center;
    padding: var(--space-4) var(--space-4) var(--space-9);
    background: rgb(8 8 8 / 0.9);
    backdrop-filter: blur(4px);
  }

  .fb-visor figure {
    max-width: min(100%, 92rem);
    margin: 0;
    text-align: center;
  }

  .fb-visor img {
    width: auto;
    max-width: 100%;
    max-height: calc(100dvh - 9rem);
    margin-inline: auto;
    border: 1px solid rgb(255 255 255 / 0.15);
    border-radius: var(--radius-sm);
    object-fit: contain;
  }

  .fb-visor figcaption {
    max-width: 70ch;
    margin: var(--space-3) auto 0;
    color: rgb(255 255 255 / 0.82);
    font-size: var(--text-sm);
    line-height: 1.5;
  }

  .fb-zoomable {
    cursor: zoom-in;
  }

  .fb-visor--zoom {
    display: block;
    width: 100%;
    max-width: none;
    height: 100%;
    max-height: none;
    padding: 0;
    margin: 0;
    border: 0;
    border-radius: 0;
    background: rgb(8 8 8 / 0.96);
  }

  .fb-visor--zoom[data-zoom="2"] .fb-visor__stage img,
  .fb-visor--zoom[data-zoom="2.5"] .fb-visor__stage img,
  .fb-visor--zoom[data-zoom="3"] .fb-visor__stage img,
  .fb-visor--zoom[data-zoom="3.5"] .fb-visor__stage img,
  .fb-visor--zoom[data-zoom="4"] .fb-visor__stage img {
    cursor: zoom-out;
  }

  .fb-visor__shell {
    display: flex;
    width: 100%;
    height: 100%;
    flex-direction: column;
    padding: var(--space-4) var(--space-4) 5.5rem;
  }

  .fb-visor__stage {
    display: grid;
    flex: 1;
    place-items: center;
    overflow: auto;
    padding: var(--space-2);
    overscroll-behavior: contain;
  }

  .fb-visor__stage img {
    display: block;
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: calc(100dvh - 9rem);
    margin: auto;
    border: 1px solid rgb(255 255 255 / 0.16);
    border-radius: var(--radius-sm);
    object-fit: contain;
    cursor: zoom-in;
  }

  .fb-visor__caption {
    max-width: 72ch;
    margin: var(--space-2) auto 0;
    color: rgb(255 255 255 / 0.82);
    font-size: var(--text-sm);
    line-height: 1.5;
    text-align: center;
  }

  .fb-visor__toolbar {
    position: fixed;
    bottom: max(var(--space-4), env(safe-area-inset-bottom));
    left: 50%;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: var(--space-1);
    padding: var(--space-1);
    border: 1px solid rgb(255 255 255 / 0.25);
    border-radius: var(--radius-pill);
    background: rgb(0 0 0 / 0.68);
    backdrop-filter: blur(8px);
    transform: translateX(-50%);
  }

  .fb-visor__tool {
    display: inline-flex;
    min-width: 2.5rem;
    min-height: 2.5rem;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #fff;
    font-size: 1.2rem;
    line-height: 1;
  }

  .fb-visor__tool:hover,
  .fb-visor__tool:focus-visible {
    background: rgb(255 255 255 / 0.18);
    color: #fff;
  }

  .fb-visor__tool--text {
    width: auto;
    padding-inline: var(--space-3);
    border-radius: var(--radius-pill);
    font-family: var(--font-body);
    font-size: 0.78rem;
    font-weight: var(--weight-semibold);
  }

  .fb-visor__zoom {
    min-width: 3.6rem;
    color: #fff;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    text-align: center;
  }

  .fb-visor-cerrar {
    position: fixed;
    top: var(--space-4);
    right: var(--space-4);
    z-index: 3;
    display: grid;
    width: 2.75rem;
    height: 2.75rem;
    place-items: center;
    border: 1px solid rgb(255 255 255 / 0.35);
    border-radius: 50%;
    background: rgb(0 0 0 / 0.55);
    color: #fff;
    font-size: 1.5rem;
    line-height: 1;
  }

  .fb-visor-cerrar:hover {
    background: #fff;
    color: #000;
  }

  /* Relacionados ---------------------------------------------------------- */
  .fb-relacionados {
    padding-top: var(--space-6);
    margin-top: var(--space-7);
    border-top: 1px solid var(--rule);
  }

  .fb-relacionados h2 {
    margin-bottom: var(--space-4);
    font-size: var(--text-2xl);
  }

  .fb-relacionados ul {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr));
    gap: var(--space-2);
    padding: 0;
    margin: 0;
    list-style: none;
  }

  .fb-relacionados li {
    padding: var(--space-3) var(--space-4);
    border: 1px solid var(--rule);
    border-radius: var(--radius-sm);
    background: var(--paper-raised);
  }

  .fb-relacionados li a {
    color: var(--ink);
    font-size: var(--text-sm);
    font-weight: var(--weight-medium);
    text-decoration: none;
  }

  .fb-relacionados li a:hover {
    color: var(--accent);
    text-decoration: underline;
  }

  .fb-relacionados-metodo {
    margin-top: var(--space-4);
    color: var(--muted);
    font-size: var(--text-xs);
  }

  /* Cajón de ficha técnica en móvil --------------------------------------- */
  .ficha-drawer-trigger {
    display: none;
    width: 100%;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    padding: var(--space-4);
    border: 1px solid var(--rule-strong);
    border-radius: var(--radius-md);
    background: var(--paper-raised);
    color: var(--ink);
    text-align: left;
  }

  .ficha-drawer-trigger:hover {
    border-color: var(--accent);
    background: var(--accent-soft);
  }

  .ficha-drawer-trigger__title {
    font-family: var(--font-display);
    font-size: var(--text-lg);
    font-weight: var(--weight-semibold);
  }

  .ficha-drawer-trigger__meta {
    flex: none;
    color: var(--accent);
    font-size: var(--text-xs);
    font-weight: var(--weight-semibold);
  }

  .ficha-drawer {
    position: fixed;
    inset: 0 0 0 auto;
    width: min(26rem, 94vw);
    max-width: 100%;
    height: 100dvh;
    max-height: 100dvh;
    padding: 0;
    margin: 0;
    border: 0;
    border-left: 1px solid var(--rule);
    background: var(--paper-raised);
    color: var(--ink);
    box-shadow: var(--shadow-lg);
    transform: translateX(100%);
  }

  .ficha-drawer[open] {
    transform: translateX(0);
    animation: ficha-drawer-in var(--duration) var(--ease);
  }

  .ficha-drawer::backdrop {
    background: rgb(0 0 0 / 0.5);
    backdrop-filter: blur(2px);
  }

  @keyframes ficha-drawer-in {
    from {
      transform: translateX(100%);
    }
    to {
      transform: translateX(0);
    }
  }

  .ficha-drawer__head {
    position: sticky;
    top: 0;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    padding: var(--space-4);
    border-bottom: 1px solid var(--rule);
    background: var(--paper-raised);
  }

  .ficha-drawer__title {
    margin: 0;
    font-family: var(--font-display);
    font-size: var(--text-lg);
    font-weight: var(--weight-semibold);
  }

  .ficha-drawer__close {
    display: grid;
    width: 2.5rem;
    height: 2.5rem;
    flex: none;
    place-items: center;
    border: 1px solid var(--rule);
    border-radius: var(--radius-sm);
    background: var(--paper-sunken);
    color: var(--ink-soft);
    font-size: 1.4rem;
    line-height: 1;
  }

  .ficha-drawer__close:hover {
    border-color: var(--accent);
    background: var(--accent-soft);
    color: var(--accent-strong);
  }

  .ficha-drawer__body {
    height: calc(100dvh - 4.05rem);
    padding: var(--space-4);
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .ficha-drawer .fb-ficha {
    padding: 0;
    border: 0;
    background: transparent;
  }

  .ficha-drawer .fb-ficha-titulo {
    display: none;
  }

  .ficha-drawer .fb-ficha-toolbar {
    position: sticky;
    top: 0;
    z-index: 1;
    padding-block: var(--space-2);
    background: var(--paper-raised);
  }

  @media (max-width: 64rem) {
    .ficha-drawer-trigger {
      display: flex;
    }
  }

  /* Barra de acción móvil -------------------------------------------------- */
  .action-bar {
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: calc(var(--z-header) - 1);
    display: none;
    height: 3.75rem;
    min-height: 3.75rem;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    padding-bottom: max(var(--space-2), env(safe-area-inset-bottom));
    border-top: var(--border);
    background: color-mix(in srgb, var(--paper) 95%, transparent);
    box-shadow: 0 -8px 24px -18px rgb(var(--shadow-color) / 0.5);
    backdrop-filter: blur(10px);
    transition: transform var(--duration) var(--ease);
  }

  .action-bar[data-hidden="true"] {
    transform: translateY(105%);
  }

  .action-bar__item {
    font-family: inherit;
    display: inline-flex;
    min-height: 2.6rem;
    max-height: 2.75rem;
    line-height: 1.1;
    white-space: nowrap;
    flex: 1;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-1) var(--space-2);
    border: 1px solid var(--rule);
    border-radius: var(--radius-sm);
    background: var(--paper-raised);
    color: var(--ink-soft);
    font-size: var(--text-xs);
    font-weight: var(--weight-semibold);
    text-decoration: none;
  }

  .action-bar__item strong {
    color: var(--accent-strong);
    font-family: var(--font-mono);
  }

  @media (max-width: 48rem) {
    .action-bar {
      display: flex;
    }

    .post-shell {
      padding-bottom: 5rem;
    }
  }

  /* Impresión ------------------------------------------------------------- */
  @media print {
    .site-header,
    .site-footer,
    .action-bar,
    .newsletter,
    .post-actions,
    .buy-box,
    .affiliate-note,
    .fb-toc,
    .fb-galeria,
    .fb-relacionados,
    .fb-copiar-ficha,
    .fb-ficha-toolbar,
    .breadcrumbs {
      display: none !important;
    }

    body {
      background: #fff !important;
      color: #000 !important;
      font-size: 11pt;
    }

    .post-shell,
    .post-hero,
    .post-body-wrap {
      padding: 0 !important;
      border: 0 !important;
    }

    .post-hero__grid {
      display: block !important;
    }

    .post-layout {
      display: flex !important;
      flex-direction: column;
    }

    .post-sidebar {
      position: static !important;
      display: block !important;
      order: -1;
      max-height: none !important;
      margin-bottom: 1rem;
      overflow: visible !important;
    }

    .post-main {
      order: 2;
    }

    .post-title {
      max-width: none;
      font-size: 22pt;
    }

    .post-deck {
      font-size: 12pt;
      color: #333 !important;
    }

    .gh-content {
      max-width: none;
    }

    .fb-ficha,
    .fb-nota,
    .fb-veredicto {
      break-inside: avoid;
      border: 1px solid #999 !important;
      background: #fff !important;
      color: #000 !important;
    }

    .fb-ficha-grupo {
      break-inside: avoid;
    }

    .fb-nota-num,
    .fb-nota-etiqueta,
    .fb-barra-valor,
    .fb-barra-label,
    .fb-kv dd,
    .fb-kv dt {
      color: #000 !important;
    }

    .fb-barra-track {
      border: 1px solid #999;
      background: #eee;
    }

    .fb-barra-fill {
      background: #444;
    }

    .fb-veredicto-pros,
    .fb-veredicto-contras,
    .fb-para-si,
    .fb-para-no,
    .fb-ficha-grupo[data-grupo="compra"] {
      background: #fff !important;
      border-color: #999 !important;
    }

    .fb-veredicto-pros h3,
    .fb-veredicto-contras h3,
    .fb-para-si h3,
    .fb-para-no h3 {
      color: #000 !important;
    }

    .fb-evidencia {
      border-color: #666 !important;
      background: #fff !important;
      color: #000 !important;
    }

    a[href]::after {
      content: " (" attr(href) ")";
      font-size: 8pt;
      color: #555;
      word-break: break-all;
    }

    a[href^="#"]::after,
    .fb-ficha a[href]::after,
    .fb-nota a[href]::after {
      content: "";
    }
  }

  @media (max-width: 36rem) {
    .fb-veredicto-para {
      grid-template-columns: 1fr;
    }

    .fb-veredicto {
      padding: var(--space-4);
    }

    .fb-barra {
      grid-template-columns: 3.7rem minmax(0, 1fr) auto;
    }

    .fb-nota {
      padding: var(--space-4);
    }
  }
}

@layer components {
  .hub-filters {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    padding: var(--space-5);
    border: 1px solid var(--rule);
    border-radius: var(--radius-md);
    background: var(--paper-raised);
  }

  .hub-filters[data-enhanced="false"] {
    display: none;
  }

  .hub-filters__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    padding-bottom: var(--space-3);
    border-bottom: 1px solid var(--rule);
  }

  .hub-filters__title {
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    font-weight: var(--weight-semibold);
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }

  .hub-filters__reset {
    color: var(--accent);
    font-size: var(--text-xs);
    font-weight: var(--weight-semibold);
    text-decoration: underline;
  }

  .filter-close {
    display: none;
    width: 2.5rem;
    height: 2.5rem;
    place-items: center;
    border: 1px solid var(--rule);
    border-radius: var(--radius-sm);
    color: var(--ink-soft);
  }

  .filter-group {
    padding: 0;
    margin: 0;
    border: 0;
  }

  .filter-group + .filter-group {
    padding-top: var(--space-3);
    border-top: 1px solid var(--rule);
  }

  .filter-group__title,
  .filter-group legend {
    display: block;
    padding: 0;
    margin-bottom: var(--space-2);
    color: var(--ink);
    font-family: var(--font-mono);
    font-size: 0.68rem;
    font-weight: var(--weight-semibold);
    letter-spacing: 0.06em;
    text-transform: uppercase;
  }

  .filter-options {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-1);
  }

  .filter-option {
    position: relative;
    display: inline-flex;
  }

  .filter-option input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
  }

  .filter-option label {
    display: inline-flex;
    align-items: center;
    gap: 0.25em;
    padding: 0.28em 0.62em;
    border: 1px solid var(--rule);
    border-radius: var(--radius-pill);
    background: var(--paper);
    color: var(--ink-soft);
    cursor: pointer;
    font-size: var(--text-xs);
    line-height: 1.4;
    user-select: none;
  }

  .filter-option label:hover {
    border-color: var(--rule-strong);
    background: var(--paper-sunken);
  }

  .filter-option input:checked + label {
    border-color: var(--accent);
    background: var(--accent-soft);
    color: var(--accent-strong);
    font-weight: var(--weight-semibold);
  }

  .filter-option input:focus-visible + label {
    outline: 3px solid var(--focus);
    outline-offset: 2px;
  }

  .filter-option__count {
    color: var(--muted);
    font-family: var(--font-mono);
    font-size: 0.62rem;
  }

  .filter-select {
    width: 100%;
    min-height: 2.5rem;
    padding: var(--space-1) var(--space-3);
    border: 1px solid var(--rule-strong);
    border-radius: var(--radius-sm);
    background: var(--paper);
    color: var(--ink);
    font-size: var(--text-sm);
  }

  .filter-select:focus-visible {
    border-color: var(--focus);
  }

  .filter-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    min-height: 2.75rem;
    padding: var(--space-2) var(--space-4);
    border: 1px solid var(--rule-strong);
    border-radius: var(--radius-sm);
    background: var(--paper-raised);
    color: var(--ink);
    font-size: var(--text-sm);
    font-weight: var(--weight-semibold);
  }

  .filter-toggle__count {
    display: none;
    min-width: 1.4rem;
    padding: 0.1em 0.4em;
    border-radius: var(--radius-pill);
    background: var(--accent);
    color: var(--accent-contrast);
    font-family: var(--font-mono);
    font-size: 0.66rem;
  }

  .filter-toggle__count[data-count]:not([data-count="0"]) {
    display: inline-flex;
    justify-content: center;
  }

  .filter-backdrop {
    display: none;
  }

  .hub-sort {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    color: var(--muted);
    font-size: var(--text-sm);
  }

  .hub-sort .filter-select {
    width: auto;
    min-width: 11rem;
  }

  .hub-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr));
    gap: var(--space-4);
  }

  .hub-grid .post-card[hidden] {
    display: none;
  }

  .hub-empty {
    display: none;
  }

  .hub-empty[data-visible="true"] {
    display: block;
  }

  .hub-filters__actions {
    display: flex;
    gap: var(--space-2);
    padding-top: var(--space-3);
    border-top: 1px solid var(--rule);
  }

  .hub-active-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2);
    min-height: 2rem;
    color: var(--muted);
    font-size: var(--text-xs);
  }

  .hub-active-filters:empty {
    display: none;
  }

  .hub-active-filter {
    display: inline-flex;
    align-items: center;
    gap: 0.35em;
    padding: 0.2em 0.55em;
    border: 1px solid var(--rule);
    border-radius: var(--radius-pill);
    background: var(--paper-sunken);
    color: var(--ink-soft);
    font-size: var(--text-xs);
  }

  .hub-active-filter button {
    color: var(--muted);
    font-size: 0.9em;
    line-height: 1;
  }

  .hub-active-filter button:hover {
    color: var(--danger);
  }

  .hub-toolbar__left {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-3);
  }

  @media (max-width: 60rem) {
    .hub-layout {
      display: block;
    }

    .hub-page[data-hub-ready="true"] .filter-toggle {
      display: inline-flex;
    }

    .hub-filters {
      position: fixed;
      top: 0;
      bottom: 0;
      left: 0;
      z-index: calc(var(--z-dialog) - 1);
      width: min(22rem, 92vw);
      gap: var(--space-3);
      padding: var(--space-5) var(--space-4) var(--space-8);
      border: 0;
      border-right: 1px solid var(--rule);
      border-radius: 0;
      box-shadow: var(--shadow-lg);
      overflow-y: auto;
      overscroll-behavior: contain;
      transform: translateX(-105%);
      transition: transform var(--duration) var(--ease);
    }

    .hub-filters[data-open="true"] {
      transform: translateX(0);
    }

    .hub-filters[data-enhanced="false"] {
      display: none;
    }

    .filter-close {
      display: grid;
    }

    .filter-backdrop {
      position: fixed;
      inset: 0;
      z-index: calc(var(--z-dialog) - 2);
      display: none;
      background: rgb(0 0 0 / 0.5);
    }

    .filter-backdrop[data-open="true"] {
      display: block;
    }

    .hub-filters__actions .btn {
      flex: 1;
    }
  }

  @media (min-width: 60.0625rem) {
    .hub-layout {
      display: grid;
      grid-template-columns: 17rem minmax(0, 1fr);
      gap: var(--space-7);
      align-items: start;
      padding-top: var(--space-6);
    }

    .hub-filters {
      position: sticky;
      top: calc(var(--header-height) + var(--space-4));
      max-height: calc(100dvh - var(--header-height) - var(--space-6));
      overflow-y: auto;
      overscroll-behavior: contain;
    }

    .hub-toolbar {
      padding-top: 0;
    }
  }

  /* Portada de hub con filtros: cabecera compacta de sección */
  .hub-section-nav {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    padding: 0;
    margin: var(--space-4) 0 0;
    list-style: none;
  }

  .hub-section-nav a {
    display: inline-flex;
    padding: 0.28em 0.62em;
    border: 1px solid var(--rule);
    border-radius: var(--radius-pill);
    background: var(--paper-raised);
    color: var(--ink-soft);
    font-size: var(--text-xs);
    text-decoration: none;
  }

  .hub-section-nav a:hover,
  .hub-section-nav a[aria-current="page"] {
    border-color: var(--accent);
    background: var(--accent-soft);
    color: var(--accent-strong);
  }

  /* Variante de listado compacto para hubs */
  .post-card--row {
    display: grid;
    grid-template-columns: 6.5rem minmax(0, 1fr);
    gap: var(--space-3);
    align-items: start;
  }

  .post-card--row .post-card__media {
    aspect-ratio: 2 / 3;
    margin: 0;
    border: var(--border);
    border-radius: var(--radius-sm);
  }

  .post-card--row .post-card__body {
    gap: var(--space-1);
  }

  .post-card--row .post-card__excerpt {
    -webkit-line-clamp: 2;
  }

  @media (max-width: 30rem) {
    .post-card--row {
      grid-template-columns: 5rem minmax(0, 1fr);
    }
  }
}
