body.site-app {
    margin: 0;
    padding: 0 !important;
    min-height: 100vh;
}

body.site-app:not(.dark-mode) {
    background: #f3f5fa;
    color: #0f172a;
}

body.site-app.dark-mode {
    background: #0b1220;
    color: #e8eef8;
}

.nav-open-btn,
.nav-hide-btn {
    width: 36px;
    height: 36px;
    border: 1px solid #334155;
    border-radius: 0;
    background: #151c2c;
    color: #e8eef8;
    cursor: pointer;
}

.nav-open-btn {
    display: inline-flex;
    position: fixed;
    top: 14px;
    left: 14px;
    z-index: 1200;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translate3d(-8px, 0, 0);
    transition: opacity 0.55s cubic-bezier(0.16, 1, 0.3, 1),
        visibility 0.55s,
        transform 0.55s cubic-bezier(0.16, 1, 0.3, 1),
        background 0.2s ease,
        border-color 0.2s ease,
        color 0.2s ease;
}

body.nav-collapsed .nav-open-btn {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: none;
}

.nav-hide-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.nav-hide-btn:hover,
.nav-open-btn:hover {
    background: #1e3a8a;
}

.nav-backdrop {
    display: none;
}

.site-nav {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 268px;
    display: flex;
    flex-direction: column;
    background: #121826;
    border-right: 1px solid #243044;
    z-index: 1100;
    will-change: transform;
    transition: transform 0.55s cubic-bezier(0.16, 1, 0.3, 1);
}

body.auth-overlay-open .site-nav {
    z-index: 40;
    pointer-events: none;
}

.site-nav-brand {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 12px 16px 20px;
    font-size: 20px;
    font-weight: 750;
    letter-spacing: -0.03em;
    color: #f8fafc;
}

.site-nav-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 4px 10px 16px;
}

.nav-item,
.nav-sub-link {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 12px;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: #cbd5e1;
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
}

.nav-item:hover,
.nav-sub-link:hover,
.nav-sub-link.is-current {
    background: #1c2538;
    color: #fff;
}

.nav-item.active {
    background: #1e3a8a;
    color: #fff;
}

.nav-toggle {
    justify-content: space-between;
}

.nav-toggle span {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.nav-caret {
    font-size: 11px;
    opacity: 0.7;
    transition: transform 0.15s ease;
}

.nav-wip {
    display: inline-block;
    flex-shrink: 0;
    margin-left: 2px;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 750;
    letter-spacing: 0.02em;
    line-height: 1.35;
    white-space: nowrap;
    color: #c4b5fd;
    background: rgba(167, 139, 250, 0.18);
}

body.site-app:not(.dark-mode) .nav-wip {
    color: #6d28d9;
    background: #f3e8ff;
}

.nav-group.open > .nav-toggle .nav-caret,
.nav-group.open > .nav-course-row .nav-caret {
    transform: rotate(180deg);
}

.nav-sub {
    display: none;
    padding: 2px 0 8px 8px;
}

.nav-group.open > .nav-sub {
    display: block;
}

.nav-course-row {
    display: flex;
    align-items: center;
    gap: 4px;
}

.nav-course-link {
    flex: 1;
    min-width: 0;
}

.nav-mini-toggle {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: #94a3b8;
    cursor: pointer;
}

.nav-mini-toggle:hover {
    background: #1c2538;
    color: #fff;
}

.nav-topics .nav-sub-link {
    font-size: 13px;
    font-weight: 500;
    color: #94a3b8;
    padding: 7px 12px;
}

.site-nav-foot {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px 12px 16px;
    border-top: 1px solid #243044;
}

.site-nav-foot-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding-bottom: 4px;
}

.site-nav-foot-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    color: #93c5fd;
    font-size: 20px;
    text-decoration: none;
}

.site-nav-foot-links a:hover {
    color: #fff;
}

body.site-app:not(.dark-mode) .site-nav-foot-links a {
    color: #64748b;
}

body.site-app:not(.dark-mode) .site-nav-foot-links a:hover {
    color: #0f172a;
}

body.site-app:not(.dark-mode) .site-nav {
    background: #ffffff;
    border-right-color: #e8edf5;
}

body.site-app:not(.dark-mode) .site-nav-brand {
    color: #0f172a;
}

body.site-app:not(.dark-mode) .nav-item,
body.site-app:not(.dark-mode) .nav-sub-link {
    color: #334155;
}

body.site-app:not(.dark-mode) .nav-item:hover,
body.site-app:not(.dark-mode) .nav-sub-link:hover,
body.site-app:not(.dark-mode) .nav-mini-toggle:hover {
    background: #eff4ff;
    color: #0f172a;
}

body.site-app:not(.dark-mode) .nav-item.active,
body.site-app:not(.dark-mode) .tab.active,
body.site-app:not(.dark-mode) .nav-sub-link.is-current {
    background: #dbeafe !important;
    color: #1e40af !important;
}

body.site-app:not(.dark-mode) .auth-btn {
    background: #dbeafe !important;
    color: #1e40af !important;
    border: 1px solid #bfdbfe !important;
}

body.site-app:not(.dark-mode) .nav-topics .nav-sub-link {
    color: #64748b;
}

body.site-app:not(.dark-mode) .nav-mini-toggle {
    color: #64748b;
}

body.site-app:not(.dark-mode) .site-nav-foot {
    border-top-color: #e8edf5;
}

body.site-app:not(.dark-mode) .nav-open-btn,
body.site-app:not(.dark-mode) .nav-hide-btn {
    background: #ffffff;
    border-color: #e8edf5;
    color: #0f172a;
}

body.site-app:not(.dark-mode) .nav-hide-btn:hover,
body.site-app:not(.dark-mode) .nav-open-btn:hover {
    background: #eff4ff;
    color: #1e3a8a;
}

body.site-app .theme-toggle,
body.site-app .auth-btn {
    position: static !important;
    top: auto !important;
    right: auto !important;
    width: 100%;
    transform: none !important;
    box-shadow: none !important;
    cursor: pointer;
    padding: 10px 12px;
    font-size: 14px;
    font-weight: 600;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

body.site-app .theme-toggle:hover {
    background: #f1f5f9 !important;
}

body.site-app .auth-btn:hover {
    filter: brightness(0.97);
}

body.dark-mode.site-app .theme-toggle:hover {
    background: #334155 !important;
    border-color: #64748b !important;
}

.site-stage {
    margin-left: 268px;
    padding-left: 0;
    min-height: 100vh;
    background: #f3f5fa;
    color: #0f172a;
    transition: margin-left 0.55s cubic-bezier(0.16, 1, 0.3, 1),
        padding-left 0.55s cubic-bezier(0.16, 1, 0.3, 1);
}

body.nav-animating .landing-codebg-track {
    animation-play-state: paused;
}

body.nav-collapsed .site-nav {
    transform: translate3d(-100%, 0, 0);
}

body.nav-collapsed .site-stage {
    margin-left: 0;
    padding-left: 56px;
}

body.dark-mode.site-app .site-stage {
    background: #0b1220;
    color: #e8eef8;
}

body.dark-mode.site-app #listSearchBox.rating-search {
    background: #121826 !important;
    border-color: #243044 !important;
    box-shadow: none !important;
}

body.dark-mode.site-app #listSearchBox.rating-search .search-input {
    background: #151c2c !important;
    color: #e8eef8 !important;
    border-color: #243044 !important;
}

body.dark-mode.site-app #listSearchBox.rating-search .search-input:focus {
    background: #1c2538 !important;
    border-color: #60a5fa !important;
}

body.dark-mode.site-app #listSearchBox.rating-search .tag-filter-toggle {
    background: #151c2c !important;
    border-color: #243044 !important;
    color: #e8eef8 !important;
}

body.dark-mode.site-app #listSearchBox.rating-search .tag-filter-toggle.active {
    background: #1c2538 !important;
    border-color: #334155 !important;
}

body.dark-mode.site-app #listSearchBox.rating-search .tag-dropdown {
    background: #151c2c !important;
    border-color: #243044 !important;
}

body.dark-mode.site-app #mathContainer,
body.dark-mode.site-app #tasksContainer {
    background: #121826 !important;
}

body.dark-mode.site-app #mathContainer .tasks-month-tabs,
body.dark-mode.site-app #tasksContainer .tasks-year-tabs,
body.dark-mode.site-app #tasksContainer .tasks-month-tabs,
body.dark-mode.site-app #tasksContainer .tasks-filter-bar {
    background: #121826 !important;
    border-bottom-color: #243044 !important;
}

body.dark-mode.site-app #mathContainer .month-tab,
body.dark-mode.site-app #tasksContainer .year-tab,
body.dark-mode.site-app #tasksContainer .month-tab,
body.dark-mode.site-app #tasksContainer .rating-select,
body.dark-mode.site-app #tasksContainer .tags-filter-btn,
body.dark-mode.site-app #tasksContainer .reset-filters-btn {
    background: #151c2c !important;
    border-color: #243044 !important;
    color: #e8eef8 !important;
}

body.dark-mode.site-app #tasksContainer .year-tab i,
body.dark-mode.site-app #tasksContainer .filter-label {
    color: #94a3b8 !important;
}

body.dark-mode.site-app #mathContainer .month-tab.active,
body.dark-mode.site-app #tasksContainer .year-tab.active,
body.dark-mode.site-app #tasksContainer .month-tab.active {
    background: #2563eb !important;
    border-color: #2563eb !important;
    color: #fff !important;
}

body.dark-mode.site-app #tasksContainer .year-tab.active i {
    color: #fff !important;
}

body.dark-mode.site-app #mathContainer .month-tab:hover:not(.active),
body.dark-mode.site-app #tasksContainer .year-tab:hover:not(.active),
body.dark-mode.site-app #tasksContainer .month-tab:hover:not(.active),
body.dark-mode.site-app #tasksContainer .tags-filter-btn:hover,
body.dark-mode.site-app #tasksContainer .rating-select:focus {
    background: #1c2538 !important;
    border-color: #334155 !important;
}

body.dark-mode.site-app #tasksContainer .reset-filters-btn:hover {
    background: #3f1d1d !important;
    border-color: #f87171 !important;
    color: #fca5a5 !important;
}

body.dark-mode.site-app #tasksContainer #tasksGrid {
    background: #121826;
}

body.dark-mode.site-app #tasksContainer .task-card-vertical {
    border-color: #243044 !important;
}

body.dark-mode.site-app #tasksContainer .task-card-vertical.task-navy-0 {
    background: #121826 !important;
}

body.dark-mode.site-app #tasksContainer .task-card-vertical.task-navy-1 {
    background: #162033 !important;
}

body.dark-mode.site-app #tasksContainer .task-card-vertical.task-navy-2 {
    background: #1a2838 !important;
}

body.dark-mode.site-app #tasksContainer .task-card-vertical.task-navy-3 {
    background: #20344c !important;
}

body.site-app:not(.dark-mode) #tasksContainer #tasksGrid {
    background: transparent;
}

body.site-app:not(.dark-mode) #tasksContainer .task-card-vertical {
    border-color: #e8edf5 !important;
}

body.site-app:not(.dark-mode) #tasksContainer .task-card-vertical.task-navy-0 {
    background: #ffffff !important;
}

body.site-app:not(.dark-mode) #tasksContainer .task-card-vertical.task-navy-1 {
    background: #f7fafc !important;
}

body.site-app:not(.dark-mode) #tasksContainer .task-card-vertical.task-navy-2 {
    background: #eef4fb !important;
}

body.site-app:not(.dark-mode) #tasksContainer .task-card-vertical.task-navy-3 {
    background: #e4eef8 !important;
}

.news-calendar-widget {
    overflow: hidden;
    border: 1px solid #dbe3ef;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

body.site-app #newsCalendarWidget {
    margin-top: 48px;
}

.news-calendar-widget-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: #2563eb;
    color: #fff;
    font-size: 17.6px;
    font-weight: 700;
}

body.site-app:not(.dark-mode) .news-calendar-widget-header {
    background: #dbeafe;
    color: #1e40af;
}

#newsCalendarCard {
    position: static !important;
    z-index: auto !important;
    padding: 16px !important;
    background: #fff !important;
    box-shadow: none !important;
    border-bottom: 0 !important;
}

#newsCalendarCard .contest-header {
    justify-content: space-between;
    margin-bottom: 8px;
}

.news-calendar-month-nav {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.news-calendar-month-nav button,
.news-calendar-month-nav span {
    height: 31px;
    border: 1px solid #cbd5e1;
    border-radius: 3px;
}

.news-calendar-month-nav button {
    width: 31px;
    padding: 0;
    background: #fff;
    color: #2563eb;
    cursor: pointer;
}

.news-calendar-month-nav button:hover {
    background: #eff6ff;
    border-color: #60a5fa;
}

.news-calendar-month-nav span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 124px;
    padding: 0 8px;
    background: #06b6d4;
    border-color: #06b6d4;
    color: #fff;
    font-size: 12.1px;
    font-weight: 700;
}

#newsCalendarCard .contest-type {
    font-size: 13.2px;
}

#newsCalendarCard .contest-info {
    margin-bottom: 10px;
    font-size: 15.4px;
}

#newsCalendarCard .calendar-grid-container {
    padding: 4px 0 8px;
}

.news-calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    margin-bottom: 6px;
    color: #64748b;
    font-size: 12.1px;
    font-weight: 700;
    text-align: center;
}

#newsCalendarCard .calendar-day-cell {
    min-width: 0;
    border-radius: 3px !important;
    background: #f1f5f9;
    border-color: #dbe3ef;
    color: #334155;
    font-size: 13.2px;
}

#newsCalendarCard .calendar-day-cell .day-number {
    font-size: 17.6px;
}

#newsCalendarCard .calendar-day-cell:hover {
    background: #dbeafe;
    border-color: #60a5fa;
}

#newsCalendarCard .calendar-day-cell.today {
    border-color: #2563eb !important;
    box-shadow: inset 0 0 0 1px #2563eb;
}

#newsCalendarCard .calendar-legend {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin: 10px 0 12px;
    color: #64748b;
    font-size: 12.1px;
}

#newsCalendarCard .calendar-legend > span {
    display: flex;
    align-items: center;
    white-space: nowrap;
}

.calendar-legend-swatch {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 3px;
    margin-right: 5px;
}

.calendar-legend-swatch--high {
    background: #f44336;
}

.calendar-legend-swatch--medium {
    background: #ff9800;
}

.calendar-legend-swatch--low {
    background: #4CAF50;
}

body.dark-mode .calendar-legend-swatch--medium {
    background: #ffc107;
}

#newsCalendarCard .contest-links {
    margin-top: 4px;
}

#newsCalendarCard .contest-link {
    font-size: 15.4px;
}

body.dark-mode .news-calendar-widget {
    background: #121826;
    border-color: #243044;
    box-shadow: none;
}

body.dark-mode .news-calendar-widget-header {
    background: #1e3a8a;
}

body.dark-mode .news-calendar-month-nav button {
    background: #151c2c;
    color: #93c5fd;
    border-color: #334155;
}

body.dark-mode .news-calendar-month-nav button:hover {
    background: #1c2940;
    border-color: #60a5fa;
}

body.dark-mode #newsCalendarCard {
    background: #121826 !important;
}

body.dark-mode #newsCalendarCard .contest-info,
body.dark-mode #newsCalendarCard .news-calendar-weekdays,
body.dark-mode #newsCalendarCard .calendar-legend {
    color: #94a3b8;
}

body.dark-mode #newsCalendarCard .calendar-day-cell {
    background: #151c2c !important;
    border-color: #334155 !important;
    color: #e8eef8;
}

body.dark-mode #newsCalendarCard .calendar-day-cell:hover {
    background: #1c2940 !important;
    border-color: #60a5fa !important;
}

body.dark-mode #newsCalendarCard .calendar-day-cell.has-events-high,
body.dark-mode #newsCalendarCard .calendar-day-cell.has-events-high:hover {
    background: #f44336 !important;
    border-color: #f44336 !important;
}

body.dark-mode #newsCalendarCard .calendar-day-cell.has-events-medium,
body.dark-mode #newsCalendarCard .calendar-day-cell.has-events-medium:hover {
    background: #ffc107 !important;
    border-color: #ffc107 !important;
}

body.dark-mode #newsCalendarCard .calendar-day-cell.has-events-low,
body.dark-mode #newsCalendarCard .calendar-day-cell.has-events-low:hover {
    background: #4CAF50 !important;
    border-color: #4CAF50 !important;
}

.day-events-heading {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 18px;
    font-size: 22px;
    color: #0f172a;
}

.day-events-heading i {
    color: #2563eb;
}

.day-events-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.day-event-card {
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
    border: 1px solid #dbe4f0;
    background: linear-gradient(180deg, #f8fbff 0%, #eef4fb 100%);
    box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04);
}

.day-event-main {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    padding: 16px 16px 14px 14px;
}

.day-event-card--low {
    border-left: 4px solid #22c55e;
}

.day-event-card--medium {
    border-left: 4px solid #f59e0b;
}

.day-event-card--high {
    border-left: 4px solid #ef4444;
}

.day-event-icon {
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #dbeafe;
    color: #1d4ed8;
    font-size: 16px;
}

.day-event-card--low .day-event-icon {
    background: #dcfce7;
    color: #15803d;
}

.day-event-card--medium .day-event-icon {
    background: #ffedd5;
    color: #c2410c;
}

.day-event-card--high .day-event-icon {
    background: #fee2e2;
    color: #b91c1c;
}

.day-event-body {
    min-width: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.day-event-title {
    margin: 0;
    padding: 0;
    font-size: 17px;
    font-weight: 700;
    line-height: 1.3;
    color: #0f172a;
}

.day-event-desc {
    display: block;
    margin: 6px 0 0;
    padding: 0;
    background: none;
    color: #166534;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
    opacity: 1;
}

.day-event-card--medium .day-event-desc {
    background: none;
    color: #9a3412;
}

.day-event-card--high .day-event-desc {
    background: none;
    color: #991b1b;
}

.day-events-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    margin-top: 22px;
}

.day-events-actions-mid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.day-events-back,
.day-events-close,
.day-events-more {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border: 1px solid #cbd5e1;
    background: #fff;
    color: #1e3a8a;
    font-size: 14px;
    cursor: pointer;
    text-decoration: none;
}

.day-events-back:hover {
    border-color: #93c5fd;
    background: #eff6ff;
}

.day-events-more {
    border-color: #2563eb;
    background: #2563eb;
    color: #fff !important;
    font-weight: 650;
}

.day-events-more:hover {
    background: #1d4ed8;
    color: #fff !important;
}

.day-events-close {
    border-color: transparent;
    background: #334155;
    color: #fff;
    transition: background 0.15s ease, box-shadow 0.15s ease, color 0.15s ease;
}

.day-events-close:hover {
    background: #94a3b8;
    color: #0f172a;
    box-shadow: 0 0 0 2px rgba(148, 163, 184, 0.45);
}

body.dark-mode .day-events-heading {
    color: #f1f5f9;
}

body.dark-mode .day-events-heading i {
    color: #93c5fd;
}

body.dark-mode .day-event-card {
    background: linear-gradient(180deg, #1a2436 0%, #151c2c 100%);
    border-color: #2a3d52;
}

body.dark-mode .day-event-title {
    color: #f8fafc;
}

body.dark-mode .day-event-desc {
    background: none;
    color: #86efac;
}

body.dark-mode .day-event-card--medium .day-event-desc {
    background: none;
    color: #fdba74;
}

body.dark-mode .day-event-card--high .day-event-desc {
    background: none;
    color: #fca5a5;
}

body.dark-mode .day-event-icon {
    background: #1e3a5f;
    color: #93c5fd;
}

body.dark-mode .day-event-card--low .day-event-icon {
    background: #14532d;
    color: #86efac;
}

body.dark-mode .day-event-card--medium .day-event-icon {
    background: #7c2d12;
    color: #fdba74;
}

body.dark-mode .day-event-card--high .day-event-icon {
    background: #7f1d1d;
    color: #fca5a5;
}

body.dark-mode .day-events-more {
    border-color: #3b82f6;
    background: #2563eb;
    color: #fff !important;
}

body.dark-mode .day-events-more:hover {
    background: #3b82f6;
}

body.dark-mode .day-events-back {
    background: #1a2436;
    border-color: #3b82f6;
    color: #bfdbfe;
}

body.dark-mode .day-events-back:hover {
    background: #243044;
}

body.dark-mode .day-events-close {
    background: #475569;
    color: #fff;
}

body.dark-mode .day-events-close:hover {
    background: #cbd5e1;
    color: #0f172a;
    box-shadow: 0 0 0 2px rgba(203, 213, 225, 0.35);
}

.full-calendar-view h2 {
    margin: 0;
    font-size: 28px;
}

.full-calendar-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin: 20px 0 16px;
}

.full-calendar-filters .contest-link {
    min-width: 42px;
    min-height: 42px;
    padding: 10px 14px;
    font-size: 16px;
    justify-content: center;
}

.full-calendar-filters .rating-select {
    min-width: 110px;
    min-height: 42px;
    padding: 10px 14px;
    border: 1px solid #ddd;
    font-size: 16px;
    background: white;
    color: #333;
}

.full-calendar-filters #calendarMonthSelect {
    min-width: 150px;
}

.full-calendar-grid {
    min-height: 0;
}

.full-calendar-loading {
    text-align: center;
    padding: 31px;
    color: #999;
}

.full-calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    margin-bottom: 8px;
    color: inherit;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
}

.full-calendar-days {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.full-calendar-week {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    background: transparent;
}

.full-calendar-view .calendar-day-cell {
    aspect-ratio: 2.8 / 1;
    min-height: 34px;
}

.full-calendar-view .calendar-day-cell .day-number {
    font-size: 14px;
}

.full-calendar-close-row {
    display: flex;
    justify-content: flex-end;
    margin-top: 23px;
}

.full-calendar-close {
    padding: 8px 19px !important;
    background: #6c757d !important;
    color: white !important;
    border: none !important;
    font-size: 11.5px !important;
    transition: background 0.15s ease, box-shadow 0.15s ease, color 0.15s ease !important;
}

.full-calendar-close:hover {
    background: #cbd5e1 !important;
    color: #0f172a !important;
    box-shadow: 0 0 0 2px rgba(203, 213, 225, 0.4);
}

#calendarModal .modal-content {
    width: 95%;
    max-width: 1200px;
    position: relative;
    overflow: hidden;
    isolation: isolate;
}

#calendarModalContent {
    position: relative;
    z-index: 1;
}

#calendarModal .modal-content::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

#calendarModal .modal-content.season-winter {
    background:
        radial-gradient(ellipse 90% 55% at 8% -10%, rgba(186, 230, 253, 0.22), transparent 52%),
        radial-gradient(ellipse 70% 45% at 100% 110%, rgba(125, 211, 252, 0.12), transparent 50%),
        linear-gradient(165deg, #0b1424 0%, #16324f 46%, #0d1b2e 100%);
}

#calendarModal .modal-content.season-winter::before {
    background-image:
        radial-gradient(1.5px 1.5px at 12% 18%, rgba(255, 255, 255, 0.55), transparent),
        radial-gradient(1px 1px at 28% 62%, rgba(255, 255, 255, 0.4), transparent),
        radial-gradient(2px 2px at 46% 24%, rgba(255, 255, 255, 0.5), transparent),
        radial-gradient(1px 1px at 63% 78%, rgba(255, 255, 255, 0.35), transparent),
        radial-gradient(1.5px 1.5px at 81% 16%, rgba(255, 255, 255, 0.45), transparent),
        radial-gradient(1px 1px at 91% 52%, rgba(255, 255, 255, 0.35), transparent),
        radial-gradient(2px 2px at 37% 88%, rgba(255, 255, 255, 0.4), transparent);
    opacity: 0.85;
}

#calendarModal .modal-content.season-spring {
    background:
        radial-gradient(ellipse 80% 50% at 0% 0%, rgba(167, 243, 208, 0.18), transparent 50%),
        radial-gradient(ellipse 60% 40% at 100% 100%, rgba(244, 114, 182, 0.1), transparent 48%),
        linear-gradient(165deg, #0d1f18 0%, #1a3d2e 48%, #12261c 100%);
}

#calendarModal .modal-content.season-spring::before {
    background:
        radial-gradient(circle at 18% 22%, rgba(244, 114, 182, 0.16) 0 8px, transparent 9px),
        radial-gradient(circle at 72% 18%, rgba(253, 186, 116, 0.14) 0 6px, transparent 7px),
        radial-gradient(circle at 86% 70%, rgba(167, 243, 208, 0.16) 0 10px, transparent 11px);
}

#calendarModal .modal-content.season-summer {
    background:
        radial-gradient(ellipse 70% 55% at 100% -8%, rgba(253, 224, 71, 0.22), transparent 48%),
        radial-gradient(ellipse 80% 50% at 0% 110%, rgba(56, 189, 248, 0.14), transparent 50%),
        linear-gradient(165deg, #102033 0%, #1b3d4a 42%, #12324a 100%);
}

#calendarModal .modal-content.season-summer::before {
    background:
        radial-gradient(circle at 92% 8%, rgba(253, 224, 71, 0.35) 0 28px, rgba(251, 191, 36, 0.12) 48px, transparent 72px);
}

#calendarModal .modal-content.season-autumn {
    background:
        radial-gradient(ellipse 80% 50% at 0% 0%, rgba(251, 146, 60, 0.2), transparent 50%),
        radial-gradient(ellipse 70% 45% at 100% 100%, rgba(185, 28, 28, 0.14), transparent 48%),
        linear-gradient(165deg, #1a1008 0%, #3b1d0c 46%, #1f120c 100%);
}

#calendarModal .modal-content.season-autumn::before {
    background:
        radial-gradient(circle at 22% 16%, rgba(251, 191, 36, 0.18) 0 7px, transparent 8px),
        radial-gradient(circle at 68% 28%, rgba(249, 115, 22, 0.16) 0 9px, transparent 10px),
        radial-gradient(circle at 84% 74%, rgba(220, 38, 38, 0.14) 0 8px, transparent 9px),
        radial-gradient(circle at 40% 82%, rgba(180, 83, 9, 0.16) 0 6px, transparent 7px);
}

body.dark-mode #calendarModal .modal-content.season-winter,
body.dark-mode #calendarModal .modal-content.season-spring,
body.dark-mode #calendarModal .modal-content.season-summer,
body.dark-mode #calendarModal .modal-content.season-autumn {
    background-color: transparent;
}

body:not(.dark-mode) #calendarModal .modal-content.season-winter {
    background:
        radial-gradient(ellipse 90% 55% at 8% -10%, rgba(186, 230, 253, 0.55), transparent 52%),
        linear-gradient(165deg, #e8f4ff 0%, #cfe4f7 50%, #dce9f5 100%);
}

body:not(.dark-mode) #calendarModal .modal-content.season-spring {
    background:
        radial-gradient(ellipse 80% 50% at 0% 0%, rgba(187, 247, 208, 0.55), transparent 50%),
        linear-gradient(165deg, #f4fff8 0%, #dcfce7 50%, #fdf2f8 100%);
}

body:not(.dark-mode) #calendarModal .modal-content.season-summer {
    background:
        radial-gradient(ellipse 70% 55% at 100% -8%, rgba(253, 224, 71, 0.45), transparent 48%),
        linear-gradient(165deg, #eff6ff 0%, #dbeafe 45%, #fef9c3 100%);
}

body:not(.dark-mode) #calendarModal .modal-content.season-autumn {
    background:
        radial-gradient(ellipse 80% 50% at 0% 0%, rgba(253, 186, 116, 0.45), transparent 50%),
        linear-gradient(165deg, #fff7ed 0%, #ffedd5 48%, #fee2e2 100%);
}

#calendarModal:has(.day-events-view) .modal-content {
    background: #1e1e1e !important;
}

#calendarModal:has(.day-events-view) .modal-content::before {
    display: none;
}

body:not(.dark-mode) #calendarModal:has(.day-events-view) .modal-content {
    background: #fff !important;
}

body.dark-mode .full-calendar-filters .rating-select {
    background: #2a2a2a;
    color: #e0e0e0;
    border-color: #444;
}

.calendar-empty-day {
    padding: 36px 20px;
    text-align: center;
    color: #64748b;
    border: 1px dashed #cbd5e1;
    background: #f8fafc;
}

.calendar-empty-day i {
    margin-bottom: 10px;
    font-size: 32px;
}

.calendar-empty-day p {
    margin: 0;
}

body.dark-mode .calendar-empty-day {
    color: #94a3b8;
    border-color: #334155;
    background: #151c2c;
}

body.site-app .container {
    max-width: 1800px !important;
    margin-left: auto;
    margin-right: auto;
    padding: 20px 28px 40px !important;
    flex-wrap: nowrap;
    align-items: flex-start;
}

body.site-app .search-box {
    max-width: 1800px;
    margin-left: auto;
    margin-right: auto;
    box-sizing: border-box;
}

body.site-app .sidebar-container {
    width: 400px;
    flex: 0 0 400px;
    min-width: 280px;
}

body.site-app .news-container.landing-scroll,
body.site-app #homeContainer.news-container,
body.site-app #newsContainer.news-container,
body.site-app #tasksContainer.news-container,
body.site-app #trainingsContainer.news-container,
body.site-app #teamContainer.news-container,
body.site-app #contestsContainer.news-container,
body.site-app #ratingContainer.news-container {
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
}

body.site-app #courseEmbedContainer.news-container {
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
    padding: 0;
    min-height: 0;
}

body.site-app .course-landing-dock {
    position: sticky;
    top: 0;
    z-index: 50;
    margin: 0 -24px 0;
}

body.site-app .course-landing-dock[hidden] {
    display: none !important;
}

body.dark-mode.site-app .course-landing-dock {
    background: #151c2c;
    border-bottom-color: #243044;
}

.course-embed-frame {
    display: none;
    width: 100%;
    min-height: 0;
    height: 0;
    overflow: hidden;
    border: 0;
    background: #fff;
}

.course-embed-frame.is-active {
    display: block;
    min-height: calc(100dvh - 72px);
}

body.dark-mode.site-app .course-embed-frame {
    background: #121826;
}

.rating-pager {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 4px 10px;
    padding: 18px 16px 28px;
    font-size: 15px;
    border-top: 1px solid #eee;
}

.rating-pager[hidden] {
    display: none !important;
}

.rating-pager a,
.rating-pager button,
.rating-pager span {
    background: none;
    border: 0;
    padding: 2px 4px;
    font: inherit;
    color: #1a73e8;
    cursor: pointer;
    text-decoration: none;
}

.rating-pager .is-current {
    font-weight: 700;
    color: inherit;
    cursor: default;
}

.rating-pager .is-gap,
.rating-pager .is-disabled {
    color: #999;
    cursor: default;
}

body.dark-mode .rating-pager {
    border-top-color: #333;
}

body.dark-mode .rating-pager a,
body.dark-mode .rating-pager button {
    color: #66b0ff;
}

body.dark-mode .rating-pager .is-current {
    color: #e8eef8;
}

body.site-app .main-content {
    min-height: calc(100vh - 80px);
    overflow: visible !important;
}

.landing {
    position: relative;
    max-width: none;
    margin: 0 auto;
    padding: 40px 40px 56px;
    overflow: hidden;
}

.landing > *:not(.landing-codebg) {
    position: relative;
    z-index: 1;
}

.landing h1 {
    margin: 0 0 12px;
    font-size: 36px;
    line-height: 1.15;
    letter-spacing: -0.04em;
}

.landing h2 {
    margin: 0 0 10px;
    font-size: 24px;
    letter-spacing: -0.03em;
}

.landing p {
    margin: 0;
    color: #64748b;
    font-size: 17px;
    line-height: 1.65;
    max-width: 62ch;
}

.landing .contact-info {
    text-align: center;
}

.landing .contact-info p {
    max-width: none;
}

.landing-contact-icons {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4px;
    margin: 8px 0 0;
}

.landing-contact-icons a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    margin: 0;
    font-size: 22px;
    text-decoration: none;
}

.landing-contact-icons a:hover {
    text-decoration: none;
    opacity: 0.8;
}

.landing-copy {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.landing-copy h2 {
    margin: 0;
}

.landing-hl-carousel {
    display: flex;
    align-items: stretch;
    gap: 10px;
    margin: 0 0 36px;
}

.landing-hl-viewport {
    flex: 1;
    min-width: 0;
    overflow-x: clip;
    overflow-y: visible;
    container-type: inline-size;
}

.landing-highlights {
    display: flex;
    gap: 14px;
    margin: 0;
}

.landing-highlights .course-landing-hl {
    flex: 0 0 calc((100cqi - 56px) / 5);
    min-width: 0;
}

.landing-highlights .course-landing-hl--stack {
    justify-content: flex-start;
    min-height: 280px;
}

.landing-highlights .course-landing-hl h3 {
    min-height: calc(2 * 1.25em);
}

.landing-hl-nav {
    flex: none;
    align-self: center;
    width: 36px;
    height: 36px;
    border: 1px solid #e8edf5;
    border-radius: 999px;
    background: #fff;
    color: #0f172a;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.landing-hl-nav:hover {
    background: #f8fafc;
}

body.dark-mode .landing-hl-nav {
    background: #151c2c;
    border-color: #243044;
    color: #e8eef8;
}

body.dark-mode .landing-hl-nav:hover {
    background: #1c2538;
}

.landing-authors {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin: 8px 0 48px;
}

.landing-author {
    display: flex;
    align-items: stretch;
    gap: 28px;
    margin: 0;
    padding: 20px;
    background: #f8fafc;
    border: 1px solid #e8edf5;
    border-radius: 18px;
}

.landing-author-photo {
    flex: 0 0 340px;
    width: 340px;
    height: 340px;
    min-height: 340px;
    align-self: flex-start;
    border-radius: 14px;
    overflow: hidden;
    background: #e8edf5;
}

.landing-author-photo img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.landing-author-text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 4px 4px 4px 0;
}

.landing-author-kicker {
    margin: 0 0 6px;
    color: #2563eb;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.landing-author h2 {
    margin: 0 0 14px;
    font-size: 28px;
    letter-spacing: -0.03em;
    line-height: 1.15;
}

.landing-author-bio {
    margin: 0;
    padding: 0;
    list-style: none;
    color: #475569;
    font-size: 15px;
    line-height: 1.45;
}

.landing-author-bio li {
    position: relative;
    padding: 7px 0 7px 16px;
    border-top: 1px solid #e8edf5;
}

.landing-author-bio li:last-child {
    border-bottom: 1px solid #e8edf5;
}

.landing-author-bio li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 14px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #2563eb;
}

.landing-author-bio li + li {
    margin-top: 0;
}

.landing-author-contact {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    align-self: flex-start;
    margin-top: 16px;
    padding: 11px 18px;
    border-radius: 10px;
    background: #229ed9;
    color: #fff !important;
    font-size: 15px;
    font-weight: 650;
    text-decoration: none;
    max-width: none;
    box-shadow: 0 6px 16px rgba(34, 158, 217, 0.28);
}

.landing-author-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-top: 16px;
}

.landing-author-actions .landing-author-contact {
    margin-top: 0;
}

.landing-author-max,
body.dark-mode .landing-author-max {
    background: #5b4dff;
    box-shadow: 0 6px 16px rgba(91, 77, 255, 0.34);
}

.landing-author-carbon,
body.dark-mode .landing-author-carbon {
    background: #ce5a82;
    box-shadow: 0 6px 16px rgba(206, 90, 130, 0.34);
}

.landing-author-contact:hover {
    filter: brightness(1.06);
    text-decoration: none;
}

.landing-faq {
    margin: 0 0 48px;
}

.landing-faq h2 {
    margin: 0 0 16px;
}

.landing-faq-list {
    border: 1px solid #e8edf5;
    border-radius: 18px;
    background: #f8fafc;
    overflow: hidden;
}

.landing-faq-item {
    padding: 18px 20px;
    border-top: 1px solid #e8edf5;
}

.landing-faq-item:first-child {
    border-top: none;
}

.landing-faq-item h3 {
    margin: 0 0 8px;
    font-size: 17px;
    line-height: 1.3;
    letter-spacing: -0.02em;
}

.landing-faq-item p {
    margin: 0;
    color: #475569;
    font-size: 15px;
    line-height: 1.6;
    max-width: none;
}

.link-telegram,
.course-register-steps a.link-telegram {
    color: #229ed9;
    font-weight: 650;
}

.link-max,
.course-register-steps a.link-max {
    color: #ce5a82;
    font-weight: 650;
}

.link-telegram:hover,
.course-register-steps a.link-telegram:hover {
    color: #38bdf8;
}

.link-max:hover,
.course-register-steps a.link-max:hover {
    color: #e879a8;
}

body.dark-mode .link-telegram,
body.dark-mode .course-register-steps a.link-telegram {
    color: #38bdf8;
}

body.dark-mode .link-max,
body.dark-mode .course-register-steps a.link-max {
    color: #f472b6;
}

.landing-courses {
    margin: 0 0 48px;
}

.landing-courses h2 {
    margin: 0 0 16px;
}

.landing-courses-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.landing-course-link {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    min-height: 0;
    padding: 18px 20px 16px;
    border: 1px solid #e8edf5;
    border-radius: 18px;
    background: #fff;
    color: inherit !important;
    font-weight: 400;
    letter-spacing: 0;
    line-height: 1.4;
    text-decoration: none;
}

.landing-course-link h3 {
    margin: 0;
    color: #0f172a;
    font-size: 17px;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.3;
}

.landing-course-link p {
    margin: 0;
    color: #64748b;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.5;
    max-width: none;
}

.landing-course-link:hover {
    border-color: #93c5fd;
    background: #fff;
    text-decoration: none;
}

.landing-hero,
.landing-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: center;
    margin-bottom: 48px;
}

.landing-row.reverse .landing-photo {
    order: 2;
}

.landing-photo {
    position: relative;
    width: 100%;
    height: 340px;
    min-height: 340px;
    aspect-ratio: auto;
    border-radius: 0;
    border: 1px dashed #cbd5e1;
    background: #eef2f7;
    overflow: hidden;
}

.landing-photo span {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    font-size: 14px;
    font-weight: 600;
}

.landing-photo img {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: block;
    width: 100%;
    height: 100%;
    min-height: 0;
    object-fit: cover;
}

.landing-photo:has(img) span {
    display: none;
}

.landing-codebg {
    position: absolute;
    inset: 0;
    z-index: 0;
    display: flex;
    gap: 28px;
    padding: 0 8px;
    overflow: hidden;
    pointer-events: none;
    opacity: 0.1;
}

.landing-codebg-col {
    flex: 1;
    min-width: 0;
    height: 100%;
    overflow: hidden;
}

.landing-codebg-track {
    margin: 0;
    font: 11px/1.6 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    white-space: pre;
    color: #334155;
    animation: landing-code-scroll 90s linear infinite;
}

.landing-codebg-col:nth-child(2) .landing-codebg-track {
    animation-duration: 120s;
    animation-direction: reverse;
}

.landing-codebg-col:nth-child(3) .landing-codebg-track {
    animation-duration: 80s;
}

.landing-codebg-col:nth-child(4) .landing-codebg-track {
    animation-duration: 140s;
    animation-direction: reverse;
}

.landing-codebg .tok-kw { color: #2563eb; }
.landing-codebg .tok-fn { color: #7c3aed; }
.landing-codebg .tok-str { color: #15803d; }
.landing-codebg .tok-num { color: #c2410c; }
.landing-codebg .tok-cmt { color: #64748b; }

@keyframes landing-code-scroll {
    from { transform: translateY(0); }
    to { transform: translateY(-50%); }
}

@media (prefers-reduced-motion: reduce) {
    .landing-codebg-track {
        animation: none;
    }

    .site-nav,
    .site-stage,
    .nav-open-btn,
    .nav-backdrop {
        transition: none !important;
    }
}

body.site-app .main-content {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
}

body.site-app #homeContainer {
    background: #fff;
    border: 1px solid #e8edf5;
    border-radius: 0;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

body.dark-mode.site-app #homeContainer {
    background: #151c2c;
    border-color: #243044;
}

body.dark-mode .landing p {
    color: #94a3b8;
}

body.dark-mode .landing-highlights .course-landing-hl {
    background: #151c2c;
    border-color: rgba(255, 255, 255, 0.06);
    box-shadow: none;
}

body.dark-mode .landing-highlights .course-landing-hl h3 {
    color: #fff;
}

body.dark-mode .landing-highlights .course-landing-hl p {
    color: #cbd5e1;
}

body.dark-mode .landing-highlights .course-landing-hl-icon {
    color: #e8eef8;
}

body.dark-mode .landing-highlights .course-landing-hl-icon--accent {
    color: #a3e635;
}

body.dark-mode .landing-highlights .course-landing-hl-icon--lg {
    color: #60a5fa;
}

body.dark-mode .landing-author {
    background: #121a2a;
    border-color: #243044;
}

body.dark-mode .landing-author-kicker {
    color: #60a5fa;
}

body.dark-mode .landing-author-bio {
    color: #cbd5e1;
}

body.dark-mode .landing-author-bio li,
body.dark-mode .landing-author-bio li:last-child {
    border-color: #243044;
}

body.dark-mode .landing-faq-list {
    background: #121a2a;
    border-color: #243044;
}

body.dark-mode .landing-faq-item {
    border-color: #243044;
}

body.dark-mode .landing-faq-item h3 {
    color: #e8eef8;
}

body.dark-mode .landing-faq-item p {
    color: #cbd5e1;
}

body.dark-mode .landing-courses-grid .landing-course-link {
    background: #121a2a;
    border-color: #243044;
}

body.dark-mode .landing-course-link h3 {
    color: #e8eef8;
}

body.dark-mode .landing-course-link p {
    color: #94a3b8;
}

body.dark-mode .landing-course-link:hover {
    background: #1c2538;
    border-color: #3b82f6;
}

body.dark-mode .landing-photo {
    background: #1c2538;
    border-color: #334155;
}

body.dark-mode .landing-codebg {
    opacity: 0.12;
}

body.dark-mode .landing-codebg-track {
    color: #94a3b8;
}

body.dark-mode .landing-codebg .tok-kw { color: #7dd3fc; }
body.dark-mode .landing-codebg .tok-fn { color: #c4b5fd; }
body.dark-mode .landing-codebg .tok-str { color: #86efac; }
body.dark-mode .landing-codebg .tok-num { color: #fdba74; }
body.dark-mode .landing-codebg .tok-cmt { color: #64748b; }

@media (max-width: 980px) {
    .landing-hero,
    .landing-row,
    .landing-row.reverse {
        grid-template-columns: 1fr;
    }

    .landing-hero > div:first-child,
    .landing-row .landing-copy {
        order: 1;
    }

    .landing-hero .landing-photo,
    .landing-row .landing-photo,
    .landing-row.reverse .landing-photo {
        order: 2;
    }

    .landing-codebg-col:nth-child(n+3) {
        display: none;
    }

    .landing {
        padding: 24px 18px 36px;
    }

    .landing h1 {
        font-size: 28px;
    }

    .landing-author {
        flex-direction: column;
        gap: 16px;
        padding: 14px;
    }

    .landing-author-photo {
        width: 100%;
        flex: none;
        height: auto;
        min-height: 0;
        aspect-ratio: 1;
    }

    .landing-courses-grid {
        grid-template-columns: 1fr;
    }

    .landing-highlights .course-landing-hl {
        flex-basis: calc((100cqi - 14px) / 2);
    }
}

@media (max-width: 640px) {
    .landing-courses-grid {
        grid-template-columns: 1fr;
    }

    .landing-highlights .course-landing-hl {
        flex-basis: 100%;
        flex: 0 0 100%;
    }

    .landing {
        padding: 12px 4px 28px;
    }

    .landing h1 {
        font-size: 22px;
        line-height: 1.25;
        overflow-wrap: anywhere;
    }

    .landing h2 {
        font-size: 20px;
    }

    .landing p {
        font-size: 15px;
    }

    .landing-photo {
        min-height: 180px;
        height: 200px;
    }

    .landing-author h2 {
        font-size: 22px;
    }

}

@media (max-width: 860px) {
    html,
    body.site-app {
        max-width: 100%;
        overflow: visible;
    }

    body.site-app,
    .site-stage,
    body.nav-collapsed .site-stage {
        min-height: 100dvh;
    }

    .nav-item,
    .nav-sub-link,
    .nav-toggle {
        justify-content: center;
        text-align: center;
    }

    .nav-toggle {
        position: relative;
    }

    .nav-toggle .nav-caret {
        position: absolute;
        right: 12px;
    }

    .nav-toggle span {
        justify-content: center;
    }

    .nav-sub {
        padding-left: 0;
    }

    .nav-open-btn {
        display: inline-flex;
        top: max(10px, env(safe-area-inset-top, 0px));
        left: max(10px, env(safe-area-inset-left, 0px));
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        transform: none;
    }

    body.nav-open .nav-open-btn {
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transform: translateX(-8px);
    }

    .site-nav {
        transform: translateX(-105%);
        width: min(320px, 88vw);
        padding-top: env(safe-area-inset-top, 0px);
        padding-bottom: env(safe-area-inset-bottom, 0px);
    }

    body.nav-open .site-nav,
    body.nav-collapsed.nav-open .site-nav {
        transform: none;
    }

    .nav-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(2, 6, 23, 0.55);
        z-index: 30;
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition: opacity 0.55s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.55s;
    }

    body.nav-open .nav-backdrop {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

    .site-stage,
    body.nav-collapsed .site-stage {
        margin-left: 0;
        padding-top: calc(52px + env(safe-area-inset-top, 0px));
        padding-left: 0;
        padding-bottom: env(safe-area-inset-bottom, 0px);
    }

    body.site-app .container {
        flex-direction: column;
        flex-wrap: nowrap;
        width: 100%;
        max-width: 100% !important;
        box-sizing: border-box;
        padding: 8px 12px 28px !important;
        gap: 12px !important;
    }

    body.site-app .search-box {
        margin: 0 12px 8px;
        padding: 12px;
    }

    body.site-app .main-content {
        min-width: 0;
        max-width: 100%;
        overflow: visible !important;
        min-height: 0;
    }

    #homeContainer {
        overflow-anchor: none;
    }

    body.tab-course.site-app .container {
        padding: 0 !important;
        gap: 0 !important;
    }

    body.tab-course .main-content,
    body.tab-course #courseEmbedContainer,
    body.tab-course .course-embed-frame,
    body.tab-course .course-embed-frame.is-active {
        width: 100% !important;
        max-width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        box-sizing: border-box;
    }

    body.site-app .course-landing-dock {
        margin: 0;
        position: relative;
        top: auto;
        padding: 10px 12px;
        justify-content: stretch;
        flex-wrap: wrap;
        gap: 8px;
    }

    body.site-app .course-landing-dock .course-landing-actions {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    body.site-app .course-landing-dock .course-landing-login,
    body.site-app .course-landing-dock .course-landing-register {
        width: 100%;
        flex: none;
        min-height: 44px;
        padding: 10px 14px;
        font-size: 15px;
    }

    body.site-app .sidebar-container {
        width: 100%;
        flex: none;
        min-width: 0;
    }

    body.site-app #pageHeader,
    body.site-app .news-header {
        padding: 12px 14px;
        font-size: 16px;
    }

    body.site-app .modal-content,
    body.site-app #modalContent {
        width: calc(100% - 16px) !important;
        max-width: calc(100vw - 16px) !important;
        margin: 8px auto !important;
        max-height: calc(100dvh - 16px);
        box-sizing: border-box;
    }

    #loginModal .modal-content {
        width: calc(100% - 16px) !important;
        max-width: 400px !important;
        padding: 16px 14px;
    }

    #calendarModal {
        padding: 0;
    }

    body.site-app #calendarModal .modal-content {
        width: 100% !important;
        max-width: none !important;
        height: 100dvh !important;
        max-height: 100dvh !important;
        margin: 0 !important;
        padding: 12px 10px 14px !important;
        border-radius: 0 !important;
        overflow: auto;
        display: flex;
        flex-direction: column;
        box-sizing: border-box;
    }

    #calendarModalContent,
    #calendarModal .full-calendar-view {
        flex: 1;
        min-height: 0;
        display: flex;
        flex-direction: column;
    }

    #calendarModal .full-calendar-view h2 {
        font-size: 20px;
    }

    #calendarModal .full-calendar-filters {
        margin: 10px 0;
        gap: 8px;
    }

    #calendarModal .full-calendar-filters .rating-select,
    #calendarModal .full-calendar-filters #calendarMonthSelect {
        min-width: 0;
        flex: 1 1 120px;
    }

    #calendarModal .full-calendar-weekdays,
    #calendarModal .full-calendar-days,
    #calendarModal .full-calendar-week,
    #calendarModal .full-calendar-grid {
        width: 100%;
    }

    #calendarModal .full-calendar-grid {
        flex: 1 1 auto;
        min-height: 0;
    }

    #calendarModal .full-calendar-days {
        display: flex;
        flex-direction: column;
        gap: 4px;
    }

    #calendarModal .full-calendar-week {
        flex: none;
    }

    #calendarModal .full-calendar-view .calendar-day-cell {
        aspect-ratio: 1;
        width: 100%;
        min-height: 44px;
        height: auto;
    }

    #calendarModal .full-calendar-close-row {
        margin-top: auto;
        padding-top: 12px;
    }

    body.site-app input,
    body.site-app select,
    body.site-app textarea {
        font-size: 16px;
    }

    .rating-item,
    #ratingFullList .rating-item {
        flex-wrap: nowrap;
        align-items: center;
        gap: 0;
        padding: 12px 10px;
        min-width: 0;
    }

    .rating-rank {
        width: 26px;
        flex: none;
        font-size: 14px;
    }

    .rating-avatar {
        width: 32px;
        height: 32px;
        margin: 0 8px;
        flex: none;
        font-size: 13px;
    }

    .rating-info {
        min-width: 0;
        flex: 1;
    }

    .rating-name {
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .rating-score,
    .rating-tasks-score {
        margin-left: 6px;
    }

    .rating-details {
        flex-wrap: wrap;
        gap: 6px 10px;
    }

    .rating-graph-btn {
        margin-left: 6px;
        min-width: 40px;
        min-height: 40px;
        padding: 8px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .cf-layout--stats {
        grid-template-columns: 1fr;
        column-gap: 0;
    }

    .month-analysis-banner {
        flex-wrap: wrap;
        margin: 12px;
        padding: 12px;
    }

    .big-calendar-btn {
        width: 100%;
        padding: 14px 16px;
        font-size: 16px;
        box-sizing: border-box;
    }

    .tasks-year-tabs,
    .tasks-month-tabs,
    .tasks-filter-bar {
        padding-left: 12px;
        padding-right: 12px;
    }

    .tasks-filter-bar .filter-row,
    .tasks-filter-bar .filter-group {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .reset-filters-btn {
        margin-left: 0;
        width: 100%;
        justify-content: center;
    }

    .rating-select,
    .tags-filter-btn {
        width: 100%;
        box-sizing: border-box;
    }

    .landing-photo {
        min-height: 220px;
        height: 220px;
    }

    .course-embed-frame.is-active {
        min-height: 50vh;
    }

    body.site-app #compilerContainer .compiler-body {
        padding: 12px 10px 20px;
    }

    body.site-app .contest-item {
        padding: 14px 12px;
    }

    body.site-app .tag,
    body.site-app .contest-type,
    body.site-app .division-badge {
        padding: 5px 10px;
        font-size: 12px;
    }

    body.site-app .tag-actions .contest-link,
    body.site-app .tag-actions button {
        flex: 1 1 100% !important;
        width: 100% !important;
        justify-content: center;
    }
}

#ratingFullList .rating-item {
    cursor: pointer;
    padding: 15px 20px;
}

#ratingFullList .rating-rank,
#ratingFullList .rating-score {
    font-size: 16px;
}

#ratingFullList .rating-name {
    font-size: 16px;
}

#ratingFullList .rating-details {
    font-size: 13px;
}

#ratingFullList .rating-tasks-score {
    font-size: 14px;
}

#ratingFullList .rating-graph-btn {
    font-size: 12px;
}

#newsList .news-date {
    background: #2196F3;
    color: white;
    padding: 2px 8px;
    font-size: 11px;
}

body.site-app #contestsContainer .contest-item,
body.site-app #trainingsContainer .contest-item,
body.site-app #teamContainer .contest-item,
body.site-app #mathContainer .contest-item,
body.site-app #newsList .contest-item {
    padding: 15px 20px;
}

body.site-app #contestsContainer .contest-type,
body.site-app #trainingsContainer .contest-type,
body.site-app #teamContainer .contest-type,
body.site-app #mathContainer .contest-type,
body.site-app #newsList .contest-type {
    font-size: 12px;
    padding: 3px 8px;
}

body.site-app #contestsContainer .contest-info,
body.site-app #trainingsContainer .contest-info,
body.site-app #teamContainer .contest-info,
body.site-app #mathContainer .contest-info,
body.site-app #newsList .contest-info {
    font-size: 14px;
    margin-bottom: 8px;
}

body.site-app #contestsContainer .tag,
body.site-app #trainingsContainer .tag,
body.site-app #teamContainer .tag,
body.site-app #mathContainer .tag,
body.site-app #newsList .tag {
    font-size: 11px;
    padding: 3px 8px;
}

body.site-app #contestsContainer .contest-link,
body.site-app #trainingsContainer .contest-link,
body.site-app #teamContainer .contest-link,
body.site-app #mathContainer .contest-link,
body.site-app #newsList .contest-link {
    font-size: 14px;
    padding: 5px 15px;
}

body.site-app #mathContainer h3,
body.site-app #newsList h3 {
    font-size: 16px;
    font-weight: 700;
    margin: 10px 0;
}

body.dark-mode.site-app .tag {
    background: #243044;
    color: #c5d0dc;
}

body.site-app:not(.dark-mode) .modal-content,
body.site-app:not(.dark-mode) #modalContent {
    color: #0f172a;
}

body.site-app:not(.dark-mode) #chartModal h2,
body.site-app:not(.dark-mode) #chartModal h3,
body.site-app:not(.dark-mode) #profilePage h3 {
    color: #0f172a !important;
}

body.site-app:not(.dark-mode) #chartModal .stat-label,
body.site-app:not(.dark-mode) #chartModal .lk-stat-lbl,
body.site-app:not(.dark-mode) #profilePage .lk-stat-lbl {
    color: #475569 !important;
}

body.site-app #chartModal.lk-open .modal-content {
    max-width: 780px;
    padding: 14px 16px;
    margin: 3% auto;
}

body.site-app:not(.dark-mode) #chartModal [style*="color:#999"],
body.site-app:not(.dark-mode) #profilePage [style*="color:#999"] {
    color: #64748b !important;
}

body.site-app:not(.dark-mode) .news-header,
body.site-app:not(.dark-mode) #pageHeader {
    background: #ffffff !important;
    color: #0f172a !important;
    border-bottom: 1px solid #e8edf5 !important;
}

body.site-app.dark-mode .news-header,
body.site-app.dark-mode #pageHeader {
    background: #121826 !important;
    color: #e8eef8 !important;
    border-bottom: 1px solid #243044 !important;
}

body.site-app.hide-right-widgets #rightWidgets {
    display: none !important;
}

body.site-app.trainings-rating-tall #ratingWidget .rating-container {
    max-height: none !important;
    height: auto !important;
    overflow: visible !important;
}

body.dark-mode.site-app #ratingWidget,
body.dark-mode.site-app #upcomingWidget {
    background: #121826 !important;
    border: 1px solid #243044 !important;
    box-shadow: none !important;
}

body.dark-mode.site-app #ratingWidget .rating-container,
body.dark-mode.site-app #upcomingWidget .upcoming-content,
body.dark-mode.site-app #upcomingWidget .upcoming-list {
    background: #121826 !important;
}

body.dark-mode.site-app #ratingWidget .rating-item {
    border-bottom-color: #243044 !important;
}

body.dark-mode.site-app #ratingWidget .rating-item:hover {
    background: #151c2c !important;
}

body.dark-mode.site-app #ratingWidget .rating-name {
    color: #e8eef8 !important;
}

html.dark-mode #ratingWidget .rank-color-expert,
html.dark-mode #ratingFullList .rank-color-expert,
body.dark-mode.site-app #ratingWidget .rank-color-expert,
body.dark-mode.site-app #ratingWidget .rating-name .rank-color-expert,
body.dark-mode.site-app #ratingWidget .rating-score.rank-color-expert,
body.dark-mode.site-app #ratingFullList .rank-color-expert {
    color: #7B9CFF !important;
}

body.dark-mode.site-app #ratingWidget .rating-graph-btn {
    background: #151c2c !important;
    border-color: #243044 !important;
    color: #93c5fd !important;
}

body.dark-mode.site-app #ratingWidget .rating-graph-btn:hover {
    background: #1c2538 !important;
    color: #e8eef8 !important;
}

body.dark-mode.site-app #upcomingWidget .upcoming-header {
    background: #1e3a5f !important;
    border-bottom: 1px solid #243044 !important;
}

body.dark-mode.site-app #upcomingWidget .upcoming-item {
    background: #151c2c !important;
    border-color: #243044 !important;
}

body.dark-mode.site-app #upcomingWidget .upcoming-item:hover {
    background: #1c2538 !important;
}

body.dark-mode.site-app #upcomingWidget .upcoming-name {
    color: #e8eef8 !important;
}

body.dark-mode.site-app #upcomingWidget .upcoming-date,
body.dark-mode.site-app #upcomingWidget .no-upcoming-contests {
    color: #94a3b8 !important;
}

body.site-app:not(.dark-mode) #ratingWidget,
body.site-app:not(.dark-mode) #upcomingWidget {
    background: #ffffff !important;
    border: 1px solid #e8edf5 !important;
    box-shadow: none !important;
}

body.site-app:not(.dark-mode) #ratingWidget .rating-container,
body.site-app:not(.dark-mode) #upcomingWidget .upcoming-content,
body.site-app:not(.dark-mode) #upcomingWidget .upcoming-list {
    background: #ffffff !important;
}

body.site-app:not(.dark-mode) #ratingWidget .rating-item {
    border-bottom-color: #e8edf5 !important;
}

body.site-app:not(.dark-mode) #ratingWidget .rating-item:hover {
    background: #f8fafc !important;
}

body.site-app:not(.dark-mode) #ratingWidget .rating-name {
    color: #0f172a !important;
}

body.site-app:not(.dark-mode) #ratingWidget .rating-rank,
body.site-app:not(.dark-mode) #ratingWidget .rating-details {
    color: #64748b !important;
}

body.site-app:not(.dark-mode) #ratingWidget .rating-graph-btn {
    background: #dbeafe !important;
    border-color: #bfdbfe !important;
    color: #1e40af !important;
}

body.site-app:not(.dark-mode) #ratingWidget .rating-graph-btn:hover {
    background: #bfdbfe !important;
    color: #1e3a8a !important;
}

body.site-app:not(.dark-mode) #upcomingWidget .upcoming-header {
    background: #dbeafe !important;
    color: #1e40af !important;
    border-bottom: 1px solid #bfdbfe !important;
}

body.site-app:not(.dark-mode) #upcomingWidget .upcoming-item {
    background: #f8fafc !important;
    border-color: #e8edf5 !important;
}

body.site-app:not(.dark-mode) #upcomingWidget .upcoming-item:hover {
    background: #eff6ff !important;
}

body.site-app:not(.dark-mode) #upcomingWidget .upcoming-name {
    color: #0f172a !important;
}

body.site-app:not(.dark-mode) #upcomingWidget .upcoming-date,
body.site-app:not(.dark-mode) #upcomingWidget .no-upcoming-contests {
    color: #64748b !important;
}

body.dark-mode.site-app .tag.team,
body.dark-mode.site-app .tag.news,
body.dark-mode.site-app .tag.training,
body.dark-mode.site-app .tag.math,
body.dark-mode.site-app .tag.contest {
    background: #1a2838 !important;
    color: #8aaecb !important;
    border: 1px solid #2a3d52 !important;
}

body.dark-mode.site-app #teamContainer .contest-type.team,
body.dark-mode.site-app .contest-type.team,
body.dark-mode.site-app #trainingsContainer .contest-type.training,
body.dark-mode.site-app .contest-type.training,
body.dark-mode.site-app #mathContainer .contest-type.math,
body.dark-mode.site-app .contest-type.math,
body.dark-mode.site-app #cppContainer .contest-type.cpp,
body.dark-mode.site-app .contest-type.cpp {
    background: #1e3a5f !important;
    color: #dbeafe !important;
}

body.dark-mode.site-app #mathContainer .math-date-badge {
    background: #1e3a5f !important;
    color: #dbeafe !important;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 700;
    border: 1px solid #2a3d52;
    border-radius: 3px;
}

body.dark-mode.site-app #listSearchBox.rating-search .tag-btn.team,
body.dark-mode.site-app #listSearchBox.rating-search .tag-btn.training,
body.dark-mode.site-app #listSearchBox.rating-search .tag-btn.math,
body.dark-mode.site-app #listSearchBox.rating-search .tag-btn.contest {
    background: #1a2838 !important;
    color: #8aaecb !important;
    border-color: #2a3d52 !important;
}

body.site-app:not(.dark-mode) .tag,
body.site-app:not(.dark-mode) .tag.team,
body.site-app:not(.dark-mode) .tag.news,
body.site-app:not(.dark-mode) .tag.training,
body.site-app:not(.dark-mode) .tag.math,
body.site-app:not(.dark-mode) .tag.contest,
body.site-app:not(.dark-mode) .selected-tag {
    background: #eef2f7 !important;
    color: #1e3a5f !important;
    border: 1px solid #d5deea !important;
}

body.site-app:not(.dark-mode) .contest-type,
body.site-app:not(.dark-mode) .contest-type.team,
body.site-app:not(.dark-mode) .contest-type.training,
body.site-app:not(.dark-mode) .contest-type.math,
body.site-app:not(.dark-mode) .contest-type.cpp,
body.site-app:not(.dark-mode) .contest-type.news,
body.site-app:not(.dark-mode) .math-date-badge,
body.site-app:not(.dark-mode) .news-date {
    background: #e8eef6 !important;
    color: #1e3a5f !important;
    border: 1px solid #d5deea;
}

body.site-app:not(.dark-mode) #mathContainer .math-date-badge {
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 700;
    border-radius: 3px;
}

body.site-app:not(.dark-mode) .tag-btn,
body.site-app:not(.dark-mode) .tag-btn.team,
body.site-app:not(.dark-mode) .tag-btn.training,
body.site-app:not(.dark-mode) .tag-btn.math,
body.site-app:not(.dark-mode) .tag-btn.contest,
body.site-app:not(.dark-mode) .tag-btn.news {
    background: #eef2f7 !important;
    color: #1e3a5f !important;
    border-color: #d5deea !important;
}

body.site-app:not(.dark-mode) .tag-btn:hover,
body.site-app:not(.dark-mode) .tag-btn.active {
    background: #dbe7f3 !important;
    color: #0f172a !important;
}

#ratingFullList .rating-item:last-child {
    border-bottom: none;
}
body.site-app .modal {
    background-color: rgba(15, 23, 42, 0.45);
    z-index: 1300;
}

body.site-app .course-register-backdrop {
    background: rgba(15, 23, 42, 0.45);
}

body.site-app .course-register-dialog {
    border-radius: 3px;
}

body.dark-mode.site-app .modal,
body.dark-mode.site-app .course-register-backdrop {
    background-color: rgba(2, 6, 23, 0.55);
}

body.site-app .year-tab,
body.site-app .month-tab,
body.site-app .rating-select,
body.site-app .tags-filter-btn,
body.site-app .reset-filters-btn,
body.site-app .filter-chip,
body.site-app .big-calendar-btn,
body.site-app .task-card-vertical,
body.site-app .month-analysis-banner,
body.site-app .contest-type,
body.site-app .division-badge,
body.site-app .contest-link,
body.site-app .tag,
body.site-app .tag-btn,
body.site-app .selected-tag,
body.site-app .calendar-day-cell,
body.site-app .upcoming-item,
body.site-app .modal-content,
body.site-app .search-input,
body.site-app .tab,
body.site-app .monitor-tab,
body.site-app .math-date-badge,
body.site-app .news-date,
body.site-app .rating-graph-btn,
body.site-app .tag-filter-toggle,
body.site-app .tag-dropdown {
    border-radius: 3px !important;
}

body.site-app .rating-avatar {
    border-radius: 50% !important;
}

body.site-app .tag-actions {
    justify-content: flex-start;
}

body.site-app .tag-actions .contest-link,
body.site-app .tag-actions button {
    flex: 0 0 auto !important;
    width: auto !important;
    white-space: nowrap;
}

#loginModal .login-register-btn {
    margin-top: 10px;
}
