.site-nav .nav-item.nav-exam {
    display: none !important;
}

.site-nav .nav-item.nav-exam,
.site-nav .nav-item.nav-exam:hover,
.site-nav .nav-item.nav-exam.active,
html.event-autumn body.site-app.dark-mode .site-nav .nav-item.nav-exam.active {
    color: #ef9a9a !important;
    background: rgba(229, 57, 53, 0.16) !important;
    border: 1px solid rgba(239, 154, 154, 0.55) !important;
    border-radius: 8px;
    margin: 4px 0;
}

body.site-app:not(.dark-mode) .site-nav .nav-item.nav-exam,
body.site-app:not(.dark-mode) .site-nav .nav-item.nav-exam:hover,
body.site-app:not(.dark-mode) .site-nav .nav-item.nav-exam.active,
html.event-autumn body.site-app:not(.dark-mode) .site-nav .nav-item.nav-exam.active {
    color: #c62828 !important;
    background: #fdecec !important;
    border: 1px solid #f5c2c0 !important;
    border-radius: 8px;
    margin: 4px 0;
}

.exam-wrap {
    padding: 8px 4px 24px;
}
.exam-class {
    margin-bottom: 28px;
}
.exam-max {
    display: block;
    font-size: 11px;
    font-weight: 400;
    color: #64748b;
}
body.dark-mode .exam-max {
    color: #94a3b8;
}
.exam-table-scroll {
    overflow: auto;
    border: 1px solid #dbe3ee;
    background: #fff;
}
body.dark-mode .exam-table-scroll {
    border-color: #2a3348;
    background: #151c2c;
}
.exam-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 860px;
    font-size: 13px;
}
.exam-table th,
.exam-table td {
    border: 1px solid #e2e8f0;
    padding: 8px 6px;
    text-align: center;
    white-space: nowrap;
}
body.dark-mode .exam-table th,
body.dark-mode .exam-table td {
    border-color: #2f3b54;
}
.exam-table th {
    background: #f1f5f9;
    font-weight: 600;
    color: #334155;
}
body.dark-mode .exam-table th {
    background: #1b2436;
    color: #e8eef8;
}
.exam-table .exam-user {
    text-align: left;
    padding-left: 10px;
    position: sticky;
    left: 0;
    background: #fff;
    min-width: 180px;
    z-index: 1;
}
body.dark-mode .exam-table .exam-user {
    background: #151c2c;
}
.exam-table tr:nth-child(even) .exam-user {
    background: #f8fafc;
}
body.dark-mode .exam-table tr:nth-child(even) .exam-user {
    background: #121826;
}
.exam-nick {
    font-weight: 600;
}
.exam-fio {
    display: block;
    font-size: 11px;
    color: #64748b;
    font-weight: 400;
}
body.dark-mode .exam-fio {
    color: #94a3b8;
}
.exam-cell {
    font-weight: 700;
    min-width: 72px;
}
.exam-cell.is-full {
    background: #4CAF50;
    color: #1b2a1b;
}
.exam-cell.is-partial {
    background: #ff9800;
    color: #2a2118;
}
.exam-cell.is-none {
    background: #f3c4c4;
    color: #5c2a2a;
}
body.dark-mode .exam-cell.is-full {
    background: #4CAF50;
    color: #122012;
}
body.dark-mode .exam-cell.is-partial {
    background: #ffc107;
    color: #2a2118;
}
body.dark-mode .exam-cell.is-none {
    background: #6a3f45;
    color: #f0d4d4;
}
.exam-cell.is-clickable {
    cursor: pointer;
}
.exam-cell.is-clickable:hover {
    filter: brightness(0.96);
}
.exam-total {
    font-weight: 700;
    background: #eef2ff;
}
body.dark-mode .exam-total {
    background: #243056;
    color: #e8eef8;
}
.exam-modal {
    position: fixed;
    inset: 0;
    z-index: 1400;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.45);
    padding: 20px;
}
.exam-modal.is-open {
    display: flex;
}
.exam-dialog {
    width: min(720px, 100%);
    max-height: min(88vh, 860px);
    overflow: auto;
    background: #fff;
    border: 1px solid #dbe3ee;
    padding: 18px 18px 16px;
}
body.dark-mode .exam-dialog {
    background: #151c2c;
    border-color: #2a3348;
    color: #e8eef8;
}
.exam-dialog h3 {
    margin: 0 0 10px;
    font-size: 18px;
}
.exam-statement {
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 12px;
}
.exam-row {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 8px;
}
.exam-dialog select,
.exam-dialog textarea,
.exam-dialog input {
    width: 100%;
    font: inherit;
    padding: 8px;
    border: 1px solid #cbd5e1;
    background: #fff;
    color: inherit;
}
body.dark-mode .exam-dialog select,
body.dark-mode .exam-dialog textarea,
body.dark-mode .exam-dialog input {
    background: #0f172a;
    border-color: #334155;
}
.exam-dialog textarea {
    min-height: 220px;
    font-family: Consolas, "Courier New", monospace;
    font-size: 13px;
    resize: vertical;
}
.exam-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 10px;
}
.exam-btn {
    border: 1px solid #cbd5e1;
    background: #f8fafc;
    color: inherit;
    padding: 8px 12px;
    cursor: pointer;
    font: inherit;
    transition: background 0.15s ease, border-color 0.15s ease, filter 0.15s ease;
}
.exam-btn:hover {
    filter: brightness(0.97);
}
body.dark-mode .exam-btn {
    background: #1e293b;
    border-color: #334155;
}
body.dark-mode .exam-btn:hover {
    background: #243044;
    border-color: #475569;
    filter: none;
}
.exam-btn.is-primary {
    background: #1a73e8;
    border-color: #1a73e8;
    color: #fff;
}
.exam-btn.is-primary:hover {
    filter: brightness(1.06);
}
.exam-btn:disabled {
    opacity: 0.55;
    cursor: default;
    filter: none;
}
.exam-status {
    min-height: 1.3em;
    font-size: 13px;
    margin-top: 8px;
    color: #475569;
}
body.dark-mode .exam-status {
    color: #cbd5e1;
}
.exam-empty {
    padding: 40px 16px;
    text-align: center;
    color: #94a3b8;
}
.exam-window-note {
    margin: 0 0 16px;
    padding: 10px 14px;
    border: 1px solid rgba(239, 154, 154, 0.45);
    background: rgba(229, 57, 53, 0.12);
    border-radius: 8px;
    color: #c62828;
    font-size: 14px;
}
body.dark-mode .exam-window-note {
    color: #ef9a9a;
}
.exam-sheets {
    display: flex;
    flex-direction: column;
    gap: 22px;
    max-width: 920px;
}
.exam-problem {
    background: #fff;
    border: 1px solid #dbe3ee;
    border-left: 5px solid #f3c4c4;
    padding: 20px 22px 18px;
}
body.dark-mode .exam-problem {
    background: #151c2c;
    border-color: #2a3348;
    border-left-color: #6a3f45;
}
.exam-problem.is-debug {
    border-left-color: #dbeafe;
}
body.dark-mode .exam-problem.is-debug {
    border-left-color: #1e3a5f;
}
.exam-problem:has(.exam-score.is-full) { border-left-color: #4CAF50; }
.exam-problem:has(.exam-score.is-partial) { border-left-color: #ff9800; }
body.dark-mode .exam-problem:has(.exam-score.is-partial) { border-left-color: #ffc107; }
.exam-problem-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 14px;
}
.exam-problem-title {
    margin: 2px 0 0;
    font-size: 22px;
    font-weight: 700;
    color: #0f172a;
}
body.dark-mode .exam-problem-title {
    color: #e8eef8;
}
.exam-debug-note,
.exam-debug-timer {
    margin: 0 0 14px;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.45;
}
.exam-debug-note {
    background: #fff7ed;
    border: 1px solid #fed7aa;
    color: #9a3412;
}
body.dark-mode .exam-debug-note {
    background: rgba(234, 88, 12, 0.16);
    border-color: rgba(251, 146, 60, 0.45);
    color: #fdba74;
}
.exam-debug-timer {
    background: rgba(229, 57, 53, 0.12);
    border: 1px solid rgba(239, 154, 154, 0.45);
    color: #c62828;
    font-weight: 600;
}
body.dark-mode .exam-debug-timer {
    color: #ef9a9a;
}
.exam-task-index {
    font-size: 12px;
    color: #64748b;
    letter-spacing: 0.02em;
}
body.dark-mode .exam-task-index {
    color: #94a3b8;
}
.exam-score {
    flex-shrink: 0;
    font-weight: 700;
    font-size: 14px;
    padding: 6px 10px;
    min-width: 64px;
    text-align: center;
}
.exam-score.is-preview { background: #6a3f45; color: #f0d4d4; }
body.site-app:not(.dark-mode) .exam-score.is-preview { background: #f3c4c4; color: #5c2a2a; }
.exam-score.is-full { background: #4CAF50; color: #122012; }
.exam-score.is-partial { background: #ff9800; color: #2a2118; }
.exam-score.is-none { background: #f3c4c4; color: #5c2a2a; }
body.dark-mode .exam-score.is-partial { background: #ffc107; }
body.dark-mode .exam-score.is-none { background: #6a3f45; color: #f0d4d4; }
.exam-body {
    font-size: 14px;
    line-height: 1.6;
    color: #333;
}
body.dark-mode .exam-body {
    color: #e0e0e0;
}
.exam-body .task-statement {
    max-width: none;
    margin: 0;
}
.exam-body .limits {
    background: #f8f8f8;
    border: 1px solid #e0e0e0;
    padding: 10px 15px;
    margin: 0 0 16px;
    display: inline-block;
}
body.dark-mode .exam-body .limits {
    background: #1b2436;
    border-color: #2f3b54;
}
.exam-body .limit-item {
    margin-right: 22px;
    font-weight: 500;
    color: #555;
}
body.dark-mode .exam-body .limit-item {
    color: #aaa;
}
.exam-body .limit-value {
    font-weight: 400;
    color: #333;
}
body.dark-mode .exam-body .limit-value {
    color: #ccc;
}
.exam-body .section-title {
    font-size: 18px;
    font-weight: 600;
    margin: 18px 0 10px;
    color: #222;
    border-left: 3px solid #3b5998;
    padding-left: 12px;
}
body.dark-mode .exam-body .section-title {
    color: #fff;
}
.exam-body .legend,
.exam-body .input-specification,
.exam-body .output-specification,
.exam-body .note {
    margin: 14px 0;
}
.exam-body .legend p,
.exam-body .input-specification p,
.exam-body .output-specification p,
.exam-body .note p {
    margin: 0 0 8px;
}
.exam-body .sample-tests {
    margin: 18px 0 8px;
}
.exam-body .sample-test {
    margin: 12px 0;
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}
.exam-body .sample-test .input,
.exam-body .sample-test .output {
    flex: 1;
    min-width: 220px;
}
.exam-body .sample-test .title {
    font-size: 13px;
    font-weight: 600;
    margin: 0 0 6px;
    color: #555;
    border: none;
    padding: 0;
}
body.dark-mode .exam-body .sample-test .title {
    color: #aaa;
}
.exam-body .sample-test pre,
.exam-body pre {
    margin: 0;
    padding: 12px;
    overflow-x: auto;
    white-space: pre-wrap;
    background: #f8f8f8;
    border: 1px solid #e0e0e0;
    font-family: Consolas, "Courier New", monospace;
    font-size: 13px;
    line-height: 1.45;
}
body.dark-mode .exam-body .sample-test pre,
body.dark-mode .exam-body pre {
    background: #0f172a;
    border-color: #334155;
    color: #e0e0e0;
}
.exam-body code {
    font-family: Consolas, "Courier New", monospace;
    font-size: 0.95em;
}
.exam-code-label {
    display: block;
    margin: 16px 0 8px;
    font-size: 13px;
    font-weight: 600;
    color: #64748b;
}
body.dark-mode .exam-code-label {
    color: #94a3b8;
}
.exam-problem .exam-code {
    width: 100%;
    min-height: 220px;
    box-sizing: border-box;
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
    background: #fff;
    color: inherit;
    font-family: Consolas, "Courier New", monospace;
    font-size: 13px;
    line-height: 1.45;
    resize: none;
}
body.dark-mode .exam-problem .exam-code {
    background: #0f172a;
    border-color: #334155;
    color: #e8eef8;
}
.debug-stage .exam-code {
    height: min(70vh, 640px);
    min-height: min(70vh, 640px);
    max-height: min(70vh, 640px);
    font-size: 14px;
    line-height: 1.5;
}
.debug-stage,
.debug-menu {
    max-width: none;
    width: 100%;
    box-sizing: border-box;
}
#debuggingContainer .exam-wrap {
    padding: 16px 0 24px;
}
.debug-menu-head {
    margin: 0 0 16px;
}
.debug-menu-title {
    margin: 0 0 6px;
    font-size: 22px;
}
.debug-menu-note {
    margin: 0;
    font-size: 14px;
    line-height: 1.45;
    color: #64748b;
}
body.dark-mode .debug-menu-note {
    color: #94a3b8;
}
.debug-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.debug-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    width: 100%;
    box-sizing: border-box;
    padding: 14px 16px;
    border: 1px solid #dbe3ee;
    background: #fff;
    color: inherit;
    font: inherit;
    text-align: left;
    border-radius: 8px;
    cursor: pointer;
}
body.dark-mode .debug-list-item {
    background: #151c2c;
    border-color: #2a3348;
    color: #e8eef8;
}
.debug-list-item:hover:not(.is-locked) {
    border-color: #1a73e8;
}
.debug-list-item.is-locked {
    opacity: 0.5;
    cursor: default;
}
.debug-list-item.is-solved {
    border-left: 4px solid #4CAF50;
}
.debug-list-item.is-run {
    border-left: 4px solid #dbeafe;
}
body.dark-mode .debug-list-item.is-run {
    border-left-color: #1e3a5f;
}
.debug-list-item.is-over {
    border-left: 4px solid #fb8c00;
}
.debug-list-name {
    font-weight: 600;
}
.debug-list-meta {
    flex-shrink: 0;
    font-size: 13px;
    font-variant-numeric: tabular-nums;
    color: #64748b;
}
body.dark-mode .debug-list-meta {
    color: #94a3b8;
}
.debug-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px 16px;
    margin-bottom: 16px;
}
.debug-toolbar-main {
    min-width: 0;
}
.debug-toolbar-main .exam-problem-title {
    margin: 0;
}
.debug-back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-left: auto;
    padding: 10px 12px;
    border: 1px solid #bfdbfe;
    border-radius: 3px;
    background: #dbeafe;
    color: #1e40af;
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: none;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, filter 0.2s ease;
}
.debug-back-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.debug-back:hover {
    filter: brightness(0.97);
}
body.dark-mode .debug-back {
    background: #1e3a5f;
    border-color: #3b82f6;
    color: #bfdbfe;
}
body.dark-mode .debug-back:hover {
    filter: brightness(1.12);
}
.debug-nav-btn {
    width: 44px;
    height: 44px;
    border: 1px solid #cbd5e1;
    background: #f8fafc;
    color: inherit;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    border-radius: 8px;
}
.debug-nav-btn:disabled {
    opacity: 0.35;
    cursor: default;
}
body.dark-mode .debug-nav-btn {
    background: #1e293b;
    border-color: #334155;
    color: #e8eef8;
}
.debug-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: 0 0 16px;
}
.debug-dot {
    width: 10px;
    height: 10px;
    padding: 0;
    border-radius: 50%;
    border: 0;
    background: #cbd5e1;
    cursor: pointer;
}
body.dark-mode .debug-dot {
    background: #475569;
}
.debug-dot.is-current {
    outline: 2px solid #1a73e8;
    outline-offset: 2px;
    background: #1a73e8;
}
.debug-dot.is-full {
    background: #4CAF50;
}
.debug-dot.is-partial {
    background: #ff9800;
}
.debug-clocks {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin: 0 0 16px;
}
.debug-clock-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.debug-clock .debug-skip {
    flex: 0 0 auto;
    margin: 0 0 0 auto;
    padding: 8px 12px;
    border: 1px solid #000;
    border-radius: 3px;
    background: transparent;
    color: #000;
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: none;
    filter: none;
    transition: background 0.2s ease, color 0.2s ease, filter 0.2s ease;
}
.debug-clock .debug-skip:hover {
    background: rgba(198, 40, 40, 0.08);
    filter: none;
    text-decoration: none;
}
body.dark-mode .debug-clock .debug-skip {
    border-color: #000;
    background: transparent;
    color: #ef5350;
}
body.dark-mode .debug-clock .debug-skip:hover {
    background: rgba(239, 83, 80, 0.12);
    filter: none;
}
.debug-clock {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 12px 14px;
    border-radius: 8px;
    border: 1px solid #dbe3ee;
    background: #f8fafc;
}
body.dark-mode .debug-clock {
    border-color: #2a3348;
    background: #121826;
}
.debug-clock-label {
    font-size: 12px;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
body.dark-mode .debug-clock-label {
    color: #94a3b8;
}
.debug-clock-time {
    font-size: 28px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    line-height: 1.15;
}
.debug-clock-hint {
    font-size: 12px;
    color: #94a3b8;
}
.debug-clock.is-on {
    border-color: rgba(239, 154, 154, 0.55);
    background: rgba(229, 57, 53, 0.12);
    color: #c62828;
}
body.dark-mode .debug-clock.is-on {
    color: #ef9a9a;
}
.debug-clock.is-done .debug-clock-time {
    color: #4CAF50;
}
.debug-clock.is-over {
    border-color: rgba(239, 154, 154, 0.45);
    color: #c62828;
}
.debug-page {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.debug-page.has-stats {
    min-height: calc(100vh - 150px);
}
.debug-stats {
    display: flex;
    flex-direction: column;
    min-height: 0;
    padding: 8px 0 12px;
    background: transparent;
    border: 0;
    box-sizing: border-box;
}
.debug-stats.is-fill {
    flex: 1 1 auto;
    min-height: 240px;
}
.debug-stats.is-compact {
    flex: 0 0 auto;
    height: 168px;
}
.debug-stats-board {
    flex: 1 1 auto;
    min-height: 96px;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}
.debug-stats-canvas {
    display: block;
    max-width: 100%;
    color-scheme: light;
}
#debuggingContainer .exam-wrap,
#debuggingMount {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
}
#debuggingContainer.news-container {
    min-height: calc(100vh - 88px);
}
.debug-start-wrap {
    display: flex;
    justify-content: center;
    padding: 18px 0 8px;
}
.debug-start-wrap .exam-btn,
.debug-start-wrap .debug-back {
    min-width: 160px;
    margin-left: 0;
}
body.site-app.trainings-rating-tall #debugRatingWidget .rating-container {
    max-height: none !important;
    height: auto !important;
    overflow: visible !important;
}
body.dark-mode.site-app #debugRatingWidget {
    background: #121826 !important;
    border: 1px solid #243044 !important;
    box-shadow: none !important;
}
body.dark-mode.site-app #debugRatingWidget .rating-container {
    background: #121826 !important;
}
body.dark-mode.site-app #debugRatingWidget .rating-item {
    border-bottom-color: #243044 !important;
}
body.dark-mode.site-app #debugRatingWidget .rating-name {
    color: #e8eef8;
}
#debugRatingWidget .rating-item {
    cursor: pointer;
}
body.site-app:not(.dark-mode) #debugRatingWidget .rating-graph-btn {
    background: #dbeafe !important;
    border-color: #bfdbfe !important;
    color: #1e40af !important;
}
body.site-app:not(.dark-mode) #debugRatingWidget .rating-graph-btn:hover {
    background: #bfdbfe !important;
    color: #1e3a8a !important;
}
body.dark-mode.site-app #debugRatingWidget .rating-graph-btn {
    background: #151c2c !important;
    border-color: #243044 !important;
    color: #93c5fd !important;
}
body.dark-mode.site-app #debugRatingWidget .rating-graph-btn:hover {
    background: #1c2538 !important;
    color: #e8eef8 !important;
}
#ratingListWrap {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 16px;
    align-items: start;
    margin-top: 16px;
}
@media (max-width: 960px) {
    #ratingListWrap {
        grid-template-columns: 1fr;
    }
}
.rating-board {
    margin: 0;
    min-width: 0;
    background: #fff;
    border: 1px solid #e8edf5;
    overflow: hidden;
}
body.dark-mode .rating-board {
    background: #151c2c;
    border-color: #243044;
}
.rating-board-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    padding: 14px 18px;
    background: #ea580c;
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.2;
}
.rating-board-title i {
    width: 1.15em;
    text-align: center;
}
body.dark-mode .rating-board-title {
    background: #c2410c;
    color: #fff;
}
.rating-board .rating-pager {
    padding: 10px 16px 14px;
    border-top: 1px solid #e8edf5;
}
body.dark-mode .rating-board .rating-pager {
    border-top-color: #243044;
}
#ratingFullList .rating-item:last-child,
#debugRatingFullList .rating-item:last-child {
    border-bottom: 0;
}
#debugRatingFullList .rating-item {
    cursor: pointer;
    padding: 15px 20px;
}
#debugRatingFullList .rating-rank,
#debugRatingFullList .rating-score {
    font-size: 16px;
}
#debugRatingFullList .rating-name {
    font-size: 16px;
}
#debugRatingFullList .rating-details {
    font-size: 13px;
}
#debugRatingFullList .rating-graph-btn {
    font-size: 12px;
}
.rating-debug-rank {
    margin-left: 8px;
    font-size: 14px;
    font-weight: 700;
}
.rating-debug-rank i {
    margin-right: 4px;
}
