:root {
    --bbcode-download-icon: url("../icon/download-svgrepo-com.svg");
}

.editor-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: #ffffff;
    box-shadow: 0 4px 12px rgba(20, 30, 48, 0.04);
    position: sticky;
    top: 12px;
    z-index: 5;
}

.editor-toolbar,
.editor-tool-group,
.editor-tool {
    isolation: isolate;
}

.editor-tool::after {
    pointer-events: none;
}

.editor-tool-group {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0;
    border: 0;
    background: transparent;
}

.editor-tool-group-title {
    display: none;
}

.editor-tool {
    position: relative;
    min-width: 34px;
    height: 34px;
    padding: 0 10px;
    border-radius: 10px;
    border: 1px solid #e2e8f2;
    background: #f9fbfd;
    color: #52607a;
    font-size: 12px;
    font-weight: 700;
    transition: background 0.14s ease, border-color 0.14s ease, color 0.14s ease;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.editor-tool:hover {
    background: #eef4ff;
    border-color: #bfd3ff;
    color: #356cff;
}

.editor-tool:focus-visible {
    background: #eef2f6;
    outline: none;
}

.editor-tool::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 50%;
    bottom: calc(100% + 8px);
    transform: translateX(-50%) translateY(4px);
    padding: 6px 8px;
    border-radius: 8px;
    background: rgba(20, 26, 38, 0.94);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.14s ease, transform 0.14s ease;
    z-index: 20;
}

.editor-tool-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    line-height: 1;
    font-size: 11px;
    text-transform: uppercase;
}

.editor-tool-icon svg {
    width: 16px;
    height: 16px;
    display: block;
}

.editor-separator {
    width: 1px;
    height: 28px;
    background: #dfe5ef;
    margin: 0 2px;
}

@media (hover: hover) and (pointer: fine) {
    .editor-tool:hover::after {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
        transition-delay: 0.12s;
    }
}

.doc-block + .doc-block {
    margin-top: 16px;
}

.doc-heading {
    margin: 0 0 10px;
    line-height: 1.25;
}

.doc-heading.h1 {
    font-size: 32px;
}

.doc-heading.h2 {
    font-size: 24px;
}

.doc-heading.h3 {
    font-size: 19px;
}

.doc-paragraph {
    margin: 0;
}

.doc-code,
.doc-pre {
    margin: 0;
    position: relative;
    padding: 14px 16px;
    background: #0f1728;
    color: #edf3ff;
    border-radius: 14px;
    overflow: auto;
    font-family: Consolas, "Courier New", monospace;
    font-size: 13px;
    line-height: 1.55;
}

.doc-pre[class*="language-"] {
    padding-top: 40px;
}

.doc-pre code[class*="language-"] {
    display: block;
    background: transparent;
    color: inherit;
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
    white-space: pre;
}

.doc-pre[class*="language-"],
.doc-pre code[class*="language-"] {
    text-shadow: none;
}

.doc-code-language {
    position: absolute;
    top: 12px;
    right: 14px;
    display: inline-flex;
    align-items: center;
    min-height: 20px;
    padding: 0 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(237, 243, 255, 0.88);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.doc-quote {
    margin: 0;
    padding: 14px 16px;
    border-left: 4px solid var(--primary);
    background: var(--panel-soft);
    border-radius: 0 14px 14px 0;
}

.doc-list {
    margin: 0;
    padding-left: 22px;
}

.doc-list-rich {
    display: grid;
    gap: 8px;
    padding-left: 24px;
}

.doc-list-rich li > .doc-block {
    margin-top: 8px;
}

.doc-rule {
    border: 0;
    border-top: 1px solid #e3e8f0;
}

.doc-link {
    color: var(--primary);
    text-decoration: none;
}

.doc-link:hover {
    text-decoration: underline;
}

.doc-inline-code {
    padding: 1px 7px;
    border: 1px solid #ddd8d0;
    border-radius: 6px;
    background: #faf9f7;
    color: #3f3f3f;
    font-family: Consolas, "Courier New", monospace;
    font-size: 0.9em;
    font-weight: 500;
}

.doc-label,
.doc-span {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 0 8px;
    border-radius: 999px;
    background: #f3f5f8;
    color: #313846;
    font-size: 12px;
    font-weight: 600;
}

.doc-span.muted,
.doc-span.muted-note {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 1px 7px;
    border: 1px solid #ddd8d0;
    border-radius: 6px;
    background: #faf9f7;
    color: #3f3f3f;
    font-family: Consolas, "Courier New", monospace;
    font-size: 0.9em;
    font-weight: 500;
    line-height: 1.35;
    vertical-align: baseline;
    box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.03);
}

.doc-span.muted:hover,
.doc-span.muted-note:hover {
    border-color: #d2c7b8;
    background: #f6f2ec;
}

.doc-callout {
    display: grid;
    grid-template-columns: 34px 1fr;
    align-items: flex-start;
    gap: 12px;
    padding: 22px 26px;
    border: 1px solid transparent;
    border-left: 5px solid transparent;
    border-radius: 10px;
    color: #202020;
}

.doc-callout::before {
    width: 24px;
    height: 24px;
    margin-top: 1px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 2px solid currentColor;
    border-radius: 999px;
    font-size: 15px;
    font-weight: 800;
    line-height: 1;
}

.doc-callout-title {
    display: none;
}

.doc-callout-body {
    font-size: 18px;
    line-height: 1.45;
    color: inherit;
}

.doc-callout-warning {
    background: #fff3e0;
    border-color: #ffd29a;
    border-left-color: #ff9800;
    color: #6f4300;
}

.doc-callout-warning::before {
    content: "!";
    color: #ff9800;
}

.doc-callout-success {
    background: #e0ffec;
    border-color: #b9e6c8;
    border-left-color: #27ae60;
    color: #145c32;
}

.doc-callout-success::before {
    content: "✓";
    color: #27ae60;
}

.doc-callout-error {
    background: #ffe0e0;
    border-color: #f4b7b7;
    border-left-color: #d94d4d;
    color: #7a2020;
}

.doc-callout-error::before {
    content: "×";
    color: #d94d4d;
}

.doc-callout-info {
    background: #d9e8ff;
    border-color: #bad4ff;
    border-left-color: #4d80ff;
    color: #1d4d91;
}

.doc-callout-info::before {
    content: "i";
    color: #4d80ff;
}

.doc-download {
    display: grid;
    grid-template-columns: 42px 1fr auto;
    align-items: center;
    gap: 14px;
    padding: 18px 22px;
    border: 1px solid #e1e6ef;
    border-radius: 14px;
    background: #ffffff;
    color: #1d2432;
    text-decoration: none;
    box-shadow: 0 8px 22px rgba(22, 31, 48, 0.06);
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.doc-download::before {
    content: "";
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background-color: #f1f5fb;
    background-image: var(--bbcode-download-icon);
    background-position: center;
    background-repeat: no-repeat;
    background-size: 20px 20px;
}

.doc-download::after {
    content: "Descargar";
    padding: 9px 16px;
    border-radius: 999px;
    background: #4d80ff;
    color: #fff;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.doc-download:hover {
    transform: translateY(-1px);
    border-color: #c8d6ee;
    box-shadow: 0 12px 28px rgba(22, 31, 48, 0.1);
    text-decoration: none;
}

.doc-download-title {
    display: none;
}

.doc-download-name {
    color: #1d2432;
    font-size: 16px;
    font-weight: 800;
}

.doc-youtube {
    border-radius: 16px;
    overflow: hidden;
    background: #0f1728;
}

.doc-youtube-frame {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    border: 0;
}

.doc-align {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.doc-align-left {
    text-align: left;
    align-items: flex-start;
}

.doc-align-center {
    text-align: center;
    align-items: center;
}

.doc-align-right {
    text-align: right;
    align-items: flex-end;
}

.doc-align-justify {
    text-align: justify;
    align-items: stretch;
}

.doc-table-wrap {
    overflow-x: auto;
    border: 1px solid #e4e8ef;
    border-radius: 16px;
    background: #fff;
}

.doc-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 420px;
}

.doc-table th,
.doc-table td {
    padding: 12px 14px;
    border-bottom: 1px solid #eceff4;
    text-align: left;
    vertical-align: top;
}

.doc-table th {
    background: #f7f9fc;
    color: #293140;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.doc-table tr:last-child td,
.doc-table tr:last-child th {
    border-bottom: 0;
}

.doc-hide {
    border: 1px solid #e4e9f0;
    border-radius: 14px;
    background: #fafbfd;
    overflow: hidden;
}

.doc-hide-summary {
    padding: 12px 14px;
    cursor: pointer;
    font-weight: 600;
    list-style: none;
}

.doc-hide-summary::-webkit-details-marker {
    display: none;
}

.doc-hide-content {
    padding: 0 14px 14px;
    display: grid;
    gap: 10px;
}

.doc-figure {
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.doc-image {
    display: block;
    max-width: 100%;
    height: auto;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: #fff;
}

.doc-figcaption {
    color: var(--muted);
    font-size: 12px;
}
