/* Recursos — Design system compartido
   Basado en el rediseño con tema Noche/Papel y tipografía Newsreader. */

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { margin: 0; }

:root {
  --bg: #0a0a0a;
  --band: #0d0d0d;
  --surface: #121212;
  --surface-2: #191919;
  --border: #262626;
  --border-strong: #383838;
  --ink: #F2EDE3;
  --ink-2: #E7E4DD;
  --muted: #8E8A82;
  --faint: #5c5953;
  --accent: #ff5a1f;
  --accent-2: #ff6a33;
  --accent-soft: rgba(255,90,31,.12);
  --blue: #2a2ae8;
  --blue-soft: #6f6ff4;
  --code-bg: #0e0e0e;
  --code-ink: #E7E4DD;
  --info: #6f6ff4;
  --info-bg: rgba(42,42,232,.14);
  --warn: #ff5a1f;
  --warn-bg: rgba(255,90,31,.10);
  --glow: rgba(255,90,31,.22);
}

html[data-theme="paper"] {
  --bg: #F2EDE3;
  --band: #ece5d8;
  --surface: #faf6ee;
  --surface-2: #ffffff;
  --border: #ddd3c2;
  --border-strong: #c4b8a4;
  --ink: #0a0a0a;
  --ink-2: #2c2620;
  --muted: #6f675b;
  --faint: #9b9486;
  --accent: #e24e15;
  --accent-2: #ff5a1f;
  --accent-soft: rgba(226,78,21,.10);
  --blue: #2a2ae8;
  --blue-soft: #2a2ae8;
  --code-bg: #161310;
  --code-ink: #ECE3D8;
  --info: #2a2ae8;
  --info-bg: rgba(42,42,232,.08);
  --warn: #c2410c;
  --warn-bg: rgba(226,78,21,.09);
  --glow: rgba(226,78,21,.13);
}

body {
  font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
img { display: block; max-width: 100%; }
::selection { background: var(--accent); color: #fff; }

/* Logo: blanco en dark, negro en paper */
[data-logo] { filter: brightness(0) invert(1); transition: filter .25s ease; }
html[data-theme="paper"] [data-logo] { filter: brightness(0); }

/* Theme toggle: icono compacto en todas las pantallas */
.theme-toggle { padding: 3px; }
.theme-btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 7px 9px; gap: 0;
}
.theme-btn .theme-icon { display: inline-flex; }
.theme-btn .theme-icon svg { width: 14px; height: 14px; display: block; }
.theme-btn .theme-label { display: none; }

/* ─── Reading progress ─── */
.progress-track {
  position: fixed; top: 0; left: 0; right: 0;
  height: 3px; background: transparent; z-index: 60;
}
.progress-bar {
  height: 100%; width: 0;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width .12s linear;
}

/* ─── Nav ─── */
.r-nav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
  padding: 16px 40px;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.r-nav-logo {
  display: flex; align-items: center; gap: 13px;
}
.r-nav-logo img { height: 26px; width: auto; }
.r-nav-tag {
  font-size: 10px; letter-spacing: .2em; text-transform: uppercase;
  color: var(--faint);
  border-left: 1px solid var(--border); padding-left: 13px;
}
.r-nav-right { display: flex; align-items: center; gap: 18px; }
.theme-toggle {
  display: flex; padding: 4px; gap: 3px;
  border: 1px solid var(--border); border-radius: 999px;
  background: var(--surface);
}
.theme-btn {
  border-radius: 999px;
  border: none; background: transparent;
  color: var(--muted);
  font-size: 12.5px; font-weight: 600; letter-spacing: .04em;
  transition: all .25s ease;
}
.theme-btn.active { background: var(--accent); color: #fff; }
.r-nav-back {
  font-size: 13px; letter-spacing: .04em; color: var(--ink-2);
  display: flex; align-items: center; gap: 7px;
  transition: color .2s ease;
}
.r-nav-back:hover { color: var(--accent); }
.r-nav-back-arrow { font-size: 15px; }

/* ─── Hero ─── */
.r-hero { max-width: 1140px; margin: 0 auto; padding: 64px 40px 8px; }
.r-breadcrumb {
  display: flex; gap: 9px;
  font-size: 11px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 40px;
}
.r-breadcrumb a { color: var(--muted); }
.r-breadcrumb a:hover { color: var(--ink-2); }
.r-breadcrumb-sep { opacity: .5; }
.r-breadcrumb .current { color: var(--ink-2); }

.r-eyebrow {
  display: flex; align-items: center; gap: 10px; margin-bottom: 22px;
}
.r-eyebrow-dot {
  width: 7px; height: 7px; border-radius: 999px;
  background: var(--accent); box-shadow: 0 0 12px var(--glow);
}
.r-eyebrow-text {
  font-size: 12px; letter-spacing: .2em; text-transform: uppercase;
  color: var(--accent); font-weight: 600;
}

.r-hero-title {
  font-family: 'Newsreader', Georgia, 'Times New Roman', serif;
  font-weight: 400;
  font-size: clamp(38px, 6.2vw, 68px);
  line-height: 1.04; letter-spacing: -.03em;
  margin: 0 0 26px; max-width: 16ch;
  color: var(--ink);
}
.r-hero-title em { font-style: italic; color: var(--accent); }

.r-hero-sub {
  font-size: clamp(17px, 2.1vw, 20px); line-height: 1.7;
  color: var(--ink-2); max-width: 60ch; margin: 0 0 36px;
}

.r-hero-actions {
  display: flex; gap: 14px; align-items: center;
  margin-bottom: 30px; flex-wrap: wrap;
}

.r-btn-primary {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 26px; border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff; font-weight: 600; font-size: 14px;
  letter-spacing: .05em; text-transform: uppercase;
  border: none; cursor: pointer;
  box-shadow: 0 12px 34px -10px var(--glow);
  transition: transform .2s ease, box-shadow .2s ease;
  white-space: nowrap; line-height: 1;
}
.r-btn-primary:hover { transform: translateY(-1px); }
.r-btn-primary svg { width: 14px; height: 14px; flex-shrink: 0; }

.r-btn-secondary {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 14px 24px; border-radius: 999px;
  background: transparent;
  border: 1px solid var(--border-strong);
  color: var(--ink); font-weight: 600; font-size: 14px;
  letter-spacing: .05em; text-transform: uppercase;
  cursor: pointer;
  transition: border-color .2s ease, color .2s ease;
  white-space: nowrap; line-height: 1;
}
.r-btn-secondary:hover { border-color: var(--accent); color: var(--accent); }
.r-btn-secondary svg { width: 14px; height: 14px; flex-shrink: 0; }

.r-hero-meta {
  display: flex; align-items: center; gap: 18px;
  font-size: 13px; color: var(--muted); flex-wrap: wrap;
}
.r-hero-meta-pill { display: flex; align-items: center; gap: 7px; }
.r-hero-meta-dot {
  width: 4px; height: 4px; border-radius: 99px;
  background: var(--border-strong);
}
.r-hero-meta-marker { color: var(--accent); }

/* ─── Resumen ─── */
.r-resumen-wrap { max-width: 1140px; margin: 48px auto 0; padding: 0 40px; }
.r-resumen-card {
  border: 1px solid var(--border); border-radius: 22px;
  background: var(--surface); overflow: hidden;
}
.r-resumen-head {
  display: flex; align-items: center; gap: 10px;
  padding: 18px 26px; border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}
.r-resumen-head em {
  font-family: 'Newsreader', Georgia, serif;
  font-style: italic; font-size: 18px; color: var(--accent);
}
.r-resumen-grid {
  display: grid; grid-template-columns: repeat(5, 1fr);
}
.r-resumen-cell {
  padding: 24px;
  border-right: 1px solid var(--border);
}
.r-resumen-cell:last-child { border-right: none; }
.r-resumen-cell.highlight { background: var(--accent-soft); }
.r-resumen-cell svg { color: var(--accent); }
.r-resumen-label {
  font-size: 11px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--muted); margin: 14px 0 5px;
}
.r-resumen-value {
  font-size: 16px; font-weight: 600; color: var(--ink); line-height: 1.3;
}
.r-resumen-value em {
  font-style: normal; color: var(--accent);
}

/* ─── Shell: TOC + article ─── */
.r-shell {
  display: grid; grid-template-columns: 228px minmax(0, 1fr);
  gap: 60px;
  max-width: 1140px; margin: 0 auto;
  padding: 72px 40px 40px;
  align-items: start;
}

.r-toc {
  position: sticky; top: 96px; align-self: start;
}
.r-toc-title {
  font-size: 11px; letter-spacing: .2em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 18px; padding-left: 14px;
}
.r-toc-nav { display: flex; flex-direction: column; gap: 1px; }
.r-toc-btn {
  display: flex; align-items: center; gap: 12px;
  width: 100%; text-align: left; padding: 8px 14px;
  background: transparent; border: none; cursor: pointer;
  border-radius: 9px; transition: background .2s ease;
}
.r-toc-bar {
  width: 3px; height: 15px; border-radius: 99px;
  background: transparent; transition: background .25s ease;
}
.r-toc-num {
  font-size: 11px; font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--muted); transition: color .2s ease;
}
.r-toc-label {
  font-size: 13.5px; color: var(--ink-2);
  font-weight: 500; transition: color .2s ease;
}
.r-toc-btn.active .r-toc-bar { background: var(--accent); }
.r-toc-btn.active .r-toc-num { color: var(--accent); }
.r-toc-btn.active .r-toc-label { color: var(--ink); font-weight: 600; }
.r-toc-btn:hover { background: var(--surface); }

.r-article { min-width: 0; }
.r-section {
  margin-bottom: 76px;
  scroll-margin-top: 96px;
}
.r-section-head {
  display: flex; align-items: center; gap: 11px; margin-bottom: 14px;
}
.r-section-num { color: var(--accent); font-weight: 600; font-size: 13px; }
.r-section-rule { width: 26px; height: 1px; background: var(--border-strong); }
.r-section-tag {
  text-transform: uppercase; letter-spacing: .22em;
  font-size: 12px; color: var(--muted); font-weight: 600;
}
h2.r-h2 {
  font-family: 'Newsreader', Georgia, 'Times New Roman', serif;
  font-weight: 400;
  font-size: clamp(28px, 4vw, 40px);
  line-height: 1.12; letter-spacing: -.022em;
  margin: 0 0 22px; color: var(--ink);
}
h2.r-h2 em { font-style: italic; }
h2.r-h2 em.accent { color: var(--accent); }
.r-p {
  font-size: 17px; line-height: 1.78;
  color: var(--ink-2); max-width: 65ch;
  margin: 0 0 18px;
}
.r-p strong { color: var(--ink); font-weight: 600; }
.r-p:last-child { margin-bottom: 0; }

/* ─── Callouts ─── */
.r-callout {
  display: flex; gap: 15px;
  padding: 18px 20px; border-radius: 16px;
  border: 1px solid var(--border);
  margin: 24px 0;
}
.r-callout-icon {
  flex: none; width: 26px; height: 26px;
  border-radius: 999px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 15px;
}
.r-callout-text {
  margin: 0; font-size: 15px; line-height: 1.65; color: var(--ink-2);
}
.r-callout-text strong { color: var(--ink); font-weight: 600; }
.r-callout.warn {
  background: var(--warn-bg);
  border-left: 3px solid var(--warn);
}
.r-callout.warn .r-callout-icon { background: var(--warn); color: #fff; }
.r-callout.info {
  background: var(--info-bg);
  border-left: 3px solid var(--info);
}
.r-callout.info .r-callout-icon {
  background: transparent; border: 1.5px solid var(--info);
  color: var(--info); font-style: italic; font-weight: 700; font-size: 13px;
}
.r-callout.shortcut {
  padding: 18px 20px; border-radius: 16px;
  background: var(--accent-soft); border: 1px solid var(--border);
  display: flex; gap: 14px; margin-bottom: 34px;
}
.r-callout.shortcut .r-callout-icon {
  width: auto; height: auto; background: transparent; font-size: 18px;
}
.r-callout.shortcut a {
  color: var(--accent); border-bottom: 1px solid var(--accent-soft);
}
.r-callout.shortcut a:hover { border-bottom-color: var(--accent); }

/* ─── Cases ─── */
.r-cases {
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px;
}
.r-case {
  display: flex; gap: 14px;
  padding: 20px; border: 1px solid var(--border);
  border-radius: 16px; background: var(--surface);
}
.r-case-icon {
  flex: none; width: 34px; height: 34px;
  border-radius: 10px;
  background: var(--accent-soft); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
}
.r-case-icon svg { width: 18px; height: 18px; }
.r-case-text {
  margin: 0; font-size: 15px; line-height: 1.6; color: var(--ink-2);
}
.r-case-text strong { color: var(--ink); font-weight: 600; }
.r-case.full { grid-column: 1 / -1; }

/* ─── Checklist ─── */
.r-check-card {
  border: 1px solid var(--border); border-radius: 18px;
  background: var(--surface); overflow: hidden;
}
.r-check-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 22px; border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}
.r-check-head-label {
  font-size: 12px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--muted);
}
.r-check-count {
  font-size: 12px; font-weight: 600; letter-spacing: .04em;
  color: var(--muted); transition: color .2s ease;
}
.r-check-count.done { color: var(--accent); }
.r-check-item {
  display: flex; align-items: flex-start; gap: 14px;
  width: 100%; text-align: left;
  padding: 16px 22px;
  background: transparent; border: none;
  border-top: 1px solid var(--border);
  cursor: pointer;
  transition: background .2s ease;
}
.r-check-item:first-of-type { border-top: none; }
.r-check-item.on { background: var(--accent-soft); }
.r-check-box {
  flex: none; width: 22px; height: 22px;
  border-radius: 7px; margin-top: 1px;
  display: flex; align-items: center; justify-content: center;
  border: 1.5px solid var(--border-strong);
  background: transparent;
  transition: all .2s ease;
}
.r-check-item.on .r-check-box {
  border: none; background: var(--accent);
}
.r-check-tick {
  opacity: 0; transition: opacity .15s ease;
}
.r-check-item.on .r-check-tick { opacity: 1; }
.r-check-text {
  font-size: 15px; line-height: 1.6; color: var(--ink-2);
}
.r-check-item.on .r-check-text { color: var(--ink); }

/* ─── Steps ─── */
.r-steps { display: flex; flex-direction: column; gap: 14px; }
.r-step {
  display: grid; grid-template-columns: auto 1fr; gap: 28px;
  padding: 26px;
  border: 1px solid var(--border); border-radius: 18px;
  background: var(--surface);
}
.r-step-num {
  font-family: 'Newsreader', Georgia, serif;
  font-size: 50px; line-height: .8;
  color: var(--accent); font-weight: 400;
}
.r-step h3 {
  margin: 0 0 10px;
  font-size: 19px; font-weight: 600; color: var(--ink);
}
.r-step p {
  margin: 0; font-size: 16px; line-height: 1.7; color: var(--ink-2);
}
.r-step p + p { margin-top: 14px; }
.r-step strong { color: var(--ink); font-weight: 600; }
.r-step a {
  color: var(--accent);
  border-bottom: 1px solid transparent;
  transition: border-color .2s ease;
}
.r-step a:hover { border-bottom-color: var(--accent); }
.r-step .r-callout { margin: 14px 0 0; padding: 14px 16px; border-radius: 13px; }
.r-step .r-callout-icon { width: 22px; height: 22px; font-size: 13px; }
.r-step .r-callout-text { font-size: 14px; line-height: 1.6; }

.r-role-card {
  padding: 16px 18px; border-radius: 13px;
  border: 1px solid var(--border);
  background: var(--surface-2); margin-bottom: 12px;
}
.r-role-card.primary { border-color: var(--border-strong); }
.r-role-head {
  display: flex; align-items: center; gap: 9px; margin-bottom: 6px;
}
.r-role-dot { width: 8px; height: 8px; border-radius: 999px; background: var(--muted); }
.r-role-card.primary .r-role-dot { background: var(--accent); }
.r-role-card strong { color: var(--ink); font-weight: 700; font-size: 15px; }
.r-role-pill {
  font-size: 11px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--accent); background: var(--accent-soft);
  padding: 2px 8px; border-radius: 99px;
}
.r-role-card p {
  margin: 0; font-size: 14px; line-height: 1.6; color: var(--ink-2);
}

.r-perm-card {
  padding: 14px 16px; border: 1px solid var(--border);
  border-radius: 12px; background: var(--surface-2);
  margin-bottom: 10px;
}
.r-perm-card strong { color: var(--ink); font-weight: 600; font-size: 15px; }
.r-perm-card span.desc { color: var(--ink-2); font-size: 14px; }

/* ─── Roles grid (sección Roles) ─── */
.r-roles-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
}
.r-roles-grid-tag {
  font-size: 12px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 14px;
}
.r-roles-card {
  padding: 18px; border: 1px solid var(--border);
  border-radius: 14px; background: var(--surface);
}
.r-roles-card strong { color: var(--ink); font-weight: 600; font-size: 15px; }
.r-roles-card p { margin: 7px 0 0; font-size: 14px; line-height: 1.6; color: var(--ink-2); }

/* ─── Errores (accordion) ─── */
.r-errors { display: flex; flex-direction: column; gap: 12px; }
.r-err {
  border: 1px solid var(--border); border-radius: 15px;
  background: var(--surface); overflow: hidden;
  transition: border-color .2s ease;
}
.r-err.open { border-color: var(--border-strong); }
.r-err-btn {
  display: flex; align-items: center; gap: 16px;
  width: 100%; text-align: left;
  padding: 20px 22px;
  background: transparent; border: none; cursor: pointer;
}
.r-err-num {
  flex: none; width: 30px; height: 30px;
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Newsreader', Georgia, serif; font-size: 15px;
  background: var(--accent-soft); color: var(--accent);
  transition: all .2s ease;
}
.r-err.open .r-err-num { background: var(--accent); color: #fff; }
.r-err-title {
  flex: 1; font-size: 16px; font-weight: 600;
  color: var(--ink); line-height: 1.4;
}
.r-err-chev {
  flex: none; color: var(--muted);
  display: flex;
  transition: transform .25s ease;
}
.r-err.open .r-err-chev { transform: rotate(180deg); }
.r-err-body {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows .28s ease;
}
.r-err.open .r-err-body { grid-template-rows: 1fr; }
.r-err-body-inner { overflow: hidden; }
.r-err-body p {
  margin: 0; padding: 0 22px 22px 60px;
  font-size: 15px; line-height: 1.7; color: var(--ink-2);
}
.r-err-body strong { color: var(--accent); font-weight: 600; }

/* ─── Capturas placeholder ─── */
.r-cap-placeholder {
  border: 1.5px dashed var(--border-strong);
  border-radius: 20px; background: var(--surface);
  padding: 48px 32px; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 14px;
}
.r-cap-icon {
  width: 52px; height: 52px; border-radius: 14px;
  background: var(--accent-soft); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
}
.r-cap-title {
  font-family: 'Newsreader', Georgia, serif;
  font-style: italic; font-size: 21px; color: var(--ink);
}
.r-cap-text {
  margin: 0; max-width: 48ch;
  font-size: 15px; line-height: 1.65; color: var(--ink-2);
}

/* ─── Message panel (mac window) ─── */
.r-msg-tabs { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.r-msg-tab {
  padding: 10px 18px; border-radius: 11px;
  background: var(--surface); color: var(--ink-2);
  border: 1px solid var(--border);
  font-size: 14px; font-weight: 600;
  transition: all .2s ease;
}
.r-msg-tab.active {
  background: var(--accent-soft); color: var(--accent);
  border-color: var(--accent);
}
.r-msg-window {
  border: 1px solid var(--border); border-radius: 16px;
  overflow: hidden; background: var(--code-bg);
}
.r-msg-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--code-bg) 70%, #000);
}
.r-msg-dots { display: flex; gap: 7px; }
.r-msg-dot { width: 11px; height: 11px; border-radius: 99px; }
.r-msg-dot.red { background: #ff5f57; }
.r-msg-dot.yellow { background: #febc2e; }
.r-msg-dot.green { background: #28c840; }
.r-msg-copy {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 14px; border-radius: 8px;
  border: 1px solid var(--border-strong);
  background: transparent; color: var(--code-ink);
  font-size: 12.5px; font-weight: 600; letter-spacing: .03em;
  transition: all .2s ease;
}
.r-msg-copy.ok {
  border-color: var(--accent);
  background: var(--accent-soft); color: var(--accent);
}
.r-msg-pre {
  margin: 0; padding: 24px 22px;
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: 13.5px; line-height: 1.75;
  color: var(--code-ink);
  white-space: pre-wrap; word-break: break-word; overflow-x: auto;
}
.r-msg-hint { font-size: 14px; color: var(--muted); margin: 14px 0 0; }

/* ─── Resource links ─── */
.r-reslist { display: flex; flex-direction: column; gap: 10px; margin-bottom: 40px; }
.r-reslist h3 {
  font-family: 'Newsreader', Georgia, serif;
  font-weight: 400; font-size: 24px;
  margin: 0 0 18px; color: var(--ink);
}
.r-reslink {
  display: flex; align-items: center; gap: 16px;
  padding: 18px 20px;
  border: 1px solid var(--border); border-radius: 14px;
  background: var(--surface);
  transition: border-color .2s ease;
}
.r-reslink:hover { border-color: var(--accent); }
.r-reslink.disabled {
  opacity: .6;
  pointer-events: none;
}
.r-restag {
  font-size: 10px; letter-spacing: .14em; text-transform: uppercase;
  font-weight: 600;
  padding: 4px 9px; border-radius: 99px;
  background: var(--accent-soft); color: var(--accent);
}
.r-restag.muted {
  background: var(--surface-2); color: var(--ink-2);
  border: 1px solid var(--border);
}
.r-restag.soon {
  background: var(--surface-2); color: var(--muted);
  border: 1px solid var(--border);
}
.r-restext {
  flex: 1; font-size: 15px; color: var(--ink); font-weight: 500;
}
.r-reslink.disabled .r-restext { color: var(--ink-2); }
.r-resarrow { color: var(--muted); font-size: 16px; }

/* ─── CTA ─── */
.r-cta {
  position: relative;
  border: 1px solid var(--border); border-radius: 24px;
  background: var(--surface); overflow: hidden;
  padding: 48px 40px; text-align: center;
}
.r-cta::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(120% 90% at 50% 120%, var(--glow), transparent 70%);
  pointer-events: none;
}
.r-cta-inner { position: relative; }
.r-cta-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  margin-bottom: 18px;
}
.r-cta-eyebrow span:first-child {
  width: 7px; height: 7px; border-radius: 99px;
  background: var(--accent); box-shadow: 0 0 12px var(--glow);
}
.r-cta-eyebrow span:last-child {
  font-size: 11px; letter-spacing: .2em; text-transform: uppercase;
  color: var(--accent); font-weight: 600;
}
.r-cta h2 {
  font-family: 'Newsreader', Georgia, serif; font-weight: 400;
  font-size: clamp(26px, 4vw, 38px); line-height: 1.15;
  margin: 0 auto 16px; max-width: 20ch; color: var(--ink);
}
.r-cta h2 em { font-style: italic; color: var(--accent); }
.r-cta p {
  font-size: 16px; line-height: 1.7; color: var(--ink-2);
  max-width: 52ch; margin: 0 auto 30px;
}
.r-cta-actions {
  display: flex; gap: 13px; justify-content: center; flex-wrap: wrap;
}

/* ─── Footer ─── */
.r-foot {
  border-top: 1px solid var(--border); margin-top: 40px;
}
.r-foot-inner {
  max-width: 1140px; margin: 0 auto;
  padding: 30px 40px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
}
.r-foot p { font-size: 13px; color: var(--muted); margin: 0; }
.r-foot a {
  font-size: 13px; color: var(--ink-2); transition: color .2s ease;
}
.r-foot a:hover { color: var(--accent); }

/* ─── Mobile ─── */
@media (max-width: 920px) {
  .r-shell { grid-template-columns: 1fr !important; gap: 0 !important; }
  .r-toc { display: none !important; }
  .r-hero { padding-left: 22px !important; padding-right: 22px !important; }
  .r-resumen-wrap { padding-left: 22px !important; padding-right: 22px !important; }
  .r-shell { padding-left: 22px !important; padding-right: 22px !important; }
  .r-nav { padding-left: 22px !important; padding-right: 22px !important; }
  .r-foot-inner { padding-left: 22px !important; padding-right: 22px !important; }
  .r-hero-actions { flex-wrap: wrap; }
  .r-resumen-grid { grid-template-columns: 1fr 1fr !important; }
  .r-resumen-cell { border-right: none; border-bottom: 1px solid var(--border); }
  .r-resumen-cell:nth-child(odd) { border-right: 1px solid var(--border); }
  .r-resumen-cell:nth-last-child(-n+1) { border-bottom: none; }
  .r-step { grid-template-columns: 1fr !important; gap: 8px !important; }
  .r-step-num { font-size: 38px !important; }
  .r-cases { grid-template-columns: 1fr; }
  .r-case.full { grid-column: auto; }
  .r-roles-grid { grid-template-columns: 1fr; }
  .r-nav-back span:not(.r-nav-back-arrow) { display: none; }
}
@media (max-width: 560px) {
  .r-resumen-grid { grid-template-columns: 1fr !important; }
  .r-resumen-cell { border-right: none !important; }
  .r-err-body p { padding-left: 22px; padding-right: 22px; }
  .r-cta { padding: 36px 24px; }
}

/* ─── Biblioteca (dashboard /recursos/) ─── */
.r-lib-hero { max-width: 1180px; margin: 0 auto; padding: 64px 40px 0; }
.r-lib-hero h1 {
  font-family: 'Newsreader', Georgia, serif; font-weight: 400;
  font-size: clamp(40px, 6.4vw, 76px);
  line-height: 1.02; letter-spacing: -.03em;
  margin: 0 0 24px; color: var(--ink);
}
.r-lib-hero h1 em { font-style: italic; color: var(--accent); }
.r-lib-hero p.r-lib-sub {
  font-size: clamp(17px, 2vw, 20px); line-height: 1.65;
  color: var(--ink-2); max-width: 62ch; margin: 0 0 30px;
}
.r-lib-stats {
  display: flex; align-items: center; gap: 18px;
  font-size: 13px; color: var(--muted); flex-wrap: wrap;
}
.r-lib-stats-item { display: flex; align-items: center; gap: 8px; }
.r-lib-stats-num {
  font-family: 'Newsreader', Georgia, serif;
  font-size: 19px; color: var(--ink); font-weight: 400;
}
.r-lib-stats-dot {
  width: 4px; height: 4px; border-radius: 99px; background: var(--border-strong);
}
.r-lib-stats-marker { color: var(--accent); }

.r-lib-banner-wrap { max-width: 1180px; margin: 40px auto 0; padding: 0 40px; }
.r-lib-banner {
  display: flex; gap: 15px;
  padding: 18px 22px; border-radius: 14px;
  background: var(--info-bg);
  border: 1px solid var(--border);
  border-left: 3px solid var(--blue-soft);
}
.r-lib-banner-icon { flex: none; font-size: 18px; }
.r-lib-banner p {
  margin: 0; font-size: 14.5px; line-height: 1.6; color: var(--ink-2);
}
.r-lib-banner p strong { color: var(--ink); font-weight: 600; }

.r-lib-filterbar-wrap {
  position: sticky; top: 65px; z-index: 40;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  margin-top: 40px;
}
.r-lib-filterbar {
  max-width: 1180px; margin: 0 auto;
  padding: 16px 40px;
  display: flex; align-items: center; gap: 18px;
  justify-content: space-between; flex-wrap: wrap;
}
.r-lib-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.r-lib-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 15px; border-radius: 999px;
  cursor: pointer; font-family: inherit;
  font-size: 13px; font-weight: 600; letter-spacing: .02em;
  border: 1px solid var(--border);
  background: var(--surface); color: var(--ink-2);
  transition: all .2s ease;
  white-space: nowrap;
}
.r-lib-chip:hover { color: var(--ink); border-color: var(--border-strong); }
.r-lib-chip.active {
  background: var(--accent); color: #fff; border-color: transparent;
}
.r-lib-chip .count { opacity: .55; font-weight: 600; }
.r-lib-search {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 15px;
  border: 1px solid var(--border); border-radius: 999px;
  background: var(--surface);
  min-width: 210px;
}
.r-lib-search svg { color: var(--muted); flex: none; }
.r-lib-search input {
  border: none; background: transparent; outline: none;
  color: var(--ink); font-family: inherit; font-size: 13.5px;
  width: 100%;
}
.r-lib-search input::placeholder { color: var(--muted); }

.r-lib-grid-wrap { max-width: 1180px; margin: 0 auto; padding: 34px 40px 20px; }
.r-lib-count-row {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 22px;
}
.r-lib-count {
  font-size: 12px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--faint);
}
.r-lib-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px;
}
.r-lib-card {
  display: flex; flex-direction: column;
  padding: 24px;
  border: 1px solid var(--border); border-radius: 14px;
  background: var(--surface);
  transition: border-color .2s ease, transform .2s ease;
  cursor: pointer;
}
.r-lib-card:hover { border-color: var(--accent); transform: translateY(-1px); }
.r-lib-card.feat { border-color: var(--accent); }
.r-lib-card.soon {
  opacity: .66; cursor: default;
}
.r-lib-card.soon:hover { border-color: var(--border); transform: none; }
.r-lib-card[hidden] { display: none !important; }
.r-lib-card-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin-bottom: 16px;
}
.r-lib-cat {
  flex: none;
  font-size: 10px; font-weight: 700; letter-spacing: .14em;
  text-transform: uppercase; color: var(--accent);
}
.r-lib-status {
  flex: none;
  font-size: 10px; font-weight: 600; letter-spacing: .12em;
  text-transform: uppercase;
}
.r-lib-status.pub {
  padding: 4px 10px; border-radius: 999px;
  border: 1px solid var(--border-strong); color: var(--blue-soft);
}
.r-lib-status.feat {
  padding: 4px 10px; border-radius: 999px;
  background: var(--accent); color: #fff; font-weight: 700;
}
.r-lib-status.soon { color: var(--faint); }
.r-lib-card h3 {
  font-family: 'Newsreader', Georgia, serif;
  font-weight: 400; font-size: 19px;
  line-height: 1.2; letter-spacing: -.01em;
  margin: 0 0 10px; color: var(--ink);
}
.r-lib-card.soon h3 { color: var(--ink-2); }
.r-lib-card p.desc {
  font-size: 13.5px; line-height: 1.6;
  color: var(--muted); margin: 0 0 22px; flex: 1;
}
.r-lib-card-foot {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 15px; border-top: 1px solid var(--border);
}
.r-lib-card-meta {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; color: var(--muted);
}
.r-lib-card-meta-icon { color: var(--accent); }
.r-lib-card-meta-dot {
  width: 3px; height: 3px; border-radius: 99px; background: var(--border-strong);
}
.r-lib-card-arrow {
  font-size: 15px; color: var(--accent);
  transition: transform .2s ease;
}
.r-lib-card.soon .r-lib-card-arrow { color: transparent; }
.r-lib-card:hover:not(.soon) .r-lib-card-arrow { transform: translateX(3px); }

.r-lib-empty {
  padding: 48px 0; text-align: center;
  color: var(--muted); font-size: 15px;
  font-family: 'Newsreader', Georgia, serif;
  font-style: italic;
}

.r-lib-cta-wrap { max-width: 1180px; margin: 40px auto 0; padding: 0 40px 80px; }
.r-lib-foot { border-top: 1px solid var(--border); }
.r-lib-foot-inner {
  max-width: 1180px; margin: 0 auto;
  padding: 30px 40px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
}
.r-lib-foot p { font-size: 13px; color: var(--muted); margin: 0; }
.r-lib-foot a { font-size: 13px; color: var(--ink-2); transition: color .2s ease; }
.r-lib-foot a:hover { color: var(--accent); }

@media (max-width: 960px) {
  .r-lib-grid { grid-template-columns: 1fr 1fr !important; }
  .r-lib-hero, .r-lib-banner-wrap, .r-lib-grid-wrap, .r-lib-cta-wrap, .r-lib-foot-inner {
    padding-left: 22px !important; padding-right: 22px !important;
  }
  .r-lib-filterbar { padding-left: 22px !important; padding-right: 22px !important; }
}
@media (max-width: 640px) {
  .r-lib-grid { grid-template-columns: 1fr !important; }
  .r-lib-filterbar { flex-direction: column; align-items: stretch; }
  .r-lib-search { width: 100%; }
}

/* ─── Paso 0 badge (hero) ─── */
.r-paso0-badge {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10.5px; letter-spacing: .18em; text-transform: uppercase;
  background: linear-gradient(135deg, var(--accent-soft), rgba(42,42,232,.14));
  border: 1px solid rgba(255,90,31,.36);
  color: var(--ink);
  padding: 7px 14px; border-radius: 999px;
  margin-bottom: 18px; font-weight: 700;
}
.r-paso0-badge::before {
  content: '★'; color: var(--accent); font-size: 12px;
}

/* ─── Captures (con lightbox) ─── */
.r-captures {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px; margin-top: 6px;
}
.r-cap {
  position: relative;
  border: 1px solid var(--border); border-radius: 16px;
  overflow: hidden; background: var(--surface);
  cursor: zoom-in;
  transition: border-color .2s ease, transform .2s ease;
}
.r-cap:hover { border-color: var(--accent); transform: translateY(-2px); }
.r-cap img {
  display: block; width: 100%; height: auto;
  aspect-ratio: 16 / 10; object-fit: cover; object-position: top;
}
.r-cap-foot {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  background: var(--surface-2);
  border-top: 1px solid var(--border);
  font-size: 12px;
}
.r-cap-num {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10.5px; letter-spacing: .12em;
  color: var(--accent); font-weight: 700;
}
.r-cap-label { color: var(--ink-2); }

/* ─── Lightbox ─── */
.r-lightbox {
  position: fixed; inset: 0; z-index: 999;
  background: color-mix(in srgb, var(--bg) 94%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  display: none; align-items: center; justify-content: center;
  padding: 24px;
  opacity: 0; transition: opacity .2s ease;
}
.r-lightbox.open { display: flex; opacity: 1; }
.r-lightbox-content {
  display: flex; flex-direction: column; gap: 18px;
  max-width: min(1080px, 100%);
  max-height: 100%; width: 100%;
  align-items: center;
}
.r-lightbox-header {
  width: 100%; text-align: center;
  display: flex; flex-direction: column; gap: 8px;
  padding: 0 60px;
}
.r-lightbox-step {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px; letter-spacing: .18em; text-transform: uppercase;
  color: var(--accent); font-weight: 600;
}
.r-lightbox-title {
  font-family: 'Newsreader', Georgia, serif;
  font-weight: 400; font-size: clamp(20px, 3vw, 26px);
  line-height: 1.2; letter-spacing: -.015em;
  margin: 0; color: var(--ink);
}
.r-lightbox-hint {
  font-size: 13.5px; line-height: 1.5;
  color: var(--ink-2); margin: 0;
  max-width: 640px; margin-left: auto; margin-right: auto;
}
.r-lightbox img {
  max-width: 100%; max-height: calc(100vh - 260px);
  border-radius: 10px;
  box-shadow: 0 24px 80px rgba(0,0,0,0.6);
  object-fit: contain;
}
.r-lightbox-footer {
  display: flex; align-items: center; justify-content: center;
  gap: 22px; width: 100%;
}
.r-lightbox-counter {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 12px; letter-spacing: .14em;
  color: var(--ink); opacity: .7;
  min-width: 56px; text-align: center;
}
.r-lightbox-close,
.r-lightbox-nav {
  background: color-mix(in srgb, var(--surface) 60%, transparent);
  color: var(--ink);
  border: 1px solid var(--border-strong);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .2s ease, border-color .2s ease, transform .2s ease;
}
.r-lightbox-close {
  position: absolute; z-index: 2;
  top: 18px; right: 18px;
  width: 42px; height: 42px; border-radius: 50%;
  font-size: 18px;
}
.r-lightbox-close:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.r-lightbox-nav {
  width: 48px; height: 48px; border-radius: 50%;
  font-size: 24px; font-weight: 500;
}
.r-lightbox-nav:hover { background: var(--accent); border-color: var(--accent); color: #fff; }

@media (min-width: 721px) {
  .r-lightbox-nav {
    position: absolute; z-index: 2;
    top: 50%; transform: translateY(-50%);
  }
  .r-lightbox-nav.prev { left: 24px; }
  .r-lightbox-nav.next { right: 24px; }
  .r-lightbox-nav:hover { transform: translateY(-50%) scale(1.06); }
}

@media (max-width: 720px) {
  .r-lightbox { padding: 16px 12px; }
  .r-lightbox-content { gap: 14px; }
  .r-lightbox-header { padding: 0 50px; gap: 5px; }
  .r-lightbox-title { font-size: 17px; }
  .r-lightbox-hint { font-size: 12.5px; }
  .r-lightbox img { max-height: calc(100vh - 260px); }
  .r-lightbox-close { top: 10px; right: 10px; width: 36px; height: 36px; font-size: 16px; }
  .r-lightbox-footer { gap: 18px; padding-top: 4px; }
  .r-lightbox-nav {
    width: 46px; height: 46px; font-size: 22px;
    background: var(--accent-soft);
    border-color: var(--accent);
    color: var(--accent);
    box-shadow: 0 4px 14px rgba(0,0,0,0.4);
  }
}

/* ─── Checklist por bloques (info para Meta Ads) ─── */
.r-block-section {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; padding: 26px 28px; margin-bottom: 14px;
}
.r-block-section h3 {
  font-family: 'Newsreader', Georgia, serif; font-weight: 400;
  font-size: 21px; line-height: 1.2;
  letter-spacing: -.015em; margin: 0 0 6px; color: var(--ink);
}
.r-block-section .r-block-sub {
  font-size: 12px; color: var(--muted);
  margin-bottom: 16px; letter-spacing: .14em;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  text-transform: uppercase;
}
.r-block-section ul {
  list-style: none; margin: 0; padding: 0; display: grid; gap: 8px;
}
.r-block-section ul li {
  display: flex; align-items: flex-start; gap: 10px;
  font-size: 15px; color: var(--ink-2); line-height: 1.6;
}
.r-block-section ul li::before {
  content: '◇'; color: var(--accent); flex-shrink: 0;
  font-size: 14px; margin-top: 2px; opacity: .7;
}
.r-block-section ul li strong { color: var(--ink); font-weight: 600; }

/* ─── Tabla de roles ─── */
.r-roles-table-wrap {
  border: 1px solid var(--border); border-radius: 16px;
  overflow: hidden; background: var(--surface);
  margin-bottom: 6px;
}
table.r-roles-table {
  width: 100%; border-collapse: collapse; font-size: 14.5px;
}
table.r-roles-table thead {
  background: var(--surface-2);
}
table.r-roles-table th {
  text-align: left; font-weight: 600;
  font-size: 11px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--muted);
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
}
table.r-roles-table td {
  padding: 18px 20px; vertical-align: top;
  border-bottom: 1px solid var(--border);
  color: var(--ink-2); line-height: 1.55;
}
table.r-roles-table tbody tr:last-child td { border-bottom: none; }
table.r-roles-table td.r-role-name {
  font-weight: 600; color: var(--ink); white-space: nowrap;
}
table.r-roles-table tr.recommended {
  background: var(--accent-soft);
}
table.r-roles-table tr.recommended td.r-role-name {
  color: var(--accent);
}
.r-role-pill-inline {
  display: inline-flex; align-items: center;
  font-size: 10px; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase;
  padding: 4px 10px; border-radius: 999px;
  white-space: nowrap;
}
.r-role-pill-inline.go {
  background: var(--accent); color: #fff;
}
.r-role-pill-inline.warn {
  background: rgba(232,192,99,.16);
  color: #E8C063;
  border: 1px solid rgba(232,192,99,.3);
}
.r-role-pill-inline.no {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border-strong);
}

@media (max-width: 720px) {
  table.r-roles-table, table.r-roles-table thead, table.r-roles-table tbody,
  table.r-roles-table tr, table.r-roles-table td { display: block; width: 100%; }
  table.r-roles-table thead { display: none; }
  table.r-roles-table tr {
    padding: 16px 18px;
    border-bottom: 1px solid var(--border);
  }
  table.r-roles-table tr.recommended {
    background: var(--accent-soft);
  }
  table.r-roles-table tr:last-child { border-bottom: none; }
  table.r-roles-table td {
    border: none; padding: 6px 0;
    font-size: 14px;
    display: flex; gap: 10px; align-items: baseline;
  }
  table.r-roles-table td::before {
    content: attr(data-label);
    flex-shrink: 0; min-width: 95px;
    font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase;
    color: var(--muted); font-weight: 600;
  }
  table.r-roles-table td.r-role-name {
    font-size: 16px; padding-bottom: 10px; margin-bottom: 6px;
    border-bottom: 1px solid var(--border);
    white-space: normal;
  }
  table.r-roles-table td.r-role-name::before { display: none; }
}
