/*
   Раздел /articles: блоки статьи и интерактивы.
   Каркас страницы (sbj-*) берётся из content-pages.css, здесь — только то,
   чего там нет. Префикс art-.
*/

:root {
    --art-ok: #0f9d58;
    --art-ok-soft: #e6f6ec;
    --art-bad: #c5221f;
    --art-bad-soft: #fdecec;
    --art-warn: #e8710a;
    --art-warn-soft: #fff3e6;
    --art-info: #1a73e8;
    --art-info-soft: #e8f0fe;
    --art-font-scale: 1;
}

/* ---------- Страница ---------- */

.art-progress {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    z-index: 1030;
    background: transparent;
    pointer-events: none;
}

.art-progress__bar {
    display: block;
    width: 0;
    height: 100%;
    background: linear-gradient(90deg, var(--sbj-primary) 0%, #b388ff 100%);
    transition: width .15s linear;
}

.art-meta {
    flex-wrap: wrap;
    gap: 8px;
}

.art-meta .sbj-pagehead__eyebrow a {
    color: inherit;
    text-decoration: none;
}

.art-body {
    font-size: calc(15.5px * var(--art-font-scale));
}

.art-body > * + * {
    margin-top: 1em;
}

.art-body .art-h {
    position: relative;
    scroll-margin-top: 90px;
    font-family: 'Rubik', var(--bs-font-sans-serif, sans-serif);
    color: var(--sbj-ink);
    line-height: 1.3;
}

.art-body .art-h--h2 {
    margin: 2.2em 0 .8em;
    padding-top: 1.2em;
    border-top: 1px solid var(--sbj-line);
    font-size: 1.45em;
    font-weight: 600;
}

.art-body .art-h--h2:first-child {
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
}

.art-body .art-h--h3 {
    margin: 1.6em 0 .6em;
    font-size: 1.15em;
    font-weight: 600;
}

.art-h__anchor {
    margin-left: .35em;
    color: var(--sbj-line);
    text-decoration: none;
    font-weight: 400;
    opacity: 0;
    transition: opacity .15s, color .15s;
}

.art-h:hover .art-h__anchor,
.art-h__anchor:focus {
    opacity: 1;
    color: var(--sbj-primary);
}

.art-body p {
    margin: 0 0 1em;
}

.art-body mark {
    padding: 0 .2em;
    background: #fff3b0;
    border-radius: 3px;
}

.art-body code {
    padding: .1em .35em;
    border-radius: 4px;
    background: var(--sbj-primary-soft);
    color: var(--sbj-primary-dark);
    font-size: .92em;
}

.art-link {
    color: var(--sbj-primary-dark);
    text-decoration: underline;
    text-decoration-color: rgba(103, 58, 183, .35);
    text-underline-offset: 3px;
}

.art-link:hover {
    text-decoration-color: var(--sbj-primary);
}

.art-list {
    padding-left: 1.4em;
    margin: 0 0 1em;
}

.art-list li + li {
    margin-top: .4em;
}

/* ---------- Кнопки и оболочка интерактива ---------- */

.art-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 16px;
    border: 1px solid var(--sbj-primary);
    border-radius: 999px;
    background: var(--sbj-primary);
    color: #fff;
    font: inherit;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.2;
    cursor: pointer;
    transition: background .15s, color .15s, border-color .15s, transform .1s;
}

.art-btn:hover {
    background: var(--sbj-primary-dark);
    border-color: var(--sbj-primary-dark);
}

.art-btn:active {
    transform: translateY(1px);
}

.art-btn:disabled {
    opacity: .55;
    cursor: default;
}

.art-btn--ghost {
    background: #fff;
    color: var(--sbj-primary-dark);
    border-color: rgba(103, 58, 183, .35);
}

.art-btn--ghost:hover {
    background: var(--sbj-primary-soft);
    color: var(--sbj-primary-dark);
    border-color: var(--sbj-primary);
}

.art-widget__head {
    margin-bottom: 14px;
}

.art-widget__kicker {
    display: inline-block;
    margin-bottom: 4px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--sbj-primary);
}

.art-widget__title {
    margin: 0;
    font-family: 'Rubik', sans-serif;
    font-size: 1.1em;
    font-weight: 600;
    color: var(--sbj-ink);
}

.art-widget__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-top: 16px;
}

.art-quiz,
.art-cloze,
.art-cards-deck,
.art-match,
.art-order,
.art-poll,
.art-steps,
.art-wiki,
.art-persons,
.art-glossary {
    margin: 1.6em 0;
    padding: clamp(16px, 2.2vw, 24px);
    border: 1px solid rgba(103, 58, 183, .22);
    border-radius: var(--sbj-radius);
    background: linear-gradient(180deg, #faf8ff 0%, #fff 100%);
}

.art-quiz,
.art-cloze,
.art-cards-deck,
.art-match,
.art-order {
    border-left: 4px solid var(--sbj-primary);
}

/* ---------- Цитата, врезка, определение ---------- */

.art-quote {
    margin: 1.6em 0;
    padding: 4px 0 4px 20px;
    border-left: 3px solid var(--sbj-primary);
}

.art-quote__text {
    margin: 0;
    font-style: italic;
    font-size: 1.05em;
    color: var(--sbj-ink);
}

.art-quote__text::before { content: '«'; }
.art-quote__text::after { content: '»'; }

.art-quote__cite {
    margin-top: 8px;
    font-size: .9em;
    color: var(--sbj-muted);
}

.art-quote__author { font-weight: 600; color: #363248; }
.art-quote__source::before { content: ' — '; }

.art-callout {
    margin: 1.4em 0;
    padding: 14px 18px 14px 50px;
    position: relative;
    border-radius: 12px;
    border: 1px solid var(--sbj-line);
    background: #fafafa;
}

.art-callout__title {
    margin: 0 0 4px;
    font-weight: 600;
    color: var(--sbj-ink);
}

.art-callout__icon {
    position: absolute;
    left: 16px;
    top: 14px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--sbj-muted);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    line-height: 22px;
    text-align: center;
}

.art-callout__icon::before { content: 'i'; }

.art-callout__body > :last-child { margin-bottom: 0; }

.art-callout--info { background: var(--art-info-soft); border-color: rgba(26, 115, 232, .25); }
.art-callout--info .art-callout__icon { background: var(--art-info); }
.art-callout--tip { background: var(--art-ok-soft); border-color: rgba(15, 157, 88, .25); }
.art-callout--tip .art-callout__icon { background: var(--art-ok); }
.art-callout--tip .art-callout__icon::before { content: '✓'; }
.art-callout--warning { background: var(--art-warn-soft); border-color: rgba(232, 113, 10, .3); }
.art-callout--warning .art-callout__icon { background: var(--art-warn); }
.art-callout--warning .art-callout__icon::before { content: '!'; }
.art-callout--important { background: var(--art-bad-soft); border-color: rgba(197, 34, 31, .25); }
.art-callout--important .art-callout__icon { background: var(--art-bad); }
.art-callout--important .art-callout__icon::before { content: '!'; }
.art-callout--example { background: #fff; border-color: rgba(103, 58, 183, .3); border-style: dashed; }
.art-callout--example .art-callout__icon { background: var(--sbj-primary); }
.art-callout--example .art-callout__icon::before { content: '≡'; }
.art-callout--definition { background: var(--sbj-primary-soft); border-color: rgba(103, 58, 183, .3); }
.art-callout--definition .art-callout__icon { background: var(--sbj-primary); }
.art-callout--definition .art-callout__icon::before { content: 'A'; }

.art-def {
    margin: 1.4em 0;
    padding: 14px 18px;
    border-radius: 12px;
    background: var(--sbj-primary-soft);
    border-left: 4px solid var(--sbj-primary);
}

.art-def__term {
    margin: 0 0 4px;
    font-family: 'Rubik', sans-serif;
    font-weight: 600;
    color: var(--sbj-primary-dark);
}

.art-def__term::after { content: ' —'; }

.art-def__body { margin: 0; }
.art-def__body > :last-child { margin-bottom: 0; }

/* ---------- Таблица, формула, код ---------- */

.art-table {
    margin: 1.6em 0;
}

.art-table__title {
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--sbj-ink);
}

.art-table__caption {
    margin-top: 8px;
    font-size: .9em;
    color: var(--sbj-muted);
}

.art-table table {
    width: 100%;
    border-collapse: collapse;
    font-size: .95em;
}

.art-table th,
.art-table td {
    padding: 9px 12px;
    border: 1px solid var(--sbj-line);
    vertical-align: top;
    text-align: left;
}

.art-table thead th {
    background: var(--sbj-primary-soft);
    color: var(--sbj-primary-dark);
    font-weight: 600;
}

.art-table tbody th {
    font-weight: 600;
    background: #fafafa;
}

.art-table tbody tr:hover td { background: #fcfbff; }

.art-formula {
    margin: 1.6em 0;
    padding: 16px;
    border-radius: 12px;
    border: 1px solid var(--sbj-line);
    background: #fff;
    text-align: center;
    overflow-x: auto;
}

.art-formula__tex code {
    background: none;
    color: var(--sbj-ink);
    font-size: 1em;
}

.art-formula__tex .katex-display { margin: 0; }

.art-formula__caption {
    margin-top: 8px;
    font-size: .9em;
    color: var(--sbj-muted);
}

.art-code {
    margin: 1.6em 0;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--sbj-line);
    background: #1e1b2a;
    color: #e8e5f0;
}

.art-code__bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 12px;
    background: #2a2638;
    font-size: 12px;
    color: #b9b4cc;
}

.art-code__copy {
    padding: 4px 10px;
    font-size: 12px;
    background: transparent;
    color: #e8e5f0;
    border-color: rgba(255, 255, 255, .25);
}

.art-code__copy:hover { background: rgba(255, 255, 255, .1); color: #fff; }

.art-code__pre {
    margin: 0;
    padding: 14px 16px;
    overflow-x: auto;
    font-size: 13.5px;
    line-height: 1.55;
}

.art-code__pre code {
    background: none;
    color: inherit;
    padding: 0;
    font-size: inherit;
}

/* ---------- Чек-лист ---------- */

.art-checklist {
    list-style: none;
    padding: 0;
    margin: 1.2em 0;
}

.art-checklist__item + .art-checklist__item { margin-top: 8px; }

.art-checklist__label {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 10px 14px;
    border: 1px solid var(--sbj-line);
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
    transition: background .15s, border-color .15s;
}

.art-checklist__label:hover { border-color: rgba(103, 58, 183, .4); }

.art-checklist__box {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.art-checklist__mark {
    flex: 0 0 22px;
    width: 22px;
    height: 22px;
    margin-top: 1px;
    border: 2px solid rgba(103, 58, 183, .5);
    border-radius: 6px;
    position: relative;
    transition: background .15s, border-color .15s;
}

.art-checklist__mark::after {
    content: '';
    position: absolute;
    left: 6px;
    top: 2px;
    width: 6px;
    height: 11px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg) scale(0);
    transition: transform .15s;
}

.art-checklist__box:checked + .art-checklist__mark {
    background: var(--sbj-primary);
    border-color: var(--sbj-primary);
}

.art-checklist__box:checked + .art-checklist__mark::after { transform: rotate(45deg) scale(1); }

.art-checklist__box:checked ~ .art-checklist__text { color: var(--sbj-muted); }

.art-checklist--takeaways .art-checklist__label { background: #fdfcff; }

/* ---------- Шаги, хронология, сравнение, карточки ---------- */

.art-steps__list {
    list-style: none;
    margin: 0;
    padding: 0;
    counter-reset: none;
}

.art-steps__item {
    display: flex;
    gap: 14px;
    padding: 12px 0;
    border-top: 1px dashed var(--sbj-line);
    animation: art-in .25s ease;
}

.art-steps__item:first-child { border-top: 0; padding-top: 0; }

.art-steps__num {
    flex: 0 0 32px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--sbj-primary);
    color: #fff;
    font-weight: 600;
    text-align: center;
    line-height: 32px;
}

.art-steps__title { margin: 4px 0 4px; font-weight: 600; color: var(--sbj-ink); }
.art-steps__text > :last-child { margin-bottom: 0; }
.art-steps__count { opacity: .8; font-weight: 400; }

@keyframes art-in {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: none; }
}

.art-timeline { margin: 1.6em 0; }

.art-timeline__list {
    list-style: none;
    margin: 0;
    padding: 0 0 0 22px;
    border-left: 2px solid rgba(103, 58, 183, .3);
}

.art-timeline__item { position: relative; padding: 4px 0 14px; }

.art-timeline__head {
    display: block;
    width: 100%;
    padding: 6px 10px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    text-align: left;
    font: inherit;
    color: var(--sbj-ink);
    cursor: pointer;
}

.art-timeline__head:hover { background: var(--sbj-primary-soft); }

.art-timeline__dot {
    position: absolute;
    left: -29px;
    top: 13px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #fff;
    border: 3px solid var(--sbj-primary);
    transition: background .15s;
}

.art-timeline__head[aria-expanded="true"] .art-timeline__dot { background: var(--sbj-primary); }

.art-timeline__date {
    display: inline-block;
    margin-right: 10px;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--sbj-primary-soft);
    color: var(--sbj-primary-dark);
    font-size: .85em;
    font-weight: 600;
}

.art-timeline__title { font-weight: 600; }

.art-timeline__body {
    padding: 4px 10px 6px;
    color: #363248;
    animation: art-in .2s ease;
}

.art-timeline__body > :last-child { margin-bottom: 0; }

.art-compare { margin: 1.6em 0; }

.art-compare__grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.art-compare__col {
    padding: 14px 16px;
    border: 1px solid var(--sbj-line);
    border-radius: 12px;
    background: #fff;
}

.art-compare__head {
    margin: 0 0 8px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--sbj-primary-soft);
    font-weight: 600;
    color: var(--sbj-primary-dark);
}

.art-compare__list { margin: 0; padding-left: 1.2em; }
.art-compare__list li + li { margin-top: 6px; }

.art-cards { margin: 1.6em 0; }

.art-cards__grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.art-cards__item {
    padding: 14px 16px;
    border: 1px solid var(--sbj-line);
    border-radius: 12px;
    background: #fff;
    transition: box-shadow .15s, border-color .15s;
}

.art-cards__item:hover { border-color: rgba(103, 58, 183, .35); box-shadow: 0 8px 24px -18px rgba(103, 58, 183, .6); }

.art-cards__title { margin: 0 0 6px; font-weight: 600; color: var(--sbj-ink); }
.art-cards__body { font-size: .95em; }
.art-cards__body > :last-child { margin-bottom: 0; }

/* ---------- Вкладки, спойлер, аккордеон ---------- */

.art-tabs { margin: 1.6em 0; }

.art-tabs__bar {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 6px;
    border: 1px solid var(--sbj-line);
    border-radius: 14px;
    background: #fff;
}

.art-tabs__tab {
    padding: 8px 14px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    font: inherit;
    font-size: 14px;
    font-weight: 500;
    color: var(--sbj-muted);
    cursor: pointer;
    transition: background .15s, color .15s;
}

.art-tabs__tab:hover { color: var(--sbj-primary-dark); }

.art-tabs__tab[aria-selected="true"] {
    background: var(--sbj-primary);
    color: #fff;
}

.art-tabs__panel {
    padding: 16px 18px;
    border: 1px solid var(--sbj-line);
    border-top: 0;
    border-radius: 0 0 14px 14px;
    margin-top: -1px;
    background: #fff;
    animation: art-in .2s ease;
}

.art-tabs__panel > :last-child { margin-bottom: 0; }

.art-spoiler,
.art-accordion__item {
    margin: 1em 0;
    border: 1px solid rgba(103, 58, 183, .25);
    border-radius: 12px;
    background: #fff;
    overflow: hidden;
}

.art-accordion__item { margin: 8px 0; }

.art-spoiler__summary,
.art-accordion__summary {
    padding: 12px 16px 12px 42px;
    position: relative;
    cursor: pointer;
    font-weight: 600;
    color: var(--sbj-primary-dark);
    list-style: none;
    user-select: none;
    transition: background .15s;
}

.art-spoiler__summary::-webkit-details-marker,
.art-accordion__summary::-webkit-details-marker { display: none; }

.art-spoiler__summary::before,
.art-accordion__summary::before {
    content: '';
    position: absolute;
    left: 16px;
    top: 50%;
    width: 8px;
    height: 8px;
    border-right: 2px solid var(--sbj-primary);
    border-bottom: 2px solid var(--sbj-primary);
    transform: translateY(-70%) rotate(45deg);
    transition: transform .2s;
}

details[open] > .art-spoiler__summary::before,
details[open] > .art-accordion__summary::before { transform: translateY(-30%) rotate(-135deg); }

.art-spoiler__summary:hover,
.art-accordion__summary:hover { background: var(--sbj-primary-soft); }

.art-spoiler__body,
.art-accordion__body {
    padding: 4px 16px 16px;
    animation: art-in .2s ease;
}

.art-spoiler__body > :last-child,
.art-accordion__body > :last-child { margin-bottom: 0; }

/* ---------- Тест ---------- */

.art-quiz__q {
    margin: 0 0 18px;
    padding: 0;
    border: 0;
    min-width: 0;
}

.art-quiz__text {
    float: none;
    width: 100%;
    margin-bottom: 8px;
    padding: 0;
    font-weight: 600;
    color: var(--sbj-ink);
    font-size: 1em;
}

.art-quiz__num { color: var(--sbj-primary); margin-right: 4px; }
.art-quiz__hint { font-weight: 400; color: var(--sbj-muted); font-size: .9em; }

.art-quiz__options { display: grid; gap: 6px; }

.art-quiz__option {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 9px 12px;
    border: 1px solid var(--sbj-line);
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
    transition: border-color .15s, background .15s;
}

.art-quiz__option:hover { border-color: rgba(103, 58, 183, .45); }

.art-quiz__option input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.art-quiz__mark {
    flex: 0 0 18px;
    width: 18px;
    height: 18px;
    margin-top: 2px;
    border: 2px solid rgba(103, 58, 183, .5);
    border-radius: 50%;
    position: relative;
}

.art-quiz__option input[type="checkbox"] + .art-quiz__mark { border-radius: 5px; }

.art-quiz__option input:checked + .art-quiz__mark { border-color: var(--sbj-primary); }

.art-quiz__option input:checked + .art-quiz__mark::after {
    content: '';
    position: absolute;
    inset: 3px;
    border-radius: inherit;
    background: var(--sbj-primary);
}

.art-quiz__option input:focus-visible + .art-quiz__mark { outline: 2px solid var(--sbj-primary); outline-offset: 2px; }

.art-quiz__option.is-correct { border-color: var(--art-ok); background: var(--art-ok-soft); }
.art-quiz__option.is-wrong { border-color: var(--art-bad); background: var(--art-bad-soft); }
.art-quiz__option.is-missed { border-color: var(--art-ok); border-style: dashed; }

.art-quiz.is-checked .art-quiz__option { cursor: default; }

.art-quiz__explain {
    margin: 10px 0 0;
    padding: 10px 14px;
    border-radius: 10px;
    background: var(--art-info-soft);
    font-size: .95em;
    animation: art-in .2s ease;
}

.art-quiz__score,
.art-cloze__score,
.art-match__score,
.art-order__score {
    margin: 0;
    font-weight: 600;
    color: var(--sbj-ink);
}

.art-quiz__score.is-good { color: var(--art-ok); }
.art-quiz__score.is-bad { color: var(--art-bad); }

/* ---------- Пропуски ---------- */

.art-cloze__text { line-height: 2.2; }

.art-cloze__input {
    display: inline-block;
    margin: 0 2px;
    padding: 2px 8px;
    border: 0;
    border-bottom: 2px solid rgba(103, 58, 183, .5);
    border-radius: 6px 6px 0 0;
    background: var(--sbj-primary-soft);
    font: inherit;
    font-size: .95em;
    color: var(--sbj-ink);
    text-align: center;
    min-width: 60px;
    outline: none;
    transition: border-color .15s, background .15s;
}

.art-cloze__input:focus { border-color: var(--sbj-primary); background: #fff; }
.art-cloze__input.is-correct { border-color: var(--art-ok); background: var(--art-ok-soft); }
.art-cloze__input.is-wrong { border-color: var(--art-bad); background: var(--art-bad-soft); }
.art-cloze__input.is-revealed { border-color: var(--art-info); background: var(--art-info-soft); }

.art-cloze__hint { margin: 8px 0 0; font-size: .9em; color: var(--sbj-muted); }

/* ---------- Карточки (flashcards) ---------- */

.art-flash__stage {
    perspective: 1200px;
    min-height: 160px;
}

.art-flash {
    display: block;
    position: relative;
    width: 100%;
    min-height: 160px;
    padding: 0;
    border: 0;
    background: transparent;
    font: inherit;
    cursor: pointer;
    transform-style: preserve-3d;
    transition: transform .45s cubic-bezier(.4, 0, .2, 1);
}

.art-flash.is-flipped { transform: rotateY(180deg); }

.art-flash__face {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 22px 26px;
    border-radius: 14px;
    border: 1px solid rgba(103, 58, 183, .3);
    background: #fff;
    color: var(--sbj-ink);
    text-align: center;
    font-size: 1.05em;
    backface-visibility: hidden;
    box-shadow: 0 10px 30px -22px rgba(103, 58, 183, .6);
}

.art-flash__face--front { font-weight: 600; }

.art-flash__face--back {
    transform: rotateY(180deg);
    background: var(--sbj-primary-soft);
    font-size: .98em;
}

.art-flash__hint { margin: 10px 0 0; font-size: .85em; color: var(--sbj-muted); text-align: center; }
.art-flash__count { margin-left: auto; font-size: .9em; color: var(--sbj-muted); }
.art-flash__done { margin: 12px 0 0; font-weight: 600; color: var(--art-ok); }

/* ---------- Сопоставление ---------- */

.art-match__hint { margin: 0 0 12px; font-size: .9em; color: var(--sbj-muted); }

.art-match__grid {
    display: grid;
    gap: 12px;
    grid-template-columns: 1fr 1fr;
}

@media (max-width: 575.98px) {
    .art-match__grid { grid-template-columns: 1fr; }
}

.art-match__col { display: grid; gap: 8px; align-content: start; }

.art-match__item {
    display: block;
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--sbj-line);
    border-radius: 10px;
    background: #fff;
    text-align: left;
    font: inherit;
    font-size: .95em;
    color: var(--sbj-ink);
    cursor: pointer;
    transition: border-color .15s, background .15s, transform .1s;
}

.art-match__item:hover { border-color: rgba(103, 58, 183, .45); }
.art-match__item.is-selected { border-color: var(--sbj-primary); background: var(--sbj-primary-soft); }
.art-match__item.is-paired { border-color: var(--sbj-primary); }
.art-match__item.is-paired::before {
    content: attr(data-badge);
    display: inline-block;
    min-width: 20px;
    margin-right: 8px;
    padding: 0 6px;
    border-radius: 999px;
    background: var(--sbj-primary);
    color: #fff;
    font-size: .8em;
    text-align: center;
}
.art-match__item.is-correct { border-color: var(--art-ok); background: var(--art-ok-soft); }
.art-match__item.is-wrong { border-color: var(--art-bad); background: var(--art-bad-soft); }

/* ---------- Порядок ---------- */

.art-order__prompt { margin: 0 0 12px; color: #363248; }

.art-order__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 8px;
}

.art-order__item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid var(--sbj-line);
    border-radius: 10px;
    background: #fff;
    cursor: grab;
    transition: border-color .15s, background .15s;
}

.art-order__item.is-dragging { opacity: .5; }
.art-order__item.is-over { border-color: var(--sbj-primary); border-style: dashed; }
.art-order__item.is-correct { border-color: var(--art-ok); background: var(--art-ok-soft); }
.art-order__item.is-wrong { border-color: var(--art-bad); background: var(--art-bad-soft); }

.art-order__handle { color: var(--sbj-muted); letter-spacing: -3px; user-select: none; }
.art-order__text { flex: 1; }
.art-order__ctl { display: flex; gap: 4px; }

.art-order__btn {
    width: 28px;
    height: 28px;
    border: 1px solid var(--sbj-line);
    border-radius: 6px;
    background: #fff;
    color: var(--sbj-primary-dark);
    cursor: pointer;
}

.art-order__btn:hover { background: var(--sbj-primary-soft); }
.art-order__btn:disabled { opacity: .3; cursor: default; }

/* ---------- Опрос ---------- */

.art-poll__options { display: grid; gap: 8px; }

.art-poll__option {
    position: relative;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 4px 12px;
    align-items: center;
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--sbj-line);
    border-radius: 10px;
    background: #fff;
    text-align: left;
    font: inherit;
    color: var(--sbj-ink);
    cursor: pointer;
    transition: border-color .15s;
}

.art-poll__option:hover { border-color: rgba(103, 58, 183, .45); }
.art-poll__option:disabled { cursor: default; }
.art-poll__option.is-mine { border-color: var(--sbj-primary); }

.art-poll__bar {
    grid-column: 1 / -1;
    height: 6px;
    border-radius: 999px;
    background: var(--sbj-line);
    overflow: hidden;
    display: none;
}

.art-poll__fill {
    display: block;
    height: 100%;
    width: 0;
    background: var(--sbj-primary);
    transition: width .5s ease;
}

.art-poll__pct { font-weight: 600; color: var(--sbj-primary-dark); display: none; }

.art-poll.is-voted .art-poll__bar,
.art-poll.is-voted .art-poll__pct { display: block; }

.art-poll__note { margin: 10px 0 0; font-size: .9em; color: var(--sbj-muted); }

/* ---------- Википедия, персоны ---------- */

.art-wiki__items { display: grid; gap: 8px; }

.art-wiki__item {
    border: 1px solid var(--sbj-line);
    border-radius: 12px;
    background: #fff;
}

.art-wiki__summary {
    padding: 12px 16px;
    cursor: pointer;
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 4px 10px;
    align-items: baseline;
}

.art-wiki__summary::-webkit-details-marker { display: none; }
.art-wiki__name { font-weight: 600; color: var(--sbj-primary-dark); }
.art-wiki__desc { font-size: .9em; color: var(--sbj-muted); }

.art-wiki__body {
    padding: 0 16px 14px;
    display: flow-root;
}

.art-wiki__thumb {
    float: right;
    margin: 0 0 8px 14px;
    border-radius: 8px;
    max-width: 120px;
    height: auto;
}

.art-wiki__extract { margin: 0 0 8px; font-size: .95em; }

.art-wiki__link {
    font-weight: 500;
    color: var(--sbj-primary-dark);
    text-decoration: none;
}

.art-wiki__link:hover { text-decoration: underline; }

.art-wiki__search {
    display: flex;
    gap: 8px;
    margin-top: 14px;
}

.art-wiki__input {
    flex: 1;
    min-width: 0;
    padding: 9px 14px;
    border: 1px solid var(--sbj-line);
    border-radius: 999px;
    font: inherit;
    font-size: 14px;
}

.art-wiki__input:focus { outline: none; border-color: var(--sbj-primary); }

.art-wiki__results { display: grid; gap: 8px; margin-top: 10px; }

.art-wiki__result {
    padding: 10px 14px;
    border: 1px dashed rgba(103, 58, 183, .35);
    border-radius: 10px;
    background: #fff;
    font-size: .95em;
    animation: art-in .2s ease;
}

.art-wiki__result p { margin: 4px 0 0; }
.art-wiki__status { font-size: .9em; color: var(--sbj-muted); }

.art-persons__grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

.art-person {
    border: 1px solid var(--sbj-line);
    border-radius: 12px;
    background: #fff;
    transition: border-color .15s, box-shadow .15s;
}

.art-person:hover { border-color: rgba(103, 58, 183, .4); box-shadow: 0 10px 28px -20px rgba(103, 58, 183, .7); }

.art-person__link {
    display: flex;
    gap: 12px;
    padding: 12px 14px;
    color: inherit;
    text-decoration: none;
}

.art-person__photo {
    flex: 0 0 56px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--sbj-primary-soft);
}

.art-person__photo--empty {
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Rubik', sans-serif;
    font-weight: 600;
    font-size: 20px;
    color: var(--sbj-primary-dark);
}

.art-person__body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.art-person__name { font-weight: 600; color: var(--sbj-ink); }
.art-person__years { font-size: .85em; color: var(--sbj-muted); }
.art-person__role { font-size: .9em; color: #363248; }
.art-person__note { font-size: .85em; color: var(--sbj-primary-dark); margin-top: 2px; }

.art-aside-persons { list-style: none; margin: 0; padding: 0; }
.art-aside-persons li { padding: 6px 0; border-top: 1px solid var(--sbj-line); font-size: 14px; }
.art-aside-persons li:first-child { border-top: 0; padding-top: 0; }
.art-aside-persons a { color: var(--sbj-primary-dark); text-decoration: none; font-weight: 500; }
.art-aside-persons span { margin-left: 6px; color: var(--sbj-muted); font-size: .9em; }

/* ---------- Словарь, литература, сноски ---------- */

.art-glossary__filter { display: block; margin-bottom: 12px; }

.art-glossary__input {
    width: 100%;
    padding: 9px 14px;
    border: 1px solid var(--sbj-line);
    border-radius: 999px;
    font: inherit;
    font-size: 14px;
}

.art-glossary__input:focus { outline: none; border-color: var(--sbj-primary); }

.art-glossary__list { margin: 0; }

.art-glossary__item {
    padding: 10px 0;
    border-top: 1px solid var(--sbj-line);
}

.art-glossary__item:first-child { border-top: 0; padding-top: 0; }
.art-glossary__term { font-weight: 600; color: var(--sbj-primary-dark); }
.art-glossary__def { margin: 2px 0 0; }
.art-glossary__empty { margin: 8px 0 0; color: var(--sbj-muted); }

.art-reading { list-style: none; margin: 1.2em 0; padding: 0; display: grid; gap: 10px; }

.art-reading__item {
    padding: 12px 16px;
    border: 1px solid var(--sbj-line);
    border-radius: 12px;
    background: #fff;
    display: grid;
    gap: 2px;
}

.art-reading__title { font-weight: 600; color: var(--sbj-ink); }
.art-reading__meta { font-size: .9em; color: var(--sbj-muted); }
.art-reading__note { font-size: .95em; color: #363248; }

.art-fn { font-size: .75em; line-height: 0; }

.art-fn a {
    padding: 0 3px;
    border-radius: 4px;
    background: var(--sbj-primary-soft);
    color: var(--sbj-primary-dark);
    text-decoration: none;
    font-weight: 600;
}

.art-fn a:hover { background: var(--sbj-primary); color: #fff; }

.art-fnpop {
    position: absolute;
    z-index: 20;
    max-width: 320px;
    padding: 10px 14px;
    border: 1px solid rgba(103, 58, 183, .3);
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 14px 40px -20px rgba(27, 23, 37, .5);
    font-size: 14px;
    line-height: 1.5;
    color: #363248;
    animation: art-in .15s ease;
}

.art-footnotes__list { padding-left: 1.4em; margin: 0; font-size: .95em; }
.art-footnotes__item { padding: 4px 0; scroll-margin-top: 90px; }
.art-footnotes__item:target { background: #fff9d6; }
.art-footnotes__back { margin-left: 6px; text-decoration: none; color: var(--sbj-primary); }

/* ---------- Оглавление и инструменты ---------- */

.art-toc__progress {
    margin: -6px 0 10px;
    font-size: 12px;
    color: var(--sbj-muted);
}

.art-toc__list { counter-reset: toc; }

.art-toc__list li {
    position: relative;
    transition: color .15s;
}

.art-toc__list li.is-active > a { color: var(--sbj-primary-dark); font-weight: 600; }
.art-toc__list li.is-read > a::after { content: ' ✓'; color: var(--art-ok); font-size: .85em; }

.art-toc__checks {
    margin: 12px 0 0;
    padding-top: 10px;
    border-top: 1px solid var(--sbj-line);
    font-size: 12px;
    color: var(--sbj-muted);
}

.art-toc-mobile {
    margin: 0 0 20px;
    border: 1px solid var(--sbj-line);
    border-radius: 12px;
    background: #fff;
}

.art-toc-mobile__summary {
    padding: 12px 16px;
    font-weight: 600;
    color: var(--sbj-primary-dark);
    cursor: pointer;
}

.art-toc-mobile__list { margin: 0; padding: 0 16px 12px 36px; }
.art-toc-mobile__list li { padding: 3px 0; }
.art-toc-mobile__list a { color: var(--sbj-ink); text-decoration: none; }

@media (min-width: 992px) {
    .art-toc-mobile { display: none; }
}

.art-tools {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.art-tools__btn {
    padding: 7px 12px;
    border: 1px solid var(--sbj-line);
    border-radius: 999px;
    background: #fff;
    font: inherit;
    font-size: 13px;
    color: var(--sbj-primary-dark);
    cursor: pointer;
}

.art-tools__btn:hover { border-color: var(--sbj-primary); background: var(--sbj-primary-soft); }
.art-tools__btn.is-done { background: var(--art-ok-soft); border-color: var(--art-ok); color: var(--art-ok); }

.art-helpful__title { margin: 0 0 12px; font-weight: 600; color: var(--sbj-ink); font-size: 1.05em; }
.art-helpful__actions { display: flex; flex-wrap: wrap; gap: 10px; }
.art-helpful__thanks { margin: 12px 0 0; color: var(--art-ok); font-weight: 600; }
.art-helpful__stat { margin: 12px 0 0; font-size: .9em; color: var(--sbj-muted); }
.art-helpful .art-btn.is-chosen { box-shadow: 0 0 0 3px rgba(103, 58, 183, .25); }

/* ---------- Каталог ---------- */

.art-search { position: relative; }

.art-search__btn {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    padding: 8px 16px;
    border: 0;
    border-radius: 999px;
    background: var(--sbj-primary);
    color: #fff;
    font: inherit;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
}

.art-search__btn:hover { background: var(--sbj-primary-dark); }
.art-search .sbj-search__input { padding-right: 96px; }
.art-search__scope { margin: 10px 0 0; font-size: 14px; color: var(--sbj-muted); }

.art-catgrid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
}

.art-catcard {
    display: flex;
    gap: 14px;
    padding: 16px;
    border: 1px solid var(--sbj-line);
    border-radius: 14px;
    background: #fff;
    color: inherit;
    text-decoration: none;
    transition: border-color .15s, box-shadow .15s, transform .15s;
}

.art-catcard:hover {
    color: inherit;
    border-color: rgba(103, 58, 183, .45);
    box-shadow: 0 14px 34px -24px rgba(103, 58, 183, .8);
    transform: translateY(-2px);
}

.art-catcard--empty { opacity: .7; }

.art-catcard__icon {
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: var(--sbj-primary-soft);
    color: var(--sbj-primary);
}

.art-catcard__icon svg { width: 24px; height: 24px; }
.art-catcard__body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.art-catcard__name { font-family: 'Rubik', sans-serif; font-weight: 600; color: var(--sbj-ink); }
.art-catcard__desc { font-size: 13px; color: var(--sbj-muted); line-height: 1.45; }
.art-catcard__count { margin-top: 4px; font-size: 12px; font-weight: 600; color: var(--sbj-primary-dark); }

.art-catnav {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0 0 20px;
}

.art-catnav--center { justify-content: center; margin-top: 14px; }

.art-catnav__item {
    padding: 6px 12px;
    border: 1px solid var(--sbj-line);
    border-radius: 999px;
    background: #fff;
    font-size: 13px;
    color: var(--sbj-ink);
    text-decoration: none;
    transition: border-color .15s, background .15s;
}

.art-catnav__item span { margin-left: 4px; color: var(--sbj-muted); }
.art-catnav__item:hover { border-color: var(--sbj-primary); color: var(--sbj-primary-dark); }
.art-catnav__item.is-active { background: var(--sbj-primary); border-color: var(--sbj-primary); color: #fff; }
.art-catnav__item.is-active span { color: rgba(255, 255, 255, .8); }

.art-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.art-card {
    border: 1px solid var(--sbj-line);
    border-radius: 14px;
    background: #fff;
    transition: border-color .15s, box-shadow .15s, transform .15s;
    content-visibility: auto;
    contain-intrinsic-size: auto 200px;
}

.art-card[hidden] { display: none !important; }

.art-card:hover {
    border-color: rgba(103, 58, 183, .45);
    box-shadow: 0 14px 34px -24px rgba(103, 58, 183, .8);
    transform: translateY(-2px);
}

.art-card__link {
    display: flex;
    flex-direction: column;
    gap: 8px;
    height: 100%;
    padding: 16px;
    color: inherit;
    text-decoration: none;
}

.art-card__link:hover { color: inherit; }

.art-card__meta {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    font-size: 12px;
    color: var(--sbj-muted);
}

.art-card__cat { font-weight: 600; color: var(--sbj-primary-dark); text-transform: uppercase; letter-spacing: .04em; font-size: 11px; }
.art-card__title { font-family: 'Rubik', sans-serif; font-weight: 600; font-size: 16px; line-height: 1.35; color: var(--sbj-ink); }
.art-card__lead { font-size: 13.5px; line-height: 1.5; color: #363248; }
.art-card__foot { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 6px; }

.art-card__chip {
    padding: 3px 9px;
    border-radius: 999px;
    background: var(--sbj-primary-soft);
    color: var(--sbj-primary-dark);
    font-size: 11.5px;
    font-weight: 500;
}

.art-card__chip--muted { background: #f3f2f7; color: var(--sbj-muted); }

.art-pager {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin: 8px 0 20px;
}

.art-pager__link {
    padding: 8px 16px;
    border: 1px solid var(--sbj-line);
    border-radius: 999px;
    background: #fff;
    color: var(--sbj-primary-dark);
    text-decoration: none;
    font-weight: 500;
}

.art-pager__link:hover { border-color: var(--sbj-primary); }
.art-pager__info { color: var(--sbj-muted); font-size: 14px; }

.art-personhead { display: flex; gap: 20px; align-items: flex-start; }

.art-personhead__photo {
    flex: 0 0 100px;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
}

@media print {
    .art-progress, .sbj-aside, .art-tools, .art-helpful, .sbj-block--chat,
    .art-widget__actions, .art-wiki__search, .art-wiki__results, .art-h__anchor { display: none !important; }
    .sbj-layout { grid-template-columns: 1fr; }
    details { open: true; }
    .art-steps__item[hidden], .art-tabs__panel[hidden], .art-timeline__body[hidden] { display: block !important; }
}

/* ---------- Вложенные категории ---------- */

/* Карточка дисциплины стала контейнером: ссылка на корень плюс чипы подразделов. */
.art-catcard { flex-direction: column; gap: 10px; }

.art-catcard__main {
    display: flex;
    gap: 14px;
    color: inherit;
    text-decoration: none;
}

.art-catcard__main:hover { color: inherit; }

.art-catcard__children {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding-top: 10px;
    border-top: 1px dashed var(--sbj-line);
}

.art-catcard__child {
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--sbj-primary-soft);
    color: var(--sbj-primary-dark);
    font-size: 12px;
    text-decoration: none;
    transition: background .15s, color .15s;
}

.art-catcard__child:hover { background: var(--sbj-primary); color: #fff; }

.art-catnav__item--up { border-style: dashed; color: var(--sbj-muted); }
