/* Navegación de la biblioteca y utilidades de las guías. */
.lib-directory, .rd-layout {
    --rd-ink: #111725;
    --rd-soft: #4d586c;
    --rd-line: #cfd5e2;
    --rd-blue: #1949eb;
    --rd-paper: #faf9f5;
    color: var(--rd-ink);
}
.lib-directory { padding-bottom: clamp(2.5rem, 7vw, 6rem); }
.lib-tools { margin: .8rem 0 clamp(1.5rem, 4vw, 3.2rem); }
.lib-searchbox { max-width: 56rem; }
.lib-searchbox label, .lib-nav > strong {
    display: block; margin-bottom: .6rem;
    font-size: .79rem; font-weight: 750; letter-spacing: .065em; text-transform: uppercase;
}
.lib-searchbox > div {
    display: flex; align-items: center; position: relative;
    border: 1px solid #8895ac; background: #fff; border-radius: .4rem;
}
.lib-searchbox > div::before {
    content: ""; width: .82rem; height: .82rem; border: 2px solid var(--rd-blue); border-radius: 50%;
    position: absolute; pointer-events: none; inset-inline-start: 1.13rem; top: calc(50% - .59rem);
}
.lib-searchbox > div::after {
    content: ""; width: .52rem; height: 2px; background: var(--rd-blue); transform: rotate(45deg);
    position: absolute; pointer-events: none; inset-inline-start: 1.85rem; top: calc(50% + .33rem);
}
.lib-searchbox > div:focus-within { outline: 3px solid #a4bcff; border-color: var(--rd-blue); }
.lib-searchbox input {
    flex: 1; min-width: 0; width: 100%; padding: 1rem .65rem 1rem 3rem; outline: 0;
    border: 0; background: transparent; color: var(--rd-ink); font: inherit;
    font-size: clamp(1rem, 1.6vw, 1.15rem); line-height: 1.4;
}
.lib-searchbox input::-webkit-search-cancel-button { display: none; }
.lib-searchbox button, .lib-empty button {
    cursor: pointer; font: inherit; font-weight: 650; border: 1px solid #bcc8e5;
    border-radius: .25rem; color: var(--rd-blue); background: #f0f4ff; padding: .45rem .8rem;
}
.lib-searchbox button { margin-inline-end: .8rem; }
.lib-grid { display: grid; grid-template-columns: minmax(12.4rem, .31fr) minmax(0, 1fr); gap: clamp(1.5rem, 4.5vw, 5rem); align-items: start; }
.lib-nav { position: sticky; top: 1.4rem; padding: 1rem; border-radius: .55rem; background: #eef0f6; }
.lib-nav > strong { padding: .4rem .45rem .45rem; color: #424e64; }
.lib-nav a {
    color: var(--rd-ink); display: flex; align-items: center; gap: .6rem; padding: .64rem .48rem;
    min-height: 44px; font-size: .92rem; font-weight: 620; text-decoration: none;
    border-bottom: 1px solid #dbe0e9; line-height: 1.4;
}
.lib-nav a:last-child { border-bottom-color: transparent; }
.lib-nav a span { flex: 1; }
.lib-nav small {
    font: 600 .72rem/1.1 ui-monospace, Consolas, monospace; color: #566077;
    padding: .18rem .25rem; font-variant-numeric: tabular-nums;
}
.lib-nav a[aria-current=true] { border-radius: .24rem; background: var(--rd-ink); color: #fff; padding-inline: .65rem; border-bottom-color: transparent; }
.lib-nav a[aria-current=true] small { color: #dce4f9; }
.lib-nav a:hover:not([aria-current=true]) { color: var(--rd-blue); background: #e5eafb; }
.lib-stacks { min-width: 0; }
.lib-status { margin: 0 0 1rem; font-size: .91rem; color: var(--rd-soft); }
.lib-status:empty { display: none; }
.lib-shelf { --collection: var(--rd-blue); margin: 0 0 clamp(2rem, 4vw, 3.8rem); scroll-margin-block-start: 1.25rem; }
#tema-texto-y-documentos { --collection: #8750ca; }
#tema-imagen-y-ajuste { --collection: #c94a36; }
#tema-empresa { --collection: #08745d; }
#tema-memoria-y-plataformas { --collection: #ad630d; }
.lib-shelf h2 {
    display: flex; gap: .7rem; align-items: center; margin: 0 0 1.05rem;
    font: 700 clamp(1.45rem, 2.55vw, 2.05rem)/1.12 var(--sans, "Segoe UI", sans-serif); letter-spacing: -.045em;
}
.lib-shelf h2::before { content: ""; flex: 0 0 .37rem; height: .94em; border-radius: 2px; background: var(--collection); }
.lib-shelf ul { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .75rem; }
.lib-shelf li.lib-card { border: 1px solid var(--rd-line); border-radius: .45rem; background: #fff; padding: 0; min-width: 0; }
.lib-card > a {
    display: block; height: 100%; width: 100%; border-radius: inherit; padding: clamp(.9rem, 1.6vw, 1.35rem);
    text-decoration: none; color: var(--rd-ink);
}
.lib-card strong { display: block; font-size: clamp(1.03rem, 1.5vw, 1.22rem); line-height: 1.25; font-weight: 700; letter-spacing: -.025em; }
.lib-card p { margin: .65rem 0 0; color: var(--rd-soft); font-size: .95rem; line-height: 1.53; font-weight: 400; }
.lib-card > a:hover, .lib-card > a:focus-visible { color: var(--rd-blue); background: #f1f5ff; }
.lib-card:focus-within { outline: 2px solid var(--rd-blue); outline-offset: 2px; }
.lib-empty { padding: 1.5rem; border-inline-start: .3rem solid #ffb338; background: #fff3d9; color: var(--rd-ink); }
.lib-empty h2 { font-size: 1.35rem; margin: 0; }
.lib-empty p { margin: .5rem 0 1rem; }
.lib-empty a { color: #163dba; display: inline-block; margin-left: 1rem; }

.story:has(> .rd-layout) { width: 100%; max-width: none; margin-inline: 0; }
.rd-layout {
    display: grid; align-items: start; gap: clamp(1.5rem,4vw,5rem);
    grid-template-columns: minmax(0, 1fr) clamp(14.5rem, 22%, 19rem);
    grid-template-areas: "copy rail";
}
.rd-column { grid-area: copy; min-width: 0; overflow-wrap: break-word; font-size: var(--rd-size,1.04rem); }
.rd-column :is(p,li,dt,dd) { line-height: 1.7; }
.rd-column p { max-width: 71ch; }
.rd-column [data-rd-heading] { scroll-margin-top: var(--rd-offset,1.3rem); }
.rd-column .ial-card h3, .rd-column .usecase-card h3 { text-wrap: pretty; }
.rd-column section:has(> .ial-wrap > .ial-eyebrow),
.rd-column .ial-route, .rd-column .tutorial-start, .rd-column .ial-plain-summary, .rd-column .sme-route,
.rd-column .ial-hero-note, .rd-column .facil { margin-block: 1.5rem; }
.rd-column :is(.tutorial-start,.ial-plain-summary,.ial-hero-note) {
    padding: clamp(1rem,2vw,1.55rem); background: #eaf0ff;
    border-radius: .38rem; border-inline-start: .28rem solid var(--rd-blue);
}
.rd-column .sme-route { background: #fff4dd; padding: clamp(1rem,2vw,1.55rem); border-inline-start: .28rem solid #ec9b21; border-radius: .38rem; }
.rd-column :is(.ial-eyebrow,.ial-kicker,.ial-tag,.tutorial-eyebrow,.sme-eyebrow) { font: 700 .76rem/1.4 var(--sans,"Segoe UI",sans-serif); color: #3a4862; }
.rd-column .ial-actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-block: .65rem; }
.rd-column .ial-actions a, .rd-column .seo-context-link a { font-weight: 650; color: #173db5; }
.rd-column .ial-actions a { display: inline-block; padding: .3rem .65rem; border: 1px solid #bac7e2; border-radius: .25rem; text-decoration: none; }
.rd-column .ial-actions a:hover { background: #eaf0ff; }
.rd-column ul[class*=tags], .rd-column .ial-chips { list-style: none; display: flex; flex-wrap: wrap; gap: .4rem; padding: 0; }
.rd-column .ial-chips > *, .rd-column ul[class*=tags] li { border: 1px solid #c6d4ec; padding: .15rem .6rem; border-radius: .2rem; font-size: .83rem; margin: 0; }
.rd-column .ial-code-wrap pre { background: #101a36; color: #edf2ff; line-height: 1.65; padding: 1.2rem; border-radius: .4rem; }
.rd-column .ial-copy, .rd-column [data-copy-code], .rd-column .biz-result-actions button {
    font: 650 .85rem/1.4 var(--sans,"Segoe UI",sans-serif); padding: .38rem .68rem; min-height: 36px;
    color: #173db5; background: #eef2ff; border: 1px solid #adbee6; border-radius: .28rem; cursor: pointer;
}
.rd-column > :first-child { margin-top: 0; }
.rd-rail {
    grid-area: rail; position: sticky; top: var(--rd-offset,1.3rem);
    min-width: 0; color: var(--rd-ink); font-size: .94rem;
}
.rd-rail-inner { border: 1px solid #d0d6e4; border-top: .24rem solid var(--rd-blue); padding: .95rem 1rem; background: #f0f2f8; border-radius: .18rem .18rem .45rem .45rem; }
.rd-meter { margin-bottom: .95rem; }
.rd-meter > div:first-child { display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; font-size: .8rem; font-weight: 650; }
.rd-meter strong { font: 650 .79rem/1.2 ui-monospace, Consolas, monospace; font-variant-numeric: tabular-nums; color: var(--rd-blue); }
.rd-meter [role=progressbar] { height: 4px; background: #d4dcec; margin-top: .55rem; overflow: hidden; border-radius: 2px; }
.rd-meter i { display:block; height:100%; background: var(--rd-blue); transform: scaleX(var(--read,0)); transform-origin: left center; }
.story .rd-index { padding: 0; margin: 0; border: 0; }
.story .rd-index > summary { color: var(--rd-ink); font-weight: 700; font-size: 1rem; cursor: pointer; }
.story .rd-index[open] > summary { margin-bottom: .6rem; }
.rd-index nav { overflow-y: auto; max-height: min(43vh, 23rem); scrollbar-width: thin; scrollbar-color: #a7b3cc transparent; }
.story .rd-index ol { padding: 0; margin: 0; list-style: none; }
.story .rd-index li { margin: 0; padding: 0; }
.rd-index a { display: block; padding: .32rem .55rem; text-decoration: none; font: 500 .85rem/1.38 var(--sans,"Segoe UI",sans-serif); border-left: 2px solid #cbd2e1; color: #3e4b63; }
.rd-index a:hover { color: var(--rd-blue); }
.rd-index a[aria-current=location] { color: #163dba; font-weight: 720; border-left-color: var(--rd-blue); background: #e3e9fc; }
.rd-size { display: flex; gap: .4rem; align-items: center; border-top: 1px solid #ced5e5; padding-top: .8rem; margin-top: .85rem; }
.rd-size span { flex: 1; font-size: .77rem; font-weight: 600; }
.rd-size button {
    min-width: 36px; min-height: 34px; padding: .25rem; font: 600 .91rem/1 var(--sans,"Segoe UI",sans-serif);
    color: #233756; background: #fff; border: 1px solid #bec9dd; border-radius: .25rem; cursor: pointer;
}
.rd-size button:disabled { color: #697589; background: #eef1f7; cursor: default; }
.rd-layout .usecase-filters { display: grid; gap: .6rem; margin-block: 1rem; padding: 1rem; border: 1px solid #d0d7e7; border-radius: .45rem; background: #f1f4fc; }
.rd-column .usecase-filter { display: flex; flex-wrap: wrap; gap: .35rem; }
.rd-column .usecase-filter button {
    border: 1px solid #aebbd2; padding: .35rem .7rem; border-radius: .25rem;
    color: var(--rd-ink); background: #fff; min-height: 36px;
    font: 650 .85rem/1.3 var(--sans,"Segoe UI",sans-serif);
}
.rd-column .usecase-filter button:is(.is-active,[aria-pressed=true]) { color: #fff; background: #1949eb; border-color: #1949eb; text-decoration: none; }
.rd-column .usecase-grid { display: grid; gap: .8rem; grid-template-columns: repeat(2, minmax(0,1fr)); margin-block: 1rem 2rem; align-items: start; }
.rd-column .usecase-card { margin: 0; padding: 1rem; background: #fff; border: 1px solid var(--rd-line); border-radius: .4rem; min-width: 0; }
.rd-column .usecase-top { display: flex; align-items: center; flex-wrap: wrap; gap: .55rem; color: #48566a; font-size: .75rem; }
.rd-column .usecase-top b { background: #e7edff; color: #21419d; padding: .1rem .4rem; border-radius: .16rem; }
.rd-column .usecase-card h3 { margin: .65rem 0 .45rem; font-weight: 710; font-size: clamp(1.06rem,1.55vw,1.28rem); line-height: 1.25; }
.rd-column .usecase-card p { font-size: .95em; line-height: 1.5; }
.rd-column .rd-case-details { border-block: 1px solid #dde3ef; padding: .55rem 0; }
.rd-column .rd-case-details > summary,.rd-column .usecase-card > a { color: #193fae; font-size: .87rem; font-weight: 650; }
.rd-column .usecase-card > a { display: inline-block; padding-top: .6rem; }
.rd-column .rd-case-details dt { margin-top: .6rem; }
.rd-column .rd-case-details dd { font-size: .95em; line-height: 1.5; }

@media (max-width: 950px) {
    .lib-grid { grid-template-columns: 1fr; gap: 1.4rem; }
    .lib-nav { position: static; display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; background: transparent; padding: 0; }
    .lib-nav > strong { width: 100%; padding: 0; margin: 0 0 .2rem; }
    .lib-nav a { background: #fff; border: 1px solid var(--rd-line); border-radius: .25rem; padding: .45rem .6rem; font-size: .84rem; }
    .lib-nav a:last-child { border-bottom-color: var(--rd-line); }
    .rd-layout { grid-template-columns: 1fr; grid-template-areas: "rail" "copy"; gap: 1.35rem; }
    .rd-layout.rd-in-view::after {
        content: ""; position: fixed; top: var(--rd-pinned-top, 0); inset-inline: 0; z-index: 12;
        height: 3px; background: var(--rd-blue); pointer-events: none;
        transform: scaleX(var(--rd-mobile-read, 0)); transform-origin: left center;
    }
    .rd-rail { position: static; }
    .rd-rail-inner { padding: .8rem 1rem; }
    .rd-meter { margin-bottom: .6rem; }
    .rd-size { padding-top: .5rem; margin-top: .5rem; }
    .rd-size span { flex: 0 0 auto; margin-right: .4rem; }
}
@media (max-width: 620px) {
    .lib-searchbox input { padding-block: .9rem; font-size: 1rem; }
    .lib-shelf ul,.rd-column .usecase-grid { grid-template-columns: 1fr; }
    .lib-shelf ul { gap: .5rem; }
    .lib-shelf h2 { margin-bottom: .6rem; }
    .lib-nav a { min-height: 40px; }
    .rd-meter > div:first-child { font-size: .76rem; }
}
@media (prefers-reduced-motion: no-preference) {
    .lib-card > a, .lib-nav a { transition: background-color .16s ease, color .16s ease; }
    .rd-meter i { transition: transform 100ms linear; }
}
@media print {
    .lib-nav,.lib-tools,.rd-rail { display: none !important; }
    .lib-grid,.rd-layout { display: block; }
    .rd-column details { content-visibility: visible; }
}

.rd-column .rd-first-practice { margin: 0 0 1.2rem; }
.rd-column .rd-first-practice h2 { margin: 0 0 1.1rem; }
.rd-column .rd-first-practice ol { list-style: none; margin: 0; padding: 0; counter-reset: practice; }
.rd-column .rd-first-practice li {
    position: relative; counter-increment: practice; margin: 0; padding: .85rem 0 .85rem 3rem;
    border-top: 1px solid var(--rd-line);
}
.rd-column .rd-first-practice li::before {
    content: counter(practice); position: absolute; left: 0; top: .9rem; border-radius: 50%;
    width: 1.85rem; height: 1.85rem; display: grid; place-items: center;
    font: 700 .88rem/1 var(--sans,system-ui); color: #26439c; background: #e9edff;
}
.rd-column .rd-first-practice li > a { font-weight: 710; }
.rd-column .rd-first-practice li > p { max-width: 54ch; margin: .25rem 0 0; line-height: 1.5; }
.rd-column details.rd-preparation { margin: 0 0 clamp(2rem,5vw,3.5rem); }
.rd-column .rd-preparation > summary { padding-block: .6rem; font-size: .95em; }
.rd-column .rd-preparation[open] > summary { margin-bottom: 1.2rem; }
@media (max-width: 950px) {
    .rd-rail-inner { display: grid; grid-template-columns: 1fr auto; gap: .15rem .75rem; align-items: start; padding: .35rem .85rem .55rem; }
    .rd-rail-inner .rd-index { grid-column: 1; grid-row: 1; }
    .rd-rail-inner .rd-index summary { min-height: 44px; align-content: center; }
    .rd-rail-inner .rd-size { grid-column: 2; grid-row: 1; margin: 0; padding: 0; border: 0; }
    .rd-rail-inner .rd-size button { min-width: 44px; min-height: 44px; }
    .rd-rail-inner .rd-size span,.rd-meter > div:first-child { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
    .rd-rail-inner .rd-meter { grid-column: 1 / -1; grid-row: 2; margin: 0; }
    .rd-rail-inner .rd-meter [role=progressbar] { margin: 0; height: 3px; }
}
@media print {
    .rd-column details::details-content,.pr-ruta details::details-content { display: block!important; content-visibility: visible!important; }
}

