:root { --site-row-hover: #fff8e8; --site-row-edge: #efbd59; }

:is(.problem-catalog__list .catalog-rows > .catalog-row, .hc-contest-list > .hc-contest-row,
    .hc-focus-stack > .hc-focus-card, .hw-list > .hw-assignment, .lesson-group-options > label)
    :where(a):focus-visible { outline: 2px solid #285fd0; outline-offset: 2px; }

:is(.problem-catalog__list .catalog-rows > .catalog-row, .hc-contest-list > .hc-contest-row,
    .hc-focus-stack > .hc-focus-card, .hw-list > .hw-assignment, .lesson-group-options > label):focus-within,
.rc-ranking-table > tbody > tr:focus-within > td {
    background-color: var(--site-row-hover);
    background-image: none;
}
:is(.page--contest_problemlist, .page--contest_scoreboard, .page--homework_scoreboard)
    .data-table > tbody > tr:focus-within > td { box-shadow: inset 0 0 0 40px #f9ce7729; }

@media (hover: hover) {
    :is(.problem-catalog__list .catalog-rows > .catalog-row, .hc-contest-list > .hc-contest-row,
        .hc-focus-stack > .hc-focus-card, .hw-list > .hw-assignment, .lesson-group-options > label):hover,
    .rc-ranking-table > tbody > tr:hover > td {
        background-color: var(--site-row-hover);
        background-image: none;
    }
    :is(.page--contest_problemlist, .page--contest_scoreboard, .page--homework_scoreboard)
        .data-table > tbody > tr:hover > td { box-shadow: inset 0 0 0 40px #f9ce7729; }
    :is(.problem-catalog__list .catalog-rows > .catalog-row, .hc-contest-list > .hc-contest-row,
        .hc-focus-stack > .hc-focus-card, .hw-list > .hw-assignment):hover,
    .rc-ranking-table > tbody > tr:hover > td:first-child {
        box-shadow: inset 3px 0 var(--site-row-edge);
    }
}

.rc-manual-refresh {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    border: 1px solid #dce6f5;
    border-radius: 8px;
    color: #1b52be;
    font-size: 13px;
    white-space: nowrap;
}
.rc-manual-refresh:is(:hover, :focus-visible) { background: #eef4ff; }

:is(.problem-catalog, .problem-catalog__results, .problem-catalog__results [data-fragment-id="problem_list"],
    .catalog-rows, .catalog-row, .problem-reader-statement, .problem-content-container, .problem-content,
    [data-fragment-id="problem-description"]) {
    animation: none !important;
    transition: none !important;
    content-visibility: visible;
}

html:is(.page--problem_main, .page--problem_category, .page--problem_detail,
    .page--contest_detail_problem, .page--homework_detail_problem)::view-transition-group(*),
html:is(.page--problem_main, .page--problem_category, .page--problem_detail,
    .page--contest_detail_problem, .page--homework_detail_problem)::view-transition-new(*) {
    animation: none !important;
}
html:is(.page--problem_main, .page--problem_category, .page--problem_detail,
    .page--contest_detail_problem, .page--homework_detail_problem)::view-transition-old(*) {
    animation: none !important;
    display: none;
}

.lesson-audience { margin: 0 0 14px; padding: 18px; border: 1px solid #dce6f5; border-radius: 12px; }
.lesson-audience legend { padding: 0 6px; color: #172840; font-weight: 700; }
.lesson-audience p { margin: 0 0 12px; color: #4b607c; font-size: 13px; }
.lesson-audience__heading { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.lesson-audience__heading a { color: #174fc7; font-size: 13px; }
.lesson-audience__users { display: block; margin: 12px 0 6px; font-weight: 650; }
.lesson-audience .textbox { box-sizing: border-box; width: 100%; }
.lesson-group-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(170px, 100%), 1fr)); gap: 8px; max-height: 14rem; overflow-y: auto; }
.lesson-group-options > label { display: flex; align-items: baseline; gap: 7px; padding: 8px 10px; border: 1px solid #e0e9f6; border-radius: 8px; cursor: pointer; overflow-wrap: anywhere; }
.lesson-group-options small { color: #4b607c; white-space: nowrap; }
