/* Bamboo A11Y Patterns — estilos con los tokens de bamboolab.tech */
:root {
  --ink: #141414; --ink-2: #292929; --paper: #fff; --paper-2: #f7f5ef; --paper-3: #f1efe8;
  --muted: #575757; --line: #d9d7d0; --line-dark: #bdbab0;
  --orange: #f59a18; --orange-text: #9a5500; --blue: #2f6b3f; --blue-2: #24553a; --blue-bg: #eef4ef;
  --success: #176b3a; --danger: #9d1c1c; --warn-bg: #fff8ea; --warn-line: #f2cf8f; --highlight: #fde3b8;
  --sans: "Trebuchet MS", Verdana, Arial, sans-serif; --mono: Consolas, "Courier New", monospace;
  --max: 1280px; --radius: 14px;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-top: 16px; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--sans); font-size: 16px; line-height: 1.5; letter-spacing: .01em; }
img, svg { vertical-align: middle; }
a { color: var(--ink); text-underline-offset: 3px; }
a:hover { color: var(--blue-2); text-decoration-thickness: 3px; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }
main:focus, [tabindex="-1"]:focus { outline: none; }
code { font-family: var(--mono); font-size: .95em; }
p { margin: 0 0 12px; }
h1, h2, h3, h4 { margin: 0; line-height: 1.15; }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
.wrap { max-width: var(--max); margin: 0 auto; padding-inline: 32px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.m0 { margin: 0; }
.plain { list-style: none; margin: 0; padding: 0; }
.row-gap { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.stack { display: flex; flex-direction: column; gap: 20px; }

/* Saltar al contenido */
.skip { position: absolute; left: -9999px; top: 8px; z-index: 100; background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 8px; font-weight: 800; }
.skip:focus { left: 16px; color: #fff; }

/* Botones */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 20px; border-radius: 10px; font: inherit; font-weight: 800; text-decoration: none; cursor: pointer; border: 2px solid transparent; }
.btn-primary { background: var(--orange); color: var(--ink); }
.btn-primary:hover { background: #ffb347; color: var(--ink); box-shadow: 0 0 0 2px var(--ink); }
.btn-outline { background: #fff; color: var(--ink); border-color: var(--ink); }
.btn-outline:hover { background: var(--paper-3); color: var(--ink); }
.btn-ghost { background: #fff; color: var(--ink); border-color: var(--line-dark); }
.btn-ghost:hover { border-color: var(--ink); }
.btn-dark { background: var(--ink); color: #fff; border-color: #fff; }
.btn-dark:hover { background: #333; box-shadow: 0 0 0 3px var(--orange); }
.btn-lg { font-size: 18px; padding: 14px 26px; border-radius: 12px; }
.btn-sm { font-size: 14px; padding: 6px 14px; }

/* Encabezado del sitio */
.header-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 16px; padding-block: 16px; }
.logo { font-size: 26px; text-decoration: none; color: var(--ink); }
.logo-bam { font-weight: 800; }
.logo-boo { text-decoration: underline; text-decoration-color: var(--orange); text-decoration-thickness: 3px; text-underline-offset: 5px; }
.mainnav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px; font-size: 15px; font-weight: 700; }
.navlink { display: block; padding: 10px 12px; border-radius: 8px; text-decoration: none; font-weight: 700; }
.navlink:hover { background: var(--paper-3); color: var(--ink); }
.navlink.is-current { background: var(--paper-2); box-shadow: inset 0 -3px 0 var(--orange); }
.menu-btn { display: none; align-items: center; gap: 8px; min-height: 44px; padding: 8px 14px; border-radius: 10px; border: 2px solid var(--ink); background: #fff; color: var(--ink); font: inherit; font-weight: 800; cursor: pointer; }
.menu-btn:hover { background: var(--paper-3); }

/* Ruta de navegación */
.breadcrumb ol { list-style: none; margin: 0 0 28px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 8px; font-size: 14px; color: var(--muted); }
.breadcrumb li { display: flex; gap: 8px; align-items: center; }
.breadcrumb a { color: var(--ink); }
.breadcrumb [aria-current] { font-weight: 700; color: var(--ink); }

/* Tipografía de secciones */
.lib-eyebrow { margin: 0 0 14px; color: var(--orange-text); font-weight: 900; letter-spacing: .16em; font-size: 15px; text-transform: uppercase; }
.eyebrow-light { color: var(--orange); }
.display { font-size: clamp(40px, 6vw, 72px); line-height: 1.02; letter-spacing: -.05em; font-weight: 700; }
.h1 { font-size: clamp(38px, 5vw, 56px); letter-spacing: -.05em; line-height: 1.05; }
.h2 { font-size: clamp(26px, 3vw, 32px); letter-spacing: -.03em; margin-bottom: 18px; }
.h2-wide { max-width: 820px; }
.h3 { font-size: 18px; margin-bottom: 6px; }
.lib-lead { font-size: clamp(17px, 2vw, 20px); line-height: 1.55; color: var(--ink-2); max-width: 760px; margin-top: 18px; }
.lead-light { color: #e6e4dd; }
.byline { font-size: 15px; color: var(--muted); }
.label { font-weight: 800; margin: 18px 0 8px; }
.label-caps { margin: 0; font-size: 13px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.label-sm { margin: 0 0 4px; font-size: 13px; font-weight: 800; color: var(--muted); }

/* Bloques */
.lib-hero { padding-block: 32px 64px; }
.cta-row { margin-top: 28px; display: flex; flex-wrap: wrap; gap: 14px; }
.band { padding-block: 56px; }
.band-paper { background: var(--paper-2); border-block: 1px solid var(--line); }
.band-ink { background: var(--ink); color: #fff; }
.lib-section { margin-top: 56px; }
.wrap.lib-section { padding-block: 56px; margin-top: 0; }
.lib-section-intro { line-height: 1.6; color: var(--ink-2); max-width: 780px; margin-bottom: 20px; }
.card-grid { list-style: none; margin: 24px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 16px; }
.lib-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.lib-card h3 { font-size: 18px; margin-bottom: 8px; }
.lib-card p { margin: 0; color: var(--muted); }
.card-dark { background: transparent; border-color: #3a3a3a; }
.card-dark p { color: #d1cfc8; }
.three-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 28px; }
.three-col h3 { font-size: 19px; margin-bottom: 10px; }
.two-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 18px; }
.cta-bottom { margin-top: 36px; }
.panel { border-radius: var(--radius); padding: 24px; border: 1px solid var(--line); }
.panel h3 { font-size: 19px; margin-bottom: 10px; }
.panel p { margin: 0; line-height: 1.6; }
.panel-paper { background: var(--paper-2); }
.panel-blue { background: var(--blue-bg); border-color: #c9cdf5; }
.note-box { margin-top: 14px; background: var(--warn-bg); border: 1px solid var(--warn-line); border-radius: 12px; padding: 14px 18px; }
.note-box .label { margin-top: 0; }
.note-box ul { margin: 0; padding-left: 20px; line-height: 1.7; }
.warn { font-weight: 800; color: var(--danger); }
.ok-msg { margin: 6px 0 0; min-height: 22px; font-size: 15px; font-weight: 700; color: var(--success); }
.ok-msg:empty { min-height: 0; margin: 0; }
.ok-msg-dark { color: #8fe0ad; }
kbd { font-family: var(--mono); font-size: 13px; font-weight: 700; background: #fff; border: 1px solid var(--line-dark); border-bottom-width: 3px; border-radius: 6px; padding: 2px 7px; color: var(--ink); white-space: nowrap; }

/* Explorar */
.explore { padding-block: 40px 72px; border-top: 0; }
.filter { margin-top: 28px; }
.chips { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; }
.chip { font: inherit; font-size: 15px; font-weight: 800; min-height: 44px; padding: 10px 18px; border-radius: 999px; cursor: pointer; border: 2px solid #747474; background: #fff; color: var(--ink); }
.chip:hover { box-shadow: 0 0 0 3px var(--orange); }
.chip[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.chip-count { font-weight: 400; }
.status-box { display: inline-block; margin: 0; font-weight: 700; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 10px 16px; }
.cat-group { margin-top: 44px; }
.cat-group[hidden] { display: none; }
.cat-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; border-bottom: 2px solid var(--ink); padding-bottom: 10px; margin-bottom: 20px; }
.cat-head h3 { font-size: 24px; letter-spacing: -.02em; }
.cat-head p { margin: 0; color: var(--muted); font-size: 15px; }
.pattern-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 270px), 1fr)); gap: 18px; }
.pattern-card { display: flex; flex-direction: column; gap: 10px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 22px 18px; }
.pattern-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.pattern-card h4 { font-size: 19px; }
.pattern-card > p { margin: 0; flex: 1; font-size: 15px; color: var(--muted); }
.pattern-card-foot { border-top: 1px solid var(--paper-3); padding-top: 12px; }
.pattern-card-foot p { margin: 0; }
.badge { flex: none; font-size: 12px; font-weight: 800; background: var(--highlight); border-radius: 999px; padding: 4px 10px; }
.see-link { display: inline-block; padding: 6px 0; font-weight: 800; text-decoration-color: var(--orange); text-decoration-thickness: 2px; text-underline-offset: 4px; }

/* Página de patrón */
.pattern-layout { display: flex; flex-wrap: wrap; gap: 40px; align-items: flex-start; padding-block: 32px; max-width: 1360px; }
.pattern-main { flex: 999 1 640px; min-width: 0; }
.side { flex: 1 1 240px; max-width: 290px; background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.side-title { margin: 0; font-size: 17px; font-weight: 800; }
.side-loc { margin: 6px 0 14px; font-size: 14px; color: var(--muted); }
.side-loc strong { color: var(--ink); }
.side-cats { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.side-cat { font: inherit; width: 100%; min-height: 44px; display: flex; justify-content: space-between; align-items: center; gap: 8px; text-align: left; font-size: 15px; font-weight: 800; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--line-dark); background: #fff; color: var(--ink); cursor: pointer; }
.side-cat:hover { box-shadow: 0 0 0 3px var(--orange); }
.side-cat .muted { font-weight: 400; }
.side-cat .chev { flex: none; transition: transform .15s; }
.side-cat[aria-expanded="true"] .chev { transform: rotate(180deg); }
.side-list { list-style: none; margin: 6px 0 4px; padding: 0 0 0 8px; display: flex; flex-direction: column; gap: 2px; font-size: 15px; }
.side-list[hidden] { display: none; }
.side-link { display: block; padding: 8px 10px; border-radius: 8px; text-decoration: none; color: var(--ink); }
a.side-link:hover { background: var(--paper-3); }
.side-link.is-current { font-weight: 800; background: var(--ink); color: #fff; }
.side-link.is-current:hover { color: #fff; background: #333; }
.side-link.is-disabled { color: var(--muted); }
.pattern-title { font-size: clamp(40px, 6vw, 60px); }
.meta-row { margin-top: 16px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.meta-row p { margin: 0; }
.intro-list { margin: 0; padding-left: 22px; line-height: 1.8; font-size: 17px; }
pre { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font-family: var(--mono); }
.code { background: var(--ink); color: #f1efe8; border-radius: 10px; padding: 14px 18px; font-size: 14px; }
.toc { margin-top: 28px; border-block: 1px solid var(--line); padding-block: 10px; }
.toc ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 6px; font-size: 15px; }
.toc .navlink { padding: 8px 10px; }

.table { width: 100%; border-collapse: collapse; font-size: 16px; }
.table th, .table td { text-align: left; padding: 12px 14px; border: 1px solid var(--line); vertical-align: top; }
.table thead th { background: var(--paper-3); }
.table tbody th { font-weight: 800; }
.w30 { width: 30%; }
.table-scroll { overflow-x: auto; position: relative; }
.table-wide { min-width: 680px; font-size: 15px; }
.table-wide ul li { white-space: nowrap; }
.sev { white-space: nowrap; font-size: 13px; font-weight: 800; border-radius: 6px; padding: 4px 8px; border: 1px solid var(--ink); }
.sev-critico { background: var(--danger); color: #fff; }
.sev-alto { background: var(--ink); color: #fff; }
.sev-medio { background: var(--highlight); }
.sev-bajo { background: #fff; }
.sev-bp { background: var(--blue-bg); color: var(--blue-2); }

/* Ejemplos */
.examples { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 28px; }
.example { border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.ex-head { padding: 22px 24px; border-bottom: 1px solid var(--line); }
.ex-head-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 10px; }
.ex-head h3 { font-size: 21px; }
.ex-head p { line-height: 1.6; }
.ex-count { margin: 0 0 4px; font-size: 13px; font-weight: 800; color: var(--muted); }
.ex-demo { padding: 24px; background: #fff; }
.demo-line { font-size: 18px; margin: 12px 0 0; }
.demo-link { color: var(--blue-2); }
.ex-code { background: var(--ink); color: #f1efe8; padding: 18px 24px; }
.ex-code-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 10px; }
.ex-code-head .label { margin: 0; }
.ex-code pre { font-size: 14px; line-height: 1.6; }
.ex-sr { padding: 20px 24px; background: var(--paper-2); }
.ex-sr h4 { font-size: 17px; }
.ex-sr .small { margin: 12px 0; }
.sr-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 12px; }
.sr-out { margin: 0; font-family: var(--mono); background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; font-size: 14px; }
.props { margin: 14px 0 0; display: flex; flex-wrap: wrap; gap: 6px 22px; font-size: 14px; }
.props div { display: flex; gap: 6px; }
.props dt { color: var(--muted); }
.props dd { margin: 0; font-weight: 800; }
.ex-refs { padding: 18px 24px; border-top: 1px solid var(--line); }
.ex-refs h4 { font-size: 16px; margin-bottom: 10px; }
.ex-refs ul { margin: 0; padding-left: 20px; line-height: 1.9; font-size: 15px; }
.ex-refs a, .bp a, .sc-grid a { font-weight: 700; }
.anchor-target { margin-top: 20px; border: 1px dashed var(--line-dark); border-radius: 12px; padding: 14px 18px; font-size: 15px; color: var(--muted); }
.anchor-target:target, .anchor-target:focus { border-color: var(--blue); background: var(--blue-bg); color: var(--ink); }

/* Nota de revisión ⚡ */

/* Diálogo */
.dialog { border: none; border-radius: 16px; padding: 28px; max-width: min(440px, 90vw); color: var(--ink); font-family: var(--sans); }
.dialog::backdrop { background: rgba(20, 20, 20, .6); }
.dialog h2 { font-size: 22px; margin-bottom: 10px; }

/* Correcto vs. incorrecto */
.compare { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.compare h3 { padding: 14px 20px; font-size: 18px; background: var(--paper-2); border-bottom: 1px solid var(--line); }
.split { display: flex; flex-wrap: wrap; }
.split > div { flex: 1 1 260px; min-width: 0; padding: 18px 20px; }
.split > div:first-child { border-right: 2px solid var(--ink); }
.split p { margin: 0; font-size: 15px; }
.verdict { font-weight: 800; display: flex; align-items: center; gap: 8px; margin-bottom: 10px !important; }
.code-light { margin: 0 0 10px; font-size: 13px; background: var(--paper-2); border-radius: 8px; padding: 10px 12px; }
.code-light strong { background: var(--highlight); }

/* Buenas prácticas y criterios */
.bp { border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.bp h3 { font-size: 18px; margin-bottom: 8px; }
.bp p { line-height: 1.55; }
.sc-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 12px; }
.sc-grid li { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.level { flex: none; font-size: 13px; font-weight: 800; background: var(--blue-bg); color: var(--blue-2); border-radius: 6px; padding: 3px 8px; }

/* Checklist */
.check-status { font-weight: 700; }
.checklist { border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 22px; margin: 0; display: flex; flex-direction: column; gap: 2px; }
.checklist legend { font-weight: 800; padding: 0 6px; }
.chk { display: flex; gap: 12px; align-items: flex-start; padding: 10px 6px; border-radius: 8px; line-height: 1.5; cursor: pointer; }
.chk:hover { background: var(--paper-2); }
.chk input { width: 22px; height: 22px; margin: 2px 0 0; flex: none; accent-color: var(--blue-2); cursor: pointer; }

/* Anterior / siguiente */
.prev-next { margin-top: 56px; border-top: 1px solid var(--line); padding-top: 24px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; }
.pn-card { display: block; flex: 1 1 200px; border: 2px solid var(--line); border-radius: 12px; padding: 16px 20px; text-decoration: none; }
a.pn-card:hover { border-color: var(--ink); }
.pn-next { text-align: right; }
.pn-label { display: block; font-size: 13px; color: var(--muted); }
.pn-name { font-weight: 800; font-size: 18px; }
.pn-card.is-disabled { color: var(--muted); }

/* Pie de página */
.logo-footer { font-size: 22px; margin: 0; }
.footer-text { margin: 12px 0 0; color: #d1cfc8; font-size: 15px; }
.footer-legal { margin: 40px 0 0; border-top: 1px solid #333; padding-top: 20px; font-size: 14px; color: #d1cfc8; }

/* Responsive: 1280 / 640 / 426 / 320 */
@media (max-width: 900px) {
  .js .menu-btn { display: inline-flex; }
  .js .mainnav { display: none; width: 100%; order: 3; }
  .js .mainnav.is-open { display: block; }
  .mainnav ul { flex-direction: column; }
  .side { max-width: none; }
}
@media (max-width: 640px) {
  .split > div:first-child { border-right: none; border-bottom: 2px solid var(--ink); }
}
@media (max-width: 480px) {
  .wrap { padding-inline: 16px; }
  .ex-head, .ex-demo, .ex-code, .ex-sr, .ex-refs { padding-inline: 16px; }
  .btn-lg { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
@media (forced-colors: active) {
  .chip[aria-pressed="true"], .side-link.is-current { outline: 2px solid CanvasText; }
  .sev { border: 1px solid CanvasText; }
}

/* Demos de patrones de contenido */
.demo-area { margin-top: 12px; }
.demo-area table { border-collapse: collapse; }
.demo-frame { display: block; width: 100%; margin-top: 12px; border: 1px solid var(--line-dark); border-radius: 10px; background: #fff; }
.tab-mock { display: flex; flex-direction: column; gap: 8px; margin: 12px 0 0; padding: 0; list-style: none; }
.tab-mock li { display: flex; align-items: center; gap: 8px; max-width: 360px; background: var(--paper-3); border: 1px solid var(--line-dark); border-radius: 10px 10px 0 0; padding: 8px 12px; font-size: 14px; }
.tab-mock .tab-label { font-size: 12px; font-weight: 800; color: var(--muted); }
.demo-table caption { text-align: left; font-weight: 800; padding: 8px 0; }
.demo-table th, .demo-table td { border: 1px solid var(--line-dark); padding: 8px 12px; text-align: left; }
.demo-table thead th, .demo-table th[scope="row"] { background: var(--paper-3); }
@media (max-width: 640px) {
  .demo-table.is-responsive thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .demo-table.is-responsive, .demo-table.is-responsive tbody, .demo-table.is-responsive tr, .demo-table.is-responsive td { display: block; width: 100%; }
  .demo-table.is-responsive tr { border: 1px solid var(--line-dark); border-radius: 10px; margin-bottom: 12px; overflow: hidden; }
  .demo-table.is-responsive td { border: none; border-bottom: 1px solid var(--line); }
  .demo-table.is-responsive td::before { content: attr(data-label) ": "; font-weight: 800; }
  .demo-table.is-responsive caption { display: block; width: 100%; padding: 0 0 10px; font-size: 18px; }
}
.demo-img { max-width: 100%; height: auto; border-radius: 8px; }
.demo-figure { margin: 0; }
.demo-figure figcaption { font-size: 14px; color: var(--muted); }

/* Índice "En esta página" */
.toc-title { font-size: 16px; margin: 0 0 8px; }
.toc ul { gap: 6px 18px; }
.toc-link { display: inline-block; padding: 6px 2px; font-weight: 700; color: var(--blue-2); text-decoration: underline; text-underline-offset: 4px; }
.toc-link:hover { text-decoration-thickness: 3px; }

/* Lectores de pantalla */
.sr-app { display: flex; align-items: center; gap: 6px; }
.sr-app .muted { font-weight: 400; }

/* Volver al punto de origen después de "Ver solución" */
.back-btn { margin: 12px 20px 0; }
.example .back-btn { margin: 16px 24px 0; }
.example:focus, .compare:focus, .lib-section:focus { outline: 3px solid var(--blue); outline-offset: 4px; }
pre code { display: block; overflow-wrap: anywhere; word-break: break-word; }
.ex-code { min-width: 0; }
code { overflow-wrap: anywhere; }

/* Píldoras del encabezado del ejemplo: etiquetas, no controles */
.ex-count { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin: 0 0 8px; }
.pill { display: inline-block; font-size: 13px; font-weight: 800; line-height: 1.3; padding: 3px 12px; border-radius: 999px; border: 2px solid var(--ink); background: #fff; color: var(--ink); cursor: default; user-select: text; }
.pill-dark { background: var(--ink); color: #fff; }

/* Atributos y elementos mencionados en el texto */
code.kw { background: var(--paper-3); border-radius: 4px; padding: 1px 4px; }
h3 code.kw { font-size: .9em; }
.ex-details { margin: 0 0 12px; padding-left: 22px; line-height: 1.7; }
.try-steps { margin-top: 14px; background: var(--paper-2); border-radius: 10px; padding: 12px 16px; }
.try-steps ol { margin: 0; padding-left: 22px; line-height: 1.7; }

/* Tabla "Lo que anuncia el lector de pantalla" */
.sr-table { margin-top: 12px; background: #fff; font-size: 15px; }
.sr-table tbody th { font-weight: 400; width: 30%; }
.sr-table .sr-out { display: block; border: 0; padding: 0; background: none; font-size: 14px; }
.sr-note { margin: 10px 0 0; }
@media (max-width: 640px) {
  .sr-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .sr-table, .sr-table tbody, .sr-table tr, .sr-table th, .sr-table td { display: block; width: 100% !important; }
  .sr-table tr { border: 1px solid var(--line-dark); border-radius: 10px; margin-bottom: 10px; overflow: hidden; }
  .sr-table th, .sr-table td { border: 0; border-bottom: 1px solid var(--line); }
  .sr-table tbody th { background: var(--paper-3); }
  .sr-table td::before { content: attr(data-label); display: block; font-size: 13px; font-weight: 800; color: var(--muted); margin-bottom: 2px; }
}

/* Código en acordeón */
.code-h { margin: 0; font-size: 17px; }
.code-toggle { font: inherit; font-weight: 800; display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 6px 14px 6px 6px; border-radius: 10px; border: 2px solid transparent; background: transparent; color: #fff; cursor: pointer; text-align: left; }
.code-toggle:hover { border-color: var(--orange); background: #262626; }
.code-chev { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 50%; background: var(--orange); color: var(--ink); flex: none; }
.code-chev .chev { transition: transform .15s; }
.code-toggle[aria-expanded="true"] .chev { transform: rotate(180deg); }
.code-lines { font-weight: 400; color: #d1cfc8; }
.code-panel[hidden] { display: none; }
.ex-code .ok-msg:empty { margin: 0; }

/* "Error común": rojo con ícono y texto */
.err-box { margin-top: 16px; background: #fdecec; border: 1px solid #e7b4b4; border-left: 6px solid var(--danger); border-radius: 12px; padding: 14px 18px; color: var(--ink); }
.err-title { display: flex; gap: 10px; align-items: flex-start; font-weight: 800; color: var(--danger); margin: 0 0 8px; }
.err-title svg { flex: none; margin-top: 1px; }
.err-box ul { margin: 0; padding-left: 22px; line-height: 1.7; }
.err-box p { margin: 0 0 8px; }
.err-box p:last-child { margin-bottom: 0; }

/* Quién se ve afectado */
.afect-h { margin-top: 26px; font-size: 20px; }
.afect-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 14px; margin-top: 12px; }
.afect { border: 1px solid var(--line); border-top: 5px solid var(--ink); border-radius: 12px; padding: 16px 18px; background: #fff; }
.afect-temp { border-top-color: var(--orange); }
.afect-edad { border-top-color: var(--blue); }
.afect h4 { font-size: 17px; margin-bottom: 8px; }
.afect ul { margin: 0; padding-left: 20px; line-height: 1.6; font-size: 15px; }
.afect li + li { margin-top: 6px; }

@media (forced-colors: active) {
  .pill { border: 1px solid CanvasText; }
  .err-box { border: 2px solid CanvasText; }
  .code-chev { border: 1px solid CanvasText; }
}

/* ───── Ronda 2: código por tipo, descarga, requisitos mínimos, nombres ───── */
.name-es { letter-spacing: 0; font-weight: 400; color: var(--ink-2); font-size: .6em; display: inline-block; }
.pattern-card h4 .name-es, .side-loc .name-es { font-size: .9em; }
.code-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.code-actions svg { margin-right: 6px; vertical-align: -3px; }
.code-block { margin-top: 14px; border: 1px solid #3a3a3a; border-left: 5px solid #7cc4ff; border-radius: 10px; overflow: hidden; }
.code-block.code-css { border-left-color: #ff9ecb; }
.code-block.code-js { border-left-color: #ffd479; }
.code-block-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 10px 6px 14px; background: #222; border-bottom: 1px solid #3a3a3a; }
.code-lang { margin: 0; font-weight: 800; font-size: 14px; letter-spacing: .04em; color: #fff; }
.code-block pre { margin: 0; padding: 12px 14px; }
.btn-code { font: inherit; font-size: 13px; font-weight: 700; min-height: 32px; padding: 4px 12px; border-radius: 8px; border: 2px solid #8a8a8a; background: transparent; color: #fff; cursor: pointer; }
.btn-code:hover { border-color: var(--orange); background: #333; }
.btn-code:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; }
/* Colores de sintaxis: todos ≥ 7:1 sobre #141414 */
.tk-tag, .tk-sel { color: #7cc4ff; }
.tk-attr { color: #ffd479; }
.tk-str, .tk-val { color: #a8e6a1; }
.tk-prop { color: #ff9ecb; }
.tk-kw { color: #ffb27a; }
.tk-num { color: #d7b8ff; }
.tk-com { color: #b8b8b8; font-style: italic; }
.minimos { margin: 0; padding: 16px 24px 20px; background: #eef7f1; border-top: 1px solid #b9dcc6; }
.minimos h4 { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; font-size: 17px; color: #145c32; }
.minimos ul { margin: 0; padding-left: 22px; line-height: 1.7; }
@media (max-width: 640px) { .minimos { padding-inline: 16px; } }
/* details/summary del sitio: indicador visible y estilo de botón */
details > summary { cursor: pointer; }
@media (forced-colors: active) {
  .code-block { border: 2px solid CanvasText; }
  .minimos { border: 2px solid CanvasText; }
}
.req-table { margin-top: 14px; }
.req-table caption { text-align: left; font-weight: 800; padding: 0 0 8px; font-size: 17px; }
.reload-row { margin: 0 0 10px; }

/* ───── Ronda 3: inicio y fin de cada ejemplo ───── */
.example { border: 2px solid var(--ink); border-radius: 14px; }
.ex-band { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 24px; background: #f59a18; border-bottom: 2px solid var(--ink); }
.ex-band .ex-count { margin: 0; color: var(--ink); }
.ex-band .ex-n { font-size: 17px; font-weight: 800; color: var(--ink); }
.ex-band-mal { background: #9d1c1c; }
.ex-band-mal .ex-n { color: #fff; }
.ex-band-mal .pill { border-color: #fff; }
.btn-band { background: #fff; color: var(--ink); border: 2px solid var(--ink); }
.btn-band:hover { background: #fde7c4; box-shadow: 0 0 0 3px var(--ink); }
.ex-head h3 { margin: 0 0 8px; }
.x-mal { color: #9d1c1c; font-weight: 800; }
.no-hacer { font-size: 20px; font-weight: 800; color: #9d1c1c; margin: 0 0 10px; }
.ex-fin { margin: 0; padding: 8px 24px; background: var(--paper-2); border-top: 1px solid var(--line); font-size: 14px; color: var(--muted); }
@media (max-width: 640px) { .ex-band, .ex-fin { padding-inline: 16px; } }
@media (forced-colors: active) { .ex-band { border-bottom: 2px solid CanvasText; } }
.note-box li > ul, .note-box li > ol { margin: 4px 0 6px; padding-left: 22px; }
.min-nota { margin: 10px 0 0; padding-top: 8px; border-top: 1px solid #b9dcc6; }
.recordatorio { margin-top: 16px; background: #fff4e0; border: 2px solid #9a5500; border-left: 10px solid #f59a18; border-radius: 12px; padding: 14px 18px; }
.rec-title { display: flex; gap: 10px; align-items: center; margin: 0 0 8px; font-size: 19px; font-weight: 800; color: #6b3b00; }
.recordatorio ul { margin: 0; padding-left: 22px; line-height: 1.7; }
@media (forced-colors: active) { .recordatorio { border: 2px solid CanvasText; } }

/* Bamboo brand */
.lib-eyebrow:not(.eyebrow-light) { color: var(--blue); }
.logo-footer { color: #fff; }
.navlink[aria-current="page"] { background: var(--paper-2); box-shadow: inset 0 -3px 0 var(--orange); }
td .plain li a { display: inline-block; padding-block: 4px; }
.logo img { display: block; width: 156px; height: auto; }
.logout-btn { font: inherit; font-weight: 800; min-height: 44px; padding: 8px 16px; border: 2px solid var(--ink); border-radius: 10px; background: var(--ink); color: #fff; cursor: pointer; }
.logout-btn:hover { background: #333; }

/* Library header, search, account menu and short footer (v2) */
.lib-header .header-row { flex-wrap: nowrap; gap: 24px; }
.lib-logo { display: inline-flex; align-items: center; gap: 12px; flex: none; color: var(--ink); }
.lib-tag { padding-left: 12px; border-left: 2px solid var(--line); font-size: 15px; font-weight: 800; white-space: nowrap; }
.lib-menu { display: flex; flex: 1; align-items: center; justify-content: space-between; gap: 16px; min-width: 0; }
.navlink[aria-current] { background: var(--paper-2); box-shadow: inset 0 -3px 0 var(--blue); }
@media (forced-colors: active) { .navlink[aria-current] { text-decoration: underline 3px; text-underline-offset: 6px; } }
.mainnav ul { flex-wrap: nowrap; }
.lib-tools { display: flex; align-items: center; gap: 10px; }
.lib-search { display: flex; width: 210px; }
.lib-search input { flex: 1; min-width: 0; min-height: 44px; padding: 8px 12px; border: 2px solid var(--ink); border-right: 0; border-radius: 10px 0 0 10px; background: #fff; color: var(--ink); font: inherit; font-size: 15px; }
.lib-search button { display: grid; place-items: center; width: 44px; min-height: 44px; border: 2px solid var(--ink); border-radius: 0 10px 10px 0; background: var(--ink); color: #fff; cursor: pointer; }
.lib-search button:hover { background: #333; }
.account { position: relative; }
.account-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 8px 14px; border: 2px solid var(--ink); border-radius: 10px; background: #fff; color: var(--ink); font: inherit; font-size: 15px; font-weight: 800; cursor: pointer; }
.account-btn:hover { background: var(--paper-3); }
.account-btn[aria-expanded="true"] svg { transform: rotate(180deg); }
.mainnav .account-menu { display: block; margin: 0; padding: 6px; list-style: none; font-weight: 700; }
.js .mainnav .account-menu { display: none; position: absolute; z-index: 20; top: calc(100% + 8px); right: 0; width: 250px; border: 1px solid var(--line); border-radius: 12px; background: #fff; box-shadow: 0 12px 30px rgba(0,0,0,.14); }
.js .mainnav .account-menu.is-open { display: block; }
.account-menu a, .account-menu button { display: flex; align-items: center; width: 100%; min-height: 44px; padding: 8px 12px; border: 0; border-radius: 8px; background: none; color: var(--ink); font: inherit; text-align: left; text-decoration: none; cursor: pointer; }
.account-menu a:hover, .account-menu button:hover { background: var(--paper-3); }
.account-menu li + li { margin-top: 2px; border-top: 1px solid var(--line); padding-top: 2px; }
.pattern-card[hidden] { display: none; }
.lib-footer { text-align: center; padding-block: 36px 24px; }
.lib-footer ul { flex-direction: row; flex-wrap: wrap; justify-content: center; gap: 8px 24px; margin-top: 16px; }
.lib-footer .footer-legal { margin-top: 24px; }
@media (max-width: 1120px) {
  .lib-header .header-row { flex-wrap: wrap; }
  .js .menu-btn { display: inline-flex; }
  .js .lib-menu { display: none; flex: 0 0 100%; order: 3; }
  .js .lib-menu.is-open { display: flex; flex-direction: column; align-items: stretch; gap: 12px; padding-top: 8px; border-top: 1px solid var(--line); }
  .lib-menu nav ul { flex-direction: column; }
  .lib-tools { flex-direction: column; align-items: stretch; }
  .lib-search { width: 100%; }
  .js .account-btn { display: none; }
  .js .mainnav .account-menu { display: block; position: static; width: auto; padding: 0; border: 0; border-top: 1px solid var(--line); border-radius: 0; box-shadow: none; }
}
@media (max-width: 640px) {
  .lib-header .header-row { gap: 12px; }
  .lib-header .logo img { width: 124px; }
  .lib-tag { padding-left: 8px; font-size: 13px; }
  .lib-logo { gap: 8px; }
}
@media (max-width: 400px) {
  .lib-logo { flex-direction: column; align-items: flex-start; gap: 4px; }
  .lib-tag { padding-left: 0; border-left: 0; }
}


/* ===== v3 (2026-12): library pages use the site header and footer (styles.v32.css loads first) ===== */
body[data-page] .site-header { border-bottom: 1px solid var(--line); }
body[data-page] .site-footer { margin-top: 0; padding: 62px 0 0; font-size: 1rem; }
body[data-page] .site-footer h2 { margin: 4px 0 16px; color: #fff; font: 900 .82rem/1 var(--sans); letter-spacing: .12em; text-transform: uppercase; }
body[data-page] .site-footer ul { display: grid; gap: 8px; font-size: inherit; }
body[data-page] .site-footer a { color: #ddd; }
body[data-page] .site-footer a:hover { color: #fff; }
body[data-page] .site-footer p { margin: 0 0 1em; color: #bdbdbd; }
body[data-page] .site-footer .footer-grid { grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 45px; }
body[data-page] .site-footer .footer-social ul { display: flex; }
body[data-page] .site-footer .footer-social a { color: #f2f2f2; }
body[data-page] .site-footer .footer-social a:hover { color: #111; }
body[data-page] .band-ink + .site-footer { border-top: 1px solid #333; }
@media (max-width: 900px) { body[data-page] .site-footer .footer-grid { grid-template-columns: 1fr; gap: 30px; } }
/* library content lines up with the site header */
body[data-page] .wrap { width: min(calc(100% - 40px), var(--max)); padding-inline: 0; }
@media (max-width: 620px) { body[data-page] .wrap { width: min(calc(100% - 30px), var(--max)); } }

/* Search in Explorar */
.explore-search { max-width: 640px; margin: 8px 0 28px; }
.explore-search label { display: block; margin-bottom: 8px; font-size: 1.05rem; font-weight: 800; }
.explore-search-row { display: flex; gap: 10px; }
.explore-search input { flex: 1; min-width: 0; min-height: 48px; padding: 10px 14px; border: 2px solid var(--ink); border-radius: 10px; font: inherit; }
.explore-search .muted { margin: 8px 0 0; }
