/* ===================================================================
   Manual de Usuario · Biblioteca Posgrado UPEA
   Estética: "Documentación Profesional Moderna" (Stripe/Linear/Tailwind Docs)
   =================================================================== */

/* ---------- Design tokens ---------- */
:root {
    /* Color — modo claro */
    --bg: #FFFFFF;
    --bg-subtle: #FAFBFC;
    --bg-raised: #FFFFFF;
    --border: #E6E8EB;
    --border-strong: #D6D9DD;
    --text: #1A1F26;
    --text-secondary: #565E68;
    --text-muted: #8891A0;

    /* Acento — azul, coincide con la UI real del sistema */
    --accent: #3B6FE0;
    --accent-hover: #2E5BC4;
    --accent-soft: #EEF2FD;
    --accent-soft-border: #D6E0FA;

    /* Semánticos */
    --info: #3B6FE0;
    --info-bg: #EEF2FD;
    --info-border: #C9D9F8;
    --warning: #B6740A;
    --warning-bg: #FEF6E7;
    --warning-border: #F3DFAE;
    --tip: #1A8F5E;
    --tip-bg: #ECFAF2;
    --tip-border: #BFE9D3;
    --danger: #C53434;
    --danger-bg: #FDEEEE;
    --danger-border: #F5C8C8;

    /* Chips de estado */
    --chip-active-bg: #E7F6EE;
    --chip-active-text: #146C43;
    --chip-warning-bg: #FEF1DD;
    --chip-warning-text: #8A5A06;
    --chip-danger-bg: #FBE7E7;
    --chip-danger-text: #A82A2A;
    --chip-neutral-bg: #EEF0F3;
    --chip-neutral-text: #525A66;

    /* Roles */
    --role-all-bg: #EEF2FD;
    --role-all-text: #2E5BC4;
    --role-staff-bg: #F1ECFB;
    --role-staff-text: #6B3FC4;
    --role-admin-bg: #FCEAEF;
    --role-admin-text: #B0285B;

    /* Tipografía */
    --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --font-mono: "JetBrains Mono", "Fira Code", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

    /* Layout */
    --sidebar-w: 280px;
    --toc-w: 220px;
    --content-max-w: 760px;
    --header-search-h: 40px;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --shadow-sm: 0 1px 2px rgba(20, 25, 35, 0.06);
    --shadow-md: 0 4px 16px rgba(20, 25, 35, 0.08);
    --shadow-lg: 0 12px 36px rgba(20, 25, 35, 0.14);
    --transition: 180ms cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
    --bg: #0D1117;
    --bg-subtle: #11161D;
    --bg-raised: #161B22;
    --border: #232A33;
    --border-strong: #2D3540;
    --text: #E6E9EE;
    --text-secondary: #9BA5B3;
    --text-muted: #6B7585;

    --accent: #6E96F2;
    --accent-hover: #88A8F5;
    --accent-soft: #16213B;
    --accent-soft-border: #283662;

    --info: #6E96F2;
    --info-bg: #131E33;
    --info-border: #28386A;
    --warning: #E0A93B;
    --warning-bg: #2B2310;
    --warning-border: #4D3D14;
    --tip: #4FCB91;
    --tip-bg: #0F2A20;
    --tip-border: #1F4A38;
    --danger: #E0696E;
    --danger-bg: #2C1517;
    --danger-border: #4D2528;

    --chip-active-bg: #103022;
    --chip-active-text: #4FCB91;
    --chip-warning-bg: #2B2310;
    --chip-warning-text: #E0A93B;
    --chip-danger-bg: #2C1517;
    --chip-danger-text: #E0696E;
    --chip-neutral-bg: #1B212A;
    --chip-neutral-text: #9BA5B3;

    --role-all-bg: #16213B;
    --role-all-text: #8FAEF5;
    --role-staff-bg: #211A38;
    --role-staff-text: #B79CEF;
    --role-admin-bg: #321824;
    --role-admin-text: #EA7FA8;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 12px 36px rgba(0, 0, 0, 0.5);
}

/* ---------- Reset ---------- */
* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.65;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    transition: background var(--transition), color var(--transition);
}

img {
    max-width: 100%;
    display: block;
}

a {
    color: var(--accent);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

code {
    font-family: var(--font-mono);
    font-size: 0.875em;
    background: var(--bg-subtle);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 0.15em 0.45em;
    color: var(--text);
}

button {
    font-family: inherit;
    cursor: pointer;
}

ul,
ol {
    padding-left: 0;
}

/* Foco visible para accesibilidad por teclado */
a:focus-visible,
button:focus-visible,
input:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: 4px;
}

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

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

/* ---------- Layout shell ---------- */
.page-shell {
    display: flex;
    margin-left: var(--sidebar-w);
}

.main-content {
    flex: 1;
    min-width: 0;
    max-width: calc(var(--content-max-w) + 96px);
    padding: 56px 48px 80px;
    margin: 0 auto;
}

@media (min-width: 1280px) {
    .page-shell {
        margin-right: 0;
    }

    .main-content {
        margin-right: var(--toc-w);
    }
}

/* ---------- Sidebar ---------- */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--sidebar-w);
    border-right: 1px solid var(--border);
    background: var(--bg-subtle);
    display: flex;
    flex-direction: column;
    z-index: 40;
    transition: transform var(--transition);
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 20px 16px 14px;
    border-bottom: 1px solid var(--border);
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    min-width: 0;
}

.brand:hover {
    text-decoration: none;
}

.brand-mark {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--accent);
    color: #fff;
    flex-shrink: 0;
}

.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.25;
    min-width: 0;
}

.brand-text strong {
    font-size: 14px;
    font-weight: 650;
    white-space: nowrap;
}

.brand-text small {
    font-size: 11.5px;
    color: var(--text-muted);
    white-space: nowrap;
}

.icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text-secondary);
    flex-shrink: 0;
    transition: background var(--transition), color var(--transition), border-color var(--transition);
}

.icon-btn:hover {
    background: var(--accent-soft);
    color: var(--accent);
    border-color: var(--accent-soft-border);
}

.icon-moon {
    display: none;
}

[data-theme="dark"] .icon-sun {
    display: none;
}

[data-theme="dark"] .icon-moon {
    display: block;
}

.sidebar-search {
    position: relative;
    margin: 14px 16px 8px;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 11px;
    color: var(--text-muted);
    pointer-events: none;
}

#search-input {
    width: 100%;
    height: var(--header-search-h);
    padding: 0 36px 0 34px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text);
    font-size: 13.5px;
    transition: border-color var(--transition), box-shadow var(--transition);
}

#search-input::placeholder {
    color: var(--text-muted);
}

#search-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
    outline: none;
}

.search-kbd {
    position: absolute;
    right: 10px;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-muted);
    background: var(--bg-subtle);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 1px 6px;
}

.search-results {
    margin: 0 16px 8px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
    max-height: 320px;
    overflow-y: auto;
}

.search-result-item {
    display: block;
    padding: 9px 12px;
    font-size: 13px;
    color: var(--text);
    border-bottom: 1px solid var(--border);
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover {
    background: var(--accent-soft);
    text-decoration: none;
}

.search-result-item strong {
    color: var(--accent);
    font-weight: 600;
}

.search-result-group {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.search-no-results {
    padding: 14px 12px;
    font-size: 13px;
    color: var(--text-muted);
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 6px 12px 16px;
}

.sidebar-nav::-webkit-scrollbar {
    width: 6px;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: var(--border-strong);
    border-radius: 3px;
}

.nav-link {
    display: block;
    padding: 7px 12px;
    margin: 1px 0;
    border-radius: var(--radius-sm);
    font-size: 13.5px;
    color: var(--text-secondary);
    position: relative;
    transition: background var(--transition), color var(--transition);
}

.nav-link:hover {
    background: var(--bg-raised);
    color: var(--text);
    text-decoration: none;
}

.nav-link.is-active {
    background: var(--accent-soft);
    color: var(--accent);
    font-weight: 600;
}

.nav-link--top {
    font-weight: 650;
    color: var(--text);
    font-size: 14px;
    margin-bottom: 8px;
}

.nav-link--featured {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--accent);
    font-weight: 600;
}

.nav-link--featured svg {
    flex-shrink: 0;
}

.nav-group {
    margin-top: 18px;
}

.nav-group-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 650;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    padding: 0 12px 6px;
    margin: 0;
}

.role-badge {
    display: inline-flex;
    align-items: center;
    font-size: 10px;
    font-weight: 650;
    text-transform: none;
    letter-spacing: 0;
    padding: 1.5px 7px;
    border-radius: 100px;
    white-space: nowrap;
}

.role-all {
    background: var(--role-all-bg);
    color: var(--role-all-text);
}

.role-staff {
    background: var(--role-staff-bg);
    color: var(--role-staff-text);
}

.role-admin {
    background: var(--role-admin-bg);
    color: var(--role-admin-text);
}

.breadcrumb-role {
    margin-left: 4px;
}

.quick-card-role {
    position: absolute;
    top: 16px;
    right: 16px;
}

.sidebar-footer {
    padding: 14px 16px;
    border-top: 1px solid var(--border);
    font-size: 11px;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    gap: 2px;
}

/* ---------- Mobile menu ---------- */
.mobile-menu-btn {
    display: none;
    position: fixed;
    top: 14px;
    left: 14px;
    z-index: 60;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text);
    box-shadow: var(--shadow-sm);
    align-items: center;
    justify-content: center;
}

.mobile-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(10, 12, 16, 0.45);
    z-index: 35;
}

@media (max-width: 960px) {
    .mobile-menu-btn {
        display: flex;
    }

    .sidebar {
        transform: translateX(-100%);
        box-shadow: var(--shadow-lg);
    }

    .sidebar.is-open {
        transform: translateX(0);
    }

    .mobile-overlay.is-open {
        display: block;
    }

    .page-shell {
        margin-left: 0;
    }

    .main-content {
        padding: 84px 20px 64px;
        max-width: 100%;
    }
}

/* ---------- Hero / Portada ---------- */
.hero-section {
    padding-top: 8px;
}

.hero-eyebrow {
    font-size: 12.5px;
    font-weight: 650;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 14px;
}

.hero-title {
    font-size: clamp(32px, 4.4vw, 46px);
    line-height: 1.12;
    font-weight: 700;
    letter-spacing: -0.01em;
    margin: 0 0 18px;
    color: var(--text);
}

.hero-title-accent {
    color: var(--accent);
}

.hero-lead {
    font-size: 17px;
    line-height: 1.6;
    color: var(--text-secondary);
    max-width: 620px;
    margin: 0 0 24px;
}

.hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 40px;
}

.meta-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-secondary);
    background: var(--bg-subtle);
    border: 1px solid var(--border);
    border-radius: 100px;
    padding: 6px 12px;
}

.meta-chip svg {
    color: var(--text-muted);
    flex-shrink: 0;
}

.hero-subhead {
    font-size: 15px;
    font-weight: 650;
    color: var(--text-secondary);
    margin: 0 0 16px;
}

.quick-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
    margin-bottom: 12px;
}

@media (max-width: 640px) {
    .quick-cards {
        grid-template-columns: 1fr;
    }
}

.quick-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 18px 18px 20px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: var(--bg-raised);
    color: var(--text);
    transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}

.quick-card:hover {
    text-decoration: none;
    border-color: var(--accent-soft-border);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.quick-card-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 9px;
    background: var(--accent-soft);
    color: var(--accent);
}

.quick-card-title {
    font-size: 15px;
    font-weight: 650;
}

.quick-card-desc {
    font-size: 13.5px;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* ---------- Content sections ---------- */
.content-section {
    padding-top: 76px;
    margin-top: -76px;
    /* compensa para anclas con scroll-margin similar */
    scroll-margin-top: 76px;
}

.content-section:first-of-type {
    padding-top: 0;
    margin-top: 0;
}

.breadcrumbs {
    font-size: 12.5px;
    color: var(--text-muted);
    margin: 0 0 10px;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.section-title {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.01em;
    margin: 0 0 14px;
    color: var(--text);
    scroll-margin-top: 90px;
}

.subsection-title {
    font-size: 18px;
    font-weight: 650;
    margin: 32px 0 12px;
    color: var(--text);
    scroll-margin-top: 90px;
}

.section-lead {
    font-size: 16px;
    color: var(--text-secondary);
    margin: 0 0 20px;
    max-width: 640px;
}

.route-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    background: var(--bg-subtle);
    border: 1px solid var(--border);
    border-radius: 100px;
    padding: 5px 8px 5px 14px;
    margin: 0 0 18px;
    color: var(--text-secondary);
}

.route-pill code {
    background: transparent;
    border: none;
    padding: 0;
    color: var(--accent);
}

.copy-btn {
    background: transparent;
    border: none;
    font-size: 12px;
    padding: 2px 6px;
    border-radius: 5px;
    color: var(--text-muted);
    transition: background var(--transition), color var(--transition);
}

.copy-btn:hover {
    background: var(--accent-soft);
    color: var(--accent);
}

.feature-list {
    list-style: none;
    margin: 0 0 4px;
    padding: 0;
}

.feature-list li {
    position: relative;
    padding: 7px 0 7px 22px;
    font-size: 15px;
    color: var(--text);
    line-height: 1.6;
    border-bottom: 1px solid var(--border);
}

.feature-list li:last-child {
    border-bottom: none;
}

.feature-list li::before {
    content: "";
    position: absolute;
    left: 2px;
    top: 16px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
    opacity: 0.55;
}

.simple-steps {
    list-style: none;
    counter-reset: step-counter;
    margin: 0 0 20px;
    padding: 0;
}

.simple-steps li {
    position: relative;
    counter-increment: step-counter;
    padding: 4px 0 4px 38px;
    margin-bottom: 10px;
    font-size: 15px;
    line-height: 1.55;
}

.simple-steps li::before {
    content: counter(step-counter);
    position: absolute;
    left: 0;
    top: 2px;
    width: 24px;
    height: 24px;
    border-radius: 7px;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 12.5px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.simple-steps--ordered-info li::before {
    background: var(--bg-subtle);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

/* ---------- Term tooltip trigger ---------- */
.term {
    border-bottom: 1.5px dotted var(--text-muted);
    cursor: help;
    font-weight: 600;
}

/* ---------- Callouts ---------- */
.callout {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 14px 16px;
    border-radius: var(--radius-md);
    border: 1px solid;
    margin: 18px 0;
    font-size: 14.5px;
    line-height: 1.55;
}

.callout-icon {
    flex-shrink: 0;
    margin-top: 1px;
    display: flex;
}

.callout-info {
    background: var(--info-bg);
    border-color: var(--info-border);
}

.callout-warning {
    background: var(--warning-bg);
    border-color: var(--warning-border);
}

.callout-tip {
    background: var(--tip-bg);
    border-color: var(--tip-border);
}

.callout-info .callout-icon {
    color: var(--info);
}

.callout-warning .callout-icon {
    color: var(--warning);
}

.callout-tip .callout-icon {
    color: var(--tip);
}

.callout a {
    font-weight: 600;
}

/* ---------- Figures / zoomable images ---------- */
.figure-block {
    margin: 20px 0 24px;
}

.figure-block--compact {
    margin: 0 0 20px;
}

.figure-zoomable {
    display: block;
    position: relative;
    width: 100%;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--bg-subtle);
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--transition), border-color var(--transition);
}

.figure-zoomable:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--accent-soft-border);
}

.figure-zoomable img {
    width: 100%;
}

.zoom-hint {
    position: absolute;
    bottom: 10px;
    right: 10px;
    font-size: 12px;
    background: rgba(20, 24, 32, 0.72);
    color: #fff;
    padding: 4px 10px;
    border-radius: 100px;
    opacity: 0;
    transition: opacity var(--transition);
}

.figure-zoomable:hover .zoom-hint {
    opacity: 1;
}

.figure-caption {
    text-align: center;
    font-size: 13px;
    color: var(--text-muted);
    margin: 8px 0 0;
    font-style: italic;
}

/* ---------- Tables ---------- */
.table-wrap {
    overflow-x: auto;
    margin: 0 0 20px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
}

.ref-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.ref-table thead th {
    text-align: left;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 650;
    color: var(--text-muted);
    background: var(--bg-subtle);
    padding: 11px 16px;
    border-bottom: 1px solid var(--border);
}

.ref-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    color: var(--text);
    vertical-align: top;
}

.ref-table tbody tr:last-child td {
    border-bottom: none;
}

.ref-table tbody tr {
    transition: background var(--transition);
}

.ref-table tbody tr:hover {
    background: var(--bg-subtle);
}

.ref-table--compact td,
.ref-table--compact th {
    padding: 9px 14px;
    font-size: 13.5px;
}

.req-mark {
    color: var(--danger);
    font-weight: 700;
}

/* Status chips */
.status-chip {
    display: inline-flex;
    align-items: center;
    font-size: 12.5px;
    font-weight: 650;
    padding: 3px 10px;
    border-radius: 100px;
    white-space: nowrap;
}

.status-active {
    background: var(--chip-active-bg);
    color: var(--chip-active-text);
}

.status-warning {
    background: var(--chip-warning-bg);
    color: var(--chip-warning-text);
}

.status-danger {
    background: var(--chip-danger-bg);
    color: var(--chip-danger-text);
}

.status-neutral {
    background: var(--chip-neutral-bg);
    color: var(--chip-neutral-text);
}

/* ---------- Search highlight ---------- */
mark.search-highlight {
    background: #FFE066;
    color: #1A1F26;
    border-radius: 3px;
    padding: 0 1px;
}

[data-theme="dark"] mark.search-highlight {
    background: #6E5A1A;
    color: #FFF3D0;
}

/* ===================================================================
   STEPPER WIDGET — elemento de firma (registrar libro nuevo)
   =================================================================== */
.content-section--featured {
    background: linear-gradient(180deg, var(--accent-soft) 0%, transparent 140px);
    border-radius: var(--radius-lg);
    padding: 32px 28px 40px;
    margin: 0 -28px;
}

[data-theme="dark"] .content-section--featured {
    background: linear-gradient(180deg, var(--accent-soft) 0%, transparent 180px);
}

.stepper-widget {
    background: var(--bg-raised);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 28px 28px 8px;
    margin: 24px 0;
}

.stepper-progress-track {
    display: flex;
    align-items: center;
    gap: 0;
    margin-bottom: 8px;
}

.stepper-dot {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: none;
    padding: 4px;
    color: var(--text-muted);
    flex-shrink: 0;
}

.stepper-dot-num {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid var(--border-strong);
    background: var(--bg);
    font-size: 13px;
    font-weight: 700;
    color: var(--text-muted);
    transition: all var(--transition);
}

.stepper-dot-label {
    font-size: 11.5px;
    font-weight: 600;
    white-space: nowrap;
    display: none;
}

@media (min-width: 560px) {
    .stepper-dot-label {
        display: block;
    }
}

.stepper-dot.is-active .stepper-dot-num {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
    box-shadow: 0 0 0 4px var(--accent-soft);
}

.stepper-dot.is-active .stepper-dot-label {
    color: var(--accent);
}

.stepper-dot.is-complete .stepper-dot-num {
    background: var(--tip);
    border-color: var(--tip);
    color: #fff;
}

.stepper-dot.is-complete .stepper-dot-label {
    color: var(--tip);
}

.stepper-dot-line {
    flex: 1;
    height: 2px;
    background: var(--border-strong);
    margin: 0 4px;
    margin-bottom: 22px;
    position: relative;
    transition: background var(--transition);
}

.stepper-dot-line.is-complete {
    background: var(--tip);
}

.stepper-progress-text {
    font-size: 13px;
    color: var(--text-muted);
    margin: 0 0 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}

.stepper-progress-text span {
    font-weight: 650;
    color: var(--text);
}

.stepper-pane {
    display: none;
    animation: fadeSlideIn 220ms ease;
}

.stepper-pane.is-active {
    display: block;
}

@keyframes fadeSlideIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.stepper-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.stepper-btn {
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 650;
    border: 1px solid var(--border-strong);
    background: var(--bg);
    color: var(--text);
    transition: all var(--transition);
}

.stepper-btn:hover {
    background: var(--bg-subtle);
}

.stepper-btn--primary {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.stepper-btn--primary:hover {
    background: var(--accent-hover);
}

.stepper-btn--success {
    background: var(--tip);
    border-color: var(--tip);
    color: #fff;
}

.stepper-btn--success:hover {
    filter: brightness(0.95);
}

.example-box {
    background: var(--bg-subtle);
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent);
    border-radius: var(--radius-md);
    padding: 16px 18px;
    margin: 20px 0;
}

.example-box-title {
    font-size: 12.5px;
    font-weight: 650;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    margin: 0 0 8px;
}

.example-box p {
    font-size: 14.5px;
    margin: 0 0 6px;
}

.example-box-note {
    color: var(--text-secondary);
    font-style: italic;
    font-size: 13.5px;
    margin: 0;
}

/* ---------- Accordion ---------- */
.accordion {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    margin: 20px 0;
}

.accordion-item {
    border-bottom: 1px solid var(--border);
}

.accordion-item:last-child {
    border-bottom: none;
}

.accordion-trigger {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 18px;
    background: var(--bg-raised);
    border: none;
    text-align: left;
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    transition: background var(--transition);
}

.accordion-trigger:hover {
    background: var(--bg-subtle);
}

.accordion-chevron {
    color: var(--text-muted);
    flex-shrink: 0;
    transition: transform var(--transition);
}

.accordion-trigger[aria-expanded="true"] .accordion-chevron {
    transform: rotate(180deg);
}

.accordion-panel {
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--transition);
    background: var(--bg-subtle);
}

.accordion-item.is-open .accordion-panel {
    max-height: 600px;
}

.accordion-panel>* {
    padding: 0 18px;
}

.accordion-panel p {
    font-size: 14.5px;
    line-height: 1.6;
    color: var(--text-secondary);
    margin: 14px 0;
}

.accordion-panel p:first-child {
    margin-top: 16px;
}

.accordion-panel p:last-child {
    margin-bottom: 16px;
}

.accordion-panel strong {
    color: var(--text);
}

/* ---------- Task grid (resumen rápido) ---------- */
.task-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin: 24px 0;
}

@media (max-width: 640px) {
    .task-grid {
        grid-template-columns: 1fr;
    }
}

.task-card {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 18px 20px;
    background: var(--bg-raised);
}

.task-card--staff {
    border-color: var(--role-staff-text);
    grid-column: 1 / -1;
}

.task-card-title {
    font-size: 15.5px;
    font-weight: 650;
    margin: 0 0 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.task-card .simple-steps {
    margin-bottom: 4px;
}

.task-card-link {
    font-size: 13.5px;
    font-weight: 650;
}

.support-box {
    background: var(--accent-soft);
    border: 1px solid var(--accent-soft-border);
    border-radius: var(--radius-md);
    padding: 20px 22px;
    margin: 28px 0;
}

.support-box-title {
    font-size: 16px;
    margin: 0 0 6px;
}

.support-box p {
    margin: 0;
    font-size: 14.5px;
    color: var(--text-secondary);
}

/* ---------- Section footer nav ---------- */
.section-footer-nav {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin: 48px 0 0;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

.footer-nav-link {
    flex: 1;
    max-width: 280px;
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text);
    transition: border-color var(--transition), box-shadow var(--transition);
}

.footer-nav-link:hover {
    text-decoration: none;
    border-color: var(--accent-soft-border);
    box-shadow: var(--shadow-sm);
}

.footer-nav-next {
    text-align: right;
    align-items: flex-end;
}

.footer-nav-link span {
    font-size: 12px;
    color: var(--text-muted);
}

.footer-nav-link strong {
    font-size: 14px;
}

/* ---------- Helpful box ---------- */
.helpful-box {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 20px 0 8px;
    font-size: 13.5px;
    color: var(--text-muted);
}

.helpful-btn {
    border: 1px solid var(--border);
    background: var(--bg);
    border-radius: 7px;
    padding: 6px 10px;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    color: var(--text-secondary);
    transition: all var(--transition);
}

.helpful-btn:hover {
    background: var(--bg-subtle);
    border-color: var(--border-strong);
}

.helpful-btn.is-selected {
    background: var(--accent-soft);
    border-color: var(--accent-soft-border);
    color: var(--accent);
}

/* Iconos pequeños inline junto a títulos (task-cards, acordeón) */
.title-icon {
    flex-shrink: 0;
    vertical-align: -3px;
    margin-right: 4px;
    color: var(--text-muted);
}

.task-card-title .title-icon {
    color: var(--accent);
}

.accordion-trigger .title-icon {
    color: var(--text-secondary);
}

.page-footer {
    margin-top: 64px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
    font-size: 13px;
    color: var(--text-muted);
    text-align: center;
}

/* ---------- TOC flotante ---------- */
.toc-floating {
    display: none;
    position: fixed;
    top: 56px;
    right: 0;
    width: var(--toc-w);
    max-height: calc(100vh - 90px);
    overflow-y: auto;
    padding: 24px 20px;
}

@media (min-width: 1280px) {
    .toc-floating {
        display: block;
    }
}

.toc-floating-title {
    font-size: 11px;
    font-weight: 650;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin: 0 0 10px;
}

.toc-floating a {
    display: block;
    font-size: 13px;
    color: var(--text-secondary);
    padding: 5px 0 5px 12px;
    border-left: 2px solid var(--border);
    margin-bottom: 1px;
    transition: color var(--transition), border-color var(--transition);
}

.toc-floating a:hover {
    color: var(--text);
    text-decoration: none;
}

.toc-floating a.is-active {
    color: var(--accent);
    border-color: var(--accent);
    font-weight: 600;
}

/* ---------- Back to top ---------- */
.back-to-top {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-lg);
    z-index: 50;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity var(--transition), transform var(--transition), background var(--transition);
    pointer-events: none;
}

.back-to-top.is-visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.back-to-top:hover {
    background: var(--accent-hover);
}

/* ---------- Lightbox ---------- */
.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(8, 10, 14, 0.88);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 40px 20px;
    animation: fadeIn 160ms ease;
}

.lightbox[hidden] {
    display: none;
}

/* el atributo hidden debe ganar sobre display:flex */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.lightbox-figure {
    max-width: min(1100px, 92vw);
    max-height: 88vh;
    margin: 0;
}

.lightbox-figure img {
    max-height: 80vh;
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    margin: 0 auto;
}

.lightbox-figure figcaption {
    text-align: center;
    color: #D7DBE2;
    font-size: 13.5px;
    margin-top: 14px;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 24px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 150ms ease;
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.18);
}

/* ---------- Glossary tooltip ---------- */
.glossary-tooltip {
    position: fixed;
    max-width: 260px;
    background: var(--text);
    color: var(--bg);
    font-size: 13px;
    line-height: 1.5;
    padding: 10px 13px;
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    z-index: 90;
    pointer-events: none;
}

[data-theme="dark"] .glossary-tooltip {
    background: #2A323D;
    color: var(--text);
}

/* ---------- Toast ---------- */
.toast {
    position: fixed;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: var(--text);
    color: var(--bg);
    font-size: 13.5px;
    font-weight: 600;
    padding: 10px 18px;
    border-radius: 100px;
    box-shadow: var(--shadow-lg);
    z-index: 110;
    opacity: 0;
    transition: opacity 200ms ease, transform 200ms ease;
}

.toast.is-visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

[data-theme="dark"] .toast {
    background: #2A323D;
    color: var(--text);
}

/* ---------- Scroll reveal ---------- */
[data-reveal] {
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 420ms ease, transform 420ms ease;
}

[data-reveal].is-visible {
    opacity: 1;
    transform: translateY(0);
}