:root {
    --doc-font-scale: 1;
    --doc-font-base-size: 0.9rem;
    --docs-navbar-height: 56px;
    --docs-toolbar-height-offset: 64px;
    --docs-sticky-offset: var(--docs-toolbar-height-offset);
    --docs-anchor-offset: calc(var(--docs-toolbar-height-offset) + 1rem);
    --dp-panel-gap: 1rem;
    --dp-soft-border: rgba(15, 23, 42, 0.08);
    --dp-muted: #64748b;
}

.dp-context-header {
    margin-bottom: 1rem;
    border: 0;
}

.dp-context-header__row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.dp-context-header__main {
    min-width: 0;
    flex: 1 1 22rem;
}

.dp-context-header__actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: .75rem;
    flex-wrap: wrap;
}

.dp-section-tabs .nav-link {
    font-weight: 600;
}

.dp-status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: .35rem .7rem;
    border-radius: 999px;
    font-size: .75rem;
    font-weight: 700;
    line-height: 1;
}

.dp-status-badge-neutral {
    color: #475569;
    background: #e2e8f0;
}

.dp-status-badge-info {
    color: #0f3d75;
    background: #dbeafe;
}

.dp-status-badge-success {
    color: #166534;
    background: #dcfce7;
}

.dp-status-badge-warning {
    color: #92400e;
    background: #fef3c7;
}

.dp-status-badge-danger {
    color: #991b1b;
    background: #fee2e2;
}

.dp-danger-zone {
    border: 1px solid rgba(220, 53, 69, 0.2);
}

.dp-danger-zone .card-body {
    background: linear-gradient(180deg, rgba(220, 53, 69, 0.04) 0%, rgba(220, 53, 69, 0.01) 100%);
}

.doc-context-menu-expand-icon {
    font-size: 1.15rem;
    font-weight: 700;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: #f8f9fa;
}

.breadcrumb {
    margin-bottom: 1rem;
}

.docs-layout {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr) 240px;
    gap: 1rem;
    align-items: start;
}

.docs-main {
    min-width: 0;
}

.docs-layout.docs-layout-wide {
    grid-template-columns: 1fr;
}

.docs-layout.docs-layout-edit {
    grid-template-columns: 280px minmax(0, 1fr);
}

.docs-layout.docs-layout-no-page-toc {
    grid-template-columns: 280px minmax(0, 1fr);
}

.docs-layout.docs-layout-edit.docs-layout-wide {
    grid-template-columns: 1fr;
}

.docs-layout.docs-sidebars-collapsed {
    grid-template-columns: minmax(0, 1fr);
}

.docs-layout.docs-toc-panel-collapsed {
    grid-template-columns: 2.5rem minmax(0, 1fr);
    gap: .35rem;
}

.docs-layout.docs-sidebars-collapsed > .docs-sidebar-left,
.docs-layout.docs-sidebars-collapsed > .docs-sidebar-right {
    display: none;
}

.docs-layout.docs-toc-panel-collapsed > .docs-sidebar-right {
    display: none;
}

main.container.docs-container-expanded {
    max-width: none;
    width: 100%;
    box-sizing: border-box;
}

.docs-sidebar-left,
.docs-sidebar-right {
    position: sticky;
    top: var(--docs-sticky-offset);
}

.docs-toolbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    margin-top: 0;
}

.mobile-page-toc-separator {
    border-top: 1px solid #dee2e6;
    margin: 0 0 1rem;
}

.docs-page {
    margin-top: -1.5rem;
}

.docs-toolbar .breadcrumb {
    margin-bottom: 0;
}

.docs-toolbar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.docs-toolbar-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: .5rem;
    flex-wrap: wrap;
    flex: 0 1 auto;
}

.docs-toolbar-header nav {
    min-width: 0;
    flex: 1 1 auto;
}

.doc-actions-dropdown .dropdown-toggle {
    white-space: nowrap;
}

.doc-actions-dropdown .dropdown-menu {
    min-width: 20rem;
    padding: .2rem;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 1rem;
    box-shadow: 0 1rem 2.5rem rgba(15, 23, 42, 0.12);
}

.doc-context-menu {
    min-width: 20rem;
    padding: .2rem;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 1rem;
    box-shadow: 0 1rem 2.5rem rgba(15, 23, 42, 0.12);
}

.doc-actions-dropdown .dropdown-header {
    padding: .25rem .5rem .15rem;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: #6c757d;
}

.doc-actions-dropdown .dropdown-item,
.doc-actions-dropdown .dropdown-action-button {
    display: flex;
    align-items: center;
    gap: .325rem;
    padding: .25rem .45rem;
    border-radius: .5rem;
    font-size: .875rem;
    line-height: 1.2;
}

.doc-context-menu .dropdown-item,
.doc-context-menu .dropdown-action-button {
    display: flex;
    align-items: center;
    gap: .325rem;
    padding: .25rem .45rem;
    border-radius: .5rem;
    font-size: .875rem;
    line-height: 1.2;
}

.doc-actions-dropdown .dropdown-action-button {
    width: 100%;
    border: 0;
    background: transparent;
    text-align: left;
}

.doc-actions-dropdown-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.2rem;
    flex: 0 0 1.2rem;
    font-size: .85rem;
}

.doc-actions-dropdown .dropdown-divider {
    margin: .15rem 0;
}

.doc-actions-dropdown .dropdown-submenu {
    position: relative;
}

.doc-actions-dropdown .dropdown-submenu-toggle {
    width: 100%;
    border: 0;
    background: transparent;
    text-align: left;
}

.doc-actions-dropdown .dropdown-submenu-caret {
    margin-left: auto;
    color: #6c757d;
}

.doc-actions-dropdown .dropdown-submenu-menu {
    top: 0;
    left: calc(100% - .35rem);
    margin-top: -.2rem;
    min-width: 18rem;
}

.doc-actions-dropdown .dropdown-submenu:hover > .dropdown-submenu-menu,
.doc-actions-dropdown .dropdown-submenu:focus-within > .dropdown-submenu-menu {
    display: block;
}

.doc-context-menu .dropdown-divider {
    margin: .15rem 0;
}

.docs-toolbar-header .breadcrumb {
    flex-wrap: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.docs-toolbar .breadcrumb a,
.doc-tree a,
.directory-tree a,
.page-toc a {
    color: inherit;
    text-decoration: none;
}

.docs-toolbar .breadcrumb a:hover,
.doc-tree a:hover,
.directory-tree a:hover,
.page-toc a:hover {
    color: inherit;
    text-decoration: none;
}

.sidebar-title {
    margin-bottom: 1rem;
    font-weight: 700;
}

.sidebar-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    margin-bottom: .7rem;
}

.toc-panel-toggle-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: .12rem .25rem;
    line-height: 1;
}

.toc-panel-toggle-row {
    display: flex;
    justify-content: flex-end;
}

.toc-panel-toggle-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.docs-layout.docs-toc-panel-collapsed > .docs-sidebar-left .card-body > :not(.toc-panel-toggle-row) {
    display: none;
}

.docs-layout.docs-toc-panel-collapsed > .docs-sidebar-left,
.docs-layout.docs-toc-panel-collapsed > .docs-sidebar-left .card-body {
    overflow: hidden;
}

.docs-layout.docs-toc-panel-collapsed > .docs-sidebar-left .card-body {
    min-height: 0;
    padding: .35rem .15rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.docs-layout.docs-toc-panel-collapsed > .docs-sidebar-left,
.docs-layout.docs-toc-panel-collapsed > .docs-sidebar-left .doc-tree,
.docs-layout.docs-toc-panel-collapsed > .docs-sidebar-left .doc-tree-item,
.docs-layout.docs-toc-panel-collapsed > .docs-sidebar-left .doc-tree-label,
.docs-layout.docs-toc-panel-collapsed > .docs-sidebar-left .doc-tree-title-link,
.docs-layout.docs-toc-panel-collapsed > .docs-sidebar-left .doc-tree-title-text,
.docs-layout.docs-toc-panel-collapsed > .docs-sidebar-left .doc-tree-children,
.docs-layout.docs-toc-panel-collapsed > .docs-sidebar-left .sidebar-title-row,
.docs-layout.docs-toc-panel-collapsed > .docs-sidebar-left .mobile-page-toc {
    max-width: 100%;
    overflow: hidden;
}

.docs-layout.docs-toc-panel-collapsed > .docs-sidebar-left {
    align-self: start;
}

.docs-layout.docs-toc-panel-collapsed > .docs-sidebar-left .toc-panel-toggle-button {
    width: 100%;
    justify-content: center;
    padding: .12rem .2rem;
}

.sidebar-title-actions {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
}

.sidebar-title-menu-trigger,
.sidebar-expand-trigger,
.sidebar-collapse-trigger,
.doc-tree-ctx-trigger {
    border: none;
    background: transparent;
    color: #6c757d;
    cursor: pointer;
    padding: 0 3px;
    margin-left: auto;
    font-size: 13px;
    line-height: 1;
    opacity: .35;
    transition: opacity .15s;
    flex-shrink: 0;
}

.sidebar-expand-trigger,
.sidebar-collapse-trigger {
    opacity: .85;
    font-size: 19px;
    font-weight: 700;
    padding: 0 4px;
}

.sidebar-expand-trigger {
    color: #198754;
}

.sidebar-collapse-trigger {
    color: #dc3545;
}

.sidebar-title-row:hover .sidebar-title-menu-trigger,
.sidebar-title-row:hover .sidebar-expand-trigger,
.sidebar-title-row:hover .sidebar-collapse-trigger,
.doc-tree-label:hover .doc-tree-ctx-trigger {
    opacity: 1;
}

.doc-tree,
.directory-tree,
.page-toc {
    font-size: calc(var(--doc-font-base-size) * 0.95 * var(--doc-font-scale));
}

.page-toc {
    list-style: none;
    padding-left: 0;
    margin-bottom: 0;
}

.doc-tree-item,
.directory-tree-item,
.page-toc li {
    margin-bottom: 0.35rem;
}

.page-toc li {
    position: relative;
    padding-left: 1rem;
}

.page-toc li::before {
    content: "•";
    position: absolute;
    left: 0;
    top: 0;
    color: #6c757d;
    font-weight: 700;
}

.doc-meta {
    font-size: 0.78rem;
    line-height: 1.35;
}

.doc-meta span {
    white-space: nowrap;
}

.doc-tree > .doc-tree-item {
    margin-bottom: .45rem;
}

.doc-tree-item > .doc-tree-children {
    margin-top: .45rem;
}

.doc-tree-children > .doc-tree-item {
    margin-bottom: 0;
}

.doc-tree-children {
    margin-left: 1rem;
    padding-left: 0.75rem;
    border-left: 1px solid #dee2e6;
}

.doc-tree-item.is-current > .doc-tree-label > a {
    font-weight: 700;
}

.doc-tree-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.doc-tree-item[data-hidden="true"][data-deleted="false"] > .doc-tree-label,
.doc-tree-item[data-hidden="true"][data-deleted="false"] > .doc-tree-label > a,
.doc-tree-item[data-hidden="true"][data-deleted="false"] > .doc-tree-label > .doc-tree-title-text {
    color: #868e96;
}

.doc-tree-item-trash {
    margin-top: 1rem;
    padding-top: .5rem;
    border-top: 1px solid #e5e7eb;
}

.doc-tree-trash-icon {
    display: inline-flex;
    margin-right: .35rem;
}

.doc-tree-title-trash {
    font-weight: 600;
}

.doc-tree-title-strikethrough {
    text-decoration: line-through;
}

.doc-tree-visibility-indicator {
    margin-left: auto;
    font-size: .82rem;
    opacity: .75;
}

.chapter-overview-list {
    padding-left: 1.1rem;
    margin-bottom: 0;
}

.chapter-overview-list > li + li {
    margin-top: .45rem;
}

.chapter-overview-list ul {
    margin-top: .3rem;
    padding-left: 1.15rem;
}

.chapter-overview-list ul > li + li {
    margin-top: .18rem;
}

.doc-tree-label-deleted,
.doc-tree-item-deleted > .doc-tree-label {
    color: #a61e2b;
}

.doc-tree-item-deleted[data-trash-entry="false"] > .doc-tree-label > a,
.doc-tree-item-deleted[data-trash-entry="false"] > .doc-tree-label > .doc-tree-title-text {
    text-decoration: line-through;
}

.doc-tree-label-trash,
.doc-tree-item-trash > .doc-tree-label {
    color: #9a4d00;
    cursor: pointer;
}

.doc-tree-label-directory {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.doc-tree-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    text-align: center;
    flex: 0 0 auto;
    width: 1rem;
    min-width: 1rem;
    line-height: 1;
    font-weight: 700;
}

.doc-tree-toggle:hover {
    color: inherit;
}

.doc-tree-caret {
    display: inline-block;
    width: 1rem;
    color: #6c757d;
}

.doc-tree-title-link {
    flex: 1 1 auto;
}

.directory-tree-icon {
    display: inline-block;
    width: 1rem;
    color: #6c757d;
}

.markdown-body {
    max-width: 100%;
}

.docs-layout.docs-toc-panel-collapsed .markdown-body .card-body,
.docs-layout.docs-sidebars-collapsed .markdown-body .card-body {
    max-width: none;
}

.docs-layout.docs-toc-panel-collapsed,
.docs-layout.docs-sidebars-collapsed {
    width: 100%;
}

.markdown-body img,
.editor-preview img {
    max-width: 100%;
    height: auto;
}

.markdown-body img.doc-image-loading,
.editor-preview img.doc-image-loading {
    min-height: clamp(8rem, 22vw, 16rem);
    background: linear-gradient(90deg, #eef1f5 0%, #dde4ec 50%, #eef1f5 100%);
    background-size: 200% 100%;
    animation: doc-image-placeholder-shimmer 1.25s ease-in-out infinite;
    border-radius: .75rem;
}

.markdown-body img.doc-image-error,
.editor-preview img.doc-image-error {
    min-height: clamp(8rem, 22vw, 16rem);
    background: #f8d7da;
    border-radius: .75rem;
}

@keyframes doc-image-placeholder-shimmer {
    from {
        background-position: 200% 0;
    }

    to {
        background-position: -200% 0;
    }
}

.markdown-body .card-body {
    max-width: 100ch;
    font-family: var(--doc-content-font-family, inherit);
    font-size: calc(var(--doc-content-font-size, 1rem) * var(--doc-font-scale));
}

.docs-sidebars-collapsed .markdown-body .card-body {
    max-width: none;
}

/*
 * Cabecera y pie personalizados del space: son "chrome" del portal, no contenido
 * editorial, así que deben usar la fuente y el tamaño por defecto del portal (los
 * mismos que el body) y NO heredar los ajustes de fuente configurados para el
 * contenido del space, ni la escala A-/A+ que el usuario aplica al texto.
 * Aunque las variables --doc-content-* se declaran en el inline style de
 * .markdown-body (y por tanto no deberían cascadear aquí), dejamos estos resets
 * explícitos como red de seguridad frente a posibles reglas futuras.
 */
.space-header-custom,
.space-footer-custom,
.space-header-custom p,
.space-footer-custom p,
.space-header-custom li,
.space-footer-custom li,
.space-header-custom h1,
.space-footer-custom h1,
.space-header-custom h2,
.space-footer-custom h2,
.space-header-custom h3,
.space-footer-custom h3,
.space-header-custom h4,
.space-footer-custom h4,
.space-header-custom h5,
.space-footer-custom h5,
.space-header-custom h6,
.space-footer-custom h6 {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.space-header-custom,
.space-footer-custom {
    font-size: .9rem;
    color: #4a5560;
}

.space-footer-custom {
    border-top: 1px solid #e5e7eb;
    padding-top: .75rem;
}

.space-header-custom {
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: .75rem;
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4,
.markdown-body h5,
.markdown-body h6,
.editor-preview h1,
.editor-preview h2,
.editor-preview h3,
.editor-preview h4,
.editor-preview h5,
.editor-preview h6 {
    margin-top: 1.25rem;
    margin-bottom: .75rem;
    scroll-margin-top: var(--docs-anchor-offset);
}

html {
    scroll-padding-top: var(--docs-anchor-offset);
}

.markdown-body h1,
.editor-preview h1 { font-size: calc(2rem * var(--doc-font-scale) * var(--doc-content-font-ratio, 1)); }
.markdown-body h2,
.editor-preview h2 { font-size: calc(1.75rem * var(--doc-font-scale) * var(--doc-content-font-ratio, 1)); }
.markdown-body h3,
.editor-preview h3 { font-size: calc(1.5rem * var(--doc-font-scale) * var(--doc-content-font-ratio, 1)); }
.markdown-body h4,
.editor-preview h4 { font-size: calc(1.25rem * var(--doc-font-scale) * var(--doc-content-font-ratio, 1)); }
.markdown-body h5,
.editor-preview h5 { font-size: calc(1.1rem * var(--doc-font-scale) * var(--doc-content-font-ratio, 1)); }
.markdown-body h6,
.editor-preview h6 { font-size: calc(1rem * var(--doc-font-scale) * var(--doc-content-font-ratio, 1)); }

.markdown-body pre,
.editor-preview pre {
    background: #f5f5f5;
    padding: 1rem;
    overflow-x: auto;
    border-radius: .5rem;
}

.markdown-body code,
.editor-preview code {
    font-family: Consolas, "Courier New", monospace;
}

.markdown-body .mermaid-diagram,
.editor-preview .mermaid-diagram {
    margin: 1.25rem 0;
    padding: 1rem;
    overflow-x: auto;
    border: 1px solid #dbe4ef;
    border-radius: .5rem;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06);
}

.markdown-body .mermaid-diagram svg,
.editor-preview .mermaid-diagram svg,
.markdown-body .mermaid-diagram img,
.editor-preview .mermaid-diagram img {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 0 auto;
}

.markdown-body .mermaid-diagram-error,
.editor-preview .mermaid-diagram-error {
    border-color: #f1aeb5;
    background: #fff5f5;
}

.markdown-body blockquote,
.editor-preview blockquote {
    margin: 0 0 1rem;
    padding: .75rem 1rem;
    border-left: 4px solid #0d6efd;
    background-color: #f8f9fa;
}

.markdown-body .mdx-callout,
.editor-preview .mdx-callout {
    margin: 0 0 1rem;
    padding: .625rem .8rem;
    border-radius: .75rem;
    border: 1px solid transparent;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
}

.markdown-body .mdx-callout-title,
.editor-preview .mdx-callout-title {
    font-weight: 700;
    margin-bottom: .35rem;
    font-size: calc(1rem * var(--doc-font-scale) * var(--doc-content-font-ratio, 1));
}

.markdown-body .mdx-callout-tip,
.editor-preview .mdx-callout-tip,
.markdown-body .mdx-callout-note,
.editor-preview .mdx-callout-note,
.markdown-body .mdx-callout-check,
.editor-preview .mdx-callout-check {
    color: #084298;
    background: linear-gradient(180deg, #e7f1ff 0%, #dbeafe 100%);
    border-color: #9ec5fe;
}

.markdown-body .mdx-callout-warning,
.editor-preview .mdx-callout-warning {
    color: #664d03;
    background: linear-gradient(180deg, #fff3cd 0%, #ffe69c 100%);
    border-color: #ffda6a;
}

.markdown-body .check,
.editor-preview .check,
.markdown-body .tip,
.editor-preview .tip,
.markdown-body .note,
.editor-preview .note,
.markdown-body .warning,
.editor-preview .warning {
    margin: 0 0 1rem;
    padding: .45rem .65rem;
    border-radius: .75rem;
    border: 1px solid transparent;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
}

.markdown-body .check > :first-child,
.editor-preview .check > :first-child,
.markdown-body .tip > :first-child,
.editor-preview .tip > :first-child,
.markdown-body .note > :first-child,
.editor-preview .note > :first-child,
.markdown-body .warning > :first-child,
.editor-preview .warning > :first-child {
    margin-top: 0;
}

.markdown-body .check > :last-child,
.editor-preview .check > :last-child,
.markdown-body .tip > :last-child,
.editor-preview .tip > :last-child,
.markdown-body .note > :last-child,
.editor-preview .note > :last-child,
.markdown-body .warning > :last-child,
.editor-preview .warning > :last-child {
    margin-bottom: 0;
}

.markdown-body .check,
.editor-preview .check,
.markdown-body .tip,
.editor-preview .tip,
.markdown-body .note,
.editor-preview .note {
    color: #084298;
    background: linear-gradient(180deg, #e7f1ff 0%, #dbeafe 100%);
    border-color: #9ec5fe;
}

.markdown-body .warning,
.editor-preview .warning {
    color: #664d03;
    background: linear-gradient(180deg, #fff3cd 0%, #ffe69c 100%);
    border-color: #ffda6a;
}

.markdown-body details.mdx-accordion,
.editor-preview details.mdx-accordion {
    margin-bottom: 1rem;
    border: 1px solid #dee2e6;
    border-radius: .5rem;
    background-color: #fff;
    overflow: hidden;
}

.markdown-body details.mdx-accordion > summary,
.editor-preview details.mdx-accordion > summary {
    padding: .75rem 1rem;
    font-weight: 600;
    cursor: pointer;
    background-color: #f8f9fa;
}

.markdown-body details.mdx-accordion > :not(summary),
.editor-preview details.mdx-accordion > :not(summary) {
    padding-left: 1rem;
    padding-right: 1rem;
}

.markdown-body .mdx-accordion-group,
.editor-preview .mdx-accordion-group {
    display: grid;
    gap: .75rem;
    margin-bottom: 1rem;
}

.markdown-body .mdx-accordion-body,
.editor-preview .mdx-accordion-body {
    padding: 1rem;
    border-top: 1px solid #dee2e6;
}

.markdown-body .mdx-steps,
.editor-preview .mdx-steps {
    list-style: none;
    margin: 0 0 1.25rem;
    padding: 0;
    display: grid;
    gap: 1rem;
}

.markdown-body .mdx-step,
.editor-preview .mdx-step {
    display: grid;
    grid-template-columns: 2rem minmax(0, 1fr);
    gap: .75rem;
    align-items: start;
    padding: .7rem .8rem;
    border: 1px solid #dbe4ff;
    border-radius: .85rem;
    background: #fff;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.06);
}

.markdown-body .mdx-step-marker,
.editor-preview .mdx-step-marker {
    width: 1.65rem;
    height: 1.65rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, #0d6efd 0%, #0b5ed7 100%);
    color: #fff;
    font-weight: 700;
    font-size: calc(.8rem * var(--doc-font-scale) * var(--doc-content-font-ratio, 1));
    box-shadow: 0 4px 10px rgba(13, 110, 253, 0.25);
}

.markdown-body .mdx-step-title,
.editor-preview .mdx-step-title {
    font-size: calc(1rem * var(--doc-font-scale) * var(--doc-content-font-ratio, 1));
    font-weight: 700;
    margin-bottom: .2rem;
}

.markdown-body .mdx-step-body,
.editor-preview .mdx-step-body {
    font-size: calc(var(--doc-content-font-size, 1rem) * var(--doc-font-scale));
}

.markdown-body .mdx-card-grid,
.editor-preview .mdx-card-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(var(--mdx-card-cols, 2), minmax(0, 1fr));
    margin-bottom: 1.25rem;
}

.markdown-body .mdx-card,
.editor-preview .mdx-card {
    display: flex;
    flex-direction: column;
    gap: .55rem;
    min-height: 100%;
    padding: .75rem .85rem;
    border: 1px solid #dee2e6;
    border-radius: .85rem;
    background: #fff;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}

.markdown-body .mdx-card:hover,
.editor-preview .mdx-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.12);
    border-color: #bfd0ff;
}

.markdown-body .mdx-card-title,
.editor-preview .mdx-card-title {
    font-weight: 700;
    font-size: calc(1rem * var(--doc-font-scale) * var(--doc-content-font-ratio, 1));
}

.markdown-body .mdx-card-header,
.editor-preview .mdx-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
}

.markdown-body .mdx-card-link,
.editor-preview .mdx-card-link {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    color: #0d6efd;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    font-size: calc(.92rem * var(--doc-font-scale) * var(--doc-content-font-ratio, 1));
}

.markdown-body .mdx-card-link::after,
.editor-preview .mdx-card-link::after {
    content: '→';
}

.markdown-body .mdx-card-link:hover,
.editor-preview .mdx-card-link:hover {
    color: #0a58ca;
    text-decoration: none;
}

.markdown-body .mdx-card-body,
.editor-preview .mdx-card-body {
    font-size: calc(var(--doc-content-font-size, 1rem) * var(--doc-font-scale));
}

.markdown-body .mdx-inline-image,
.editor-preview .mdx-inline-image {
    display: block;
    margin: .75rem 0;
}

.markdown-body .mdx-inline-image.mdx-inline-image-center img,
.editor-preview .mdx-inline-image.mdx-inline-image-center img {
    margin-left: auto;
    margin-right: auto;
}

.markdown-body .mdx-inline-image.mdx-inline-image-right img,
.editor-preview .mdx-inline-image.mdx-inline-image-right img {
    margin-left: auto;
}

.markdown-body .mdx-inline-image img,
.editor-preview .mdx-inline-image img {
    display: block;
    max-width: 100%;
    height: auto;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
}

.markdown-body table,
.editor-preview table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
}

.markdown-body table th,
.markdown-body table td,
.editor-preview table th,
.editor-preview table td {
    border: 1px solid #dee2e6;
    padding: .5rem;
}

/* ── Video slide tags ── */
.markdown-body .mdx-new-slide {
    display: none !important;
}

.markdown-body .mdx-keep-with-previous {
    display: none !important;
}

.markdown-body .mdx-keep-together {
    display: contents;
}

.editor-preview hr.mdx-new-slide {
    display: block !important;
    all: unset;
    display: block !important;
    border: none;
    border-top: 3px dashed #6366f1;
    margin: 1rem 0;
    opacity: 0.6;
    position: relative;
}

.editor-preview hr.mdx-new-slide::after {
    content: "nueva diapositiva";
    position: absolute;
    top: -0.65em;
    left: 50%;
    transform: translateX(-50%);
    background: #fff;
    padding: 0 0.5em;
    font-size: 0.7rem;
    color: #6366f1;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.editor-preview .mdx-keep-together {
    display: block !important;
    border: 1.5px dotted #10b981;
    border-radius: 4px;
    padding: 0.25rem;
    margin: 0.5rem 0;
    position: relative;
}

.editor-preview .mdx-keep-together::before {
    content: "mantener junto";
    position: absolute;
    top: -0.6em;
    left: 0.75em;
    background: #fff;
    padding: 0 0.4em;
    font-size: 0.65rem;
    color: #10b981;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.editor-preview .mdx-keep-with-previous {
    display: block !important;
    all: unset;
    display: block !important;
    border: none;
    border-top: 3px dashed #f59e0b;
    margin: 1rem 0;
    opacity: 0.75;
    position: relative;
}

.editor-preview .mdx-keep-with-previous::before {
    content: "mantener con la anterior";
    position: absolute;
    top: -0.7em;
    left: 50%;
    transform: translateX(-50%);
    background: #fff;
    padding: 0 0.5em;
    font-size: 0.7rem;
    color: #f59e0b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.page-toc .toc-level-2 { margin-left: 0.75rem; }
.page-toc .toc-level-3 { margin-left: 1.5rem; }
.page-toc .toc-level-4 { margin-left: 2.25rem; }
.page-toc .toc-level-5 { margin-left: 3rem; }
.page-toc .toc-level-6 { margin-left: 3.75rem; }

.editor-split {
    --editor-pane-height: 70vh;
    display: grid;
    gap: 1rem;
    align-items: start;
}

.editor-code-only {
    grid-template-columns: 1fr;
}

.editor-split-two-columns {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.editor-pane {
    min-width: 0;
}

.editor-toolbar-custom {
    background-color: #fff;
}

.editor-pane-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    margin-bottom: .5rem;
}

.editor-pane-status {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: .125rem;
}

.editor-save-status {
    text-align: right;
    font-weight: 600;
    color: #198754;
}

.editor-save-status.is-dirty {
    color: #b45309;
}

.editor-save-status.is-saving {
    color: #0d6efd;
}

.editor-image-status {
    text-align: right;
}

.editor-toolbar-custom .btn-toolbar {
    align-items: center;
}

.editor-toolbar-row + .editor-toolbar-row {
    margin-top: .5rem;
}

.editor-toolbar-row-images {
    justify-content: flex-start;
}

.editor-tool-button {
    min-width: 2.25rem;
    min-height: calc(1.5em + .5rem + 2px);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.editor-tool-button-wide {
    min-width: auto;
    padding-inline: .75rem;
    white-space: nowrap;
}

.editor-tool-button.active {
    color: #fff;
    background-color: #0d6efd;
    border-color: #0d6efd;
}

::highlight(editor-preview-selection) {
    background-color: rgba(13, 110, 253, 0.25);
}

.editor-preview-image-selected {
    outline: 3px solid rgba(13, 110, 253, 0.55);
    outline-offset: 2px;
}

.editor-source-fallback.editor-drop-active,
.editor-preview.editor-drop-active {
    outline: 2px dashed #0d6efd;
    outline-offset: -4px;
    background-color: #eef5ff;
}

.editor-source-shell {
    position: relative;
    height: var(--editor-pane-height);
    border: 1px solid #dee2e6;
    border-radius: .375rem;
    background-color: #fff;
    overflow: hidden;
}

.editor-source-shell:focus-within {
    border-color: #dee2e6;
    box-shadow: none;
}

.editor-source-highlight,
.editor-source-fallback {
    font-family: Consolas, "Courier New", monospace;
    font-size: .95rem;
    font-weight: 400;
    font-style: normal;
    letter-spacing: normal;
    word-spacing: normal;
    font-kerning: none;
    font-variant-ligatures: none;
    font-feature-settings: "liga" 0, "calt" 0;
    position: absolute;
    inset: 0;
    margin: 0;
    padding: calc(.375rem + 1px) calc(.75rem + 1px);
    white-space: pre-wrap;
    word-break: break-word;
    overflow-wrap: break-word;
    tab-size: 4;
    line-height: 1.5;
    box-sizing: border-box;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-gutter: stable;
}

.editor-source-highlight {
    pointer-events: none;
    color: transparent;
    background: transparent;
    z-index: 0;
}

.editor-source-highlight-markers {
    position: relative;
    min-height: 100%;
    width: 100%;
}

.editor-source-line-marker {
    position: absolute;
    left: 0;
    right: 0;
    border-left: 3px solid #f97316;
    border-radius: .3rem;
    background: linear-gradient(90deg, rgba(249, 115, 22, 0.14) 0%, rgba(249, 115, 22, 0.07) 100%);
}

.editor-source-line-marker-admin {
    border-left-color: #b78103;
    background: linear-gradient(90deg, rgba(255, 243, 205, 0.92) 0%, rgba(255, 251, 230, 0.78) 100%);
}

.editor-source-line-marker-admin-start {
    box-shadow: inset 0 1px 0 rgba(183, 129, 3, 0.35);
}

.editor-source-line-marker-admin-end {
    box-shadow: inset 0 -1px 0 rgba(183, 129, 3, 0.35);
}

.editor-source-fallback {
    resize: none;
    z-index: 1;
    color: #212529 !important;
    background: transparent;
    caret-color: #212529;
    -webkit-text-fill-color: #212529 !important;
    border: 0;
    outline: 0;
}

.editor-source-fallback.editor-source-fallback-plain {
    color: #212529 !important;
    background: #fff;
    caret-color: #212529;
    -webkit-text-fill-color: #212529 !important;
}

.editor-source-fallback::selection {
    color: #212529;
    -webkit-text-fill-color: #212529;
    background: rgba(13, 110, 253, .22);
}

.editor-source-fallback.editor-source-fallback-plain::selection {
    color: #212529;
    -webkit-text-fill-color: #212529;
    background: rgba(13, 110, 253, .22);
}

.editor-token-comment {
    color: #6c757d;
}

.editor-token-fence,
.editor-token-heading-marker,
.editor-token-block-marker {
    color: #6f42c1;
}

.editor-token-language,
.editor-token-attr-name {
    color: #b45309;
}

.editor-token-tag,
.editor-token-expression {
    color: #0d6efd;
}

.editor-token-image-tag {
    color: #c2410c;
}

.editor-token-image-attr-name {
    color: #9a3412;
}

.editor-token-image-string {
    color: #ea580c;
}

.editor-token-punctuation {
    color: #495057;
}

.editor-token-string,
.editor-token-link-url {
    color: #198754;
}

.editor-token-link-text,
.editor-token-inline-code,
.editor-token-code-block {
    color: #212529;
}

.editor-token-inline-code,
.editor-token-code-block {
    background-color: rgba(13, 110, 253, .06);
}

.editor-token-inline-code {
    border-radius: .2rem;
}

.editor-source-fallback:focus,
.editor-source-fallback:focus-visible,
.editor-source-fallback.form-control:focus,
.editor-source-fallback.form-control:focus-visible {
    outline: 0 !important;
    outline-width: 0 !important;
    box-shadow: none !important;
    border-color: transparent !important;
}

.preview-toolbar-spacer {
    margin-bottom: .5rem;
}

.editor-preview {
    height: var(--editor-pane-height);
    overflow: auto;
    font-family: var(--doc-content-font-family, inherit);
    font-size: calc(var(--doc-content-font-size, 1rem) * var(--doc-font-scale));
}

.editor-pane.preview-pane {
    display: flex;
    flex-direction: column;
}

.editor-preview,
.editor-preview p,
.editor-preview li,
.editor-preview blockquote,
.editor-preview table,
.editor-preview .text-muted,
.editor-preview .mdx-callout,
.editor-preview .check,
.editor-preview .tip,
.editor-preview .note,
.editor-preview .warning,
.editor-preview .mdx-accordion-body,
.editor-preview details.mdx-accordion > summary,
.editor-preview .mdx-step-body,
.editor-preview .mdx-step-title,
.editor-preview .mdx-card-title,
.editor-preview .mdx-card-link,
.editor-preview .mdx-card-body {
    font-family: var(--doc-content-font-family, inherit);
}

body.modal-open {
    overflow: hidden;
}

.editor-settings-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1080;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(15, 23, 42, 0.45);
}

.editor-settings-modal {
    width: min(100%, 40rem);
    max-height: calc(100vh - 2rem);
    overflow: auto;
    border: 0;
}

body.docs-edit-full-width main.container {
    width: calc(100vw - 2rem);
    max-width: none;
    box-sizing: border-box;
    margin-left: auto;
    margin-right: auto;
    padding-left: 1rem;
    padding-right: 1rem;
}

@media (max-width: 1399.98px) {
    .docs-layout {
        grid-template-columns: 240px minmax(0, 1fr);
    }

    .mobile-page-toc {
        display: block !important;
    }

    .docs-sidebar-right {
        display: none !important;
    }
}

@media (min-width: 1400px) {
    .mobile-page-toc {
        display: none !important;
    }

    .docs-sidebar-right {
        display: block !important;
    }
}

@media (max-width: 900px) {
    .editor-split-two-columns {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .editor-pane-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .editor-image-status {
        text-align: left;
    }

    .docs-layout,
    .docs-layout.docs-layout-wide {
        display: flex;
        flex-direction: column;
        grid-template-columns: 1fr;
    }

    .docs-sidebar-left { order: 1; }
    .docs-sidebar-right { order: 2; }
    .docs-main { order: 3; }

    .docs-toolbar-header {
        flex-direction: column;
        align-items: stretch;
        flex-wrap: wrap;
    }

    .docs-toolbar-actions,
    .docs-toolbar-header .breadcrumb {
        flex-wrap: wrap;
        white-space: normal;
    }

    .docs-toolbar {
        position: static;
    }

    .docs-sidebar-left,
    .docs-sidebar-right {
        position: static;
        width: 100%;
    }

    .editor-source-shell,
    .editor-preview {
        height: 50vh;
    }
}

.markdown-body .mdx-admin-block,
.editor-preview .mdx-admin-block {
    border: 1px dashed #b78103;
    background: #fffbe6;
    border-radius: 10px;
    padding: 0.75rem 1rem;
    margin: 1rem 0;
    position: relative;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
}

.markdown-body .mdx-admin-block-toggle,
.editor-preview .mdx-admin-block-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    border: 0;
    background: transparent;
    padding: 0;
    color: #8a6300;
    cursor: pointer;
    text-align: left;
    font: inherit;
}

.markdown-body .mdx-admin-block-toggle-label,
.editor-preview .mdx-admin-block-toggle-label {
    display: inline-flex;
    align-items: center;
    min-height: 1.75rem;
    font-size: 0.75rem;
    font-weight: 700;
    color: #8a6300;
    background: #fff3cd;
    padding: 0.15rem 0.6rem;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.markdown-body .mdx-admin-block-toggle-icon,
.editor-preview .mdx-admin-block-toggle-icon {
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1;
    color: #8a6300;
}

.markdown-body .mdx-admin-block-content,
.editor-preview .mdx-admin-block-content {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(183, 129, 3, 0.22);
}

.markdown-body .mdx-admin-block-content[hidden],
.editor-preview .mdx-admin-block-content[hidden] {
    display: none !important;
}

.markdown-body .mdx-admin-block-content > :first-child,
.editor-preview .mdx-admin-block-content > :first-child {
    margin-top: 0.25rem;
}

.markdown-body .mdx-admin-block-content > :last-child,
.editor-preview .mdx-admin-block-content > :last-child {
    margin-bottom: 0;
}

/*
 * Botones "Guardar" deshabilitados por dirty-tracking: queremos que el usuario
 * vea que están desactivados por *estado* (sin cambios) y no por permisos, así
 * que mantenemos el color del botón pero reducimos opacidad y bloqueamos clicks.
 */
button.is-dirty-disabled,
input.is-dirty-disabled {
    opacity: .55;
    cursor: not-allowed;
}

/*
 * MsgBox: modal centrado tipo SweetAlert que reemplaza alert()/confirm()/prompt().
 * Se construye dinámicamente en _LayoutClientScripts.cshtml y se añade al <body>.
 */
.msgbox-backdrop {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(15, 23, 42, 0.5);
    animation: msgbox-fade-in .15s ease-out;
}

.msgbox-backdrop.msgbox-open {
    display: flex;
}

body.msgbox-scroll-lock {
    overflow: hidden;
}

.msgbox-dialog {
    background: #ffffff;
    border-radius: .75rem;
    box-shadow: 0 30px 60px rgba(15, 23, 42, 0.25), 0 0 0 1px rgba(15, 23, 42, 0.05);
    width: 100%;
    max-width: 440px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    animation: msgbox-slide-in .18s ease-out;
}

.msgbox-header {
    padding: 1.25rem 1.5rem .5rem 1.5rem;
    display: flex;
    align-items: center;
    gap: .75rem;
}

.msgbox-icon {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background: #e7f1ff;
    color: #0d6efd;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    font-weight: 700;
    flex-shrink: 0;
}

.msgbox-dialog.msgbox-danger .msgbox-icon {
    background: #fde8e8;
    color: #dc3545;
}

.msgbox-title {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 600;
    color: #0f172a;
}

.msgbox-body {
    padding: 0 1.5rem 1rem 1.5rem;
    color: #334155;
    font-size: .95rem;
    line-height: 1.5;
}

.msgbox-message {
    margin: 0;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.msgbox-input {
    margin-top: .75rem;
    width: 100%;
}

.msgbox-footer {
    display: flex;
    justify-content: flex-end;
    gap: .5rem;
    padding: .75rem 1.5rem 1.25rem 1.5rem;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
}

.msgbox-footer .btn {
    min-width: 96px;
}

@keyframes msgbox-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes msgbox-slide-in {
    from { opacity: 0; transform: translateY(-8px) scale(.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
