:root {
    --bs-body-bg: #ffffff;
    --bs-body-color: #212529;

    --bs-navbar-bg: #E6E6E6;
    --bs-navbar-color: #000;

    --bs-btn-bg: #007bff;
    --bs-btn-color: #fff;
}

[data-bs-theme="dark"] {
    --bs-body-bg: #141414 !important;
    
    --bs-navbar-bg: #222222 !important;
    --bs-navbar-color: #000;
}

#navbar {
    background-color: var(--bs-navbar-bg) !important;
}

/* ===== Scrollbar (site-wide, premium) =====
   Notes:
   - Subtle by default, appears stronger on hover (desktop only)
   - Supports Firefox via scrollbar-color/width
*/
:root {
    --rs-scrollbar-size: 9px;
    --rs-scrollbar-track: rgba(15, 23, 42, 0.06);
    --rs-scrollbar-thumb: rgba(15, 23, 42, 0.28);
    --rs-scrollbar-thumb-hover: rgba(15, 23, 42, 0.42);
    --rs-scrollbar-glow: rgba(69, 76, 238, 0.18);
}

[data-bs-theme="dark"] {
    --rs-scrollbar-track: rgba(255, 255, 255, 0.08);
    --rs-scrollbar-thumb: rgba(255, 255, 255, 0.22);
    --rs-scrollbar-thumb-hover: rgba(255, 255, 255, 0.34);
    --rs-scrollbar-glow: rgba(140, 185, 255, 0.14);
}

/* Firefox */
html {
    scrollbar-width: thin;
    scrollbar-color: var(--rs-scrollbar-thumb) var(--rs-scrollbar-track);
}

/* WebKit (Chromium/Safari) */
::-webkit-scrollbar {
    width: var(--rs-scrollbar-size);
    height: var(--rs-scrollbar-size);
}

::-webkit-scrollbar-corner {
    background: transparent;
}

.btn-violet {
    background-color: #454CEE !important;
    color: white !important;
    transition: background-color 0.3s ease;
}

.btn-violet:hover {
    background-color: rgb(49, 56, 188) !important;
}

.btn-violet:active {
    background-color: rgb(54, 61, 198) !important;
}

.btn-violet:focus {
    outline: none;
    box-shadow: none;
    border-color: rgb(54, 61, 198) !important;
}

.text-violet {
    color: #454CEE !important;
}

label.required::after {
    content: " *";
    color: red;
}

::-webkit-scrollbar-track {
    background: var(--rs-scrollbar-track);
    border-radius: 999px;
}

::-webkit-scrollbar-thumb {
    border-radius: 999px;
    border: 2px solid transparent; /* inner padding */
    background-clip: content-box;
    background-color: var(--rs-scrollbar-thumb);
    box-shadow:
        0 10px 28px rgba(0, 0, 0, 0.10),
        0 0 0 1px rgba(255, 255, 255, 0.05) inset,
        0 0 22px var(--rs-scrollbar-glow);
}

@media (hover: hover) and (pointer: fine) {
    /* Make it more "premium": almost hidden until hover */
    ::-webkit-scrollbar-track {
        background: transparent;
    }

    body:hover ::-webkit-scrollbar-track {
        background: var(--rs-scrollbar-track);
    }

    body:hover ::-webkit-scrollbar-thumb {
        background-color: var(--rs-scrollbar-thumb-hover);
    }
}

::-webkit-scrollbar-thumb:active {
    background-color: rgba(69, 76, 238, 0.55);
}

[data-bs-theme="dark"] ::-webkit-scrollbar-thumb:active {
    background-color: rgba(140, 185, 255, 0.45);
}

/* Отступ из-за навбара (не на экране первой загрузки WASM) */
body:not(:has(#app .rs-boot)) {
    padding-top: 58px;
}

html:has(#app .rs-boot),
body:has(#app .rs-boot) {
    padding-top: 0;
    margin: 0;
    background: #f4f6fb;
}

@media (prefers-color-scheme: dark) {
    html:has(#app .rs-boot),
    body:has(#app .rs-boot) {
        background: #101014;
    }
}

/* Blazor.Bootstrap admin layout sets main { height: 100vh; overflow-x: hidden } globally.
   overflow-x: hidden forces overflow-y: auto → inner scrollbar on our page <main>. */
.rs-site-main {
    flex: none;
    height: auto;
    min-height: calc(100vh - 58px);
    overflow: visible;
}

/* EditorJS rendered content */
.rs-edjs {
    --rs-edjs-max: 74ch;
    --rs-edjs-gap: .85rem;
    /* Inline preview: cap size; full resolution via imageViewer on click */
    --rs-edjs-img-max-width: min(100%, 42rem);
    --rs-edjs-img-max-height: min(70vh, 28rem);
    --rs-edjs-img-stretched-max-height: min(92vh, 72rem);
}

/* Post/variant main content: use full container width */
.rs-main-content .rs-edjs {
    --rs-edjs-max: 100%;
}

.rs-edjs__block {
    margin: 0 0 var(--rs-edjs-gap);
}

.rs-edjs__p {
    margin: 0;
    line-height: 1.65;
    max-width: var(--rs-edjs-max);
}

.rs-edjs .text-justify,
.rs-edjs__h.text-justify {
    text-align: justify;
}

.rs-edjs__p code {
    padding: .1rem .35rem;
    border-radius: .5rem;
    border: 1px solid rgba(122, 85, 255, 0.18);
    background: rgba(122, 85, 255, 0.08);
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: .95em;
}

[data-bs-theme="dark"] .rs-edjs__p code {
    border-color: rgba(152, 120, 255, 0.28);
    background: rgba(122, 85, 255, 0.16);
}

/* Editor.js inline marker (mark.cdx-marker) */
.rs-edjs mark,
.rs-edjs mark.cdx-marker {
    background-color: rgba(245, 235, 111, 0.45);
    padding: 0.05em 0;
    border-radius: 0.12em;
    color: inherit;
}

[data-bs-theme="dark"] .rs-edjs mark,
[data-bs-theme="dark"] .rs-edjs mark.cdx-marker {
    background-color: rgba(234, 179, 8, 0.32);
    color: inherit;
}

.rs-edjs a {
    color: #454CEE;
    text-decoration: underline;
    text-decoration-thickness: .1em;
    text-underline-offset: .18em;
    text-decoration-color: rgba(69, 76, 238, 0.45);
    transition: color .15s ease, text-decoration-color .15s ease;
}

.rs-edjs a:hover {
    color: rgb(49, 56, 188);
    text-decoration-color: rgba(69, 76, 238, 0.85);
}

[data-bs-theme="dark"] .rs-edjs a {
    color: rgba(185, 175, 255, 0.98);
    text-decoration-color: rgba(185, 175, 255, 0.45);
}

[data-bs-theme="dark"] .rs-edjs a:hover {
    color: rgba(210, 200, 255, 0.98);
    text-decoration-color: rgba(210, 200, 255, 0.8);
}

.rs-edjs__h {
    margin: 1.05rem 0 .55rem;
    letter-spacing: -0.02em;
    line-height: 1.15;
    font-weight: 900;
    max-width: var(--rs-edjs-max);
}

.rs-edjs__h1 { font-size: clamp(1.45rem, 3.2vw, 1.9rem); }
.rs-edjs__h2 { font-size: clamp(1.25rem, 2.7vw, 1.65rem); }
.rs-edjs__h3 { font-size: clamp(1.1rem, 2.2vw, 1.35rem); }
.rs-edjs__h4 { font-size: 1.1rem; }

.rs-edjs__hr {
    border: 0;
    height: 1px;
    opacity: 1;
    background: linear-gradient(90deg, transparent, rgba(122, 85, 255, 0.35), transparent);
    margin: 1.15rem 0;
}

.rs-edjs__figure:not(.rs-edjs__figure--stretched) {
    margin: 0 auto;
    width: fit-content;
    max-width: min(100%, var(--rs-edjs-img-max-width));
    text-align: center;
}

.rs-edjs__figure--background {
    padding: 1rem 1.1rem;
    border-radius: 16px;
    background: rgba(122, 85, 255, 0.06);
}

[data-bs-theme="dark"] .rs-edjs__figure--background {
    background: rgba(122, 85, 255, 0.14);
}

.rs-edjs__figure--stretched,
.rs-edjs__table-wrap--stretched {
    display: block;
    margin: 0 auto;
    width: 100%;
    max-width: 100%;
    text-align: center;
}

/* Подложка оборачивает картинку; блок центрирует figure */
.rs-edjs__block--img-stretched {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.rs-edjs__figure--stretched.rs-edjs__figure--background {
    display: block;
    width: fit-content;
    max-width: 100%;
    margin-inline: auto;
}

.rs-edjs__img {
    display: block;
    width: auto;
    height: auto;
    margin-inline: auto;
    border-radius: 16px;
    border: 1px solid rgba(0,0,0,.08);
    box-shadow: 0 10px 28px rgba(0,0,0,.08);
    cursor: zoom-in;
}

.rs-edjs__img:not(.rs-edjs__img--stretched) {
    max-width: var(--rs-edjs-img-max-width);
    max-height: var(--rs-edjs-img-max-height);
}

/* Растянуть: крупнее, до ширины контента; рамка по контуру картинки (не letterbox) */
.rs-edjs__img.rs-edjs__img--stretched {
    max-width: 100%;
    max-height: var(--rs-edjs-img-stretched-max-height);
}

[data-bs-theme="dark"] .rs-edjs__img {
    border-color: rgba(255,255,255,.12);
    box-shadow: 0 14px 34px rgba(0,0,0,.35);
}

.rs-edjs__img--border {
    border: 3px solid rgba(122, 85, 255, 0.35);
}

[data-bs-theme="dark"] .rs-edjs__img--border {
    border-color: rgba(152, 120, 255, 0.45);
}

.rs-main-content .rs-edjs__block--img-stretched,
.rs-task .rs-edjs__block--img-stretched {
    align-items: center;
}

.rs-edjs__caption {
    margin-top: .5rem;
    color: rgba(33, 37, 41, 0.68);
    font-size: .92rem;
    font-style: italic;
}

[data-bs-theme="dark"] .rs-edjs__caption {
    color: rgba(248, 249, 250, 0.68);
}

.rs-edjs__quote {
    margin: 0;
    padding: 1.05rem 1rem .95rem;
    border-radius: 16px;
    border: 1px solid rgba(122, 85, 255, 0.18);
    background: rgba(122, 85, 255, 0.06);
    max-width: var(--rs-edjs-max);
    position: relative;
}

.rs-edjs__quote::before {
    content: "“";
    position: absolute;
    top: -.55rem;
    left: .7rem;
    font-size: 2.8rem;
    line-height: 1;
    color: rgba(122, 85, 255, 0.35);
    font-weight: 900;
}

[data-bs-theme="dark"] .rs-edjs__quote {
    border-color: rgba(152, 120, 255, 0.28);
    background: rgba(122, 85, 255, 0.12);
}

[data-bs-theme="dark"] .rs-edjs__quote::before {
    color: rgba(185, 175, 255, 0.35);
}

.rs-edjs__quote .blockquote {
    margin: 0;
}

.rs-edjs__quote .blockquote p,
.rs-edjs__quote .blockquote-footer {
    margin: 0;
}

.rs-edjs__quote .blockquote-footer {
    margin-top: .55rem;
}

.rs-edjs__quote .blockquote-footer {
    margin-top: .55rem;
}

.rs-edjs__code {
    margin: 0;
    padding: .85rem 1rem;
    border-radius: 16px;
    border: 1px solid rgba(0,0,0,.08);
    background: rgba(0,0,0,.03);
    overflow: auto;
    max-width: 100%;
}

[data-bs-theme="dark"] .rs-edjs__code {
    border-color: rgba(255,255,255,.12);
    background: rgba(255,255,255,.05);
}

/* Inline formatting inside rich fields (code, translation, audio transcript, …) */
.rs-edjs__code code,
.rs-edjs__translation-body .rs-edjs,
.rs-mnlg-modal__body .rs-edjs {
    white-space: pre-wrap;
    word-break: break-word;
}

.rs-edjs .rs-text-color {
    font-weight: inherit;
}

.rs-edjs .inline-code,
.rs-edjs__code .inline-code {
    padding: .1rem .35rem;
    border-radius: .5rem;
    border: 1px solid rgba(122, 85, 255, 0.18);
    background: rgba(122, 85, 255, 0.08);
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: .95em;
    color: #b44437;
}

[data-bs-theme="dark"] .rs-edjs .inline-code,
[data-bs-theme="dark"] .rs-edjs__code .inline-code {
    border-color: rgba(152, 120, 255, 0.28);
    background: rgba(122, 85, 255, 0.16);
    color: #f0a8a0;
}

.rs-edjs .cdx-underline,
.rs-edjs__code .cdx-underline {
    text-decoration: underline;
}

.rs-edjs .fs-1 { font-size: calc(1.375rem + 1.5vw); }
.rs-edjs .fs-2 { font-size: calc(1.325rem + .9vw); }
.rs-edjs .fs-3 { font-size: calc(1.3rem + .6vw); }
.rs-edjs .fs-4 { font-size: calc(1.275rem + .3vw); }
.rs-edjs .fs-5 { font-size: 1.25rem; }
.rs-edjs .fs-6 { font-size: 1rem; }

.rs-edjs__list {
    margin: 0;
    padding-left: 1.25rem;
    max-width: var(--rs-edjs-max);
}

.rs-edjs__list li::marker {
    color: rgba(122, 85, 255, 0.85);
}

[data-bs-theme="dark"] .rs-edjs__list li::marker {
    color: rgba(185, 175, 255, 0.9);
}

.rs-edjs__list li { margin: .25rem 0; }

.rs-edjs__list--checklist {
    list-style: none;
    padding-left: 0;
}

.rs-edjs__checklist-item {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: .55rem .65rem;
    align-items: start;
    margin: .35rem 0;
}

.rs-edjs__checklist-box {
    width: 1.15rem;
    height: 1.15rem;
    margin-top: .2rem;
    border-radius: .35rem;
    border: 1px solid rgba(122, 85, 255, 0.45);
    background: var(--bs-body-bg);
    position: relative;
    flex-shrink: 0;
}

.rs-edjs__checklist-item--checked .rs-edjs__checklist-box {
    background: rgba(122, 85, 255, 0.85);
    border-color: rgba(122, 85, 255, 0.85);
}

.rs-edjs__checklist-item--checked .rs-edjs__checklist-box::after {
    content: "";
    position: absolute;
    left: .32rem;
    top: .14rem;
    width: .35rem;
    height: .62rem;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.rs-edjs__checklist-item--checked .rs-edjs__checklist-content {
    text-decoration: line-through;
    opacity: .72;
}

.rs-edjs__list--nested {
    margin-top: .35rem;
    padding-left: 1.1rem;
}

.rs-edjs__alert {
    border-radius: 16px;
    border-width: 1px;
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.06);
}

[data-bs-theme="dark"] .rs-edjs__alert {
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.25);
}

/* EditorJS: блок «оригинал + перевод» (задание) */
.rs-edjs__translation {
    width: 100%;
    max-width: 100%;
}

/* Кнопка «Показать перевод» — как раньше у <summary> (пилюля, не Bootstrap .btn) */
button.rs-edjs__translation-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    max-width: 100%;
    margin: 0;
    padding: .28rem .85rem;
    border-radius: 999px;
    font-weight: 800;
    font-size: .85rem;
    line-height: 1.25;
    font-family: inherit;
    color: rgba(48, 30, 120, 0.95);
    border: 1px solid rgba(122, 85, 255, 0.28);
    background: rgba(255, 255, 255, 0.85);
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

button.rs-edjs__translation-toggle:hover {
    border-color: rgba(0, 203, 255, 0.45);
}

button.rs-edjs__translation-toggle:focus-visible {
    outline: 0;
    box-shadow: 0 0 0 .2rem rgba(122, 85, 255, 0.28);
}

[data-bs-theme="dark"] button.rs-edjs__translation-toggle {
    color: rgba(235, 230, 255, 0.98);
    border-color: rgba(152, 120, 255, 0.35);
    background: rgba(20, 20, 20, 0.55);
}

[data-bs-theme="dark"] button.rs-edjs__translation-toggle:hover {
    border-color: rgba(0, 203, 255, 0.45);
}

.rs-edjs__translation-kicker {
    display: inline-flex;
    margin-bottom: .45rem;
    padding: .12rem .5rem;
    border-radius: 999px;
    font-size: .68rem;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: rgba(48, 30, 120, 0.92);
    border: 1px solid rgba(122, 85, 255, 0.22);
    background: rgba(255, 255, 255, 0.75);
}

[data-bs-theme="dark"] .rs-edjs__translation-kicker {
    color: rgba(235, 230, 255, 0.95);
    border-color: rgba(152, 120, 255, 0.35);
    background: rgba(20, 20, 20, 0.55);
}

/* Модалка «Образец» (одна колонка): контент на всю ширину окна, текст слева */
.rs-mnlg-modal__body {
    padding: 0.35rem 0 0;
    text-align: start;
}

.rs-mnlg-modal__panel-single.rs-tr-modal__panel {
    max-width: none;
    width: 100%;
    margin-inline: 0;
    border-radius: 0;
    border-left: 0;
    border-right: 0;
}

.rs-mnlg-modal__panel-single .rs-edjs__translation-body,
.rs-mnlg-modal__panel-single .rs-edjs__translation-body > .rs-edjs {
    width: 100%;
    max-width: none;
    text-align: start;
}

/* Полноэкранная модалка: оригинал | перевод */
.rs-tr-modal .modal-content {
    border: 0;
    border-radius: 0;
    min-height: 100%;
}

[data-bs-theme="dark"] .rs-tr-modal .modal-content {
    background: #121318;
    color: rgba(248, 249, 250, 0.95);
}

[data-bs-theme="dark"] .rs-tr-modal .modal-header {
    border-bottom-color: rgba(255, 255, 255, 0.10);
}

.rs-tr-modal__panel {
    border-radius: 16px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    background: rgba(255, 255, 255, 0.55);
    padding: 1rem 1.05rem;
    height: 100%;
    min-height: 0;
}

.rs-tr-modal__panel--tr {
    border-color: rgba(0, 203, 255, 0.22);
    background: rgba(0, 203, 255, 0.06);
}

[data-bs-theme="dark"] .rs-tr-modal__panel {
    border-color: rgba(255, 255, 255, 0.10);
    background: rgba(20, 20, 20, 0.45);
}

[data-bs-theme="dark"] .rs-tr-modal__panel--tr {
    border-color: rgba(0, 203, 255, 0.28);
    background: rgba(0, 203, 255, 0.10);
}

@media (min-width: 992px) {
    .rs-tr-modal__cols {
        min-height: calc(100vh - 8.5rem);
    }

    .rs-tr-modal__cols > [class*="col-"] {
        display: flex;
    }

    .rs-tr-modal__cols .rs-tr-modal__panel {
        flex: 1;
    }
}

/* Тело задания внутри блока перевода — та же обёртка .rs-edjs, что и у целого поста (ссылки, --rs-edjs-max). */
.rs-edjs__translation .rs-edjs__translation-body > .rs-edjs {
    max-width: none;
    width: 100%;
}

.rs-tr-modal__panel .rs-edjs__translation-body > .rs-edjs {
    max-width: none;
    width: 100%;
}

/* In translation modal we want full width text (no 74ch constraint) */
.rs-tr-modal .rs-edjs {
    --rs-edjs-max: 100%;
}

/* Интерполяция в колонке «Оригинал» модалки: только показ, без клика и без сбора в форму */
.rs-tr-modal input.rs-interp-input--modal-display {
    pointer-events: none;
    cursor: default;
    user-select: none;
}

/* Маркеры границ «оригинал» в модалке (интерполяция); пустые span не занимают место */
span.rs-tr-protect.rs-tr-protect--modal-orig-start,
span.rs-tr-protect.rs-tr-protect--modal-orig-end {
    display: none;
}

/* Редактор: панели ввода оригинала и перевода */
.rs-translation-tool__pane + .rs-translation-tool__pane {
    margin-top: .25rem;
}

.rs-translation-tool__label {
    font-size: .78rem;
    font-weight: 700;
    color: rgba(33, 37, 41, 0.65);
    margin-bottom: .35rem;
}

[data-bs-theme="dark"] .rs-translation-tool__label {
    color: rgba(248, 249, 250, 0.65);
}

.rs-translation-tool__editor {
    min-height: 5rem;
    line-height: 1.65;
    overflow-wrap: anywhere;
    word-break: break-word;
    padding: .55rem .65rem;
    border-radius: .5rem;
    border: 1px solid var(--bs-border-color);
    background: var(--bs-body-bg);
}

.rs-translation-tool__editor[data-placeholder]:empty::before {
    content: attr(data-placeholder);
    color: var(--bs-secondary-color);
    pointer-events: none;
    white-space: pre-wrap;
}

.rs-translation-tool__editor[data-placeholder]:empty:focus::before {
    opacity: .85;
}

.rs-translation-tool__editor:focus {
    box-shadow: 0 0 0 .2rem rgba(122, 85, 255, 0.18);
    outline: none;
}

[data-bs-theme="dark"] .rs-translation-tool__editor {
    background: var(--bs-tertiary-bg);
    border-color: var(--bs-border-color);
}

[data-bs-theme="dark"] .rs-translation-tool__editor[data-placeholder]:empty::before {
    color: var(--bs-secondary-color);
}

.rs-edjs__table-wrap {
    border-radius: 16px;
    border: 1px solid rgba(0,0,0,.08);
    overflow: hidden;
    width: 100%;
    max-width: 100%;
    margin: 0;
}

/* EditorJS table: column width modes in editor */
.tc-table.rs-tc-table--has-content-cols .tc-row {
    grid-template-columns: var(--rs-tc-cols) !important;
}

.tc-wrap .tc-toolbox--column {
    z-index: 4;
    pointer-events: auto;
}

.tc-wrap .tc-toolbox--column.tc-toolbox--showed .tc-toolbox__toggler {
    opacity: 1;
}

.tc-wrap .tc-table::before {
    height: calc(var(--toolbox-aiming-field-size) + 6px);
    top: calc((var(--toolbox-aiming-field-size) + 6px) * -1);
}

.rs-edjs__col--content,
.rs-edjs__cell--col-content {
    width: 1%;
    white-space: nowrap;
}

.rs-edjs__table--has-content-cols {
    table-layout: auto;
}

[data-bs-theme="dark"] .rs-edjs__table-wrap {
    border-color: rgba(255,255,255,.12);
}

.rs-edjs__embed {
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid rgba(0,0,0,.08);
    box-shadow: 0 10px 24px rgba(0,0,0,.08);
    width: 100%;
    max-width: 100%;
    margin: 0;
}

[data-bs-theme="dark"] .rs-edjs__embed {
    border-color: rgba(255,255,255,.12);
    box-shadow: 0 14px 34px rgba(0,0,0,.35);
}

.rs-edjs__attach {
    border-radius: 16px;
    border: 1px solid rgba(0,0,0,.08);
    width: 100%;
    max-width: 100%;
    margin: 0;
}

[data-bs-theme="dark"] .rs-edjs__attach {
    border-color: rgba(255,255,255,.12);
}

/* Стили для анимированного бургера */
.navbar-toggler {
    border: none;
    outline: none;
    padding: 0;
}

.navbar-toggler-icon {
    width: 30px;
    height: 24px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.navbar-toggler-icon span {
    display: block;
    width: 100%;
    height: 4px;
    background-color: black;
    transition: all 0.3s ease;
    border-radius: 2px;
}

/* Анимация бургер-меню при открытии */
.navbar-toggler.active .line1 {
    transform: translateY(10px) rotate(45deg);
}

.navbar-toggler.active .line2 {
    opacity: 0;
}

.navbar-toggler.active .line3 {
    transform: translateY(-10px) rotate(-45deg);
}

svg .icon--link {
    background-image: url("svg/link.svg")
}
svg .icon--unlink { background-image: url("svg/link.svg") }

/*.custom-pagination .page-link {*/
/*    background-color: #454CEE !important;*/
/*    color: white !important;*/
/*}*/

.custom-pagination .page-item.active .page-link {
    background-color: #454CEE !important;
    color: white !important;
}

/* ===== Explanation modal: correct answer + editor explanation cards ===== */
.rs-explanation-hr {
    margin: 1rem 0;
    border: 0;
    height: 1px;
    background: rgba(15, 23, 42, 0.10);
}

[data-bs-theme="dark"] .rs-explanation-hr {
    background: rgba(255, 255, 255, 0.12);
}

.rs-explanation-correct-card,
.rs-explanation-editor-card {
    border-radius: 16px;
    padding: .9rem 1rem;
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

[data-bs-theme="dark"] .rs-explanation-correct-card,
[data-bs-theme="dark"] .rs-explanation-editor-card {
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.35);
}

.rs-explanation-correct-card {
    background:
        radial-gradient(900px 200px at 10% 0%, rgba(16, 196, 76, 0.18), rgba(16, 196, 76, 0) 60%),
        linear-gradient(118deg, rgba(16, 196, 76, 0.16) 0%, rgba(255, 255, 255, 0.92) 60%);
    border-color: rgba(16, 196, 76, 0.22);
}

/* In explanation modal we don't want selecting the correct answer card text */
.rs-explanation-correct-card,
.rs-explanation-correct-card * {
    -webkit-user-select: none !important;
    user-select: none !important;
    -webkit-touch-callout: none !important;
}

[data-bs-theme="dark"] .rs-explanation-correct-card {
    background:
        radial-gradient(900px 200px at 10% 0%, rgba(16, 196, 76, 0.26), rgba(16, 196, 76, 0) 60%),
        linear-gradient(118deg, rgba(16, 196, 76, 0.18) 0%, rgba(24, 24, 30, 0.92) 60%);
    border-color: rgba(16, 196, 76, 0.28);
}

.rs-explanation-editor-card {
    background:
        radial-gradient(900px 220px at 12% 0%, rgba(122, 85, 255, 0.20), rgba(122, 85, 255, 0) 60%),
        radial-gradient(820px 200px at 90% 10%, rgba(0, 203, 255, 0.12), rgba(0, 203, 255, 0) 55%),
        rgba(255, 255, 255, 0.92);
    border-color: rgba(122, 85, 255, 0.24);
}

[data-bs-theme="dark"] .rs-explanation-editor-card {
    background:
        radial-gradient(900px 220px at 12% 0%, rgba(122, 85, 255, 0.26), rgba(122, 85, 255, 0) 60%),
        radial-gradient(820px 200px at 90% 10%, rgba(0, 203, 255, 0.14), rgba(0, 203, 255, 0) 55%),
        rgba(24, 24, 30, 0.92);
    border-color: rgba(152, 120, 255, 0.30);
}

.rs-explanation-correct-label {
    font-size: .78rem;
    font-weight: 900;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin: 0;
    color: rgba(33, 37, 41, 0.62);
}

[data-bs-theme="dark"] .rs-explanation-correct-label {
    color: rgba(248, 249, 250, 0.62);
}

.rs-explanation-correct-value {
    font-weight: 900;
    letter-spacing: -0.01em;
    color: rgba(16, 196, 76, 0.98);
    font-size: 1.15rem;
    line-height: 1.2;
}

[data-bs-theme="dark"] .rs-explanation-correct-value {
    color: rgba(130, 255, 180, 0.98);
}

.rs-explanation-editor-text {
    color: rgba(33, 37, 41, 0.88);
    line-height: 1.55;
}

[data-bs-theme="dark"] .rs-explanation-editor-text {
    color: rgba(248, 249, 250, 0.86);
}

.rs-explanation-editor-text p {
    margin-bottom: .55rem;
}

.rs-explanation-editor-text p:last-child {
    margin-bottom: 0;
}

/* Optional spacing for section-style label above editor block */
.rs-explanation-section__label--editor {
    margin: 0 0 .55rem 0;
}

/* Prevent text selection inside specific modals */
.rs-modal-noselect,
.rs-modal-noselect * {
    -webkit-user-select: none !important;
    user-select: none !important;
    -webkit-touch-callout: none !important;
}

/* Hard override for modal stacks used in PostComponent modals */
.rs-explanation-modal-stack,
.rs-explanation-modal-stack * {
    -webkit-user-select: none !important;
    user-select: none !important;
    -webkit-touch-callout: none !important;
}

/* Modal header text (Bootstrap) should not be selectable */
.modal :is(.modal-header, .modal-title),
.modal :is(.modal-header, .modal-title) * {
    -webkit-user-select: none !important;
    user-select: none !important;
    -webkit-touch-callout: none !important;
}

/* Explanation labels inside modal (extra safety) */
.rs-explanation-section__label,
.rs-explanation-section__label--editor {
    -webkit-user-select: none !important;
    user-select: none !important;
}

/* ===== Global typography for variant pages (PostComponent) ===== */
.rs-typo {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    font-kerning: normal;
    font-feature-settings: "kern" 1, "liga" 1, "calt" 1;
}

.rs-typo :where(p, ul, ol, blockquote, pre, table) {
    line-height: 1.65;
    color: rgba(33, 37, 41, 0.88);
}

[data-bs-theme="dark"] .rs-typo :where(p, ul, ol, blockquote, pre, table) {
    color: rgba(248, 249, 250, 0.86);
}

.rs-typo :where(p) {
    margin: 0 0 .85rem 0;
}

.rs-typo :where(p:last-child) {
    margin-bottom: 0;
}

.rs-typo :where(h1, h2, h3, h4, h5, h6) {
    letter-spacing: -0.02em;
    line-height: 1.12;
    font-weight: 900;
    color: rgba(15, 23, 42, 0.92);
    margin: 1.05rem 0 .55rem 0;
}

[data-bs-theme="dark"] .rs-typo :where(h1, h2, h3, h4, h5, h6) {
    color: rgba(248, 249, 250, 0.92);
}

.rs-typo :where(h1) { font-size: clamp(1.45rem, 2.6vw, 1.95rem); }
.rs-typo :where(h2) { font-size: clamp(1.25rem, 2.2vw, 1.65rem); }
.rs-typo :where(h3) { font-size: clamp(1.15rem, 1.9vw, 1.45rem); }
.rs-typo :where(h4) { font-size: 1.15rem; font-weight: 850; }
.rs-typo :where(h5) { font-size: 1.05rem; font-weight: 850; }
.rs-typo :where(h6) { font-size: .95rem; font-weight: 850; letter-spacing: -0.01em; }

.rs-typo :where(a:not(.rs-support-promo__link)) {
    color: rgba(13, 110, 253, 0.95);
    text-decoration: underline;
    text-decoration-thickness: .08em;
    text-underline-offset: .18em;
}

.rs-typo :where(a:not(.rs-support-promo__link):hover) {
    color: rgba(10, 88, 202, 1);
    text-decoration-thickness: .10em;
}

[data-bs-theme="dark"] .rs-typo :where(a:not(.rs-support-promo__link)) {
    color: rgba(140, 185, 255, 0.95);
}

[data-bs-theme="dark"] .rs-typo :where(a:not(.rs-support-promo__link):hover) {
    color: rgba(198, 220, 255, 1);
}

.rs-typo :where(strong, b) {
    font-weight: 900;
}

.rs-typo :where(ul, ol) {
    margin: 0 0 .9rem 0;
    padding-left: 1.2rem;
}

.rs-typo :where(li) {
    margin: .25rem 0;
}

.rs-typo :where(blockquote) {
    margin: .95rem 0;
    padding: .75rem 1rem;
    border-left: 4px solid rgba(122, 85, 255, 0.35);
    border-radius: 12px;
    background: rgba(122, 85, 255, 0.08);
}

[data-bs-theme="dark"] .rs-typo :where(blockquote) {
    border-left-color: rgba(152, 120, 255, 0.40);
    background: rgba(122, 85, 255, 0.14);
}

.rs-typo :where(code) {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: .92em;
    padding: .12em .35em;
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.06);
    color: rgba(15, 23, 42, 0.92);
}

[data-bs-theme="dark"] .rs-typo :where(code) {
    background: rgba(255, 255, 255, 0.08);
    color: rgba(248, 249, 250, 0.92);
}

.rs-typo :where(pre) {
    padding: .85rem 1rem;
    border-radius: 14px;
    border: 1px solid rgba(15, 23, 42, 0.10);
    background: rgba(255, 255, 255, 0.82);
    overflow: auto;
}

[data-bs-theme="dark"] .rs-typo :where(pre) {
    border-color: rgba(255, 255, 255, 0.10);
    background: rgba(24, 24, 30, 0.82);
}

.rs-typo :where(pre code) {
    background: transparent;
    padding: 0;
}

.rs-typo :where(hr) {
    border: 0;
    height: 1px;
    background: rgba(15, 23, 42, 0.10);
    margin: 1rem 0;
}

[data-bs-theme="dark"] .rs-typo :where(hr) {
    background: rgba(255, 255, 255, 0.12);
}

.rs-typo :where(table) {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid rgba(15, 23, 42, 0.08);
    background: rgba(255, 255, 255, 0.78);
    box-shadow: 0 2px 14px rgba(15, 23, 42, 0.06);
}

[data-bs-theme="dark"] .rs-typo :where(table) {
    border-color: rgba(255, 255, 255, 0.10);
    background: rgba(24, 24, 30, 0.72);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.30);
}

.rs-typo :where(th, td) {
    padding: .65rem .8rem;
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
    vertical-align: top;
}

[data-bs-theme="dark"] .rs-typo :where(th, td) {
    border-bottom-color: rgba(255, 255, 255, 0.10);
}

.rs-typo :where(tr:last-child td) {
    border-bottom: 0;
}

.rs-typo :where(th) {
    font-size: .78rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    font-weight: 900;
    color: rgba(33, 37, 41, 0.62);
    background: rgba(248, 249, 255, 0.95);
}

[data-bs-theme="dark"] .rs-typo :where(th) {
    color: rgba(248, 249, 250, 0.62);
    background: rgba(28, 28, 32, 0.98);
}

.rs-support-stack {
    width: 100%;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
}

.rs-support-promo {
    display: flex;
    justify-content: center;
    padding: 2px 0;
}

.rs-support-stack .rs-support-promo a.rs-support-promo__link,
.rs-support-stack .rs-support-promo a.rs-support-promo__link:visited {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.55rem 1.2rem;
    border-radius: 999px;
    font-weight: 800;
    font-size: 1.05rem;
    letter-spacing: -0.015em;
    text-decoration: none !important;
    color: rgba(52, 28, 120, 0.98) !important;
    border: 1px solid rgba(122, 85, 255, 0.45);
    background:
        linear-gradient(155deg,
            rgba(255, 255, 255, 0.55) 0%,
            rgba(230, 220, 255, 0.35) 28%,
            rgba(122, 85, 255, 0.22) 52%,
            rgba(180, 140, 255, 0.28) 78%,
            rgba(255, 255, 255, 0.4) 100%);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.75),
        inset 0 -1px 0 rgba(122, 85, 255, 0.12),
        0 4px 18px rgba(122, 85, 255, 0.28),
        0 1px 2px rgba(55, 40, 120, 0.08);
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.45);
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, color 0.18s ease, filter 0.18s ease;
}

.rs-support-stack .rs-support-promo a.rs-support-promo__link:hover {
    color: rgba(36, 18, 95, 1) !important;
    border-color: rgba(122, 85, 255, 0.65);
    filter: brightness(1.04) saturate(1.08);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.85),
        inset 0 -1px 0 rgba(122, 85, 255, 0.15),
        0 6px 26px rgba(122, 85, 255, 0.38),
        0 2px 4px rgba(55, 40, 120, 0.1);
    transform: translateY(-1px);
}

[data-bs-theme="dark"] .rs-support-stack .rs-support-promo a.rs-support-promo__link,
[data-bs-theme="dark"] .rs-support-stack .rs-support-promo a.rs-support-promo__link:visited {
    color: rgba(248, 244, 255, 0.98) !important;
    border-color: rgba(180, 155, 255, 0.5);
    background:
        linear-gradient(155deg,
            rgba(255, 255, 255, 0.14) 0%,
            rgba(122, 85, 255, 0.32) 35%,
            rgba(60, 35, 120, 0.55) 65%,
            rgba(140, 110, 220, 0.35) 100%);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.18),
        inset 0 -1px 0 rgba(0, 0, 0, 0.25),
        0 4px 22px rgba(122, 85, 255, 0.45),
        0 0 24px rgba(122, 85, 255, 0.18);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
}

[data-bs-theme="dark"] .rs-support-stack .rs-support-promo a.rs-support-promo__link:hover {
    color: #fff !important;
    border-color: rgba(210, 195, 255, 0.65);
    filter: brightness(1.08) saturate(1.05);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.22),
        inset 0 -1px 0 rgba(0, 0, 0, 0.2),
        0 6px 28px rgba(122, 85, 255, 0.55),
        0 0 32px rgba(160, 130, 255, 0.22);
    transform: translateY(-1px);
}

.rs-support-stack .rs-support-promo__icon {
    display: inline-flex;
    font-size: 1.2rem;
    line-height: 1;
    filter: drop-shadow(0 1px 1px rgba(255, 255, 255, 0.35));
}

[data-bs-theme="dark"] .rs-support-stack .rs-support-promo__icon {
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.35));
}

.rs-preload {
    position: fixed;
    inset: 0;
    z-index: 2147483646;
    display: grid;
    place-items: center;
    padding: 1.25rem;
    pointer-events: none;
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

.rs-preload__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.60);
    backdrop-filter: blur(10px);
}

[data-bs-theme="dark"] .rs-preload__backdrop {
    background: rgba(10, 10, 14, 0.66);
}

.rs-preload__card {
    position: relative;
    width: min(520px, calc(100vw - 2rem));
    border-radius: 18px;
    border: 1px solid rgba(122, 85, 255, 0.22);
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 22px 56px rgba(55, 40, 120, 0.18);
    overflow: hidden;
    padding: 1.15rem 1.25rem;
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto auto;
    grid-template-areas:
        "sp title"
        "sp text";
    column-gap: .9rem;
    row-gap: .2rem;
}

[data-bs-theme="dark"] .rs-preload__card {
    border-color: rgba(152, 120, 255, 0.32);
    background: rgba(24, 24, 30, 0.92);
    box-shadow: 0 26px 64px rgba(0, 0, 0, 0.55);
}

.rs-preload__spinner {
    grid-area: sp;
    width: 40px;
    height: 40px;
    border-radius: 999px;
    border: 3px solid rgba(122, 85, 255, 0.18);
    border-top-color: rgba(122, 85, 255, 0.92);
    animation: rs-preload-spin 0.9s linear infinite;
    margin-top: .15rem;
}

[data-bs-theme="dark"] .rs-preload__spinner {
    border-color: rgba(152, 120, 255, 0.26);
    border-top-color: rgba(210, 200, 255, 0.98);
}

@keyframes rs-preload-spin {
    to { transform: rotate(360deg); }
}

.rs-preload__title {
    grid-area: title;
    font-weight: 950;
    letter-spacing: -0.01em;
    color: rgba(33, 37, 41, 0.92);
    line-height: 1.1;
}

[data-bs-theme="dark"] .rs-preload__title {
    color: rgba(248, 249, 250, 0.94);
}

.rs-preload__text {
    grid-area: text;
    opacity: .9;
    line-height: 1.35;
    color: rgba(33, 37, 41, 0.76);
}

[data-bs-theme="dark"] .rs-preload__text {
    color: rgba(248, 249, 250, 0.72);
}

.rs-preload__bar {
    grid-column: 1 / -1;
    margin-top: .85rem;
    height: 10px;
    border-radius: 999px;
    border: 1px solid rgba(122, 85, 255, 0.18);
    background: rgba(122, 85, 255, 0.06);
    overflow: hidden;
}

[data-bs-theme="dark"] .rs-preload__bar {
    border-color: rgba(152, 120, 255, 0.26);
    background: rgba(122, 85, 255, 0.12);
}

.rs-preload__bar-fill {
    height: 100%;
    width: 45%;
    border-radius: 999px;
    background:
        linear-gradient(90deg,
            rgba(122, 85, 255, 0) 0%,
            rgba(122, 85, 255, 0.65) 35%,
            rgba(0, 203, 255, 0.55) 65%,
            rgba(0, 203, 255, 0) 100%);
    animation: rs-preload-indeterminate 1.15s ease-in-out infinite;
    transform: translateX(-120%);
    filter: saturate(1.1);
}

[data-bs-theme="dark"] .rs-preload__bar-fill {
    background:
        linear-gradient(90deg,
            rgba(122, 85, 255, 0) 0%,
            rgba(210, 200, 255, 0.85) 35%,
            rgba(0, 203, 255, 0.55) 65%,
            rgba(0, 203, 255, 0) 100%);
}

@keyframes rs-preload-indeterminate {
    0% { transform: translateX(-120%); }
    100% { transform: translateX(260%); }
}

/* Blazor WASM startup / error UI (must stay hidden until a real unhandled error) */
#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 10000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

/* Blazor WASM first paint (index.html #app) */
.rs-boot {
    position: fixed;
    inset: 0;
    z-index: 2147483645;
    display: grid;
    place-items: center;
    padding: 1.5rem;
    box-sizing: border-box;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    background:
        radial-gradient(1100px 520px at 50% -8%, rgba(69, 76, 238, 0.16), transparent 58%),
        radial-gradient(800px 420px at 100% 100%, rgba(122, 85, 255, 0.10), transparent 52%),
        #f4f6fb;
}

@media (prefers-color-scheme: dark) {
    .rs-boot {
        background:
            radial-gradient(1100px 520px at 50% -8%, rgba(122, 85, 255, 0.22), transparent 58%),
            radial-gradient(800px 420px at 100% 100%, rgba(69, 76, 238, 0.14), transparent 52%),
            #101014;
    }
}

.rs-boot__panel {
    width: min(22rem, 100%);
    padding: 2rem 1.75rem 1.85rem;
    border-radius: 20px;
    border: 1px solid rgba(69, 76, 238, 0.18);
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 22px 56px rgba(55, 40, 120, 0.14);
    text-align: center;
}

@media (prefers-color-scheme: dark) {
    .rs-boot__panel {
        border-color: rgba(152, 120, 255, 0.28);
        background: rgba(22, 22, 28, 0.94);
        box-shadow: 0 26px 64px rgba(0, 0, 0, 0.5);
    }
}

.rs-boot__ring {
    position: relative;
    width: 7.25rem;
    height: 7.25rem;
    margin: 0 auto 1.35rem;
}

.loading-progress {
    display: block;
    width: 100%;
    height: 100%;
    margin: 0;
}

.loading-progress circle {
    fill: none;
    stroke-width: 7;
    transform-origin: 50% 50%;
    transform: rotate(-90deg);
}

.loading-progress circle:first-child {
    stroke: rgba(69, 76, 238, 0.14);
}

.loading-progress circle:last-child {
    stroke: #454cee;
    stroke-linecap: round;
    stroke-dasharray: calc(2.51327 * var(--blazor-load-percentage, 0%)), 251.327;
    transition: stroke-dasharray 0.08s ease-out;
}

@media (prefers-color-scheme: dark) {
    .loading-progress circle:first-child {
        stroke: rgba(152, 120, 255, 0.22);
    }

    .loading-progress circle:last-child {
        stroke: #9898ff;
    }
}

.loading-progress-text {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 0;
    font-size: 1.125rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.02em;
    color: #454cee;
    pointer-events: none;
}

@media (prefers-color-scheme: dark) {
    .loading-progress-text {
        color: #c8c2ff;
    }
}

.loading-progress-text::after {
    content: var(--blazor-load-percentage-text, "…");
}

.rs-boot__brand {
    margin: 0 0 0.4rem;
    font-size: 1.35rem;
    font-weight: 950;
    letter-spacing: -0.02em;
    color: rgba(33, 37, 41, 0.94);
}

.rs-boot__hint {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.4;
    color: rgba(33, 37, 41, 0.62);
}

@media (prefers-color-scheme: dark) {
    .rs-boot__brand {
        color: rgba(248, 249, 250, 0.95);
    }

    .rs-boot__hint {
        color: rgba(248, 249, 250, 0.62);
    }
}