:root {
  color-scheme: dark;
  --bg: #111019;
  --surface: #191722;
  --text: #f3f0fa;
  --muted: #b8b2c8;
  --accent: #c6a5ff;
  --border: #34303f;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 104px; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.7 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
a { color: var(--accent); text-underline-offset: 4px; }
button, input { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid #d1b5ff; outline-offset: 5px; }
.skip-link { position: fixed; top: 12px; left: 16px; padding: 10px 18px; background: var(--surface); border: 1px solid var(--accent); border-radius: 8px; z-index: 20; transform: translateY(-160%); }
.skip-link:focus { transform: none; }
.site-header { position: sticky; top: 0; z-index: 5; background: rgba(17,16,25,.96); border-bottom: 1px solid var(--border); }
.header-inner { max-width: 1320px; padding: 20px 32px; margin: auto; display: flex; align-items: center; gap: 26px; }
.brand { color: var(--text); display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-size: 21px; font-weight: 750; letter-spacing: -.6px; }
.brand img { border-radius: 7px; }
.header-label { color: var(--muted); font-size: 14px; padding-left: 24px; border-left: 1px solid var(--border); }
.studio-link { margin-left: auto; font-size: 14px; font-weight: 600; text-decoration: none; }
.studio-link span { margin-left: 8px; }
.layout { max-width: 1320px; margin: 0 auto; padding: 44px 32px 0; display: grid; grid-template-columns: 260px minmax(0,1fr); gap: 64px; align-items: start; }
.sidebar { position: sticky; top: 114px; max-height: calc(100dvh - 136px); overflow-y: auto; scrollbar-width: thin; scrollbar-color: #59456e transparent; padding: 0 8px 12px 0; }
.search { margin-bottom: 22px; }
.search label { display: block; color: var(--muted); font-size: 13px; margin-bottom: 8px; }
.search-input { display: flex; align-items: center; gap: 9px; border: 1px solid #53485f; background: var(--surface); border-radius: 10px; padding: 10px 11px; }
.search-input:focus-within { border-color: var(--accent); }
.search-input svg { width: 18px; height: 18px; flex: 0 0 auto; fill: none; stroke: var(--muted); stroke-width: 1.7; }
.search input { min-width: 0; width: 100%; color: var(--text); border: 0; background: transparent; outline: none; font-size: 14px; }
.search input::placeholder { color: #a49aac; }
.search input::-webkit-search-cancel-button { display: none; }
.search button { flex: 0 0 26px; border: 0; background: #393044; color: var(--text); border-radius: 5px; line-height: 26px; padding: 0; }
.search-status { min-height: 20px; margin: 7px 0 0; color: var(--muted); font-size: 12px; }
.topics summary { display: none; }
.nav-group { margin-bottom: 24px; }
.nav-group h3 { text-transform: uppercase; letter-spacing: 1.3px; color: #998faa; font-size: 10px; margin: 0 0 8px 10px; }
.nav-group a { display: block; text-decoration: none; color: var(--muted); font-size: 13px; line-height: 1.5; padding: 9px 11px; border-radius: 8px; margin: 2px 0; border-left: 2px solid transparent; }
.nav-group a:hover { color: var(--text); background: #211d2b; }
.nav-group a[aria-current="location"] { color: #ede3ff; background: #30233f; border-left-color: var(--accent); }
.sidebar-footer { color: #aaa0b7; font-size: 11px; border-top: 1px solid var(--border); padding: 20px 10px 0; }
main { min-width: 0; }
.hero { position: relative; padding: 13px 0 46px; border-bottom: 1px solid var(--border); }
.hero::before { content: ""; pointer-events: none; position: absolute; top: -40px; right: 0; width: min(440px,100%); height: 320px; background: radial-gradient(ellipse, #39204d44, transparent 68%); z-index: -1; }
.eyebrow { margin: 0 0 16px; color: var(--accent); letter-spacing: 1.6px; text-transform: uppercase; font-size: 11px; font-weight: 700; }
h1 { font-size: clamp(34px,3.7vw,52px); line-height: 1.13; letter-spacing: -1.9px; margin: 0 0 23px; max-width: 780px; }
.hero-copy { max-width: 690px; color: var(--muted); font-size: 17px; margin: 0; }
.hero-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 24px; margin: 28px 0 32px; }
.button { display: inline-flex; align-items: center; gap: 18px; border-radius: 9px; background: #c6a5ff; color: #21152e; padding: 12px 18px; font-size: 14px; font-weight: 700; text-decoration: none; }
.button:hover { background: #d7beff; }
.text-link { color: var(--muted); font-size: 14px; }
.journey { display: grid; grid-template-columns: repeat(3,1fr); gap: 18px; }
.journey > div { padding: 18px 16px; border: 1px solid var(--border); border-radius: 12px; background: #191520; }
.journey span { display: block; color: #a78bc7; font-size: 11px; letter-spacing: 1px; margin-bottom: 8px; }
.journey strong { font-size: 14px; }
.journey p { font-size: 12px; color: var(--muted); line-height: 1.5; margin: 6px 0 0; }
.article { padding: 42px 0; border-bottom: 1px solid var(--border); scroll-margin-top: 0; }
.article-heading { display: flex; align-items: flex-start; gap: 18px; margin-bottom: 24px; }
.chapter { border: 1px solid #514261; border-radius: 10px; min-width: 39px; height: 39px; display: grid; place-items: center; color: var(--accent); font-size: 12px; margin-top: 4px; }
.article .eyebrow { font-size: 10px; letter-spacing: 1.1px; color: #a79ab9; margin: 0 0 5px; }
h2 { font-size: clamp(23px,2.4vw,29px); line-height: 1.25; letter-spacing: -.7px; margin: 0 0 10px; }
.summary { color: var(--muted); font-size: 14px; margin: 0; }
.article > p, .article > ol, .article > ul { color: #d1cbdc; margin: 18px 0; }
.article li { padding-left: 5px; margin: 9px 0; }
.article ol, .article ul { padding-left: 23px; }
.article li::marker { color: var(--accent); font-weight: 600; }
.callout { border-left: 3px solid #a782d1; background: #221b2c; border-radius: 0 10px 10px 0; padding: 18px 22px; margin: 26px 0; }
.callout strong { font-size: 14px; color: #ebdbff; }
.callout p { margin: 8px 0 0; color: #c8bed5; font-size: 14px; }
.back-link { display: inline-block; margin-top: 10px; font-size: 12px; color: #b8a0d4; }
.table-wrap { width: 100%; overflow-x: auto; border: 1px solid var(--border); border-radius: 10px; margin: 25px 0; }
table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 390px; text-align: left; }
th, td { padding: 13px 16px; border-bottom: 1px solid var(--border); vertical-align: top; }
thead th { background: #211b2a; color: #e9dafa; font-weight: 650; }
tbody th { color: #ded7e9; font-weight: 550; }
td { color: #bfb6ce; }
tbody tr:last-child th, tbody tr:last-child td { border-bottom: 0; }
.empty-state { margin: 32px 0; padding: 30px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.empty-state p { color: var(--muted); }
.empty-state button { background: var(--accent); border: 0; border-radius: 8px; padding: 9px 14px; color: #21152e; font-weight: 600; }
.page-footer { padding: 30px 0 40px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; color: #a79ab9; font-size: 12px; }
@media (min-width: 861px) { .topics > nav { display: block; } }
@media (max-width: 1100px) { .layout { gap: 34px; grid-template-columns: 235px minmax(0,1fr); } .journey { gap: 10px; } }
@media (max-width: 860px) {
  html { scroll-padding-top: 92px; }
  .header-inner { padding: 17px 22px; gap: 15px; }
  .header-label { padding-left: 15px; font-size: 12px; }
  .layout { display: block; padding: 28px 22px 0; }
  .sidebar { position: static; max-height: none; overflow: visible; padding: 0; }
  .search { margin-bottom: 12px; }
  .topics { border: 1px solid var(--border); border-radius: 10px; padding: 10px 13px; margin-bottom: 28px; }
  .topics summary { display: list-item; cursor: pointer; font-size: 14px; color: #d9c5f4; }
  .topics nav { padding-top: 20px; max-height: 290px; overflow: auto; }
  .topics:not([open]) > nav { display: none; }
  .sidebar-footer { display: none; }
  .hero { padding-top: 0; }
  h1 { letter-spacing: -1.2px; }
}
@media (max-width: 520px) {
  .header-inner { padding: 15px 18px; }
  .brand { font-size: 19px; }
  .header-label { display: none; }
  .studio-link { font-size: 12px; }
  .layout { padding: 24px 18px 0; }
  .hero-copy { font-size: 16px; }
  .hero-actions { gap: 16px; }
  .journey { grid-template-columns: 1fr; gap: 9px; }
  .journey > div { padding: 12px 15px; display: grid; grid-template-columns: 24px 1fr; gap: 0 8px; }
  .journey span { grid-row: span 2; margin-top: 3px; margin-bottom: 0; }
  .journey p { margin-top: 2px; }
  .article-heading { gap: 12px; }
  .callout { padding: 16px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
@media print {
  :root { color-scheme: light; }
  body { background: #fff; color: #111; font-size: 11pt; }
  .site-header, .sidebar, .hero-actions, .back-link, .skip-link { display: none; }
  .layout { display: block; padding: 0; }
  .hero::before { display: none; }
  .article[hidden] { display: block !important; }
  .article p, .article li, .summary, .hero-copy, .callout p, td, th, .eyebrow { color: #222; }
  .callout, thead th { background: #f3f3f3; }
  .callout strong { color: #111; }
  .article-heading, .callout, tr { break-inside: avoid; }
}

/* Guías independientes: migas, capturas, tarjetas del índice y relacionadas. */
.crumbs { font-size: 13px; color: var(--muted); margin: 0 0 18px; }
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 0; }
.crumbs li + li::before { content: "/"; margin-right: 6px; color: #6f6680; }
.crumbs a { color: var(--muted); }
.guide { padding: 0 0 36px; border-bottom: 1px solid var(--border); }
.guide .summary { font-size: 17px; max-width: 700px; }
.guide-meta { color: #a79ab9; font-size: 12px; margin: 14px 0 0; }
.guide > p, .guide > ol, .guide > ul { color: #d1cbdc; margin: 18px 0; max-width: 760px; }
.guide li { padding-left: 5px; margin: 9px 0; }
.guide ol, .guide ul { padding-left: 23px; }
.guide li::marker { color: var(--accent); font-weight: 600; }
.shot { margin: 28px 0; }
.shot img { display: block; width: 100%; height: auto; border: 1px solid var(--border); border-radius: 12px; background: #0b0a10; }
.shot.tall img { max-width: 320px; }
.shot figcaption { color: var(--muted); font-size: 13px; margin-top: 10px; }
.cta { margin: 36px 0 0; padding: 22px 24px; border: 1px solid #514261; border-radius: 12px; background: #1d1726; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
.cta p { margin: 0; color: #d9cfe8; }
.related { padding: 34px 0 10px; }
.related h2 { font-size: 20px; }
.cards { list-style: none; padding: 0; margin: 18px 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.cards a { display: block; height: 100%; padding: 18px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); text-decoration: none; }
.cards a:hover { border-color: #6a5584; background: #201b2a; }
.cards strong { display: block; color: var(--text); font-size: 15px; line-height: 1.35; }
.cards span { display: block; color: var(--muted); font-size: 13px; line-height: 1.5; margin-top: 6px; }
.hub-group { padding: 34px 0 6px; }
.hub-group h2 { font-size: 22px; }
@media print { .crumbs, .cta, .related { display: none; } }
.hero .journey { margin-top: 30px; }
.journey strong a { color: var(--text); }
.nav-group a[aria-current="page"] { color: #ede3ff; background: #30233f; border-left-color: var(--accent); }
/* En el móvil, la guía va primero y la lista de guías al final. */
@media (max-width: 860px) {
  .layout:has(> .all-guides) { display: flex; flex-direction: column; }
  .layout > .all-guides { order: 2; margin-top: 8px; }
  .all-guides .topics nav { max-height: none; }
}

/* Guías completas en una sola columna, con índice interno. */
.page { max-width: 860px; margin: 0 auto; padding: 40px 32px 0; }
.page > .cards { margin-top: 8px; }
.guide h1 { margin-bottom: 14px; }
.toc { margin: 28px 0 8px; padding: 18px 22px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.toc p { margin: 0 0 8px; color: #a79ab9; font-size: 11px; font-weight: 700; letter-spacing: 1.3px; text-transform: uppercase; }
.toc ol { margin: 0; padding-left: 20px; }
.toc li { margin: 4px 0; }
.toc a { color: #ded3ee; text-decoration: none; }
.toc a:hover { color: var(--accent); text-decoration: underline; }
.guide-section { padding-top: 34px; scroll-margin-top: 90px; }
.guide-section h2 { margin-bottom: 4px; }
.section-summary { color: var(--muted); margin: 0 0 6px; }
.guide-section > p, .guide-section > ol, .guide-section > ul { color: #d1cbdc; margin: 16px 0; }
.guide-section li { padding-left: 5px; margin: 9px 0; }
.guide-section ol, .guide-section ul { padding-left: 23px; }
.guide-section li::marker { color: var(--accent); font-weight: 600; }
.cards { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
@media (max-width: 520px) { .page { padding: 24px 18px 0; } .toc { padding: 14px 16px; } }
