/* Prime Math - Main Stylesheet */

:root {
    /* Палитра Prime Math: основной белый, индиго + фиолетовый акценты */
    --blue:       #2E3192;   /* индиго — основной бренд-цвет */
    --blue-dark:  #131740;   /* тёмный индиго — футер, тёмные секции */
    --blue-light: #4B50C8;   /* светлый индиго — ховеры, второстепенные ссылки */
    --violet:     #7C3AED;   /* фиолетовый акцент */
    --violet-dark:#6D28D9;
    --medal:      #F4B740;   /* тёплый акцент (бейджи, выделения) */
    --accent:     #EEEDFB;   /* светло-фиолетовая подложка */
    --accent-mid: #C9C6F2;
    --white:      #FFFFFF;
    --off-white:  #F6F7FC;
    --gray-100:   #F1F2F8;
    --gray-200:   #DFE1EE;
    --gray-400:   #8A90B0;
    --gray-600:   #4A5068;
    --gray-800:   #1B2038;
    --green:      #1B8A4C;
    --green-bg:   #E8F7EE;
    --red:        #C53030;
    --red-bg:     #FFF0F0;
    --yellow-bg:  #FFFAEB;
    --yellow:     #B45309;
    --nav-h:      64px;
    --radius:     10px;
    --radius-lg:  16px;
    --shadow:     0 2px 12px rgba(19,23,64,.08);
    --shadow-lg:  0 8px 32px rgba(19,23,64,.14);
    --tr:         .2s ease;
    --grad:       linear-gradient(135deg, var(--blue) 0%, var(--violet) 100%);
    --grid-line:  rgba(46,49,146,.06); /* клетка «в тетрадку» */
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    font-family: 'Golos Text', system-ui, sans-serif;
    font-size: 16px;
    line-height: 1.65;
    color: var(--gray-800);
    /* Белый фон с тонкой клеткой «в тетрадку» */
    background-color: var(--white);
    background-image:
        linear-gradient(to right, var(--grid-line) 1px, transparent 1px),
        linear-gradient(to bottom, var(--grid-line) 1px, transparent 1px);
    background-size: 32px 32px;
    padding-top: var(--nav-h);
}
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }

/* NAV */
.top-nav {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--nav-h);
    background: rgba(255,255,255,.92);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--gray-200);
    z-index: 1000;
    box-shadow: 0 1px 10px rgba(19,23,64,.05);
    transition: background var(--tr), box-shadow var(--tr);
    overflow: visible;
}
.top-nav.scrolled { background: rgba(255,255,255,.97); box-shadow: 0 2px 16px rgba(19,23,64,.10); }
.nav-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    height: var(--nav-h);
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: nowrap;
    overflow: visible;
    position: relative;
}
.nav-left { display: flex; align-items: center; gap: 0; flex-shrink: 0; }
.nav-logo { display: flex; align-items: center; text-decoration: none; flex-shrink: 0; transition: opacity var(--tr); }
.nav-logo:hover { opacity: .85; text-decoration: none; }
/* Основной логотип: обрезанный по вертикали PNG со скруглёнными углами */
.nav-logo-img {
    height: 52px; width: auto; display: block;
}
/* Текстовый логотип (используется в футере и на страницах входа — на тёмном фоне) */
.logo-prime { font-size: 1.45rem; font-weight: 700; color: var(--white); letter-spacing: -.01em; line-height: 1; }
.logo-math  { font-size: 1.45rem; font-weight: 700; color: #A78BFA; letter-spacing: -.01em; line-height: 1; }
.nav-links { display: flex; align-items: center; gap: .15rem; flex: 1; justify-content: center; min-width: 0; }
.nav-link {
    padding: .42rem .7rem; border-radius: 6px; font-size: .88rem; font-weight: 500;
    color: var(--gray-600); text-decoration: none; white-space: nowrap; flex-shrink: 0;
    transition: background var(--tr), color var(--tr);
}
.nav-link:hover { background: var(--accent); color: var(--blue); text-decoration: none; }
.nav-link.active { background: var(--accent); color: var(--blue); font-weight: 600; }
.nav-link--admin {
    display: inline-flex; align-items: center; gap: .3rem;
    background: var(--accent); border: 1px solid var(--accent-mid); border-radius: 6px; color: var(--blue);
}
.nav-link--admin:hover { background: var(--accent-mid); border-color: var(--accent-mid); }
.nav-right { display: flex; align-items: center; gap: .6rem; flex-shrink: 0; }
.notif-btn {
    position: relative; display: flex; align-items: center; justify-content: center;
    width: 36px; height: 36px; border-radius: 8px; color: var(--gray-600);
    text-decoration: none; transition: background var(--tr), color var(--tr);
}
.notif-btn:hover { background: var(--accent); color: var(--blue); text-decoration: none; }
.notif-icon { width: 20px; height: 20px; }
/* Иконка-картинка ringing.png: чёрный PNG → приглушённый тёмный на белой шапке */
.notif-icon--img { width: 21px; height: 21px; object-fit: contain; opacity: .72; }
.notif-btn:hover .notif-icon--img { opacity: 1; }
.notif-badge {
    position: absolute; top: 3px; right: 3px;
    background: #E53E3E; color: #fff; font-size: .58rem; font-weight: 700;
    min-width: 15px; height: 15px; border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    padding: 0 3px; border: 2px solid var(--white);
}
.notif-badge.notif-hidden { display: none; }
.user-dropdown { position: relative; }
.user-btn {
    display: flex; align-items: center; gap: .45rem;
    padding: .3rem .55rem .3rem .3rem;
    border: 1.5px solid var(--gray-200); border-radius: 8px;
    background: transparent; color: var(--gray-800); font-size: .86rem; font-weight: 500;
    transition: background var(--tr), border-color var(--tr); cursor: pointer; white-space: nowrap;
}
.user-btn:hover, .user-btn[aria-expanded="true"] { background: var(--gray-100); border-color: var(--accent-mid); }
.user-avatar {
    width: 26px; height: 26px; border-radius: 5px; background: var(--grad);
    display: flex; align-items: center; justify-content: center;
    font-size: .75rem; font-weight: 700; color: var(--white); overflow: hidden; flex-shrink: 0;
}
.user-avatar img { width: 100%; height: 100%; object-fit: cover; }
.user-name-text { max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chevron { width: 13px; height: 13px; opacity: .7; transition: transform var(--tr); flex-shrink: 0; }
.user-btn[aria-expanded="true"] .chevron { transform: rotate(180deg); }
.dropdown-menu {
    position: absolute; top: calc(100% + 8px); right: 0;
    background: var(--white); border: 1px solid var(--gray-200); border-radius: var(--radius);
    box-shadow: var(--shadow-lg); min-width: 175px; padding: .35rem;
    opacity: 0; transform: translateY(-6px); pointer-events: none;
    transition: opacity .15s ease, transform .15s ease; z-index: 1200;
}
.dropdown-menu.open { opacity: 1; transform: translateY(0); pointer-events: auto; }
.dropdown-item {
    display: flex; align-items: center; gap: .55rem; padding: .48rem .65rem; border-radius: 7px;
    font-size: .86rem; font-weight: 500; color: var(--gray-600); text-decoration: none;
    transition: background var(--tr), color var(--tr);
}
.dropdown-item:hover { background: var(--gray-100); color: var(--blue); text-decoration: none; }
.dropdown-item svg { width: 15px; height: 15px; flex-shrink: 0; }
.dropdown-item--danger { color: var(--red); }
.dropdown-item--danger:hover { background: var(--red-bg); color: var(--red); }
.dropdown-divider { height: 1px; background: var(--gray-200); margin: .28rem 0; }
.btn-nav-login {
    padding: .42rem 1.1rem; background: var(--grad); border: none;
    border-radius: 20px; color: var(--white); font-size: .86rem; font-weight: 600;
    text-decoration: none; white-space: nowrap; flex-shrink: 0;
    box-shadow: 0 2px 10px rgba(124,58,237,.28);
    transition: box-shadow var(--tr), transform var(--tr);
}
.btn-nav-login:hover { box-shadow: 0 4px 16px rgba(124,58,237,.40); transform: translateY(-1px); text-decoration: none; }
.burger { display: none; flex-direction: column; justify-content: space-between; width: 22px; height: 16px; background: none; border: none; padding: 0; cursor: pointer; flex-shrink: 0; }
.burger span { display: block; height: 2px; background: var(--gray-800); border-radius: 2px; transition: transform .25s ease, opacity .25s ease; transform-origin: center; }
.burger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.burger.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.burger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* MOBILE MENU */
.mobile-menu {
    position: fixed; top: var(--nav-h); left: 0; right: 0;
    background: var(--white); border-bottom: 1px solid var(--gray-200);
    padding: .75rem 1rem 1rem; z-index: 999;
    transform: translateY(-110%); transition: transform .3s cubic-bezier(.4,0,.2,1);
    box-shadow: var(--shadow-lg);
}
.mobile-menu.open { transform: translateY(0); }
.mobile-nav { display: flex; flex-direction: column; gap: .2rem; }
.mobile-link { display: block; padding: .7rem 1rem; border-radius: 8px; font-size: .95rem; font-weight: 500; color: var(--gray-800); text-decoration: none; transition: background var(--tr); }
.mobile-link:hover { background: var(--gray-100); text-decoration: none; }
.mobile-link--accent { color: var(--blue); font-weight: 700; }
.mobile-link--danger { color: var(--red); }
.mobile-link-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; margin-left: .4rem; padding: 0 .35rem; border-radius: 10px; background: var(--red); color: #fff; font-size: .72rem; font-weight: 700; vertical-align: middle; }
.mobile-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 998; opacity: 0; pointer-events: none; transition: opacity .3s ease; }
.mobile-overlay.open { opacity: 1; pointer-events: auto; }

/* FLASH MESSAGES */
.messages-container { position: fixed; top: calc(var(--nav-h) + 12px); right: 1.5rem; z-index: 1100; display: flex; flex-direction: column; gap: .45rem; max-width: 340px; }
.flash { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .7rem 1rem; border-radius: var(--radius); font-size: .88rem; font-weight: 500; box-shadow: var(--shadow-lg); animation: flashIn .3s ease; }
@keyframes flashIn { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: translateX(0); } }
.flash--success { background: var(--green-bg); color: var(--green); border: 1px solid #A7F3CA; }
.flash--error   { background: var(--red-bg);   color: var(--red);   border: 1px solid #FCA5A5; }
.flash--warning { background: var(--yellow-bg); color: var(--yellow); border: 1px solid #FCD34D; }
.flash--info    { background: var(--accent);    color: var(--blue);  border: 1px solid var(--accent-mid); }
.flash-close { background: none; border: none; font-size: 1.15rem; line-height: 1; color: inherit; opacity: .55; padding: 0; cursor: pointer; flex-shrink: 0; }
.flash-close:hover { opacity: 1; }

/* PAGE CONTENT */
.page-content { max-width: 1200px; margin: 0 auto; padding: 2.5rem 1.5rem 5rem; min-height: calc(100vh - var(--nav-h) - 220px); }

/* BUTTONS */
.btn { display: inline-flex; align-items: center; gap: .4rem; padding: .55rem 1.2rem; background: var(--grad); color: var(--white); border: none; border-radius: 8px; font-family: inherit; font-size: .9rem; font-weight: 600; cursor: pointer; text-decoration: none; transition: filter var(--tr), transform var(--tr), box-shadow var(--tr); }
.btn:hover { filter: brightness(1.07); text-decoration: none; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(124,58,237,.30); }
.btn:active { transform: translateY(0); }
.btn-sm { padding: .32rem .75rem; font-size: .82rem; }
.btn-secondary { display: inline-flex; align-items: center; gap: .4rem; padding: .5rem 1.1rem; background: var(--white); color: var(--blue); border: 1.5px solid var(--blue); border-radius: 8px; font-family: inherit; font-size: .9rem; font-weight: 600; cursor: pointer; text-decoration: none; transition: background var(--tr), transform var(--tr); }
.btn-secondary:hover { background: var(--accent); text-decoration: none; transform: translateY(-1px); }
.btn-danger { background: var(--red); }
.btn-danger:hover { background: #9B2C2C; }

/* TABLES */
/* Белый фон: иначе сквозь таблицу просвечивает клетчатый фон страницы */
.table-wrap { overflow-x: auto; border-radius: var(--radius-lg); border: 1px solid var(--gray-200); background: var(--white); }
.problems-table, .scoreboard-table, .data-table { width: 100%; border-collapse: collapse; font-size: .9rem; background: var(--white); }
.problems-table th, .scoreboard-table th, .data-table th { background: var(--blue); color: var(--white); padding: .7rem 1rem; text-align: left; font-weight: 600; font-size: .8rem; letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; }
.problems-table td, .scoreboard-table td, .data-table td { padding: .65rem 1rem; border-bottom: 1px solid var(--gray-100); vertical-align: middle; }
.problems-table tr:last-child td, .scoreboard-table tr:last-child td, .data-table tr:last-child td { border-bottom: none; }
.problems-table tbody tr, .scoreboard-table tbody tr, .data-table tbody tr { transition: background var(--tr); }
.problems-table tbody tr:hover, .scoreboard-table tbody tr:hover, .data-table tbody tr:hover { background: var(--off-white); }
.row-solved { background: #F0FFF6 !important; }
.row-tried  { background: #FFF5F5 !important; }
.row-solved td:first-child { border-left: 3px solid #68D391; }
.row-tried  td:first-child { border-left: 3px solid #FC8181; }
.cell-green  { background: #C6F6D5 !important; color: var(--green); font-weight: 700; text-align: center; }
.cell-yellow { background: #FEFCBF !important; color: var(--yellow); text-align: center; }
.cell-red    { background: #FED7D7 !important; color: var(--red); text-align: center; }

/* FORMS */
.form-group { margin-bottom: 1.15rem; }
.form-group label { display: block; font-size: .85rem; font-weight: 600; color: var(--gray-600); margin-bottom: .38rem; }
.text-input, .form-control, input[type="text"], input[type="email"], input[type="password"], input[type="number"], select, textarea {
    display: block; width: 100%; padding: .58rem .9rem; background: var(--white);
    border: 1.5px solid var(--gray-200); border-radius: 8px; font-family: inherit;
    font-size: .95rem; color: var(--gray-800); transition: border-color var(--tr), box-shadow var(--tr); outline: none;
}
.text-input:focus, input[type="text"]:focus, input[type="email"]:focus, input[type="password"]:focus, select:focus, textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(46,49,146,.1); }
textarea { resize: vertical; min-height: 90px; }

/* TAGS & BADGES */
.tag { display: inline-flex; align-items: center; padding: .18rem .55rem; background: var(--accent); color: var(--blue); border-radius: 20px; font-size: .76rem; font-weight: 600; border: 1px solid var(--accent-mid); margin: .12rem; }
.tag-sm { font-size: .72rem; padding: .13rem .45rem; margin: .08rem; }
.badge { display: inline-flex; align-items: center; padding: .17rem .52rem; border-radius: 20px; font-size: .74rem; font-weight: 700; }
.badge-warmup    { background: #E8F4FD; color: #2B6CB0; }
.badge-easy      { background: #E8F7EE; color: #1B8A4C; }
.badge-normal    { background: #FFF8E6; color: #92600A; }
.badge-hard      { background: #FFF0F0; color: #C53030; }
.badge-very_hard { background: #F5E6FF; color: #6B21A8; }
.badge-grave     { background: #1A202C; color: #FFF; }

/* ANSWER RESULTS */
.answer-result, .contest-answer-result { padding: .48rem .9rem; border-radius: 8px; font-weight: 600; font-size: .88rem; margin-top: .7rem; display: inline-block; animation: resultPop .22s ease; }
@keyframes resultPop { from { transform: scale(.94); opacity: .7; } to { transform: scale(1); opacity: 1; } }
.answer-result.success, .contest-answer-result.success { background: var(--green-bg); color: var(--green); border: 1px solid #A7F3CA; }
.answer-result.error,   .contest-answer-result.error   { background: var(--red-bg);   color: var(--red);   border: 1px solid #FCA5A5; }

/* TABS */
.tabs { display: flex; gap: .35rem; border-bottom: 2px solid var(--gray-200); margin-bottom: 1.5rem; }
.tab-button { padding: .52rem 1.05rem; border: none; background: transparent; color: var(--gray-400); font-family: inherit; font-size: .88rem; font-weight: 600; cursor: pointer; border-bottom: 2.5px solid transparent; margin-bottom: -2px; transition: color var(--tr), border-color var(--tr); border-radius: 6px 6px 0 0; }
.tab-button:hover { color: var(--blue); }
.tab-button.active { color: var(--blue); border-bottom-color: var(--blue); }
.tab-content { display: none; }
.tab-content.active { display: block; animation: fadeUp .2s ease; }
@keyframes fadeUp { from { opacity: .6; transform: translateY(5px); } to { opacity: 1; transform: none; } }

/* ACCORDION */
details.accordion { border: 1px solid var(--gray-200); border-radius: var(--radius); margin-bottom: .65rem; overflow: hidden; }
details.accordion summary { padding: .75rem 1rem; cursor: pointer; font-weight: 600; font-size: .88rem; color: var(--blue); background: var(--off-white); list-style: none; display: flex; align-items: center; justify-content: space-between; transition: background var(--tr); user-select: none; }
details.accordion summary::-webkit-details-marker { display: none; }
details.accordion summary:hover { background: var(--accent); }
details.accordion summary::after { content: '\25B8'; font-size: .75rem; color: var(--gray-400); transition: transform var(--tr); }
details.accordion[open] summary::after { transform: rotate(90deg); }
details.accordion > div { padding: 1rem; background: var(--white); }

/* VIDEO */
.video-wrapper { position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden; border-radius: var(--radius-lg); border: 1px solid var(--gray-200); margin: 1rem 0; }
.video-wrapper iframe, .video-wrapper video { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }

/* PAGINATION */
.pagination { display: flex; align-items: center; justify-content: center; gap: .35rem; margin-top: 2rem; flex-wrap: wrap; }
.pagination a, .pagination span { display: inline-flex; align-items: center; justify-content: center; min-width: 36px; height: 36px; padding: 0 .55rem; border-radius: 8px; font-size: .86rem; font-weight: 500; text-decoration: none; border: 1px solid var(--gray-200); color: var(--blue); transition: background var(--tr), color var(--tr); }
.pagination a:hover { background: var(--accent); text-decoration: none; }
.pagination .current { background: var(--blue); color: var(--white); border-color: var(--blue); font-weight: 700; }
.pagination-dots { display: inline-flex; align-items: center; justify-content: center; min-width: 36px; height: 36px; color: var(--gray-400); font-size: .88rem; pointer-events: none; }

/* CARDS */
.card { background: var(--white); border: 1px solid var(--gray-200); border-radius: var(--radius-lg); padding: 1.5rem; box-shadow: var(--shadow); transition: box-shadow var(--tr), transform var(--tr); }
.card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }

/* STATS GRID */
.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2rem; margin: 1.5rem 0; }
.stat-item { background: var(--accent); border: 1px solid var(--accent-mid); border-radius: var(--radius-lg); padding: 1.75rem 1.5rem; text-align: center; }
.stat-number { display: block; font-size: 2.8rem; font-weight: 700; color: var(--blue); line-height: 1; margin-bottom: .4rem; }
.stat-label  { display: block; font-size: .88rem; color: var(--gray-600); font-weight: 500; }

/* HERO */
.hero { text-align: center; padding: 3.5rem 1rem 2.5rem; }
.hero h1 { font-size: 3.5rem; font-weight: 700; line-height: 1.1; color: var(--blue); margin-bottom: .75rem; }
.hero p { font-size: 1.08rem; color: var(--gray-600); max-width: 580px; margin: 0 auto .5rem; }

/* PAGE HEADER */
.page-header { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 1.75rem; padding-bottom: 1.25rem; border-bottom: 2px solid var(--gray-100); }
.page-title { font-size: 1.9rem; font-weight: 700; color: var(--blue); line-height: 1.1; margin-bottom: .2rem; }
.page-subtitle { font-size: .88rem; color: var(--gray-400); font-weight: 500; }
.no-data { color: var(--gray-400); font-size: .85rem; }

/* MISC */
.normalized-preview { font-size: .8rem; color: var(--gray-400); margin: .45rem 0; display: flex; align-items: center; gap: .35rem; }
.normalized-preview span { font-family: 'JetBrains Mono', monospace; font-size: .82rem; color: var(--blue); background: var(--accent); padding: .08rem .38rem; border-radius: 4px; font-weight: 600; }
.author-solution { margin-top: 1.5rem; padding: 1.25rem; background: var(--off-white); border-left: 4px solid var(--blue); border-radius: 0 var(--radius) var(--radius) 0; animation: fadeUp .3s ease; }
.field-hint  { font-size: .76rem; color: var(--gray-400); }
.field-error { font-size: .76rem; color: var(--red); font-weight: 600; }
.empty-state { display: flex; flex-direction: column; align-items: center; gap: .85rem; padding: 3rem 1rem; background: var(--off-white); border: 1.5px dashed var(--gray-200); border-radius: var(--radius-lg); color: var(--gray-400); font-size: .95rem; }
.empty-icon svg { width: 40px; height: 40px; color: var(--gray-200); }
.empty-row td { padding: 0 !important; border: none !important; }
.empty-row .empty-state { padding: 3.5rem 1rem; }
@keyframes spin { to { transform: rotate(360deg); } }

/* FOOTER */
.site-footer { background: var(--blue-dark); color: rgba(255,255,255,.6); padding: 2.5rem 1.5rem; margin-top: 5rem; }
.footer-inner { max-width: 1200px; margin: 0 auto; display: grid; grid-template-columns: auto 1fr auto; gap: 2.5rem; align-items: start; }
.footer-logo { display: flex; align-items: baseline; gap: .05em; margin-bottom: .4rem; }
.footer-brand p { font-size: .8rem; color: rgba(255,255,255,.4); }
.footer-links { display: flex; flex-direction: column; gap: .45rem; }
.footer-links a { font-size: .86rem; color: rgba(255,255,255,.6); text-decoration: none; transition: color var(--tr); }
.footer-links a:hover { color: var(--white); text-decoration: none; }
.footer-copy { font-size: .76rem; color: rgba(255,255,255,.38); text-align: right; }
.footer-copy a { color: rgba(255,255,255,.55); text-decoration: underline; }

/* ========== MAIN PAGE ========== */
.hero-section { position: relative; text-align: center; padding: 5rem 1rem 4rem; overflow: hidden; }
.hero-badge { display: inline-block; padding: .3rem .9rem; background: var(--accent); color: var(--blue); border: 1px solid var(--accent-mid); border-radius: 20px; font-size: .78rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; margin-bottom: 1.5rem; animation: fadeDown .5s ease both; }
.hero-title { font-size: clamp(3.5rem, 8vw, 6rem); font-weight: 700; line-height: 1; margin-bottom: 1rem; animation: fadeDown .55s .08s ease both; }
.hero-sub  { font-size: clamp(1rem, 2.5vw, 1.2rem); font-weight: 600; color: var(--blue); margin-bottom: .75rem; animation: fadeDown .55s .14s ease both; }
.hero-desc { font-size: .97rem; color: var(--gray-600); max-width: 580px; margin: 0 auto 2rem; animation: fadeDown .55s .2s ease both; }
.hero-actions { display: flex; gap: .85rem; justify-content: center; flex-wrap: wrap; animation: fadeDown .55s .26s ease both; }
.btn-hero { padding: .7rem 1.8rem; font-size: 1rem; }
.btn-hero-sec { padding: .65rem 1.6rem; font-size: 1rem; }
@keyframes fadeDown { from { opacity: 0; transform: translateY(-14px); } to { opacity: 1; transform: none; } }
.stats-section { margin: 0 0 3.5rem; }
.stat-card { background: var(--white); border: 1px solid var(--gray-200); border-radius: var(--radius-lg); padding: 2rem 1.5rem; text-align: center; box-shadow: var(--shadow); transition: box-shadow var(--tr); }
.stat-card.visible { opacity: 1; transform: none; }
.stat-card:hover { box-shadow: var(--shadow-lg); border-color: var(--accent-mid); }
.stat-num { display: block; font-size: 3rem; font-weight: 700; color: var(--blue); line-height: 1; margin-bottom: .45rem; font-variant-numeric: tabular-nums; }
.stat-lbl { display: block; font-size: .88rem; color: var(--gray-400); font-weight: 500; }
.home-section { margin-bottom: 4rem; }
.section-header { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 1.5rem; border-bottom: 2px solid var(--gray-100); padding-bottom: .75rem; }
.section-title { font-size: 1.5rem; font-weight: 700; color: var(--blue); }
.section-link { font-size: .88rem; font-weight: 600; color: var(--blue-light); text-decoration: none; transition: color var(--tr); }
.section-link:hover { color: var(--blue); text-decoration: none; }
.contests-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.2rem; }
.contest-card { background: var(--white); border: 1px solid var(--gray-200); border-radius: var(--radius-lg); padding: 1.4rem; display: flex; flex-direction: column; gap: .65rem; box-shadow: var(--shadow); transition: box-shadow var(--tr); }
.contest-card.visible { opacity: 1; transform: none; } /* animation handled by JS on homepage */
.contest-card:hover { box-shadow: var(--shadow-lg); }
.contest-card-top { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.contest-type { display: inline-flex; padding: .18rem .6rem; border-radius: 20px; font-size: .74rem; font-weight: 700; letter-spacing: .02em; }
.contest-type--marathon { background: #EBF8FF; color: #2B6CB0; }
.contest-type--penalty  { background: #FFF5F0; color: #C05621; }
.contest-type--abaka    { background: #F0FFF4; color: #276749; }
.contest-type--carousel { background: #F3E8FF; color: #6B21A8; }
.contest-rated { font-size: .72rem; font-weight: 600; color: var(--yellow); background: var(--yellow-bg); padding: .18rem .55rem; border-radius: 20px; }
.contest-card-title { font-size: 1.05rem; font-weight: 700; color: var(--blue); line-height: 1.3; }
.contest-card-desc { font-size: .86rem; color: var(--gray-600); line-height: 1.5; flex: 1; }
.contest-card-meta { display: flex; flex-direction: column; gap: .3rem; }
.contest-meta-item { display: flex; align-items: center; gap: .4rem; font-size: .82rem; color: var(--gray-400); }
.contest-meta-item svg { width: 14px; height: 14px; flex-shrink: 0; }
.contest-card-timer { display: flex; align-items: center; gap: .45rem; font-size: .82rem; padding: .4rem .7rem; background: var(--off-white); border-radius: 7px; border: 1px solid var(--gray-200); }
.timer-label { color: var(--gray-400); font-weight: 500; }
.timer-value { color: var(--blue); font-weight: 700; font-family: 'JetBrains Mono', monospace; font-size: .85rem; }
.contest-card-btn { align-self: flex-start; margin-top: auto; }
.format-card { border: 1px solid var(--gray-200); border-radius: var(--radius-lg); padding: 1.75rem 1.5rem; background: var(--white); box-shadow: var(--shadow); transition: box-shadow var(--tr), border-color var(--tr); }
.format-card.visible { opacity: 1; transform: none; }
.format-card:hover { box-shadow: var(--shadow-lg); border-color: var(--accent-mid); }
.format-icon { width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center; margin-bottom: 1rem; }
.format-icon svg { width: 24px; height: 24px; }
.format-icon--marathon { background: #EBF8FF; color: #2B6CB0; }
.format-icon--penalty  { background: #FFF5F0; color: #C05621; }
.format-icon--abaka    { background: #F0FFF4; color: #276749; }
.format-card h3 { font-size: 1.05rem; font-weight: 700; color: var(--blue); margin-bottom: .5rem; }
.format-card p  { font-size: .88rem; color: var(--gray-600); line-height: 1.6; }
.formats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2rem; }
.edu-promo { background: var(--blue); border-radius: var(--radius-lg); overflow: hidden; padding: 0; }
.edu-promo-inner { display: grid; grid-template-columns: 1fr auto; align-items: center; padding: 2.5rem 3rem; gap: 2rem; position: relative; }
.edu-promo-tag { display: inline-block; padding: .22rem .75rem; background: rgba(255,255,255,.18); border: 1px solid rgba(255,255,255,.3); color: var(--accent-mid); border-radius: 20px; font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; margin-bottom: .85rem; }
.edu-promo-text h2 { font-size: 1.6rem; font-weight: 700; color: var(--white); margin-bottom: .6rem; line-height: 1.25; }
.edu-promo-text p  { font-size: .93rem; color: rgba(255,255,255,.72); max-width: 440px; margin-bottom: 1.4rem; line-height: 1.6; }
.edu-promo-text .btn { background: var(--white); color: var(--blue); }
.edu-promo-text .btn:hover { background: var(--accent); }
.edu-promo-deco { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; opacity: .12; }
.deco-math { font-size: 2.5rem; font-weight: 700; color: var(--white); text-align: center; line-height: 1; }

/* ========== AUTH ========== */
.auth-wrap { display: grid; grid-template-columns: 1fr 1fr; min-height: calc(100vh - var(--nav-h) - 220px); margin: -2.5rem -1.5rem -5rem; overflow: hidden; }
/* Auth-страницы: синяя плашка/форма вплотную к футеру (убираем белый зазор) */
body.auth-page .page-content { padding-bottom: 0; }
body.auth-page .site-footer { margin-top: 0; }
body.auth-page .auth-wrap { margin-bottom: 0; }
.auth-left { background: linear-gradient(160deg, var(--blue-dark) 0%, var(--blue) 60%, var(--violet-dark) 135%); display: flex; align-items: center; justify-content: center; padding: 3rem 2.5rem; position: relative; overflow: hidden; }
.auth-left::before { content: ''; position: absolute; width: 400px; height: 400px; border-radius: 50%; border: 60px solid rgba(255,255,255,.04); top: -100px; left: -100px; pointer-events: none; }
.auth-left::after  { content: ''; position: absolute; width: 300px; height: 300px; border-radius: 50%; border: 50px solid rgba(255,255,255,.04); bottom: -80px; right: -80px; pointer-events: none; }
.auth-left-content { position: relative; z-index: 1; text-align: center; }
.auth-brand { display: flex; align-items: baseline; justify-content: center; gap: .05em; margin-bottom: 1rem; }
.auth-brand .logo-prime, .auth-brand .logo-math { font-size: 3rem; }
.auth-tagline { color: rgba(255,255,255,.65); font-size: .95rem; line-height: 1.55; max-width: 280px; margin: 0 auto 2rem; }
.auth-symbols { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; margin-bottom: 2.5rem; opacity: .15; }
.auth-symbols span { font-size: 2.2rem; color: var(--white); font-weight: 700; text-align: center; }
.auth-stats { display: flex; gap: 2rem; justify-content: center; }
.auth-stat { text-align: center; }
.auth-stat-num { display: block; font-size: 1.8rem; font-weight: 700; color: var(--accent-mid); line-height: 1; }
.auth-stat-lbl { font-size: .75rem; color: rgba(255,255,255,.5); font-weight: 500; }
.auth-steps { display: flex; flex-direction: column; gap: .9rem; align-items: flex-start; text-align: left; margin-top: .5rem; }
.auth-step { display: flex; align-items: center; gap: .75rem; color: rgba(255,255,255,.45); font-size: .88rem; font-weight: 500; }
.auth-step--done { color: rgba(255,255,255,.9); }
.step-dot { width: 26px; height: 26px; border-radius: 50%; border: 2px solid rgba(255,255,255,.25); display: flex; align-items: center; justify-content: center; font-size: .75rem; font-weight: 700; color: rgba(255,255,255,.4); flex-shrink: 0; }
.auth-step--done .step-dot { background: var(--accent-mid); border-color: var(--accent-mid); color: var(--blue); }
.auth-right { display: flex; align-items: center; justify-content: center; padding: 2.5rem 2rem; background: var(--off-white); }
.auth-card { width: 100%; max-width: 420px; background: var(--white); border: 1px solid var(--gray-200); border-radius: var(--radius-lg); padding: 2.25rem 2rem; box-shadow: var(--shadow-lg); animation: authCardIn .4s ease both; }
@keyframes authCardIn { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
.auth-card-header { margin-bottom: 1.75rem; }
.auth-title    { font-size: 1.6rem; font-weight: 700; color: var(--blue); margin-bottom: .3rem; }
.auth-subtitle { font-size: .9rem; color: var(--gray-400); }
.auth-alert { display: flex; align-items: center; gap: .6rem; padding: .65rem .9rem; border-radius: 8px; font-size: .88rem; font-weight: 500; margin-bottom: 1.2rem; animation: flashIn .25s ease; }
.auth-alert svg { width: 16px; height: 16px; flex-shrink: 0; }
.auth-alert--error   { background: var(--red-bg);   color: var(--red);   border: 1px solid #FCA5A5; }
.auth-alert--success { background: var(--green-bg); color: var(--green); border: 1px solid #A7F3CA; }
.auth-alert--warning { background: var(--yellow-bg); color: var(--yellow); border: 1px solid #FCD34D; }
.auth-form { display: flex; flex-direction: column; gap: 1.1rem; }
.auth-row   { display: grid; grid-template-columns: 1fr 1fr; gap: .85rem; }
.auth-field { display: flex; flex-direction: column; gap: .38rem; }
.auth-field label { font-size: .83rem; font-weight: 700; color: var(--gray-600); letter-spacing: .01em; }
.auth-field-header { display: flex; align-items: center; justify-content: space-between; }
.auth-forgot { font-size: .78rem; font-weight: 600; color: var(--blue-light); text-decoration: none; }
.auth-forgot:hover { text-decoration: underline; }
.req { color: var(--red); font-weight: 700; }
.input-wrap { position: relative; display: flex; align-items: center; }
.input-wrap input { padding-left: 2.4rem; padding-right: 2.6rem; }
.input-icon { position: absolute; left: .75rem; width: 16px; height: 16px; color: var(--gray-400); pointer-events: none; flex-shrink: 0; }
.toggle-pass { position: absolute; right: .6rem; background: none; border: none; color: var(--gray-400); cursor: pointer; padding: 4px; display: flex; align-items: center; justify-content: center; transition: color var(--tr); }
.toggle-pass:hover { color: var(--blue); }
.toggle-pass svg { width: 16px; height: 16px; }
.strength-bar { height: 4px; background: var(--gray-100); border-radius: 4px; overflow: hidden; margin-top: .35rem; }
.strength-fill { height: 100%; border-radius: 4px; width: 0%; transition: width .3s ease, background .3s ease; }
.strength-fill.weak   { background: var(--red);    width: 25%; }
.strength-fill.ok     { background: var(--yellow); width: 50%; }
.strength-fill.good   { background: #38A169;       width: 75%; }
.strength-fill.strong { background: var(--green);  width: 100%; }
.strength-label       { font-size: .74rem; font-weight: 600; margin-top: .2rem; }
.strength-label.weak   { color: var(--red); }
.strength-label.ok     { color: var(--yellow); }
.strength-label.good   { color: #38A169; }
.strength-label.strong { color: var(--green); }
.auth-submit { width: 100%; justify-content: center; padding: .7rem; font-size: .95rem; margin-top: .4rem; gap: .5rem; }
.auth-submit svg { width: 16px; height: 16px; }
.auth-switch { text-align: center; font-size: .88rem; color: var(--gray-400); margin-top: 1.2rem; }
.auth-switch a { font-weight: 700; color: var(--blue); }
.auth-switch a:hover { text-decoration: underline; }
.resend-hint { display: flex; align-items: center; gap: .5rem; padding: .6rem .9rem; background: var(--accent); border: 1px solid var(--accent-mid); border-radius: 8px; font-size: .88rem; font-weight: 600; margin-bottom: 1rem; }
.resend-hint svg { width: 15px; height: 15px; color: var(--blue); flex-shrink: 0; }
.resend-hint a { color: var(--blue); text-decoration: none; }
.resend-hint a:hover { text-decoration: underline; }
.auth-center { display: flex; align-items: center; justify-content: center; min-height: calc(100vh - var(--nav-h) - 220px); }
.activation-card { max-width: 420px; width: 100%; text-align: center; background: var(--white); border: 1px solid var(--gray-200); border-radius: var(--radius-lg); padding: 3rem 2rem; box-shadow: var(--shadow-lg); animation: authCardIn .4s ease both; }
.activation-icon { width: 72px; height: 72px; border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 0 auto 1.5rem; }
.activation-icon svg { width: 36px; height: 36px; }
.activation-icon--success { background: var(--green-bg); color: var(--green); }
.activation-icon--info    { background: var(--accent); color: var(--blue); }
.activation-icon--error   { background: var(--red-bg); color: var(--red); }
.activation-title { font-size: 1.6rem; font-weight: 700; color: var(--blue); margin-bottom: .75rem; }
.activation-text  { font-size: .95rem; color: var(--gray-600); line-height: 1.6; margin-bottom: 1.75rem; }
.activation-btn   { width: 100%; justify-content: center; padding: .7rem; font-size: .95rem; }

/* ========== ARCHIVE ========== */
.filters-panel { background: var(--white); border: 1px solid var(--gray-200); border-radius: var(--radius-lg); padding: 1.4rem 1.6rem; margin-bottom: 1.25rem; box-shadow: var(--shadow); }
.filters-row { display: flex; flex-direction: column; gap: 1.1rem; }
.filter-block { display: flex; flex-direction: column; gap: .45rem; }
.filter-label { font-size: .75rem; font-weight: 700; color: var(--gray-400); letter-spacing: .06em; text-transform: uppercase; }
.difficulty-pills, .topics-pills { display: flex; flex-wrap: wrap; gap: .4rem; }
.pill { display: inline-flex; align-items: center; padding: .28rem .75rem; border-radius: 20px; font-size: .8rem; font-weight: 600; cursor: pointer; border: 1.5px solid var(--gray-200); background: var(--white); color: var(--gray-600); transition: background var(--tr), border-color var(--tr), color var(--tr), transform var(--tr); user-select: none; }
.pill input { display: none; }
.pill:hover { border-color: var(--blue); color: var(--blue); transform: translateY(-1px); }
.pill--active             { background: var(--blue); color: var(--white) !important; border-color: var(--blue); }
.pill--warmup.pill--active { background: #2B6CB0; color: var(--white) !important; border-color: #2B6CB0; }
.pill--easy.pill--active   { background: #1B8A4C; color: var(--white) !important; border-color: #1B8A4C; }
.pill--normal.pill--active { background: #92600A; color: var(--white) !important; border-color: #92600A; }
.pill--hard.pill--active   { background: var(--red); color: var(--white) !important; border-color: var(--red); }
.pill--very_hard.pill--active { background: #6B21A8; color: var(--white) !important; border-color: #6B21A8; }
.pill--grave.pill--active  { background: #1A202C; color: var(--white) !important; border-color: #1A202C; }
.pill--topic.pill--active  { background: var(--blue); color: var(--white) !important; border-color: var(--blue); }
.pill--warmup   { color: #2B6CB0; border-color: #BEE3F8; background: #EBF8FF; }
.pill--easy     { color: #1B8A4C; border-color: #C6F6D5; background: #F0FFF4; }
.pill--normal   { color: #92600A; border-color: #FAD97A; background: #FFFAEB; }
.pill--hard     { color: var(--red); border-color: #FCA5A5; background: #FFF5F5; }
.pill--very_hard{ color: #6B21A8; border-color: #E9D5FF; background: #FAF5FF; }
.pill--grave    { color: #1A202C; border-color: #CBD5E0; background: #F7FAFC; }
.filters-actions { display: flex; align-items: flex-end; gap: 1rem; flex-wrap: wrap; }
.filter-block--sort { flex: 0 0 auto; }
.sort-select { min-width: 170px; padding: .42rem .8rem; border: 1.5px solid var(--gray-200); border-radius: 8px; font-family: inherit; font-size: .88rem; color: var(--gray-800); background: var(--white); cursor: pointer; outline: none; }
.sort-select:focus { border-color: var(--blue); }
.filters-btns { display: flex; gap: .5rem; align-items: center; margin-top: 1.35rem; }
.active-filters { display: flex; align-items: center; flex-wrap: wrap; gap: .4rem; margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--gray-100); }
.active-filters-label { font-size: .76rem; color: var(--gray-400); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.active-tag { display: inline-flex; align-items: center; gap: .35rem; padding: .2rem .6rem; background: var(--accent); border: 1px solid var(--accent-mid); border-radius: 20px; font-size: .78rem; font-weight: 600; color: var(--blue); }
.active-tag-remove { color: var(--blue); font-size: .9rem; line-height: 1; text-decoration: none; opacity: .6; }
.active-tag-remove:hover { opacity: 1; text-decoration: none; }
.archive-legend { display: flex; gap: 1.25rem; align-items: center; margin-bottom: .85rem; font-size: .82rem; font-weight: 500; color: var(--gray-600); }
.legend-item { display: flex; align-items: center; gap: .4rem; }
.legend-dot { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }
.legend-item--solved .legend-dot { background: #68D391; }
.legend-item--tried  .legend-dot { background: #FC8181; }
.legend-dot--empty   { background: var(--gray-200); }
.col-id      { width: 60px; }
.col-title   { min-width: 200px; }
.col-topics  { width: 200px; }
.col-diff    { width: 165px; }
.col-diff .badge { white-space: nowrap; }
.col-solved  { width: 90px; text-align: center; }
.col-accuracy{ width: 105px; }
.sort-link { display: inline-flex; align-items: center; gap: .3rem; color: rgba(255,255,255,.8); text-decoration: none; font-weight: 600; font-size: .8rem; letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; }
.sort-link:hover { color: var(--white); text-decoration: none; }
.sort-link--active { color: var(--white); }
.sort-arrow { font-size: .7rem; opacity: .7; }
.problem-id { font-family: 'JetBrains Mono', monospace; font-size: .82rem; color: var(--gray-400); font-weight: 500; }
.problem-link { font-weight: 600; color: var(--blue); text-decoration: none; transition: color var(--tr); line-height: 1.4; }
.problem-link:hover { color: var(--blue-light); text-decoration: none; }
.status-icon { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; border-radius: 50%; font-size: .65rem; font-weight: 700; margin-left: .4rem; vertical-align: middle; }
.status-icon--solved { background: var(--green-bg); color: var(--green); }
.status-icon--tried  { background: var(--red-bg);   color: var(--red); }
.solved-count { display: block; text-align: center; font-weight: 600; color: var(--gray-600); font-size: .9rem; }
.accuracy-wrap { display: flex; align-items: center; gap: .5rem; }
.accuracy-bar  { flex: 1; height: 6px; background: var(--gray-100); border-radius: 4px; overflow: hidden; }
.accuracy-fill { height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--blue-light), var(--blue)); transition: width .4s ease; min-width: 2px; }
.accuracy-val  { font-size: .78rem; font-weight: 600; color: var(--gray-600); min-width: 34px; text-align: right; }
.problem-row { transition: background var(--tr); }
.row-solved:hover { background: #E6FFEE !important; }
.row-tried:hover  { background: #FFE8E8 !important; }

/* ========== PROBLEM DETAIL ========== */
.problem-header { margin-bottom: 2rem; padding-bottom: 1.5rem; border-bottom: 2px solid var(--gray-100); }
.problem-header-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; flex-wrap: wrap; gap: .5rem; }
.back-link { display: inline-flex; align-items: center; gap: .3rem; font-size: .85rem; font-weight: 600; color: var(--gray-400); text-decoration: none; transition: color var(--tr); }
.back-link svg { width: 16px; height: 16px; }
.back-link:hover { color: var(--blue); text-decoration: none; }
.problem-breadcrumb { display: inline-flex; align-items: center; gap: .35rem; flex-wrap: wrap; color: var(--gray-400); }
.problem-breadcrumb svg { color: var(--gray-200); flex-shrink: 0; }
.problem-meta-badges { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.badge-solved { display: inline-flex; align-items: center; gap: .35rem; padding: .22rem .7rem; background: var(--green-bg); color: var(--green); border: 1px solid #A7F3CA; border-radius: 20px; font-size: .78rem; font-weight: 700; }
.badge-solved svg { width: 13px; height: 13px; }
.problem-title { font-size: 2rem; font-weight: 700; color: var(--blue); line-height: 1.25; margin-bottom: .75rem; }
.problem-tags-row { display: flex; flex-wrap: wrap; gap: .3rem; margin-bottom: .85rem; }
.problem-stats-row { display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap; }
.pstat { display: flex; align-items: center; gap: .4rem; font-size: .85rem; color: var(--gray-400); font-weight: 500; }
.pstat svg { width: 15px; height: 15px; flex-shrink: 0; }
.problem-layout { display: grid; grid-template-columns: 1fr 340px; gap: 1.75rem; align-items: start; }
.problem-main { display: flex; flex-direction: column; gap: 1rem; }
.problem-statement { padding: 1.75rem 2rem; }
.problem-statement-content { font-size: 1rem; line-height: 1.75; color: var(--gray-800); }
.problem-statement-content p { margin-bottom: .75rem; }
.problem-statement-content img { max-width: 100%; border-radius: var(--radius); margin: .75rem 0; }
.author-solution { border: 1px solid var(--accent-mid); border-radius: var(--radius-lg); overflow: hidden; animation: fadeUp .35s ease; }
.author-solution-header { display: flex; align-items: center; gap: .6rem; padding: .85rem 1.25rem; background: var(--accent); font-size: .9rem; font-weight: 700; color: var(--blue); border-bottom: 1px solid var(--accent-mid); }
.author-solution-header svg { width: 16px; height: 16px; flex-shrink: 0; }
.author-solution-body { padding: 1.25rem; font-size: .95rem; line-height: 1.7; background: var(--white); }
.video-solution-block { border: 1px solid var(--gray-200); border-radius: var(--radius-lg); overflow: hidden; animation: fadeUp .35s ease; }
.video-solution-header { display: flex; align-items: center; gap: .6rem; padding: .85rem 1.25rem; background: var(--off-white); font-size: .9rem; font-weight: 700; color: var(--blue); border-bottom: 1px solid var(--gray-200); }
.video-solution-header svg { width: 16px; height: 16px; flex-shrink: 0; }
.problem-sidebar { display: flex; flex-direction: column; gap: 1rem; }
.answer-card { padding: 1.4rem; }
.answer-card-title { display: flex; align-items: center; gap: .55rem; font-size: 1rem; font-weight: 700; color: var(--blue); margin-bottom: 1.1rem; padding-bottom: .85rem; border-bottom: 1.5px solid var(--gray-100); }
.answer-card-title svg { width: 18px; height: 18px; }
.answer-input { font-size: 1rem; padding: .65rem 1rem; letter-spacing: .02em; }
.multi-answer-wrap { display: flex; flex-direction: column; gap: .5rem; }
.multi-answer-btns { display: flex; gap: .5rem; }
.multi-answer-btns .btn-secondary { flex: 1; justify-content: center; padding: .35rem .6rem; font-size: .8rem; }
.answer-submit-btn { width: 100%; justify-content: center; padding: .65rem; font-size: .92rem; gap: .5rem; }
.answer-submit-btn:disabled { opacity: .65; cursor: not-allowed; transform: none !important; }
.answer-result-wrap { margin-top: .75rem; }
.answer-result { display: flex; align-items: center; gap: .5rem; padding: .6rem .9rem; border-radius: 8px; font-weight: 600; font-size: .9rem; animation: resultPop .25s ease; }
.answer-result.success { background: var(--green-bg); color: var(--green); border: 1px solid #A7F3CA; }
.answer-result.error   { background: var(--red-bg);   color: var(--red);   border: 1px solid #FCA5A5; }
.answer-already-solved { display: flex; align-items: center; gap: .65rem; padding: 1rem; background: var(--green-bg); border: 1px solid #A7F3CA; border-radius: var(--radius); color: var(--green); font-weight: 700; font-size: .95rem; animation: fadeUp .3s ease; }
.answer-already-solved svg { width: 20px; height: 20px; flex-shrink: 0; }
.submissions-card { padding: 1.25rem; }
.submissions-title { display: flex; align-items: center; gap: .5rem; font-size: .92rem; font-weight: 700; color: var(--blue); margin-bottom: .85rem; padding-bottom: .75rem; border-bottom: 1.5px solid var(--gray-100); }
.submissions-title svg { width: 16px; height: 16px; }
.submissions-list { display: flex; flex-direction: column; gap: .4rem; }
.submission-row { display: flex; align-items: center; gap: .65rem; padding: .55rem .75rem; border-radius: 8px; font-size: .84rem; border: 1px solid var(--gray-100); }
.submission-row--ok { background: #F0FFF6; border-color: #C6F6D5; }
.submission-row--wa { background: #FFF5F5; border-color: #FCA5A5; }
.submission-verdict { width: 20px; height: 20px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.submission-row--ok .submission-verdict { background: var(--green-bg); color: var(--green); }
.submission-row--wa .submission-verdict { background: var(--red-bg);   color: var(--red); }
.submission-verdict svg { width: 11px; height: 11px; }
.submission-info { flex: 1; display: flex; flex-direction: column; gap: .1rem; min-width: 0; }
.submission-answer { font-family: 'JetBrains Mono', monospace; font-size: .8rem; font-weight: 600; color: var(--gray-800); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.submission-time   { font-size: .73rem; color: var(--gray-400); }
.submission-tag    { font-size: .73rem; font-weight: 700; flex-shrink: 0; }
.submission-row--ok .submission-tag { color: var(--green); }
.submission-row--wa .submission-tag { color: var(--red); }
.login-prompt { display: flex; flex-direction: column; align-items: center; text-align: center; gap: .85rem; padding: 1.75rem 1.25rem; }
.login-prompt svg { width: 36px; height: 36px; color: var(--gray-200); }
.login-prompt p { font-size: .9rem; color: var(--gray-400); line-height: 1.5; }
.login-prompt .btn { width: 100%; justify-content: center; }

/* ========== CONTESTS ========== */
.contests-section { margin-bottom: 2.5rem; }
.contests-section-label { display: flex; align-items: center; gap: .5rem; font-size: .8rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--gray-400); margin-bottom: 1rem; padding-bottom: .65rem; border-bottom: 1.5px solid var(--gray-100); }
.contests-section-label svg { width: 15px; height: 15px; }
.contests-section-label--active { color: var(--green); border-bottom-color: #C6F6D5; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.status-dot--live { background: var(--green); box-shadow: 0 0 0 3px rgba(27,138,76,.2); animation: pulse 1.5s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 3px rgba(27,138,76,.2); } 50% { box-shadow: 0 0 0 6px rgba(27,138,76,.05); } }
.contest-status { font-size: .72rem; font-weight: 700; padding: .18rem .55rem; border-radius: 20px; }
.contest-status--live     { background: #F0FFF4; color: var(--green); }
.contest-status--done     { background: var(--gray-100); color: var(--gray-400); }
.contest-status--upcoming { background: var(--accent); color: var(--blue); }
.contest-card--active { border-color: #A7F3CA; }
.contest-time-row { display: flex; align-items: center; gap: .4rem; font-size: .82rem; color: var(--gray-400); }
.contest-time-row svg { width: 14px; height: 14px; flex-shrink: 0; }
.contest-time-row .timer-value { font-weight: 700; color: var(--blue); font-family: 'JetBrains Mono', monospace; }
.contest-date-cell { color: var(--gray-400); font-size: .85rem; white-space: nowrap; }
.contest-type--sm { font-size: .72rem; padding: .13rem .45rem; }
.contest-header { margin-bottom: 2rem; padding-bottom: 1.5rem; border-bottom: 2px solid var(--gray-100); }
.contest-header-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; flex-wrap: wrap; gap: .5rem; }
.contest-header-badges { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.contest-desc-text { font-size: .97rem; color: var(--gray-600); line-height: 1.6; margin: .5rem 0 1.25rem; max-width: 680px; }
.contest-countdown { margin: 1.25rem 0; }
.countdown-label { font-size: .8rem; font-weight: 700; color: var(--gray-400); letter-spacing: .05em; text-transform: uppercase; margin-bottom: .6rem; }
.countdown-timer { display: flex; align-items: flex-end; gap: .3rem; }
.countdown-block { display: flex; flex-direction: column; align-items: center; background: var(--blue); border-radius: 8px; padding: .5rem .9rem; min-width: 64px; }
.cd-num { font-size: 1.9rem; font-weight: 700; color: var(--white); font-family: 'JetBrains Mono', monospace; line-height: 1; }
.cd-lbl { font-size: .65rem; color: rgba(255,255,255,.55); font-weight: 600; letter-spacing: .04em; margin-top: .2rem; }
.countdown-sep { font-size: 1.8rem; font-weight: 700; color: var(--blue); padding-bottom: .5rem; line-height: 1; }
.countdown-finished { display: inline-flex; align-items: center; gap: .5rem; padding: .6rem 1.1rem; background: var(--green-bg); color: var(--green); border: 1px solid #A7F3CA; border-radius: var(--radius); font-weight: 700; font-size: .95rem; }
.countdown-finished svg { width: 18px; height: 18px; }
.contest-reg-row { margin-top: 1.25rem; }
.contest-registered { display: inline-flex; align-items: center; gap: .5rem; padding: .55rem 1.1rem; background: var(--green-bg); color: var(--green); border: 1px solid #A7F3CA; border-radius: 8px; font-size: .9rem; font-weight: 700; }
.contest-registered svg { width: 16px; height: 16px; }

/* Кнопка регистрации — крупнее и заметнее */
.btn-reg-lg { font-size: 1.05rem; padding: .85rem 1.7rem; border-radius: 10px; box-shadow: var(--shadow); }
.btn-reg-lg svg { width: 18px; height: 18px; }

/* Кнопка «Правила игры» в шапке */
.rules-btn { display: inline-flex; align-items: center; gap: .4rem; padding: .4rem .85rem; border: 1.5px solid var(--gray-200); background: var(--white); color: var(--blue); border-radius: 20px; font-size: .82rem; font-weight: 700; cursor: pointer; transition: border-color var(--tr), background var(--tr); }
.rules-btn:hover { border-color: var(--accent-mid); background: var(--accent); }
.rules-btn svg { width: 15px; height: 15px; }

/* Модалка «Правила игры» */
.rules-modal { position: fixed; inset: 0; z-index: 1200; display: flex; align-items: center; justify-content: center; padding: 1.5rem; }
.rules-modal[hidden] { display: none; }
.rules-backdrop { position: absolute; inset: 0; background: rgba(15,28,54,.55); backdrop-filter: blur(2px); }
.rules-card { position: relative; z-index: 1; width: 100%; max-width: 560px; max-height: 85vh; overflow-y: auto; background: var(--white); border-radius: var(--radius-lg); padding: 1.75rem 1.85rem 1.85rem; box-shadow: var(--shadow-lg); animation: authCardIn .25s ease both; }
.rules-close { position: absolute; top: .9rem; right: 1rem; width: 32px; height: 32px; border: none; background: var(--gray-100); color: var(--gray-600); border-radius: 8px; font-size: 1.4rem; line-height: 1; cursor: pointer; transition: background var(--tr); }
.rules-close:hover { background: var(--gray-200); }
.rules-title { font-size: 1.25rem; color: var(--blue); margin: 0 2.5rem .9rem 0; }
.rules-body { font-size: .94rem; color: var(--gray-700); line-height: 1.6; }
.rules-body p { margin: 0 0 .8rem; }
.rules-body ul { margin: 0; padding-left: 1.3rem; display: flex; flex-direction: column; gap: .5rem; }
.rules-body li { padding-left: .15rem; }
.rules-body code { background: var(--off-white); border: 1px solid var(--gray-200); border-radius: 5px; padding: .05rem .3rem; font-family: 'JetBrains Mono', monospace; font-size: .85em; }
.marathon-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; align-items: start; }
.marathon-card-title { display: flex; align-items: center; gap: .55rem; font-size: .95rem; font-weight: 700; color: var(--blue); margin-bottom: 1rem; padding-bottom: .75rem; border-bottom: 1.5px solid var(--gray-100); }
.marathon-card-title svg { width: 17px; height: 17px; }
.marathon-problems { list-style: none; padding: 0; display: flex; flex-direction: column; gap: .4rem; }
.marathon-problem-link { display: flex; align-items: center; justify-content: space-between; padding: .6rem .85rem; border-radius: 8px; border: 1px solid var(--gray-200); font-weight: 600; color: var(--blue); font-size: .9rem; text-decoration: none; transition: background var(--tr), border-color var(--tr); }
.marathon-problem-link:hover { background: var(--accent); border-color: var(--accent-mid); text-decoration: none; }
.marathon-problem-link svg { width: 13px; height: 13px; color: var(--gray-400); flex-shrink: 0; }
.marathon-upload-hint { font-size: .85rem; color: var(--gray-400); margin-bottom: 1rem; line-height: 1.55; }
.marathon-upload-form { display: flex; flex-direction: column; gap: .75rem; }
.upload-area { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .5rem; padding: 2rem 1rem; border: 2px dashed var(--gray-200); border-radius: var(--radius-lg); cursor: pointer; transition: border-color var(--tr), background var(--tr); text-align: center; }
.upload-area:hover, .upload-area.drag-over { border-color: var(--blue); background: var(--accent); }
.upload-area svg { width: 32px; height: 32px; color: var(--gray-400); }
.upload-text { font-size: .9rem; font-weight: 600; color: var(--blue); }
.upload-sub  { font-size: .78rem; color: var(--gray-400); }
.upload-area input[type="file"] { display: none; }
.contest-main-layout { display: grid; grid-template-columns: 380px 1fr; gap: 1.5rem; align-items: start; }
/* Позволяем правому столбцу сжиматься, чтобы широкое табло скроллилось внутри карточки, а не растягивало страницу */
.contest-main-layout > .scoreboard-col { min-width: 0; }
.scoreboard-col .card { overflow: hidden; }
.contest-problems-title { display: flex; align-items: center; gap: .55rem; font-size: .95rem; font-weight: 700; color: var(--blue); margin-bottom: 1rem; padding-bottom: .75rem; border-bottom: 1.5px solid var(--gray-100); }
.contest-problems-title svg { width: 17px; height: 17px; }
.contest-problems-list { display: flex; flex-direction: column; gap: .5rem; }
.contest-problem-item { display: flex; gap: .85rem; padding: .85rem; border: 1px solid var(--gray-200); border-radius: var(--radius); transition: border-color var(--tr); }
.contest-problem-item:hover { border-color: var(--accent-mid); }
.contest-problem-num { width: 28px; height: 28px; border-radius: 50%; background: var(--blue); color: var(--white); font-size: .8rem; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; margin-top: .1rem; }
.contest-problem-body { flex: 1; min-width: 0; }
.contest-problem-name { font-weight: 600; font-size: .9rem; margin-bottom: .5rem; }
.contest-problem-name a { color: var(--blue); text-decoration: none; }
.contest-problem-name a:hover { text-decoration: underline; }
.contest-answer-row { display: flex; gap: .4rem; align-items: center; }
.contest-answer-input { flex: 1; padding: .38rem .7rem; font-size: .88rem; }
.contest-answer-result { display: block; font-size: .78rem; font-weight: 600; margin-top: .3rem; min-height: 1.2em; }
.contest-answer-result.success { color: var(--green); }
.contest-answer-result.error   { color: var(--red); }
.contest-problems-locked { display: flex; flex-direction: column; align-items: center; text-align: center; gap: .75rem; padding: 2.5rem 1rem; color: var(--gray-400); font-size: .9rem; }
.contest-problems-locked svg { width: 36px; height: 36px; color: var(--gray-200); }
.finished-problem-row { display: flex; align-items: center; gap: .6rem; padding: .5rem .7rem; border-radius: 7px; border: 1px solid var(--gray-100); }
.finished-problem-num { width: 22px; height: 22px; border-radius: 50%; background: var(--gray-100); color: var(--gray-400); font-size: .75rem; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.finished-problem-link { font-size: .88rem; font-weight: 600; color: var(--blue); }
.scoreboard-header { display: flex; align-items: center; gap: .55rem; font-size: .95rem; font-weight: 700; color: var(--blue); margin-bottom: 1rem; padding-bottom: .75rem; border-bottom: 1.5px solid var(--gray-100); }
.scoreboard-header svg { width: 17px; height: 17px; }
.live-badge { margin-left: auto; padding: .15rem .5rem; background: var(--green); color: var(--white); border-radius: 4px; font-size: .65rem; font-weight: 700; letter-spacing: .08em; animation: pulse 1.5s ease-in-out infinite; }
.scoreboard-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--gray-200); }
.scoreboard-table { font-size: .82rem; }
.sb-rank  { width: 36px; text-align: center; }
.sb-user  { min-width: 120px; }
.sb-prob  { width: 50px; text-align: center; }
.sb-bonus { width: 60px; text-align: center; }
.sb-score { width: 60px; text-align: center; font-weight: 700; }
.sb-row-me { background: var(--accent) !important; font-weight: 700; }
.sb-empty  { text-align: center; color: var(--gray-400); padding: 1.5rem; font-size: .88rem; }
.scoreboard-legend { display: flex; gap: .75rem; flex-wrap: wrap; margin-top: .85rem; padding-top: .85rem; border-top: 1px solid var(--gray-100); }
.sb-legend-item { padding: .2rem .65rem; border-radius: 20px; font-size: .74rem; font-weight: 600; }

/* ── Табло Пенальти ── */
.penalty-board { width: 100%; border-collapse: collapse; font-size: .82rem; }
/* Тонкие линии между всеми ячейками */
.penalty-board th, .penalty-board td { border: 1px solid var(--gray-200); padding: .4rem .3rem; text-align: center; white-space: nowrap; }
.penalty-board thead th { background: var(--blue); color: var(--white); font-weight: 700; font-size: .8rem; letter-spacing: 0; text-transform: none; padding: .45rem .3rem; }
.penalty-board .pb-user { min-width: 150px; text-align: left; padding-left: .6rem; }
.penalty-board .pb-tasknum { width: 38px; }
.penalty-board .pb-total { width: 52px; }
/* Строка актуальной стоимости — визуально отличается от номеров задач */
.penalty-board .pb-cost-row th { background: var(--accent); color: var(--blue); font-weight: 600; font-size: .76rem; font-style: italic; }
.penalty-board .pb-cost-label { text-align: right; padding-right: .5rem; font-style: normal; letter-spacing: .02em; }
.penalty-board tbody .pb-user { text-align: left; font-weight: 600; color: var(--gray-800); }
.penalty-board tbody .pb-total { font-weight: 800; color: var(--blue); }
.penalty-board tbody .pb-cell { font-weight: 700; }
.penalty-board .cell-empty { background: var(--white); }
.penalty-board tbody tr:hover { background: var(--off-white); }
.penalty-board tbody tr.sb-row-me { background: var(--accent) !important; }

/* PDF-врезка условий */
.pdf-embed { border: 1px solid var(--gray-200); border-radius: var(--radius); overflow: hidden; height: 460px; }
.pdf-embed iframe { width: 100%; height: 100%; border: 0; display: block; }

/* Форма сдачи Пенальти */
.penalty-submit-card { margin-top: 1.25rem; }
.penalty-submit-row { display: flex; gap: .5rem; align-items: stretch; flex-wrap: wrap; }
.penalty-task-select { flex: 0 0 130px; }
.penalty-submit-row .text-input:not(.penalty-task-select) { flex: 1 1 120px; }
.penalty-submit-note { margin-top: .55rem; font-size: .82rem; min-height: 1.1em; color: var(--gray-600); }
.penalty-submit-note.solved { color: var(--green); font-weight: 600; }
.penalty-submit-note.error { color: var(--red); font-weight: 600; }

/* Сетка 16 ответов в админ-форме игры */
.penalty-answers-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem .75rem; }
.penalty-answer-item { display: flex; align-items: center; gap: .4rem; }
.penalty-answer-item label { font-size: .8rem; font-weight: 700; color: var(--gray-400); min-width: 28px; white-space: nowrap; }
.penalty-answer-item .text-input { padding: .35rem .5rem; font-size: .85rem; }

/* ── Абака: табло ── */
.penalty-board .pb-bonus { width: 58px; }
.penalty-board thead .pb-bonus { color: var(--white); }
.penalty-board tbody .pb-bonus { font-weight: 800; color: var(--yellow); }
/* Жирная линия между блоками */
/* Жирная линия между блоками — только в шапке (до синей строки) */
.penalty-board thead th.pb-block-start { border-left: 3px solid var(--blue) !important; }

/* Карусель: подсвечивается сама цифра балла, а не фон ячейки. */
.carousel-board tbody .pb-cell { background: var(--white); font-weight: 800; }
.carousel-board tbody .cell-correct { color: var(--green); }
.carousel-board tbody .cell-wrong   { color: var(--red); }
.carousel-board tbody .cell-empty   { color: var(--gray-200); }
/* Текущая задача и сообщение о завершении в форме сдачи */
.carousel-current { font-size: 1rem; color: var(--gray-800); margin-bottom: .2rem; }
.carousel-current strong { color: var(--blue); font-weight: 800; }
.carousel-current-sep { color: var(--gray-300); margin: 0 .35rem; }
.carousel-done-msg { display: flex; align-items: center; gap: .5rem; padding: .9rem 1rem; color: var(--green); font-weight: 600; background: var(--green-bg, #F0FFF4); border-radius: 10px; }
.abaka-pos { color: var(--accent-mid); font-weight: 400; margin-left: .1rem; font-size: .85em; }

/* ── Абака: блоки в админ-форме ── */
.abaka-blocks { display: flex; flex-direction: column; gap: .6rem; margin-top: .4rem; }
.abaka-block { border: 1px solid var(--gray-200); border-radius: var(--radius); padding: .55rem .65rem; background: var(--off-white); }
.abaka-block-title { font-size: .78rem; font-weight: 700; color: var(--blue); margin-bottom: .45rem; }
.abaka-block-inputs { display: grid; grid-template-columns: repeat(4, 1fr); gap: .4rem .55rem; }
.abaka-block-btns { display: flex; gap: .5rem; margin-top: .6rem; }

/* ========== EDU ========== */
.edu-tabs { display: flex; gap: .4rem; margin-bottom: 1.75rem; border-bottom: 2px solid var(--gray-200); padding-bottom: 0; }
.edu-tab { display: inline-flex; align-items: center; gap: .45rem; padding: .6rem 1.1rem; border: none; background: transparent; color: var(--gray-400); font-family: inherit; font-size: .9rem; font-weight: 600; cursor: pointer; border-bottom: 2.5px solid transparent; margin-bottom: -2px; border-radius: 6px 6px 0 0; transition: color var(--tr), border-color var(--tr); }
.edu-tab svg { width: 15px; height: 15px; flex-shrink: 0; }
.edu-tab:hover { color: var(--blue); }
.edu-tab.active { color: var(--blue); border-bottom-color: var(--blue); }
.edu-tab-count { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 5px; background: var(--accent); color: var(--blue); border-radius: 10px; font-size: .72rem; font-weight: 700; transition: background var(--tr), color var(--tr); }
.edu-tab.active .edu-tab-count { background: var(--blue); color: var(--white); }
.edu-tab-content { display: none; animation: fadeUp .2s ease; }
.edu-tab-content.active { display: block; }
.courses-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.25rem; }
.course-card { display: flex; gap: 1.1rem; background: var(--white); border: 1px solid var(--gray-200); border-radius: var(--radius-lg); padding: 1.4rem; text-decoration: none; transition: box-shadow var(--tr), transform var(--tr), border-color var(--tr); box-shadow: var(--shadow); }
.course-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); border-color: var(--accent-mid); text-decoration: none; }
.course-card-icon { width: 48px; height: 48px; border-radius: 12px; background: var(--accent); display: flex; align-items: center; justify-content: center; flex-shrink: 0; color: var(--blue); }
.course-card-icon svg { width: 24px; height: 24px; }
.course-card-icon--local { background: #FFF5F0; color: #C05621; }
.course-card-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .5rem; }
.course-card-top { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.course-type-badge { display: inline-flex; padding: .16rem .55rem; border-radius: 20px; font-size: .72rem; font-weight: 700; letter-spacing: .02em; }
.course-type-badge--open  { background: var(--accent); color: var(--blue); border: 1px solid var(--accent-mid); }
.course-type-badge--local { background: #FFF5F0; color: #C05621; border: 1px solid #FED7B0; }
.course-author { font-size: .76rem; color: var(--gray-400); font-weight: 500; margin-left: auto; }
.course-card-title { font-size: 1rem; font-weight: 700; color: var(--blue); line-height: 1.3; }
.course-card-desc  { font-size: .85rem; color: var(--gray-600); line-height: 1.55; flex: 1; }
.course-card-footer { display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding-top: .5rem; border-top: 1px solid var(--gray-100); }
.course-topics-count { display: flex; align-items: center; gap: .35rem; font-size: .78rem; color: var(--gray-400); font-weight: 500; }
.course-topics-count svg { width: 13px; height: 13px; }
.course-arrow { font-size: .78rem; font-weight: 700; color: var(--blue-light); }
.course-header { margin-bottom: 2rem; padding-bottom: 1.5rem; border-bottom: 2px solid var(--gray-100); }
.course-header-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; flex-wrap: wrap; gap: .5rem; }
.course-full-desc { font-size: .97rem; color: var(--gray-600); line-height: 1.65; margin: .5rem 0 1rem; max-width: 680px; }
.course-author-row { display: flex; align-items: center; gap: .6rem; font-size: .88rem; font-weight: 600; color: var(--gray-600); }
.course-author-avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--accent); display: flex; align-items: center; justify-content: center; font-size: .78rem; font-weight: 700; color: var(--blue); flex-shrink: 0; }
.course-detail-layout { display: grid; grid-template-columns: 1fr 380px; gap: 1.75rem; align-items: start; }
.course-section-title { display: flex; align-items: center; gap: .55rem; font-size: .95rem; font-weight: 700; color: var(--blue); margin-bottom: 1.1rem; padding-bottom: .75rem; border-bottom: 1.5px solid var(--gray-100); }
.course-section-title svg { width: 17px; height: 17px; }
.course-topics-list { display: flex; flex-direction: column; gap: .65rem; }
.course-topic-card { display: flex; gap: .85rem; padding: 1.1rem; background: var(--white); border: 1px solid var(--gray-200); border-radius: var(--radius-lg); box-shadow: var(--shadow); transition: border-color var(--tr), box-shadow var(--tr); }
.course-topic-card:hover { border-color: var(--accent-mid); box-shadow: var(--shadow-lg); }
.course-topic-num { width: 32px; height: 32px; border-radius: 8px; background: var(--blue); color: var(--white); font-size: .85rem; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.course-topic-body { flex: 1; min-width: 0; }
.course-topic-name { font-weight: 700; font-size: .95rem; color: var(--blue); margin-bottom: .6rem; line-height: 1.3; }
.course-topic-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.course-topic-btn { display: inline-flex; align-items: center; gap: .4rem; padding: .32rem .75rem; border-radius: 7px; font-size: .8rem; font-weight: 700; text-decoration: none; transition: background var(--tr), transform var(--tr); }
.course-topic-btn svg { width: 13px; height: 13px; }
.course-topic-btn--theory   { background: var(--accent); color: var(--blue); border: 1px solid var(--accent-mid); }
.course-topic-btn--theory:hover   { background: var(--accent-mid); text-decoration: none; transform: translateY(-1px); }
.course-topic-btn--practice { background: var(--blue); color: var(--white); border: 1px solid var(--blue); }
.course-topic-btn--practice:hover { background: var(--blue-light); text-decoration: none; transform: translateY(-1px); }
.topic-problems-cnt { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; background: rgba(255,255,255,.25); border-radius: 9px; font-size: .68rem; padding: 0 4px; }
.course-rating-col .card { padding: 1.25rem; }
.rating-user-name { font-weight: 600; font-size: .86rem; color: var(--gray-800); }
.score-positive { color: var(--green); font-weight: 700; }
.topic-header { margin-bottom: 2rem; padding-bottom: 1.5rem; border-bottom: 2px solid var(--gray-100); }
.topic-breadcrumb { display: flex; align-items: center; gap: .35rem; margin-bottom: 1rem; flex-wrap: wrap; }
.topic-breadcrumb svg { width: 13px; height: 13px; color: var(--gray-400); flex-shrink: 0; }
.breadcrumb-link { font-size: .82rem; font-weight: 600; color: var(--gray-400); text-decoration: none; transition: color var(--tr); }
.breadcrumb-link:hover { color: var(--blue); text-decoration: none; }
.breadcrumb-current { font-size: .82rem; font-weight: 700; color: var(--blue); }
.topic-header-main { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.topic-label { display: inline-flex; align-items: center; gap: .4rem; padding: .22rem .7rem; background: var(--accent); color: var(--blue); border: 1px solid var(--accent-mid); border-radius: 20px; font-size: .74rem; font-weight: 700; letter-spacing: .02em; margin-bottom: .5rem; }
.topic-label svg { width: 13px; height: 13px; }
.topic-label--practice { background: #F0FFF4; color: var(--green); border-color: #A7F3CA; }
.topic-practice-btn, .topic-theory-btn { align-self: center; white-space: nowrap; }
.theory-content { padding: 2rem; font-size: 1rem; line-height: 1.8; color: var(--gray-800); margin-bottom: 1.5rem; }
.theory-content h2 { font-size: 1.25rem; font-weight: 700; color: var(--blue); margin: 1.5rem 0 .75rem; }
.theory-content h3 { font-size: 1.05rem; font-weight: 700; color: var(--blue); margin: 1rem 0 .5rem; }
.theory-content p  { margin-bottom: .85rem; }
.theory-content blockquote { border-left: 4px solid var(--accent-mid); padding: .75rem 1.25rem; margin: 1rem 0; background: var(--accent); border-radius: 0 var(--radius) var(--radius) 0; color: var(--blue); font-style: italic; }
.theory-content code { font-family: 'JetBrains Mono', monospace; font-size: .88em; background: var(--gray-100); padding: .1rem .35rem; border-radius: 4px; color: var(--blue); }
/* Списки теории и условий задач: маркеры/номера у левого края, текст с отступом
   (глобальный reset обнуляет padding у ul/ol — иначе маркеры вылезают за абзац). */
.theory-content ul, .theory-content ol,
.problem-statement-content ul, .problem-statement-content ol { margin: 0 0 .85rem; padding-left: 1.6em; }
.theory-content li, .problem-statement-content li { margin-bottom: .3rem; }
.theory-content sub, .theory-content sup,
.problem-statement-content sub, .problem-statement-content sup { font-size: .75em; }
.theory-video-block { margin-bottom: 1.5rem; }
.theory-video-title { display: flex; align-items: center; gap: .55rem; font-size: .9rem; font-weight: 700; color: var(--blue); margin-bottom: .75rem; }
.theory-video-title svg { width: 16px; height: 16px; }
.topic-nav { display: flex; gap: .75rem; margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid var(--gray-200); flex-wrap: wrap; }
.topic-nav a { display: inline-flex; align-items: center; gap: .4rem; }
.topic-nav a svg { width: 16px; height: 16px; }
.practice-stats { display: flex; gap: 1.5rem; margin-bottom: 1.25rem; }
.practice-problems-list { display: flex; flex-direction: column; gap: .6rem; }
.practice-problem-card { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 1.25rem; background: var(--white); border: 1px solid var(--gray-200); border-radius: var(--radius-lg); box-shadow: var(--shadow); transition: border-color var(--tr), box-shadow var(--tr); }
.practice-problem-card:hover { border-color: var(--accent-mid); box-shadow: var(--shadow-lg); }
.practice-problem-left  { display: flex; align-items: center; gap: .85rem; flex: 1; min-width: 0; }
.practice-problem-num   { width: 30px; height: 30px; border-radius: 50%; background: var(--blue); color: var(--white); font-size: .8rem; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.practice-problem-info  { flex: 1; min-width: 0; }
.practice-problem-title { font-weight: 700; font-size: .95rem; margin-bottom: .35rem; }
.practice-problem-meta  { display: flex; align-items: center; flex-wrap: wrap; gap: .25rem; }
.practice-problem-right { display: flex; align-items: center; gap: .5rem; flex-shrink: 0; }
.practice-video-btn { display: inline-flex; align-items: center; gap: .35rem; }
.practice-video-btn svg { width: 13px; height: 13px; }

/* ========== PROFILE ========== */
.profile-page { display: grid; grid-template-columns: 340px 1fr; gap: 1.75rem; align-items: start; }
.profile-left-col { display: flex; flex-direction: column; gap: 1rem; }
.profile-avatar-card { padding: 1.75rem 1.5rem; }
.avatar-upload-wrap { position: relative; display: flex; justify-content: center; margin-bottom: 1.25rem; }
.avatar-large { width: 110px; height: 110px; border-radius: 50%; overflow: hidden; border: 3px solid var(--accent-mid); flex-shrink: 0; }
.avatar-large-img { width: 100%; height: 100%; object-fit: cover; }
.avatar-large-placeholder { width: 100%; height: 100%; background: var(--accent); display: flex; align-items: center; justify-content: center; font-size: 2.8rem; font-weight: 700; color: var(--blue); }
.avatar-upload-btn { position: absolute; bottom: 0; right: calc(50% - 62px); width: 30px; height: 30px; border-radius: 50%; background: var(--blue); color: var(--white); display: flex; align-items: center; justify-content: center; cursor: pointer; border: 2px solid var(--white); transition: background var(--tr), transform var(--tr); box-shadow: var(--shadow); }
.avatar-upload-btn:hover { background: var(--blue-light); transform: scale(1.1); }
.avatar-upload-btn svg { width: 14px; height: 14px; }
.profile-name-display { text-align: center; margin-bottom: 1.5rem; }
.profile-full-name { display: block; font-size: 1.15rem; font-weight: 700; color: var(--blue); line-height: 1.2; margin-bottom: .2rem; }
.profile-email { display: block; font-size: .82rem; color: var(--gray-400); }
.profile-fields { display: flex; flex-direction: column; gap: .75rem; margin-bottom: 1.25rem; }
.profile-field-row { display: grid; grid-template-columns: 1fr 1fr; gap: .65rem; }
.profile-field-row .form-group, .profile-fields .form-group { margin-bottom: 0; }
.profile-fields label { font-size: .8rem; font-weight: 700; color: var(--gray-400); letter-spacing: .04em; text-transform: uppercase; margin-bottom: .3rem; }
.profile-fields .text-input { padding: .5rem .85rem; font-size: .92rem; }
.profile-fields .text-input[readonly] { background: var(--off-white); color: var(--gray-400); cursor: not-allowed; }
.profile-fields .input-wrap .text-input { padding-left: 2.3rem; }
.profile-save-btn { width: 100%; justify-content: center; padding: .65rem; font-size: .92rem; }
.profile-save-btn svg { width: 16px; height: 16px; }
.profile-right-col { display: flex; flex-direction: column; gap: 1.25rem; }
.profile-stats-card { padding: 1.25rem 1.5rem; }
.profile-stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.profile-stat { display: flex; align-items: center; gap: .75rem; padding: .85rem 1rem; background: var(--off-white); border-radius: var(--radius); border: 1px solid var(--gray-100); }
.profile-stat-icon { width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.profile-stat-icon svg { width: 20px; height: 20px; }
.profile-stat-icon--rating   { background: #FFF8E6; color: var(--yellow); }
.profile-stat-icon--solved   { background: var(--green-bg); color: var(--green); }
.profile-stat-icon--accuracy { background: var(--accent); color: var(--blue); }
.profile-stat-body { display: flex; flex-direction: column; }
.profile-stat-val { font-size: 1.4rem; font-weight: 700; color: var(--blue); line-height: 1; font-variant-numeric: tabular-nums; }
.profile-stat-lbl { font-size: .72rem; color: var(--gray-400); font-weight: 500; margin-top: .15rem; }
.profile-activity-card { padding: 1.25rem 1.5rem; }
.profile-section-title { display: flex; align-items: center; gap: .5rem; font-size: .92rem; font-weight: 700; color: var(--blue); margin-bottom: 1rem; padding-bottom: .65rem; border-bottom: 1.5px solid var(--gray-100); }
.profile-section-title svg { width: 16px; height: 16px; }
.activity-range-btns { display: flex; gap: .3rem; margin-bottom: .85rem; }
.activity-range-btn { padding: .28rem .75rem; border-radius: 20px; border: 1.5px solid var(--gray-200); background: var(--white); color: var(--gray-600); font-family: inherit; font-size: .78rem; font-weight: 600; cursor: pointer; transition: background var(--tr), border-color var(--tr), color var(--tr); }
.activity-range-btn:hover { border-color: var(--blue); color: var(--blue); }
.activity-range-btn.active { background: var(--blue); border-color: var(--blue); color: var(--white); }
.activity-chart-wrap { position: relative; width: 100%; }
#activity-chart { display: block; width: 100%; height: 140px; border-radius: var(--radius); }
.activity-empty { text-align: center; color: var(--gray-400); font-size: .88rem; padding: 2rem; }
.achievements-list { display: flex; flex-direction: column; gap: .5rem; }
.achievement-item { display: flex; align-items: center; gap: .75rem; padding: .65rem .85rem; background: var(--off-white); border-radius: var(--radius); border: 1px solid var(--gray-100); transition: border-color var(--tr); }
.achievement-item:hover { border-color: var(--accent-mid); }
.achievement-icon  { font-size: 1.4rem; flex-shrink: 0; line-height: 1; }
.achievement-body  { display: flex; flex-direction: column; gap: .1rem; flex: 1; min-width: 0; }
.achievement-title { font-weight: 700; font-size: .9rem; color: var(--blue); }
.achievement-desc  { font-size: .78rem; color: var(--gray-400); line-height: 1.4; }
.achievement-date  { font-size: .74rem; color: var(--gray-400); white-space: nowrap; flex-shrink: 0; }

/* ========== RATING ========== */
.rating-search-wrap { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.75rem; }
.rating-search-input-wrap { position: relative; flex: 1; max-width: 420px; }
.rating-search-icon { position: absolute; left: .85rem; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--gray-400); pointer-events: none; }
.rating-search-input { width: 100%; padding: .6rem 2.5rem .6rem 3rem; border: 1.5px solid var(--gray-200); border-radius: 10px; font-family: inherit; font-size: .92rem; color: var(--gray-800); background: var(--white); outline: none; transition: border-color var(--tr), box-shadow var(--tr); }
.rating-search-input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(46,49,146,.1); }
.rating-search-clear { position: absolute; right: .65rem; top: 50%; transform: translateY(-50%); background: none; border: none; color: var(--gray-400); cursor: pointer; padding: 2px; display: flex; align-items: center; transition: color var(--tr); }
.rating-search-clear:hover { color: var(--blue); }
.rating-search-clear svg { width: 14px; height: 14px; }
.rating-search-count { font-size: .85rem; color: var(--gray-400); font-weight: 500; white-space: nowrap; }
.rating-podium { display: flex; align-items: flex-end; justify-content: center; gap: 0; margin-bottom: 2.5rem; padding: 0 1rem; }
.podium-item { display: flex; flex-direction: column; align-items: center; gap: .3rem; position: relative; flex: 1; max-width: 200px; }
.podium-crown { font-size: 1.6rem; line-height: 1; margin-bottom: .15rem; animation: crownBob 2s ease-in-out infinite; }
@keyframes crownBob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
.podium-avatar { border-radius: 50%; overflow: hidden; display: flex; align-items: center; justify-content: center; font-weight: 700; border: 3px solid var(--white); box-shadow: var(--shadow-lg); flex-shrink: 0; }
.podium-avatar img { width: 100%; height: 100%; object-fit: cover; }
.podium-avatar--1 { width: 72px; height: 72px; font-size: 1.8rem; background: linear-gradient(135deg, #FFD700, #FFA500); color: var(--white); border-color: #FFD700; }
.podium-avatar--2 { width: 60px; height: 60px; font-size: 1.5rem; background: linear-gradient(135deg, #C0C0C0, #A8A8A8); color: var(--white); border-color: #C0C0C0; }
.podium-avatar--3 { width: 56px; height: 56px; font-size: 1.4rem; background: linear-gradient(135deg, #CD7F32, #A0522D); color: var(--white); border-color: #CD7F32; }
.podium-medal  { font-size: 1.2rem; line-height: 1; }
.podium-name   { font-size: .82rem; font-weight: 700; color: var(--blue); text-align: center; max-width: 130px; line-height: 1.2; }
.podium-rating { font-size: .9rem; font-weight: 700; color: var(--gray-600); font-variant-numeric: tabular-nums; }
.podium-block  { width: 100%; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; font-weight: 700; color: rgba(255,255,255,.7); border-radius: var(--radius) var(--radius) 0 0; margin-top: .5rem; }
.podium-block--1 { height: 80px; background: linear-gradient(180deg, #F6C340 0%, #E5A800 100%); box-shadow: 0 -4px 20px rgba(230,168,0,.3); }
.podium-block--2 { height: 60px; background: linear-gradient(180deg, #C8C8C8 0%, #A8A8A8 100%); box-shadow: 0 -4px 16px rgba(168,168,168,.25); }
.podium-block--3 { height: 44px; background: linear-gradient(180deg, #D4905A 0%, #B5722A 100%); box-shadow: 0 -4px 14px rgba(181,114,42,.25); }
.col-rank        { width: 60px; text-align: center; }
.col-rating-val  { width: 160px; }
.col-solved-cnt  { width: 90px; text-align: center; }
.col-accuracy-rt { width: 140px; }
.rank-medal { font-size: 1.2rem; line-height: 1; }
.rank-num   { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%; background: var(--gray-100); color: var(--gray-400); font-size: .82rem; font-weight: 700; }
.rating-row { opacity: 0; transform: translateY(8px); transition: opacity .3s ease, transform .3s ease, background var(--tr); }
.rating-row.row-visible { opacity: 1; transform: none; }
.rating-row--me { background: var(--accent) !important; }
.rating-row--me td:first-child { border-left: 3px solid var(--blue); }
.rating-user-row { display: flex; align-items: center; gap: .75rem; }
.rating-avatar { width: 36px; height: 36px; border-radius: 50%; overflow: hidden; background: var(--accent); display: flex; align-items: center; justify-content: center; font-size: .88rem; font-weight: 700; color: var(--blue); flex-shrink: 0; border: 1.5px solid var(--gray-200); }
.rating-avatar img { width: 100%; height: 100%; object-fit: cover; }
.rating-user-info { display: flex; flex-direction: column; gap: .1rem; }
.rating-user-name-cell { font-weight: 700; font-size: .92rem; color: var(--blue); display: flex; align-items: center; gap: .4rem; }
.rating-you-badge { display: inline-flex; padding: .1rem .45rem; background: var(--blue); color: var(--white); border-radius: 20px; font-size: .65rem; font-weight: 700; letter-spacing: .03em; }
.rating-user-sub  { font-size: .76rem; color: var(--gray-400); }
.rating-bar-wrap  { display: flex; align-items: center; gap: .5rem; }
.rating-val-num   { font-weight: 700; font-size: .95rem; color: var(--blue); min-width: 36px; font-variant-numeric: tabular-nums; }
.rating-mini-bar  { flex: 1; height: 5px; background: var(--gray-100); border-radius: 3px; overflow: hidden; }
.rating-mini-fill { height: 100%; background: linear-gradient(90deg, var(--blue-light), var(--blue)); border-radius: 3px; transition: width .6s ease; max-width: 100%; }
.rating-no-results { margin-top: 1rem; }

/* ========== NOTIFICATIONS ========== */
.notif-header-actions { display: flex; gap: .5rem; align-items: center; }
.notif-filter-tabs { display: flex; gap: .35rem; margin-bottom: 1.25rem; border-bottom: 2px solid var(--gray-200); padding-bottom: 0; }
.notif-filter-btn { display: inline-flex; align-items: center; gap: .45rem; padding: .52rem 1rem; border: none; background: transparent; color: var(--gray-400); font-family: inherit; font-size: .88rem; font-weight: 600; cursor: pointer; border-bottom: 2.5px solid transparent; margin-bottom: -2px; border-radius: 6px 6px 0 0; transition: color var(--tr), border-color var(--tr); }
.notif-filter-btn:hover { color: var(--blue); }
.notif-filter-btn.active { color: var(--blue); border-bottom-color: var(--blue); }
.notif-filter-count { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 5px; background: var(--gray-100); color: var(--gray-600); border-radius: 10px; font-size: .72rem; font-weight: 700; transition: background var(--tr), color var(--tr); }
.notif-filter-btn.active .notif-filter-count { background: var(--blue); color: var(--white); }
.notif-list { display: flex; flex-direction: column; gap: .5rem; }
.notif-item { display: flex; align-items: flex-start; gap: 1rem; padding: 1rem 1.25rem; background: var(--white); border: 1px solid var(--gray-200); border-radius: var(--radius-lg); box-shadow: var(--shadow); transition: border-color var(--tr), box-shadow var(--tr), background var(--tr); }
.notif-item:hover { border-color: var(--accent-mid); box-shadow: var(--shadow-lg); }
.notif-item--unread { background: var(--accent); border-color: var(--accent-mid); }
.notif-item--unread:hover { background: #E4E1F8; border-color: var(--blue); }
.notif-icon-wrap { position: relative; flex-shrink: 0; margin-top: .1rem; }
.notif-icon { width: 38px; height: 38px; border-radius: 10px; background: var(--white); border: 1.5px solid var(--gray-200); display: flex; align-items: center; justify-content: center; color: var(--blue); }
.notif-item--unread .notif-icon { background: var(--blue); border-color: var(--blue); color: var(--white); }
.notif-icon svg { width: 17px; height: 17px; }
.notif-unread-dot { position: absolute; top: -3px; right: -3px; width: 10px; height: 10px; border-radius: 50%; background: #E53E3E; border: 2px solid var(--accent); }
.notif-content { flex: 1; min-width: 0; }
.notif-message { font-size: .92rem; font-weight: 500; color: var(--gray-800); line-height: 1.5; margin-bottom: .35rem; }
.notif-item--unread .notif-message { font-weight: 600; color: var(--blue-dark); }
.notif-meta { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.notif-time { display: flex; align-items: center; gap: .3rem; font-size: .76rem; color: var(--gray-400); font-weight: 500; }
.notif-time svg { width: 12px; height: 12px; flex-shrink: 0; }
.notif-unread-label { display: inline-flex; padding: .1rem .45rem; background: var(--blue); color: var(--white); border-radius: 20px; font-size: .65rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.notif-actions { display: flex; align-items: center; gap: .4rem; flex-shrink: 0; }
.notif-action-btn { width: 32px; height: 32px; border-radius: 8px; border: 1.5px solid var(--gray-200); background: var(--white); display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--gray-400); text-decoration: none; transition: background var(--tr), border-color var(--tr), color var(--tr), transform var(--tr); }
.notif-action-btn:hover { transform: scale(1.08); text-decoration: none; }
.notif-action-btn svg { width: 14px; height: 14px; }
.notif-action-btn--link:hover  { background: var(--accent); border-color: var(--accent-mid); color: var(--blue); }
.notif-action-btn--check:hover { background: var(--green-bg); border-color: #A7F3CA; color: var(--green); }
.notif-empty-filter { margin-top: 1.5rem; }
.notif-all-empty { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 5rem 2rem; gap: 1rem; }
.notif-all-empty-icon { width: 80px; height: 80px; border-radius: 50%; background: var(--off-white); border: 2px solid var(--gray-200); display: flex; align-items: center; justify-content: center; margin-bottom: .5rem; }
.notif-all-empty-icon svg { width: 36px; height: 36px; color: var(--gray-400); }
.notif-all-empty-title { font-size: 1.4rem; font-weight: 700; color: var(--blue); }
.notif-all-empty-text  { font-size: .95rem; color: var(--gray-400); max-width: 360px; line-height: 1.6; }
.notif-all-empty-actions { display: flex; gap: .75rem; flex-wrap: wrap; justify-content: center; margin-top: .5rem; }

/* ========== ADMIN PANEL ========== */
.ap-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 2rem; padding-bottom: 1.5rem; border-bottom: 2px solid var(--gray-100); flex-wrap: wrap; gap: 1rem; }
.ap-header-label { display: inline-flex; align-items: center; gap: .4rem; font-size: .75rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--gray-400); margin-bottom: .4rem; }
.ap-header-label svg { width: 13px; height: 13px; }
.ap-django-admin-link { display: inline-flex; align-items: center; gap: .4rem; white-space: nowrap; }
.ap-django-admin-link svg { width: 14px; height: 14px; }
.ap-stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 2rem; }
.ap-stat-card { background: var(--white); border: 1px solid var(--gray-200); border-radius: var(--radius-lg); padding: 1.25rem 1.4rem; display: flex; align-items: center; gap: 1rem; box-shadow: var(--shadow); transition: box-shadow var(--tr), border-color var(--tr); }
.ap-stat-card:hover { box-shadow: var(--shadow-lg); border-color: var(--accent-mid); }
.ap-stat-card--alert { border-color: #FCA5A5; background: #FFF5F5; }
.ap-stat-icon { width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.ap-stat-icon svg { width: 22px; height: 22px; }
.ap-stat-icon--users    { background: var(--accent); color: var(--blue); }
.ap-stat-icon--problems { background: #F0FFF4; color: var(--green); }
.ap-stat-icon--contests { background: #FFF8E6; color: var(--yellow); }
.ap-stat-icon--marathon { background: var(--red-bg); color: var(--red); }
.ap-stat-body { display: flex; flex-direction: column; gap: .1rem; }
.ap-stat-val { font-size: 1.8rem; font-weight: 700; color: var(--blue); line-height: 1; font-variant-numeric: tabular-nums; }
.ap-stat-lbl { font-size: .82rem; font-weight: 600; color: var(--gray-600); }
.ap-stat-sub { font-size: .74rem; color: var(--gray-400); }
.ap-stat-sub--live { color: var(--green); font-weight: 600; }
.ap-section-title { display: flex; align-items: center; gap: .5rem; font-size: .8rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--gray-400); margin-bottom: 1rem; padding-bottom: .65rem; border-bottom: 1.5px solid var(--gray-100); }
.ap-section-title svg { width: 14px; height: 14px; }
.ap-actions-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-bottom: 2.5rem; }
.ap-action-card { display: flex; align-items: center; gap: 1rem; padding: 1.1rem 1.25rem; background: var(--white); border: 1px solid var(--gray-200); border-radius: var(--radius-lg); text-decoration: none; box-shadow: var(--shadow); transition: box-shadow var(--tr), transform var(--tr), border-color var(--tr); position: relative; }
.ap-action-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); border-color: var(--accent-mid); text-decoration: none; }
.ap-action-card--alert { border-color: #FCA5A5; }
.ap-action-card--alert:hover { border-color: var(--red); }
.ap-action-card--muted { background: var(--off-white); }
.ap-action-icon { width: 44px; height: 44px; border-radius: 11px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.ap-action-icon svg { width: 20px; height: 20px; }
.ap-action-icon--blue   { background: var(--accent); color: var(--blue); }
.ap-action-icon--orange { background: #FFF5F0; color: #C05621; }
.ap-action-icon--green  { background: var(--green-bg); color: var(--green); }
.ap-action-icon--red    { background: var(--red-bg); color: var(--red); }
.ap-action-icon--purple { background: #FAF5FF; color: #6B21A8; }
.ap-action-icon--gray   { background: var(--gray-100); color: var(--gray-600); }
.ap-action-body { flex: 1; min-width: 0; }
.ap-action-title { display: block; font-size: .95rem; font-weight: 700; color: var(--blue); margin-bottom: .2rem; }
.ap-action-desc  { display: block; font-size: .78rem; color: var(--gray-400); line-height: 1.4; }
.ap-action-count { font-size: 1.1rem; font-weight: 700; color: var(--gray-400); background: var(--gray-100); min-width: 36px; height: 36px; border-radius: 8px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-variant-numeric: tabular-nums; }
.ap-action-count--alert { background: var(--red-bg); color: var(--red); }
.ap-bottom-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.25rem; margin-bottom: 1.5rem; }
.ap-bottom-grid > .card { min-width: 0; }
.ap-table-card { padding: 1.25rem; }
.ap-table-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; padding-bottom: .75rem; border-bottom: 1.5px solid var(--gray-100); }
.ap-table-title { display: flex; align-items: center; gap: .45rem; font-size: .9rem; font-weight: 700; color: var(--blue); }
.ap-table-title svg { width: 15px; height: 15px; }
.ap-table-link { font-size: .8rem; font-weight: 700; color: var(--blue-light); text-decoration: none; }
.ap-table-link:hover { text-decoration: underline; }
.ap-users-list { display: flex; flex-direction: column; gap: .5rem; }
.ap-user-row { display: flex; align-items: center; gap: .65rem; padding: .45rem .5rem; border-radius: 8px; transition: background var(--tr); }
.ap-user-row:hover { background: var(--off-white); }
.ap-user-avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--accent); display: flex; align-items: center; justify-content: center; font-size: .75rem; font-weight: 700; color: var(--blue); flex-shrink: 0; overflow: hidden; border: 1.5px solid var(--gray-200); }
.ap-user-avatar img { width: 100%; height: 100%; object-fit: cover; }
.ap-user-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .05rem; }
.ap-user-name  { font-size: .85rem; font-weight: 600; color: var(--blue); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ap-user-email { font-size: .73rem; color: var(--gray-400); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ap-user-meta  { display: flex; align-items: center; gap: .3rem; flex-shrink: 0; }
.ap-user-date  { font-size: .73rem; color: var(--gray-400); }
.ap-badge { display: inline-flex; padding: .1rem .45rem; border-radius: 20px; font-size: .65rem; font-weight: 700; letter-spacing: .03em; }
.ap-badge--admin    { background: var(--accent); color: var(--blue); }
.ap-badge--inactive { background: var(--gray-100); color: var(--gray-400); }
.ap-badge--blocked  { background: var(--red-bg); color: var(--red); }
.ap-contests-list { display: flex; flex-direction: column; gap: .5rem; }
.ap-contest-row { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .5rem; border-radius: 8px; transition: background var(--tr); }
.ap-contest-row:hover { background: var(--off-white); }
.ap-contest-left { display: flex; align-items: center; gap: .5rem; min-width: 0; }
.ap-contest-name { font-size: .85rem; font-weight: 600; color: var(--blue); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ap-contest-right { flex-shrink: 0; }
.ap-contest-timer { font-size: .78rem; font-weight: 700; color: var(--green); font-family: 'JetBrains Mono', monospace; }
.ap-marathon-list { display: flex; flex-direction: column; gap: .5rem; }
.ap-marathon-row { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .5rem; border-radius: 8px; background: var(--off-white); border: 1px solid var(--gray-100); }
.ap-marathon-info { display: flex; flex-direction: column; gap: .05rem; min-width: 0; }
.ap-marathon-user    { font-size: .85rem; font-weight: 600; color: var(--blue); }
.ap-marathon-contest { font-size: .73rem; color: var(--gray-400); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ap-marathon-meta { display: flex; align-items: center; gap: .5rem; flex-shrink: 0; }
.ap-marathon-date { font-size: .73rem; color: var(--gray-400); }
.ap-empty { font-size: .85rem; color: var(--gray-400); text-align: center; padding: 1rem; }
.ap-empty-block { display: flex; flex-direction: column; align-items: center; gap: .5rem; padding: 2rem 1rem; color: var(--gray-400); font-size: .88rem; text-align: center; }
.ap-empty-block svg { width: 32px; height: 32px; color: var(--gray-200); }
.ap-activity-card { padding: 1.25rem; }
#ap-activity-chart { display: block; width: 100%; }

/* ========== RESPONSIVE ========== */
@media (max-width: 900px) {
    .nav-links { display: none; }
    .burger    { display: flex; }
    .user-name-text { display: none; }
    /* Иконка уведомлений убрана из шапки — пункт «Уведомления» живёт в бургере */
    .notif-btn { display: none; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .footer-inner { grid-template-columns: 1fr 1fr; }
    .profile-page { grid-template-columns: 1fr; }
    .col-topics, .col-accuracy { display: none; }
    .problem-layout { grid-template-columns: 1fr; }
    .problem-sidebar { order: -1; }
    .contest-main-layout { grid-template-columns: 1fr; }
    .marathon-layout { grid-template-columns: 1fr; }
    .course-detail-layout { grid-template-columns: 1fr; }
    .ap-stats-grid { grid-template-columns: repeat(2, 1fr); }
    .ap-actions-grid { grid-template-columns: repeat(2, 1fr); }
    /* minmax(0,…) — чтобы карточки могли сжиматься и не вылезали за правый край */
    .ap-bottom-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .ap-bottom-grid > .card:last-child { grid-column: 1 / -1; }
    .formats-grid { grid-template-columns: 1fr 1fr; }
    .edu-promo-inner { grid-template-columns: 1fr; padding: 2rem; }
    .edu-promo-deco { display: none; }
}
@media (max-width: 600px) {
    :root { --nav-h: 56px; }
    .nav-inner { padding: 0 1rem; }
    .page-content { padding: 1.5rem 1rem 3.5rem; }
    .hero h1 { font-size: 2.4rem; }
    .stats-grid { grid-template-columns: 1fr; }
    .ap-bottom-grid { grid-template-columns: minmax(0, 1fr); }
    .footer-inner { grid-template-columns: 1fr; gap: 1.5rem; }
    .footer-copy { text-align: left; }
    .messages-container { left: 1rem; right: 1rem; max-width: none; }
    .col-diff { display: none; }
    .archive-legend { display: none; }
    .filters-panel { padding: 1rem; }
    .hero-section { padding: 3rem 1rem 2.5rem; }
    .contests-grid { grid-template-columns: 1fr; }
    .formats-grid  { grid-template-columns: 1fr; }
    .hero-actions  { flex-direction: column; align-items: center; }
    .btn-hero, .btn-hero-sec { width: 100%; max-width: 300px; justify-content: center; }
    .countdown-block { min-width: 52px; padding: .4rem .6rem; }
    .cd-num { font-size: 1.5rem; }
    .profile-stats-grid { grid-template-columns: 1fr 1fr; }
    .profile-field-row { grid-template-columns: 1fr; }
    .rating-podium { gap: 0; }
    .podium-avatar--1 { width: 58px; height: 58px; }
    .podium-avatar--2 { width: 48px; height: 48px; }
    .podium-avatar--3 { width: 44px; height: 44px; }
    .rating-search-wrap { flex-direction: column; align-items: stretch; }
    .rating-search-input-wrap { max-width: none; }
    .notif-item { padding: .85rem 1rem; gap: .75rem; }
    .ap-stats-grid   { grid-template-columns: 1fr 1fr; }
    .ap-actions-grid { grid-template-columns: 1fr; }
    .ap-bottom-grid  { grid-template-columns: 1fr; }
    .courses-grid { grid-template-columns: 1fr; }
    .topic-header-main { flex-direction: column; }
    .practice-problem-card { flex-direction: column; align-items: flex-start; }
    .practice-problem-right { width: 100%; }
    .theory-content { padding: 1.25rem; }
    .auth-wrap { grid-template-columns: 1fr; margin: -2.5rem -1rem -3.5rem; }
    .auth-left { display: none; }
    .auth-right { padding: 2rem 1rem; background: var(--white); }
    .auth-card { box-shadow: none; border: none; padding: 1.5rem 0; }
    .auth-row  { grid-template-columns: 1fr; }
}


/* ========== ADMIN PANEL LAYOUT & SIDEBAR ========== */
/* Админ-страницы: контент во всю ширину, без центрирующего контейнера и зазора до футера */
body.ap-page .page-content { max-width: none; margin: 0; padding: 0; min-height: calc(100vh - var(--nav-h)); }
body.ap-page .site-footer { margin-top: 0; }

.ap-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 0;
    min-height: calc(100vh - var(--nav-h));
    margin: 0;
    position: relative;
    z-index: 0;
}
.ap-sidebar {
    background: var(--blue-dark);
    position: sticky;
    top: var(--nav-h);
    height: calc(100vh - var(--nav-h));
    overflow-y: auto;
    flex-shrink: 0;
}
.ap-sidebar-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 1.25rem .75rem;
}
.ap-sidebar-label {
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: rgba(255,255,255,.3);
    padding: 0 .6rem;
    margin-bottom: .75rem;
}
.ap-nav { display: flex; flex-direction: column; gap: .15rem; flex: 1; }
.ap-nav-group { margin-top: 1rem; }
.ap-nav-group-label {
    font-size: .65rem;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: rgba(255,255,255,.25);
    padding: 0 .6rem;
    display: block;
    margin-bottom: .35rem;
}
.ap-nav-item {
    display: flex;
    align-items: center;
    gap: .55rem;
    padding: .52rem .7rem;
    border-radius: 8px;
    font-size: .88rem;
    font-weight: 500;
    color: rgba(255,255,255,.65);
    text-decoration: none;
    transition: background var(--tr), color var(--tr);
    position: relative;
}
.ap-nav-item svg { width: 15px; height: 15px; flex-shrink: 0; }
.ap-nav-item:hover { background: rgba(255,255,255,.1); color: var(--white); text-decoration: none; }
.ap-nav-item.active { background: rgba(255,255,255,.15); color: var(--white); font-weight: 600; }
.ap-nav-item--muted { color: rgba(255,255,255,.35); }
.ap-nav-item--muted:hover { color: rgba(255,255,255,.6); }
.ap-nav-badge {
    margin-left: auto;
    background: #E53E3E;
    color: #fff;
    font-size: .65rem;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}
.ap-sidebar-footer {
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid rgba(255,255,255,.1);
    display: flex;
    flex-direction: column;
    gap: .15rem;
}
.ap-main { padding: 2rem 2.25rem; min-width: 0; overflow-x: hidden; }
.ap-page-title { font-size: 1.65rem; font-weight: 700; color: var(--blue); line-height: 1.1; margin-bottom: .2rem; }
.ap-breadcrumb { font-size: .78rem; font-weight: 600; color: var(--gray-400); margin-bottom: .4rem; letter-spacing: .02em; }
.ap-breadcrumb-link { color: var(--gray-400); text-decoration: none; }
.ap-breadcrumb-link:hover { color: var(--blue); text-decoration: none; }

/* ========== ADMIN PANEL FORMS ========== */
.ap-filters {
    display: flex;
    align-items: center;
    gap: .65rem;
    flex-wrap: wrap;
    margin-bottom: 1.25rem;
    padding: .85rem 1.1rem;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}
.ap-select {
    padding: .5rem .85rem;
    border: 1.5px solid var(--gray-200);
    border-radius: 8px;
    font-family: inherit;
    font-size: .88rem;
    color: var(--gray-800);
    background: var(--white);
    cursor: pointer;
    outline: none;
    transition: border-color var(--tr);
}
.ap-select:focus { border-color: var(--blue); }
.ap-form-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 1.25rem;
    align-items: start;
}
.ap-form-main    { display: flex; flex-direction: column; gap: 1.25rem; }
.ap-form-sidebar { display: flex; flex-direction: column; gap: 1rem; }
.ap-form-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.4rem;
    box-shadow: var(--shadow);
}
.ap-form-card--info { background: var(--off-white); }
.ap-form-card-title {
    font-size: .88rem;
    font-weight: 700;
    color: var(--blue);
    margin-bottom: 1rem;
    padding-bottom: .65rem;
    border-bottom: 1.5px solid var(--gray-100);
}
.ap-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}
.ap-form-errors { margin-bottom: 1rem; }
.ap-statement-editor { font-family: 'JetBrains Mono', monospace; font-size: .88rem; line-height: 1.6; }
.ap-topics-picker { display: flex; flex-wrap: wrap; gap: .35rem; }
.ap-checkbox-label {
    display: flex;
    gap: .7rem;
    align-items: flex-start;
    cursor: pointer;
    padding: .4rem 0;
}
.ap-checkbox-label input { width: 16px; height: 16px; margin-top: 3px; flex-shrink: 0; cursor: pointer; }
.ap-checkbox-text { display: flex; flex-direction: column; gap: .1rem; }
.ap-checkbox-text strong { font-size: .9rem; color: var(--blue); }
.ap-checkbox-text small  { font-size: .76rem; color: var(--gray-400); line-height: 1.4; }
.ap-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: .35rem 0;
    border-bottom: 1px solid var(--gray-100);
    font-size: .86rem;
}
.ap-info-row:last-child { border-bottom: none; }
.ap-info-row span { color: var(--gray-400); }
.ap-info-row strong { color: var(--blue); }
.ap-form-actions { display: flex; flex-direction: column; }

/* Row actions */
.ap-row-actions { display: flex; align-items: center; gap: .35rem; justify-content: flex-end; }
.ap-row-btn {
    width: 30px; height: 30px;
    border-radius: 7px;
    border: 1.5px solid var(--gray-200);
    background: var(--white);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    color: var(--gray-400);
    text-decoration: none;
    transition: background var(--tr), border-color var(--tr), color var(--tr);
}
.ap-row-btn svg { width: 13px; height: 13px; }
.ap-row-btn--edit:hover   { background: var(--accent);  border-color: var(--accent-mid); color: var(--blue); }
.ap-row-btn--delete:hover { background: var(--red-bg);  border-color: #FCA5A5; color: var(--red); }
.ap-delete-form { display: inline; }

/* Topics layout */
.ap-topics-layout { display: flex; flex-direction: column; gap: 1.25rem; }
.ap-inline-form { display: flex; align-items: center; gap: .65rem; }

/* Stub */
.ap-stub {
    display: flex; flex-direction: column; align-items: center;
    text-align: center; padding: 5rem 2rem; gap: 1rem;
}
.ap-stub-icon { width: 72px; height: 72px; border-radius: 50%; background: var(--off-white); border: 2px solid var(--gray-200); display: flex; align-items: center; justify-content: center; }
.ap-stub-icon svg { width: 32px; height: 32px; color: var(--gray-400); }
.ap-stub h2 { font-size: 1.4rem; font-weight: 700; color: var(--blue); }
.ap-stub p  { font-size: .95rem; color: var(--gray-400); }

/* Responsive */
@media (max-width: 900px) {
    .ap-layout { grid-template-columns: 1fr; }
    .ap-sidebar { display: none; }
    .ap-main    { padding: 1.5rem 1rem; }
    .ap-form-layout { grid-template-columns: 1fr; }
    .ap-form-row    { grid-template-columns: 1fr; }
}

/* ========== ADMIN PANEL CONTESTS ========== */
.ap-date-cell { font-size: .84rem; color: var(--gray-600); white-space: nowrap; }
.ap-contest-cell { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.ap-mini-badge {
    display: inline-flex; padding: .1rem .4rem; border-radius: 20px;
    font-size: .65rem; font-weight: 700;
}
.ap-mini-badge--gold { background: #FFF8E6; color: var(--yellow); }

/* Карточки типа соревнования */
.ap-type-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: .65rem;
    grid-column: 1 / -1;
}
.ap-type-card {
    display: flex; flex-direction: column; align-items: center; gap: .4rem;
    padding: .85rem .6rem; border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-lg); cursor: pointer; text-align: center;
    transition: border-color var(--tr), background var(--tr), transform var(--tr);
    user-select: none;
}
.ap-type-card input { display: none; }
.ap-type-card:hover { border-color: var(--accent-mid); transform: translateY(-1px); }
.ap-type-card--active { border-color: var(--blue); background: var(--accent); }
.ap-type-icon {
    width: 38px; height: 38px; border-radius: 9px; margin: 0 auto;
    display: flex; align-items: center; justify-content: center;
}
.ap-type-icon svg { width: 18px; height: 18px; }
/* Название и подзаголовок — каждый на своей строке (подзаголовок под названием) */
.ap-type-name { display: block; width: 100%; font-size: .88rem; font-weight: 700; color: var(--blue); }
.ap-type-desc { display: block; width: 100%; font-size: .72rem; color: var(--gray-400); line-height: 1.3; }
@media (max-width: 600px) { .ap-type-cards { grid-template-columns: repeat(2, 1fr); } }

/* Пресеты продолжительности */
.ap-duration-presets {
    display: flex; align-items: center; gap: .4rem;
    flex-wrap: wrap; margin-top: .5rem;
}
.ap-duration-label { font-size: .78rem; color: var(--gray-400); font-weight: 500; }
.ap-duration-btn {
    padding: .22rem .65rem; border: 1.5px solid var(--gray-200);
    border-radius: 20px; background: var(--white); color: var(--blue);
    font-family: inherit; font-size: .78rem; font-weight: 600;
    cursor: pointer; transition: background var(--tr), border-color var(--tr);
}
.ap-duration-btn:hover { background: var(--accent); border-color: var(--accent-mid); }

/* Пикер задач */
.ap-form-card-title { display: flex; align-items: center; justify-content: space-between; }
.ap-selected-count {
    font-size: .78rem; font-weight: 600; color: var(--blue);
    background: var(--accent); padding: .15rem .55rem; border-radius: 20px;
    border: 1px solid var(--accent-mid);
}
.ap-problems-picker {
    display: flex; flex-direction: column; gap: .35rem;
    max-height: 380px; overflow-y: auto;
    border: 1px solid var(--gray-200); border-radius: var(--radius);
    padding: .5rem;
}
.ap-problem-pick {
    display: flex; align-items: center; gap: .65rem;
    padding: .55rem .75rem; border: 1.5px solid transparent;
    border-radius: 8px; cursor: pointer;
    transition: background var(--tr), border-color var(--tr);
    user-select: none;
}
.ap-problem-pick input { display: none; }
.ap-problem-pick:hover { background: var(--off-white); }
.ap-problem-pick--selected { background: var(--accent); border-color: var(--accent-mid); }
.ap-problem-pick-body { display: flex; align-items: center; gap: .5rem; flex: 1; min-width: 0; }
.ap-problem-pick-id    { font-family: 'JetBrains Mono', monospace; font-size: .78rem; color: var(--gray-400); flex-shrink: 0; }
.ap-problem-pick-title { font-size: .88rem; font-weight: 500; color: var(--blue); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ap-pick-check {
    width: 16px; height: 16px; flex-shrink: 0; color: var(--blue);
    opacity: 0; transition: opacity var(--tr);
}
.ap-problem-pick--selected .ap-pick-check { opacity: 1; }

/* ========== ADMIN PANEL USERS ========== */
.ap-user-stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: .75rem;
    margin-bottom: 1.25rem;
}
.ap-user-stat-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: .9rem 1rem;
    background: var(--white);
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-lg);
    text-decoration: none;
    transition: border-color var(--tr), box-shadow var(--tr);
    box-shadow: var(--shadow);
    cursor: pointer;
}
.ap-user-stat-card:hover { border-color: var(--accent-mid); box-shadow: var(--shadow-lg); text-decoration: none; }
.ap-user-stat-card.active { border-color: var(--blue); background: var(--accent); }
.ap-user-stat-num { font-size: 1.65rem; font-weight: 700; color: var(--blue); line-height: 1; font-variant-numeric: tabular-nums; }
.ap-user-stat-lbl { font-size: .76rem; color: var(--gray-400); font-weight: 500; margin-top: .2rem; }

.ap-status-dot {
    display: inline-block;
    width: 8px; height: 8px;
    border-radius: 50%;
    margin-right: .3rem;
    flex-shrink: 0;
}
.ap-status-dot--active   { background: var(--green); }
.ap-status-dot--inactive { background: var(--gray-400); }

.ap-badge--super { background: #2D3748; color: #fff; }

/* User detail */
.ap-user-detail-grid {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 1.25rem;
    align-items: start;
}
.ap-user-detail-left  { display: flex; flex-direction: column; gap: 1rem; }
.ap-user-detail-right { display: flex; flex-direction: column; gap: 1rem; }

.ap-user-profile-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 1.75rem 1.25rem;
    gap: .5rem;
}
.ap-user-big-avatar {
    width: 80px; height: 80px;
    border-radius: 50%;
    background: var(--accent);
    display: flex; align-items: center; justify-content: center;
    font-size: 2rem; font-weight: 700; color: var(--blue);
    overflow: hidden;
    border: 3px solid var(--accent-mid);
    margin-bottom: .5rem;
}
.ap-user-big-avatar img { width: 100%; height: 100%; object-fit: cover; }
.ap-user-profile-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--blue);
    display: flex;
    align-items: center;
    gap: .45rem;
    flex-wrap: wrap;
    justify-content: center;
}
.ap-user-profile-email { font-size: .82rem; color: var(--gray-400); }
.ap-user-profile-status { display: flex; align-items: center; gap: .3rem; margin-top: .25rem; }

.ap-user-actions { display: flex; flex-direction: column; gap: .5rem; }
.ap-action-btn {
    display: flex;
    align-items: center;
    gap: .55rem;
    width: 100%;
    padding: .55rem .9rem;
    border-radius: 8px;
    border: 1.5px solid var(--gray-200);
    background: var(--white);
    font-family: inherit;
    font-size: .88rem;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--tr), border-color var(--tr), color var(--tr);
    color: var(--gray-600);
}
.ap-action-btn svg { width: 15px; height: 15px; flex-shrink: 0; }
.ap-action-btn:hover { background: var(--off-white); }
.ap-action-btn--danger  { color: var(--red); border-color: #FCA5A5; }
.ap-action-btn--danger:hover  { background: var(--red-bg); }
.ap-action-btn--success { color: var(--green); border-color: #A7F3CA; }
.ap-action-btn--success:hover { background: var(--green-bg); }
.ap-action-btn--warning { color: var(--yellow); border-color: #FCD34D; }
.ap-action-btn--warning:hover { background: var(--yellow-bg); }
.ap-action-btn--info    { color: var(--blue); border-color: var(--accent-mid); }
.ap-action-btn--info:hover    { background: var(--accent); }
.ap-action-btn--muted   { color: var(--gray-400); }

/* Mini stats row */
.ap-user-stats-mini {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: .65rem;
}
.ap-user-stat-mini {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: .85rem 1rem;
    text-align: center;
    box-shadow: var(--shadow);
}
.ap-user-stat-mini--rating { background: #FFF8E6; border-color: #FCD34D; }
.ap-user-stat-mini--solved { background: var(--green-bg); border-color: #A7F3CA; }
.ap-user-stat-mini-val { font-size: 1.5rem; font-weight: 700; color: var(--blue); line-height: 1; font-variant-numeric: tabular-nums; }
.ap-user-stat-mini--rating .ap-user-stat-mini-val { color: var(--yellow); }
.ap-user-stat-mini--solved .ap-user-stat-mini-val { color: var(--green); }
.ap-user-stat-mini-lbl { font-size: .73rem; color: var(--gray-400); margin-top: .2rem; font-weight: 500; }

.ap-submissions-list { display: flex; flex-direction: column; gap: .35rem; }

@media (max-width: 900px) {
    .ap-user-stats-row  { grid-template-columns: 1fr 1fr; }
    .ap-user-detail-grid { grid-template-columns: 1fr; }
    .ap-user-stats-mini  { grid-template-columns: 1fr 1fr; }
}

/* ========== ADMIN PANEL MARATHONS ========== */
.ap-status-tabs {
    display: flex;
    gap: .35rem;
}
.ap-status-tab {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .42rem .85rem;
    border: 1.5px solid var(--gray-200);
    border-radius: 8px;
    background: var(--white);
    font-size: .84rem;
    font-weight: 600;
    color: var(--gray-400);
    text-decoration: none;
    transition: background var(--tr), border-color var(--tr), color var(--tr);
    white-space: nowrap;
}
.ap-status-tab svg { width: 13px; height: 13px; flex-shrink: 0; }
.ap-status-tab:hover { border-color: var(--blue); color: var(--blue); text-decoration: none; }
.ap-status-tab.active { background: var(--blue); border-color: var(--blue); color: var(--white); }
.ap-status-tab-badge {
    background: #E53E3E;
    color: #fff;
    font-size: .65rem;
    font-weight: 700;
    min-width: 18px; height: 18px;
    border-radius: 9px;
    display: inline-flex;
    align-items: center; justify-content: center;
    padding: 0 4px;
}
.ap-status-tab.active .ap-status-tab-badge {
    background: rgba(255,255,255,.3);
}

.marathon-row-pending { background: #FFFBF0 !important; }
.marathon-row-pending:hover { background: #FFF8E6 !important; }
.marathon-row-pending td:first-child { border-left: 3px solid var(--yellow); }

.ap-marathon-status {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    font-size: .78rem;
    font-weight: 700;
    padding: .2rem .6rem;
    border-radius: 20px;
}
.ap-marathon-status svg { width: 11px; height: 11px; }
.ap-marathon-status--done    { background: var(--green-bg); color: var(--green); }
.ap-marathon-status--pending { background: var(--yellow-bg); color: var(--yellow); }

/* Check layout */
.ap-check-layout {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 1.25rem;
    align-items: start;
}
.ap-pdf-col { min-height: 0; }
.ap-pdf-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .85rem 1.25rem;
    background: var(--off-white);
    border-bottom: 1px solid var(--gray-200);
    gap: 1rem;
    flex-wrap: wrap;
}
.ap-pdf-info {
    display: flex;
    align-items: center;
    gap: .6rem;
    font-size: .88rem;
    font-weight: 600;
    color: var(--blue);
    min-width: 0;
}
.ap-pdf-info svg { width: 16px; height: 16px; flex-shrink: 0; }
.ap-pdf-contest { font-size: .78rem; color: var(--gray-400); font-weight: 500; }
.ap-pdf-viewer { height: calc(100vh - 240px); min-height: 500px; }
.ap-pdf-viewer iframe { width: 100%; height: 100%; border: none; display: block; }

/* Check sidebar */
.ap-check-sidebar { display: flex; flex-direction: column; gap: 1rem; }

.ap-check-user {
    display: flex;
    align-items: center;
    gap: .85rem;
    margin-bottom: .5rem;
}

.ap-current-score {
    display: flex;
    align-items: baseline;
    gap: .5rem;
    margin-bottom: .75rem;
    padding: .75rem 1rem;
    background: var(--accent);
    border-radius: var(--radius);
    border: 1px solid var(--accent-mid);
}
.ap-current-score-val {
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--blue);
    line-height: 1;
    font-variant-numeric: tabular-nums;
}
.ap-current-score-lbl { font-size: .82rem; color: var(--gray-400); font-weight: 500; }

.ap-form-card--highlight { border-color: var(--accent-mid); box-shadow: 0 0 0 3px rgba(46,49,146,.07); }

.ap-score-input-wrap {
    display: flex;
    align-items: center;
    gap: .5rem;
}
.ap-score-input {
    font-size: 1.4rem !important;
    font-weight: 700 !important;
    text-align: center;
    max-width: 120px;
}
.ap-score-unit { font-size: .88rem; color: var(--gray-400); font-weight: 500; }

.ap-score-presets {
    display: flex;
    align-items: center;
    gap: .3rem;
    flex-wrap: wrap;
    margin-top: .4rem;
}
.ap-score-preset-btn {
    padding: .22rem .55rem;
    border: 1.5px solid var(--gray-200);
    border-radius: 20px;
    background: var(--white);
    font-family: inherit;
    font-size: .78rem;
    font-weight: 700;
    color: var(--gray-600);
    cursor: pointer;
    transition: background var(--tr), border-color var(--tr), color var(--tr);
    min-width: 30px;
    text-align: center;
}
.ap-score-preset-btn:hover,
.ap-score-preset-btn.active { background: var(--blue); border-color: var(--blue); color: var(--white); }

.ap-marathon-problems-list { display: flex; flex-direction: column; gap: .45rem; }
.ap-marathon-problem-item {
    display: flex;
    align-items: center;
    gap: .55rem;
    padding: .4rem .5rem;
    border-radius: 7px;
    transition: background var(--tr);
}
.ap-marathon-problem-item:hover { background: var(--off-white); }
.ap-marathon-problem-num {
    width: 22px; height: 22px;
    border-radius: 50%;
    background: var(--gray-100);
    color: var(--gray-600);
    font-size: .73rem;
    font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}

@media (max-width: 1000px) {
    .ap-check-layout { grid-template-columns: 1fr; }
    .ap-check-sidebar { order: -1; }
    .ap-pdf-viewer { height: 500px; }
}

/* ========== MARATHON TASK SCORE TABLE ========== */
.ap-tasks-score-wrap {
    overflow-x: auto;
    border-radius: var(--radius);
    border: 1.5px solid var(--accent-mid);
    margin-bottom: .75rem;
}
.ap-tasks-score-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .84rem;
}
.ap-tasks-score-table th {
    background: var(--blue);
    color: var(--white);
    padding: .45rem .3rem;
    text-align: center;
    font-weight: 700;
    font-size: .78rem;
    white-space: nowrap;
    min-width: 36px;
}
.ap-tasks-score-table th.ap-ts-lbl {
    text-align: left;
    padding-left: .75rem;
    min-width: 64px;
    background: var(--blue-dark);
}
.ap-tasks-score-table td {
    padding: .4rem .25rem;
    text-align: center;
    border: none;
    vertical-align: middle;
}
.ap-tasks-score-table td.ap-ts-lbl {
    text-align: left;
    padding-left: .75rem;
    font-size: .78rem;
    font-weight: 600;
    color: var(--gray-600);
    background: var(--off-white);
    border-right: 1px solid var(--gray-200);
}
.ap-task-score-input {
    width: 38px;
    height: 38px;
    text-align: center;
    font-size: 1.1rem !important;
    font-weight: 700 !important;
    padding: .2rem .1rem !important;
    border: 1.5px solid var(--gray-200);
    border-radius: 7px;
    outline: none;
    transition: border-color var(--tr), background var(--tr);
    -moz-appearance: textfield;
    appearance: textfield;
}
.ap-task-score-input::-webkit-outer-spin-button,
.ap-task-score-input::-webkit-inner-spin-button { -webkit-appearance: none; }
.ap-task-score-input:focus  { border-color: var(--blue); background: var(--accent); }
.ap-task-score-input.score-max  { border-color: var(--green); background: var(--green-bg); color: var(--green); }
.ap-task-score-input.score-zero { border-color: var(--gray-200); color: var(--gray-400); }

.ap-score-total-row {
    display: flex;
    align-items: baseline;
    gap: .5rem;
    padding: .6rem .85rem;
    background: var(--accent);
    border-radius: var(--radius);
    border: 1px solid var(--accent-mid);
    margin-bottom: .5rem;
}
.ap-score-total-lbl { font-size: .86rem; font-weight: 600; color: var(--gray-600); }
.ap-score-total-val { font-size: 1.9rem; font-weight: 700; color: var(--blue); line-height: 1; font-variant-numeric: tabular-nums; transition: color .3s ease; }

/* PDF fallback */
.ap-pdf-fallback {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    height: 100%;
    min-height: 400px;
    padding: 2rem;
    text-align: center;
    color: var(--gray-400);
    font-size: .95rem;
}
.ap-pdf-fallback a { min-width: 180px; justify-content: center; }

/* ========== ADMIN PANEL COURSES ========== */
.ap-course-topics-list { display: flex; flex-direction: column; gap: .5rem; }
.ap-course-topic-row {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .75rem 1rem;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    transition: border-color var(--tr);
}
.ap-course-topic-row:hover { border-color: var(--accent-mid); }
.ap-course-topic-order {
    width: 28px; height: 28px;
    border-radius: 8px;
    background: var(--blue);
    color: var(--white);
    font-size: .8rem;
    font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.ap-course-topic-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .1rem; }
.ap-course-topic-title { font-size: .92rem; font-weight: 600; }
.ap-course-topic-meta  { font-size: .75rem; color: var(--gray-400); }
.ap-course-topic-actions { display: flex; align-items: center; gap: .3rem; flex-shrink: 0; }
.ap-course-topic-actions button:disabled { opacity: .35; cursor: not-allowed; }

/* Topic edit layout */
.ap-topic-edit-layout {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 1.25rem;
    align-items: start;
}
.ap-topic-edit-main    { display: flex; flex-direction: column; gap: 1.25rem; }
.ap-topic-edit-sidebar { display: flex; flex-direction: column; gap: 1rem; }

/* Practice list */
.ap-course-practice-list { display: flex; flex-direction: column; gap: .4rem; margin-bottom: .75rem; }
.ap-practice-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .65rem;
    padding: .5rem .6rem;
    border-radius: 8px;
    border: 1px solid var(--gray-100);
    transition: background var(--tr);
}
.ap-practice-item:hover { background: var(--off-white); }
.ap-practice-item-info { display: flex; align-items: center; gap: .55rem; flex: 1; min-width: 0; }
.ap-practice-num {
    width: 22px; height: 22px;
    border-radius: 50%;
    background: var(--blue);
    color: var(--white);
    font-size: .72rem;
    font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.ap-practice-body { display: flex; flex-direction: column; gap: .1rem; min-width: 0; }

@media (max-width: 1000px) {
    .ap-topic-edit-layout { grid-template-columns: 1fr; }
}

/* ========== STATS ========== */
.ap-stats-topic-row {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .35rem .5rem;
    border-radius: 7px;
    transition: background var(--tr);
}
.ap-stats-topic-row:hover { background: var(--off-white); }
.ap-stats-topic-nums {
    display: flex;
    align-items: center;
    gap: .2rem;
    font-size: .82rem;
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
    min-width: 60px;
}
.ap-stats-sep { color: var(--gray-200); font-weight: 300; }

/* Fix SVG sizes in stats and card titles */
.ap-card-title svg { width: 16px; height: 16px; flex-shrink: 0; }
.ap-card-title { display: flex; align-items: center; gap: .5rem;
    font-size: .92rem; font-weight: 700; color: var(--blue);
    margin-bottom: .85rem; padding-bottom: .65rem;
    border-bottom: 1.5px solid var(--gray-100); }
.ap-stats-grid .ap-stat-icon svg { width: 22px; height: 22px; }

/* Global SVG size guard - prevent SVG from stretching inside buttons and links */
.btn svg, .btn-secondary svg, .ap-action-btn svg,
.answer-submit-btn svg, button svg {
    width: 16px; height: 16px; flex-shrink: 0;
}
/* Stats page section title SVG */
.ap-section-title svg { width: 14px !important; height: 14px !important; }

/* ========== ЛЕНДИНГ PRIME MATH ========== */
/* Главная-лендинг занимает всю ширину: внутренние секции сами центрируют контент */
body.landing-page .page-content { max-width: none; padding: 0; }
body.landing-page .site-footer { margin-top: 0; }

.pm-wrap { max-width: 1200px; margin: 0 auto; padding: 0 1.5rem; }
.pm-section { padding: 3.5rem 0; }
.pm-section--tight { padding: 2.25rem 0; }

/* Мини-заголовок секции: без подложки, основным шрифтом сайта */
.pm-eyebrow {
    display: inline-flex; align-items: center; gap: .5rem;
    font-size: .82rem; font-weight: 700;
    letter-spacing: .09em; text-transform: uppercase; color: var(--violet);
}
.pm-section-head { max-width: 640px; margin-bottom: 2rem; }
.pm-section-head .pm-eyebrow { margin-bottom: .9rem; }
.pm-section-head h2 { font-size: clamp(1.7rem, 3.4vw, 2.4rem); font-weight: 700; line-height: 1.2; color: var(--blue-dark); }
.pm-section-head p { margin-top: .8rem; font-size: 1rem; line-height: 1.65; color: var(--gray-600); }

/* ── HERO ── */
.pm-hero { position: relative; overflow: hidden; padding: 3.25rem 0 2.25rem; }
.pm-hero-inner { display: grid; grid-template-columns: 1.1fr .9fr; gap: 3rem; align-items: center; }
/* Название школы: градиент в тёмно-фиолетовых тонах (закрашивает текст) */
.pm-hero-title {
    font-size: clamp(3rem, 7vw, 5.2rem); font-weight: 700; line-height: 1.05;
    letter-spacing: -.02em; margin: 1rem 0 0;
    background: linear-gradient(120deg, #2E3192 0%, #5B21B6 55%, #7C3AED 100%);
    -webkit-background-clip: text; background-clip: text; color: transparent;
    width: fit-content;
}
.pm-hero-sub {
    margin-top: 1.4rem; font-size: 1.08rem; line-height: 1.7; color: var(--gray-600);
    max-width: 56ch; text-align: justify; text-wrap: pretty; hyphens: auto;
}
.pm-hero-actions { display: flex; gap: .85rem; margin-top: 2rem; flex-wrap: wrap; }

/* Анимация «треугольник в окружности» (построение циркулем и линейкой) */
.pm-hero-figure {
    position: relative; aspect-ratio: 1 / 1; max-width: 460px; justify-self: center; width: 100%;
    transform: translateY(-1.75rem); /* приподнята относительно текстовой колонки */
}
.pm-hero-figure svg { width: 100%; height: 100%; display: block; }
.construction-line {
    fill: none; stroke: var(--blue-dark); stroke-width: 1.6; stroke-linecap: round;
    stroke-dasharray: 1000; stroke-dashoffset: 1000;
    animation: pmDraw 2.6s ease forwards;
}
.construction-line.delay1 { animation-delay: .3s; }
.construction-line.delay2 { animation-delay: .9s; }
.construction-line.delay3 { animation-delay: 1.4s; }
.construction-dash {
    fill: none; stroke: var(--violet); stroke-width: 1.4; stroke-dasharray: 4 6;
    opacity: 0; animation: pmFadeIn 1s ease forwards; animation-delay: 1.8s;
}
.construction-dot { fill: var(--violet); opacity: 0; animation: pmFadeIn .6s ease forwards; animation-delay: 2.1s; }
@keyframes pmDraw { to { stroke-dashoffset: 0; } }
@keyframes pmFadeIn { to { opacity: 1; } }
/* Описанная окружность вращается по часовой, вписанная — против */
.orbit     { animation: pmSpin 60s linear infinite;    transform-origin: center; transform-box: fill-box; }
.orbit-rev { animation: pmSpinRev 45s linear infinite; transform-origin: center; transform-box: fill-box; }
@keyframes pmSpin    { to { transform: rotate(360deg); } }
@keyframes pmSpinRev { to { transform: rotate(-360deg); } }

/* ── Цифры школы: бегущая строка ── */
.pm-marquee {
    background: var(--blue-dark);
    border-top: 1px solid rgba(255,255,255,.08);
    border-bottom: 1px solid rgba(255,255,255,.08);
    overflow: hidden; padding: 1.5rem 0;
}
/* Трек = две одинаковые группы; сдвиг на половину ширины даёт бесшовный цикл.
   Пауза при наведении намеренно не ставится — строка не должна останавливаться. */
.pm-marquee-track { display: flex; width: max-content; animation: pmMarquee 38s linear infinite; }
.pm-marquee-group { display: flex; align-items: center; flex-shrink: 0; }
.pm-marquee-item {
    display: inline-flex; align-items: baseline; gap: .45rem; white-space: nowrap; padding: 0 1.5rem;
    font-family: 'JetBrains Mono', monospace; font-size: .78rem; font-weight: 500;
    text-transform: uppercase; letter-spacing: .07em; color: var(--gray-400);
}
.pm-marquee-item b { color: var(--accent-mid); font-weight: 700; font-size: .9rem; }
.pm-marquee-sep { color: var(--violet); font-size: .62rem; line-height: 1; }
@keyframes pmMarquee { to { transform: translateX(-50%); } }

/* ── Три формата обучения ── */
/* Форматы и «Ближайшие игры» — смежные блоки, между ними компактный отступ */
#formats { padding-bottom: 1.75rem; }
#formats + .pm-section--tight { padding-top: .75rem; }
.pm-pillars { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2rem; }
.pm-pillar-card {
    background: var(--white); border: 1.5px solid var(--blue-dark); border-radius: var(--radius-lg);
    padding: 1.9rem 1.6rem; position: relative; display: flex; flex-direction: column;
    transition: transform var(--tr), box-shadow var(--tr);
}
.pm-pillar-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.pm-pillar-tag {
    font-family: 'JetBrains Mono', monospace; font-size: .68rem; letter-spacing: .05em; text-transform: uppercase;
    color: var(--violet); border: 1px solid var(--violet); border-radius: 20px;
    padding: .2rem .7rem; display: inline-block; margin-bottom: 1.1rem; align-self: flex-start;
}
.pm-pillar-card h3 { font-size: 1.25rem; font-weight: 700; color: var(--blue-dark); margin-bottom: .6rem; }
.pm-pillar-card p { font-size: .92rem; line-height: 1.6; color: var(--gray-600); flex: 1; }
.pm-pillar-link { display: inline-flex; align-items: center; gap: .35rem; margin-top: 1.2rem; font-size: .88rem; font-weight: 700; color: var(--violet); text-decoration: none; }
.pm-pillar-link:hover { text-decoration: none; gap: .55rem; }
.pm-pillar-link { transition: gap var(--tr); }

/* ── Тёмные секции (индиго + меловая клетка) ── */
.pm-dark {
    background-color: var(--blue-dark);
    background-image:
        linear-gradient(to right, rgba(246,247,252,.05) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(246,247,252,.05) 1px, transparent 1px);
    background-size: 32px 32px;
    color: var(--off-white);
}
.pm-dark .pm-section-head h2 { color: var(--white); }
.pm-dark .pm-section-head p { color: rgba(246,247,252,.66); }
.pm-dark .pm-eyebrow { color: #FDD883; }

/* ── Бесплатные материалы ── */
.pm-materials-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 1.4rem; }
.pm-material-card {
    background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.14);
    border-radius: var(--radius-lg); padding: 1.75rem;
}
.pm-material-card h3 { font-size: 1.25rem; font-weight: 700; color: var(--white); margin-bottom: .6rem; }
.pm-material-card p { font-size: .92rem; line-height: 1.6; color: rgba(246,247,252,.66); }
.pm-material-card--featured { display: flex; flex-direction: column; justify-content: space-between; }
.pm-material-btn { align-self: flex-start; margin-top: 1.5rem; }

.pm-lecture-list { margin-top: 1.25rem; list-style: none; padding: 0; }
.pm-lecture-list li {
    display: flex; align-items: center; gap: .9rem; padding: .75rem 0;
    border-top: 1px solid rgba(246,247,252,.12); font-size: .9rem;
}
.pm-lecture-list li:first-child { border-top: none; }
.pm-lecture-index { font-family: 'JetBrains Mono', monospace; font-size: .78rem; color: var(--medal); flex: none; width: 14px; }
.pm-lecture-topic { color: var(--off-white); }
.pm-lecture-meta  { margin-left: auto; font-family: 'JetBrains Mono', monospace; font-size: .72rem; color: rgba(246,247,252,.55); flex: none; }

/* Промо-ролик и его заглушка */
.pm-promo-video { margin-top: 1.1rem; border-color: rgba(255,255,255,.18); }
.pm-promo-placeholder {
    margin-top: 1.1rem; padding: 1.6rem 1.25rem; text-align: center;
    border: 1.5px dashed rgba(255,255,255,.28); border-radius: var(--radius);
    background: rgba(0,0,0,.18); display: flex; flex-direction: column; align-items: center; gap: .5rem;
}
.pm-promo-placeholder svg { width: 34px; height: 34px; color: var(--medal); }
.pm-promo-placeholder-title { font-size: .95rem; font-weight: 700; color: var(--white); }
.pm-promo-placeholder small { font-size: .76rem; line-height: 1.5; color: rgba(246,247,252,.5); max-width: 34ch; }
.pm-promo-placeholder code { font-family: 'JetBrains Mono', monospace; font-size: .92em; color: var(--accent-mid); }

/* ── Курсы (промо-карточки) ── */
.pm-courses-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2rem; }
.pm-course-card { border: 1.5px solid var(--blue-dark); border-radius: var(--radius-lg); overflow: hidden; background: var(--white); display: flex; flex-direction: column; }
.pm-course-head { padding: 1.4rem 1.5rem 1.1rem; border-bottom: 1.5px dashed var(--gray-400); display: flex; justify-content: space-between; align-items: flex-start; gap: .5rem; }
.pm-course-grade { font-family: 'JetBrains Mono', monospace; font-size: .78rem; color: var(--gray-600); }
/* Заголовок курса держим в одну строку на любой ширине карточки */
.pm-course-head h3 {
    font-size: clamp(1.1rem, 1.6vw, 1.35rem); font-weight: 700; color: var(--blue-dark);
    margin-top: .3rem; white-space: nowrap;
}
.pm-course-num { font-size: 1.9rem; font-weight: 700; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; line-height: 1; }
.pm-course-body { padding: 1.2rem 1.5rem 1.5rem; flex: 1; display: flex; flex-direction: column; }
.pm-course-topics { margin-bottom: 1.2rem; }
.pm-course-topics li { font-size: .88rem; line-height: 1.5; padding: .45rem 0 .45rem 1.25rem; position: relative; color: var(--gray-600); border-top: 1px solid var(--gray-100); list-style: none; }
.pm-course-topics li:first-child { border-top: none; }
.pm-course-topics li::before { content: ""; position: absolute; left: 0; top: .85rem; width: 8px; height: 8px; border: 1.5px solid var(--violet); border-radius: 50%; }
.pm-course-meta { font-family: 'JetBrains Mono', monospace; font-size: .74rem; color: var(--gray-400); margin-bottom: 1.2rem; display: flex; flex-direction: column; gap: .3rem; }
.pm-course-card .btn { margin-top: auto; justify-content: center; }

/* ── Преподаватели ── */
.pm-teachers-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2rem; }
.pm-teacher-card { border: 1.5px dashed var(--accent-mid); border-radius: var(--radius-lg); padding: 1.6rem; background: var(--off-white); }
.pm-teacher-avatar {
    width: 56px; height: 56px; border-radius: 50%; background: var(--grad);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.15rem; font-weight: 700; color: var(--white); margin-bottom: 1rem;
}
.pm-teacher-card h4 { font-size: 1.05rem; font-weight: 700; color: var(--blue-dark); }
.pm-teacher-achievement {
    display: inline-block; font-size: .72rem; font-weight: 700; color: #8A6207;
    background: rgba(244,183,64,.18); border-radius: 20px; padding: .18rem .6rem; margin-top: .45rem;
}
.pm-teacher-card p { font-size: .86rem; line-height: 1.55; color: var(--gray-600); margin-top: .8rem; }
.pm-placeholder-note { font-family: 'JetBrains Mono', monospace; font-size: .68rem; color: var(--violet); margin-top: .9rem; display: block; }

/* ── Отзывы ── */
.pm-testimonials-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2rem; }
.pm-testimonial-card { background: var(--white); border: 1px solid var(--gray-200); border-radius: var(--radius-lg); padding: 1.6rem; box-shadow: var(--shadow); }
.pm-testimonial-mark { font-size: 2.4rem; line-height: 1; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; display: block; margin-bottom: .4rem; font-weight: 700; }
.pm-testimonial-card .pm-quote { font-size: .92rem; line-height: 1.6; color: var(--gray-600); }
.pm-testimonial-attr { display: block; margin-top: 1rem; font-family: 'JetBrains Mono', monospace; font-size: .72rem; color: var(--violet); }

/* ── FAQ ── */
.pm-faq-list { max-width: 760px; }
.pm-faq-item { border-top: 1px solid var(--gray-200); }
.pm-faq-item:last-child { border-bottom: 1px solid var(--gray-200); }
.pm-faq-q {
    width: 100%; text-align: left; background: none; border: none; padding: 1.15rem 0;
    display: flex; justify-content: space-between; align-items: center; gap: 1.2rem;
    font-family: inherit; font-size: 1rem; font-weight: 600; cursor: pointer; color: var(--blue-dark);
}
.pm-faq-q .pm-plus { font-family: 'JetBrains Mono', monospace; font-size: 1.25rem; color: var(--violet); transition: transform var(--tr); flex-shrink: 0; }
.pm-faq-item.open .pm-plus { transform: rotate(45deg); }
.pm-faq-a { max-height: 0; overflow: hidden; transition: max-height .25s ease; }
.pm-faq-a p { font-size: .92rem; line-height: 1.65; color: var(--gray-600); padding-bottom: 1.15rem; max-width: 62ch; }

/* ── Финальный CTA ── */
.pm-cta { text-align: center; padding: 4rem 0; }
.pm-cta h2 { font-size: clamp(1.9rem, 4vw, 2.8rem); font-weight: 700; color: var(--white); max-width: 20ch; margin: 1.2rem auto 0; line-height: 1.2; }
.pm-cta p { margin: 1rem auto 0; font-size: 1rem; color: rgba(246,247,252,.66); max-width: 46ch; }
.pm-cta .pm-hero-actions { justify-content: center; margin-top: 2.2rem; }
.btn--light { background: var(--white); color: var(--blue-dark); }
.btn--light:hover { filter: none; background: var(--off-white); }

/* ── Появление при скролле ── */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity .6s ease, transform .6s ease; }
.reveal.is-visible { opacity: 1; transform: translateY(0); }

@media (prefers-reduced-motion: reduce) {
    .construction-line, .construction-dash, .construction-dot {
        animation: none !important; stroke-dashoffset: 0 !important; opacity: 1 !important;
    }
    .orbit, .orbit-rev, .pm-marquee-track { animation: none !important; }
    .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
    html { scroll-behavior: auto !important; }
}

@media (max-width: 900px) {
    .pm-hero-inner { grid-template-columns: 1fr; }
    .pm-hero-figure { max-width: 340px; transform: none; }
    .pm-pillars, .pm-courses-grid, .pm-teachers-grid, .pm-testimonials-grid,
    .pm-materials-grid { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
    .pm-section { padding: 2.5rem 0; }
    .pm-hero { padding: 2.5rem 0 1.75rem; }
    .pm-hero-sub { text-align: left; }
    .pm-hero-actions .btn, .pm-hero-actions .btn-secondary { width: 100%; justify-content: center; }
}
